/* ============================================================================
   SKIDS ATLAS — styles
   Deliberately plain: one column of prose, generous margins, no decoration that
   competes with the text. Works offline and prints.
   ========================================================================== */

:root {
  --paper:      #f8f5ef;
  --paper-deep: #f1ece2;
  --card:       #fffdf8;
  --ink:        #16201c;
  --ink-soft:   #3d4a44;
  --muted:      #6b7770;
  --line:       #ded6c8;
  --line-soft:  #ebe5d9;
  --accent:     #0d5c4f;
  --accent-ink: #0a4a3f;
  --accent-bg:  #e5efe8;
  --warn-bg:    #fbf3e4;
  --warn-line:  #e8d5b0;
  --flag-bg:    #fbeeea;
  --flag-line:  #ecd0c7;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 34rem;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 32, 28, .05), 0 8px 24px -12px rgba(22, 32, 28, .18);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

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

/* ---------------------------------------------------------------- header -- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248, 245, 239, .92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-head__in {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 20px;
  min-width: 0;
}
.brand { display: flex; align-items: baseline; gap: 9px; text-decoration: none; color: var(--ink); }
.brand__mark { font-family: var(--serif); font-size: 20px; letter-spacing: .01em; }
.brand__sub {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.head-spacer { flex: 1; }

.agepick { display: flex; align-items: center; gap: 8px; margin-right: 4px; }
.agepick__label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.agepick select {
  font: inherit; font-size: 13px; padding: 5px 8px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font: inherit; font-size: 14px; font-weight: 600; text-decoration: none;
  padding: 9px 16px; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: #fff; cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.btn:hover { background: var(--accent-ink); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--quiet:hover { background: var(--paper-deep); color: var(--ink); }
.btn--sm { font-size: 13px; padding: 7px 13px; }

/* ------------------------------------------------------------------ hero -- */
.hero { padding: 72px 0 40px; }
.hero__eyebrow {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 18px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.1rem, 5.2vw, 3.5rem); line-height: 1.1;
  letter-spacing: -.015em; margin: 0 0 22px; max-width: 18ch;
}
.hero h1 em { font-style: italic; color: var(--accent-ink); }
.hero__lede { font-size: 1.09rem; color: var(--ink-soft); max-width: 46ch; margin: 0 0 28px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 13px; }
.hero__meta span { display: inline-flex; align-items: center; gap: 6px; }

/* -------------------------------------------------------- symptom index -- */
.section { padding: 34px 0; }
.section__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 6px; flex-wrap: wrap; }
.section__title {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 400; margin: 0; letter-spacing: -.01em;
}
.section__note { font-size: 13px; color: var(--muted); margin: 0 0 18px; max-width: 58ch; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font: inherit; font-size: 13px; line-height: 1;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  cursor: pointer; transition: border-color .12s, background .12s, color .12s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-bg); }
.chip--on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------------------------ grid -- */
.group-label {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin: 26px 0 14px;
}
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 14px; }

.card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 20px 20px 18px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { border-color: #c9bfa9; transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card__glyph { font-size: 22px; line-height: 1; }
.card__min { font-size: 11px; color: var(--muted); white-space: nowrap; }
.card h3 { font-size: 1rem; font-weight: 650; margin: 0; letter-spacing: -.005em; }
.card p { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.5; }
.card__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; font-size: 12px; color: var(--accent-ink); font-weight: 600; }
.card__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.card--read .card__dot { background: #b9c6bd; }
.card--outline .card__min::after { content: " · in progress"; color: #a98f5e; }

/* --------------------------------------------------------------- chapter -- */
.reader { padding: 28px 0 80px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 22px; display: flex; align-items: center; gap: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }

.chap-head { max-width: 44rem; }
.chap-head__glyph { font-size: 34px; line-height: 1; margin-bottom: 12px; }
.chap-head h1 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -.02em;
  font-size: clamp(2rem, 4.6vw, 2.9rem); line-height: 1.08; margin: 0 0 14px;
}
.chap-head__meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 26px; }
.chap-lede {
  font-family: var(--serif); font-size: 1.22rem; line-height: 1.62;
  color: var(--ink-soft); margin: 0 0 12px; max-width: 40rem;
}

