/* ==========================================================================
   CompareBabyStuff — Design System v2 ("Soft Pastels")
   R1 foundation: tokens + typography + shape + motion + core components
   Spec source: builds/lane-redesign1/BRIEF.md (proposal §2.1–2.4)
   NOTE: Google Fonts loaded via @import for R1 speed; self-hosting fonts
   (woff2 + preload) is a scheduled follow-up before prod cutover.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. FONTS — Fraunces (display, opsz 9–144, wght 400–900, italics)
             + Nunito Sans (body/UI, variable)
             + JetBrains Mono (data/table numerals)
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..900;1,9..144,400..900&family=Nunito+Sans:ital,opsz,wght@0,6..12,400..1000;1,6..12,400..1000&family=JetBrains+Mono:wght@400..700&display=swap');

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* --- 1a. Pastel palette (100 = wash/tint, 200 = solid pastel, 300 = edge) */
  --blush-100: #fff0ef;
  --blush-200: #ffdcda;
  --blush-300: #ffc4c0;

  --peach-100: #fff1e7;
  --peach-200: #ffe0cb;
  --peach-300: #ffc9a3;

  --butter-100: #fff8e1;
  --butter-200: #ffedb8;
  --butter-300: #ffe08a;

  --mint-100: #e9f8f0;
  --mint-200: #ccf0de;
  --mint-300: #a5e3c6;

  --sky-100: #eaf4ff;
  --sky-200: #d3e7fd;
  --sky-300: #aed3fa;

  --lilac-100: #f2eeff;
  --lilac-200: #e4dbfc;
  --lilac-300: #cdbdf7;

  /* --- 1b. Ink (text) scale — warm plum-charcoal */
  --ink-900: #2a2338;
  --ink-700: #4a4160;
  --ink-500: #6f6689;
  /* ink-400: footer fine-print on ink-900 — ink-500 there was 2.82:1 (F1b). */
  --ink-400: #9890ae;
  --ink-300: #a49bb8;
  --ink-100: #eceaf2;

  /* --- 1c. Brand / semantic */
  --brand-green-700: #084c37;
  --brand-green-600: #0b6e4f;
  --brand-green-500: #2e9e77;

  --cta-coral-500: #ff7a59;
  --cta-coral-400: #ff9273;
  --cta-coral-600: #f05a35;

  --win-bg: var(--mint-100);
  --win-text: var(--brand-green-700);
  --lose-bg: #faf9fb;
  --lose-text: var(--ink-500);

  /* --- 1d. Gradients */
  --grad-cta: linear-gradient(135deg, var(--cta-coral-500) 0%, var(--cta-coral-400) 55%, #ffb08a 100%);
  --grad-hero: linear-gradient(165deg, var(--butter-100) 0%, var(--blush-100) 42%, var(--sky-100) 100%);
  --grad-bloom: radial-gradient(closest-side, rgba(255, 122, 89, 0.18), rgba(255, 122, 89, 0));
  --grad-sheen: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);

  /* --- 1e. Shape system */
  --r-card: 20px;        /* outer cards */
  --r-card-inner: 16px;  /* nested panels / card media */
  --r-img: 24px;         /* imagery */
  --r-input: 12px;
  --r-pill: 999px;       /* buttons, tags */

  /* --- 1f. Layered soft shadows (ambient + key) */
  --shadow-xs: 0 1px 2px rgba(42, 35, 56, 0.06), 0 1px 6px rgba(42, 35, 56, 0.04);
  --shadow-sm: 0 1px 2px rgba(42, 35, 56, 0.05), 0 4px 12px rgba(42, 35, 56, 0.06);
  --shadow-md: 0 2px 4px rgba(42, 35, 56, 0.05), 0 10px 28px rgba(42, 35, 56, 0.09);
  --shadow-lg: 0 4px 8px rgba(42, 35, 56, 0.06), 0 20px 48px rgba(42, 35, 56, 0.13);
  --shadow-btn: 0 2px 6px rgba(240, 90, 53, 0.28), 0 8px 22px rgba(240, 90, 53, 0.18);
  --shadow-btn-hover: 0 4px 10px rgba(240, 90, 53, 0.32), 0 12px 30px rgba(240, 90, 53, 0.24);

  /* --- 1g. Glass header recipe */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-blur: blur(14px) saturate(150%);
  --glass-border: 1px solid rgba(42, 35, 56, 0.07);

  /* --- 1h. Confetti-ready vars (consumed by future celebration moments) */
  --confetti-1: var(--cta-coral-500);
  --confetti-2: var(--butter-300);
  --confetti-3: var(--mint-300);
  --confetti-4: var(--sky-300);
  --confetti-5: var(--lilac-300);
  --confetti-6: var(--blush-300);
  --confetti-duration: 2.6s;

  /* --- 1i. Motion timing tokens */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 180ms;
  --dur-med: 320ms;
  --dur-slow: 640ms;

  /* --- 1j. Typography families */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Nunito Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* --- 1k. Layout */
  --container-max: 1160px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
}

