/* Hefta public site. Follows the app's ui-spec (docs/design/ui-spec.html) since Nov 3, 2026: Material 3 Expressive,
   the SchemeVibrant roles from seed #2D5BD0 copied verbatim (light and dark, by the system setting), the data colors
   the page uses, Roboto Flex only, Material Symbols Rounded. Both fonts are served from /fonts, so a visit makes no request to
   another host. No shadows on cards, no gradients, no emoji (CLAUDE.md "UI"). */

@font-face {
  font-family: "Roboto Flex";
  src: url("/fonts/roboto-flex.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Material Symbols Rounded";
  src: url("/fonts/material-symbols-rounded.woff2") format("woff2");
  font-weight: 400 600;
  font-display: block;
}

/* ui-spec §1: generated roles (.m-light / .m-dark) and data colors, verbatim. */
:root {
  color-scheme: light;
  --primary: #0052de; --on-primary: #ffffff; --primary-container: #dbe1ff; --on-primary-container: #003dab;
  --secondary-container: #e3dfff; --on-secondary-container: #454364;
  --tertiary-container: #ebdcff; --on-tertiary-container: #4f3e6e;
  --surface: #faf8ff; --on-surface: #191b25; --on-surface-variant: #434654;
  --surface-lowest: #ffffff; --surface-low: #f2f3ff; --surface-mid: #ecedfb; --surface-high: #e6e7f5; --surface-highest: #e1e1ef;
  --outline: #747685; --outline-variant: #c3c6d6;
  --inverse-surface: #2e303a; --inverse-on-surface: #eff0fe; --inverse-primary: #b5c4ff;
  --train: #2655ca; --train-container: #dbe1ff; --train-ring: #547df3;
  --protein: #9b4500; --protein-container: #ffdbc9; --protein-ring: #d46304;
  --energy: #006d38; --energy-container: #8df9ac; --energy-ring: #239654;
  --pr: #775a00; --pr-container: #ffdf99;
  --ring-track: 16%;
  /* Chat apps keep their own neutral chrome (ui-spec §9), not M3. */
  --chat-bg: #e7e9ee; --chat-ink: #16181c; --chat-bar: #ffffff; --chat-rule: #d7dae0; --chat-card: #ffffff;
  --chat-me: #c9f2b4; --chat-me-ink: #16181c; --chat-qr: #b9bec8; --chat-field: #eef0f3; --chat-edge: transparent; --chat-link: #1f6696;
  --watch-ink: #e1e1ef; --watch-dim: #c3c6d6; --watch-primary: #b5c4ff;

  --font: "Roboto Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.05, 0.7, 0.1, 1); /* M3 emphasized decelerate */
  --max: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --primary: #b5c4ff; --on-primary: #00297a; --primary-container: #003dab; --on-primary-container: #dbe1ff;
    --secondary-container: #454364; --on-secondary-container: #e3dfff;
    --tertiary-container: #4f3e6e; --on-tertiary-container: #ebdcff;
    --surface: #10131c; --on-surface: #e1e1ef; --on-surface-variant: #c3c6d6;
    --surface-lowest: #0b0e17; --surface-low: #191b25; --surface-mid: #1d1f29; --surface-high: #272a34; --surface-highest: #32343f;
    --outline: #8d909f; --outline-variant: #434654;
    --inverse-surface: #e1e1ef; --inverse-on-surface: #2e303a; --inverse-primary: #0052de;
    --train: #b5c4ff; --train-container: #003dab; --train-ring: #8da8ff;
    --protein: #ffb68d; --protein-container: #763300; --protein-ring: #ff8d44;
    --energy: #71dc92; --energy-container: #005229; --energy-ring: #54c079;
    --pr: #f3bf37; --pr-container: #5a4300;
    --ring-track: 22%;
    --chat-bg: #0f1115; --chat-ink: #e6e8ec; --chat-bar: #181b21; --chat-rule: #2a2e36; --chat-card: #232730;
    --chat-me: #2e5a22; --chat-me-ink: #eaf7e3; --chat-qr: #3a3f4a; --chat-field: #232730; --chat-edge: #2a2e36; --chat-link: #7cbcf0;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; overflow-x: hidden; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font: 400 1.0625rem/1.55 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
[hidden] { display: none !important; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; }
a { color: inherit; }
::selection { background: var(--primary-container); color: var(--on-primary-container); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
input { caret-color: var(--primary); }
html { scrollbar-color: var(--outline) var(--surface); }

.i {
  font-family: "Material Symbols Rounded";
  font-weight: 400; font-style: normal; font-size: 24px; line-height: 1;
  letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr;
  font-feature-settings: "liga"; -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  display: inline-block; flex: none; user-select: none;
}
.i.f { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.i.s { font-size: 18px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20; }
.num { font-variation-settings: "wdth" 88; font-feature-settings: "tnum"; font-weight: 600; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.mark { font-size: 1.75rem; font-weight: 700; font-variation-settings: "wdth" 90; letter-spacing: -0.01em; text-decoration: none; display: inline-flex; align-items: center; gap: 0.33em; }
/* The mark before the wordmark (ui-spec §17.4, L2 "Cut"): 1.33 x the type, 0.33 em from it. The gap around each plate
   takes the color behind the mark (--mark-bg), so the bar stops short of the plates on any field. */
.logo { width: 1.33em; height: 1.33em; flex: none; color: var(--primary); --mark-bg: var(--surface); }
.logo path { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; }
.logo rect { fill: currentColor; }
.logo rect.gap { fill: var(--mark-bg); }
.bar.top .logo, .close-band .logo { --mark-bg: var(--primary-container); }
.bar nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.bar nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  font-size: 0.95rem; font-weight: 550; text-decoration: none; color: var(--on-surface-variant);
  transition: background-color 200ms, color 200ms;
}
.bar nav a:hover { background: var(--surface-high); background: color-mix(in srgb, var(--on-surface) 8%, transparent); color: var(--on-surface); }
.bar nav a[aria-current="page"] { background: var(--secondary-container); color: var(--on-secondary-container); }

/* ---------- the story: one set in three places (index.html .story) ---------- */
.bar.top { background: var(--primary-container); color: var(--on-primary-container); max-width: none; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px), calc((100% - var(--max)) / 2)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px), calc((100% - var(--max)) / 2)); }
.bar.top nav a { color: var(--on-primary-container); }
.bar.top nav a:hover { background: var(--surface-low); background: color-mix(in srgb, var(--on-primary-container) 10%, transparent); }

/* Each chapter owns a flat M3 role; the stage changes field between them (no gradients). */
.stage { --bg: var(--primary-container); --fg: var(--on-primary-container); background: var(--bg); color: var(--fg); transition: background-color 700ms var(--ease), color 700ms var(--ease); position: relative; }
.stage[data-beat="2"] { --bg: var(--secondary-container); --fg: var(--on-secondary-container); }
.stage[data-beat="3"] { --bg: var(--inverse-surface); --fg: var(--inverse-on-surface); }
.stage { --ring-soft: var(--outline-variant); --track: var(--surface-low); }
@supports (color: color-mix(in srgb, red, blue)) {
  .stage { --ring-soft: color-mix(in srgb, var(--fg) 14%, transparent); --track: color-mix(in srgb, var(--fg) 10%, transparent); }
}
.stage-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: center; }
.beat h1, .beat h2 {
  font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: 1.02; font-weight: 600;
  font-variation-settings: "wdth" 84; letter-spacing: -0.02em; max-width: 12ch;
}
.beat .lede { color: inherit; opacity: 0.86; margin-top: 18px; max-width: 34ch; }
.soon { display: flex; align-items: center; gap: 12px; margin-top: 26px; font-size: 1.2rem; line-height: 1.3; font-weight: 650; }
.soon .i { font-size: 28px; }
.small { font-size: 0.875rem; line-height: 1.5; color: var(--on-surface-variant); }
.story-cap { color: inherit; opacity: 0.8; text-align: center; margin-top: 16px; }
.strap { display: none; }
.chapters { display: none; }

