/* =============================================================
   POP THAT PANTRY

   Palette and type stack come from the Brand sheet of the client's
   reporting document. Colours are referenced through semantic tokens
   so the light theme is a pure token swap — Electric Yellow reads at
   1.1:1 on cream and can never be text there, only a highlight block.
   ============================================================= */

/* ---------- Fonts ------------------------------------------- */

@font-face {
  font-family: "Catalpa";
  src: url("../fonts/catalpa-black.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SignPainter";
  src: url("../fonts/signpainter.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("../fonts/roboto-mono-var.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Brand constants --------------------------------- */

:root {
  --pink: #ea0085;        /* Poppin Pink     */
  --pink-soft: #f699be;   /* Pink Panther    */
  --cotton: #ffdeed;      /* Cotton Candy    */
  --yellow: #f4f401;      /* Electric Yellow */

  /* White on Poppin Pink is 4.34:1 — under the 4.5 floor for small
     bold text. Two clicks darker clears it at 4.69:1. */
  --pink-btn: #e00080;
  /* Poppin Pink on cream is 4.11:1 — large text only. This is the
     small-text-safe pink for light backgrounds (5.66:1). */
  --pink-deep: #c2006d;

  --display: "Catalpa", "Arial Black", sans-serif;
  --script: "SignPainter", "Brush Script MT", cursive;
  --body: "Roboto Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 60ch;
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- Dark theme (default) ---------------------------- */

:root {
  --ground: #07030a;
  --surface: #120711;
  --surface-2: #1c0b1a;
  --line: #351a30;

  --text: var(--cotton);
  --text-dim: #c9a8bb;
  --text-faint: #9a7d90;

  --accent: var(--yellow);          /* eyebrows, links, prices     */
  --spark: var(--yellow);
  --script-ink: var(--pink);
  --heading: var(--cotton);
  --eyebrow-ink: var(--pink-soft);

  --btn-fill: var(--pink-btn);
  --btn-fill-ink: #fff;
  --btn-alt: var(--yellow);
  --btn-alt-ink: #12000a;

  --hero-glow: color-mix(in srgb, var(--pink) 40%, transparent);
  --ticker-bg: var(--pink-btn);
  --ticker-ink: #fff;
}

/* ---------- Light theme ------------------------------------- */

:root[data-theme="light"] {
  --ground: #fcf8f5;
  --surface: #ffeef5;
  --surface-2: #fff6fa;
  --line: #eccfdd;

  --text: #1a0a14;
  --text-dim: #5c3d4d;
  --text-faint: #6b4a5c;

  --accent: var(--pink-deep);
  --spark: var(--pink);
  --script-ink: var(--pink);
  --heading: #1a0a14;
  --eyebrow-ink: var(--pink-deep);

  --btn-fill: var(--pink-btn);
  --btn-fill-ink: #fff;
  --btn-alt: var(--yellow);
  --btn-alt-ink: #1a0a14;

  --hero-glow: color-mix(in srgb, var(--cotton) 90%, transparent);
  --ticker-bg: var(--pink-btn);
  --ticker-ink: #fff;
}

/* ---------- Base -------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--heading);
  margin: 0;
}

p { margin: 0 0 1.15em; }

::selection { background: var(--yellow); color: #12000a; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Layout ------------------------------------------ */

.wrap { width: min(100% - (var(--gutter) * 2), 1180px); margin-inline: auto; }
.section { padding-block: var(--section-y); position: relative; }
.section--tint { background: var(--surface); }

/* ---------- Type helpers ------------------------------------ */

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--eyebrow-ink);
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 1.3rem;
}

.script {
  font-family: var(--script);
  text-transform: none;
  letter-spacing: 0;
  line-height: 0.8;
  display: inline-block;
  transform: translateY(0.08em);
  color: var(--script-ink);
}

.display-l { font-size: clamp(2.4rem, 7vw, 5rem); }
.display-m { font-size: clamp(1.8rem, 4.2vw, 2.9rem); }
.display-s { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }

.lede {
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.22rem);
  line-height: 1.6;
  color: var(--text-dim);
  max-width: var(--measure);
}

.fine { font-size: 0.78rem; line-height: 1.6; color: var(--text-faint); }

/* The outer <svg> has no viewBox — it needs both dimensions or it
   falls back to the SVG default of 300x150 and wrecks its flex row. */
.spark {
  width: 1em;
  height: 1em;
  flex: none;
  display: inline-block;
  color: var(--spark);
}

/* ---------- Buttons ----------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.05em 1.9em;
  background: var(--btn-fill);
  color: var(--btn-fill-ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 2px solid var(--btn-fill);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s var(--ease), filter 0.18s var(--ease);
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }

.btn--alt {
  background: var(--btn-alt);
  color: var(--btn-alt-ink);
  border-color: var(--btn-alt);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }

/* ---------- Wordmark ---------------------------------------- */

.wordmark {
  display: inline-flex;
  flex-direction: column;
  line-height: 0.8;
  text-transform: uppercase;
}

.wordmark__top {
  font-family: var(--display);
  letter-spacing: -0.02em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.06em;
  white-space: nowrap;
}

.wordmark__top .spark { width: 0.52em; height: 0.52em; color: var(--accent); }

.wordmark__bottom {
  font-family: var(--script);
  font-size: 1.42em;
  color: var(--pink);
  margin-top: -0.34em;
  margin-left: 0.5em;
  line-height: 0.8;
}

:root[data-theme="light"] .wordmark__top { color: #1a0a14; }

/* ---------- Ticker ------------------------------------------ */

.ticker {
  background: var(--ticker-bg);
  color: var(--ticker-ink);
  overflow: hidden;
}

.ticker__track { display: flex; width: max-content; animation: ticker 34s linear infinite; }
.ticker__group { display: flex; align-items: center; flex: none; padding-block: 0.6rem; }

.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  padding-inline: 1.1em;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker__item .spark { width: 0.85em; height: 0.85em; color: var(--yellow); }

@keyframes ticker { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }
.ticker:hover .ticker__track { animation-play-state: paused; }

/* ---------- Header ------------------------------------------ */

.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: 0.85rem;
}

.header .wordmark { font-size: 1.05rem; }

.nav { display: flex; align-items: center; gap: clamp(0.9rem, 2vw, 1.75rem); margin-left: auto; }

.nav > a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-block: 0.35rem;
  border-bottom: 2px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.nav > a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* `.nav > a` (0,1,1) outranks `.btn` (0,1,0), so the CTA's colour has to
   be restated here at higher specificity or it inherits the link grey. */
.nav .btn {
  padding: 0.7em 1.25em;
  font-size: 0.68rem;
  color: var(--btn-fill-ink);
  border-bottom: 2px solid var(--btn-fill);
}
.nav .btn:hover { color: var(--btn-fill-ink); border-bottom-color: var(--btn-fill); }

.nav-toggle { display: none; }

/* ---------- Hero -------------------------------------------- */
/* Type-led: there is no photography yet and none is faked. */

.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(3rem, 7vw, 5rem);
  isolation: isolate;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -30% -10% auto -10%;
  height: 90%;
  background: radial-gradient(60% 60% at 50% 40%, var(--hero-glow), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em 1.1em;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(1.4rem, 3.5vw, 2.2rem);
}
.hero__tag .spark { width: 0.9em; height: 0.9em; }

.hero__title { font-size: clamp(2.9rem, 10.5vw, 8.5rem); margin-bottom: 0.3em; }
.hero__title .line { display: block; }

.hero__title .script {
  font-size: 0.5em;
  margin-left: 0.04em;
  margin-top: 0.08em;
  white-space: nowrap;
}

.hero__body { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); align-items: end; }

