/* ============================================================================
   NOVA FORM — theme.css
   Hand-rolled Shopify theme. No framework, no preprocessor, no utility classes.
   Order: tokens → base → layout → components. Nothing below the token block
   hard-codes a colour, size, or duration.

   Type    Instrument Serif + Instrument Sans (SIL OFL 1.1, self-hosted)
   Palette Ivory & Cedar — every text pair verified AA, most AAA
   See docs/style-research.md for the derivation of every value here.
   ========================================================================= */

/* ============================================================================
   1. TOKENS
   ========================================================================= */

:root {
  /* ---------- Typography ---------- */
  --font-display: "Instrument Serif", "Iowan Old Style", "Apple Garamond",
                  Baskerville, Georgia, "Times New Roman", serif;
  --font-sans:    "Instrument Sans", ui-sans-serif, system-ui, -apple-system,
                  "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --text-xs:      0.75rem;                                          /* 12px    */
  --text-sm:      0.875rem;                                         /* 14px    */
  --text-md:      clamp(1rem,     0.9780rem + 0.0939vw, 1.0625rem); /* 16 → 17 */
  --text-lg:      clamp(1.125rem, 1.0590rem + 0.2817vw, 1.3125rem); /* 18 → 21 */
  --text-xl:      clamp(1.375rem, 1.2430rem + 0.5634vw, 1.75rem);   /* 22 → 28 */
  --text-2xl:     clamp(1.625rem, 1.3609rem + 1.1268vw, 2.375rem);  /* 26 → 38 */
  --text-display: clamp(2.125rem, 1.4648rem + 2.8169vw, 4rem);      /* 34 → 64 */

  --leading-tight:    1.1;
  --leading-snug:     1.25;
  --leading-normal:   1.5;
  --leading-relaxed:  1.6;
  --tracking-label:   0.08em;
  --tracking-display: -0.02em;

  /* ---------- Colour ---------- */
  --color-bg:            #FBFAF7;   /* warm ivory page ground                  */
  --color-surface:       #FFFFFF;   /* cards                                   */
  --color-band:          #F1EDE6;   /* soft stone section band                 */
  --color-band-deep:     #E7E1D6;   /* second-level band                       */

  --color-border:        #DFD9CE;   /* DECORATIVE hairlines ONLY — 1.35:1      */
  --color-border-strong: #8B8170;   /* any border that identifies a control    */

  --color-text:          #211F1C;   /* 15.75:1 on bg — AAA                     */
  --color-text-muted:    #635D54;   /*  6.24:1 on bg — AA                      */

  --color-accent:        #3F5137;   /* botanical green — accent AND CTA        */
  --color-accent-hover:  #33422C;
  --color-accent-soft:   #E8EDE4;
  --color-cta-text:      #FBFAF7;   /*  8.23:1 on accent — AAA                 */

  --color-success:       #2F6B47;
  --color-success-bg:    #EAF2ED;
  --color-error:         #9B3126;
  --color-error-bg:      #FBEDEA;

  /* Charcoal, NOT green. 1.91:1 against the CTA itself, so outline-offset is
     load-bearing: it lifts the ring onto the ground behind the button. */
  --color-focus:         #211F1C;

  /* ---------- Spacing ---------- */
  --space-2xs: 0.25rem;   /*  4px */
  --space-xs:  0.5rem;    /*  8px */
  --space-sm:  1rem;      /* 16px */
  --space-md:  1.5rem;    /* 24px */
  --space-lg:  2.5rem;    /* 40px */
  --space-xl:  4rem;      /* 64px */
  --space-2xl: 6rem;      /* 96px */

  --space-section: clamp(3.5rem, 1.9155rem + 6.7606vw, 8rem);      /*  56 → 128 */
  --gutter:        clamp(1.5rem, 1.1039rem + 1.6901vw, 2.625rem);  /*  24 →  42 */

  /* ---------- Radius ---------- */
  --radius-sm:   2px;     /* buttons, inputs, badges */
  --radius-md:   4px;     /* cards, media            */
  --radius-lg:   8px;     /* drawers, modals, bars   */
  --radius-pill: 999px;   /* filter chips only       */

  /* ---------- Motion ---------- */
  --ease:          cubic-bezier(.2, .7, .3, 1);
  --duration-fast: 160ms;
  --duration-base: 260ms;
  --duration-slow: 480ms;

  /* ---------- Layout ---------- */
  --page-max:  78rem;     /* 1248px */
  --measure:   62ch;      /* max line length for body copy */
  --header-h:  64px;
  --tap:       48px;      /* minimum tap target */
}