/* Without the scroll story (reduced motion, no script): the three screens side by side, the chat tappable. */
html:not(.story) .stage { padding-block: clamp(20px, 3vw, 40px) clamp(48px, 6vw, 80px); }
html:not(.story) .stage-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
html:not(.story) .beats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px; }
html:not(.story) .beat[data-b="0"] { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 8px 32px; align-items: end; }
html:not(.story) .beat[data-b="0"] h1 { grid-row: span 2; max-width: 14ch; }
html:not(.story) .beat[data-b="0"] .lede, html:not(.story) .beat[data-b="0"] .soon { margin-top: 0; }
html:not(.story) .beat:not([data-b="0"]) h2 { font-size: clamp(1.4rem, 2vw, 1.75rem); max-width: none; }
html:not(.story) .beat:not([data-b="0"]) .lede { font-size: 1rem; margin-top: 8px; }
html:not(.story) .beat[data-b="4"] { display: none; }
html:not(.story) .dev { display: flex; justify-content: center; align-items: flex-start; gap: 24px; }
html:not(.story) .layer.watch { margin-top: 180px; }

/* The scroll story: the stage is pinned while the section scrolls past; home.js sets --p and the beat. */
html.story .story { height: 480vh; }
html.story .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; align-items: center; }
html.story .beats { position: relative; height: min(56vh, 460px); }
html.story .beat {
  position: absolute; left: 0; right: 0; top: 50%; translate: 0 calc(-50% + 28px); opacity: 0; visibility: hidden;
  transition: opacity 520ms var(--ease), translate 720ms var(--ease), visibility 0s linear 520ms;
}
html.story .beat.on { opacity: 1; visibility: visible; translate: 0 -50%; transition: opacity 520ms var(--ease) 120ms, translate 720ms var(--ease) 120ms, visibility 0s; }
html.story .beat.past { translate: 0 calc(-50% - 28px); }
html.story .dev-area { height: 100vh; height: 100svh; display: grid; place-items: center; position: relative; }
html.story .dev-wrap { position: relative; display: grid; place-items: center; scale: var(--fit, 1); }
html.story .dev {
  position: relative; width: var(--dw, 330px); height: var(--dh, 680px); border-radius: var(--dr, 44px);
  /* A border, not an outline (Safari before 16.4 draws outlines square); clip-path makes WebKit clip the fading,
     scaling screens to the rounded corners inside the 3D-turned wrapper. */
  box-sizing: content-box; overflow: hidden; background: #000; border: 8px solid var(--ring, var(--ring-soft));
  clip-path: inset(0 round var(--dr, 44px)); z-index: 1;
}
html.story .layer { position: absolute; left: 50%; top: 50%; translate: -50% -50%; margin: 0; border: 0; border-radius: 0; }
html.story .layer.chat, html.story .layer.ses { width: 330px; height: 680px; }
html.story .layer.watch { width: 300px; height: 300px; border-radius: 50%; }
html.story .layer.chat { opacity: var(--o-chat, 1); }
html.story .layer.ses { opacity: var(--o-ses, 0); scale: calc(0.94 + 0.06 * var(--o-ses, 0)); }
html.story .layer.watch { opacity: var(--o-watch, 0); }
html.story .strap {
  display: block; position: absolute; left: 50%; width: 184px; height: 190px; translate: -50% 0; background: #0052de; /* a Hefta-cobalt band, like the app seed */
  scale: 1 var(--strap, 0); transition: none;
}
html.story .s-top { bottom: calc(50% + 120px); border-radius: 48px 48px 14px 14px; transform-origin: 50% 100%; }
html.story .s-bot { top: calc(50% + 120px); border-radius: 14px 14px 48px 48px; transform-origin: 50% 0; }
html.story .s-top, html.story .s-bot { transform-origin: center; }
html.story .story-cap { position: absolute; bottom: 24px; left: 0; right: 0; opacity: calc(0.8 * var(--o-chat, 1)); }
html.story .chapters {
  display: flex; gap: 4px; position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); translate: -50% 0;
  padding: 4px; border-radius: 999px; background: var(--track); z-index: 2;
}
html.story .chapters li { min-height: 32px; padding: 0 14px; border-radius: 999px; display: grid; place-items: center; font-size: 0.85rem; font-weight: 600; opacity: 0.7; transition: background-color 300ms var(--ease), color 300ms var(--ease), opacity 300ms; }
html.story .chapters li.on { background: var(--fg); color: var(--bg); opacity: 1; }
html.story .story-cap { display: none; }
/* The header rides over the first stage, so the whole stage (and its scroll cue) is in the first viewport. */
html.story .bar.top { position: absolute; top: 0; left: 0; right: 0; z-index: 5; background: transparent; }
html.story .stage-grid { padding-top: 40px; }
html.story .dev-wrap { transform: perspective(1400px) rotateY(var(--ry, 0deg)); }
/* Scroll cue: says the page moves on scroll, and goes as soon as it does. */
.cue { display: none; }
html.story .cue {
  display: flex; flex-direction: column; align-items: center; gap: 2px; position: absolute; left: 50%; translate: -50% 0;
  bottom: calc(max(20px, env(safe-area-inset-bottom, 0px)) + 58px); z-index: 2; font-size: 1rem; font-weight: 650;
  opacity: var(--cue, 1); border: 0; background: none; color: inherit; font-family: inherit; cursor: pointer; min-height: 44px; padding: 0 12px;
}
html.story .stage.moved .cue { pointer-events: none; visibility: hidden; }
html.story .cue .i { font-size: 32px; animation: cue-bob 1.6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
html.story .stage.moved .cue .i { animation-play-state: paused; }
@keyframes cue-bob { 50% { translate: 0 7px; } }
/* Story progress under the chapter pill. */
html.story .chapters::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: -9px; height: 3px; border-radius: 2px;
  background: var(--fg); opacity: 0.55; transform-origin: 0 50%; scale: var(--p, 0) 1;
}
/* First arrival: the headline wipes up, the phone rises into place. */
html.story .beat[data-b="0"] h1 { animation: wipe-up 900ms var(--ease) 80ms both; }
html.story .beat[data-b="0"] .lede, html.story .beat[data-b="0"] .soon { animation: rise-in 800ms var(--ease) both; }
html.story .beat[data-b="0"] .lede { animation-delay: 320ms; }
html.story .beat[data-b="0"] .soon { animation-delay: 440ms; }
html.story .dev-area { animation: rise-in 1000ms var(--ease) 200ms both; }
html.story .cue { animation: fade-in 600ms var(--ease) 1100ms both; }
@keyframes wipe-up { from { clip-path: inset(0 0 100% 0); translate: 0 24px; } to { clip-path: inset(0 0 -10% 0); } }
@keyframes rise-in { from { opacity: 0; translate: 0 48px; } }
@keyframes fade-in { from { opacity: 0; } }

