/* Age Calculator — styles.css (Package A)
 * Full design system: color tokens, typography, spacing, all components.
 * No external fonts, no framework. WCAG AA. Mobile-first.
 */

/* ── Color tokens: Light (default) ─────────────────────────────────────────── */
:root {
  --brand: #6366f1;
  --brand-strong: #4f46e5;
  --brand-contrast: #ffffff;
  --accent-2: #8b5cf6;

  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --bg-subtle: #eef0f7;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #7b8499;
  --border: #e3e6ef;
  --border-strong: #cdd2e0;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --ring: #6366f1;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow-md: 0 6px 20px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.05);
  --shadow-lg: 0 18px 50px rgba(15,23,42,.14), 0 6px 16px rgba(15,23,42,.08);
  --grad-hero: linear-gradient(135deg,#6366f1 0%, #8b5cf6 60%, #a855f7 100%);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --font-num: "SF Mono", ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;

  --fs-display: clamp(2.2rem, 5vw, 3.25rem);
  --fs-h1: clamp(1.8rem, 3.5vw, 2.4rem);
  --fs-h2: 1.5rem;
  --fs-h3: 1.2rem;
  --fs-stat: clamp(1.6rem, 4vw, 2.2rem);
  --fs-headline: clamp(2rem, 6vw, 3rem);
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-caption: .78rem;

  /* Spacing (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;
}

/* ── Color tokens: Dark ─────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --brand: #818cf8;
  --brand-strong: #6366f1;
  --brand-contrast: #0b1020;
  --accent-2: #a78bfa;

  --bg: #0b1020;
  --bg-elev: #121933;
  --bg-subtle: #1b2444;
  --text: #eef1f8;
  --text-muted: #aab2cd;
  --text-faint: #7e88a8;
  --border: #26304f;
  --border-strong: #36426a;

  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;

  --ring: #818cf8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
  --grad-hero: linear-gradient(135deg,#4f46e5 0%, #7c3aed 60%, #9333ea 100%);
}

/* ── Auto dark mode (prefers-color-scheme) ──────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #818cf8;
    --brand-strong: #6366f1;
    --brand-contrast: #0b1020;
    --accent-2: #a78bfa;
    --bg: #0b1020;
    --bg-elev: #121933;
    --bg-subtle: #1b2444;
    --text: #eef1f8;
    --text-muted: #aab2cd;
    --text-faint: #7e88a8;
    --border: #26304f;
    --border-strong: #36426a;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --ring: #818cf8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow-md: 0 8px 24px rgba(0,0,0,.45);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
    --grad-hero: linear-gradient(135deg,#4f46e5 0%, #7c3aed 60%, #9333ea 100%);
  }
}

/* ── Reset & base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ── Skip link ──────────────────────────────────────────────────────────────── */
.skip-link {
  position: fixed;
  left: -9999px;
  top: 8px;
  background: var(--brand);
  color: var(--brand-contrast);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: var(--fs-small);
  text-decoration: none;
  z-index: 9999;
  transition: left .15s ease;
}
.skip-link:focus { left: 8px; }

/* ── Container ──────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 28px);
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: color-mix(in srgb, var(--bg-elev) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background 250ms;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark { display: block; flex-shrink: 0; }

.brand-name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -.01em;
  color: var(--text);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  flex: 1;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: var(--fs-small);
  font-weight: 600;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  transition: color 160ms, background 160ms;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--brand);
  background: var(--bg-subtle);
}

.site-nav a[aria-current="page"] {
  color: var(--brand);
  background: var(--bg-subtle);
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-underline-offset: 3px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-2);
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  transition: border-color 160ms, color 160ms;
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }

/* Show correct icon based on theme */
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

/* ── Main ───────────────────────────────────────────────────────────────────── */
main.container { padding-block: var(--s-12); }

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  padding-block: var(--s-16) var(--s-20);
  text-align: center;
}

.hero-title {
  font-size: var(--fs-display);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: var(--s-4);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin-inline: auto;
  margin-bottom: var(--s-8);
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-sm);
}

.calc-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-8);
  box-shadow: var(--shadow-lg);
  max-width: 640px;
  margin-inline: auto;
}

@media (max-width: 639px) {
  .calc-card { padding: var(--s-6); border-radius: var(--r-lg); }
}

