/* ============================================================
   bada.cafe — v1
   Retro-coastal · bento · duotone · condensed
   ============================================================ */

:root {
    --ink: #0B2A4A;
    --paper: #F2ECD8;
    --tide: #E86A4C;
    --ink-60: rgba(11, 42, 74, 0.6);
    --ink-30: rgba(11, 42, 74, 0.28);
    --ink-12: rgba(11, 42, 74, 0.12);
    --paper-80: rgba(242, 236, 216, 0.82);

    --font-display: 'Archivo Narrow', 'Bebas Neue', 'Inter', sans-serif;
    --font-body: 'Inter', 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Sans', 'Inter', monospace;

    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 64px;
    --s-9: 96px;

    --dur-fast: 200ms;
    --dur: 320ms;
    --dur-slow: 420ms;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

    --border: 1px solid var(--ink);
    --hairline: 1px solid var(--ink);
    --radius: 0;

    --max: 1320px;
    --pad-x: clamp(20px, 4vw, 56px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ============================================================
   Typography
   ============================================================ */

.display {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 0.92;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--ink);
}

.display--xl {
    font-size: clamp(3rem, 8vw, 6.5rem);
    display: flex;
    flex-direction: column;
    gap: 0.05em;
}

.display--l {
    font-size: clamp(2.2rem, 5.2vw, 4.2rem);
}

.display--m {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    letter-spacing: -0.005em;
}

.display-line--accent {
    color: var(--tide);
}

.display-line {
    display: block;
}

.cell-label {
    font-family: var(--font-display);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-60);
    font-weight: 500;
}

.cell-body, .section-lede, .story-body, .menu-note {
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--ink);
}

.section-lede {
    max-width: 56ch;
    color: var(--ink-60);
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--paper);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 var(--pad-x);
    max-width: var(--max);
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--font-display);
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.brand-mark {
    display: inline-flex;
    color: var(--ink);
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.5vw, 28px);
}

.nav-link {
    position: relative;
    font-family: var(--font-display);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 8px 2px;
    color: var(--ink);
    font-weight: 500;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 4px;
    height: 1.5px;
    background: var(--tide);
    transition: right var(--dur-fast) var(--ease);
}

.nav-link:hover::after {
    right: 0;
}

.lang-toggle {
    border: var(--hairline);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
}

.lang-toggle.is-active {
    background: var(--ink);
    color: var(--paper);
}

.horizon-line {
    height: 1px;
    background: var(--ink);
    width: 100%;
}

/* ============================================================
   Sections + Bento Grid
   ============================================================ */

main {
    display: block;
}

.section {
    padding: clamp(40px, 6vw, 80px) var(--pad-x);
    max-width: var(--max);
    margin: 0 auto;
    border-bottom: var(--hairline);
}

.section:last-child {
    border-bottom: 0;
}

.section-head {
    margin-bottom: var(--s-7);
    display: grid;
    gap: var(--s-3);
    max-width: 980px;
}

.section-num {
    display: inline-block;
}

.bento {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(180px, auto);
    border: var(--hairline);
    background: var(--paper);
}

.bento--hero {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: minmax(280px, auto) minmax(220px, auto);
}

.bento--menu {
    grid-template-columns: repeat(6, 1fr);
    list-style: none;
}

.bento--menu > li {
    grid-column: span 2;
    display: flex;
}

.bento--story {
    grid-template-columns: repeat(12, 1fr);
}

.bento--visit {
    grid-template-columns: repeat(12, 1fr);
}

/* ============================================================
   Cell — printed-panel base
   ============================================================ */

.cell {
    position: relative;
    grid-column: span 4;
    padding: clamp(20px, 2.4vw, 32px);
    border-right: var(--hairline);
    border-bottom: var(--hairline);
    background: var(--paper);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    overflow: hidden;
    isolation: isolate;
    cursor: pointer;
    transition: background var(--dur) var(--ease);
    container-type: inline-size;
}

