/* Kid Safety Index — calm, editorial, trustworthy.
   Design system: warm off-white plane, serious ink, one restrained accent.
   Risk-ladder magnitude bars use a single sequential hue (deep teal). */

:root {
  --plane:        #f7f5f0;   /* page background, warm paper */
  --surface:      #ffffff;   /* cards */
  --surface-2:    #fbfaf6;   /* subtle panels */
  --ink:          #1a1c1a;   /* primary text */
  --ink-2:        #4d514c;   /* secondary text */
  --muted:        #7c7f78;   /* captions, axis */
  --hair:         #e5e2d8;   /* hairlines */
  --hair-2:       #d8d5c9;

  --accent:       #0e6b63;   /* deep teal — trust, calm; the magnitude hue */
  --accent-ink:   #0a4f49;
  --accent-soft:  #d7ebe8;
  --accent-wash:  #eef6f5;

  --warn:         #b06a12;   /* "avoid" / caution — muted amber, never red-alarm */
  --warn-soft:    #f6ecdb;
  --good:         #2f7d32;
  --good-soft:    #e5f0e5;

  --bar-track:    #ece9e0;

  --radius:       14px;
  --radius-sm:    9px;
  --shadow:       0 1px 2px rgba(26,28,26,.04), 0 6px 20px rgba(26,28,26,.06);
  --shadow-sm:    0 1px 2px rgba(26,28,26,.05);

  --sans: "Söhne", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Tiempos Text", Georgia, "Times New Roman", serif;

  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --plane:      #14150f;
    --surface:    #1c1e17;
    --surface-2:  #191b14;
    --ink:        #f3f1e8;
    --ink-2:      #c8c6ba;
    --muted:      #9a9c90;
    --hair:       #2f322a;
    --hair-2:     #3a3d33;
    --accent:     #3fb3a6;
    --accent-ink: #6fd3c7;
    --accent-soft:#123f3a;
    --accent-wash:#15211f;
    --warn:       #e0a24e;
    --warn-soft:  #2e2415;
    --good:       #6bbf6e;
    --good-soft:  #17251a;
    --bar-track:  #26281f;
    --shadow:     0 1px 2px rgba(0,0,0,.3), 0 8px 26px rgba(0,0,0,.4);
    --shadow-sm:  0 1px 2px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--plane);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }

a { color: var(--accent-ink); text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
a:hover { text-decoration-color: var(--accent); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }

img { max-width: 100%; height: auto; display: block; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  margin: 0 0 12px;
}

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--plane) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hair);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { font-size: 26px; line-height: 1; }
.brand-logo { width: 34px; height: 34px; display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; letter-spacing: -0.01em; }
.brand-text small { color: var(--muted); font-size: 12.5px; }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-wash); }

/* ---- hero ---- */
.hero { padding: 56px 0 40px; }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4.4vw, 46px); margin: 0 0 18px; font-weight: 640; }
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--ink-2); margin: 0 0 24px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 10px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow-sm); transition: transform .08s ease, background .15s ease;
}
.btn:hover { background: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--accent-ink); box-shadow: none; border: 1px solid var(--hair-2); }
.btn-ghost:hover { background: var(--surface-2); }
.hero-art img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 1/1; object-fit: cover; }

/* ---- ladder ---- */
.ladder-section { padding: 28px 0 8px; }
.ladder-head h2 { font-size: 28px; margin: 0 0 6px; }
.section-note { color: var(--ink-2); margin: 0 0 22px; max-width: 62ch; }