/* ============================================================================
   2. BASE
   ========================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-sm));
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;                 /* Instrument Serif ships one weight */
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-sm);
  text-wrap: balance;
}
h1 { font-size: var(--text-display); }
h2 { font-size: var(--text-2xl); line-height: 1.12; }
h3 { font-size: var(--text-xl);  line-height: var(--leading-snug); }

p { margin: 0 0 var(--space-sm); max-width: var(--measure); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

img, picture, video, svg { display: block; max-width: 100%; height: auto; }

ul, ol { margin: 0 0 var(--space-sm); padding-left: 1.25em; }

/* One global focus style. Never remove without a replacement. */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: inherit;
}

/* Controls use the AA border, never the decorative hairline. */
:where(input, select, textarea) {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-md);        /* ≥16px stops iOS Safari zooming on focus */
  min-height: var(--tap);
  padding: 0 var(--space-sm);
}

::selection { background: var(--color-accent-soft); color: var(--color-text); }

/* The UA rule for [hidden] is a bare attribute selector, so any class that
   sets `display` beats it — the cart badge (display: grid) stayed visible
   showing "0" while carrying the hidden attribute. Toggling `.hidden` in JS
   is only correct if this rule exists. */
[hidden] { display: none !important; }

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

/* ============================================================================
   3. LAYOUT
   ========================================================================= */

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

.container--narrow { max-width: 46rem; }

.section       { padding-block: var(--space-section); }
.section--band { background: var(--color-band); }
.section--deep { background: var(--color-band-deep); }
.section--tight { padding-block: calc(var(--space-section) * 0.55); }

.section__head { margin-bottom: var(--space-lg); }
.section__head > :last-child { margin-bottom: 0; }

/* Vertical rhythm without margin collapse surprises. */
.stack > * + * { margin-top: var(--space-sm); }
.stack--lg > * + * { margin-top: var(--space-md); }

.grid { display: grid; gap: var(--space-md); }
@media (min-width: 48em)  { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60em)  { .grid--3 { grid-template-columns: repeat(3, 1fr); }
                            .grid--4 { grid-template-columns: repeat(4, 1fr); } }

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

/* Skip link — visible only when focused. */
.skip-link {
  position: absolute; top: var(--space-xs); left: var(--space-xs);
  z-index: 100;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease);
}
.skip-link:focus { transform: none; }

/* ----- Scroll reveal -------------------------------------------------------
   Inverted on purpose: content is visible by default and JS ADDS the hidden
   state, so a failed observer or a JS error leaves a readable page rather than
   a blank section. This is the most common way production themes break. */
.js .reveal { opacity: 0; transform: translateY(12px); }
.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity var(--duration-slow) var(--ease),
              transform var(--duration-slow) var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
}

/* ============================================================================
   4. COMPONENTS
   ========================================================================= */

/* ----- Label ------------------------------------------------------------- */
.label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xs);
}

/* ----- Button ------------------------------------------------------------
   One element, three variants, seven states. The loading state keeps the
   button's width so the layout does not jump when the label is swapped. */
.btn {
  --btn-bg:     var(--color-accent);
  --btn-fg:     var(--color-cta-text);
  --btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--tap);
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease),
              transform var(--duration-fast) var(--ease);
}
.btn:hover  { --btn-bg: var(--color-accent-hover); }
.btn:active { transform: translateY(1px); }

.btn--full { width: 100%; }

.btn--secondary {
  --btn-bg: transparent;
  --btn-fg: var(--color-text);
  --btn-border: var(--color-border-strong);
}
.btn--secondary:hover { --btn-bg: var(--color-band); --btn-border: var(--color-text); }

.btn--tertiary {
  --btn-bg: transparent;
  --btn-fg: var(--color-text);
  --btn-border: transparent;
  padding: var(--space-2xs) 0;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  /* Keeps the full tap height while the underline stays tight to the text,
     so it still reads as a link next to the 48px primary. */
}
.btn--tertiary:hover { --btn-bg: transparent; color: var(--color-accent); }

.btn[disabled],
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

/* Loading — aria-busy is the source of truth, so screen readers and CSS agree. */
.btn[aria-busy="true"] { cursor: progress; color: transparent; position: relative; }
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 1.125em; height: 1.125em;
  border: 2px solid currentColor;
  border-block-start-color: var(--btn-fg);
  border-radius: 50%;
  color: color-mix(in srgb, var(--btn-fg) 35%, transparent);
  animation: nf-spin 700ms linear infinite;
}
@keyframes nf-spin { to { transform: rotate(360deg); } }

