/* ═══════════════════════════════════════════════════════════════════════
   BLESSED BEGINNINGS — DESIGN TOKENS (v19.91.0)
   The one source of truth for colour, type, depth, shape and motion, for
   BOTH the app (styles.css) and the marketing pages (marketing.css). Until
   this file existed the marketing shell carried its own copy of the palette,
   so none of the type floor, the text-safe accents or the gates reached it.
   Linked before styles.css / marketing.css; theme-boot.js stamps data-theme
   render-blocking, and the html:not([data-theme]) branches cover pages that
   never run it (marketing).
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  --cream: #faf7f2;
  --cream-dark: #f0ebe3;
  --warm-white: #fffdf9;
  --gold: #c9a96e;
  --gold-light: #e8d5a8;
  --gold-dark: #786236;   /* v19.82.0 — used as text 132x; 4.67:1 on the darkest ground it lands on */
  --rose: #d4a0a0;
  --rose-light: #f0d4d4;
  --rose-muted: #c48b8b;
  --sage: #8fa68f;
  --sage-light: #c5d6c5;
  --sage-dark: #6b8a6b;
  --olive: #9aab7f;
  --charcoal: #3a3632;
  --charcoal-light: #5a5550;
  --warm-gray: #8a8480;
  --warm-gray-light: #b5afa9;
  --navy: #3a4a5c;
  --navy-light: #5a7090;
  /* Medical-urgency copy — legible in BOTH themes (accent golds/roses sit at
     ~2.2:1 on white, too low for "CALL TODAY"/"EMERGENCY" headings) */
  --danger-text: #c0392b;
  --urgent-text: #a85455;
  --caution-text: #7d6229;   /* v19.82.0 — 4.11:1 as the MONITOR tier heading */
  --blush: #f5e6e0;
  --lavender: #e8e0f0;

  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  /* v19.92.0 — Outfit replaces Inter as the body face. Inter was the single
     most common typographic tell of a generated page; Outfit's rounder bowls
     and open apertures sit with the Playfair italic rather than against it. */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  --shadow-sm: 0 1px 3px rgba(58, 54, 50, 0.05), 0 1px 2px rgba(58, 54, 50, 0.03);
  --shadow-md: 0 4px 12px rgba(58, 54, 50, 0.07), 0 2px 4px rgba(58, 54, 50, 0.04);
  --shadow-lg: 0 8px 30px rgba(58, 54, 50, 0.09), 0 4px 8px rgba(58, 54, 50, 0.04);
  --shadow-xl: 0 12px 40px rgba(58, 54, 50, 0.11), 0 6px 12px rgba(58, 54, 50, 0.05);
  --shadow-glow: 0 0 20px rgba(201, 169, 110, 0.12);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* v19.1 — motion tokens (calm, no bounce) */
  --dur-fast: 0.12s;
  --dur: 0.28s;
  --dur-slow: 0.9s;
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);

  /* v19.86.0 — TYPE SCALE (design audit rec 2). Five rungs under 18px,
     floored at 12px. Tune the scale here, once. */
  --fs-2xs: 0.75rem;    /* 12px — the floor: meta, captions, badges */
  --fs-xs: 0.8125rem;   /* 13px — secondary copy */
  --fs-sm: 0.875rem;    /* 14px — supporting copy */
  --fs-base: 0.9375rem; /* 15px — card body */
  --fs-md: 1rem;        /* 16px — page body */

  /* v19.95.0 — SPACING. The last thing in the design audit with no scale
     behind it: padding and gaps were hand-picked at every call site, which is
     why the same "card" could be 12, 14, 16 or 18px inside depending on when
     it was written. A 4px base, the rungs that were actually in use.
     New code takes these; existing values are converted where they are
     touched, not in a sweep — a sweep would be 400 silent diffs. */
  --space-1: 0.25rem;   /*  4px */
  --space-2: 0.5rem;    /*  8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */

  /* v19.97.0 — THE FOCUS RING. Kept in this one :root block on purpose:
     gen-design-md.mjs reads the first :root only, so a token declared in a
     second block is a token nobody documents. The rule that uses these is at
     the bottom of this file. */
  --focus-ring: var(--gold-dark);
  --focus-ring-w: 3px;
  --focus-ring-offset: 2px;
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: var(--cream);
  --bg-secondary: var(--warm-white);
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-tertiary: #f1ece4;
  --text-primary: var(--charcoal);
  --text-secondary: var(--charcoal-light);
  --text-muted: var(--warm-gray);
  --border-color: #e8e2da;
  --border-light: #f0ebe3;
  /* v19.82.0 — TEXT-SAFE ACCENTS. Gold, sage and rose are the brand; fills,
     borders, rings and icons keep exactly the colour they have. These are the
     siblings that only TYPE uses, each darkened until it clears 4.5:1 on the
     ground it actually lands on. */
  --on-gold: #241a0c;
  --gold-text: var(--gold-dark);  /* same value, kept as an intent-named alias for new code */
  --sage-text: #5a695a;   /* 4.66:1 on the darkest ground, 5.83 on white */
  --rose-text: #7a5555;   /* 5.16:1 on the darkest ground */
  --lavender-text: #6b5a8a; /* lavender as text; --lavender (#e8e0f0) is a fill, 1.28:1 on white */
}