.cell:last-child,
.cell:nth-last-child(2):nth-child(odd) {
    /* let JS-free fallback be fine; visual outer border handled via container */
}

.bento > .cell:last-child { border-right: 0; }
.bento--menu > li:nth-child(3n) .cell { border-right: 0; }
.bento--menu > li:nth-last-child(-n+3) .cell { border-bottom: 0; }

.bento--hero .cell--hero { grid-column: span 7; grid-row: span 2; }
.bento--hero .cell--wave { grid-column: span 5; grid-row: span 1; }
.bento--hero .cell--hours { grid-column: span 5; grid-row: span 1; border-bottom: 0; }
.bento--hero .cell--hero { border-bottom: 0; }

.bento--story .cell--story-main { grid-column: span 6; }
.bento--story .cell--postcard { grid-column: span 4; }
.bento--story .cell--quote { grid-column: span 2; border-right: 0; }
.bento--story .cell { border-bottom: 0; }

.bento--visit .cell--map { grid-column: span 7; }
.bento--visit .cell--address { grid-column: span 3; }
.bento--visit .cell--contact { grid-column: span 2; border-right: 0; }
.bento--visit .cell { border-bottom: 0; }

.cell:hover {
    background: color-mix(in oklab, var(--paper) 92%, var(--ink) 8%);
}

.cell-inner {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    z-index: 2;
    position: relative;
}

.cell-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
}

.cell-art--hero {
    inset: auto 0 0 0;
    height: 60%;
    opacity: 1;
}

.cell-art--wave,
.cell-art--hours,
.cell-art--menu {
    position: absolute;
    width: 60%;
    height: 60%;
    bottom: -10%;
    right: -10%;
    opacity: 0.95;
}

.cell-art svg {
    width: 100%;
    height: 100%;
}

.art-blur {
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
    filter: blur(18px);
}

.art-sharp {
    transition: stroke var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.cell:hover .art-blur {
    filter: blur(0);
    transform: scale(1.04);
}

.cell:hover .art-sharp {
    stroke: var(--tide);
}

/* ============================================================
   Hero cell content
   ============================================================ */

.cell--hero {
    min-height: clamp(420px, 60vh, 640px);
    justify-content: space-between;
}

.cell--hero .display--xl {
    margin-top: var(--s-4);
}

/* CTA */
.cta {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    align-self: flex-start;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.82rem;
    padding: 14px 18px 14px 14px;
    border: var(--hairline);
    color: var(--ink);
    background: transparent;
    transition: color var(--dur-fast) var(--ease);
    min-height: 48px;
    z-index: 3;
    position: relative;
}

.cta-mark {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tide);
    transform: translateX(-8px);
    opacity: 0;
    transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}

.cta:hover .cta-mark {
    transform: translateX(0);
    opacity: 1;
}

.cta:hover {
    background: var(--ink);
    color: var(--paper);
}

/* ============================================================
   Today's Wave
   ============================================================ */

.cell--wave {
    background: var(--ink);
    color: var(--paper);
    border-bottom: var(--hairline);
}

.cell--wave .cell-label { color: var(--paper-80); }

.wave-content {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    z-index: 2;
    position: relative;
}

.wave-state {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1;
    color: var(--paper);
    letter-spacing: -0.005em;
    text-transform: uppercase;
    transition: opacity var(--dur) var(--ease);
}

.wave-state.is-fading { opacity: 0; }

.wave-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    font-size: 0.85rem;
    color: var(--paper-80);
}

