/* ==========================================================================
   Component library (WB §6 conversion components + global furniture).
   ========================================================================== */

/* ----- Buttons ----- */
/* One look for every button: the subtle tri-hue pastel wash (peach → lavender → mint) —
   the wordmark's three colours washed ~80% into white — with dark-ink text, no border,
   and slim padding. Variants (primary/brand/focus/reset/flow…) differ only by size now. */
:root {
  /* Interpolated in oklab so the three hues melt together instead of banding into
     thirds; extra mid-stops keep the sweep continuous. Washed ~80% into white. */
  --grad-brand-soft: linear-gradient(100deg in oklab,
    color-mix(in srgb, var(--flow)   20%, #fff) 0%,
    color-mix(in srgb, var(--flow)   14%, color-mix(in srgb, var(--focus) 14%, #fff)) 30%,
    color-mix(in srgb, var(--focus)  16%, #fff) 50%,
    color-mix(in srgb, var(--focus)  14%, color-mix(in srgb, var(--reset) 14%, #fff)) 70%,
    color-mix(in srgb, var(--reset)  20%, #fff) 100%);
  /* Solid fallback for browsers without oklab gradients (pale lavender). */
  --grad-brand-fallback: color-mix(in srgb, var(--focus) 9%, #fff);
  /* Same tri-hue sweep, less washed — soft but visible as a 1px hairline border
     on the cream surface (used for card hover). */
  --grad-brand-border: linear-gradient(100deg in oklab,
    color-mix(in srgb, var(--flow)   55%, #fff) 0%,
    color-mix(in srgb, var(--focus)  55%, #fff) 50%,
    color-mix(in srgb, var(--reset)  55%, #fff) 100%);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm);
  padding: 0.32em 1.2em; border-radius: var(--radius-pill);
  border: 0; cursor: pointer; text-decoration: none;
  background-color: var(--grad-brand-fallback); background-image: var(--grad-brand-soft);
  color: var(--ink);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              filter var(--dur) var(--ease),
              background var(--dur) var(--ease), color var(--dur) var(--ease);
}
/* Barely-there feedback: faint shadow + gentle deepen on hover, text warms to brand
   purple, tiny press-in on click. */
.btn:hover { box-shadow: var(--shadow-sm); filter: saturate(1.15) brightness(0.98); color: var(--focus); }
.btn:active { transform: scale(0.98); }

/* Colour variants collapse to the shared pastel — kept as aliases so existing markup
   (btn-primary, btn-brand, btn-brand-soft, btn-secondary, btn-focus/reset/flow) still works. */
.btn-primary, .btn-brand, .btn-brand-soft, .btn-secondary,
.btn-focus, .btn-reset, .btn-flow {
  background-color: var(--grad-brand-fallback); background-image: var(--grad-brand-soft);
  color: var(--ink); border: 0;
}
.btn-primary:hover, .btn-brand:hover, .btn-brand-soft:hover, .btn-secondary:hover,
.btn-focus:hover, .btn-reset:hover, .btn-flow:hover {
  color: var(--focus); filter: saturate(1.15) brightness(0.98);
}

/* Ghost stays a quiet transparent text button (used inline, e.g. "What's this?"). */
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); background: var(--bg-soft); filter: none; }

/* Reviews flavour filters: larger type; on hover the soft brand gradient fills in and the
   text turns purple. */
.btn.review-filter { font-size: var(--text-md); }
.btn.review-filter:hover {
  background-color: var(--grad-brand-fallback);
  background-image: var(--grad-brand-soft);
  color: var(--focus); filter: none;
}

.btn-sm { font-size: var(--text-xs); padding: 0.26em 1em; }

/* ----- Inline newsletter signup -----
   The "Monthly honest guides" card on the article and learn pages. `.input` is width:100%
   site-wide, which is what put the Sign up button on a row of its own beneath a full-width
   field: the field claimed the whole line and the button had nowhere to go.

   The field is capped rather than greedy: `flex: 0 1` on both the form and the field means
   neither grows into the spare width, so the button stays beside the field instead of being
   pushed to the far edge of the card by a bar long enough for an essay. 18rem is about twice
   the longest address anyone types into it, and both still shrink on a narrow card, the
   button dropping below only when there is genuinely no room for the pair.

   This also replaces a `style="min-width:220px"` that only the learn page's field carried —
   which is exactly why the two pages disagreed about where the button went. */
.newsletter-inline { flex: 0 1 auto; align-items: center; }
.newsletter-inline .input { flex: 0 1 18rem; width: auto; min-width: 0; }
/* A step above the .btn default (--text-sm) so it reads as the card's action rather than as
   a footnote beside a 1rem field. */
.newsletter-inline .btn { flex: 0 0 auto; font-size: var(--text-md); padding: 0.42em 1.4em; }
.btn-lg { font-size: var(--text-base); padding: 0.42em 1.5em; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: 0.55; pointer-events: none; }

/* ----- Add-to-cart buttons ----- */
/* Keyed off [data-add-to-cart] rather than a class, so every add-to-cart button picks
   this up wherever it appears - product cards, PDP, quiz result, cart upsell, sticky bar -
   without having to tag each one. Each size tier moves up exactly one step on the type
   scale, so the buttons read larger without breaking the sizes around them. */
[data-add-to-cart] { font-size: var(--text-base); }
.btn-sm[data-add-to-cart] { font-size: var(--text-sm); }
.btn-lg[data-add-to-cart] { font-size: var(--text-md); }

/* Hover: zoom in, with a short wobble that settles at the zoomed size. The animation runs
   once (no fill-mode), so once it finishes the static :hover transform below holds the
   button at 1.06 - the keyframes end on that exact value so there is no snap between them. */
[data-add-to-cart]:hover,
[data-add-to-cart]:focus-visible {
  transform: scale(1.06);
  animation: cartWobble 0.5s var(--ease);
}
/* Restated so the press-in still reads while hovering - .btn:active alone would be
   outranked by the rule above on source order. */
[data-add-to-cart]:active { transform: scale(0.98); animation: none; }
@keyframes cartWobble {
  0%   { transform: scale(1)    rotate(0deg); }
  25%  { transform: scale(1.08) rotate(-2.5deg); }
  50%  { transform: scale(1.06) rotate(2deg); }
  75%  { transform: scale(1.07) rotate(-1.2deg); }
  100% { transform: scale(1.06) rotate(0deg); }
}
/* base.css's global reduce-motion rule collapses animation/transition duration but leaves
   transform alone, which would turn the zoom into an instant jump. Drop it entirely instead. */
@media (prefers-reduced-motion: reduce) {
  [data-add-to-cart]:hover,
  [data-add-to-cart]:focus-visible { transform: none; animation: none; }
}

/* Text-style submit: no pill, letters filled with the brand gradient (gold → violet → green).
   Used where a filled button would be too heavy, e.g. the footer newsletter capture. */
.btn-text-grad {
  display: inline-flex; align-items: center; white-space: nowrap;
  border: 0; background: transparent; padding: 0 var(--sp-2); cursor: pointer;
  font-family: var(--font-display); font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--text-sm);
  background-image: linear-gradient(100deg, var(--flow) 0%, var(--focus) 45%, var(--reset) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: var(--brand-deep);            /* fallback where background-clip:text is unsupported */
  transition: filter var(--dur) var(--ease);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .btn-text-grad { color: transparent; }
}
.btn-text-grad:hover { filter: brightness(1.08) saturate(1.12); }
.btn.is-loading::after {
  content: ""; width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }

/* ----- Badges & chips ----- */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em;
  padding: 0.3em 0.9em; border-radius: var(--radius-pill);
  background: var(--bg-soft); color: var(--ink-soft);
}
.badge-focus { background: var(--focus-tint); color: var(--focus-deep); }
.badge-reset { background: var(--reset-tint); color: var(--reset-deep); }
.badge-flow  { background: var(--flow-tint);  color: var(--flow-deep); }
.badge-notice { background: var(--notice-bg); color: #7a5b12; }

/* ⚠ Placeholder-data marker (admin-visible honesty flag until Celeste data lands) */
.placeholder-flag {
  background: var(--notice-bg); color: #7a5b12; border: 1px dashed #d9b36a;
  font-size: var(--text-xs); padding: 0.15em 0.6em; border-radius: var(--radius-sm);
}

/* ----- Cards ----- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  /* Soft tri-hue gradient hairline. Border goes transparent; a surface-coloured
     padding-box layer sits over the gradient border-box layer so only the 1px
     frame shows — and it follows the card's rounded corners. */
  border-color: transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), var(--grad-brand-border);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
}

/* Featured Learn card: the card itself is NOT a link — only the "Read the guide"
   CTA is clickable. Body copy keeps its colour; only the CTA text warms to brand
   purple on hover. */
.learn-feature-cta { transition: color var(--dur) var(--ease); }
.learn-feature .learn-feature-cta:hover { color: var(--focus); }
.card-focus { border-top: 4px solid var(--focus); }
.card-reset { border-top: 4px solid var(--reset); }
.card-flow  { border-top: 4px solid var(--flow); }

/* Stacked link-cards hold an inline <strong> title and a small <span> label. Vertical margin
   (from .stack) doesn't apply to inline boxes, so the label ran on the same line as the title.
   Make them block so the title sits on its own line and the label drops to the next paragraph. */
.card.stack > strong,
.card.stack > span { display: block; }

/* ----- Forms ----- */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--sp-1); }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.65em 0.9em;
  transition: border-color var(--dur) var(--ease);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); outline: none; }
.field .error { color: var(--danger); font-size: var(--text-xs); margin-top: var(--sp-1); }
.checkbox-row { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: var(--text-sm); }
.checkbox-row input { margin-top: 0.3em; }

/* ----- Flash / toasts ----- */
.flash { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); margin-bottom: var(--sp-4); font-size: var(--text-sm); }
.flash-success { background: var(--reset-tint); color: var(--reset-deep); }
.flash-error   { background: #FBEAE7; color: var(--danger); }
.flash-info    { background: var(--focus-tint); color: var(--focus-deep); }

/* ----- Accordion ----- */
.accordion { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion details:last-child { border-bottom: 0; }
.accordion summary {
  cursor: pointer; list-style: none; font-weight: 600;
  padding: var(--sp-4) var(--sp-5); position: relative;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+"; position: absolute; right: var(--sp-5); top: 50%;
  transform: translateY(-50%); font-family: var(--font-display); font-size: var(--text-lg);
  color: var(--ink-faint); transition: transform var(--dur) var(--ease);
}
.accordion details[open] summary::after { content: "–"; }
.accordion .accordion-body { padding: 0 var(--sp-5) var(--sp-4); color: var(--ink-soft); }

/* ----- Announcement bar (scrolling marquee) ----- */
.announce {
  /* Soft wash of the wordmark gradient (gold -> violet -> green), lightened so dark ink reads
     on it — a slim, gentle band. The message scrolls continuously across it. */
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--flow)  40%, #fff) 0%,
    color-mix(in srgb, var(--focus) 38%, #fff) 50%,
    color-mix(in srgb, var(--reset) 40%, #fff) 100%);
  color: var(--ink);
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(var(--text-xs), 1.9vw, var(--text-sm)); letter-spacing: 0.01em;
  position: relative; overflow: hidden; padding-block: 0.18rem;
}
@media (min-width: 700px) { .announce { padding-block: 0.28rem; } }
/* Static, centered statement — no scrolling. Wraps to as many lines as the screen needs so
   nothing clips on narrow phones; symmetric side margins keep it centred and clear of the
   close button. */
.announce-static {
  display: flex; justify-content: center; align-items: center;
  margin-inline: 2.2rem; text-align: center; text-wrap: balance;
}
.announce-msg strong { font-weight: 800; }
/* Generous breathing room on both sides of the dash in "LABEL - message". */
.announce-dash { margin-inline: 0.85rem; color: var(--flow-deep); opacity: 0.75; }
/* On phones the copy wraps, so the wide dash margins read as a big gap — tighten them. */
@media (max-width: 699px) { .announce-dash { margin-inline: 0.3rem; } }
.announce a { color: var(--ink); text-decoration: underline; }
.announce-close {
  position: absolute; right: var(--sp-3); top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--ink-soft); font-size: 1rem; cursor: pointer; line-height: 1; z-index: 2;
}

/* ----- Brand lockup (glonice_lockup): official GLONICE™ / WOBBI™ artwork as an image ----- */
/* Interim text lockup (see glonice_lockup() in app/helpers.php): GLONICE in brand gold over
   the WOBBI wordmark, in the same 60px box the packaged PNG occupied so the header grid and
   the footer keep their geometry. Colours are the lockup's own — --gold above, and the
   per-letter .pw-* values on the wordmark below. Delete this block when real artwork lands. */
.gl-lockup {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 60px; gap: 0.15em; line-height: 1; white-space: nowrap;
}
.gl-lockup-name {
  font-family: var(--font-display); font-weight: 800; font-size: 0.95rem;
  letter-spacing: 0.16em; color: var(--gold);
}
.gl-lockup-mark { display: inline-flex; align-items: flex-start; }
/* Wordmark + ™ as one unit, so the pair looks identical wherever it is set — the hero, a
   section heading, anywhere else it lands. The ™ is measured in em against .brand-mark's own
   size, which is also the wordmark's size, so the two scale together instead of the ™ growing
   or shrinking against the mark whenever the surrounding type size changes. That is exactly
   what went wrong in the "Why … beats your usual protein?" heading: a bare <sup> there took
   the h2's font, weight and ink colour, and browser-default sup sizing, so it read as a big
   dark character standing next to the mark rather than as part of it. */
.brand-mark { display: inline-flex; align-items: flex-start; }
.brand-tm {
  font-size: 0.2625em; line-height: 1;
  font-family: var(--font-body); font-weight: 700;
  /* The wordmark's closing purple (.pw-o2, #AC8ABF), so the ™ belongs to the mark. */
  color: #AC8ABF;
  /* Both offsets are in the ™'s own em, so they hold at every size. The negative pull tucks
     it under the wordmark's overhang; -0.32em had it sitting on the final I, so it is eased
     out to leave a hair of air. */
  align-self: flex-start; margin-left: -0.18em; margin-top: 0.2em;
}

.gl-lockup-mark .proto-word { font-size: 1.7rem; }
/* Every WOBBI is stretched a touch taller than the face draws it: the wide Archivo
   instance reads short and fat at display size — under the airy letter-spaced GLONICE in
   the lockup, and on its own in the hero. A scaleY rather than a lower font-stretch,
   because the wdth axis is the one thing the .proto-word comment below says not to give
   back: the mark is meant to be wide, just not squat. One rule for all three instances so
   the value cannot drift between them. Transform only, so the lockup's 60px box and the
   heading's line box are untouched, and the ™ beside it does not move. .proto-word is a
   flex item in both wrappers, so it is already blockified and takes the transform. */
.gl-lockup-mark .proto-word,
.brand-mark .proto-word { transform: scaleY(1.06); transform-origin: center; }
/* Both ™s: small, raised to the cap line, and tucked in so they read as part of the mark
   rather than as a following character. The lower one takes the wordmark's closing purple. */
.gl-lockup sup { font-size: 0.42em; line-height: 1; font-family: var(--font-body); font-weight: 700; }
.gl-lockup-name sup { margin-left: 0.1em; vertical-align: super; }
.gl-lockup-mark sup { color: #AC8ABF; margin-left: 0.04em; margin-top: 0.2em; align-self: flex-start; }

/* The lockup is decorative and sits beside real UI, so it shrinks with the header. */
.gl-lockup-img { height: 60px; width: auto; display: block; }
@media (max-width: 420px) {
  .gl-lockup-img { height: 48px; }
  .gl-lockup { height: 48px; }
  .gl-lockup-name { font-size: 0.78rem; }
  .gl-lockup-mark .proto-word { font-size: 1.35rem; }
}

/* ----- Header ----- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur) var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.header-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-4);
  height: var(--header-h); max-width: var(--container-wide);
  margin-inline: auto; padding-inline: var(--sp-4);
}
.header-inner > .main-nav    { grid-column: 1; grid-row: 1; justify-self: start; margin-inline: 0; }
.header-inner > .logo        { grid-column: 2; grid-row: 1; justify-self: center; }
.header-inner > .header-utils{ grid-column: 3; grid-row: 1; justify-self: end; }
/* Circular brand emblem: GLONICE curved over the top, WOBBI along the bottom,
   favicon G in the centre — the two words closing a ring. (see glonice_logo()) */
.logo.logo-stack { flex-direction: column; gap: 0; line-height: 1; }
.brand-emblem { height: 52px; width: auto; display: block; }
.logo { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo .leaf { color: var(--reset); }
.logo-icon  { height: 20px; width: auto; display: block; }
.logo-sep   { width: 1px; height: 18px; background: var(--ink-faint); opacity: 0.5; font-size: 0; align-self: center; }

/* Straight, per-letter-coloured WOBBI wordmark (matches the logo art).
   Set in the wordmark face, not the display face: the logo is an ultra-bold geometric sans
   (Druk Wide Bold on the brand card), so --font-wordmark carries Archivo at wdth 125 /
   wght 900. font-stretch is stated because that is how CSS addresses the wdth axis — without
   it a browser can pick a narrower instance and the mark reads as ordinary bold text.
   Colours (.pw-*) and the size set by each context are unchanged. */
.proto-word {
  font-family: var(--font-wordmark); font-weight: 900; font-stretch: 125%;
  letter-spacing: 0.005em; white-space: nowrap; line-height: 1;
}
.proto-word > span { display: inline-block; }
.proto-word .pw-p  { color: #AC8ABF; }
.proto-word .pw-r  { color: #6C87BE; }
.proto-word .pw-o  { color: #EAA83C; }
.proto-word .pw-t  { color: #ADC186; }
.proto-word .pw-o2 { color: #AC8ABF; }

.main-nav { display: flex; gap: var(--sp-2); align-items: center; margin-inline: auto; }
.main-nav > .nav-item { position: relative; }
.nav-link {
  display: inline-block; padding: var(--sp-2) var(--sp-3);
  /* A notch above --text-sm (0.9rem): the nav labels sat too quiet next to the lockup,
     and the full 1rem step pushes the row into the utilities before the drawer takes over. */
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  border-radius: var(--radius-pill); white-space: nowrap;
}
/* Hover affordance (pill + metallic sweep) is defined once in the "Clickable
   hover affordance" block below, shared with the footer + mobile drawer. */

/* Mega menu — anchored to the Shop link's left edge (it is the leftmost nav item),
   so it opens rightward and never hangs off the left of the screen when the header
   stops centring on narrower windows. Width is capped to the viewport as a safety net. */
.mega {
  position: absolute; left: 0; transform: translateY(6px);
  top: 100%; width: 860px; max-width: calc(100vw - var(--sp-6)); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--sp-6);
  display: none; grid-template-columns: 1fr 1fr 1.1fr; gap: var(--sp-6);
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
/* When the panel is capped narrow, let the three columns collapse instead of overflowing. */
@media (max-width: 720px) {
  .mega { grid-template-columns: 1fr 1fr; }
}
.nav-item.is-open .mega { display: grid; opacity: 1; }
/* The panel is offset 6px below the link, and that strip belongs to no hover target:
   a pointer travelling from "Shop" down into the menu left the nav item mid-way and
   the panel shut before it got there. This invisible bridge spans exactly the gap
   (it sits below every nav link, so it steals no clicks) and keeps the pointer
   inside the item for the whole journey. */
.nav-item.is-open .mega::before {
  content: ''; position: absolute; left: 0; right: 0; top: -6px; height: 6px;
}
/* Whole dropdown in caps: every entry in here is a label (a flavour, a bundle, a section
   heading), and caps make the panel read as a menu rather than as prose. Tracking is opened
   because the links sit at --text-xs, where caps set without it close up and get harder to
   scan, not easier. Transform only - the flavour names stay title-case everywhere else. */
.mega { text-transform: uppercase; letter-spacing: 0.05em; }
/* The one exception: the "New here?" line is a full sentence, not a label, and a sentence
   in caps is measurably slower to read. It stays sentence case. */
.mega-feature p { text-transform: none; letter-spacing: normal; }
.mega h4 { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: var(--sp-4); padding-inline: 0; }
/* The ul is pulled out by exactly the link's own padding, so the hover pill can be wider than
   the label while the LABEL TEXT still starts at the panel's padding edge. The h4 therefore
   takes no inline padding of its own - give it any and the heading stops lining up with the
   labels under it, which is what happened when these were 8px and nobody noticed. */
.mega ul { list-style: none; padding: 0; margin: 0 calc(var(--sp-3) * -1); }
.mega li { margin-bottom: var(--sp-1); }
.mega li:last-child { margin-bottom: 0; }
/* Each link is a full-width row so the whole strip is the hit target and the
   hover highlight reads as a tidy pill, not just underlined text. */
.mega a {
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: var(--text-xs);
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 0.62em var(--sp-3); border-radius: var(--radius);
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
/* Soft brand-tone gradient wash on hover/focus (peach → lavender → mint). */
.mega a:hover, .mega a:focus-visible {
  background: var(--grad-brand-soft); color: var(--ink);
  transform: translateX(2px); outline: none;
}
/* Trailing badges (e.g. "Most popular") sit right after the label, compact and on one line. */
.mega a .badge {
  flex: 0 0 auto; white-space: nowrap;
  font-size: 0.6rem; padding: 0.12em 0.5em; letter-spacing: 0;
}
.swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.swatch-focus { background: var(--focus); }
.swatch-reset { background: var(--reset); }
.swatch-flow { background: var(--flow); }
.mega-feature { background: var(--bg-soft); border-radius: var(--radius); padding: var(--sp-5); font-size: var(--text-xs); }
/* Match the small dropdown-link size throughout the box (incl. the intro paragraph). */
.mega-feature strong { font-size: var(--text-sm); }
.mega-feature p { font-size: inherit; font-weight: 700; }
/* "Find your formula" CTA: warm to brand purple on hover (beats .mega a:hover ink). */
.mega-feature .btn:hover { color: var(--focus); }

.header-utils { display: flex; align-items: center; gap: var(--sp-2); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: none; border: 0; cursor: pointer; color: var(--ink);
  text-decoration: none; position: relative;
}
.icon-btn:hover { background: var(--bg-soft); }
.cart-count {
  position: absolute; top: 2px; right: 0;
  background: var(--coral); color: #fff; font-size: 0.65rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: var(--radius-pill);
  display: none; align-items: center; justify-content: center; padding-inline: 3px;
}
.cart-count.has-items { display: inline-flex; }

/* Utility-icon label. Shown on hover AND :focus-visible so it is keyboard-reachable.
   aria-hidden on the span: the accessible name already comes from the parent's aria-label. */
.icon-tip {
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-family: var(--font-body); font-size: var(--text-xs); font-weight: 500;
  line-height: 1; white-space: nowrap;
  padding: 6px 8px; border-radius: var(--radius-sm);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur) var(--ease), visibility var(--dur) var(--ease);
  z-index: 120;
}
.icon-btn:hover .icon-tip,
.icon-btn:focus-visible .icon-tip { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .icon-tip { transition: none; } }

/* Match the left nav links: same text size, and the label turns brand-purple on hover. */
.quiz-pill { white-space: nowrap; font-size: var(--text-sm); }
.quiz-pill:hover { color: var(--focus-deep); }

/* /shipping-countries — founder-maintained destination list */
.country-list {
  list-style: none; padding: 0; margin: 0 0 var(--sp-4);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-2);
}
.country-list li {
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-soft); border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

/* Mobile nav */
.nav-toggle { display: none; }
.mobile-drawer {
  display: none; position: fixed; inset: 0; z-index: 150; background: var(--bg);
  padding: var(--sp-5); overflow-y: auto;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer .drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-5); }
.mobile-drawer nav a {
  display: block; padding: var(--sp-3) 0; font-family: var(--font-display);
  font-size: var(--text-lg); font-weight: 700; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.mobile-drawer .drawer-secondary a { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500; color: var(--ink-soft); border: 0; padding: var(--sp-2) 0; }

/* Narrow desktop: seven primary labels + the quiz pill + the centred lockup stop fitting
   on one row somewhere under ~1150px. The pill is the least load-bearing of the three -
   it is repeated in the Shop mega-menu and in the mobile drawer - so it steps out first
   and the nav stays complete; the labels then tighten to keep a little slack in hand. */
@media (max-width: 1150px) {
  .quiz-pill { display: none; }
  .main-nav { gap: var(--sp-1); }
  .nav-link { padding-inline: var(--sp-2); }
}

@media (max-width: 980px) {
  .main-nav, .quiz-pill { display: none; }
  .nav-toggle { display: inline-flex; }
  /* Nav hidden here — drop the 3-col centred grid for a flex row that can't overflow */
  .header-inner { display: flex; justify-content: space-between; }
}
/* Narrow phones: tighten the header so the logo + icons fit down to 320px */
@media (max-width: 420px) {
  .header-inner { gap: var(--sp-2); padding-inline: var(--sp-3); }
  .header-utils { gap: 0; }
  .icon-btn { width: 36px; height: 36px; }
  .brand-emblem { height: 42px; width: auto; }
}

/* ----- Footer ----- */
.site-footer { background: #E9DFC9; color: var(--ink-soft); margin-top: var(--sp-9); }
.site-footer h4 { color: var(--ink); }
.site-footer a { color: var(--ink); text-decoration: none; }

/* ---- Clickable hover affordance ----------------------------------------------
   Replaces the old flat "light-yellow" hover across the nav + footer chrome:
   a soft brand-gradient pill fades in behind the word (painted on ::before so the
   element's own background stays free), and the label lightens into a slow,
   moving "metallic" gradient sweep — a clear, on-brand "this is clickable" cue. */
@keyframes metalShimmer { to { background-position: -200% center; } }

.nav-link, .mobile-drawer nav a, .site-footer a { position: relative; z-index: 0; }
/* The shimmer lives on the PILL (::before), so the word's own colour is never
   clipped or made transparent — the text stays fully solid and readable. */
.nav-link::before, .mobile-drawer nav a::before, .site-footer a::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: var(--radius-sm); background-image: var(--grad-brand-soft);
  background-size: 200% 100%; background-position: 0% center;
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.nav-link:hover::before, .nav-item.is-open > .nav-link::before,
.mobile-drawer nav a:hover::before, .site-footer a:hover::before {
  opacity: 1; animation: metalShimmer 2.6s linear infinite;
}

/* Text simply deepens to a legible brand tone on hover — always visible. */
.nav-link:hover, .nav-item.is-open > .nav-link,
.mobile-drawer nav a:hover, .site-footer a:hover {
  color: var(--focus-deep); text-decoration: none;
}
@media (prefers-reduced-motion: reduce) {
  .nav-link:hover::before, .nav-item.is-open > .nav-link::before,
  .mobile-drawer nav a:hover::before, .site-footer a:hover::before { animation: none; }
}
.footer-cols {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-6);
  max-width: var(--container-wide); margin-inline: auto;
  padding: var(--sp-8) var(--sp-4) var(--sp-6);
}
.footer-cols h4 { color: var(--ink); font-size: var(--text-base); font-weight: 700; margin-bottom: var(--sp-3); }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin-bottom: var(--sp-2); font-size: var(--text-xs); }
.footer-cols li a { font-weight: 700; }
@media (max-width: 980px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-cols { grid-template-columns: 1fr; } }

.footer-band {
  border-top: 1px solid rgba(34, 31, 26, 0.12);
  max-width: var(--container-wide); margin-inline: auto;
  padding: var(--sp-6) var(--sp-4);
  display: flex; flex-wrap: wrap; gap: var(--sp-5); align-items: center; justify-content: space-between;
}
.footer-capture { display: flex; gap: var(--sp-2); flex-wrap: nowrap; max-width: 480px; align-items: stretch; }
.footer-capture .input { background: rgba(255, 255, 255, 0.55); border-color: rgba(34, 31, 26, 0.2); color: var(--ink); flex: 1; min-width: 0; }
.footer-capture .input::placeholder { color: var(--ink-faint); }
/* Follow block: Instagram / TikTok / X logo links, sits in the footer band. */
.footer-follow { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); text-align: left; }
.footer-follow h4 { color: var(--ink); font-size: var(--text-base); font-weight: 700; margin: 0; }
/* Left-aligned under the heading rather than centred — the icon row is far narrower
   than the 60px QR tiles it replaced, so centring left it floating mid-column. */
.footer-socials { display: flex; flex-flow: row wrap; align-items: center; gap: var(--sp-4); }
.footer-social {
  display: inline-flex; color: var(--ink); text-decoration: none;
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.footer-social:hover, .footer-social:focus-visible { color: var(--ink-soft); transform: translateY(-2px); }
/* 24px keeps all three glyphs legible; the marks are drawn to fill their own viewBox,
   so they optically match at a shared box size without per-icon nudging. */
.footer-social-mark { width: 24px; height: 24px; display: block; }
/* The logo links opt out of the footer's animated text-underline. */
.site-footer .footer-social::before { content: none; }
/* Gift-card "Notify me" band: slimmer input (less vertical padding) and a slightly
   larger button label kept on one line. Scoped so the site-wide .input/.btn are untouched. */
.notify-band .input { padding-block: 0.3em; line-height: 1.2; }
.notify-band .btn { font-size: var(--text-base); white-space: nowrap; padding-block: 0.3em; }
/* Persistent health-claims disclaimer (product + article pages) */
.claims-disclaimer {
  border: 1px solid var(--line); border-left: 3px solid var(--ink-faint);
  border-radius: var(--radius-sm); background: var(--bg-soft);
  padding: var(--sp-3) var(--sp-4); color: var(--ink-soft); line-height: 1.6;
  /* No max-width: the 760px cap left this sitting as a narrow box while the prose around it
     ran the full width of the page, which read as a stray column rather than a closing note.
     It now flows to whatever container holds it, on articles and on the PDP alike. */
  margin-block: var(--sp-4);
}
.claims-disclaimer strong { color: var(--ink); }
.article-wrap .claims-disclaimer { margin-inline: 0; }

.footer-disclaimer {
  border-top: 1px solid rgba(34, 31, 26, 0.12);
  max-width: var(--container-wide); margin-inline: auto;
  padding: var(--sp-5) var(--sp-4) var(--sp-2);
  font-size: var(--text-xs); line-height: 1.6; color: var(--ink-soft);
}
.footer-disclaimer p {
  margin: 0 0 var(--sp-2); max-width: none;
  text-align: justify; text-align-last: left;
  hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word;
}
.footer-disclaimer strong { color: var(--ink); }
.footer-disclaimer a { color: var(--ink); text-decoration: underline; }
.footer-legal {
  border-top: 1px solid rgba(34, 31, 26, 0.12);
  max-width: var(--container-wide); margin-inline: auto;
  padding: var(--sp-4); font-size: var(--text-xs); color: var(--ink-soft);
  font-weight: 700;
  display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: space-between;
}
.footer-legal a { color: var(--ink-soft); }

/* ----- Benefit strip (hero numbers) ----- */
.benefit-strip { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-6); }
.benefit-strip .benefit { display: flex; flex-direction: column; }
.benefit .num { font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); }
.benefit .label { font-size: var(--text-xs); color: var(--ink-soft); }

/* ----- Trust row (under CTAs) ----- */
.trust-row { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); font-size: var(--text-xs); color: var(--ink-soft); align-items: center; }
.trust-row .tick::before { content: "✓ "; color: var(--reset); font-weight: 700; }

/* ----- Consent banner ----- */
.consent-banner {
  position: fixed; left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4); z-index: 160;
  max-width: 560px; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: var(--sp-4) var(--sp-5);
}
.consent-inner { display: flex; flex-direction: column; gap: var(--sp-3); }

/* ----- Earned capture popup ----- */
.capture-popup {
  position: fixed; inset: 0; z-index: 170;
  background: rgba(34, 31, 26, 0.45);
  display: grid; place-items: center; padding: var(--sp-4);
}
.capture-popup[hidden] { display: none; }
.capture-popup-card {
  position: relative; width: min(420px, 100%);
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.capture-popup-close { position: absolute; top: var(--sp-3); right: var(--sp-3); }

/* ----- Section headers ----- */
.kicker {
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm);
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink);
  display: block; margin-bottom: var(--sp-2);
}

/* ------------------------------------------------------------------------
   Flavour cursors — pick a ritual and the pointer becomes that flavour's fruit.
     focus → grape vine + halved passionfruit   (Passion Fruit Grape)
     reset → rose salt over lime wave           (Mangosteen Lime)
     flow  → pina colada glass                  (Yuzu Pineapple Coconut)

   PNG rather than SVG: Safari ignores SVG cursors entirely, and a decorative
   cursor that only half the desktop audience sees is not worth the asset split.
   Sources live beside them as .svg — edit those, re-render to .png (see the
   note in each file). 32x32 is the size every browser honours; the hotspot sits
   at 4,4, on the tip of the vine / the left crest / the pineapple fronds.

   `cursor` inherits, so the containers below hand it to their whole subtree, and
   the affordance rules underneath hand real controls their pointer back. Gated on
   a fine hover pointer so it never loads on touch, where there is no cursor at all.
   ------------------------------------------------------------------------ */
@media (hover: hover) and (pointer: fine) {
  .card-focus, .flavour-focus { --flavour-cursor: url('../img/cursors/focus.png') 4 4; }
  .card-reset, .flavour-reset { --flavour-cursor: url('../img/cursors/reset.png') 4 4; }
  .card-flow,  .flavour-flow  { --flavour-cursor: url('../img/cursors/flow.png') 4 4; }

  .card-focus, .card-reset, .card-flow,
  .flavour-focus, .flavour-reset, .flavour-flow { cursor: var(--flavour-cursor), auto; }

  /* Buttons and links keep saying "clickable"; fields keep saying "type here".
     Losing that signal across a whole buy box would cost more than the fruit adds. */
  :is(.card-focus, .card-reset, .card-flow, .flavour-focus, .flavour-reset, .flavour-flow)
    :is(a, button, summary, label, select, [role="button"]) { cursor: pointer; }
  :is(.card-focus, .card-reset, .card-flow, .flavour-focus, .flavour-reset, .flavour-flow)
    :is(input:not([type="radio"]):not([type="checkbox"]), textarea) { cursor: text; }

  /* The variant chips are the moment of choosing, so they preview the flavour they
     switch to rather than showing a plain pointer. Two classes, so this wins over
     the affordance rule above. */
  .variant-chip.chip-focus { cursor: url('../img/cursors/focus.png') 4 4, pointer; }
  .variant-chip.chip-reset { cursor: url('../img/cursors/reset.png') 4 4, pointer; }
  .variant-chip.chip-flow  { cursor: url('../img/cursors/flow.png') 4 4, pointer; }
}

/* A product card's image and title are links, so the affordance rule above was handing
   them a plain pointer — and on the shop grid those two ARE the card: hovering a pouch,
   the most natural thing to do on that page, showed no fruit at all. Clicking them picks
   the flavour, which is exactly the moment this whole thing exists for, so they carry the
   fruit. Real action controls (Add to cart, the Jelly Jury pill) keep their pointer, and
   `pointer` stays as the fallback if the image ever fails to load. */
@media (hover: hover) and (pointer: fine) {
  :is(.card-focus, .card-reset, .card-flow)
    :is(.product-card-media, .product-card-title a, .ritual-media) {
    cursor: var(--flavour-cursor), pointer;
  }
}


/* ------------------------------------------------------------------------
   "Still in the lab" holding panel. Shown wherever real lab numbers are not
   substantiated yet: the ingredient explorer on /science, and the nutrition +
   ingredient tables on the PDP. Warm and confident, not an error state — it
   carries the same brand-triad gradient border the explorer cards use on hover.
   Moved here from pages/science.css when the PDP started sharing it.
   ------------------------------------------------------------------------ */
.lab-panel {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-3);
  text-align: center;
  padding: clamp(var(--sp-6), 7vw, var(--sp-9)) var(--sp-5);
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.lab-panel::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: var(--grad-brand-border);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
/* Larger than the site-wide .kicker (0.9rem): this one is a standalone label carrying a whole
   panel rather than a small tag above a section, and at the default size it read as an
   afterthought under a 40px headline. Still well clear of the title so the hierarchy holds. */
.lab-panel-kicker {
  color: var(--focus-deep);
  font-size: clamp(var(--text-base), 0.85rem + 0.5vw, 1.25rem);
}
.lab-panel-title {
  margin: 0;
  font-size: clamp(var(--text-xl), 3.6vw, 2.5rem);
  line-height: 1.15;
  text-wrap: balance;
}
/* No max-width, deliberately — a reading measure folded this single statement into a
   three-line block that read as a stubby paragraph. It runs on one line on a wide desktop and
   wraps below that; text-wrap: pretty keeps the last line off a single orphan word.
   Set in the display face rather than the body face: this is the one line of voice in the
   panel, sitting between a display kicker and a display headline, and in Inter it read as a
   footnote apologising for them. 600 is the lightest Baloo 2 weight loaded in head.php — going
   lower would get a synthesised weight. Size is unchanged from the Inter version because Baloo
   2 at 600 sets NARROWER, not wider: measured at 1.125rem the line is 916px against Inter's
   1017px, so it holds one line down to a ~1080px viewport where the old face gave out at
   ~1180px. The one-line window got wider, not tighter. */
.lab-panel-body {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(var(--text-base), 0.9rem + 0.4vw, var(--text-md));
  letter-spacing: -0.005em;
  text-wrap: pretty;
}
.lab-panel-cta { margin-top: var(--sp-2); }

/* ----- Account auth screens (log in, register, reset) -----
   These four pages link straight to each other, so they share one shell: a box that
   changed width between "Log in" and "Create an account" would read as a glitch.
   The 440px inline width they carried made the card narrower than the labels needed
   and it read as a toy; 560px with a roomier card gives it the weight of a real form. */
.auth-shell { max-width: 560px; }
.auth-card { padding: var(--sp-7) var(--sp-6); }
/* Taller fields and CTA to match the larger box — em-based so they track the type. */
.auth-card .input { padding-block: 0.8em; }
.auth-card .btn   { padding-block: 0.7em; font-size: var(--text-base); }
.auth-card .field { margin-bottom: var(--sp-5); }
@media (max-width: 560px) {
  .auth-card { padding: var(--sp-5) var(--sp-4); }
}