/* Below the story: each block arrives once as it is reached. home.js marks blocks .rv (hidden) only when it runs,
   so a failed script hides nothing. */
html.story .rv { opacity: 0; translate: 0 40px; filter: blur(6px); transition: opacity 700ms var(--ease) var(--d, 0ms), translate 900ms var(--ease) var(--d, 0ms), filter 700ms var(--ease) var(--d, 0ms); }
html.story .rv.from-l { translate: -56px 0; }
html.story .rv.from-r { translate: 56px 24px; rotate: 3deg; transition-property: opacity, translate, filter, rotate; transition-duration: 700ms, 1000ms, 700ms, 1000ms; }
html.story .rv.wipe { opacity: 1; translate: 0; filter: none; clip-path: inset(0 100% -20% 0); transition: clip-path 1000ms var(--ease) var(--d, 0ms); }
html.story .rv.in { opacity: 1; translate: 0 0; filter: none; rotate: 0deg; clip-path: inset(0 0 -20% 0); }
html.story .price { transform-origin: 0 80%; scale: var(--price, 1); }
@media (max-width: 920px) {
  /* Phones: things arrive from below, never from off the side of the screen. */
  html.story .rv.from-l, html.story .rv.from-r { translate: 0 40px; rotate: 0deg; }
  /* The cue takes the chapter pill's place until the story starts moving. */
  html.story .cue {
    bottom: max(20px, env(safe-area-inset-bottom, 0px)); flex-direction: row; gap: 6px; min-height: 40px; padding: 0 12px 0 18px;
    border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 0.95rem;
  }
  html.story .cue .i { font-size: 24px; }
  html.story .chapters { opacity: calc(1 - var(--cue, 1)); }
}
html.story .close h2 .w { opacity: 0.2; transition: opacity 260ms var(--ease); }
html.story .close h2 .w.on { opacity: 1; }
/* Chat in the story is a picture of the flow, scrubbed by scroll; the tappable demo is the fallback and "Type it". */
html.story .layer.chat .qr span { cursor: default; }
.qr span.pick { background: #0052de; border-color: #0052de; color: #fff; }

.screen {
  --w: 280px;
  flex: none; width: var(--w); height: 600px; position: relative; overflow: hidden;
  border-radius: 36px; background: var(--surface); color: var(--on-surface);
  border: 1px solid var(--outline-variant); isolation: isolate;
  font-size: 14px; line-height: 20px; display: flex; flex-direction: column;
}
.screen.chat { --w: 330px; height: 680px; background: var(--chat-bg); color: var(--chat-ink); border: 6px solid var(--surface); }
.sb { height: 36px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-size: 13px; font-weight: 550; font-feature-settings: "tnum"; }
.sb::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; position: absolute; left: 50%; top: 13px; transform: translateX(-50%); }
.sb .i { font-size: 15px; }
.gest { position: absolute; left: 50%; bottom: 8px; width: 108px; height: 4px; border-radius: 2px; background: currentColor; opacity: 0.35; transform: translateX(-50%); }
.scr-body { flex: 1; min-height: 0; padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.scr-top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.scr-top .scr-title { font-size: 30px; line-height: 38px; font-weight: 450; }
.av { width: 32px; height: 32px; border-radius: 50%; background: var(--tertiary-container); color: var(--on-tertiary-container); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.v { color: var(--on-surface-variant); }
.tile { background: var(--surface-low); border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.lm { font-size: 12px; line-height: 16px; font-weight: 550; letter-spacing: 0.2px; }
.tm { font-size: 16px; line-height: 24px; font-weight: 550; }
.tl { font-size: 20px; line-height: 26px; font-weight: 450; }

/* Live session (ui-spec §4.1) */
.ses-top { display: flex; align-items: center; gap: 14px; min-height: 52px; }
.ses-top p { display: grid; line-height: 18px; }
.ex-chips { display: flex; gap: 8px; }
.ex-chip { height: 32px; border-radius: 8px; border: 1px solid var(--outline-variant); display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 13px; font-weight: 550; white-space: nowrap; }
.ex-chip.on { background: var(--secondary-container); color: var(--on-secondary-container); border-color: transparent; }
.big-set { font-size: 54px; line-height: 58px; font-weight: 650; font-variation-settings: "wdth" 84; font-feature-settings: "tnum"; letter-spacing: -0.5px; white-space: nowrap; }
.big-set small { font-size: 22px; font-weight: 500; color: var(--on-surface-variant); font-variation-settings: "wdth" 100; margin-left: 2px; }
.plates { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-surface-variant); }
.plates .bar-e { width: 22px; height: 6px; border-radius: 3px; background: var(--outline); flex: none; }
.plates .col { width: 4px; height: 14px; border-radius: 2px; background: var(--on-surface-variant); margin-left: -8px; flex: none; }
.plates .pl { display: flex; align-items: center; gap: 2px; margin-left: -6px; flex: none; }
.plates .pl i { width: 6px; border-radius: 2px; }
/* Real bumper colors, the one domain color on the session screen (ui-spec §4.1). */
.p25 { height: 34px; background: #c8352a; } .p20 { height: 32px; background: #2f5fb3; } .p15 { height: 30px; background: #e2b52b; }
.p10 { height: 26px; background: #3d8b4a; } .p5 { height: 24px; background: #ecece8; outline: 1px solid var(--outline-variant); }
.p2-5, .p1-25 { height: 16px; background: #8e9297; } .p1-25 { height: 12px; }
.sets { display: grid; font-size: 14px; }
.sets > div { display: grid; grid-template-columns: 28px 1fr 52px 36px 28px; align-items: center; min-height: 44px; padding: 0 8px; border-radius: 12px; font-feature-settings: "tnum"; }
.sets .hd { min-height: 28px; font-size: 12px; color: var(--on-surface-variant); }
.sets .cur { background: var(--primary-container); color: var(--on-primary-container); font-weight: 600; }
.sets .done .tick { color: var(--primary); }
.sets .tick { font-size: 22px; color: var(--outline-variant); transition: color 300ms; }
.sets .done .tick { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.sets .kg, .sets .rp { transition: color 300ms; }
.sets .fresh { animation: fresh 900ms var(--ease); }
@keyframes fresh { from { background: var(--primary-container); } }
.toolbar { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; gap: 6px; padding: 8px; border-radius: 999px; background: var(--surface-high); box-shadow: 0 3px 8px rgb(20 24 48 / 0.16), 0 1px 3px rgb(20 24 48 / 0.12); }
.toolbar span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }

/* Food (ui-spec §6.3) */
.wave { width: 100%; height: 10px; display: block; }
.wave path { fill: none; stroke-width: 4; stroke-linecap: round; }
.meal-list { display: grid; gap: 12px; padding: 4px 4px 0; }
.meal-list .lm { color: var(--on-surface-variant); }
.meal-list p { display: grid; }

/* Wear OS current set (ui-spec §14.3): always dark, black ground. */
.screen.watch {
  --w: 232px; height: 232px; border-radius: 50%; margin-top: 190px; background: #000; color: var(--watch-ink);
  border: 10px solid #24262d; align-items: center; justify-content: center; text-align: center; gap: 2px; padding: 20px;
}
.watch .t { font-size: 13px; font-feature-settings: "tnum"; }
.watch .ex { font-size: 14px; color: var(--watch-dim); }
.watch .wnum { font-size: 52px; line-height: 54px; font-weight: 650; font-variation-settings: "wdth" 86; font-feature-settings: "tnum"; }
.watch .wsub { font-size: 14px; color: var(--watch-dim); }
.watch .wbtn { margin-top: 8px; height: 40px; min-width: 120px; border-radius: 999px; background: var(--watch-primary); color: #00297a; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; font-size: 14px; font-weight: 600; transition: background-color 300ms; }
.watch.logged .wbtn { background: #1d3b2a; color: #8df9ac; }

/* ---------- chat chrome (ui-spec §9): neutral, like the chat apps themselves ---------- */
.mh { height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--chat-bar); border-bottom: 1px solid var(--chat-rule); }
.bot-av { width: 36px; height: 36px; border-radius: 50%; background: #0052de; color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.mh p { display: grid; line-height: 1.25; }
.mh b { font-size: 15px; font-weight: 600; }
.mh span { font-size: 12px; opacity: 0.65; }
.thread {
  flex: 1; min-height: 0; overflow: hidden; padding: 12px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
}
.me { align-self: flex-end; max-width: 80%; background: var(--chat-me); color: var(--chat-me-ink); padding: 8px 13px; border-radius: 18px 18px 4px 18px; font-size: 15px; font-weight: 500; }
.card { align-self: flex-start; width: 88%; background: var(--chat-card); color: var(--chat-ink); border-radius: 16px; padding: 10px 13px 12px; display: grid; gap: 6px; font-size: 14px; }
.card > b { font-size: 15px; font-weight: 600; }
.card .rows { display: grid; gap: 3px; font-size: 13.5px; }
.card .rows div { display: flex; justify-content: space-between; gap: 10px; }
.card .rows span:first-child { opacity: 0.65; }
.card .rows span:last-child { font-weight: 600; font-feature-settings: "tnum"; text-align: right; }
.card .ask { font-weight: 600; }
.card .hint { font-size: 12.5px; opacity: 0.65; }
.qr { display: flex; flex-wrap: wrap; gap: 6px; }
.qr button, .qr span {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--chat-ink); background: var(--chat-card);
  border: 1px solid var(--chat-qr); border-radius: 999px; min-height: 36px; padding: 0 13px; display: inline-flex; align-items: center;
  cursor: pointer; position: relative; transition: transform 160ms, background-color 160ms, border-color 160ms;
}
.qr button { min-height: 40px; }
.qr button:hover { border-color: #0052de; }
.qr button.pressed { transform: scale(0.95); }
.qr button[aria-pressed="true"] { background: #0052de; border-color: #0052de; color: #fff; }
.qr button:disabled:not([aria-pressed="true"]) { opacity: 0.45; cursor: default; }
.qr.gone { display: none; } /* LINE quick replies disappear after a tap */
.tap-ring { position: absolute; inset: -2px; border-radius: inherit; border: 2px solid #0052de; pointer-events: none; animation: tap 560ms var(--ease) forwards; }
@keyframes tap { to { inset: -12px; opacity: 0; } }
.cmp { height: 56px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--chat-bar); }
.cmp div { flex: 1; height: 36px; border-radius: 18px; background: var(--chat-field); display: flex; align-items: center; padding: 0 14px; font-size: 14px; opacity: 0.7; }
.again { align-self: center; font: inherit; font-size: 13px; font-weight: 550; color: inherit; background: none; border: 0; min-height: 36px; padding: 0 10px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.in { animation: msg-in 520ms var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }


/* ---------- sections ---------- */
.sec { padding-block: clamp(80px, 10vw, 128px) 0; }
.sec-head { display: grid; gap: 14px; max-width: 640px; margin-bottom: clamp(32px, 4vw, 48px); }
.sec-head h2, .free h2 { font-size: clamp(2.1rem, 3.9vw, 3.4rem); line-height: 1.06; font-variation-settings: "wdth" 88; letter-spacing: -0.015em; }
.lede { font-size: clamp(1.06rem, 1.4vw, 1.22rem); line-height: 1.55; color: var(--on-surface-variant); max-width: 52ch; }

/* One question at a time: four connected steps, the current one filled. */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; background: var(--surface); }
.step { background: var(--surface-low); padding: 24px 22px 26px; display: grid; gap: 6px; align-content: start; transition: background-color 280ms, color 280ms; }
.step:first-child { border-radius: 28px 8px 8px 28px; }
.step:last-child { border-radius: 8px 28px 28px 8px; }
.step:not(:first-child):not(:last-child) { border-radius: 8px; }
.step .q { font-size: 1rem; font-weight: 600; color: var(--on-surface-variant); display: flex; align-items: center; gap: 8px; }
.step .q .i { font-size: 20px; }
.step .a { font-size: clamp(2rem, 3.2vw, 2.8rem); line-height: 1.1; font-weight: 600; font-variation-settings: "wdth" 86; font-feature-settings: "tnum"; margin: 6px 0 4px; }
.step p:last-child { font-size: 0.95rem; color: var(--on-surface-variant); }
.step.now { background: var(--primary-container); color: var(--on-primary-container); }
.step.now .q, .step.now p:last-child { color: var(--on-primary-container); }

/* Type it */
.type-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.try { display: grid; gap: 12px; background: var(--surface-low); border-radius: 28px; padding: clamp(18px, 2.4vw, 28px); }
.field { display: flex; gap: 8px; align-items: stretch; }
.field input {
  flex: 1; min-width: 0; height: 56px; border: 1px solid var(--outline); border-radius: 16px; background: var(--surface);
  color: var(--on-surface); font: 500 1.15rem var(--font); font-feature-settings: "tnum"; padding: 0 16px; -webkit-appearance: none; appearance: none;
  transition: border-color 160ms, box-shadow 160ms;
}
.field input::placeholder { color: var(--on-surface-variant); opacity: 0.8; }
.field input:focus { outline: none; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.field button {
  height: 56px; min-width: 56px; border: 0; border-radius: 16px; padding: 0 20px; background: var(--primary); color: var(--on-primary);
  font: 600 1rem var(--font); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; transition: border-radius 200ms var(--ease), transform 160ms;
}
.field button:hover { border-radius: 28px; }
.field button.pressed { transform: scale(0.96); }
.try-out { min-height: 132px; display: flex; flex-direction: column; justify-content: flex-start; background: var(--chat-bg); color: var(--chat-ink); border-radius: 20px; padding: 12px; }
.try-out .card { width: 100%; }
.miss { font-size: 0.95rem; padding: 10px 13px; border-radius: 14px; background: var(--chat-card); }
.forms li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 14px 4px; border-bottom: 1px solid var(--outline-variant); }
.forms li:first-child { padding-top: 4px; }
.typed { font-size: 1.15rem; font-weight: 600; font-feature-settings: "tnum"; }
.reads { font-size: 0.92rem; color: var(--on-surface-variant); text-align: right; }

/* Chat panels below the hero use the same chrome as the hero chat. */
.panel, .menu, .try-out { box-shadow: inset 0 0 0 1px var(--chat-edge); }
.panel { background: var(--chat-bg); color: var(--chat-ink); border-radius: 28px; overflow: hidden; display: flex; flex-direction: column; }
.panel .thread { justify-content: flex-start; padding: 16px; gap: 10px; }
.panel .card { width: min(100%, 440px); }
.pair { display: flex; gap: 20px; align-items: flex-start; }
.pair .panel { flex: 1; min-width: 0; }
.screen.inline { height: 560px; flex: none; }
.pr-tile { background: var(--pr-container); color: var(--on-surface); gap: 4px; }
.pr-tile .i { color: var(--pr); }
.stat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat > div { background: var(--surface-low); border-radius: 16px; padding: 10px 12px; display: grid; gap: 2px; }
.stat .num { font-size: 22px; line-height: 28px; }
.stat small { font-size: 12px; font-weight: 500; color: var(--on-surface-variant); margin-left: 2px; font-variation-settings: "wdth" 100; }
.wave .done { transition: stroke-dasharray 900ms var(--ease); }
.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.split .sec-head { margin-bottom: 0; }
.caption { font-size: 0.875rem; color: var(--on-surface-variant); margin-top: 10px; }

/* Finish: the summary card's four numbers. */
.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 4px 0; }
.tally div { display: grid; gap: 2px; padding: 10px; border-radius: 12px; background: var(--chat-bg); }
.tally span { font-size: 12px; opacity: 0.7; }
.tally b { white-space: nowrap; font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.2; font-weight: 650; font-variation-settings: "wdth" 86; font-feature-settings: "tnum"; }

/* Every chat app: LINE's rich menu and Telegram's command menu. */
.apps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.menu { background: var(--chat-bg); color: var(--chat-ink); border-radius: 28px; padding: 20px; display: grid; gap: 14px; align-content: start; }
.menu h3 { font-size: 1rem; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.menu h3 span { font-size: 0.8rem; font-weight: 500; opacity: 0.65; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; border-radius: 16px; overflow: hidden; }
.tiles > span { background: var(--chat-card); min-height: 92px; display: grid; place-items: center; align-content: center; gap: 6px; font-size: 0.95rem; font-weight: 550; transition: background-color 240ms, color 240ms; position: relative; }
.tiles > span .i { font-size: 28px; color: #0052de; transition: color 240ms; }
.tiles > span.lit { background: #0052de; color: #fff; }
.tiles > span.lit .i { color: #fff; }
.cmds { display: grid; border-radius: 16px; overflow: hidden; gap: 2px; }
.cmds div { background: var(--chat-card); display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 46px; padding: 0 16px; font-size: 0.95rem; transition: background-color 240ms; }
.cmds b { font-weight: 600; color: var(--chat-link); }
.cmds div.lit { background: var(--primary-container); background: color-mix(in srgb, #0052de 16%, var(--chat-card)); }
.apps-note { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; background: var(--surface-low); border-radius: 24px; padding: 18px 20px; color: var(--on-surface-variant); }
.apps-note .i { color: var(--primary); }

/* Free */
.free-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 80px); align-items: start; }
.price { display: block; font-size: clamp(5rem, 11vw, 9rem); line-height: 0.9; font-weight: 700; font-variation-settings: "wdth" 80; letter-spacing: -0.03em; color: var(--primary); margin-bottom: 12px; }
.free ul { display: grid; }
.free li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 16px; padding: 18px 4px; border-bottom: 1px solid var(--outline-variant); }
.free li:first-child { padding-top: 6px; }
.free li .i { color: var(--primary); margin-top: 1px; }
.free li p { font-weight: 550; display: grid; gap: 2px; }
.free li p span { font-weight: 400; font-size: 0.95rem; color: var(--on-surface-variant); }

/* Close */
.close-band { background: var(--primary-container); color: var(--on-primary-container); margin-top: clamp(96px, 12vw, 160px); }
.close { padding-block: clamp(64px, 9vw, 112px); display: grid; gap: 18px; }
.close h2 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.02; font-variation-settings: "wdth" 84; letter-spacing: -0.02em; max-width: 14ch; }
.close .lede { color: var(--on-primary-container); }

/* ---------- footer ---------- */
.foot { padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 0.875rem; color: var(--on-surface-variant); }
.foot-row > span { font-weight: 700; font-variation-settings: "wdth" 90; font-size: 1.1rem; color: var(--on-surface); display: inline-flex; align-items: center; gap: 0.33em; }
.foot nav { display: flex; gap: 4px; flex-wrap: wrap; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; text-decoration: none; }
.foot nav a:hover { background: var(--surface-high); background: color-mix(in srgb, var(--on-surface) 8%, transparent); color: var(--on-surface); }
.foot nav a[aria-current="page"] { color: var(--on-surface); font-weight: 600; }
body > .foot { border-top: 1px solid var(--outline-variant); }
.close-band .foot { border-top: 1px solid var(--outline-variant); border-top: 1px solid color-mix(in srgb, var(--on-primary-container) 22%, transparent); }
.close-band .foot-row, .close-band .foot-row > span { color: var(--on-primary-container); }
.close-band .foot nav a:hover { background: var(--surface-low); background: color-mix(in srgb, var(--on-primary-container) 10%, transparent); color: var(--on-primary-container); }

/* ---------- reading pages (privacy, terms, downloads) ---------- */
.doc { max-width: 72ch; padding-block: clamp(24px, 5vw, 56px) clamp(64px, 8vw, 96px); display: grid; gap: 16px;
  /* One column that never grows past the page: an auto track took a table's full width (579px on a 360px phone) and
     pushed every paragraph off screen. The tables scroll inside .tbl instead. */
  grid-template-columns: minmax(0, 1fr); }
.doc h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.05; font-variation-settings: "wdth" 86; letter-spacing: -0.015em; margin-bottom: 8px; }
.doc h2 { font-size: 1.6rem; line-height: 1.2; font-weight: 600; margin-top: 28px; scroll-margin-top: 24px; }
.doc p, .doc li { color: var(--on-surface); }
.doc ul { list-style: disc; padding-left: 1.3em; display: grid; gap: 6px; }
.doc li::marker { color: var(--primary); }
.doc a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc a:hover { text-decoration-thickness: 2px; }
.doc code { font-size: 0.92em; background: var(--surface-high); border-radius: 6px; padding: 1px 6px; }
.draft { background: var(--tertiary-container); color: var(--on-tertiary-container); border-radius: 16px; padding: 14px 18px; }
.meta { display: grid; gap: 6px; background: var(--surface-low); border-radius: 24px; padding: 18px 20px; }
.tbd { background: var(--pr-container); color: var(--on-surface); border-radius: 6px; padding: 0 5px; font-weight: 600; white-space: nowrap; }
.tbl { overflow-x: auto; border-radius: 16px; border: 1px solid var(--outline-variant); }
.tbl table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--outline-variant); }
.tbl th { background: var(--surface-low); font-weight: 600; font-size: 0.875rem; }
.tbl tr:last-child td { border-bottom: 0; }

/* ---------- narrow screens ---------- */
@media (max-width: 920px) {
  html:not(.story) .beats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html:not(.story) .beat[data-b="0"] { grid-template-columns: minmax(0, 1fr); }
  html:not(.story) .beat[data-b="0"] h1 { grid-row: auto; }
  html.story .stage-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: 36vh 64vh; grid-template-rows: 36svh 64svh; gap: 0; align-items: stretch; }
  html.story .beats { height: 100%; }
  html.story .beat { top: 58%; }
  html.story .beat h1, html.story .beat h2 { font-size: clamp(2rem, 7.4vw, 3rem); max-width: 16ch; }
  html.story .beat .lede { margin-top: 10px; font-size: 1rem; }
  html.story .beat .soon { margin-top: 14px; font-size: 1.05rem; }
  html.story .dev-area { height: 64vh; height: 64svh; align-items: start; padding-top: 8px; }
  html.story .dev-wrap { transform-origin: 50% 0; }
  .split, .type-grid, .free-grid, .apps { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(1) { border-radius: 28px 8px 8px 8px; }
  .step:nth-child(2) { border-radius: 8px 28px 8px 8px; }
  .step:nth-child(3) { border-radius: 8px 8px 8px 28px; }
  .step:nth-child(4) { border-radius: 8px 8px 28px 8px; }
}
@media (max-width: 760px) {
  /* Without the story the three screens become a swipeable rail. Only the rail scrolls sideways, never the page. */
  html:not(.story) .dev-area { margin-inline: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px))); }
  html:not(.story) .dev {
    justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    padding: 4px max(16px, env(safe-area-inset-left, 0px)) 12px; scroll-padding-inline: 16px;
  }
  html:not(.story) .dev::-webkit-scrollbar { display: none; }
  html:not(.story) .layer { scroll-snap-align: start; }
  html:not(.story) .layer.chat { --w: min(320px, calc(100vw - 56px)); }
  html:not(.story) .layer.watch { margin-top: 160px; }
}
@media (max-width: 560px) {
  .bar nav a:not(.keep) { display: none; }
  .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step:nth-child(n) { border-radius: 8px; padding-block: 18px 20px; }
  .step:first-child { border-radius: 28px 28px 8px 8px; }
  .step:last-child { border-radius: 8px 8px 28px 28px; }
  .field { flex-direction: column; }
  .field button { justify-content: center; }
  .forms li { grid-template-columns: minmax(0, 1fr); }
  .reads { text-align: left; }
  .apps-note { align-items: flex-start; }
  .pair { flex-direction: column; align-items: center; }
  .pair .panel { align-self: stretch; }
  .screen.inline { width: min(280px, 100%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