@media (min-width: 62rem) { .hero__body { grid-template-columns: 1.1fr 0.9fr; } }

/* ---------- Countdown --------------------------------------- */

.countdown { display: flex; gap: clamp(0.5rem, 1.8vw, 1rem); flex-wrap: wrap; }

.countdown__unit {
  flex: 1 1 4.2rem;
  min-width: 4.2rem;
  padding: 0.85rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.countdown__num {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- Section head ------------------------------------ */

.sec-head { display: grid; gap: 1.2rem; margin-bottom: clamp(2rem, 4.5vw, 3.25rem); }

@media (min-width: 62rem) {
  .sec-head--split { grid-template-columns: 1fr auto; align-items: end; gap: 2.5rem; }
}

/* ---------- Cards ------------------------------------------- */

.grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease);
}

.card:hover { border-color: var(--pink); transform: translateY(-4px); }

.card__index {
  font-family: var(--display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--pink);
  margin-bottom: 0.9rem;
}

:root[data-theme="light"] .card__index { color: var(--pink-deep); }

.card__sub {
  font-family: var(--script);
  font-size: 2rem;
  line-height: 0.8;
  color: var(--script-ink);
  margin: -0.1rem 0 1rem;
}

.card p { color: var(--text-dim); font-size: 0.9rem; }

.card__foot {
  margin-top: auto;
  padding-top: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
}

.price { font-family: var(--display); font-size: 1.8rem; color: var(--accent); line-height: 1; }

.price small {
  font-family: var(--body);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  display: block;
  margin-top: 0.35rem;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4em 0.85em;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Recipe index ------------------------------------ */

.recipes { border-top: 1px solid var(--line); }

.recipe {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  align-items: center;
  padding-block: clamp(0.9rem, 2vw, 1.35rem);
  border-bottom: 1px solid var(--line);
  transition: background 0.2s var(--ease), padding-inline 0.2s var(--ease);
}

.recipe:hover { background: var(--surface); padding-inline: 1rem; }

.recipe__num {
  font-family: var(--display);
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  color: var(--pink);
  font-variant-numeric: tabular-nums;
}

:root[data-theme="light"] .recipe__num { color: var(--pink-deep); }

.recipe__name {
  font-family: var(--display);
  font-size: clamp(1.2rem, 3.4vw, 2rem);
  text-transform: uppercase;
  color: var(--heading);
  line-height: 1;
  letter-spacing: -0.015em;
}

.recipe:hover .recipe__name { color: var(--accent); }

/* ---------- About ------------------------------------------- */

.about { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); align-items: start; }