.wave-meta-row {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.wave-key {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.7rem;
    color: var(--paper-80);
}

.wave-val {
    color: var(--paper);
    font-variant-numeric: tabular-nums;
}

.cell--wave .art-blur,
.cell--wave .art-sharp {
    stroke: var(--paper);
}

.cell--wave svg circle[stroke="#0B2A4A"] { stroke: var(--paper); }
.cell--wave .art-blur { fill: var(--tide); }

.cell--wave:hover {
    background: color-mix(in oklab, var(--ink) 92%, var(--tide) 8%);
}

.cell--wave:hover .art-sharp {
    stroke: var(--tide);
}

.tide-rings circle {
    transform-origin: 100px 100px;
    transform-box: fill-box;
}

/* ============================================================
   Hours
   ============================================================ */

.hours-list {
    display: grid;
    gap: 8px;
    z-index: 2;
    position: relative;
}

.hours-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px dashed var(--ink-30);
    padding: 6px 0;
    font-variant-numeric: tabular-nums;
}

.hours-row dt {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.85rem;
}

.hours-row dd {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.04em;
}

.hours-row--off dd {
    color: var(--tide);
}

/* ============================================================
   Menu cells
   ============================================================ */

.cell--menu {
    min-height: 240px;
    gap: var(--s-2);
    grid-column: auto;
    width: 100%;
}

.menu-jp {
    color: var(--ink-60);
    font-size: 0.92rem;
    margin-top: -4px;
}

.menu-note {
    font-size: 0.95rem;
    color: var(--ink);
    max-width: 32ch;
}

.menu-price {
    margin-top: auto;
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    color: var(--ink);
    border-top: 1px dashed var(--ink-30);
    padding-top: 10px;
    z-index: 2;
    position: relative;
}

/* ============================================================
   Story
   ============================================================ */

.story-body {
    max-width: 56ch;
    z-index: 2;
    position: relative;
}

.cell--postcard {
    background: color-mix(in oklab, var(--paper) 96%, var(--ink) 4%);
    padding: 18px;
}

.postcard {
    border: var(--hairline);
    background: var(--paper);
    padding: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.postcard-art {
    flex: 1;
    border-bottom: 1px dashed var(--ink-30);
    overflow: hidden;
}

.postcard-art svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.postcard-stamp {
    font-family: var(--font-display);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--ink);
    text-align: center;
}

.cell--quote {
    background: var(--tide);
    color: var(--paper);
    border-bottom: var(--hairline);
}

.cell--quote .cell-label {
    color: var(--paper-80);
}

.pull-quote {
    z-index: 2;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.pull-quote p {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 1.6vw, 1.5rem);
    line-height: 1.1;
    color: var(--paper);
    letter-spacing: -0.005em;
}

.pull-quote cite {
    font-style: normal;
    font-size: 0.78rem;
    color: var(--paper-80);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-family: var(--font-display);
}

/* ============================================================
   Visit
   ============================================================ */

.cell--map {
    padding: 0;
    overflow: hidden;
    min-height: 320px;
    position: relative;
}

.cell--map .cell-label {
    position: absolute;
    top: 16px;
    left: 18px;
    z-index: 3;
    background: var(--paper);
    padding: 4px 8px;
    border: var(--hairline);
}

.map-art {
    position: absolute;
    inset: 0;
}

.map-art svg {
    width: 100%;
    height: 100%;
}

.map-pin-blur {
    transform-origin: 220px 148px;
    transform-box: fill-box;
    animation: pin-pulse 4s var(--ease) infinite;
}

@keyframes pin-pulse {
    0%, 100% { opacity: 0.28; transform: scale(1); }
    50% { opacity: 0.12; transform: scale(1.6); }
}

.visit-address {
    font-style: normal;
    display: grid;
    gap: 4px;
    line-height: 1.45;
    z-index: 2;
    position: relative;
}

.contact-list {
    list-style: none;
    display: grid;
    gap: 10px;
    z-index: 2;
    position: relative;
    font-size: 0.95rem;
}

.contact-list li {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    align-items: baseline;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--ink-30);
}

.contact-key {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: var(--ink-60);
}

.contact-val {
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    background: var(--paper);
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: var(--s-7) var(--pad-x) var(--s-6);
    display: grid;
    gap: var(--s-3);
    text-align: center;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 5rem);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 1;
    color: var(--ink);
}