.chap-body { max-width: var(--measure); }
.chap-body p { margin: 0 0 1.15em; }
.chap-body h2 {
  font-family: var(--serif); font-weight: 400; font-size: 1.55rem; letter-spacing: -.015em;
  margin: 2.4em 0 .7em; padding-top: .2em; scroll-margin-top: 84px;
}
.chap-body h2:first-of-type { margin-top: 1.6em; }
.chap-body h3 { font-size: 1rem; font-weight: 650; margin: 1.8em 0 .4em; }
.chap-body .panel__title { margin-top: 0; }

/* age switcher */
.agebar { display: flex; gap: 6px; flex-wrap: wrap; margin: 22px 0 4px; }
.agebar button {
  font: inherit; font-size: 13px; padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer;
}
.agebar button:hover { border-color: var(--accent); color: var(--accent-ink); }
.agebar button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.agebar button small { display: block; font-size: 10px; opacity: .75; letter-spacing: .06em; text-transform: uppercase; }

.panel { border-top: 1px solid var(--line-soft); padding-top: 16px; margin-top: 12px; }
.panel__title { font-family: var(--serif); font-size: 1.28rem; margin: 0 0 8px; font-weight: 400; padding-top: 0; }

/* signals */
.signals { list-style: none; padding: 0; margin: 0; }
.signals li { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.signals li:last-child { border-bottom: 0; }
.signals b { display: block; font-size: 1rem; font-weight: 650; margin-bottom: 4px; }
.signals span { color: var(--ink-soft); font-size: 15.5px; }

/* triage ladder */
.ladder { display: grid; gap: 12px; margin-top: 8px; }
.rung {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  background: var(--card);
}
.rung h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.rung ul { margin: 0; padding-left: 18px; }
.rung li { margin: 0 0 .4em; font-size: 15px; color: var(--ink-soft); }
.rung--normal { border-left: 3px solid #9db9a8; }
.rung--watch  { border-left: 3px solid #d8b877; background: var(--warn-bg); border-color: var(--warn-line); }
.rung--ask    { border-left: 3px solid #c98a78; background: var(--flag-bg); border-color: var(--flag-line); }

/* nurture */
.nurture { display: grid; gap: 14px; }
.nurture__item { padding: 16px 18px; background: var(--accent-bg); border-radius: 12px; }
.nurture__item h4 { margin: 0 0 5px; font-size: 15px; font-weight: 650; color: var(--accent-ink); }
.nurture__item p { margin: 0; font-size: 15px; color: var(--ink-soft); }

/* red flags */
.flags { display: grid; gap: 10px; }
.flag { padding: 14px 16px; border: 1px solid var(--flag-line); background: var(--flag-bg); border-radius: 12px; }
.flag b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.flag span { font-size: 14.5px; color: var(--ink-soft); }

/* keep card */
.keep {
  margin: 34px 0; padding: 22px 24px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
}
.keep h3 { margin: 0 0 12px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.keep ul { margin: 0; padding-left: 18px; }
.keep li { margin-bottom: .55em; font-family: var(--serif); font-size: 1.02rem; color: var(--ink); }

/* CTA block */
.cta {
  margin: 44px 0 0; padding: 28px; border-radius: var(--radius);
  background: var(--ink); color: #efe9dd;
}
.cta h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 400; margin: 0 0 8px; color: #fff; }
.cta p { margin: 0 0 20px; font-size: 15px; color: #cfd6cf; max-width: 40ch; }
.cta__row { display: flex; flex-wrap: wrap; gap: 10px; }
.cta .btn { background: #efe9dd; color: var(--ink); }
.cta .btn:hover { background: #fff; color: var(--ink); }
.cta .btn--ghost { background: transparent; color: #efe9dd; border-color: #4a554e; }
.cta .btn--ghost:hover { background: #232e28; color: #fff; }
.cta__note { margin-top: 16px; font-size: 12px; color: #9aa69d; }

/* related */
.related { margin-top: 40px; }
.related__list { display: flex; flex-wrap: wrap; gap: 8px; }
.related__link {
  font-size: 13px; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); text-decoration: none; color: var(--ink-soft); background: var(--card);
}
.related__link:hover { border-color: var(--accent); color: var(--accent-ink); }

/* prev / next */
.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.pager a { font-size: 13.5px; text-decoration: none; color: var(--ink-soft); max-width: 45%; }
.pager a:hover { color: var(--accent-ink); }
.pager span { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.pager__next { text-align: right; margin-left: auto; }

/* ---------------------------------------------------------------- footer -- */
.site-foot { border-top: 1px solid var(--line); padding: 34px 0 48px; margin-top: 30px; }
.site-foot__row { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.site-foot p { font-size: 12.5px; color: var(--muted); margin: 0; max-width: 52ch; line-height: 1.6; }
.site-foot a { color: var(--ink-soft); }
.site-foot__links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }

/* ------------------------------------------------------------ misc/print -- */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; background: var(--accent);
  width: 0; z-index: 100; transition: width .1s linear;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
.notice {
  margin: 20px 0; padding: 12px 14px; border-radius: 10px;
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  font-size: 14px; color: var(--ink-soft);
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 44px 0 24px; }
  .agepick__label { display: none; }
  .site-head__in { gap: 10px; }
  .brand__sub { display: none; }
  .grid { grid-template-columns: 1fr; }
  .cta { padding: 22px; }
}

@media print {
  .site-head, .site-foot, .pager, .cta__row, .progress, .agebar, .crumbs { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .chap-body { max-width: none; }
  .keep, .rung, .flag, .nurture__item { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ==========================================================================
   LIFE LAYER — restored motion language
   ========================================================================== */

/* --- hero: living field ------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero__field {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: .95;
}
.hero__in { position: relative; z-index: 1; }

/* --- scroll reveal ------------------------------------------------------ */
[data-reveal] {
  opacity: 0;
  translate: 0 16px;
  transition: opacity .55s cubic-bezier(.22, .7, .25, 1),
              translate .55s cubic-bezier(.22, .7, .25, 1);
  transition-delay: var(--d, 0ms);
  will-change: opacity, translate;
}
[data-reveal].is-in {
  opacity: 1;
  translate: 0 0;
  transition-delay: 0ms;
  will-change: auto;
}

/* --- cards: glyph reacts, dot fills ------------------------------------ */
.card__glyph { transition: transform .35s cubic-bezier(.22, .7, .25, 1); }
.card:hover .card__glyph { transform: translateY(-2px) scale(1.12); }
.card--read .card__dot { box-shadow: 0 0 0 3px rgba(13, 92, 79, .12); }

/* --- chapter: breathing orb -------------------------------------------- */
.chap-head { position: relative; }
.chap-head > *:not(.chap-orb) { position: relative; z-index: 1; }
.chap-orb {
  position: absolute; top: -60px; right: -70px;
  width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%,
              rgba(13, 92, 79, .13) 0%,
              rgba(13, 92, 79, .06) 42%,
              rgba(13, 92, 79, 0) 68%);
  pointer-events: none; z-index: 0; opacity: .8;
}
.chap-orb.is-breathing { animation: atlas-breathe 11s ease-in-out infinite; }
@keyframes atlas-breathe {
  0%, 100% { transform: scale(1);    opacity: .72; }
  50%      { transform: scale(1.09); opacity: 1;   }
}

/* --- chapter: table of contents ---------------------------------------- */
.toc { display: none; }
.toc__label {
  font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin: 0 0 12px;
}
.toc__link {
  display: block; width: 100%; text-align: left;
  font: inherit; font-size: 13px; line-height: 1.45;
  padding: 7px 10px; margin: 0 0 2px -10px; border: 0; border-radius: 7px;
  background: none; color: var(--ink-soft); cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.toc__link:hover { background: var(--paper-deep); color: var(--ink); border-left-color: var(--accent); }
.toc__foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft);
  font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px;
}
.toc__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

@media (min-width: 1024px) {
  .reader__grid {
    display: grid; grid-template-columns: 200px minmax(0, 1fr);
    gap: 56px; align-items: start;
  }
  .toc { display: block; position: sticky; top: 88px; }
}

/* --- floating WhatsApp --------------------------------------------------- */
.fab {
  position: fixed;
  right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 54px; height: 54px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: #128c7e; color: #fff; z-index: 60;
  box-shadow: 0 6px 22px rgba(13, 92, 79, .28), 0 1px 3px rgba(0, 0, 0, .12);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.fab:hover { transform: translateY(-2px) scale(1.04); color: #fff; box-shadow: 0 10px 26px rgba(13, 92, 79, .34); }
.fab:active { transform: scale(.97); }

@media (max-width: 1023px) {
  .fab { display: flex; }
  .site-foot { padding-bottom: 92px; }
}

/* --- header ------------------------------------------------------------- */
.head-wa span { display: inline; }
@media (max-width: 720px) {
  .head-wa span { display: none; }
  .head-wa { padding: 8px; border-radius: 999px; }
}

/* --- mobile reading ----------------------------------------------------- */
@media (max-width: 1023px) {
  .agebar {
    position: sticky; top: 59px; z-index: 20;
    background: var(--paper); padding: 10px 0; margin: 0 0 2px;
    border-bottom: 1px solid var(--line-soft);
  }
  .chap-orb { width: 220px; height: 220px; top: -50px; right: -60px; }
  .hero { padding: 44px 0 34px; }
  .hero__field { opacity: .8; }
  .card:hover { transform: none; }
}

/* --- progress bar ------------------------------------------------------- */
.progress { background: linear-gradient(90deg, var(--accent), #2f8f78); }

@media (max-width: 640px) {
  .site-head__in { height: 56px; }
  .agebar { top: 55px; }
}

/* --- respect the OS setting -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; translate: none !important; transition: none !important; }
  .chap-orb.is-breathing { animation: none !important; }
  .card:hover { transform: none; }
  html { scroll-behavior: auto; }
  .progress { transition: none; }
}

/* --- narrow phones: stop the header from widening the page -------------- */
@media (max-width: 720px) {
  .site-head__in { padding: 0 16px; gap: 10px; }
  .brand { flex-shrink: 0; }
  .brand__mark { font-size: 18px; }
  .agepick { margin-right: 0; min-width: 0; }
  .agepick select { max-width: 116px; font-size: 12px; padding: 4px 6px; }
  .head-spacer { min-width: 0; }
  .head-wa { flex-shrink: 0; }
  .hero h1 { font-size: clamp(1.75rem, 8.4vw, 2.4rem); }
  .hero__lede { font-size: 1rem; }
  .hero__meta { gap: 12px; font-size: 12px; }
  .section__title { font-size: 1.3rem; }
}
@media (max-width: 400px) {
  .agepick select { max-width: 96px; }
  .chips { gap: 6px; }
  .chip { font-size: 12.5px; padding: 7px 10px; }
}

/* ==========================================================================
   PER-SYSTEM COLOUR — the old SKIDS system palette, muted for reading
   ========================================================================== */

.card {
  box-shadow: inset 2px 0 0 0 var(--hue, var(--accent));
}
.card:hover {
  box-shadow: inset 2px 0 0 0 var(--hue, var(--accent)), var(--shadow);
}
.card__dot { background: var(--hue, var(--accent)); }
.card--read .card__dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--hue, var(--accent)) 18%, transparent); }

.chap-orb {
  background: radial-gradient(circle at 40% 40%,
              color-mix(in srgb, var(--hue, #0d5c4f) 30%, transparent) 0%,
              color-mix(in srgb, var(--hue, #0d5c4f) 12%, transparent) 45%,
              transparent 70%);
  opacity: .75;
}
.agebar button[aria-pressed="true"] {
  background: var(--hue, var(--accent));
  border-color: var(--hue, var(--accent));
}
.related__link:hover {
  border-color: var(--hue, var(--accent));
  color: var(--hue, var(--accent));
}
.chap-body h2::before {
  content: "";
  display: inline-block;
  width: 20px; height: 2px; border-radius: 2px;
  background: var(--hue, var(--accent));
  vertical-align: middle;
  margin-right: 12px;
  opacity: .75;
}

/* header select breathing room on phones */
@media (max-width: 720px) {
  .agepick select { max-width: 138px; }
}

@media print {
  [data-reveal] { opacity: 1 !important; translate: none !important; }
  .chap-orb { display: none; }
}

/* --- softer orb, tinted glyph tiles, active TOC ------------------------- */
.chap-orb {
  top: -180px; right: -190px;
  width: 560px; height: 560px;
  filter: blur(34px);
  opacity: .5;
}
.chap-orb.is-breathing { animation: atlas-breathe 11s ease-in-out infinite; }

.card__glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px; font-size: 21px;
  background: color-mix(in srgb, var(--hue, var(--accent)) 11%, transparent);
  transition: transform .35s cubic-bezier(.22,.7,.25,1), background .2s;
}
.card:hover .card__glyph {
  transform: translateY(-2px) scale(1.06);
  background: color-mix(in srgb, var(--hue, var(--accent)) 18%, transparent);
}
.chap-head__glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 16px; font-size: 28px;
  background: color-mix(in srgb, var(--hue, var(--accent)) 12%, transparent);
  margin-bottom: 14px;
}

.toc__link.is-active {
  background: var(--paper-deep);
  color: var(--ink);
  border-left-color: var(--hue, var(--accent));
  font-weight: 600;
}

/* slightly tighter hero → first section */
.hero { padding-bottom: 26px; }
.section { padding: 30px 0; }

/* ==========================================================================
   PERSONALISATION + WONDERS
   ========================================================================== */

.childbar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.childbar__row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.childbar__row + .childbar__row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.childbar__who { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 0; }
.childbar__label {
  font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; white-space: nowrap;
}
.childbar__name {
  font: inherit; font-size: 14px; padding: 7px 10px; min-width: 0; width: 100%; max-width: 230px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
}
.childbar__name:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.childbar__ages { display: flex; gap: 6px; flex-wrap: wrap; }
.childbar__ages button {
  font: inherit; font-size: 13px; padding: 7px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.childbar__ages button small { display: block; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.childbar__ages button:hover { border-color: var(--accent); color: var(--accent-ink); }
.childbar__ages button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.childbar__ages button[aria-pressed="true"] small { opacity: .85; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper); }
.seg button {
  font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 14px; border: 0; border-radius: 999px;
  background: none; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.seg button.is-on { background: var(--ink); color: #fff; }
.seg button:not(.is-on):hover { color: var(--ink); }

.childbar__hint { margin: 0; font-size: 12.5px; color: var(--muted); flex: 1 1 260px; }
.childbar__hint b { color: var(--ink-soft); }

.section__count {
  margin-left: auto; font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}

/* --- wonders ------------------------------------------------------------ */
.wonders {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 620px) { .wonders { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .wonders { grid-template-columns: repeat(3, 1fr); } }
.wonder {
  display: flex; flex-direction: column; gap: 3px;
  padding: 18px 18px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  border-top: 3px solid var(--hue, var(--accent));
  text-decoration: none; color: var(--ink);
  transition: transform .25s cubic-bezier(.22,.7,.25,1), box-shadow .25s;
}
.wonder:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.wonder__n {
  font-family: var(--serif); font-size: 1.75rem; line-height: 1.05;
  letter-spacing: -.02em; color: var(--hue, var(--accent));
}
.wonder__u {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.wonder__f { margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
.wonder__src {
  margin-top: auto; padding-top: 12px;
  font-size: 11.5px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}

/* --- chapter wonders ---------------------------------------------------- */
.chap-wonders {
  display: grid; gap: 12px; margin: 26px 0 8px;
  grid-template-columns: 1fr; max-width: 44rem;
}
@media (min-width: 720px) { .chap-wonders { grid-template-columns: repeat(3, 1fr); } }
.chap-wonder {
  padding: 16px 18px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--hue, var(--accent));
}
.chap-wonder__n {
  font-family: var(--serif); font-size: 1.5rem; line-height: 1.05;
  color: var(--hue, var(--accent)); letter-spacing: -.02em;
}
.chap-wonder__u {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.chap-wonder__f { margin: 7px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }

/* --- rest of the atlas --------------------------------------------------- */
.section--rest { padding-top: 0; }
.rest {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  background: rgba(255, 253, 248, .5);
}
.rest__title {
  font-family: var(--serif); font-size: 1.2rem; font-weight: 400; margin: 0 0 6px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.rest__title span {
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  background: var(--paper-deep); color: var(--muted);
  padding: 2px 8px; border-radius: 999px;
}
.rest__note { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.grid--rest { margin-top: 22px; text-align: left; }
.grid--rest .card { opacity: .92; }

/* --- phones -------------------------------------------------------------- */
@media (max-width: 640px) {
  .childbar { padding: 15px 15px; }
  .childbar__row { gap: 10px; }
  .childbar__who { flex-basis: 100%; }
  .childbar__name { max-width: none; }
  .childbar__ages { flex: 1 1 100%; }
  .childbar__ages button { flex: 1 1 0; padding: 7px 4px; text-align: center; }
  .seg { width: 100%; }
  .seg button { flex: 1; text-align: center; }
  .childbar__hint { font-size: 12px; }
  .wonder__n { font-size: 1.55rem; }
}
