/* Yomi — "golden-hour wayfinding". Warm near-black surface, brand amber, one amber
   drench. Archivo carries everything; its width axis does the display/body contrast. */
:root {
  --bg: oklch(0.19 0.012 70);          /* #17130D warm near-black */
  --bg-raised: oklch(0.23 0.014 70);
  --line: oklch(0.34 0.02 70);
  --ink: oklch(0.95 0.014 78);
  --muted: oklch(0.80 0.02 72);        /* ≥ 7:1 on --bg */
  --amber: oklch(0.83 0.115 68);       /* #FFB868 */
  --amber-ink: oklch(0.24 0.06 60);    /* #2C1600-ish, on amber */
  --amber-soft: oklch(0.91 0.05 70);
  --teal: oklch(0.83 0.075 195);
  --teal-ink: oklch(0.22 0.04 200);
  --alert: oklch(0.52 0.18 27);        /* #B3261E */

  --plate-t: rgba(23, 19, 13, 0.92);
  --plate-p: rgba(255, 184, 104, 0.95);
  --plate-b: rgba(128, 212, 214, 0.95);
  --plate-w: rgba(179, 38, 30, 0.95);

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 76rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);   /* quint-ish */

  --z-sticky: 10;
  --z-skip: 50;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-variation-settings: "wdth" 100;
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: var(--z-skip);
  background: var(--amber); color: var(--amber-ink); padding: .6rem 1rem; border-radius: 6px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 1rem; }

h1, h2 {
  font-variation-settings: "wdth" 125;
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2.75rem, 7.2vw, 5.75rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); }
p { margin: 0; text-wrap: pretty; max-width: 62ch; }
.amber { color: var(--amber); }
.quiet { color: var(--muted); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem var(--gutter);
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid color-mix(in oklch, var(--line) 60%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 800;
  font-variation-settings: "wdth" 115; font-size: 1.2rem; color: var(--ink); }
.mark { width: 30px; height: 30px; color: var(--amber); }
nav { display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.75rem); }
nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; transition: color .15s; }
nav a:hover { color: var(--ink); }
.nav-cta { color: var(--amber) !important; }
@media (max-width: 720px) { nav a:not(.nav-cta) { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: .8rem 1.4rem; border-radius: 999px; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform .15s var(--ease-out), background-color .15s, color .15s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--amber); color: var(--amber-ink); }
.btn-primary:hover { background: var(--amber-soft); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 6rem) var(--gutter) clamp(3rem, 8vw, 7rem);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: center;
}
.hero-copy { display: grid; gap: 1.25rem; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .phone { justify-self: center; }
}

/* the phone: a fixed 2:3 viewport so overlay coordinates map exactly onto the photo */
.phone { margin: 0; width: min(100%, 25rem); }
.screen {
  position: relative; aspect-ratio: 2 / 3; overflow: hidden;
  border-radius: 34px; border: 10px solid #0b0906;
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -20px rgba(0, 0, 0, .7);
  background: #000;
}
.screen > img { width: 100%; height: 100%; object-fit: cover; }
.scrim-top { position: absolute; inset: 0 0 auto; height: 18%;
  background: linear-gradient(rgba(0,0,0,.5), transparent); }