.btn.is-success { --btn-bg: var(--color-success); }
.btn.is-error   { --btn-bg: var(--color-error); }

/* ----- Price -------------------------------------------------------------- */
.price { display: inline-flex; align-items: baseline; gap: var(--space-xs); }
.price__current { font-size: var(--text-lg); font-weight: 500; }
.price__compare {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: line-through;
}
.price__unit { font-size: var(--text-xs); color: var(--color-text-muted); }
.price--sale .price__current { color: var(--color-accent); }

/* ----- Rating ------------------------------------------------------------
   The stars are decorative; the accessible value lives in visually-hidden
   text so a screen reader hears "4.9 out of 5" rather than five glyphs. */
.rating { display: inline-flex; align-items: center; gap: var(--space-xs); }
.rating__stars { display: inline-flex; gap: 2px; color: var(--color-accent); }
.rating__stars svg { width: 14px; height: 14px; fill: currentColor; }
.rating__star--empty { opacity: 0.25; }
.rating__text { font-size: var(--text-sm); color: var(--color-text-muted); }

/* ----- Card --------------------------------------------------------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);   /* decorative: bg change carries it */
  border-radius: var(--radius-md);
  padding: var(--space-md);
}
.card__media {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: calc(var(--space-md) * -1) calc(var(--space-md) * -1) var(--space-md);
}
.card__media img { transition: transform var(--duration-slow) var(--ease); }
.card:hover .card__media img { transform: scale(1.03); }
.card__title { font-size: var(--text-lg); margin-bottom: var(--space-2xs); }

/* ----- Badge -------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: var(--space-2xs) var(--space-xs);
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.badge--demo { background: var(--color-band-deep); color: var(--color-text-muted); }

/* ----- Field -------------------------------------------------------------- */
.field { display: grid; gap: var(--space-2xs); }
.field__label { font-size: var(--text-sm); font-weight: 500; }
.field__hint  { font-size: var(--text-xs); color: var(--color-text-muted); }
.field__error { font-size: var(--text-sm); color: var(--color-error); }
.field input[aria-invalid="true"] { border-color: var(--color-error); }

/* ----- Quantity selector --------------------------------------------------
   A real number input, kept accessible, with the spinners hidden so the
   custom −/+ buttons are the only affordance. */
.qty {
  display: inline-grid;
  grid-template-columns: var(--tap) 3.5rem var(--tap);
  align-items: stretch;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty__btn {
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--color-text);
  font-size: var(--text-lg);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease);
}
.qty__btn:hover { background: var(--color-band); }
.qty__btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.qty__input {
  border: 0; border-inline: 1px solid var(--color-border-strong);
  border-radius: 0;
  text-align: center;
  padding: 0;
  -moz-appearance: textfield;
}
.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ----- Variant selector ---------------------------------------------------
   Real radio inputs behind the labels: keyboard and screen-reader support
   comes free, and the control still works with JS disabled. */
.variants { display: grid; gap: var(--space-sm); }
.variants__group { display: grid; gap: var(--space-xs); }
.variants__options { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.variants__input { position: absolute; opacity: 0; pointer-events: none; }
.variants__label {
  display: inline-flex; align-items: center;
  min-height: var(--tap); padding: 0 var(--space-sm);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease),
              background var(--duration-fast) var(--ease);
}
.variants__label:hover { background: var(--color-band); }
.variants__input:checked + .variants__label {
  border-color: var(--color-text);
  background: var(--color-text);
  color: var(--color-bg);
}
.variants__input:focus-visible + .variants__label {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
/* Sold out: struck through, still focusable so it can announce itself. */
.variants__input:disabled + .variants__label {
  color: var(--color-text-muted);
  border-color: var(--color-border);
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ----- Accordion ----------------------------------------------------------
   details/summary. Works with no JS at all. The height tween is a progressive
   enhancement: interpolate-size is Chromium-only today, so browsers without it
   simply open instantly instead of animating. */
.accordion { border-top: 1px solid var(--color-border); }
.accordion__item { border-bottom: 1px solid var(--color-border); }
.accordion__summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-sm);
  min-height: var(--tap);
  padding-block: var(--space-sm);
  font-size: var(--text-lg);
  cursor: pointer;
  list-style: none;
}
.accordion__summary::-webkit-details-marker { display: none; }
.accordion__summary::after {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--duration-base) var(--ease);
}
.accordion__item[open] > .accordion__summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}
.accordion__panel { padding-bottom: var(--space-md); color: var(--color-text-muted); }

