/* Happy Spoon shop, built on the Flavor Flood brand (brand/index.html).
   The featured flavor floods the whole page with its color, tubs wait on the glass shelf like the waitlist,
   and below them a full-width white section. The current flavor sets --bg, --deep, --glow, --ink and --btn. */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #ef4c3c; }
@property --deep { syntax: "<color>"; inherits: true; initial-value: #cf3a2b; }
@property --glow { syntax: "<color>"; inherits: true; initial-value: #ff8a78; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #ffffff; }
@property --btn { syntax: "<color>"; inherits: true; initial-value: #2a0f0b; }
:root {
  transition: --bg .9s cubic-bezier(.65, 0, .35, 1), --deep .9s cubic-bezier(.65, 0, .35, 1), --glow .9s cubic-bezier(.65, 0, .35, 1), --ink .6s ease, --btn .9s ease;
  --bg: #ef4c3c; --deep: #cf3a2b; --glow: #ff8a78; --ink: #ffffff; --btn: #2a0f0b;
  /* Neutrals from the brand guide: white pages, ink text, paper cards */
  --text: #15191d; --sub: #5d6870; --paper: #f3f3f1; --line: #e3e3df;
  --ease: cubic-bezier(.65, 0, .35, 1);
  --gutter: 18px;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  font-family: "Archivo", system-ui, sans-serif; color: var(--ink); background: var(--bg); overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wordmark {
  display: block; width: 84px; aspect-ratio: 640 / 422; background: currentColor;
  -webkit-mask: url(../assets/logos/happy-spoon-wordmark-mask.png) center / contain no-repeat;
  mask: url(../assets/logos/happy-spoon-wordmark-mask.png) center / contain no-repeat;
}
/* Brand type: wide for flavor names and numbers, condensed for headlines */
.wide { font-weight: 900; font-stretch: 125%; font-variation-settings: "wdth" 125; text-transform: uppercase; letter-spacing: -.02em; line-height: .86; }
.cond { font-weight: 880; font-stretch: 72%; font-variation-settings: "wdth" 72; text-transform: uppercase; line-height: .95; letter-spacing: -.005em; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.smile { display: block; aspect-ratio: 338 / 103; background: currentColor;
  -webkit-mask: url(../assets/logos/happy-spoon-smile.png) center / contain no-repeat; mask: url(../assets/logos/happy-spoon-smile.png) center / contain no-repeat; }

/* Stat block: protein and calories side by side. 20 g / 180 are placeholders until the recipes are final. */
.stats { --ss: 40px; display: flex; align-items: flex-end; gap: calc(var(--ss) * .45); }
.stat b { display: block; font-size: var(--ss); font-variant-numeric: tabular-nums; }
.stat b i { font-style: normal; font-size: .5em; margin-left: .06em; text-transform: none; }
.stat small { display: block; margin-top: calc(var(--ss) * .16); font-size: max(10px, calc(var(--ss) * .2)); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.stat + .stat { padding-left: calc(var(--ss) * .45); box-shadow: -2px 0 0 color-mix(in srgb, currentColor 30%, transparent); }

/* ---------- Builder (hero) ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--bg); color: var(--ink);
  /* Phones: the stage height below still budgets 76px here, so this smaller padding ends the section a nudge
     above the bottom of the screen and the white section just peeks up */
  padding: max(env(safe-area-inset-top), 12px) var(--gutter) 52px;
  display: grid; grid-template-areas: "top" "stage" "panel";
}
.top { grid-area: top; }   /* the header itself is assets/site-header.css */
.box-btn.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.12); } }

.stage { grid-area: stage; position: relative;
  /* Phones: a plain fixed height worked out so the flavor section ends at the bottom of the screen:
     screen height minus the header (58), gap (28), name/price/button block (152) and bottom padding (76) */
  height: clamp(330px, calc(100lvh - 314px - max(env(safe-area-inset-top), 12px)), 620px); margin-top: 28px; touch-action: manipulation; }
.tub { position: absolute; left: 0; top: 0; aspect-ratio: 600 / 720; transform-origin: 50% 100%; will-change: transform; cursor: pointer; outline: none; }
.tub img { width: 100%; height: 100%; -webkit-user-drag: none; pointer-events: none; user-select: none; }
.tub:focus-visible::after { content: ""; position: absolute; inset: -6px; border-radius: 16px; box-shadow: 0 0 0 3px var(--ink); }
.halo {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--glow) 85%, var(--bg)), color-mix(in srgb, var(--glow) 35%, var(--bg)) 70%);
  box-shadow: inset 0 -30px 60px -30px color-mix(in srgb, var(--deep) 60%, transparent);
}
.halo.pulse { animation: pulse 1.1s var(--ease); }
@keyframes pulse { 40% { transform: scale(.94); } 70% { transform: scale(1.025); } }