.band-toggle {
  display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--hair);
  padding: 4px; border-radius: 12px; margin-bottom: 22px; flex-wrap: wrap;
}
.band-toggle button {
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 600; font-size: 15px;
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15;
}
.band-toggle button small { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.band-toggle button[aria-selected="true"] { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.band-toggle button[aria-selected="true"] small { color: var(--accent); }

.ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rung {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 18px; align-items: center;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 16px 20px; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}
.rung:hover { border-color: var(--accent-soft); transform: translateY(-1px); box-shadow: var(--shadow); }
.rung-rank { font-size: 22px; font-weight: 680; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.rung-main { min-width: 0; }
.rung-name { font-size: 18px; font-weight: 620; margin: 0 0 3px; }
.rung-liner { color: var(--ink-2); font-size: 14.5px; margin: 0 0 10px; }
.bar-wrap { display: flex; align-items: center; gap: 12px; }
.bar-track { flex: 1; height: 12px; background: var(--bar-track); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px 4px 4px 6px; min-width: 4px; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.bar-num { font-variant-numeric: tabular-nums; font-weight: 640; font-size: 15px; white-space: nowrap; }
.bar-num small { color: var(--muted); font-weight: 500; }
.rung-cta { color: var(--muted); font-size: 22px; }
.rung .trend { margin-left: 8px; }

.ladder-foot { color: var(--muted); font-size: 14px; margin: 24px 0 8px; max-width: 70ch; }

/* ---- trend badges ---- */
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.trend-down { color: var(--good); background: var(--good-soft); }
.trend-up   { color: var(--warn); background: var(--warn-soft); }
.trend-flat { color: var(--muted); background: var(--surface-2); }

/* ---- static rung (non-linking, e.g. "other unintentional") ---- */
.rung-static { cursor: default; opacity: .82; }
.rung-static:hover { transform: none; border-color: var(--hair); box-shadow: var(--shadow-sm); }

/* ---- age notes ---- */
.age-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.age-notes li { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: start; }
.age-stage { font-weight: 700; font-size: 14px; color: var(--accent-ink); }
.age-notes p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* ---- crisis banner ---- */
.crisis { background: var(--accent-wash); border: 1px solid var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; margin: 4px 0 8px; font-size: 15.5px; color: var(--ink); }
.crisis strong { color: var(--accent-ink); }

/* ---- cross-cutting cards (homepage, per band) ---- */
.crosscut-inline { margin-top: 26px; }
.crosscut-title { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 14px; }
.cc-num { font-weight: 640; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-2); }
.crosscut-card h4 { margin: 0 0 5px; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crosscut-section { padding: 40px 0 8px; }
.crosscut-section h2 { font-size: 24px; margin: 0 0 6px; }
.crosscut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.crosscut-card {
  display: flex; gap: 18px; align-items: center; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); transition: border-color .15s ease, transform .08s ease;
}
.crosscut-card:hover { border-color: var(--accent-soft); transform: translateY(-1px); }
.crosscut-card img { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.crosscut-card h3 { margin: 0 0 5px; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crosscut-card p { margin: 0 0 8px; color: var(--ink-2); font-size: 14.5px; }
.crosscut-cta { color: var(--accent-ink); font-size: 14px; font-weight: 600; }

/* ---- reassure cards ---- */
.reassure { padding: 44px 0 64px; }
.reassure-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.reassure-card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.reassure-card h3 { margin: 0 0 8px; font-size: 17px; }
.reassure-card p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* ---- hazard page ---- */
.hazard { padding: 28px 0 40px; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs span { margin: 0 8px; }

.hazard-top { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: start; margin-bottom: 12px; }
.hazard-top-copy h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; font-weight: 640; }
.headline { font-size: 20px; color: var(--ink-2); margin: 0 0 24px; max-width: 60ch; }
.hazard-art img { border-radius: var(--radius); box-shadow: var(--shadow); width: 300px; max-width: 40vw; aspect-ratio: 1/1; object-fit: cover; }

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 14px 18px; min-width: 120px; box-shadow: var(--shadow-sm); }
.stat-num { display: block; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-num.small { font-size: 18px; }
.stat-lab { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.verify-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 20px; margin: 4px 0 0; }
.verify-badge.ok   { color: var(--good); background: var(--good-soft); }
.verify-badge.warn { color: var(--warn); background: var(--warn-soft); }
.verify-badge.bad  { color: #a13c2f; background: #f6e3df; }
.verify-badge a { color: inherit; }

.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 26px 28px; margin: 16px 0; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 21px; margin: 0 0 14px; }
.panel-note, .note { color: var(--muted); font-size: 14px; margin: -6px 0 16px; }
.accent-panel { background: var(--accent-wash); border-color: var(--accent-soft); }
.avoid-panel { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 26%, transparent); }

.plain-list { margin: 0; padding-left: 20px; }
.plain-list li { margin: 8px 0; color: var(--ink-2); }
.plain-list.avoid { list-style: none; padding-left: 0; }
.plain-list.avoid li { position: relative; padding-left: 28px; }
.plain-list.avoid li::before { content: "✕"; position: absolute; left: 4px; color: var(--warn); font-weight: 700; }

.prevention { margin: 0; padding: 0; list-style: none; counter-reset: prev; }
.prevention li { counter-increment: prev; position: relative; padding: 14px 0 14px 44px; border-top: 1px solid color-mix(in srgb, var(--accent) 14%, transparent); }
.prevention li:first-child { border-top: 0; }
.prevention li::before {
  content: counter(prev); position: absolute; left: 0; top: 14px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.prev-main { font-weight: 560; font-size: 16px; }
.prev-meta { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-top: 5px; }
.evidence { color: var(--ink-2); font-size: 13.5px; }
.cost { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.cost-free { color: var(--good); background: var(--good-soft); }
.cost-under-25 { color: var(--accent-ink); background: var(--accent-soft); }
.cost-under-100 { color: var(--warn); background: var(--warn-soft); }
.cost-over-100 { color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--hair); }

.resources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.resources li { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.res-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 4px 9px; border-radius: 7px; white-space: nowrap; margin-top: 2px; }
.res-guidance { color: var(--accent-ink); background: var(--accent-soft); }
.res-program  { color: var(--good); background: var(--good-soft); }
.res-hotline  { color: #a13c2f; background: #f6e3df; }
.res-product  { color: var(--warn); background: var(--warn-soft); }
.res-recall-check { color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--hair); }
.res-inspection { color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--hair); }
.res-body a { font-weight: 600; }
.res-body p { margin: 3px 0 0; color: var(--ink-2); font-size: 14.5px; }

.sources-panel .confidence, .sources-panel .basis { color: var(--ink-2); font-size: 15px; margin: 6px 0; }
.checks { margin: 20px 0; }
.checks h3, .sources-panel h3 { font-size: 15px; margin: 18px 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.checks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.check { font-size: 14.5px; color: var(--ink-2); padding-left: 14px; border-left: 3px solid var(--hair-2); }
.check small { color: var(--muted); }
.check em { color: var(--accent-ink); font-style: normal; font-weight: 600; }
.check-confirmed { border-left-color: var(--good); }
.check-partly { border-left-color: var(--warn); }
.check-refuted { border-left-color: #c0492f; }
.check-unverifiable { border-left-color: var(--muted); }
.check-status { font-weight: 700; color: var(--ink); }
.check-confirmed .check-status { color: var(--good); }
.check-partly .check-status { color: var(--warn); }
.check-refuted .check-status { color: #a13c2f; }

.source-links { columns: 2; column-gap: 28px; list-style: none; margin: 0; padding: 0; font-size: 14px; }
.source-links li { break-inside: avoid; margin: 0 0 8px; }
.back { margin: 28px 0 0; }
.back a { font-weight: 600; text-decoration: none; }

/* ---- doc pages ---- */
.doc { padding: 44px 0 60px; }
.doc h1 { font-size: clamp(30px, 4vw, 40px); margin: 0 0 12px; }
.doc h2 { font-size: 22px; margin: 34px 0 10px; }
.doc p, .doc li { color: var(--ink-2); }
.doc .lede { color: var(--ink-2); }
.doc ul.policy li, .doc ul li { margin: 8px 0; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--hair); background: var(--surface-2); padding: 40px 0; margin-top: 20px; }
.site-footer p { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); max-width: 88ch; }
.foot-credit { color: var(--ink-2) !important; }
.foot-disclaimer { font-style: italic; }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-art { order: -1; max-width: 420px; }
  .hazard-top { grid-template-columns: 1fr; }
  .hazard-art { display: none; }
  .reassure-grid { grid-template-columns: 1fr; }
  .source-links { columns: 1; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .rung { grid-template-columns: 34px 1fr; }
  .rung-cta { display: none; }
  .wrap { padding: 0 18px; }
  .panel { padding: 20px 18px; }
}

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