/* foodifyai.app v3 — colour chapters. Tokens first; everything else reads them. */
@font-face { font-family: "Pilcrow Rounded"; src: url("/assets/fonts/pilcrow-rounded-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pilcrow Rounded"; src: url("/assets/fonts/pilcrow-rounded-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Pilcrow Rounded"; src: url("/assets/fonts/pilcrow-rounded-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --cream: #FBF6EA;
  --cream-2: #F1EADA;
  --forest: #123D2B;
  --forest-2: #1B4A36;
  --green: #185A3E;
  --green-2: #21694A;
  --leaf: #7BE495;
  --sky: #71C7F8;
  --orange: #FF7A1A;
  --protein: #4ECDC4;
  --carbs: #FFD166;
  --fat: #EE6C4D;

  --ink: var(--forest);
  --ground: var(--cream);

  --font: "Pilcrow Rounded", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --step-small: 0.875rem;
  --step-body: 1.1875rem;
  --step-lead: 1.5rem;
  --step-head: clamp(2.5rem, 1.4rem + 4.2vw, 5.5rem);
  --step-display: clamp(3.25rem, 1.6rem + 6.4vw, 7.5rem);

  --margin: clamp(1rem, 0.4rem + 2.6vw, 2.5rem);
  --gap: clamp(1rem, 0.6rem + 1.6vw, 2rem);
  --section: clamp(5rem, 3rem + 8vw, 11rem);
  --radius: 20px;
  --max: 1360px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--orange); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--leaf); color: var(--forest); }
p { margin: 0 0 1em; max-width: 60ch; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.04em; line-height: 0.95; text-wrap: balance; }
h1 { font-size: var(--step-display); }
h2 { font-size: var(--step-head); }
h3 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.15; }
.lead { font-size: var(--step-lead); line-height: 1.4; }
.small { font-size: var(--step-small); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--margin); top: -100px; z-index: 50; background: var(--forest); color: var(--cream); padding: 0.6em 1em; border-radius: 999px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--margin); }

/* Fields. Every chapter is one flat colour with its own ink. */
.field { position: relative; padding-block: var(--section); }
.f-cream { background: var(--cream); color: var(--forest); }
.f-forest { background: var(--forest); color: var(--cream); }
.f-green { background: var(--green); color: var(--cream); }
.f-leaf { background: var(--leaf); color: var(--forest); }
.f-sky { background: var(--sky); color: var(--forest); }
.f-orange { background: var(--orange); color: var(--forest); }
.f-cream + .f-cream { padding-top: 0; }

/* Buttons and store links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 52px; padding: 0.7em 1.4em; border-radius: 999px;
  background: var(--forest); color: var(--cream); font: 500 var(--step-body)/1 var(--font);
  text-decoration: none; transition: transform 0.25s var(--ease), background-color 0.25s;
}
.btn:hover { transform: translateY(-2px); background: var(--green); }
.btn:active { transform: translateY(0) scale(0.98); }
.f-forest .btn, .f-green .btn { background: var(--cream); color: var(--forest); }
.f-forest .btn:hover, .f-green .btn:hover { background: var(--leaf); }
.store { display: inline-block; border-radius: 10px; line-height: 0; }
.store img { height: 56px; width: auto; }
.store-sm img { height: 40px; }

/* ------------------------------------------------------------ bar */
.bar { position: relative; z-index: 20; background: var(--cream); }
.bar .wrap { display: flex; align-items: center; gap: var(--gap); min-height: 84px; }
.bar .mark img { height: 34px; width: auto; }
.bar nav { margin-left: auto; }
.bar nav ul { display: flex; gap: clamp(1rem, 2vw, 2rem); list-style: none; margin: 0; padding: 0; }
.bar nav a { font-size: var(--step-body); font-weight: 500; text-decoration: none; padding: 0.5em 0; }
.bar nav a:hover { text-decoration: underline; text-decoration-color: var(--orange); }
@media (max-width: 899px) { .bar nav { display: none; } .bar .store { margin-left: auto; } }