@supports (interpolate-size: allow-keywords) {
  .accordion__item::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size var(--duration-base) var(--ease),
                content-visibility var(--duration-base) allow-discrete;
  }
  .accordion__item[open]::details-content { block-size: auto; }
  :root { interpolate-size: allow-keywords; }
}

/* ----- Trust item --------------------------------------------------------- */
.trust { display: grid; gap: var(--space-md); }
.trust__item { display: grid; gap: var(--space-2xs); }
.trust__icon { width: 22px; height: 22px; color: var(--color-accent); }
.trust__title { font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600; }
.trust__body  { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }

/* ----- Demo notice --------------------------------------------------------
   Required wherever fictional social proof appears. See docs/brand.md. */
.demo-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: var(--space-sm);
}

/* ============================================================================
   5. GLOBAL SECTIONS
   ========================================================================= */

/* ----- Announcement bar --------------------------------------------------- */
.announcement {
  background: var(--announcement-bg, var(--color-text));
  color: var(--announcement-fg, var(--color-bg));
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.announcement__inner { display: grid; place-items: center; min-height: 38px; }
.announcement__list { list-style: none; margin: 0; padding: 0; }
.announcement__item { margin: 0; text-align: center; }
.announcement__item a { color: inherit; }

/* ----- Header ------------------------------------------------------------
   Three-column grid on mobile (menu / logo / cart) so the logo is optically
   centred regardless of how wide the actions are. Desktop swaps to a
   nav-left, logo-left, actions-right arrangement. */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.header__inner {
  display: grid;
  grid-template-columns: var(--tap) 1fr auto;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--header-h);
}

.header__logo {
  justify-self: center;
  display: flex; align-items: center;
  min-height: var(--tap);      /* the wordmark links home — give it a real target */
  text-decoration: none;
}
.header__wordmark {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.header__logo-img { max-height: 28px; width: auto; }

.header__icon-btn {
  display: grid; place-items: center;
  width: var(--tap); height: var(--tap);
  background: none; border: 0;
  color: var(--color-text);
  cursor: pointer;
  text-decoration: none;
}
.header__icon { width: 22px; height: 22px; }

.header__cart { position: relative; }
.header__cart-count {
  position: absolute;
  top: 6px; right: 4px;
  min-width: 18px; height: 18px;
  display: grid; place-items: center;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-cta-text);
  font-size: 11px;
  line-height: 1;
}

.header__actions { display: flex; align-items: center; }
.header__nav { display: none; }

/* Mobile disclosure nav — no JavaScript required to open or close it. */
.header__nav-toggle > summary { list-style: none; }
.header__nav-toggle > summary::-webkit-details-marker { display: none; }
.header__drawer {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) var(--gutter) var(--space-md);
}
.header__drawer-list { list-style: none; margin: 0; padding: 0; display: grid; }
.header__drawer-list a {
  display: flex; align-items: center;
  min-height: var(--tap);
  font-size: var(--text-lg);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
}
.header__drawer-list li:last-child a { border-bottom: 0; }

@media (min-width: 60em) {
  .header__nav-toggle { display: none; }
  .header__inner { grid-template-columns: auto 1fr auto; gap: var(--space-lg); }
  .header__logo { justify-self: start; }
  .header__nav { display: block; }
  .header__nav-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: var(--space-md);
  }
  .header__nav-list a {
    text-decoration: none;
    font-size: var(--text-sm);
    padding-block: var(--space-xs);
    border-bottom: 1px solid transparent;
    transition: border-color var(--duration-fast) var(--ease);
  }
  .header__nav-list a:hover,
  .header__nav-list a[aria-current="page"] { border-bottom-color: var(--color-text); }
}

.header__desktop-only { display: none; }
@media (min-width: 48em) { .header__desktop-only { display: grid; } }

/* ----- Footer ------------------------------------------------------------- */
.footer {
  background: var(--color-band);
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-xl) var(--space-lg);
}
.footer__groups { display: grid; gap: var(--space-xs); }