/* Glass shelf, as on the waitlist */
.shelf { position: absolute; top: 0; left: -24px; right: -24px; height: 100%; pointer-events: none; z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.shelf > * { position: absolute; }
.face { left: 0; right: 0; overflow: hidden; background: linear-gradient(rgba(255,255,255,.05), rgba(255,255,255,.22)); }
.edge { left: 0; right: 0; background: linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.22)); }
.under { left: 0; right: 0; background: radial-gradient(60% 100% at 50% 0, rgba(0,0,0,.2), transparent); }
.refl { position: absolute; opacity: .32; transform: scaleY(-1); transition: opacity .35s ease .8s;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 38%); mask-image: linear-gradient(to top, #000 0%, transparent 38%); }
.cshadow { border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.32), rgba(0,0,0,0)); transition: opacity .35s ease .8s; }
.gone { opacity: 0 !important; transition-delay: 0s !important; }

/* How many of each flavor are in the box, shown on the shelf */
.badge {
  position: absolute; z-index: 6; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; pointer-events: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
  background: #fff; color: var(--text); box-shadow: 0 4px 12px -4px rgba(0,0,0,.35);
  transform: scale(0); transition: transform .3s var(--ease);
}
.badge.on { transform: scale(1); }

.panel { grid-area: panel; position: relative; z-index: 5; container-type: inline-size; }
.panel .eyebrow { opacity: .85; }
/* Flavor name: wide, on two lines, sliding up as the flavor changes */
.name { position: relative; height: 1.02em; overflow: hidden; margin-top: 10px; font-size: 7.6cqi; }   /* phones: every name on one line, one shared size */
.name br { display: none; }
.name span { position: absolute; left: 0; top: 0; white-space: nowrap; }
.name span.in { animation: nameIn .8s var(--ease) both; }
.name span.out { animation: nameOut .8s var(--ease) both; }
@keyframes nameIn { from { transform: translateY(105%); } }
@keyframes nameOut { to { transform: translateY(-105%); } }
.hero-stats { margin-top: 12px; display: none; }   /* phones show them beside the tub instead */
.side-stat { position: absolute; z-index: 1; transform: translateY(-50%); container-type: inline-size; text-align: center; opacity: .55; pointer-events: none; }
.side-stat b { display: block; font-size: min(36cqi, 40px); }
.side-stat b i { font-style: normal; font-size: .5em; text-transform: none; }
.side-stat small { display: block; margin-top: 5px; font-size: 8.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.price { margin-top: 12px; font-size: 15px; font-weight: 500; opacity: .92; }
.price b { font-size: 17px; font-weight: 800; }

/* Add to box: a big button, which becomes a stepper once the flavor is in the box */
.adder { margin-top: 12px; }
.add-main {
  width: 100%; height: 60px; border: 0; border-radius: 999px; padding: 0 22px; background: var(--btn); color: #fff; font-size: 16px; font-weight: 800;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.4); transition: background-color .9s var(--ease), transform .15s ease;
}
.add-main:active { transform: scale(.98); }
.step { display: none; align-items: center; justify-content: space-between; gap: 6px; padding: 5px; border-radius: 999px; background: #fff; color: var(--text); }
.step button { flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--paper); transition: transform .15s ease; }
.step button:active { transform: scale(.92); }
.step button svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.step output { min-width: 2em; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.has .add-main, .has > .add { display: none; }
.has .step { display: flex; }
.adder .step { height: 60px; padding: 5px; box-shadow: 0 10px 30px -12px rgba(0,0,0,.4); }   /* same height as the Add button, so nothing shifts */
.adder .step button { width: 50px; height: 50px; background: var(--btn); color: #fff; transition: background-color .9s var(--ease), transform .15s ease; }
.adder .step output { font-size: 16px; }

/* ---------- Full-width white section ---------- */
.story { position: relative; }
.sheet { position: relative; background: #fff; color: var(--text); padding: 44px 20px 52px; }
.sheet .dim { color: var(--sub); }
.sheet .big { margin-top: 10px; font-size: clamp(44px, 12vw, 88px); }
.sheet .mid { margin-top: 56px; font-size: clamp(38px, 10vw, 64px); scroll-margin-top: 20px; }
.sheet .lede { margin-top: 10px; max-width: 520px; font-size: 17px; line-height: 1.45; color: var(--sub); }


/* Why Happy Spoon: centered; the spotlighted flavor's tub on a disc of its color, protein and calories either side */
.why { text-align: center; }
.why .big { margin-top: 10px; }
.why-by { margin: 14px auto 0; max-width: 520px; font-size: clamp(17px, 1.8vw, 21px); line-height: 1.4; color: var(--sub); }
.why-by a { color: var(--text); font-weight: 800; }
.why-stage { display: grid; gap: 18px; align-items: center; margin: 32px auto 0; max-width: 1100px; }
.why-disc { position: relative; width: min(440px, 86vw); height: min(440px, 86vw); margin: 0 auto; border-radius: 50%; overflow: hidden; background: var(--bg); transition: background-color .9s var(--ease); }
.why-tub { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: opacity .35s ease; }
.why-tub.swap { opacity: 0; }
.callout b { display: block; font-size: clamp(64px, 9vw, 120px); }
.callout b i { font-style: normal; font-size: .45em; text-transform: none; margin-left: .04em; }
.callout small { display: block; margin-top: 8px; font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sub); }
.callout p { margin-top: 8px; font-size: 14px; color: var(--sub); }
.why-close { margin-top: 30px; font: 880 clamp(26px, 3.2vw, 42px)/1 "Archivo", sans-serif; font-stretch: 72%; font-variation-settings: "wdth" 72; text-transform: uppercase; }
.fine { margin-top: 10px; font-size: 13px; color: var(--sub); }
@media (max-width: 899px) {
  /* Phones: tub first, then the two numbers side by side */
  .why-stage { grid-template-columns: 1fr 1fr; gap: 22px 12px; }
  .why-disc { grid-column: 1 / -1; grid-row: 1; width: min(320px, 78vw); height: min(320px, 78vw); }
  .callout b { font-size: clamp(54px, 16vw, 76px); }
}
@media (min-width: 900px) {
  .why-stage { grid-template-columns: 1fr auto 1fr; gap: 40px; }
  .callout.l { text-align: right; } .callout.r { text-align: left; }
}

/* Flavor cards: tub on its flood, faint giant name behind */
.cards {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(76%, 280px); gap: 12px;
  margin: 24px -20px 0; padding: 0 20px 6px; scroll-padding: 0 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.cards::-webkit-scrollbar { display: none; }
.card { scroll-snap-align: start; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--paper); scroll-margin-top: 20px; }
.card .art { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--c-bg); }
/* Flavor display photos (assets/<flavor>/<flavor>-display-closed.webp) already carry the flavor color, so they fill the square */
.card .art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .art img { transform: scale(1.04); }
.card .body { flex: 1; display: flex; flex-direction: column; padding: 16px 16px 16px; }
.card .body { container-type: inline-size; }
.card h3 { font-size: 7.6cqi; white-space: nowrap; }   /* longest name (Chocolate Fudge) fits on one line */
.card .stats { --ss: 26px; margin-top: 14px; }
.card .row { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card .row > b { font-size: 16px; font-weight: 800; }
.card .add { border: 0; border-radius: 999px; padding: 13px 18px; background: var(--c-btn); color: #fff; font-weight: 800; font-size: 14.5px; transition: transform .15s ease; }
.card .add:active { transform: scale(.96); }
.card .step { background: #fff; }
.card .step button { width: 36px; height: 36px; }

/* The lineup strip: the only place all five colors meet */
.strip { display: grid; grid-template-columns: repeat(5, 1fr); }
.strip span { padding: 14px 4px; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--c); }
/* Pulling past the footer on a phone shows footer brown instead of the flavor color */
body::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 50vh; background: #2a1712; z-index: -1; pointer-events: none; }
main, .hero { position: relative; }
.shop-footer { margin-top: 0; padding-bottom: max(48px, env(safe-area-inset-bottom)); }

/* ---------- "Added" toast: drops in at the top, near the header's box button (clear of Safari's bottom toolbar) ---------- */
.toast {
  position: fixed; z-index: 30; left: 50%; top: max(env(safe-area-inset-top), 12px); width: max-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 999px; background: #fff; color: var(--text);
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.05);
  transform: translate(-50%, -140%); opacity: 0; visibility: hidden;
  transition: transform .45s var(--ease), opacity .3s ease, visibility 0s linear .45s;
}
.toast.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .45s var(--ease), opacity .3s ease; }
.toast.bump { animation: none; }
.toast-text b { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; }
.toast-text span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--sub); }
.toast button { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 13px 18px; background: var(--btn); color: #fff; font-weight: 800; font-size: 14.5px; transition: background-color .9s var(--ease); }
.pips { display: flex; gap: 4px; }
.pips[hidden] { display: none; }
.pips i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background-color .3s ease; }
.pips i.on { background: var(--btn); }