/* ------------------------------------------------------------ hero */
.hero { position: relative; background: var(--cream); padding-top: clamp(1.5rem, 4vw, 4rem); overflow: clip; }
.hero-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); min-height: min(calc(100svh - 84px), 900px); }
.hero-copy { grid-column: 1 / span 6; position: relative; z-index: 3; padding-bottom: 4rem; }
.hero h1 { max-width: 7ch; }
.hero .lead { margin-top: 1.75rem; max-width: 32ch; }
.cta-row { display: flex; align-items: center; gap: 1.5rem; margin-top: 2rem; flex-wrap: wrap; }
.qr { display: none; align-items: center; gap: 0.9rem; padding: 0.6rem 1rem 0.6rem 0.6rem; background: var(--cream-2); border-radius: 16px; }
.qr img { width: 72px; height: 72px; background: var(--cream); padding: 6px; border-radius: 10px; }
.qr span { font-size: var(--step-small); line-height: 1.3; max-width: 13ch; }
@media (min-width: 900px) and (hover: hover) { .qr { display: inline-flex; } }
.terms { margin-top: 1.25rem; font-size: var(--step-small); max-width: 46ch; }

.stage {
  position: absolute; right: 0; bottom: 0; z-index: 1;
  width: 56vw; height: 82%;
}
.stage-bg { position: absolute; inset: 0; background: var(--green); clip-path: polygon(96px 0, 100% 0, 100% 100%, 0 100%, 0 96px); }
.stage-plate, .stage-screen, .stage-foodi { position: absolute; z-index: 2; }
.stage-plate { width: min(38vw, 620px); right: 9vw; top: 10%; }
/* The screen card is the front plane of the layered hero; its shadow is what separates it from the plate. taste-skill-ignore */
.stage-screen { width: clamp(170px, 14vw, 240px); left: -4.5rem; bottom: 7%; z-index: 4; filter: drop-shadow(0 24px 40px rgba(10, 30, 20, 0.35)); } /* taste-skill-ignore */
.stage-foodi { width: clamp(130px, 12vw, 210px); right: 1.2vw; bottom: 0; z-index: 3; }
.brackets { position: absolute; z-index: 3; width: min(38vw, 620px); aspect-ratio: 1; right: 9vw; top: 10%; pointer-events: none; }
.brackets i { position: absolute; width: 14%; aspect-ratio: 1; border: 5px solid var(--cream); border-radius: 4px; }
.brackets i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 28px; }
.brackets i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 28px; }
.brackets i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 28px; }
.brackets i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 28px; }

@media (max-width: 899px) {
  .hero-grid { display: block; min-height: 0; }
  .hero-copy { padding-bottom: 2.5rem; }
  .hero h1 { font-size: clamp(2.9rem, 13vw, 4.5rem); }
  .stage { position: relative; width: 100%; height: auto; aspect-ratio: 1 / 1.08; }
  .stage-bg { clip-path: polygon(64px 0, 100% 0, 100% 100%, 0 100%, 0 64px); }
  .stage-plate, .brackets { width: 82%; right: 9%; top: 6%; }
  .stage-screen { width: 36%; left: 6%; bottom: 3%; }
  .stage-foodi { width: 34%; right: 2%; }
}

/* Load moment: the scan frame closes on the plate, then the result rises. */
@media (prefers-reduced-motion: no-preference) {
  .brackets { animation: lock 1.1s var(--ease) 0.2s both; }
  .stage-screen { animation: rise 0.9s var(--ease) 0.95s both; }
  .stage-foodi { animation: peek 0.9s var(--ease) 0.6s both; }
}
.stage-foodi.blink { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .hero .stage-foodi.blink { animation: peek 0.9s var(--ease) 0.6s both, blink 4.6s steps(1) 2.4s infinite; }
}
@keyframes blink { 0%, 100% { opacity: 0; } 96% { opacity: 1; } 98.5% { opacity: 0; } }
@keyframes lock { from { transform: scale(1.14); opacity: 0; } 60% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes peek { from { transform: translateY(40%); } to { transform: none; } }

/* Depth on scroll: each plane moves at its own rate (native scroll timeline). */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 900px) {
    .stage-plate { animation: plate-depth linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    .hero .stage-foodi { animation: peek 0.9s var(--ease) 0.6s both, foodi-depth linear both; animation-timeline: auto, scroll(root); animation-range: normal, 0 100vh; }
    .hero .stage-foodi.blink { animation: peek 0.9s var(--ease) 0.6s both, foodi-depth linear both, blink 4.6s steps(1) 2.4s infinite; animation-timeline: auto, scroll(root), auto; animation-range: normal, 0 100vh, normal; }
  }
}
@keyframes plate-depth { to { transform: translateY(70px) rotate(14deg); } }
@keyframes foodi-depth { to { transform: translateY(-90px); } }