/* ── Labeled field ──────────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  margin-bottom: var(--s-5);
}

.field-label {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text);
}

.field-hint {
  font-size: var(--fs-caption);
  color: var(--text-faint);
  letter-spacing: .01em;
}

.field-error {
  font-size: var(--fs-caption);
  color: var(--danger);
  min-height: 1.2em;
}

.field.is-invalid .input,
.field.is-invalid .select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent);
}

.input,
.select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  padding: 0 var(--s-4);
  transition: border-color 160ms, box-shadow 160ms;
  -webkit-appearance: none;
  appearance: none;
}

.select {
  padding-right: var(--s-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23475569' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.input:focus, .select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 30%, transparent);
}

.input:focus-visible, .select:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.7;
  cursor: pointer;
  filter: invert(var(--date-icon-invert, 0));
}

[data-theme="dark"] .input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 var(--s-6);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 160ms, box-shadow 160ms, transform 160ms, border-color 160ms;
  min-width: 44px;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-contrast);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--brand-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-sm); }

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-ghost {
  background: transparent;
  color: var(--brand);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-subtle); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-6);
}

/* ── Segmented control ──────────────────────────────────────────────────────── */
.segmented {
  display: inline-flex;
  background: var(--bg-subtle);
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
}

.segmented-option {
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms, color 180ms, box-shadow 180ms;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.segmented-option[aria-checked="true"] {
  background: var(--bg-elev);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.segmented-option:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ── Results ────────────────────────────────────────────────────────────────── */
.results { margin-top: var(--s-8); }
.results[hidden] { display: none; }

.headline-result {
  font-family: var(--font-num);
  font-size: var(--fs-headline);
  font-weight: 800;
  color: var(--brand);
  line-height: 1.1;
  margin-bottom: var(--s-6);
  letter-spacing: -.02em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}

.stat-tile {
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  border-left: 3px solid var(--brand);
}

.stat-value {
  font-family: var(--font-num);
  font-size: var(--fs-stat);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.stat-label {
  font-size: var(--fs-caption);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.result-line {
  font-size: var(--fs-body);
  color: var(--text-muted);
  margin-bottom: var(--s-3);
  line-height: 1.5;
}

.zodiac-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-4);
}

.zodiac-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: var(--s-2) var(--s-4);
  font-size: var(--fs-small);
  font-weight: 600;
}

/* ── Tool grid ──────────────────────────────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-5);
  margin-block: var(--s-10);
}

.tool-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 160ms, transform 160ms;
}

.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-card:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.tool-card .tool-icon {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--brand);
}

.tool-card h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.tool-card p {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin: 0;
}

/* ── Trust strip ────────────────────────────────────────────────────────────── */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6);
  justify-content: center;
  padding: var(--s-8) 0;
  border-top: 1px solid var(--border);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-small);
  color: var(--text-muted);
  font-weight: 600;
}

.trust-item svg { color: var(--brand); flex-shrink: 0; }

/* ── Recent chips ───────────────────────────────────────────────────────────── */
.recent {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: var(--s-2);
  padding-block: var(--s-2);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  margin-bottom: var(--s-4);
}

.recent:empty { display: none; }

.recent-chip {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: var(--s-1) var(--s-4);
  font-size: var(--fs-small);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  transition: background 160ms, color 160ms;
}

.recent-chip:hover { background: var(--border); color: var(--text); }
.recent-chip:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ── Ad slot ────────────────────────────────────────────────────────────────── */
.ad-slot {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-block: var(--s-8);
}

.ad-slot-label {
  font-size: var(--fs-caption);
  color: var(--text-faint);
  letter-spacing: .06em;
  text-transform: uppercase;
  user-select: none;
}

/* ── Hero layout (2-column at ≥960px) ───────────────────────────────────────── */
.hero-layout {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: 1fr;
  align-items: start;
  margin-top: var(--s-6);
}

@media (min-width: 960px) {
  .hero-layout { grid-template-columns: minmax(0,1fr) 336px; }
}

/* ── Ad rail ─────────────────────────────────────────────────────────────────── */
.ad-rail {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  min-width: 0;
}

@media (min-width: 960px) {
  .ad-rail { position: sticky; top: 84px; }
}

/* Rail ad slots get a sensible min-height for the 336px column */
.ad-rail .ad-slot { min-height: 250px; }

/* ── Date field (typeable text + calendar button) ───────────────────────────── */
.date-field { position: relative; }

.date-field .input { padding-right: 46px; }

.date-pick {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
}

.date-pick:hover { background: var(--bg-subtle); color: var(--brand); }

.date-pick:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Visually hidden native date input — NOT display:none so showPicker() works */
.date-native {
  position: absolute;
  right: 8px;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}