.footer__group { border-bottom: 1px solid var(--color-border); }
.footer__group-title {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--tap);
  margin: 0;
  cursor: pointer;
  list-style: none;
}
.footer__group-title::-webkit-details-marker { display: none; }
details.footer__group > summary::after {
  content: "";
  width: 9px; height: 9px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--duration-base) var(--ease);
}
details.footer__group[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }

.footer__links { list-style: none; margin: 0 0 var(--space-sm); padding: 0; display: grid; }
.footer__links a {
  display: flex; align-items: center;
  min-height: var(--tap);        /* phones: full tap target */
  font-size: var(--text-sm);
  text-decoration: none;
  color: var(--color-text-muted);
}
@media (min-width: 48em) {
  /* Pointer input — the 48px rows read as loose in a four-column footer. */
  .footer__links a { min-height: 34px; }
}
.footer__links a:hover { color: var(--color-text); text-decoration: underline; }

.footer__group--newsletter { border-bottom: 0; padding-top: var(--space-sm); }
.footer__newsletter-copy { font-size: var(--text-sm); color: var(--color-text-muted); }
.footer__form { display: grid; gap: var(--space-xs); max-width: 22rem; }
.footer__form-success { font-size: var(--text-sm); color: var(--color-success); margin: 0; }

.footer__base {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  display: grid; gap: var(--space-2xs);
}
.footer__copyright,
.footer__disclaimer { font-size: var(--text-xs); color: var(--color-text-muted); margin: 0; }

@media (min-width: 48em) {
  /* minmax(0, 1fr), not 1fr: the newsletter input's min-content width would
     otherwise force that column wider than the three link columns. */
  .footer__groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md) var(--space-lg); }

  /* From tablet up the groups stay open and stop behaving as disclosures.
     The markup already carries `open`, so this is purely presentational —
     no JS removes or re-adds the attribute at the breakpoint. */
  .footer__group { border-bottom: 0; }
  details.footer__group > summary { pointer-events: none; cursor: default; }
  details.footer__group > summary::after { display: none; }
  .footer__group--newsletter { padding-top: 0; }
  .footer__base { grid-template-columns: 1fr auto; align-items: center; }
  .footer__disclaimer { text-align: right; }
}

@media (min-width: 60em) {
  /* Four columns only once each one can hold its links without wrapping. */
  .footer__groups { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============================================================================
   6. HOME SECTIONS
   ========================================================================= */

/* ----- Hero --------------------------------------------------------------
   Mobile stacks image → text, which is also the DOM order, so nothing is
   reordered for assistive technology. On desktop the grid places the media
   column; `order` is only ever applied to whole columns, never to text. */
.hero { padding-block: var(--space-lg) var(--space-section); }
.hero__inner { display: grid; gap: var(--space-md); align-items: center; }

.hero__media { border-radius: var(--radius-md); overflow: hidden; }
.hero__img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.hero__placeholder { background: var(--color-band); }

.hero__heading { margin-bottom: var(--space-sm); }
.hero__body { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 34ch; }

.hero__actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.hero__proof {
  display: flex; align-items: center; gap: var(--space-xs);
  margin-top: var(--space-md);
}
.hero__proof-text { font-size: var(--text-sm); color: var(--color-text-muted); }
.hero__proof + .demo-note { margin-top: var(--space-2xs); }

@media (min-width: 60em) {
  .hero { padding-block: var(--space-section); }
  .hero__inner { grid-template-columns: 1fr 1fr; gap: var(--space-2xl); }
  .hero__img { aspect-ratio: 1 / 1; }

  .hero__inner--right .hero__media  { order: 2; }
  .hero__inner--right .hero__content { order: 1; }
  .hero__inner--left  .hero__media  { order: 1; }
  .hero__inner--left  .hero__content { order: 2; }
}

/* ============================================================================
   7. PRODUCT PAGE
   ========================================================================= */

.pdp { padding-block: var(--space-lg) var(--space-section); }
.pdp__grid { display: grid; gap: var(--space-lg); }

@media (min-width: 60em) {
  .pdp__grid { grid-template-columns: 55fr 45fr; gap: var(--space-2xl); align-items: start; }
  /* The gallery is taller than the purchase column; sticking the column keeps
     the CTA in view while the images scroll past. */
  .pdp__info { position: sticky; top: calc(var(--header-h) + var(--space-md)); }
}

/* ----- Gallery -----------------------------------------------------------
   Mobile is a scroll-snap track — native momentum, no carousel library, and
   it still works with JS disabled. Desktop stacks the images and the
   thumbnails become anchors into that stack. */
.gallery__viewport {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radius-md);
}
.gallery__viewport::-webkit-scrollbar { display: none; }

.gallery__slide {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: center;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.gallery__img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.gallery__counter {
  margin: var(--space-xs) 0 0;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: var(--tracking-label);
}

.gallery__thumbs { display: none; }

@media (min-width: 60em) {
  .gallery__viewport {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xs);
    overflow: visible;
    scroll-snap-type: none;
  }
  .gallery__img { aspect-ratio: 1 / 1; }
  .gallery__counter { display: none; }

  .gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-xs);
    list-style: none;
    margin: var(--space-xs) 0 0;
    padding: 0;
  }
  .gallery__thumb {
    display: block; width: 100%;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: none;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.6;
    transition: opacity var(--duration-fast) var(--ease),
                border-color var(--duration-fast) var(--ease);
  }
  .gallery__thumb img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
  .gallery__thumb:hover { opacity: 1; }
  .gallery__thumb.is-active { opacity: 1; border-color: var(--color-text); }
}