/* ------------------------------------------------------------ the scan (peak) */
.scan { padding-block: 0; }
.scan-track { position: relative; }
.scan-stick { min-height: 100svh; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: center; padding-block: var(--section); }
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .js .scan-track { height: 260vh; }
  .js .scan-stick { position: sticky; top: 0; height: 100svh; padding-block: 1.5rem; }
}
.scan-visual { grid-column: 1 / span 6; position: relative; }
.scan-copy { grid-column: 7 / span 6; }
.scan-copy h2 { font-size: var(--step-head); }
.plate-frame { position: relative; width: min(100%, 72svh); margin-inline: auto; }
.plate-frame > img { width: 100%; transition: opacity 0.35s, transform 0.6s var(--ease); }
.plate-frame.swap > img { opacity: 0; transform: rotate(-12deg) scale(0.96); }
.plate-frame .brackets { width: 100%; right: 0; top: 0; animation: none; transform: scale(calc(1.16 - 0.16 * var(--lock, 1))); opacity: var(--lock, 1); }

.tag {
  position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%);
  transform: translate(var(--ax, -50%), -50%);
  display: inline-flex; align-items: baseline; gap: 0.5em;
  padding: 0.5em 0.85em; border-radius: 999px;
  background: var(--cream); color: var(--forest);
  font-size: var(--step-small); font-weight: 500; white-space: nowrap;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.tag b { font-weight: 700; }
.tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--leaf); align-self: center; }
.js .tag:not(.on) { opacity: 0; transform: translate(var(--ax, -50%), -30%) scale(0.92); }

.steps { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.steps li { padding-left: 1.4rem; border-left: 4px solid rgba(251, 246, 234, 0.2); transition: border-color 0.3s, opacity 0.3s; }
.js .steps li { opacity: 0.5; }
.js .steps li.on { opacity: 1; border-color: var(--leaf); }
.steps b { display: block; font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.2; }
.steps span { display: block; max-width: 44ch; line-height: 1.4; }

.totals { margin-top: 1.1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.75rem; transition: opacity 0.4s; }
.js .totals:not(.on) { opacity: 0.25; }
.kcal { font-size: var(--step-head); font-weight: 700; letter-spacing: -0.04em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.kcal small { font-size: var(--step-lead); letter-spacing: 0; margin-left: 0.2em; }
.macros-line { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin: 0; font-variant-numeric: tabular-nums; }
.macros-line div { display: flex; gap: 0.4em; align-items: center; }
.macros-line dt::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.4em; background: var(--c); }
.macros-line dd { margin: 0; font-weight: 700; }
.saved { grid-column: 1 / -1; margin-top: 0.6rem; font-size: var(--step-small); }

.picker { margin-top: 1.1rem; }
.picker p { margin-bottom: 0.5rem; font-weight: 500; }
.picker-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.picker button {
  appearance: none; border: 0; cursor: pointer; font: inherit; color: inherit;
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px;
  padding: 0.25rem 0.8rem 0.25rem 0.25rem; font-size: var(--step-small); border-radius: 999px; background: var(--forest-2);
  transition: background-color 0.2s, transform 0.2s var(--ease);
}
.picker button img { width: 34px; height: 34px; }
.picker button:hover { background: var(--green); transform: translateY(-2px); }
.picker button[aria-pressed="true"] { background: var(--cream); color: var(--forest); }
.sample-note { margin: 0.75rem 0 0; font-size: var(--step-small); opacity: 0.85; max-width: 46ch; }

@media (prefers-reduced-motion: reduce) {
  .js .tag:not(.on), .js .totals:not(.on) { opacity: 1; transform: translate(var(--ax, -50%), -50%); }
  .js .steps li { opacity: 1; border-color: var(--leaf); }
  .plate-frame .brackets { --lock: 1; }
}
@media (max-width: 899px) {
  .scan-stick { display: block; }
  .scan-copy { margin-top: 2.5rem; }
  .plate-frame { width: 80%; }
  .tag { --ax: -50% !important; }
  .tag[style*="-80%"] { --ax: -62% !important; }
  .tag[style*="-20%"] { --ax: -38% !important; }
  .js .tag:not(.on), .js .totals:not(.on) { opacity: 1; transform: translate(var(--ax, -50%), -50%); }
  .js .steps li { opacity: 1; border-color: var(--leaf); }
  .plate-frame .brackets { --lock: 1; }
}

/* ------------------------------------------------------------ split sections */
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: center; }
.split > .text { grid-column: 1 / span 5; }
.split > .art { grid-column: 7 / span 6; position: relative; }
.split.flip > .text { grid-column: 8 / span 5; grid-row: 1; }
.split.flip > .art { grid-column: 1 / span 6; grid-row: 1; }
.text h2 + .lead, .text h2 + p { margin-top: 1.5rem; }
.points { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: 0.9rem; }
.points li { padding-left: 1.6rem; position: relative; max-width: 44ch; }
.points li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 10px; height: 10px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.f-cream .points li::before, .f-leaf .points li::before, .f-sky .points li::before { background: var(--orange); opacity: 1; }
@media (max-width: 899px) {
  .split { display: block; }
  .split > .art { margin-top: 3rem; }
}