/* --------------------------------------------------------------------------
   2. BASE / RESET (light touch)
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.65;
  color: var(--ink-900);
  background: #fffdfa;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

::selection { background: var(--peach-200); color: var(--ink-900); }

:focus-visible {
  outline: 3px solid rgba(255, 122, 89, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY SCALE
   Fraunces = h1/h2/display · Nunito Sans = body/UI · JetBrains Mono = numbers
   -------------------------------------------------------------------------- */
h1, h2, h3.display, .display {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-4);
  color: var(--ink-900);
}

h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-variation-settings: 'opsz' 144;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-variation-settings: 'opsz' 72;
}

h3 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0 0 var(--space-3);
}

.display-xl {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 800;
  font-variation-settings: 'opsz' 144;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.em-accent {                    /* italic Fraunces accent word */
  font-style: italic;
  font-weight: 600;
  color: var(--cta-coral-600);
}

p { margin: 0 0 var(--space-4); }

.lead {
  font-size: 1.1875rem;
  color: var(--ink-700);
  max-width: 60ch;
}

small, .text-small { font-size: 0.875rem; color: var(--ink-500); }

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cta-coral-600);
  margin-bottom: var(--space-3);
}

/* Numeric/data contexts get mono + tabular figures */
.num, td.num, .spec-table td.num {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   4. MOTION LIBRARY
   ALL animation lives behind prefers-reduced-motion: no-preference.
   JS (motion.js) mirrors the same guard for IntersectionObserver work.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {

  /* Reveal-on-scroll initial states (JS adds .is-visible; html.js guard
     means content stays visible if JS never loads). */
  html.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--dur-slow) var(--ease-out),
                transform var(--dur-slow) var(--ease-out);
    will-change: opacity, transform;
  }
  html.js [data-reveal="fade"] { transform: none; }
  html.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }

  /* Stagger children of .stagger (pairs with data-reveal on parent) */
  html.js .stagger.is-visible > * {
    animation: stagger-fade-up var(--dur-slow) var(--ease-out) both;
  }
  .stagger.is-visible > *:nth-child(1)  { animation-delay: 60ms; }
  .stagger.is-visible > *:nth-child(2)  { animation-delay: 140ms; }
  .stagger.is-visible > *:nth-child(3)  { animation-delay: 220ms; }
  .stagger.is-visible > *:nth-child(4)  { animation-delay: 300ms; }
  .stagger.is-visible > *:nth-child(5)  { animation-delay: 380ms; }
  .stagger.is-visible > *:nth-child(6)  { animation-delay: 460ms; }
  .stagger.is-visible > *:nth-child(7)  { animation-delay: 540ms; }
  .stagger.is-visible > *:nth-child(8)  { animation-delay: 620ms; }
  .stagger.is-visible > *:nth-child(n+9) { animation-delay: 700ms; }

  @keyframes stagger-fade-up {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes fade-in-once {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  @keyframes card-lift {
    from { transform: translateY(0); box-shadow: var(--shadow-md); }
    to   { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
  }

  @keyframes button-scale {
    0%   { transform: scale(1); }
    40%  { transform: scale(0.96); }
    100% { transform: scale(1); }
  }

  /* Winner-row sheen: sweeps --grad-sheen across once */
  @keyframes highlight-sweep {
    from { background-position: 220% 0; }
    to   { background-position: -120% 0; }
  }

  /* Count-up finisher: little spring pop (JS toggles .count-done) */
  @keyframes counter-pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.14); }
    100% { transform: scale(1); }
  }
  .count-done { animation: counter-pop 420ms var(--ease-spring) both; display: inline-block; }

  /* Confetti primitives — ready for celebration moments (quiz complete,
     "best pick" reveal). Pieces are absolutely positioned spans. */
  .confetti-piece {
    position: absolute;
    top: -12px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    opacity: 0;
    animation: confetti-fall var(--confetti-duration) var(--ease-out) forwards;
  }
  .confetti-piece:nth-child(6n + 1) { background: var(--confetti-1); }
  .confetti-piece:nth-child(6n + 2) { background: var(--confetti-2); }
  .confetti-piece:nth-child(6n + 3) { background: var(--confetti-3); }
  .confetti-piece:nth-child(6n + 4) { background: var(--confetti-4); }
  .confetti-piece:nth-child(6n + 5) { background: var(--confetti-5); }
  .confetti-piece:nth-child(6n + 6) { background: var(--confetti-6); }

  @keyframes confetti-fall {
    0%   { opacity: 1; transform: translate3d(0, -12px, 0) rotate(0deg); }
    80%  { opacity: 1; }
    100% { opacity: 0; transform: translate3d(var(--confetti-drift, 24px), 46vh, 0) rotate(540deg); }
  }

  /* Hero entrance */
  .hero .hero-copy { animation: stagger-fade-up var(--dur-slow) var(--ease-out) both; }
  .hero .hero-copy > *:nth-child(2) { animation-delay: 120ms; }
  .hero .hero-copy > *:nth-child(3) { animation-delay: 240ms; }
  .hero .hero-art { animation: fade-in-once var(--dur-slow) var(--ease-out) 200ms both; }

  /* Gentle idle float for decorative blobs */
  @keyframes blob-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(12px, -16px) scale(1.04); }
  }
  .blob { animation: blob-float 11s ease-in-out infinite; }
  .blob-b { animation-duration: 14s; animation-direction: reverse; }
}