/* ----- Product information ------------------------------------------------ */
.pdp__rating { margin-bottom: var(--space-xs); }
.pdp__title { font-size: var(--text-2xl); margin-bottom: var(--space-xs); }
.pdp__price { margin-bottom: var(--space-sm); }
.pdp__lede { color: var(--color-text-muted); margin-bottom: var(--space-md); }

.pdp__form { display: grid; gap: var(--space-md); }
.pdp__form fieldset { border: 0; padding: 0; margin: 0; }
.pdp__form legend { padding: 0; margin-bottom: var(--space-xs); }

.pdp__submit { margin-top: var(--space-2xs); }

.pdp__error {
  margin: 0;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--color-error-bg);
  color: var(--color-error);
  font-size: var(--text-sm);
}

.pdp__reassurance {
  display: flex; align-items: center; gap: var(--space-xs);
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.pdp__reassurance-icon { width: 18px; height: 18px; flex: none; color: var(--color-accent); }

/* ----- Purchase options --------------------------------------------------
   Radio cards. The input stays in the flow (not hidden) so it is focusable
   and announces itself; the card is the label wrapped around it. */
.purchase { display: grid; gap: var(--space-xs); }
.purchase__option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs) var(--space-sm);
  align-items: center;
  padding: var(--space-sm);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease),
              background var(--duration-fast) var(--ease);
}
.purchase__option:hover { background: var(--color-band); }
.purchase__option:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}
.purchase__option input { min-height: auto; accent-color: var(--color-accent); }
.purchase__body {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-sm);
  font-size: var(--text-sm);
}
.purchase__name { display: flex; align-items: center; gap: var(--space-xs); font-weight: 500; }
.purchase__price { font-weight: 500; white-space: nowrap; }
.purchase__note {
  grid-column: 2;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ----- Sticky mobile add to cart -----------------------------------------
   Revealed only once the real CTA has scrolled out of view. Compact by
   design: it must never become the page. */
.sticky-cart {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-xs);
  padding-bottom: max(var(--space-xs), env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform var(--duration-base) var(--ease);
}
.sticky-cart.is-visible { transform: none; }

.sticky-cart__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-sm);
}
.sticky-cart__meta { display: grid; min-width: 0; }
.sticky-cart__title {
  font-size: var(--text-sm);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sticky-cart__price { font-size: var(--text-sm); font-weight: 500; }
.sticky-cart__btn { flex: none; }

@media (min-width: 60em) {
  .sticky-cart { display: none; }
}

/* ============================================================================
   8. PDP SUPPORTING SECTIONS
   ========================================================================= */

/* ----- Benefits ----------------------------------------------------------
   Mobile scrolls horizontally with snap points; from 48em it becomes a plain
   grid. Same markup, no duplicated DOM. */
.benefits {
  list-style: none; margin: 0; padding: 0 0 var(--space-xs);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 78%;
  gap: var(--space-sm);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* Bleed to the screen edge so cards look like they continue off-screen. */
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: none;
}
.benefits::-webkit-scrollbar { display: none; }
.benefits__item { scroll-snap-align: start; }
.benefits__index { display: block; color: var(--color-accent); margin-bottom: var(--space-xs); }
.benefits__title { font-size: var(--text-lg); margin-bottom: var(--space-2xs); }
.benefits__body { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }

@media (min-width: 48em) {
  .benefits {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    grid-auto-columns: auto;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
}

/* ----- Comparison --------------------------------------------------------
   Stays a real table at every width. The first column sticks so the feature
   name is still readable once the columns scroll — which is what card
   conversion is usually trying to solve, without breaking the semantics. */
.cmp__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cmp {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--text-sm);
}
.cmp th, .cmp td { padding: var(--space-sm) var(--space-xs); border-bottom: 1px solid var(--color-border); }

.cmp__row-label {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--color-bg);
  font-weight: 400;
  min-width: 12rem;
}
.section--band .cmp__row-label { background: var(--color-band); }