/* App screens float over their field at different scroll rates; the drop carries that depth. */
.screen { filter: drop-shadow(0 28px 44px rgba(10, 30, 20, 0.22)); } /* taste-skill-ignore */

/* Macros collage */
.collage { position: relative; aspect-ratio: 1 / 1.12; }
.collage .screen { position: absolute; }
.collage .c1 { width: 44%; left: 28%; top: 0; z-index: 2; }
.collage .c2 { width: 34%; left: 0; top: 26%; z-index: 1; }
.collage .c3 { width: 34%; right: 0; top: 40%; z-index: 3; }
.barcode { margin-top: 3rem; padding-top: 2rem; border-top: 4px solid var(--cream-2); }
.barcode h3 { margin-bottom: 0.75rem; }

/* ------------------------------------------------------------ coach */
.coach { overflow: clip; }
.coach .split { align-items: center; }
.coach-media { position: relative; width: min(100%, 540px); margin: 0 auto calc(-1 * var(--section)); }
.coach-foodi { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover;
  /* a mask, not a fill: it fades the clip's edges so its sky and the page's sky read as one */
  -webkit-mask-image: radial-gradient(ellipse 72% 78% at 50% 52%, #000 70%, transparent 100%); /* taste-skill-ignore */
  mask-image: radial-gradient(ellipse 72% 78% at 50% 52%, #000 70%, transparent 100%); } /* taste-skill-ignore */
.coach-media .pause { top: 0.5rem; right: 0; bottom: auto; }
.thread { margin-top: 2rem; display: grid; gap: 0.9rem; max-width: 34rem; }
.bubble { padding: 1rem 1.2rem; border-radius: 22px; background: var(--cream); line-height: 1.45; }
.bubble.me { justify-self: end; max-width: 80%; background: var(--forest); color: var(--cream); border-bottom-right-radius: 6px; }
.bubble.foodi { justify-self: start; max-width: 92%; border-bottom-left-radius: 6px; }
.bubble .who { display: block; font-size: var(--step-small); font-weight: 700; margin-bottom: 0.25rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.chips span { padding: 0.55em 0.95em; border-radius: 999px; background: rgba(18, 61, 43, 0.12); font-size: var(--step-small); font-weight: 500; }
.coach .also { margin-top: 2rem; }

/* ------------------------------------------------------------ plan gallery */
.plan-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; margin-bottom: 3.5rem; }
.plan-head h2 { grid-column: 1 / span 6; }
.plan-head .text { grid-column: 8 / span 5; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile { margin: 0; display: flex; flex-direction: column; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.tile figcaption { padding: 0.9rem 1rem 1rem; display: grid; gap: 0.35rem; font-variant-numeric: tabular-nums; }
.tile .meal { display: flex; justify-content: space-between; gap: 1rem; font-weight: 700; }
.tile .nums { display: flex; justify-content: space-between; font-size: var(--step-small); }
.tile:nth-child(4n+1) figcaption { background: var(--cream); color: var(--forest); }
.tile:nth-child(4n+2) figcaption { background: var(--leaf); color: var(--forest); }
.tile:nth-child(4n+3) figcaption { background: var(--forest); color: var(--cream); }
.tile:nth-child(4n+4) figcaption { background: var(--orange); color: var(--forest); }
.tile.ui { background: var(--cream-2); justify-content: center; align-items: center; padding: 1.5rem; }
.tile.ui img { aspect-ratio: auto; width: 62%; }
@media (max-width: 899px) {
  .coach-media { width: 78%; }
  .tile .meal { flex-direction: column; gap: 0.1rem; }
  .plan { padding-block: 2.5rem 3rem; }
  .plan-head { display: block; }
  .plan-head .text { margin-top: 1.5rem; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile .nums span:nth-child(n+3) { display: none; }
}

/* ------------------------------------------------------------ progress */
.trio { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--gap); align-items: start; }
.trio .screen:nth-child(2) { margin-top: 4rem; }
.trio .screen:nth-child(3) { margin-top: 8rem; }
.figures { display: flex; gap: clamp(1.5rem, 4vw, 4rem); margin-top: 2.5rem; flex-wrap: wrap; }
.figures div { display: grid; }
.figures b { font-size: var(--step-head); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.medal-foodi { position: absolute; width: clamp(120px, 14vw, 220px); right: -1rem; top: -7rem; z-index: 3; }
@media (max-width: 899px) {
  .trio { grid-template-columns: 1fr 1fr; }
  .trio .screen:nth-child(3) { display: none; }
  .trio .screen:nth-child(2) { margin-top: 3rem; }
  .medal-foodi { top: -5.5rem; right: 0; }
}

/* ------------------------------------------------------------ more: board of close-ups */
.board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 104px; gap: 8px; }
.cell { position: relative; overflow: hidden; border-radius: 0; padding: 1.25rem; display: flex; flex-direction: column; justify-content: flex-end; }
.cell h3 { font-size: var(--step-lead); letter-spacing: -0.01em; }
.cell p { margin: 0.3rem 0 0; font-size: var(--step-small); max-width: 34ch; }
.cell .crop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cell .crop + div { position: relative; z-index: 1; margin: -1.25rem; padding: 1rem 1.25rem 1.25rem; background: inherit; }
.cell.head { justify-content: flex-start; }
.cell.head h2 { font-size: var(--step-head); letter-spacing: -0.05em; }
.c-cream { background: var(--cream); color: var(--forest); }
.c-leaf { background: var(--leaf); color: var(--forest); }
.c-green { background: var(--green); color: var(--cream); }
.c-sky { background: var(--sky); color: var(--forest); }
.c-orange { background: var(--orange); color: var(--forest); }
.c-forest2 { background: var(--forest-2); color: var(--cream); }
.cell .big { font-size: var(--step-head); font-weight: 700; letter-spacing: -0.05em; line-height: 0.9; }
.s-6x4 { grid-column: span 6; grid-row: span 4; }
.s-6x2 { grid-column: span 6; grid-row: span 2; }
.s-3x4 { grid-column: span 3; grid-row: span 4; }
.s-3x2 { grid-column: span 3; grid-row: span 2; }
@media (max-width: 899px) {
  .board { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(clamp(100px, 22vw, 150px), auto); gap: 6px; }
  .cell.head { grid-row: span 1; }
  .s-6x4 { grid-column: span 2; grid-row: span 4; }
  .s-6x2 { grid-column: span 2; grid-row: span 2; }
  .s-3x4 { grid-column: span 1; grid-row: span 3; }
  .s-3x2 { grid-column: span 1; grid-row: span 2; }
}

/* ------------------------------------------------------------ pricing */
.pricing { padding-bottom: 0; }
.pricing-head { margin-bottom: 3rem; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
.pricing-head h2 { grid-column: 1 / span 7; }
.pricing-head p { grid-column: 8 / span 5; margin: 0; }
.plans { display: grid; grid-template-columns: 7fr 5fr; }
.plan { min-height: 72svh; padding: clamp(1.5rem, 3vw, 3rem); display: flex; flex-direction: column; }
.plan h3 { font-size: var(--step-head); letter-spacing: -0.04em; line-height: 0.95; }
.plan .for { margin-top: 1rem; font-size: var(--step-lead); max-width: 24ch; }
.plan .price { margin-top: auto; display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.plan .price b { font-size: var(--step-display); letter-spacing: -0.05em; line-height: 0.85; font-variant-numeric: tabular-nums; }
.plan .price span { font-size: var(--step-lead); }
.plan .detail { margin: 1rem 0 1.5rem; }
.plan .btn { align-self: flex-start; }
.plan.yearly .btn { background: var(--forest); color: var(--cream); }
.price-note { padding-block: 2rem 0; }
@media (max-width: 899px) {
  .pricing-head { display: block; }
  .pricing-head p { margin-top: 1rem; }
  .plans { grid-template-columns: 1fr; margin-inline: calc(-1 * var(--margin)); }
  .plan { min-height: 64svh; }
  .plan .btn { align-self: stretch; }
}

/* ------------------------------------------------------------ glance, guides, faq */
.glance dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--gap); margin: 2.5rem 0 0; }
.glance dl div { padding: 1.1rem 0; border-top: 3px solid var(--cream-2); display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; }
.glance dt { font-weight: 700; }
.glance dd { margin: 0; }
@media (max-width: 899px) { .glance dl { grid-template-columns: 1fr; } .glance dl div { grid-template-columns: 1fr; gap: 0.2rem; } }

.guide-list { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.guide-list a { display: grid; gap: 0.3rem; height: 100%; padding: 1.25rem 1.4rem; background: var(--cream-2); text-decoration: none; transition: background-color 0.2s, transform 0.25s var(--ease); }
.guide-list a:hover { background: var(--leaf); transform: translateY(-2px); }
.guide-list b { font-size: var(--step-body); letter-spacing: -0.01em; line-height: 1.25; }
.guide-list span { font-size: var(--step-small); }
@media (max-width: 599px) { .guide-list { grid-template-columns: 1fr; } }

.faq-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.faq-grid > h2 { grid-column: 1 / span 4; position: sticky; top: 96px; align-self: start; }
.faq-list { grid-column: 5 / span 8; display: grid; gap: 8px; }
.faq-list details { background: var(--cream-2); border-radius: var(--radius); transition: background-color 0.25s; }
.faq-list summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 72px; padding: 1rem 1.5rem; font-weight: 500; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary i { position: relative; flex: none; width: 16px; height: 16px; }
.faq-list summary i::before, .faq-list summary i::after { content: ""; position: absolute; left: 0; top: 6.5px; width: 16px; height: 3px; border-radius: 2px; background: currentColor; transition: transform 0.3s var(--ease); }
.faq-list summary i::after { transform: rotate(90deg); }
.faq-list details[open] { background: var(--orange); }
.faq-list details[open] summary i::after { transform: rotate(0deg); }
.faq-list .answer { padding: 0 1.5rem 1.5rem; }
.faq-list .answer p { max-width: 58ch; }
@media (max-width: 899px) { .faq-grid { display: block; } .faq-grid > h2 { position: static; margin-bottom: 2rem; } }

/* ------------------------------------------------------------ close */
.close { padding-top: calc(var(--section) * 0.6); padding-bottom: 0; overflow: clip; text-align: left; }
#faq { padding-bottom: calc(var(--section) * 0.6); }
.close-copy { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
.close-copy h2 { grid-column: 1 / span 7; }
.close-copy .text { grid-column: 8 / span 5; }
.close-video { position: relative; margin-top: clamp(1rem, 3vw, 3rem); }
.close-video video, .close-video img { width: 100%; aspect-ratio: 1600 / 686; object-fit: cover; }
.pause { position: absolute; right: var(--margin); bottom: 1rem; z-index: 2; min-height: 44px; padding: 0.5em 1em; border: 0; border-radius: 999px; background: rgba(18, 61, 43, 0.85); color: var(--cream); font: 500 var(--step-small) var(--font); cursor: pointer; }
@media (max-width: 899px) {
  .close-copy { display: block; }
  .close-copy .text { margin-top: 1.5rem; }
  .close-video video, .close-video img { aspect-ratio: 4 / 3; object-position: 50% 100%; }
}

/* ------------------------------------------------------------ footer */
.foot { background: var(--forest); color: var(--cream); padding-block: 4rem 2.5rem; }
.foot-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 2rem; }
.foot .mark { grid-column: 1 / span 4; }
.foot .mark img { width: 200px; height: auto; }
.foot .mark p { margin-top: 1rem; font-size: var(--step-small); max-width: 30ch; }
.foot nav { grid-column: span 2; }
.foot nav.wide { grid-column: span 4; }
.foot h2 { font-size: var(--step-body); letter-spacing: 0; line-height: 1.3; margin-bottom: 0.9rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; font-size: var(--step-small); }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; text-decoration-color: var(--leaf); }
.legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 3px solid var(--forest-2); display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; font-size: var(--step-small); }
.legal p { margin: 0; max-width: 70ch; }
@media (max-width: 899px) {
  .foot .mark, .foot nav.wide { grid-column: 1 / -1; }
  .foot nav { grid-column: span 6; }
}


/* Section entrances (JS adds .js; without it everything is simply there). */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal > * { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.8s var(--ease); }
  .js .reveal.in > * { opacity: 1; transform: none; }
  .js .reveal.in > *:nth-child(2) { transition-delay: 80ms; }
  .js .reveal.in > *:nth-child(3) { transition-delay: 160ms; }
  .js .reveal.in > *:nth-child(4) { transition-delay: 240ms; }
  .js .reveal.in > *:nth-child(5) { transition-delay: 320ms; }
  .js .reveal.in > *:nth-child(n+6) { transition-delay: 400ms; }
}

/* Screens drift against the scroll inside their section (native view timeline). */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 900px) {
    .drift-1 { animation: drift-a linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    .drift-2 { animation: drift-b linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    .drift-3 { animation: drift-c linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
  }
}
@keyframes drift-a { from { translate: 0 60px; } to { translate: 0 -60px; } }
@keyframes drift-b { from { translate: 0 140px; } to { translate: 0 -140px; } }
@keyframes drift-c { from { translate: 0 -30px; } to { translate: 0 30px; } }

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

/* ------------------------------------------------------------ revision: iPhone frames, one size everywhere */
.phone { width: 200px; max-width: 100%; height: auto; }
.phones { display: flex; justify-content: center; align-items: flex-start; gap: clamp(0.75rem, 2vw, 1.75rem); }
.phones .phone:nth-child(2) { margin-top: 3rem; }
.tile.ui .phone { width: 200px; aspect-ratio: auto; }
.trio, .collage { display: none; }

.stage-video { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; }
.stage-video video { width: 100%; height: 100%; object-fit: contain; }
.stage-video .pause { top: 1rem; right: 1rem; bottom: auto; }
.stage-phone { position: absolute; z-index: 4; width: 200px; left: 1rem; bottom: 4%; }

#more h2 { margin-bottom: 3rem; }
.row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.row figure { margin: 0; display: grid; justify-items: center; gap: 1.25rem; text-align: center; }
.row figcaption { max-width: 24ch; }
.row figcaption b { display: block; font-size: var(--step-lead); letter-spacing: -0.02em; margin-bottom: 0.25rem; }
.extras { list-style: none; margin: 4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem var(--gap); }
.extras li { padding: 1.25rem 1.4rem; background: var(--forest-2); }
@media (max-width: 899px) {
  .phone { width: 42vw; max-width: 200px; }
  .phones .phone:nth-child(3) { display: none; }
  .row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 3rem; }
  .extras { grid-template-columns: 1fr; }
  .stage-phone { width: 34%; left: 4%; bottom: 4%; }
  .stage { aspect-ratio: 16 / 11; }
}
.phones .phone, .row .phone { flex: 1 1 0; min-width: 0; width: 100%; max-width: 200px; }
.phones { max-width: 100%; }

/* ------------------------------------------------------------ intro: Foodi powers up, Apple-style frame sequence */
.bar-dark { background: #121413; color: var(--cream); }
.intro { position: relative; background: #121413; color: var(--cream); --fin: 0; --mark: 0; }
.intro-stick { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: #121413; }
.js .intro { height: 460vh; }
.js .intro-stick { position: sticky; top: 0; }
.seq-poster, .seq, .finale { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.seq-poster { z-index: 0; }
.seq { z-index: 1; }
.finale { z-index: 2; opacity: var(--fin); background: #5a0d04; }
.intro-lines { position: absolute; z-index: 4; inset: 9% var(--margin) auto; display: grid; justify-items: center; text-align: center; }
.intro-line { grid-area: 1 / 1; margin: 0; max-width: 16ch; font-size: var(--step-head); font-weight: 700; letter-spacing: -0.04em; line-height: 0.95; text-wrap: balance;
  color: var(--cream); text-shadow: 0 2px 24px rgba(40, 8, 0, 0.6); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); } /* taste-skill-ignore */
.js .intro-line:not(.on) { opacity: 0; transform: translateY(24px); }
.intro-mark { position: absolute; z-index: 3; left: 50%; top: 54%; width: min(52vw, 860px); height: auto;
  transform: translate(-50%, -50%) scale(calc(0.86 + 0.14 * var(--mark))); opacity: var(--mark);
  filter: drop-shadow(0 6px 30px rgba(60, 10, 0, 0.55)); } /* taste-skill-ignore */
@media (prefers-reduced-motion: reduce) {
  .js .intro { height: auto; }
  .js .intro-stick { position: relative; }
  .js .intro-line:not(.on) { display: none; }
  .intro-lines { gap: 0.4rem; }
  .intro-line.on { grid-area: auto; }
}
@media (max-width: 899px) {
  .intro-lines { top: 8%; }
  .intro-line { font-size: clamp(2.2rem, 10vw, 3.4rem); }
  .intro-mark { width: 80vw; top: 50%; }
}

/* progress: Foodi stands under the phones */
.medal-foodi { position: static; display: block; width: clamp(120px, 12vw, 180px); margin: 1.5rem 0 0 auto; }
/* the lines sit over moving fire; a soft dark halo keeps them readable */
.intro-line { text-shadow: 0 2px 24px rgba(60, 12, 0, 0.55); } /* taste-skill-ignore */

/* ------------------------------------------------------------ languages */
.langs { margin-top: 2.5rem; }
.langs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: var(--step-small); }
.langs a[aria-current] { color: var(--leaf); text-decoration: underline; text-underline-offset: 0.2em; }
/* translated display headings run longer than English; long words hyphenate instead of overflowing */
html:not([lang="en"]):not([lang="ja"]) :is(h1, h2, .intro-line) { hyphens: auto; overflow-wrap: break-word; }
/* Japanese: the Latin face has no kana, so use the rounded system Gothic and drop the tight tracking */
:lang(ja) body { font-family: "Pilcrow Rounded", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ja) .intro-line, :lang(ja) .kcal, :lang(ja) .steps b, :lang(ja) .figures b { letter-spacing: 0; line-height: 1.2; word-break: auto-phrase; }
/* the 7ch hero title fits "AI calorie counter"; translated titles have longer words */
html:not([lang="en"]) .hero h1 { max-width: 11ch; font-size: clamp(2.75rem, 1.2rem + 5vw, 6.25rem); }
@media (max-width: 899px) { html:not([lang="en"]) .hero h1 { font-size: clamp(2.4rem, 10.5vw, 4rem); } }

/* ------------------------------------------------------------ Foodi chat */
.msgs { display: grid; gap: 0.9rem; min-height: 13.5rem; align-content: start; }
.chips-hint { margin: 0.6rem 0 0; font-size: var(--step-small); font-weight: 700; opacity: 0.75; }
.chips button { font: inherit; font-size: var(--step-small); font-weight: 500; color: var(--forest); padding: 0.55em 0.95em; border: 0; border-radius: 999px; background: rgba(18, 61, 43, 0.12); cursor: pointer; transition: background-color 0.2s, color 0.2s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.chips button:hover { background: rgba(18, 61, 43, 0.2); }
.chips button:active { transform: scale(0.95); }
.chips button[aria-pressed="true"] { background: var(--forest); color: var(--cream); }
.chips button:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.chat-note { margin: 0.2rem 0 0; font-size: var(--step-small); opacity: 0.7; }
.bubble.pop { animation: bubble-in 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.bubble.me.pop { transform-origin: 100% 100%; }
.bubble.foodi.pop { transform-origin: 0 100%; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(0.85); } to { opacity: 1; transform: none; } }
.bubble.typing { display: inline-flex; gap: 0.3rem; padding: 1.05rem 1.2rem; }
.bubble.typing i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--forest); opacity: 0.35; animation: typing-dot 1s ease-in-out infinite; }
.bubble.typing i:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-dot { 0%, 60%, 100% { transform: none; opacity: 0.35; } 30% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bubble.typing i { animation: none; } }

/* without the Turkish köfte tile the phone fills the last row */
.gallery:not(:has(.tile:nth-child(6))) .tile.ui { grid-column: span 2; }