/* Hard stop for reduced-motion users (belt & suspenders vs vendor styles) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   5. COMPONENTS — BUTTONS (pill, coral gradient CTA)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  border: 0;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out),
              background-color var(--dur-fast) linear,
              filter var(--dur-fast) linear;
}
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  /* F1 fix (QA v2): white on coral gradient measured 2.57–2.18:1 (AA fail).
   * ink-900 label passes AA on every gradient stop incl. hover brightness(1.05)
   * (5.86–9.09:1); white inner ring keeps the pill crisp on pastel washes. */
  background-image: var(--grad-cta);
  color: var(--ink-900);
  box-shadow: var(--shadow-btn), inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: var(--shadow-btn-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--ink-900);
  box-shadow: inset 0 0 0 2px var(--ink-100), var(--shadow-xs);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  background: var(--blush-100);
  box-shadow: inset 0 0 0 2px var(--blush-300), var(--shadow-sm);
}

.btn-mint {
  background: var(--mint-200);
  color: var(--brand-green-700);
}
.btn-mint:hover {
  transform: translateY(-2px);
  background: var(--mint-300);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-700);
}
.btn-ghost:hover { background: var(--sky-100); color: var(--ink-900); }

.btn-sm { padding: 9px 18px; font-size: 0.875rem; }
.btn-lg { padding: 17px 36px; font-size: 1.0625rem; }

/* --------------------------------------------------------------------------
   6. COMPONENTS — CARDS (hover lift + pastel bloom)
   -------------------------------------------------------------------------- */
.c-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out);
}
.c-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 0 0 6px var(--blush-100);
}
.c-card:hover::after {           /* pastel bloom halo */
  content: '';
  position: absolute;
  inset: -34px;
  background: var(--grad-bloom);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.c-card-media {
  border-radius: var(--r-img);
  margin: var(--space-4);
  margin-bottom: 0;
  overflow: hidden;
  background: var(--sky-100);
}
.c-card-media img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

.c-card-body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.c-card-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin: 0; }
.c-card-text { color: var(--ink-700); font-size: 0.9688rem; margin: 0; flex: 1; }
.c-card-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
}

