/* cantino.eat — the app's Organic language on the web.
 *
 * Every colour below is a token from design/tokens.json (base, accents and
 * their dark pairs). The site adds layout, nothing else: if a value here
 * disagrees with tokens.json, tokens.json is right.
 */

@font-face { font-family: "Caprasimo"; src: url("/assets/fonts/Caprasimo-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/fonts/Figtree-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/fonts/Figtree-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/fonts/Figtree-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/fonts/Figtree-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/fonts/Figtree-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  color-scheme: light dark;

  --ground: #f5ead8;
  --crust: #e9dabb;
  --bowl: #fbf4e6;
  --paper: #fffdf8;
  --ink: #2a2018;
  --ink-soft: #5c4c3c;
  --terracotta: #a8431f;
  --on-terracotta: #fff7ef;
  --sage: #3d6a48;
  --honey: #7b5410;
  --ember: #8e2b24;
  --bark: #4a2c1c;
  --slate: #2f5c6b;
  --shade: #c9b38e;

  --t-action: #8f3517;
  --t-info: #28505d;
  --t-success: #345c3d;
  --t-caution: #6b4809;
  --t-warning: #7c231d;
  --t-urgent: #3f2415;
  --t-neutral: #4f4132;

  --bg-success: color-mix(in srgb, var(--sage) 9%, var(--paper));
  --bg-caution: #f2e2be;
  --bg-warning: #f6ded4;
  --bg-neutral: color-mix(in srgb, var(--ink-soft) 9%, var(--paper));
  --bg-info: color-mix(in srgb, var(--slate) 9%, var(--paper));

  --rule: color-mix(in srgb, var(--shade) 55%, transparent);
  --glaze: 0 2px 10px color-mix(in srgb, var(--shade) 7%, transparent);
  --sheet: 0 -10px 30px -8px color-mix(in srgb, var(--bark) 26%, transparent);
  --weave-x: color-mix(in srgb, var(--crust) 12%, transparent);
  --weave-y: color-mix(in srgb, var(--bowl) 28%, transparent);

  --display: "Caprasimo", ui-serif, Georgia, serif;
  --text: "Figtree", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --page: min(1200px, 100% - 48px);
  --band: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1e1712;
    --crust: #2a2018;
    --bowl: #262019;
    --paper: #2f2720;
    --ink: #f3e7d5;
    --ink-soft: #c4b29a;
    --terracotta: #e58356;
    --on-terracotta: #23150e;
    --sage: #7fb489;
    --honey: #e4b25a;
    --ember: #f0857c;
    --bark: #c9a288;
    --slate: #7fc0d4;
    --shade: #0f0b07;

    --t-action: #f09a6e;
    --t-info: #93cee0;
    --t-success: #93c79c;
    --t-caution: #edc471;
    --t-warning: #f79a92;
    --t-urgent: #d8b69c;
    --t-neutral: #d0bfa9;

    --bg-caution: #43341b;
    --bg-warning: #42231f;

    --rule: color-mix(in srgb, #6a563c 60%, transparent);
    --glaze: 0 2px 10px color-mix(in srgb, var(--shade) 7%, transparent);
    --sheet: 0 -10px 30px -8px rgb(0 0 0 / 0.6);
  }
}

/* ------------------------------------------------------------- the page -- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  /* The app's woven ground: a 28 px grid, verticals in crust, horizontals in
     bowl (Theme.swift, CantinoBackground). */
  background-color: var(--ground);
  background-image:
    linear-gradient(to right, var(--weave-x) 1px, transparent 1px),
    linear-gradient(to bottom, var(--weave-y) 1px, transparent 1px);
  background-size: 28px 28px;
}

::selection { background: color-mix(in srgb, var(--terracotta) 26%, transparent); color: var(--ink); }
:focus-visible { outline: 3px solid var(--slate); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: var(--shade) var(--ground); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: var(--shade); border-radius: 99px; border: 3px solid var(--ground); }

