/* Shared stylesheet for all animal sites. Each site sets its own colours in :root via site.mjs (theme). */
:root {
  --bg: #f6f3ee; --paper: #fffdf9; --ink: #1c2226; --muted: #5d6870; --line: #e3ddd2;
  --accent: #b5476a; --accent-ink: #fff; --deep: #13252c; --soft: #f0e6e8; --ok: #2f7a4f; --warn: #b8741a; --bad: #b3361f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 14px; --wrap: 1120px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.62 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 22px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; font: 600 1.18rem/1 var(--serif); text-decoration: none; white-space: nowrap; }
.logo svg { flex: none; }
.top nav { display: flex; gap: 18px; margin-left: auto; font-size: .95rem; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
.menu { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; font: inherit; color: var(--ink); }
@media (max-width: 820px) {
  .menu { display: block; }
  .top nav { display: none; position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 6px 22px 14px; }
  .top nav.open { display: flex; }
  .top nav a { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
}

/* hero */
.hero { position: relative; min-height: min(86vh, 760px); display: flex; align-items: flex-end; color: #fff; background: var(--deep); overflow: hidden; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.34) 42%, rgba(0,0,0,0) 72%), linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.5) 100%); }
@media (max-width: 820px) { .hero::after { background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.72) 75%); } }
.hero .wrap { position: relative; z-index: 1; padding-bottom: clamp(36px, 7vw, 78px); width: 100%; }
.hero h1 { max-width: 15ch; text-shadow: 0 2px 24px rgba(0,0,0,.25); }
.hero .lead { font-size: clamp(1.08rem, 1.6vw, 1.3rem); max-width: 40rem; opacity: .95; }
.kicker { display: inline-block; font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 18px; opacity: .9; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; border: 0; cursor: pointer; font-size: 1rem; }
.btn:hover { color: var(--accent-ink); filter: brightness(1.07); }
.btn.ghost { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.btn.line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.line:hover { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.credit-tag { position: absolute; right: 10px; bottom: 8px; z-index: 1; font-size: .7rem; opacity: .7; color: #fff; }

/* sections */
section { padding: clamp(46px, 7vw, 92px) 0; }
section.tight { padding: 34px 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.sec-h p { color: var(--muted); margin: 0; max-width: 34rem; }
.eyebrow { font: 600 .78rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 12px; }

/* numbers strip */
.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.nums div { padding: 26px 24px; border-right: 1px solid var(--line); }
.nums div:last-child { border-right: 0; }
.nums b { display: block; font: 600 2.4rem/1 var(--serif); color: var(--accent); margin-bottom: 8px; }
.nums span { color: var(--muted); font-size: .95rem; }

/* split photo + text */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split.rev > :first-child { order: 2; }
.split figure { margin: 0; }
.split img, .photo { border-radius: var(--r); }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } .split.rev > :first-child { order: 0; } }
figcaption, .cap { font-size: .78rem; color: var(--muted); margin-top: 8px; }

/* full-bleed photo band */
.band { position: relative; color: #fff; min-height: 460px; display: flex; align-items: center; background: var(--deep); overflow: hidden; }
.band > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.66), rgba(0,0,0,.08) 70%); }
.band .wrap { position: relative; z-index: 1; width: 100%; }
.band p.big { font: 500 clamp(1.5rem, 3.2vw, 2.4rem)/1.25 var(--serif); max-width: 22ch; margin: 0 0 16px; }
.band p { max-width: 34rem; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.08); color: inherit; }
.card img { aspect-ratio: 3/2; object-fit: cover; width: 100%; }
.card div { padding: 16px 18px 20px; }
.card b { display: block; font: 600 1.15rem/1.25 var(--serif); margin-bottom: 6px; }
.card span { color: var(--muted); font-size: .93rem; }

/* tools */
.tool { background: var(--paper); border: 1px solid var(--line); border-radius: calc(var(--r) + 6px); padding: clamp(20px, 3.4vw, 36px); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 44px); }
.tool + .tool { margin-top: 22px; }
@media (max-width: 820px) { .tool { grid-template-columns: 1fr; } }
.tool h3 { font-size: 1.5rem; }
.tool .intro { color: var(--muted); }
.field { margin-bottom: 16px; }
.field label, .field .lbl { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field input[type=number], .field input[type=date], .field select { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field input[type=range] { width: 100%; accent-color: var(--accent); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-block; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-size: .93rem; cursor: pointer; background: #fff; }
.seg input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.out { background: var(--soft); border-radius: var(--r); padding: 22px 22px 18px; align-self: start; }
.out .res { font: 600 clamp(1.9rem, 4vw, 2.7rem)/1.05 var(--serif); margin: 4px 0 8px; }
.out .sub { color: var(--muted); font-size: .95rem; }
.out ul { margin: 12px 0 0; padding-left: 20px; }
.out li { margin-bottom: 6px; }
.out .status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.st-ok { background: color-mix(in srgb, var(--ok) 16%, #fff); color: var(--ok); }
.st-warn { background: color-mix(in srgb, var(--warn) 18%, #fff); color: var(--warn); }
.st-bad { background: color-mix(in srgb, var(--bad) 15%, #fff); color: var(--bad); }
.gauge { height: 12px; border-radius: 999px; background: linear-gradient(90deg, #5b8fd6 0%, var(--ok) 30%, var(--ok) 48%, var(--warn) 62%, var(--bad) 85%); position: relative; margin: 14px 0 4px; }
.gauge i { position: absolute; top: -5px; width: 4px; height: 22px; background: var(--ink); border-radius: 3px; transform: translateX(-50%); transition: left .25s; }
.gauge-l { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.timeline { list-style: none; padding: 0; margin: 14px 0 0; }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 9px 0; border-top: 1px dashed color-mix(in srgb, var(--ink) 20%, transparent); }
.timeline li b { font-variant-numeric: tabular-nums; }
.timeline li.now { color: var(--accent); font-weight: 600; }
.share { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; background: none; border: 1.5px solid var(--ink); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: 600 .88rem var(--sans); cursor: pointer; }
.share:hover { color: var(--accent); border-color: var(--accent); }

/* checklist kit */
.kit { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.kit li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; grid-template-columns: 30px 1fr auto; gap: 14px; align-items: start; }
.kit li.done { opacity: .62; }
.kit li.done b { text-decoration: line-through; }
.kit input[type=checkbox] { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--accent); }
.kit b { display: block; font-size: 1.04rem; }
.kit p { margin: 4px 0 0; color: var(--muted); font-size: .93rem; }
.kit .tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-left: 6px; }
.kit a.go { white-space: nowrap; font-size: .88rem; font-weight: 600; text-decoration: none; padding: 8px 13px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--ink); }
.kit a.go:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
@media (max-width: 560px) { .kit li { grid-template-columns: 28px 1fr; } .kit a.go { grid-column: 2; justify-self: start; } }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 6px 0 18px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }

/* quiz */
.quiz { background: var(--deep); color: #fff; border-radius: calc(var(--r) + 6px); padding: clamp(22px, 4vw, 44px); }
.quiz h2 { color: #fff; }
.quiz .q { font: 500 1.35rem/1.35 var(--serif); margin: 6px 0 18px; min-height: 3.6em; }
.quiz .n { opacity: .7; font-size: .85rem; }
.quiz .ans { display: flex; gap: 10px; flex-wrap: wrap; }
.quiz .ans button { flex: 1 1 140px; padding: 13px 16px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.5); background: transparent; color: #fff; font: 600 1rem var(--sans); cursor: pointer; }
.quiz .ans button:hover { background: rgba(255,255,255,.1); }
.quiz .verdict { font: 500 1.5rem/1.3 var(--serif); }

/* prose pages */
.page-hero { position: relative; height: clamp(260px, 42vw, 440px); background: var(--deep); overflow: hidden; }
.page-hero img { width: 100%; height: 100%; object-fit: cover; }
.doc { max-width: 720px; margin: 0 auto; padding: 0 22px; }
.doc h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); margin-top: 38px; }
.doc .standfirst { font-size: 1.2rem; color: var(--muted); }
.doc h2 { font-size: 1.65rem; margin-top: 1.8em; }
.doc h3 { margin-top: 1.4em; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: .45em; }
.doc figure { margin: 30px -40px; }
@media (max-width: 860px) { .doc figure { margin: 26px 0; } }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0 26px; font-size: .95rem; background: var(--paper); border-radius: 10px; overflow: hidden; }
.doc th, .doc td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th { background: var(--soft); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.note { background: var(--paper); border-left: 4px solid var(--accent); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 22px 0; }
.note.warn { border-color: var(--bad); }
.facts { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin: 24px 0; }
.facts dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--muted); }
.crumbs { font-size: .85rem; color: var(--muted); margin-top: 22px; }
.crumbs a { color: var(--muted); }
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 20px; margin: 20px 0 8px; font-size: .95rem; }
.toc ol { margin: 6px 0 0; }
.diagram { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.diagram svg { width: 100%; height: auto; display: block; }
.next { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 40px 0 0; }
.next a { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; text-decoration: none; }
.next a small { display: block; color: var(--muted); font-size: .8rem; }
.next a b { font-family: var(--serif); font-size: 1.1rem; }
@media (max-width: 560px) { .next { grid-template-columns: 1fr; } }

/* faq */
details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; margin-bottom: 10px; }
details summary { cursor: pointer; padding: 15px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 14px; }
details summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--accent); }
details[open] summary::after { content: "–"; }
details > div { padding: 0 0 14px; color: var(--muted); }

/* footer */
footer { background: var(--deep); color: rgba(255,255,255,.82); padding: 54px 0 40px; margin-top: 30px; font-size: .92rem; }
footer a { color: #fff; }
footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
footer b { color: #fff; font-family: var(--serif); font-size: 1.1rem; display: block; margin-bottom: 8px; }
footer .small { font-size: .78rem; opacity: .75; margin-top: 30px; }
@media (max-width: 760px) { footer .cols { grid-template-columns: 1fr; } }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.toast.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .top, footer, .btns, .share, .kit a.go, .menu { display: none !important; } body { background: #fff; } }