/* ── FAQ ────────────────────────────────────────────────────────────────────── */
.faq { margin-block: var(--s-10); }

.faq h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: var(--s-6);
}

.faq-item {
  border-top: 1px solid var(--border);
  padding: 0;
}

.faq-item:last-child { border-bottom: 1px solid var(--border); }

.faq-item > summary {
  padding: var(--s-4) 0;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  user-select: none;
}

.faq-item > summary::-webkit-details-marker { display: none; }

.faq-item > summary::after {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  transition: transform 200ms ease;
}

.faq-item[open] > summary::after {
  transform: rotate(180deg);
}

.faq-a {
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: 1.65;
  padding-bottom: var(--s-5);
  max-width: 68ch;
}

/* ── Notices / notes ────────────────────────────────────────────────────────── */
.notice {
  background: var(--bg-subtle);
  border-left: 4px solid var(--brand);
  border-radius: var(--r-md);
  padding: var(--s-4);
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-bottom: var(--s-5);
}

.note, .footnote {
  font-size: var(--fs-caption);
  color: var(--text-faint);
  letter-spacing: .01em;
  line-height: 1.4;
}

.badge {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 2px var(--s-3);
  font-size: var(--fs-caption);
  font-weight: 700;
  color: var(--brand);
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding-block: var(--s-12) var(--s-6);
  margin-top: var(--s-20);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-8);
  margin-bottom: var(--s-8);
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-brand .brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  display: block;
  margin-bottom: var(--s-3);
  color: var(--text);
}

.footer-tag {
  font-size: var(--fs-small);
  color: var(--text-muted);
  max-width: 36ch;
  line-height: 1.6;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.footer-h {
  font-size: var(--fs-small);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  margin-bottom: var(--s-1);
}

.footer-col a {
  font-size: var(--fs-small);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 160ms;
}

.footer-col a:hover { color: var(--brand); }

.footer-legal {
  border-top: 1px solid var(--border);
  padding-top: var(--s-4);
}

.footer-legal p {
  font-size: var(--fs-caption);
  color: var(--text-faint);
}

/* ── Coming soon ────────────────────────────────────────────────────────────── */
.coming-soon {
  text-align: center;
  padding: var(--s-16) var(--s-6);
  max-width: 480px;
  margin-inline: auto;
}

.coming-soon .coming-icon { font-size: 3rem; margin-bottom: var(--s-4); }

.coming-soon h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  margin-bottom: var(--s-3);
}

.coming-soon p {
  color: var(--text-muted);
  margin-bottom: var(--s-6);
}

/* ── Page headings ──────────────────────────────────────────────────────────── */
h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: var(--s-3);
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: var(--text);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

p { max-width: 68ch; }

/* ── Aria-live ──────────────────────────────────────────────────────────────── */
[aria-live] {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── Visually hidden (screen-reader only) ───────────────────────────────────── */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

/* ── Focus rings (global) ───────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

a { color: var(--brand); }
a:hover { text-decoration: underline; }

/* ── Noscript notice ─────────────────────────────────────────────────────────── */
noscript p.notice {
  background: var(--bg-subtle);
  border-left: 4px solid var(--warning);
  border-radius: var(--r-md);
  padding: var(--s-4);
  color: var(--text-muted);
  font-size: var(--fs-small);
  margin-bottom: var(--s-6);
}

/* ── Intro text ──────────────────────────────────────────────────────────────── */
.intro {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: var(--s-8);
  max-width: 60ch;
}

/* ── Page section spacing ────────────────────────────────────────────────────── */
.section { margin-block: var(--s-10); }

/* ── Responsive nav ─────────────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .header-inner { flex-wrap: wrap; padding-block: var(--s-2); height: auto; min-height: 64px; }
  .site-nav { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: var(--s-2); }
  .site-nav a { font-size: 0.78rem; padding: var(--s-1) var(--s-2); }
}

/* ── Transitions for theme ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  body { transition: background-color .25s, color .25s; }
  .site-header { transition: background .25s; }
}

/* ── Results reveal animation ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .results-reveal {
    animation: resultsReveal 200ms ease-out forwards;
  }
  @keyframes resultsReveal {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ── Segmented theme adaptation ──────────────────────────────────────────────── */
.segmented .segmented-option:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

/* ── Print ───────────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .ad-slot, .theme-toggle, [data-copy-link], [data-share] { display: none !important; }
  body { background: #fff; color: #000; }
}