a { color: var(--t-info); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 12px;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- bands -- */

.band {
  background: var(--crust);
  border-bottom: 1px solid var(--rule);
}
.band-inner {
  width: var(--page);
  margin-inline: auto;
  min-height: var(--band);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.625rem;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }

/* The launch page's decision, repeated: the mark set down on a sage disc. */
.disc {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #3d6a48;
  flex: none;
}
.disc svg { width: 30px; height: 30px; display: block; }

.band nav ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.band nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 22px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.band nav a:hover { background: color-mix(in srgb, var(--bowl) 70%, transparent); }
.band nav a[aria-current="page"] { color: var(--t-action); }

/* -------------------------------------------------------------- buttons -- */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 26px;
  background: var(--terracotta);
  color: var(--on-terracotta);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.pill:hover { background: color-mix(in srgb, var(--terracotta) 88%, var(--ink)); text-decoration: none; }
.pill:active { transform: scale(0.97); }
.pill svg { width: 20px; height: 20px; flex: none; }

.pill-quiet {
  background: var(--bowl);
  color: var(--ink);
  border: 1.5px solid var(--shade);
  font-weight: 600;
}
.pill-quiet:hover { background: var(--paper); }

/* --------------------------------------------------------- food stamps -- */
/* FoodStamp: crust tile, shade border at 3.5% of its size, glyph inset 22%,
   corner 32%, a small fixed tilt per food (FoodIcon.swift). */

.stamp {
  --size: 48px;
  width: var(--size);
  height: var(--size);
  flex: none;
  padding: calc(var(--size) * 0.22);
  border-radius: 32%;
  background: var(--crust);
  border: max(1px, calc(var(--size) * 0.035)) solid var(--shade);
  rotate: var(--tilt, 0deg);
}
.stamp svg { display: block; width: 100%; height: 100%; overflow: visible; }
.stamp .s { stroke: var(--shade); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stamp .b { fill: var(--bowl); }
.stamp .n { fill: none; }
.stamp .f { fill: currentColor; }
.stamp .k { stroke: var(--ink-soft); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stamp .g { stroke: var(--sage); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.stamp .gf { fill: var(--sage); }
.stamp.sage { color: var(--sage); }
.stamp.terracotta { color: var(--terracotta); }
.stamp.slate { color: var(--slate); }
.stamp.honey { color: var(--honey); }
.stamp.bark { color: var(--bark); }
.stamp .w3 { stroke-width: 3; }
.stamp .w5 { stroke-width: 5; }
.tilt-p2 { --tilt: 2deg; }
.tilt-m1 { --tilt: -1deg; }
.tilt-m2 { --tilt: -2deg; }
.tilt-m3 { --tilt: -3deg; }
.tilt-p1 { --tilt: 1deg; }
.stamp .sh { fill: var(--shade); }
.stamp .w4 { stroke-width: 4; }

/* --------------------------------------------------------------- badges -- */

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1.5px solid currentColor;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge.success { color: var(--t-success); background: var(--bg-success); }
.badge.caution { color: var(--t-caution); background: var(--bg-caution); }
.badge.warning { color: var(--t-warning); background: var(--bg-warning); }
.badge.neutral { color: var(--t-neutral); background: var(--bg-neutral); }
.badge.info { color: var(--t-info); background: var(--bg-info); }
.badge.urgent { color: var(--paper); background: var(--bark); border-color: var(--bark); }

/* ============================================================ HOME PAGE == */
/* Six scenes, pinned while you scroll: a sentence typed one character at a
   time, the goals it becomes, a receipt read into the pantry, a recipe from
   it, the week, and the invite.
   It opens on the app's dark ground and gives each scene one full colour
   from the app's palette. Display type is Figtree, large and light; the
   app's own screens keep its light theme and Caprasimo, as the app does. */

@font-face { font-family: "Figtree"; src: url("/assets/fonts/Figtree-300.woff2") format("woff2"); font-weight: 300; font-display: swap; }

.home {
  --night: #1e1712;
  /* Each scene's colour. scenes.js reads these five to blend the stage. */
  --f0: #1e1712;
  --f1: #3d6a48;
  --f2: #7b5410;
  --f3: #8e2b24;
  --f4: #f5ead8;
  --cream: #f3e7d5;
  --cream-2: color-mix(in srgb, #f3e7d5 76%, transparent);
  --mark: #7fb489;
  --cta: #e58356;
  --on-cta: #23150e;
  --top-h: 68px;
  --edge: max(24px, (100% - 1200px) / 2);
  color-scheme: dark;
  background: var(--night);
  color: var(--cream);
}
.home ::selection { background: color-mix(in srgb, var(--cta) 40%, transparent); color: var(--cream); }
.home :focus-visible { outline-color: var(--cta); }
.home .pill { background: var(--cta); color: var(--on-cta); }
.home .pill:hover { background: color-mix(in srgb, var(--cta) 86%, #fff); }
.pill-sm { min-height: 40px; padding: 0 18px; border-radius: 20px; font-size: 0.9375rem; }

/* The app's light theme, wherever the page shows the app or its food. */
.screen, .calendar, .receipt {
  --ground: #f5ead8; --crust: #e9dabb; --bowl: #fbf4e6; --paper: #fffdf8;
  --ink: #2a2018; --ink-soft: #5c4c3c; --terracotta: #a8431f; --sage: #3d6a48;
  --honey: #7b5410; --ember: #8e2b24; --bark: #4a2c1c; --slate: #2f5c6b; --shade: #c9b38e;
  --t-action: #8f3517; --t-info: #28505d; --t-success: #345c3d; --t-caution: #6b4809;
  --t-warning: #7c231d; --t-neutral: #4f4132;
  --bg-success: color-mix(in srgb, #3d6a48 9%, #fffdf8); --bg-caution: #f2e2be;
  --bg-warning: #f6ded4; --bg-neutral: color-mix(in srgb, #5c4c3c 9%, #fffdf8);
  --rule: color-mix(in srgb, #c9b38e 55%, transparent);
  color: var(--ink);
}

/* ------------------------------------------------------------- header -- */

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: var(--edge);
  background: var(--night);
  color: var(--cream);
  border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent);
  transition: color 300ms var(--ease);
}
.story-on .top { position: fixed; inset: 0 0 auto; }
html[data-tone="light"] .top { color: #2a2018; }
.top .brand { color: inherit; }
.top .disc { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--cream) 55%, transparent); }
.top nav { display: flex; align-items: center; gap: 6px; }
.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 22px;
  color: inherit;
  font-weight: 500;
  text-decoration: none;
}
.top-link:hover { background: color-mix(in srgb, currentColor 10%, transparent); text-decoration: none; }

/* ------------------------------------------------------------- scenes -- */
/* Without the script, or with reduced motion, each scene is a section with
   its own colour. With it (.story-on) they stack inside one pinned stage
   and scenes.js feeds each one's progress, 0 to 1, as --t0 … --t4. */

.scene { position: relative; padding: clamp(80px, 10vw, 140px) var(--edge); }
.s-goals { background: var(--f1); }
.s-pantry { background: var(--f2); }
.s-recipe { background: var(--f3); }
.s-week { background: var(--f4); color: #2a2018; }

.story-on .story { height: calc(100svh * 10.6); }
.story-on .stage { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--night); }
.story-on .scene { position: absolute; inset: 0; padding: calc(var(--top-h) + 3vh) var(--edge) 4vh; background: none; }

h1, .copy h2, .join h2 { font-weight: 300; letter-spacing: -0.04em; }

/* 1 · the sentence */
.s-type { display: grid; align-content: start; gap: clamp(48px, 8vh, 88px); }
.hero h1 { font-size: clamp(3rem, 6.6vw, 6rem); line-height: 0.96; max-width: 12ch; }
.hero .promise { margin-top: 22px; max-width: 36ch; font-size: clamp(1.0625rem, 1.3vw, 1.25rem); line-height: 1.5; color: var(--cream-2); }
.hero .act { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hero .beta-note { color: var(--cream-2); font-size: 0.9375rem; }

.type { margin: 0; }
.type-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--cream) 18%, transparent);
  color: var(--cream-2);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.count { font-weight: 500; font-variant-numeric: tabular-nums; }
.type-review { margin-left: auto; color: var(--cta); }
.sentence {
  margin: 22px 0 0;
  max-width: 26ch;
  min-height: calc(3 * 1.12em);
  font-weight: 300;
  font-size: clamp(2rem, 4.4vw, 4.25rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.words mark {
  color: inherit;
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 100% / calc(var(--m, 1) * 100%) 0.06em;
  padding-bottom: 0.05em;
}
.caret { display: none; width: 0.06em; height: 0.9em; margin-left: 0.05em; vertical-align: -0.08em; background: var(--cta); }
.hint { display: none; }

/* 2, 3 and 4 · words beside the phone or the receipt */
.s-goals, .s-pantry, .s-recipe {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: clamp(40px, 7vw, 120px);
  align-items: center;
  align-content: center;
}
.copy h2 { font-size: clamp(2.25rem, 4.6vw, 4.5rem); line-height: 1.02; max-width: 15ch; }
.copy p { margin-top: 22px; max-width: 38ch; font-size: clamp(1.0625rem, 1.25vw, 1.1875rem); line-height: 1.55; }
.copy .fine { margin-top: 14px; font-size: 0.875rem; opacity: 0.9; }
.numbers { margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 20px 48px; }
.numbers div { display: flex; flex-direction: column-reverse; }
.numbers dd { margin: 0; font-weight: 300; font-size: clamp(2.75rem, 5.4vw, 5.25rem); line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.numbers dt { margin-top: 10px; font-size: 0.875rem; font-weight: 500; }

/* A drawn phone: the screen is laid out at the iPhone's own 390 × 844 and
   scaled, so its type stays in the app's proportions. */
.phone {
  --s: 0.76;
  --bz: 10px;
  position: relative;
  margin: 0;
  justify-self: center;
  width: calc(390px * var(--s) + 2 * var(--bz));
  height: calc(844px * var(--s) + 2 * var(--bz));
  padding: var(--bz);
  border-radius: calc(55px * var(--s) + var(--bz));
  background: #0f0b07;
  box-shadow: inset 0 0 0 1.5px #3a3029, 0 32px 64px -24px rgb(0 0 0 / 0.55);
  overflow: hidden;
}
.phone::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: calc(var(--bz) + 11px * var(--s));
  left: 50%;
  translate: -50% 0;
  width: calc(120px * var(--s));
  height: calc(35px * var(--s));
  border-radius: 99px;
  background: #0f0b07;
}
.screen {
  width: 390px;
  height: 844px;
  scale: var(--s);
  transform-origin: 0 0;
  border-radius: 55px;
  overflow: hidden;
  background: var(--ground);
  font-size: 16px;
  line-height: 1.35;
}
.app { height: 100%; display: flex; flex-direction: column; }
.app-status { display: flex; align-items: center; justify-content: space-between; height: 54px; padding: 16px 34px 0 44px; background: var(--crust); font-size: 16px; font-weight: 600; }
.batt { position: relative; width: 26px; height: 12px; border: 1.5px solid currentColor; border-radius: 4px; }
.batt::after { content: ""; position: absolute; inset: 1.5px 5px 1.5px 1.5px; border-radius: 1.5px; background: currentColor; }
.app-nav { padding: 8px 0 14px; background: var(--crust); border-bottom: 1px solid var(--rule); text-align: center; font-weight: 800; font-size: 18px; }
.app-body {
  flex: 1;
  padding: 4px 18px 24px;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--crust) 12%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--bowl) 28%, transparent) 1px, transparent 1px);
  background-size: 28px 28px;
}
.app-sec { margin: 18px 6px 8px; font-weight: 800; font-size: 19px; }
.app-card { padding: 4px 18px; border-radius: 22px; background: var(--bowl); }
.app-field { padding: 14px 14px 10px; }
.app-field p { min-height: 86px; padding: 10px 12px; border: 1px solid var(--shade); border-radius: 10px; font-size: 16px; }
.app-field-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--ink-soft); font-size: 13px; }
.app-act { color: var(--t-action); font-weight: 600; font-size: 15px; }
.app-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding-block: 10px; font-size: 16px; }
.app-row + .app-row { border-top: 1px solid var(--rule); }
.app-row .v { color: var(--ink-soft); text-align: right; }
.app-row .v.set { color: var(--ink); font-weight: 700; }
.app-hero { padding: 6px 22px 18px; background: var(--crust); border-bottom: 1px solid var(--rule); }
.app-title { font-family: var(--display); font-size: 30px; line-height: 1.08; letter-spacing: -0.01em; }
.app-sub { margin-top: 6px; color: var(--ink-soft); font-size: 18px; }
.app-recipe { margin-top: 14px; padding: 16px 18px 18px; background: var(--paper); border: 1px solid var(--rule); }
.hn { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 16px; }
.hn + .hn { margin-top: 8px; }
.hn .badge { font-size: 13px; min-height: 24px; }
.app-h { margin: 16px 0 10px; padding-top: 14px; border-top: 1px solid var(--rule); font-weight: 800; font-size: 19px; }
.facts4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
.facts4 div { display: grid; justify-items: center; gap: 2px; padding: 12px 4px; text-align: center; }
.facts4 div + div { border-left: 1px solid var(--rule); }
.facts4 b { font-weight: 800; font-size: 16px; }
.facts4 span { color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.ing { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 16px; }
.ing li { display: flex; align-items: center; gap: 12px; }
.steps { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: 15px; color: var(--ink-soft); }
.steps li::marker { color: var(--ink); font-weight: 700; }
.ing li::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--terracotta); }