.cmp__col { text-align: center; font-weight: 500; font-size: var(--text-xs);
            letter-spacing: var(--tracking-label); text-transform: uppercase; }
.cmp__col--featured { color: var(--color-accent); }
.cmp__cell { text-align: center; }
.cmp__cell--featured { background: var(--color-accent-soft); }
.cmp__yes { width: 18px; height: 18px; margin-inline: auto; color: var(--color-accent); }
.cmp__no { color: var(--color-text-muted); }

/* ----- Trust row ---------------------------------------------------------- */
.trust--row {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
@media (min-width: 60em) {
  .trust--row { grid-template-columns: repeat(4, 1fr); }
}

/* ----- Bundle ------------------------------------------------------------- */
.bundle { display: grid; gap: var(--space-lg); }
.bundle__items {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  align-items: start;
}
.bundle__item { text-align: center; }
.bundle__media {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  margin-bottom: var(--space-xs);
}
.bundle__media img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.bundle__item-title { font-size: var(--text-sm); margin: 0; }
.bundle__item-price { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }

.bundle__summary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: grid;
  gap: var(--space-sm);
  align-content: start;
}
.bundle__lines { margin: 0; display: grid; gap: var(--space-2xs); }
.bundle__line { display: flex; justify-content: space-between; gap: var(--space-sm); font-size: var(--text-sm); }
.bundle__line dt, .bundle__line dd { margin: 0; }
.bundle__line--total { font-size: var(--text-lg); font-weight: 500; }
.bundle__saving {
  margin: 0;
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 500;
  /* Deliberately not a loud badge — the brief asks for value, not urgency. */
}

@media (min-width: 60em) {
  .bundle { grid-template-columns: 1.4fr 1fr; align-items: start; gap: var(--space-2xl); }
}

/* ----- Reviews ------------------------------------------------------------ */
.reviews__head { display: grid; gap: var(--space-md); }
.reviews__aggregate { display: grid; gap: var(--space-2xs); }
.reviews__average { font-size: var(--text-lg); margin: 0; }
.reviews__count { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }

.reviews__list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  gap: var(--space-sm);
}
.reviews__item { display: grid; gap: var(--space-xs); align-content: start; }
.reviews__item-title { font-family: var(--font-sans); font-size: var(--text-md); font-weight: 600; margin: 0; }
.reviews__body { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.reviews__author { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }

@media (min-width: 48em) {
  .reviews__head { grid-template-columns: 1fr auto; align-items: end; }
  .reviews__aggregate { justify-items: end; text-align: right; }
  .reviews__list { grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
}

/* ============================================================================
   9. CART
   ========================================================================= */

/* ----- Drawer ------------------------------------------------------------
   A native <dialog>. ::backdrop, focus trapping, Escape and page inertness
   are all handled by the platform. */
.drawer {
  margin: 0 0 0 auto;                 /* pin to the right edge */
  max-width: 26rem;
  width: 100%;
  height: 100%;
  max-height: 100%;
  padding: 0;
  border: 0;
  background: var(--color-bg);
  color: var(--color-text);
}
.drawer::backdrop { background: rgb(33 31 28 / 0.35); }

.drawer[open] { animation: nf-drawer-in var(--duration-base) var(--ease); }
.drawer[open]::backdrop { animation: nf-fade-in var(--duration-base) var(--ease); }
@keyframes nf-drawer-in { from { transform: translateX(100%); } }
@keyframes nf-fade-in   { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .drawer[open], .drawer[open]::backdrop { animation: none; }
}

.drawer__inner {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100%;
  overflow: hidden;
}

.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
}
.drawer__title { font-size: var(--text-xl); margin: 0; }

.drawer__items {
  list-style: none; margin: 0;
  padding: var(--space-sm) var(--space-md);
  display: grid; gap: var(--space-sm);
  /* Rows keep their own height instead of stretching to fill the scroll area —
     without this a single line item grows to the height of the drawer. */
  align-content: start;
  overflow-y: auto;
}

.drawer__foot {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  display: grid; gap: var(--space-sm);
  background: var(--color-bg);
}
.drawer__subtotal {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--text-sm);
}
.drawer__subtotal-value { font-size: var(--text-lg); font-weight: 500; }
.drawer__continue { justify-self: center; }