/* ---------- Box drawer ---------- */
.flyer { position: fixed; z-index: 60; pointer-events: none; aspect-ratio: 600 / 720; }
dialog.drawer {
  position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 88svh; height: auto;
  border: 0; padding: 0; border-radius: 26px 26px 0 0; background: #fff; color: var(--text);
  display: none; flex-direction: column; overflow: hidden; z-index: 60;
}
dialog.drawer[open] { display: flex; animation: sheetUp .45s var(--ease); }
dialog.drawer::backdrop { background: transparent; }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetIn { from { transform: translateX(100%); } }
@keyframes fade { from { opacity: 0; } }
.d-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 6px; }
.d-head h2 { font-size: 38px; }
.close { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--paper); display: grid; place-items: center; }
.close svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.d-progress { padding: 4px 20px 14px; }
.d-progress[hidden] { display: none; }
.d-progress p { font-size: 14px; font-weight: 600; color: var(--sub); }
.d-progress .pips { max-width: none; margin-top: 10px; }
.d-progress .pips i { height: 6px; }
.d-lines { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 20px; }
.line { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.line .thumb { width: 64px; height: 64px; border-radius: 16px; background: var(--c-bg); display: grid; place-items: end center; overflow: hidden; }
.line .thumb img { width: 50px; }
.line b { display: block; font-size: 16px; font-weight: 800; }
.line span { display: block; margin-top: 2px; font-size: 13.5px; color: var(--sub); }
.line .step { display: flex; background: var(--paper); }
.line .step button { width: 34px; height: 34px; background: #fff; }
.empty-box { padding: 28px 0; text-align: center; color: var(--sub); font-size: 15px; }
.d-foot { padding: 16px 20px max(env(safe-area-inset-bottom), 18px); border-top: 1px solid var(--line); background: #fff; }
.total { display: flex; justify-content: space-between; font-size: 17px; font-weight: 800; }
.checkout { width: 100%; margin-top: 14px; border: 0; border-radius: 999px; padding: 18px; background: var(--btn); color: #fff; font-size: 16px; font-weight: 800; }
.checkout:disabled { background: var(--line); color: #8a9299; cursor: not-allowed; }
.d-note { min-height: 18px; margin-top: 10px; text-align: center; font-size: 13px; color: var(--sub); }
.d-note.warn { color: var(--text); font-weight: 700; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  :root { --gutter: clamp(32px, 4.5vw, 72px); }
  .hero {
    /* Desktop: stop ~150px short of the window so the next section peeks in and it's clear the page scrolls */
    min-height: 0; height: clamp(560px, calc(100svh - 150px), 820px); padding-top: 20px; padding-bottom: 40px; column-gap: clamp(32px, 4vw, 72px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-rows: auto 1fr; grid-template-areas: "top top" "panel stage";
  }
  .stage { height: auto; min-height: 0; margin-top: 12px; }
  .panel { align-self: center; max-width: 600px; padding-top: 20px; }
  .eyebrow { font-size: 13px; }
  .name { font-size: min(10.5cqi, 84px); height: 1.74em; margin-top: 14px; }
  .name br { display: inline; }
  .hero-stats { --ss: 52px; margin-top: 20px; display: flex; }
  .side-stat { display: none; }
  .price { font-size: 16px; }
  .adder { max-width: 460px; margin-top: 20px; }

  .sheet { padding: 80px var(--gutter) 96px; }
  .sheet .mid { margin-top: 80px; }
  .cards { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: 30px 0 0; padding: 0; }
  .card[data-clone] { display: none; }   /* looping copies are for the phone scroller only */
  .strip span { font-size: 12px; padding: 18px 6px; }
  dialog.drawer { inset: 0 0 0 auto; width: 440px; height: 100%; max-height: 100%; border-radius: 26px 0 0 26px; }
  dialog.drawer[open] { animation-name: sheetIn; }
}
@media (min-width: 1200px) {
  .cards { grid-template-columns: repeat(5, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  :root { transition-duration: .01s; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01s !important; animation-delay: 0s !important; }
}