/* 3 · the receipt: what the slip says on paper, and beside each line the
   food Cantino reads from it. */
.receipt {
  --pw: 45%;
  /* soft text beside the slip: 4.7:1 on the honey ground */
  --read-soft: color-mix(in srgb, var(--cream) 88%, transparent);
  position: relative;
  margin: 0;
  justify-self: center;
  width: clamp(440px, 46vw, 620px);
  max-width: 100%;
  padding-bottom: 12px;
}
.receipt .paper {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pw);
  border-radius: 4px 4px 0 0;
  background: var(--paper);
  /* the torn foot of the slip */
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 18px 100%;
}
.slip-head, .slip-foot, .line .raw {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.slip-head, .slip-foot { position: relative; display: flex; justify-content: space-between; gap: 12px; width: var(--pw); margin: 0; }
.slip-head { flex-direction: column; gap: 2px; padding: 18px 18px 12px; border-bottom: 1px dashed var(--shade); color: var(--ink-soft); }
.slip-head span:first-child { color: var(--ink); font-weight: 700; }
.slip-foot { padding: 12px 18px 18px; border-top: 1px dashed var(--shade); font-weight: 700; }
.scan { position: relative; }
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: var(--pw) minmax(0, 1fr); column-gap: 22px; align-items: center; min-height: clamp(44px, 6.4vh, 60px); }
.line .raw { display: flex; justify-content: space-between; gap: 12px; padding: 0 18px; }
.line.out .raw { color: var(--ink-soft); }
.line .read { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--cream); }
.line .stamp { --size: 38px; }
.nofood { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 1.5px dashed color-mix(in srgb, var(--cream) 45%, transparent); border-radius: 32%; color: var(--read-soft); }
.nofood svg { width: 18px; height: 18px; }
.said { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.said .name { font-size: 1.125rem; font-weight: 500; line-height: 1.25; }
.said .when { font-size: 0.875rem; color: var(--read-soft); }
.said .badge { margin-top: 3px; }
.line.out .name { color: var(--read-soft); text-decoration: line-through; text-decoration-thickness: 1px; }
.beam { display: none; }

/* 5 · the week, and nothing else */
.s-week { display: grid; align-content: center; gap: 18px; }
.calendar {
  margin: 0;
  display: grid;
  grid-template-columns: 6.5rem repeat(7, minmax(0, 1fr));
  grid-template-rows: auto repeat(3, minmax(min-content, 1fr)) auto;
  min-height: min(70vh, 660px);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 24px;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--shade) 7%, transparent);
  overflow: hidden;
}
.cal-slots { display: contents; }
.cal-slots span { grid-column: 1; display: flex; align-items: center; padding: 0 18px; color: var(--ink-soft); font-size: 0.8125rem; font-weight: 600; border-bottom: 1px solid var(--rule); }
.cal-slots span:nth-child(1) { grid-row: 1; }
.cal-slots span:nth-child(2) { grid-row: 2; }
.cal-slots span:nth-child(3) { grid-row: 3; }
.cal-slots span:nth-child(4) { grid-row: 4; }
.cal-slots span:nth-child(5) { grid-row: 5; border-bottom: 0; }
.cal-days, .cal-day ul { list-style: none; margin: 0; padding: 0; }
.cal-days { display: contents; }
.cal-day { grid-row: 1 / -1; display: grid; grid-template-rows: subgrid; border-left: 1px solid var(--rule); min-width: 0; }
.cal-day.today { background: var(--bowl); }
.cal-day h3 { display: flex; align-items: center; gap: 8px; padding: 16px 14px 14px; border-bottom: 1px solid var(--rule); font-size: 1rem; font-weight: 600; }
.cal-day abbr { text-decoration: none; }
.now { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 9px; background: var(--ink); color: var(--crust); font-size: 0.75rem; font-weight: 700; }
.cal-day ul { display: contents; }
.cal-day ul li { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule); font-size: 0.875rem; font-weight: 500; line-height: 1.3; }
.cal-day .stamp { --size: 38px; }
.cal-total { display: flex; align-items: center; padding: 14px; color: var(--ink-soft); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.week-cap { font-size: clamp(1.125rem, 1.4vw, 1.375rem); font-weight: 400; letter-spacing: -0.01em; color: #5c4c3c; }
.week-cap span { margin-left: 10px; font-weight: 400; opacity: 0.8; }

/* 6 · the invite */
.join { padding: clamp(120px, 16vw, 200px) var(--edge) clamp(100px, 12vw, 160px); }
.join h2 { font-size: clamp(2.75rem, 6vw, 6rem); line-height: 1; max-width: 14ch; }
.join h2::after { content: ""; display: inline-block; width: 0.06em; height: 0.85em; margin-left: 0.06em; vertical-align: -0.06em; background: var(--cta); animation: blink 1100ms steps(1) 4; }
.join p { margin-top: 24px; max-width: 40ch; color: var(--cream-2); font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); }
.join .pill { margin-top: 34px; }
@keyframes blink { 50% { opacity: 0; } }

.end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding: 28px var(--edge) 40px;
  border-top: 1px solid color-mix(in srgb, var(--cream) 12%, transparent);
  color: var(--cream-2);
  font-size: 0.9375rem;
}
.end .brand { color: var(--cream); font-size: 1.25rem; }
.end .disc { width: 32px; height: 32px; }
.end .disc svg { width: 24px; height: 24px; }
.end nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.end a:not(.brand) { color: inherit; text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.end a:not(.brand):hover { color: var(--cream); }
.end small { margin-left: auto; font-size: 0.875rem; }

/* --------------------------------------------------- the pinned story -- */
/* Every value below is a function of the scroll: --tN runs 0 → 1 through
   scene N. --a style locals are clamped slices of it; (1 - a)² eases. */

.story-on .s-type .hero { padding-top: clamp(24px, 9vh, 112px); }
.story-on .hero { --a: clamp(0, var(--t0) / 0.08, 1); opacity: calc(1 - var(--a)); translate: 0 calc(var(--a) * -56px); }
.story-on .type {
  --a: clamp(0, var(--t0) / 0.1, 1);
  --b: clamp(0, (var(--t1) - 0.02) / 0.1, 1);
  translate: 0 calc(var(--a) * var(--lift, 0px) * -1);
  opacity: calc(1 - var(--b));
}
.story-on .type-review { opacity: clamp(0, (var(--t0) - 0.88) / 0.08, 1); }
/* The caret blinks four times to say "type here", then holds steady. */
.story-on .caret { display: inline-block; animation: blink 1100ms steps(1) 4; }
.story-on .hint {
  display: flex;
  position: absolute;
  left: 50%;
  bottom: 4vh;
  translate: -50% 0;
  align-items: center;
  gap: 8px;
  color: var(--cream-2);
  font-size: 0.8125rem;
  font-weight: 600;
  opacity: calc(1 - clamp(0, var(--t0) / 0.04, 1));
}
.hint svg { width: 18px; height: 18px; }

.story-on .s-goals .copy {
  --a: clamp(0, (var(--t1) - 0.34) / 0.22, 1);
  opacity: calc(var(--a) * (1 - clamp(0, var(--t2) / 0.15, 1)));
  translate: 0 calc((1 - var(--a)) * (1 - var(--a)) * 32px);
}
.story-on .s-goals .phone {
  --a: clamp(0, var(--t1) / 0.3, 1);
  --x: clamp(0, var(--t2) / 0.14, 1);
  opacity: calc(var(--a) * (1 - var(--x)));
  translate: 0 calc((1 - var(--a)) * (1 - var(--a)) * 96px - var(--x) * var(--x) * 72px);
}
.story-on .s-pantry .copy {
  --a: clamp(0, (var(--t2) - 0.16) / 0.22, 1);
  opacity: calc(var(--a) * (1 - clamp(0, var(--t3) / 0.15, 1)));
  translate: 0 calc((1 - var(--a)) * (1 - var(--a)) * 32px);
}
.story-on .receipt {
  --a: clamp(0, (var(--t2) - 0.12) / 0.22, 1);
  --x: clamp(0, var(--t3) / 0.12, 1);
  opacity: calc(var(--a) * (1 - var(--x)));
  translate: 0 calc((1 - var(--a)) * (1 - var(--a)) * 96px - var(--x) * var(--x) * 72px);
}
/* A scan line runs down the slip; each line it passes is read. */
.story-on .beam {
  --p: clamp(0, (var(--t2) - 0.36) / 0.5, 1);
  display: block;
  position: absolute;
  z-index: 1;
  top: calc(var(--p) * 100%);
  left: -8px;
  width: calc(var(--pw) + 16px);
  height: 2px;
  border-radius: 2px;
  background: var(--cta);
  box-shadow: 0 0 14px 3px color-mix(in srgb, var(--cta) 55%, transparent);
  opacity: calc(clamp(0, (var(--t2) - 0.32) / 0.04, 1) * (1 - clamp(0, (var(--t2) - 0.86) / 0.04, 1)));
}
.story-on .line { --i: 0; --r: clamp(0, (var(--t2) - 0.37 - var(--i) * 0.083) / 0.065, 1); }
.story-on .line:nth-child(2) { --i: 1; }
.story-on .line:nth-child(3) { --i: 2; }
.story-on .line:nth-child(4) { --i: 3; }
.story-on .line:nth-child(5) { --i: 4; }
.story-on .line:nth-child(6) { --i: 5; }
.story-on .line .read { opacity: var(--r); translate: calc((1 - var(--r)) * (1 - var(--r)) * -28px) 0; }
.story-on .s-recipe .copy {
  --a: clamp(0, (var(--t3) - 0.2) / 0.25, 1);
  opacity: calc(var(--a) * (1 - clamp(0, var(--t4) / 0.15, 1)));
  translate: 0 calc((1 - var(--a)) * (1 - var(--a)) * 32px);
}
.story-on .numbers div { --k: 0; --a: clamp(0, (var(--t3) - 0.3 - var(--k) * 0.06) / 0.2, 1); opacity: var(--a); translate: 0 calc((1 - var(--a)) * (1 - var(--a)) * 24px); }
.story-on .numbers div:nth-child(2) { --k: 1; }
.story-on .numbers div:nth-child(3) { --k: 2; }
.story-on .s-recipe .phone {
  --a: clamp(0, (var(--t3) - 0.1) / 0.24, 1);
  --x: clamp(0, var(--t4) / 0.25, 1);
  opacity: calc(var(--a) * (1 - var(--x)));
  translate: 0 calc((1 - var(--a)) * (1 - var(--a)) * 96px + var(--x) * var(--x) * 140px);
}
.story-on .calendar {
  --a: clamp(0, (var(--t4) - 0.12) / 0.25, 1);
  opacity: var(--a);
  translate: 0 calc((1 - var(--a)) * (1 - var(--a)) * 48px);
}
.story-on .cal-day { --i: 0; --d: clamp(0, (var(--t4) - 0.22 - var(--i) * 0.05) / 0.18, 1); }
.story-on .cal-day:nth-child(2) { --i: 1; }
.story-on .cal-day:nth-child(3) { --i: 2; }
.story-on .cal-day:nth-child(4) { --i: 3; }
.story-on .cal-day:nth-child(5) { --i: 4; }
.story-on .cal-day:nth-child(6) { --i: 5; }
.story-on .cal-day:nth-child(7) { --i: 6; }
.story-on .cal-day ul li,
.story-on .cal-total { opacity: var(--d); translate: 0 calc((1 - var(--d)) * (1 - var(--d)) * 14px); }
/* The caption is the week's Example label: it stays, and lightens as the
   ground turns back to night (scenes.js writes --home, 0 to 1). */
.story-on .week-cap { opacity: clamp(0, (var(--t4) - 0.4) / 0.2, 1); color: color-mix(in srgb, #f3e7d5 calc(var(--home, 0) * 100%), #5c4c3c); }

/* The phrases that fly from the sentence into the phone (scenes.js). */
.flyers { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.chip {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  white-space: nowrap;
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.03em;
  /* Mid-flight a phrase becomes a sage token, so it reads over the cream
     screen it lands on (scenes.js eases --pill from 0 to 1). */
  --pill: 0;
  margin-left: -0.16em;
  padding: 0 0.16em 0.05em;
  border-radius: 0.28em;
  color: color-mix(in srgb, #1e1712 calc(var(--pill) * 100%), #f3e7d5);
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0.16em 100% / calc(100% - 0.32em) 0.06em,
    color-mix(in srgb, var(--mark) calc(var(--pill) * 100%), transparent);
  opacity: 0;
}

@media (max-height: 820px) { .phone { --s: 0.68; } }
@media (max-height: 720px) { .phone { --s: 0.6; } }

@media (max-width: 880px) {
  .home { --top-h: 60px; }
  .top-link { display: none; }
  .scene { padding-block: 72px; }
  .s-type { gap: 48px; }
  .hero h1 { font-size: clamp(2.75rem, 12vw, 3.75rem); }
  .s-goals, .s-pantry, .s-recipe { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  .copy h2 { font-size: clamp(2rem, 8.6vw, 2.75rem); }
  .numbers { margin-top: 24px; gap: 14px 28px; }
  .numbers dd { font-size: clamp(2rem, 9vw, 2.75rem); }
  .phone { --s: 0.6; --bz: 8px; }

  .story-on .scene { padding: calc(var(--top-h) + 18px) var(--edge) 16px; }
  .story-on .s-goals, .story-on .s-pantry, .story-on .s-recipe { align-content: start; row-gap: 18px; }
  .story-on .copy p { margin-top: 12px; font-size: 0.9375rem; }
  .story-on .s-recipe .copy p:not(.fine) { display: none; }
  .story-on .copy .fine { margin-top: 10px; font-size: 0.8125rem; }
  .story-on .numbers { margin-top: 16px; }

  .receipt { --pw: 50%; width: 100%; }
  .slip-head, .slip-foot, .line .raw { font-size: 0.6875rem; letter-spacing: 0; }
  .slip-head { padding: 14px 12px 10px; }
  .slip-foot { padding: 10px 12px 14px; }
  .line { min-height: clamp(38px, 5.8vh, 52px); column-gap: 14px; }
  .line .raw { gap: 8px; padding: 0 12px; }
  .line .read { gap: 10px; }
  .line .stamp { --size: 28px; }
  .nofood { width: 28px; height: 28px; }
  .nofood svg { width: 15px; height: 15px; }
  .said .name { font-size: 0.9375rem; }
  .said .when { font-size: 0.75rem; }

  .calendar { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: 0; }
  .cal-slots { display: none; }
  .cal-days { display: grid; }
  .cal-day { grid-row: auto; display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 10px; row-gap: 4px; padding: 10px 14px; border-left: 0; }
  .cal-day + .cal-day { border-top: 1px solid var(--rule); }
  .cal-day h3 { grid-area: 1 / 1; gap: 6px; padding: 0; border: 0; font-size: 0.9375rem; }
  .cal-day ul { grid-area: 1 / 2 / 3 / 3; display: grid; gap: 1px; min-width: 0; align-self: center; }
  .cal-day ul li { display: block; padding: 0; border: 0; font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-day .stamp { display: none; }
  .cal-total { grid-area: 2 / 1; align-self: start; padding: 0; font-size: 0.75rem; }
  .week-cap { font-size: 1rem; }
  .end small { margin-left: 0; }
}
@media (max-width: 880px) and (min-height: 860px) { .phone { --s: 0.64; } }
@media (max-width: 880px) and (max-height: 760px) { .phone { --s: 0.54; } }
/* Short phones: the receipt tightens so the words above it still fit. */
@media (max-width: 880px) and (max-height: 700px) {
  .story-on .s-pantry .copy .fine { display: none; }
}
/* Portrait tablets: the phone layout, but a bigger phone, centred. */
@media (max-width: 880px) and (min-height: 1000px) {
  .phone { --s: 0.86; --bz: 10px; }
  .story-on .s-goals, .story-on .s-pantry, .story-on .s-recipe { align-content: center; }
  .story-on .s-recipe .copy p { display: block; }
}


/* --------------------------------------------------------------- footer -- */

.foot { border-top: 1px solid var(--rule); border-bottom: 0; }
.foot .band-inner { min-height: 88px; flex-wrap: wrap; padding-block: 20px; }
.foot .brand { font-size: 1.25rem; }
.foot .disc { width: 32px; height: 32px; }
.foot .disc svg { width: 24px; height: 24px; }
.foot nav ul { flex-wrap: wrap; }
.foot small { color: var(--ink-soft); font-size: 0.875rem; }

/* ============================================================ READ PAGES == */

.doc {
  /* One column for everything on a reading page: about 70 characters of
     body text, with headings, rules and cards on the same right edge. */
  width: min(33rem, 100% - 48px);
  margin-inline: auto;
  padding-block: clamp(56px, 8vw, 96px) clamp(80px, 10vw, 128px);
}
.doc h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 5.4vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.012em;
}
.doc .lede { margin-top: 20px; font-size: 1.1875rem; }
.doc .updated { margin-top: 14px; color: var(--ink-soft); font-size: 0.9375rem; }
.doc h2 {
  margin-top: 52px;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.25;
}
.doc h2 + p, .doc h2 + ol, .doc h2 + ul { margin-top: 12px; }
.doc p + p { margin-top: 14px; }
.doc ol, .doc ul { padding-left: 1.4em; margin-bottom: 0; }
.doc li + li { margin-top: 8px; }
.doc li::marker { color: var(--ink-soft); font-weight: 700; }

.doc .card {
  margin-top: 36px;
  background: var(--bowl);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: var(--glaze);
  padding: 24px 26px 26px;
}
.doc .card h2 { margin-top: 0; }
.doc .card .pill { margin-top: 18px; }
.doc .mail { font-weight: 700; font-size: 1.1875rem; }

.doc details {
  border-bottom: 1px solid var(--rule);
}
.doc details:first-of-type { border-top: 1px solid var(--rule); margin-top: 16px; }
.doc summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 14px 0;
  font-weight: 700;
  font-size: 1.125rem;
}
.doc summary::-webkit-details-marker { display: none; }
.doc summary svg { width: 20px; height: 20px; flex: none; color: var(--ink-soft); transition: rotate 260ms var(--ease); }
.doc details[open] summary svg { rotate: 180deg; }
.doc details > div { padding: 0 0 22px; }
.doc details > div p + p { margin-top: 10px; }

.doc .steps-list { counter-reset: step; list-style: none; padding: 0; margin-top: 18px; }
.doc .steps-list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.doc .steps-list li:last-child { border-bottom: 1px solid var(--rule); }
.doc .steps-list li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--crust);
  border: 1px solid var(--rule);
  font-family: var(--display);
  font-size: 1.0625rem;
  line-height: 1;
}

.policy section + section { margin-top: 0; }
.policy .providers { margin-top: 14px; }

.lost {
  min-height: calc(100svh - var(--band) - 89px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* =========================================================== responsive == */

@media (max-width: 880px) {
  :root { --band: 60px; }
  .band nav a { padding: 0 10px; }
  .brand { font-size: 1.375rem; }
  .disc { width: 36px; height: 36px; }
  .disc svg { width: 27px; height: 27px; }
}

@media (max-width: 420px) {
  .band-inner { gap: 8px; }
  .band nav a { padding: 0 8px; font-size: 0.9375rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