.drawer__empty {
  display: grid; gap: var(--space-md);
  place-content: center; justify-items: center;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  grid-row: 2 / -1;
}

/* ----- Free shipping progress -------------------------------------------- */
.shipbar { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--color-border); }
.shipbar__text { margin: 0 0 var(--space-xs); font-size: var(--text-xs); color: var(--color-text-muted); }
.shipbar__bar {
  appearance: none; -webkit-appearance: none;
  display: block; width: 100%; height: 4px;
  border: 0; border-radius: var(--radius-pill);
  background: var(--color-band-deep);
  overflow: hidden;
}
.shipbar__bar::-webkit-progress-bar { background: var(--color-band-deep); border-radius: var(--radius-pill); }
.shipbar__bar::-webkit-progress-value {
  background: var(--color-accent); border-radius: var(--radius-pill);
  transition: width var(--duration-base) var(--ease);
}
.shipbar__bar::-moz-progress-bar { background: var(--color-accent); border-radius: var(--radius-pill); }

/* ----- Line item ---------------------------------------------------------- */
.line { display: grid; grid-template-columns: 72px 1fr; gap: var(--space-sm); }
.line__media {
  /* align-self is load-bearing: as a stretched grid item the box would grow to
     the full row height and show its background as a tall band beside a short
     thumbnail. */
  align-self: start;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-band);
}
.line__media img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.line__body { display: grid; gap: var(--space-2xs); align-content: start; min-width: 0; }
.line__title { font-size: var(--text-sm); font-weight: 500; text-decoration: none; }
.line__variant,
.line__plan { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
.line__plan { color: var(--color-accent); }
.line__controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-sm);
  margin-top: var(--space-2xs);
}
.line__price { font-size: var(--text-sm); font-weight: 500; white-space: nowrap; }

/* Compact stepper for line items — smaller than the PDP one, but the buttons
   stay at 40px so they remain usable on a phone. */
.qty--sm { grid-template-columns: 40px 2.5rem 40px; }
.qty--sm .qty__btn { min-height: 40px; font-size: var(--text-md); }
.qty--sm .qty__input { min-height: 40px; font-size: var(--text-sm); }

/* A line mid-update is dimmed and inert rather than removed, so the drawer
   does not jump while the request is in flight. */
.line.is-updating { opacity: 0.45; pointer-events: none; }

/* ----- Upsell ------------------------------------------------------------
   Sits above the footer, dismissible, and never taller than a line item. */
.upsell {
  margin: 0 var(--space-md) var(--space-sm);
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-band);
}
.upsell__head { display: flex; align-items: center; justify-content: space-between; }
.upsell__head .label { margin: 0; }
.upsell__dismiss {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  margin-right: calc(var(--space-2xs) * -1);
  border: 0; background: none; cursor: pointer;
  color: var(--color-text-muted);
}
.upsell__dismiss-icon { width: 16px; height: 16px; }
.upsell__body {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}
.upsell__media { border-radius: var(--radius-sm); overflow: hidden; background: var(--color-surface); }
.upsell__media img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.upsell__meta { min-width: 0; }
.upsell__title { margin: 0; font-size: var(--text-sm); font-weight: 500; }
.upsell__price { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.upsell__add { min-height: 40px; padding-inline: var(--space-sm); }

/* ----- Cart page ---------------------------------------------------------- */
.cart-page__items { padding-inline: 0; }
.cart-page__qty { width: 5rem; }
.cart-page__foot {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  display: grid; gap: var(--space-md);
}
.cart-page__actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

/* ----- Related products ---------------------------------------------------
   Two across on a phone rather than one: product cards are for scanning, and
   a single column turns four products into a lot of scrolling. */
.related__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}
@media (min-width: 60em) {
  .related__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-md); }
}

.product-card { display: grid; gap: var(--space-2xs); align-content: start; }
.product-card__link { text-decoration: none; display: grid; gap: var(--space-xs); }
.product-card__title { font-size: var(--text-md); margin: 0; }
.product-card__placeholder { background: var(--color-band); aspect-ratio: 1 / 1; }
.product-card__sold-out { margin: 0; font-size: var(--text-xs); color: var(--color-text-muted); }