.badge {
  position: absolute; top: 4%; right: 5%;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: #FFDCBE; color: #2C1600;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #8B5000; }
.shutter {
  position: absolute; left: 50%; bottom: 17%; width: 3.4rem; height: 3.4rem; translate: -50% 0;
  border-radius: 50%; border: 4px solid var(--amber);
  box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 40px rgba(255,255,255,.9);
  background-clip: padding-box;
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .55rem 1.1rem 1rem;
  background: #241E17; color: var(--ink); border-radius: 18px 18px 0 0;
  display: grid; gap: .1rem; font-size: .8rem;
}
.sheet strong { font-size: .95rem; }
.sheet span:last-child { color: var(--muted); }
.grip { justify-self: center; width: 2.2rem; height: 4px; border-radius: 4px; background: var(--line); margin-bottom: .35rem; }

.plates, .mini-plates { list-style: none; margin: 0; padding: 0; }
.plates li, .mini-plates li {
  position: absolute; left: var(--x); top: var(--y); translate: -50% -50%;
  display: flex; gap: 3px; white-space: nowrap;
}
.plate {
  display: block;
  padding: .18em .5em; border-radius: 5px; white-space: nowrap;
  font-size: clamp(.58rem, 2.3vw, .74rem); font-weight: 600; line-height: 1.35;
  font-variation-settings: "wdth" 92;
}
.plate.t { background: var(--plate-t); color: #fff; }
.plate.p { background: var(--plate-p); color: #2C1600; font-weight: 700; }
.plate.b { background: var(--plate-b); color: #002021; font-weight: 700; }
.plate.w { background: var(--plate-w); color: #fff; font-weight: 700; }

/* scan-in: plates resolve one after another, like the app reading the board */
.plates li {
  transition: opacity .35s var(--ease-out), filter .45s var(--ease-out), scale .35s var(--ease-out);
  transition-delay: calc(var(--d) * 70ms);
}
.phone[data-state="original"] .plates li { opacity: 0; filter: blur(6px); scale: .94; transition-delay: 0ms; }
.phone[data-state="original"] .sheet { translate: 0 100%; }
.phone[data-state="original"] .badge { opacity: .0; }
.sheet, .badge { transition: translate .35s var(--ease-out), opacity .25s; }
.phone figcaption { margin-top: .9rem; font-size: .82rem; color: var(--muted); text-align: center; text-wrap: balance; }

@media (prefers-reduced-motion: reduce) {
  .plates li, .sheet, .badge { transition: opacity .15s linear; transition-delay: 0ms; }
  .phone[data-state="original"] .plates li { filter: none; scale: 1; }
  .phone[data-state="original"] .sheet { translate: 0 0; opacity: 0; }
}

/* ---------- reads: a departure board ---------- */
.reads { max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter); }
.section-lede { color: var(--muted); font-size: 1.15rem; margin-top: 1rem; }
.board {
  margin-top: clamp(2rem, 4vw, 3rem);
  border-top: 2px solid var(--amber);
}
.board-row {
  display: grid; grid-template-columns: minmax(7rem, 14rem) 1fr; gap: 1.5rem;
  padding: 1.25rem 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.board-head { padding: .7rem 0; color: var(--muted); font-size: .85rem; font-weight: 600; }
.code {
  font-variation-settings: "wdth" 125; font-weight: 850; font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--amber); line-height: 1;
}
.board-row span:last-child { font-size: 1.12rem; max-width: 60ch; }
@media (max-width: 560px) { .board-row { grid-template-columns: 1fr; gap: .4rem; } .board-head { display: none; } }

/* ---------- offline: amber drench ---------- */
.offline {
  background: var(--amber); color: var(--amber-ink);
  padding: clamp(3.5rem, 9vw, 7rem) var(--gutter);
}
.offline h2 { max-width: var(--max); margin: 0 auto; font-size: clamp(2.4rem, 6.5vw, 5rem); }
.offline-list {
  list-style: none; max-width: var(--max); margin: clamp(2rem, 5vw, 3.5rem) auto 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem 3rem;
}
.offline-list li { font-size: 1.15rem; line-height: 1.5; padding-top: 1rem; border-top: 2px solid var(--amber-ink); }
.offline-list strong { display: block; font-variation-settings: "wdth" 115; font-size: 1.45rem; font-weight: 800; margin-bottom: .2rem; }

/* ---------- places ---------- */
.places {
  max-width: var(--max); margin: 0 auto; padding: clamp(3.5rem, 9vw, 7rem) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.places-photo img { border-radius: 14px; aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.places-copy { display: grid; gap: 1.25rem; }
.nearby { list-style: none; margin: .25rem 0; padding: 0; border-top: 1px solid var(--line); }
.nearby li { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 1rem; align-items: center;
  padding: .8rem 0; border-bottom: 1px solid var(--line); }
.cat { font-size: .8rem; font-weight: 700; padding: .15rem .55rem; border-radius: 5px; justify-self: start; }
.cat.health { background: var(--plate-w); color: #fff; }
.cat.money { background: var(--plate-p); color: #2C1600; }
.cat.transit { background: var(--plate-b); color: #002021; }
.dist { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .places { grid-template-columns: 1fr; } }

/* ---------- privacy ---------- */
.privacy {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(3.5rem, 9vw, 7rem);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.privacy-copy { display: grid; gap: 1.1rem; order: -1; }
.menu-shot { position: relative; margin: 0; border-radius: 14px; overflow: hidden; }
.menu-shot img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
@media (max-width: 860px) { .privacy { grid-template-columns: 1fr; } .privacy-copy { order: 0; } }

/* ---------- beta ---------- */
.beta {
  max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter);
  border-top: 1px solid var(--line); display: grid; gap: 1.25rem;
}
.steps { margin: .5rem 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: .9rem; max-width: 40rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.5rem 1fr; align-items: center; font-size: 1.1rem; }
.steps li::before {
  content: counter(s); width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--amber); color: var(--amber); font-weight: 800; font-size: .95rem;
}

/* ---------- footer ---------- */
.foot { padding: 2.5rem var(--gutter) 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem;
  display: grid; gap: .5rem; max-width: var(--max); margin: 0 auto; }
.credits a { color: var(--ink); }


/* ---------- upload: share sheet ---------- */
.upload {
  max-width: var(--max); margin: 0 auto; padding: clamp(1rem, 4vw, 3rem) var(--gutter) clamp(3.5rem, 9vw, 7rem);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.upload-copy { display: grid; gap: 1.1rem; }
.share-sheet {
  background: #241E17; border: 1px solid var(--line); border-radius: 16px;
  padding: 1.25rem; display: grid; gap: 1rem; max-width: 24rem; justify-self: center; width: 100%;
}
.share-thumb { display: flex; align-items: center; gap: .9rem; font-size: .9rem; color: var(--muted); }
.share-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.share-title { font-weight: 700; font-size: .95rem; }
.share-targets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.share-targets li { display: grid; justify-items: center; gap: .4rem; font-size: .78rem; color: var(--muted); padding: .5rem .2rem; border-radius: 12px; }
.share-targets .pick { background: color-mix(in oklch, var(--amber) 16%, transparent); color: var(--ink); font-weight: 700; outline: 2px solid var(--amber); }
.tile { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.tile.t1 { background: oklch(0.55 0.08 250); }
.tile.t2 { background: oklch(0.6 0.1 150); }
.tile.t3 { background: oklch(0.5 0.03 70); }
.tile.yomi { background: #17130D; }
.tile.yomi svg { width: 34px; height: 34px; }
@media (max-width: 860px) { .upload { grid-template-columns: 1fr; } }

/* ---------- scroll choreography ----------
   Scroll-driven, so nothing depends on JS or a class toggle: where
   animation-timeline isn't supported the page is simply static and fully visible. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes rise { from { opacity: 0; translate: 0 32px; } to { opacity: 1; translate: 0 0; } }
    @keyframes slide-in { from { opacity: 0; translate: -28px 0; } to { opacity: 1; translate: 0 0; } }
    @keyframes unveil {
      from { clip-path: inset(14% 10% 14% 10% round 14px); }
      to { clip-path: inset(0 0 0 0 round 14px); }
    }
    @keyframes settle { from { scale: 1.12; } to { scale: 1; } }
    @keyframes plate-in { from { opacity: 0; scale: .85; filter: blur(4px); } to { opacity: 1; scale: 1; filter: blur(0); } }
    @keyframes drift { to { translate: 0 -48px; } }
    @keyframes rule-grow { from { scale: 0 1; } to { scale: 1 1; } }
    @keyframes pop { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }

    h2, .section-lede, .places-copy > p, .privacy-copy > p, .upload-copy > p, .beta > p {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 70%;
    }

    /* departure board: rows slide in as each one reaches the viewport */
    .board { transform-origin: left; }
    .board-row:not(.board-head) {
      animation: slide-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 90%;
    }
    .board-row:not(.board-head) .code { animation: pop linear both; animation-timeline: view(); animation-range: entry 20% entry 100%; }

    /* amber drench: each fact's rule draws across, then the copy rises */
    .offline-list li { position: relative; border-top-color: transparent;
      animation: rise linear both; animation-timeline: view(); animation-range: entry 10% entry 80%; }
    .offline-list li::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px;
      background: var(--amber-ink); transform-origin: left;
      animation: rule-grow linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }

    /* photos open like a shutter and settle */
    .places-photo { animation: unveil linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; border-radius: 14px; }
    .places-photo img { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
    .menu-shot { view-timeline-name: --menu; animation: unveil linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }

    /* the converted prices "resolve" on the menu once it's in view, like a scan */
    .mini-plates li { animation: plate-in linear both; animation-timeline: --menu; animation-range: cover 30% cover 45%; }
    .mini-plates li:nth-child(2) { animation-range: cover 36% cover 51%; }
    .privacy { timeline-scope: --menu; }

    .nearby li { animation: slide-in linear both; animation-timeline: view(); animation-range: entry 10% entry 90%; }
    .share-sheet { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .share-targets .pick { animation: pop linear both; animation-timeline: view(); animation-range: entry 40% cover 35%; }
    .steps li { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }

    /* hero phone eases upward as you leave the fold */
    .phone { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
  }
}