/* --------------------------------------------------------------------------
   7. COMPONENTS — TAG PILLS
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--sky-100);
  color: var(--ink-700);
}

/* Pills may reflow to two lines on very narrow screens instead of clipping */
@media (max-width: 480px) {
  .tag { white-space: normal; }
}
.tag-mint   { background: var(--mint-100); color: var(--brand-green-700); }
.tag-blush  { background: var(--blush-100); color: var(--cta-coral-600); }
.tag-butter { background: var(--butter-100); color: #8a6d1f; }
.tag-lilac  { background: var(--lilac-200); color: #45357a; }
.tag-outline {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink-100);
  color: var(--ink-500);
}

/* --------------------------------------------------------------------------
   8. COMPONENTS — QUIZ PROGRESS DOTS
   -------------------------------------------------------------------------- */
.quiz-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}
.quiz-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-100);
  transition: background-color var(--dur-fast) linear,
              transform var(--dur-fast) var(--ease-spring);
}
.quiz-dots .dot.done { background: var(--mint-300); }
.quiz-dots .dot.active {
  background-image: var(--grad-cta);
  transform: scale(1.35);
  box-shadow: 0 0 0 4px var(--blush-100);
}

/* --------------------------------------------------------------------------
   9. COMPONENTS — SPEC TABLE (mono numerals, mint win cells)
   -------------------------------------------------------------------------- */
.spec-table-wrap {
  border-radius: var(--r-card);
  background: #fff;
  box-shadow: var(--shadow-md);
  overflow-x: auto;
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
.spec-table caption {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  padding: var(--space-5) var(--space-5) var(--space-2);
}
.spec-table th, .spec-table td {
  padding: 14px var(--space-5);
  text-align: left;
  border-bottom: 1px solid var(--ink-100);
  vertical-align: middle;
}
.spec-table thead th {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-500);
  background: #fdfcfe;
}
.spec-table tbody tr:last-child td { border-bottom: 0; }
.spec-table tbody tr { transition: background-color var(--dur-fast) linear; }
.spec-table tbody tr:hover { background: var(--sky-100); }

.spec-table td.num {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1;
  font-size: 0.9375rem;
}

.spec-table .col-win { background: var(--win-bg); color: var(--win-text); font-weight: 800; }
.spec-table .col-win:first-child { box-shadow: inset 4px 0 0 var(--brand-green-500); }

.win-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: var(--r-pill);
  background: var(--mint-200);
  color: var(--brand-green-700);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.win-badge::before { content: '✓'; font-weight: 900; }

/* Highlight sweep utility — apply to a revealed winner row/cell */
.sweep {
  background-image: var(--grad-sheen);
  background-size: 250% 100%;
  background-repeat: no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .sweep.is-visible { animation: highlight-sweep 1.4s var(--ease-out) 0.3s both; }
}

/* --------------------------------------------------------------------------
   10. HERO — gradient wash + SVG blob backdrop
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background-image: var(--grad-hero);
  padding-block: var(--space-9) var(--space-8);
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: var(--space-7);
}
.hero-copy .lead { margin-bottom: var(--space-5); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }

.blob {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
}
.blob-a { top: -140px; right: -120px; width: 480px; height: 480px; }
.blob-b { bottom: -180px; left: -140px; width: 520px; height: 520px; opacity: 0.7; }

@media (max-width: 860px) {
  .hero { padding-block: var(--space-8) var(--space-7); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 380px; margin-inline: auto; }
}

/* --------------------------------------------------------------------------
   11. GLASS HEADER
   -------------------------------------------------------------------------- */
.site-header-v2 {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: var(--glass-border);
}
.site-header-v2 .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 68px;
}
.site-header-v2 .logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--ink-900);
}
.site-header-v2 .logo em { color: var(--cta-coral-600); font-style: italic; }
.site-header-v2 nav { display: flex; gap: var(--space-5); }
.site-header-v2 nav a {
  color: var(--ink-700);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9375rem;
  transition: color var(--dur-fast) linear;
}
.site-header-v2 nav a:hover { color: var(--cta-coral-600); }

/* Header collapses on small screens: hide inline nav, keep logo + CTA */
@media (max-width: 720px) {
  .site-header-v2 nav { display: none; }
}

/* --------------------------------------------------------------------------
   12. SECTION SCAFFOLDING + UTILITIES
   -------------------------------------------------------------------------- */
.section { padding-block: var(--space-8); }
.section-head { max-width: 720px; margin-bottom: var(--space-6); }

.stack > * + * { margin-top: var(--space-4); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }

.demo-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-300);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--cta-coral-600);
  line-height: 1;
}

/* ==========================================================================
   13. COMPAT LAYER — v1 class names mapped to v2 tokens (R4)
   The 62 non-homepage pages keep their v1 markup (.card, header.site,
   .lede …). This layer re-skins that markup with the v2 pastel/glass
   system WITHOUT HTML edits. v1 custom properties are aliased so
   page-scoped inline styles (tools calculators, best-of pages) resolve.
   Order matters: these rules intentionally come after the v2 core.
   ========================================================================== */