.footer-meta, .footer-colophon {
    font-size: 0.85rem;
    color: var(--ink-60);
    letter-spacing: 0.04em;
}

.footer-colophon {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ============================================================
   Cell expand dialog
   ============================================================ */

.cell-dialog {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-5);
}

.cell-dialog[hidden] {
    display: none;
}

.cell-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: var(--paper-80);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.cell-dialog-panel {
    position: relative;
    width: min(680px, 100%);
    max-height: 86vh;
    overflow: auto;
    background: var(--paper);
    border: var(--hairline);
    padding: clamp(24px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    transform-origin: center;
    animation: dialog-in var(--dur-slow) var(--ease) both;
}

@keyframes dialog-in {
    0% { opacity: 0; transform: translateY(12px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.cell-dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: var(--hairline);
    background: var(--paper);
}

.cell-dialog-close:hover {
    background: var(--ink);
    color: var(--paper);
}

.cell-dialog-body {
    font-size: 1rem;
    line-height: 1.6;
    display: grid;
    gap: var(--s-3);
}

.cell-dialog-body p { margin: 0; }
.cell-dialog-body strong {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

/* ============================================================
   Reveal on scroll
   ============================================================ */

.cell {
    opacity: 1;
    transform: none;
}

.cell.is-staggered {
    opacity: 0;
    transform: translateY(12px);
}

.cell.is-revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
    .bento--hero .cell--hero { grid-column: span 12; grid-row: span 1; border-right: 0; }
    .bento--hero .cell--wave { grid-column: span 7; }
    .bento--hero .cell--hours { grid-column: span 5; }

    .bento--menu { grid-template-columns: repeat(4, 1fr); }
    .bento--menu > li { grid-column: span 2; }
    .bento--menu > li:nth-child(3n) .cell { border-right: var(--hairline); }
    .bento--menu > li:nth-child(2n) .cell { border-right: 0; }
    .bento--menu > li:nth-last-child(-n+3) .cell { border-bottom: var(--hairline); }
    .bento--menu > li:nth-last-child(-n+2) .cell { border-bottom: 0; }

    .bento--story .cell--story-main { grid-column: span 12; border-right: 0; }
    .bento--story .cell--postcard { grid-column: span 7; }
    .bento--story .cell--quote { grid-column: span 5; border-right: 0; }

    .bento--visit .cell--map { grid-column: span 12; min-height: 280px; border-right: 0; }
    .bento--visit .cell--address { grid-column: span 7; }
    .bento--visit .cell--contact { grid-column: span 5; border-right: 0; }
}

@media (max-width: 640px) {
    .header-inner { height: 52px; }
    .brand-name { font-size: 0.95rem; }
    .nav-link { font-size: 0.78rem; letter-spacing: 0.12em; }

    .bento--hero { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
    .bento--hero .cell { grid-column: 1 / -1 !important; grid-row: auto !important; border-right: 0 !important; }
    .bento--hero .cell--hours { border-bottom: 0; }

    .bento--menu { grid-template-columns: 1fr; }
    .bento--menu > li { grid-column: 1 / -1; }
    .bento--menu > li .cell { border-right: 0 !important; border-bottom: var(--hairline) !important; }
    .bento--menu > li:last-child .cell { border-bottom: 0 !important; }

    .bento--story { grid-template-columns: 1fr; }
    .bento--story .cell { grid-column: 1 / -1 !important; border-right: 0 !important; border-bottom: var(--hairline) !important; }
    .bento--story .cell:last-child { border-bottom: 0 !important; }

    .bento--visit { grid-template-columns: 1fr; }
    .bento--visit .cell { grid-column: 1 / -1 !important; border-right: 0 !important; border-bottom: var(--hairline) !important; }
    .bento--visit .cell:last-child { border-bottom: 0 !important; }

    .cell--hero { min-height: 480px; }
    .cell-art--hero { height: 50%; }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .cell.is-staggered { transform: none; }
}