/* Dark theme */
[data-theme="dark"] {
  --bg-primary: #1a1816;
  --bg-secondary: #222018;
  --bg-card: #2a2722;
  --bg-elevated: #332f2a;
  --bg-tertiary: #211e1a;
  --text-primary: #f0ebe3;
  --text-secondary: #c5bfb5;
  --text-muted: #a29a90;   /* v19.8: #8a8480 was 3.6-4.0:1 on dark cards — below AA for text */
  --border-color: #3a3632;
  --border-light: #2e2a26;
  --gold: #d4b87a;
  --gold-light: #c9a96e;
  --rose: #d4a0a0;
  --sage: #9ab89a;
  /* v19.4.4 — the "-dark"/"-muted" emphasis tokens are used as TEXT COLOR on
     dark cards (~250 call sites). Inverted here so "emphasis" means lighter on
     dark, all ≥6:1 on --bg-card. */
  --gold-dark: #e0c68e;
  --sage-dark: #b0c9b0;
  --rose-muted: #c99a9a;
  --navy: #9db4cc;
  --navy-light: #b3c6da;
  --charcoal: #f0ebe3;
  --charcoal-light: #c5bfb5;
  --danger-text: #ff8888;
  --urgent-text: #e0a8a8;
  --caution-text: #e0c68e;
  /* On a dark ground the text-safe hues go UP, not down. */
  --on-gold: #241a0c;
  --gold-text: #d9bf8b;
  --sage-text: #a8c4a8;
  --rose-text: #e0b0b0;
  --lavender-text: #c9bce0;
}

/* Unstamped html — marketing pages, and the app before theme-boot.js runs.
   Light values first; the media block below swaps them for system dark. */
html:not([data-theme]) {
  --bg-primary: var(--cream);
  --bg-secondary: var(--warm-white);
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-tertiary: #f1ece4;
  --text-primary: var(--charcoal);
  --text-secondary: var(--charcoal-light);
  --text-muted: var(--warm-gray);
  --border-color: #e8e2da;
  --border-light: #f0ebe3;
  /* v19.92.0 — these MUST equal [data-theme="light"] above. They did not, and
     the marketing pages (permanently unstamped) rendered accents a full step
     lighter than the app — which is how a 12px eyebrow landed at 3.2:1. */
  --on-gold: #241a0c;
  --gold-text: var(--gold-dark);
  --sage-text: #5a695a;
  --rose-text: #7a5555;
  --lavender-text: #6b5a8a;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg-primary: #1a1816;
    --bg-secondary: #222018;
    --bg-card: #2a2722;
    --bg-elevated: #332f2a;
    --bg-tertiary: #211e1a;
    --text-primary: #f0ebe3;
    --text-secondary: #c5bfb5;
    --text-muted: #a29a90;
    --border-color: #3a3632;
    --border-light: #2e2a26;
    --gold: #d4b87a;
    --gold-light: #c9a96e;
    --rose: #d4a0a0;
    --sage: #9ab89a;
    /* keep in sync with [data-theme="dark"] above — this block paints before JS runs */
    --gold-dark: #e0c68e;
    --sage-dark: #b0c9b0;
    --rose-muted: #c99a9a;
    --navy: #9db4cc;
    --navy-light: #b3c6da;
    --charcoal: #f0ebe3;
    --charcoal-light: #c5bfb5;
    --danger-text: #ff8888;
    --urgent-text: #e0a8a8;
    --caution-text: #e0c68e;
    --gold-text: #d9bf8b; --sage-text: #a8c4a8; --rose-text: #e0b0b0; --lavender-text: #c9bce0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   THE FOCUS RING (v19.97.0)
   The one rule in this file, and it is here for the same reason the tokens
   are: it has to be identical on both surfaces. Before this, styles.css had
   five separate focus rules and marketing.css had one, so the public pages
   fell back to the browser's default ring — near-black at 1.07:1 on the dark
   landing, which is not an indicator, it is a formality.

   WCAG 2.2 SC 1.4.11 asks for 3:1. The old ring was `2px solid var(--gold)`:
   #c9a96e on #faf7f2 measures 2.09:1, so every keyboard user in this app has
   been getting a ring that is present in the DOM and invisible on the screen.
   --gold-dark measures 5.46:1 on cream and 10.7:1 on the dark ground, and it
   inverts with the theme like the rest of the emphasis tokens.

   Measured, not asserted: scripts/e2e/interaction.mjs walks the real keyboard
   journey (Tab presses — :focus-visible does not match a programmatic focus()
   on a button) and fails on anything under 3:1 or with no indicator at all.
   ═══════════════════════════════════════════════════════════════════════ */
:where(a, button, input, select, textarea, summary, [role="button"], [tabindex]):focus-visible {
  outline: var(--focus-ring-w) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

/* ═══════════════════════════════════════════════════════════════════════
   THE FACE, ON FORM CONTROLS (v19.98.0)
   Form controls do not inherit font-family from their parent; the browser
   gives them its own. That is not a corner case here — every label in the
   bottom dock sits inside a <button>, so the five words a person sees more
   than any others in this app were rendering in ARIAL while everything
   around them was Outfit. The landing's "Show me" button too, sitting beside
   an <a> styled with the identical .btn class that DID inherit.
   font-family only, deliberately: sizes and weights are set per component
   and `font: inherit` would flatten them.
   ═══════════════════════════════════════════════════════════════════════ */
:where(button, input, select, textarea, optgroup) {
  font-family: inherit;
}