/* ---- 13a. v1 custom-property aliases (consumed by page-scoped styles) --- */
:root {
  --ink: var(--ink-900);
  --muted: var(--ink-500);
  --accent: var(--brand-green-600);
  --accent-dark: var(--brand-green-700);
  --bg: #fffdfa;
  --card: #ffffff;
  --line: var(--ink-100);
  --warn-bg: var(--butter-100);
  --win: var(--mint-100);
}

/* ---- 13b. Layout -------------------------------------------------------- */
.wrap {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

/* Content links (classless anchors in prose) get brand green, not UA blue */
main a:not([class]):not(:hover) { color: var(--brand-green-600); }

/* ---- 13c. Header / footer ---------------------------------------------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: var(--glass-border);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  min-height: 68px;
  padding-block: 8px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink-900);
  text-decoration: none;
}
.logo span, .logo em { color: var(--cta-coral-600); font-style: italic; }
header.site nav.main { display: flex; flex-wrap: wrap; gap: var(--space-5); }
header.site nav.main a {
  color: var(--ink-700);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9375rem;
  transition: color var(--dur-fast) linear;
}
header.site nav.main a:hover { color: var(--cta-coral-600); }

footer.site {
  background: var(--ink-900);
  color: var(--ink-300);
  padding-block: var(--space-7);
  margin-top: var(--space-8);
}
footer.site nav { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: var(--space-5); }
footer.site a { color: var(--ink-300); text-decoration: none; font-size: 0.875rem; font-weight: 700; }
footer.site a:hover { color: #ffb08a; }
footer.site p { font-size: 0.8125rem; color: var(--ink-400); max-width: 80ch; margin: 0; }

/* ---- 13d. Page head: hub hero, breadcrumb, lede, sub, section heads ----- */
.hub-hero {
  background-image: var(--grad-hero);
  border-radius: var(--r-img);
  padding: var(--space-7) var(--space-6);
  margin-block: var(--space-6);
}
.breadcrumb {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-500);
  margin: 0 0 var(--space-3);
}
.breadcrumb a { color: var(--ink-500); text-decoration: none; }
.breadcrumb a:hover { color: var(--cta-coral-600); }
.lede {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink-700);
  max-width: 62ch;
  margin: 0 0 var(--space-3);
}
.sub { color: var(--ink-500); max-width: 76ch; overflow-wrap: anywhere; }
h2.section { margin: var(--space-8) 0 var(--space-5); }
/* Sources sections sit outside <main> on some pages — give them the
   container treatment without touching markup */
body > h2.section,
body > .sources {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

/* ---- 13e. Cards ---------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-5); margin: var(--space-5) 0; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 0 0 6px var(--blush-100);
}
.card::after {
  content: '';
  position: absolute;
  inset: -34px;
  background: var(--grad-bloom);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-out);
}
.card:hover::after { opacity: 1; }
.card h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
  color: var(--ink-900);
}
.card p { color: var(--ink-700); font-size: 0.9688rem; margin: 0; flex: 1; }
.mini-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-facts .fact {
  background: var(--sky-100);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-700);
}
.mini-facts .fact strong { color: var(--ink-900); }
.card-cta {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--cta-coral-600);
  margin-top: auto;
}

/* ---- 13f. Verdict / safety / CTA boxes ---------------------------------- */
.verdict {
  background: #fff;
  border-left: 5px solid var(--brand-green-500);
  border-radius: 0 var(--r-card-inner) var(--r-card-inner) 0;
  box-shadow: var(--shadow-sm);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-6) 0;
}
.verdict h2 { margin-top: 0; }
.verdict ul, .verdict ol { margin: 0; padding-left: 22px; }
.verdict li { margin: 9px 0; color: var(--ink-700); }
.verdict li::marker { color: var(--brand-green-500); font-weight: 800; }
.verdict .pick { font-weight: 800; color: var(--brand-green-700); }

.safety-note {
  background: var(--butter-100);
  border: 1px solid var(--butter-300);
  border-radius: var(--r-card-inner);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-6) 0;
  font-size: 0.9688rem;
  color: var(--ink-700);
}
.safety-note strong { color: var(--ink-900); }

.cta-box {
  background: var(--ink-900);
  color: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-6) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.cta-box p { max-width: 560px; margin: 0; }