@media (min-width: 62rem) { .about { grid-template-columns: 0.85fr 1.15fr; } }

.about p { color: var(--text-dim); }

.pullquote {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin: 0;
}

.pullquote em {
  font-style: normal;
  background: var(--yellow);
  color: #1a0a14;
  padding: 0 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.sig {
  font-family: var(--script);
  font-size: clamp(2.2rem, 5vw, 3rem);
  color: var(--script-ink);
  line-height: 0.8;
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.25em;
}

.sig .spark { width: 0.42em; height: 0.42em; color: var(--pink); }

/* ---------- Capture ----------------------------------------- */

.capture {
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.form-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.6rem; max-width: 32rem; }

.form-row input {
  flex: 1 1 13rem;
  min-width: 0;
  padding: 1.05em 1.25em;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--body);
  font-size: 0.88rem;
}

.form-row input::placeholder { color: var(--text-faint); }
.form-row input:focus { border-color: var(--accent); outline: none; }

/* ---------- Footer ------------------------------------------ */

.footer { padding-block: clamp(2.5rem, 6vw, 4rem) 2rem; border-top: 1px solid var(--line); }

.footer__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.footer__links { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer__links a { font-size: 0.85rem; color: var(--text-dim); }
.footer__links a:hover { color: var(--accent); }
.footer .wordmark { font-size: 1.25rem; margin-bottom: 1rem; }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* ---------- Mobile nav -------------------------------------- */

@media (max-width: 60rem) {
  /* The drawer is a child of .header, and a non-none backdrop-filter makes an
     element the containing block for its position:fixed descendants. With the
     blur on, the fixed drawer resolved against the header instead of the
     viewport and slid in 52px tall inside the header strip — the button
     appeared to do nothing. The 88% color-mix already reads near-solid, so the
     blur costs nothing here. */
  .header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--ground);
    /* The drawer lives inside .header, and .header's own z-index makes it a
       stacking context — so .nav's z-index:70 is scoped in here and can never
       beat the scrim's 65 outside. Lift the whole header above the scrim, or
       the drawer paints underneath it and reads as blurred background. */
    z-index: 80;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
    padding: 0.6em 1em;
    background: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(90vw, 20rem);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 5.5rem 2rem 2rem;
    background: var(--surface);
    border-left: 1px solid var(--line);
    transform: translateX(101%);
    /* visibility keeps the parked drawer out of the tab order */
    visibility: hidden;
    transition: transform 0.32s var(--ease), visibility 0s linear 0.32s;
    overflow-y: auto;
    z-index: 70;
  }

  .nav[data-open="true"] {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.32s var(--ease), visibility 0s;
  }

  .nav > a {
    font-family: var(--display);
    font-size: 1.5rem;
    color: var(--heading);
    padding-block: 0.75rem;
    border-bottom: 1px solid var(--line);
  }
  .nav > a:hover { border-bottom-color: var(--line); }

  .nav .btn { width: 100%; margin-top: 1.5rem; }

  .nav-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: 0;
    color: var(--text);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
  }

  .scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 65;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
  }
  .scrim[data-open="true"] { opacity: 1; pointer-events: auto; }
}

@media (min-width: 60.0625rem) { .nav-close, .scrim { display: none; } }

/* ---------- Reveal ------------------------------------------ */
/* Scoped to .js so a script failure can never blank the page. */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal[data-shown="true"] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .ticker__track { animation: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; }
}

/* ---------- Utilities --------------------------------------- */

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

/* Theme switch shown only on the shared review build. */
.theme-switch {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7em 1.1em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}
.theme-switch:hover { border-color: var(--pink); }

/* ---------- Builder credit (Sites by Nu) -------------------- */
/* Deliberately quiet: sits below the legal row, muted until hover. */

.sbn-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
}

.sbn-ring--inner { stroke: var(--script-ink); stroke-width: 1.5; opacity: 0.75; }

.sbn-crown { fill: var(--script-ink); }

.sbn-mono {
  font-family: var(--display);
  font-size: 41px;
  letter-spacing: -0.045em;
  fill: var(--heading);
}

.credit {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  transition: color 0.2s var(--ease);
}

/* Discretion comes from scale and colour, not opacity — a 0.75 alpha
   drops this text to 3.5:1 against the footer and fails AA. */
.credit:hover { color: var(--text-dim); }

.credit__mark { width: 30px; height: 30px; flex: none; }

.credit__text {
  font-size: 0.68rem;
  line-height: 1.45;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.credit__text b { color: var(--text-dim); font-weight: 700; }

.credit__tag {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}