.cta-box .btn {
  background: #fff;
  color: var(--ink-900);
  box-shadow: none;
  white-space: nowrap;
}
.cta-box .btn:hover { background: var(--blush-100); transform: translateY(-2px); }
.cta-box .note { font-size: 0.75rem; opacity: 0.75; display: block; margin-top: 8px; }

/* Bare .btn (no modifier) gets a soft mint fill so it is never invisible */
.btn:not(.btn-primary):not(.btn-secondary):not(.btn-mint):not(.btn-ghost):not(.quiz-cta) {
  background: var(--mint-200);
  color: var(--brand-green-700);
}

/* ---- 13g. Sources + disclosure ------------------------------------------ */
.sources { font-size: 0.875rem; color: var(--ink-500); }
.sources ol { padding-left: 22px; margin: var(--space-3) 0 0; }
.sources li { margin: 8px 0; overflow-wrap: anywhere; }
.sources li::marker { color: var(--cta-coral-600); font-weight: 800; }
.sources a { color: var(--brand-green-700); word-break: break-all; }

.disclosure {
  font-size: 0.8125rem;
  color: var(--ink-500);
  border-top: 1px solid var(--ink-100);
  padding-top: var(--space-5);
  margin: var(--space-7) 0 var(--space-6);
}

/* ---- 13h. Spec tables (v1 table.compare) --------------------------------- */
table.compare {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin: var(--space-5) 0;
  font-size: 0.9375rem;
}
table.compare caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ink-900);
  padding: 0 var(--space-4) var(--space-3);
}
table.compare th, table.compare td {
  padding: 12px var(--space-4);
  border-bottom: 1px solid var(--ink-100);
  text-align: left;
  vertical-align: top;
}
table.compare thead th {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-500);
  background: #fdfcfe;
}
table.compare tbody th { width: 26%; color: var(--ink-500); font-weight: 600; }
table.compare tbody tr:last-child th,
table.compare tbody tr:last-child td { border-bottom: 0; }
table.compare tbody tr { transition: background-color var(--dur-fast) linear; }
table.compare tbody tr:hover { background: var(--sky-100); }
table.compare td.win { background: var(--win-bg); color: var(--win-text); font-weight: 800; }
td.win::after { content: " ✓"; color: var(--brand-green-600); }
.win { background: var(--win-bg); color: var(--win-text); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-card); }
/* Bare v1 spec tables (no .table-scroll wrapper): scroll in place on mobile
   instead of pushing the page 1px+ wide */
@media (max-width: 720px) {
  table.compare { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---- 13i. Table tools: chips, sort, diff toggle -------------------------- */
.table-tools { margin: var(--space-5) 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-3); }
.chip {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 800;
  padding: 7px 15px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--ink-100);
  background: #fff;
  color: var(--ink-500);
  cursor: pointer;
  transition: border-color var(--dur-fast) linear, color var(--dur-fast) linear,
              background-color var(--dur-fast) linear;
}
.chip:hover { border-color: var(--mint-300); color: var(--brand-green-700); }
.chip.is-active {
  background: var(--brand-green-600);
  border-color: var(--brand-green-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.tools-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--ink-500);
  margin-bottom: 4px;
}
.diff-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.diff-toggle input { accent-color: var(--cta-coral-500); width: 15px; height: 15px; }
.sort-group button {
  font-family: inherit;
  font-size: 0.78rem;
  padding: 5px 11px;
  margin-left: 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--ink-100);
  background: #fff;
  color: var(--ink-500);
  cursor: pointer;
}
.sort-group button:hover { border-color: var(--cta-coral-400); color: var(--cta-coral-600); }
.sort-group button.is-active {
  background: var(--blush-100);
  border-color: var(--blush-300);
  color: var(--cta-coral-600);
  font-weight: 800;
}

/* ---- 13j. Picker quiz ----------------------------------------------------- */
.quiz {
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  margin: var(--space-5) 0 var(--space-6);
}
.quiz-progress { display: flex; gap: 8px; margin-bottom: var(--space-4); }
.quiz-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-100);
  transition: background-color var(--dur-fast) linear,
              transform var(--dur-fast) var(--ease-spring);
}
.quiz-dot.done { background: var(--mint-300); }
.quiz-dot.current {
  background-image: var(--grad-cta);
  transform: scale(1.35);
  box-shadow: 0 0 0 4px var(--blush-100);
}
.quiz-question {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  margin: 0 0 var(--space-4);
}
.quiz-options { display: grid; gap: 10px; margin-bottom: var(--space-2); }
.quiz-option {
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  padding: 13px 16px;
  border-radius: var(--r-input);
  border: 1.5px solid var(--ink-100);
  background: #fff;
  cursor: pointer;
  color: var(--ink-900);
  transition: border-color var(--dur-fast) linear, background-color var(--dur-fast) linear;
}
.quiz-option:hover { border-color: var(--sky-300); background: var(--sky-100); }
.quiz-back {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  background: none;
  border: none;
  color: var(--ink-500);
  cursor: pointer;
  padding: var(--space-2) 0;
  text-decoration: underline;
}
.quiz-result-title {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 700;
  margin: 0 0 var(--space-4);
}
.quiz-result-card { border-top: 1px solid var(--ink-100); padding: var(--space-4) 0; }
.quiz-result-card.top { border-top: none; }
.quiz-result-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.quiz-pct {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--brand-green-700);
  font-weight: 700;
  white-space: nowrap;
}
.quiz-bar { height: 8px; background: var(--ink-100); border-radius: var(--r-pill); margin: 8px 0; overflow: hidden; }
.quiz-bar-fill { height: 100%; background-image: var(--grad-cta); border-radius: var(--r-pill); transition: width 0.5s var(--ease-out); }
.quiz-blurb { font-size: 0.9063rem; color: var(--ink-700); margin-bottom: 10px; }
.quiz-cta {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  font-size: 0.875rem;
  background: var(--brand-green-700);
  color: #fff !important;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  margin: 6px 8px 0 0;
}
.quiz-cta:hover { background: var(--brand-green-600); }
.quiz-tie {
  font-size: 0.875rem;
  color: var(--ink-700);
  background: var(--butter-100);
  border-radius: var(--r-input);
  padding: 10px 14px;
  margin-top: var(--space-3);
}

/* ---- 13k. Misc v1 leftovers ----------------------------------------------- */
.soon-badge {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--butter-100);
  border: 1px solid var(--butter-300);
  border-radius: var(--r-pill);
  padding: 3px 10px;
  color: #8a6d1f;
}
.related-links a { font-weight: 700; }

/* Narrow-screen guards carried over from v1 */
@media (max-width: 640px) {
  .hub-hero { padding: var(--space-5); border-radius: var(--r-card); }
  .quiz { padding: var(--space-5) var(--space-4); }
  .cta-box { flex-direction: column; align-items: stretch; }
  .cta-box .btn { display: block; width: 100%; box-sizing: border-box; margin: 0; white-space: normal; text-align: center; }
  .cta-box br { display: none; }
  .quiz-cta { display: block; width: 100%; box-sizing: border-box; margin: 8px 0 0; text-align: center; white-space: normal; }
}

/* ==========================================================================
   14. MOBILE NAV — hamburger <=720px (R4)
   Toggle button injected by js/nav.js into header.site and
   .site-header-v2 headers. Desktop (>=721px) is untouched.
   ========================================================================== */
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 11px;
    flex: 0 0 auto;
    background: #fff;
    border: 1.5px solid var(--ink-100);
    border-radius: var(--r-input);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
  }
  .nav-toggle .nav-toggle-bar {
    display: block;
    width: 100%;
    height: 2.5px;
    border-radius: 2px;
    background: var(--ink-900);
    transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) linear;
  }
  header.nav-open .nav-toggle .nav-toggle-bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  header.nav-open .nav-toggle .nav-toggle-bar:nth-child(2) { opacity: 0; }
  header.nav-open .nav-toggle .nav-toggle-bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

  /* Dropdown panel anchored to the sticky header (both header generations).
     Specificity above the homepage inline override (.site-header-v2 nav). */
  header.site-header-v2 nav,
  header.site nav.main {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-bottom: var(--glass-border);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2) var(--space-5) var(--space-4);
    max-height: calc(100vh - 76px);
    overflow-y: auto;
  }
  header.nav-open.site-header-v2 nav,
  header.nav-open.site nav.main { display: flex; }
  header.site-header-v2 nav a,
  header.site nav.main a {
    display: block;
    padding: 13px 4px;
    font-size: 1rem;
    border-bottom: 1px solid var(--ink-100);
  }
  header.site-header-v2 nav a:last-child,
  header.site nav.main a:last-child { border-bottom: 0; }
}
