/* Paper: warm page, dark ink, one idea per screen.
   1rem is 20px on phones and 22px on wide screens, and nothing is set below
   .85rem, so no rendered text falls under 17px. */
:root {
  --bg: #f5f0e4;
  --card: #fbf8ef;
  --ink: #17201c;
  --ink2: #3d4640;
  --accent: #24512f;
  --num: #0d4a5a;
  --warm: #6a3f04;
  --line: #b9b3a2;
  --focus: #0d4a5a;
  --moss: #6f8f5a;
  --moss-dark: #46663a;
  --sage: #e2e8d5;
  --teal: #2c7f97;
  --plum: #7a3f5a;
  --plum-dark: #4d2438;
  --amber: #b8741a;
  --serif: Fraunces, Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 125%; -webkit-text-size-adjust: 100%; background: var(--bg); color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); font-optical-sizing: auto; font-size: 1rem; line-height: 1.6; overflow-wrap: break-word; }
h1, h2, h3, p, ol, ul, figure, dl, dd, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--num); }
b, strong { font-weight: 600; }
.scientific, [lang="la"] { font-style: italic; }
[hidden] { display: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }


.skip { position: absolute; left: .7rem; top: -5rem; z-index: 40; padding: .6rem 1rem; background: var(--ink); color: var(--bg); font: 600 .9rem var(--sans); border-radius: 8px; }
.skip:focus { top: .7rem; color: var(--bg); }

/* ---- screens ---- */
.screen { display: flex; flex-direction: column; justify-content: center; min-height: 84vh; min-height: 84svh; padding: 4.2rem 1.1rem 3.2rem; }
.screen.auto { min-height: 0; padding-top: 2.6rem; padding-bottom: 2.6rem; }
.col { width: 100%; max-width: 31rem; margin: 0 auto; }
.kick { font: 600 .85rem/1.35 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.chn { font-style: italic; font-weight: 400; font-size: 5.6rem; line-height: .9; color: var(--accent); }
.h { font-weight: 500; font-size: clamp(1.8rem, 9.4vw, 2.7rem); line-height: 1.06; letter-spacing: -.01em; margin-top: .45rem; }
.pull { font-weight: 500; font-size: clamp(1.6rem, 8.2vw, 2.3rem); line-height: 1.12; color: var(--num); }
.sub { font-weight: 500; font-size: 1.45rem; line-height: 1.15; }
.body { margin-top: 1.3rem; }
.body + .body { margin-top: 1rem; }
.quiet { color: var(--ink2); }
.big { font-family: var(--serif); font-weight: 500; font-size: clamp(3.6rem, 22vw, 7rem); line-height: .95; letter-spacing: -.02em; color: var(--num); font-variant-numeric: lining-nums; }
.big.long { font-size: clamp(2.5rem, 13.5vw, 4.6rem); line-height: 1; }
.big small { display: block; font: 600 .95rem/1.2 var(--sans); letter-spacing: 0; color: var(--ink2); margin-bottom: .35rem; }
.unit { font: 600 1.1rem/1.25 var(--sans); margin-top: .55rem; }
.nsub { font: 400 .9rem/1.45 var(--sans); color: var(--ink2); margin-top: .3rem; }
.pair { display: grid; gap: 1.6rem; }
.h + .big { margin-top: 1.6rem; }
.lede.small p { font-size: clamp(1.3rem, 6.4vw, 1.8rem); line-height: 1.28; }
.lede.small .next { text-align: left; margin-top: 2rem; }
.fig svg.strip { height: 2.4rem; }

/* ---- cover ---- */
.cover { min-height: 100vh; min-height: 100svh; text-align: center; justify-content: space-between; padding-top: 4.4rem; padding-bottom: 2rem; }
.cover-art { display: block; width: min(60vw, 13rem); max-height: 26vh; margin: 0 auto; }
.cover h1 { font-weight: 500; font-size: clamp(2.5rem, 13.4vw, 4.4rem); line-height: 1; letter-spacing: -.02em; margin: .5rem 0 .9rem; }
.cover h1 em { color: var(--num); }
.dek { font-size: .95rem; line-height: 1.5; color: var(--ink2); max-width: 26rem; margin: 0 auto; }
.begin { display: inline-block; font: 600 .95rem var(--sans); text-decoration: none; border-bottom: 2px solid var(--accent); padding: .5rem 0; min-height: 44px; }
.lede p { font-size: clamp(1.5rem, 7.8vw, 2.3rem); line-height: 1.2; font-weight: 500; text-align: center; }

html:not(.js) #menu-btn { display: none; }

/* ---- contents ---- */
.contents h2 { font-weight: 500; font-size: 2rem; margin: .2rem 0 1rem; }
.toc a { display: grid; grid-template-columns: 2.1rem 1fr; align-items: baseline; padding: .7rem 0; border-top: 1px solid var(--line); text-decoration: none; min-height: 44px; }
.toc li:last-child a { border-bottom: 1px solid var(--line); }
.toc .tn { font-style: italic; font-size: 1.25rem; color: var(--accent); }
.toc .tt { font-size: 1.08rem; line-height: 1.25; }
.toc a[aria-current="true"] .tt { text-decoration: underline; text-decoration-thickness: 2px; }
.extras { display: grid; gap: .1rem; margin-top: 1.1rem; }
.extras a { padding: .5rem 0; font: 500 .9rem/1.4 var(--sans); min-height: 44px; }

/* ---- menu ---- */
#menu-btn { position: fixed; top: .7rem; right: .7rem; z-index: 20; font: 600 .85rem var(--sans); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 999px; padding: .5rem .95rem; min-height: 44px; cursor: pointer; box-shadow: 0 2px 12px rgba(23, 32, 28, .16); }
#menu { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border: 0; padding: 1rem 1.1rem 3rem; background: var(--bg); color: var(--ink); overflow: auto; }
#menu::backdrop { background: var(--bg); }
#menu .col { max-width: 28rem; }
#menu .mh { font: 600 .85rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 1.5rem 0 .6rem; }
#menu-close { display: block; margin-left: auto; font: 600 .85rem var(--sans); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 999px; padding: .5rem .95rem; min-height: 44px; cursor: pointer; }

/* ---- figures ---- */
.fig { margin: 1.8rem auto 0; max-width: 26rem; }
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption { margin-top: .9rem; padding-top: .7rem; border-top: 1px solid var(--line); font: 400 .88rem/1.45 var(--sans); color: var(--ink2); }
.fl { font: 500 .92rem/1.4 var(--sans); color: var(--ink2); margin-top: .35rem; }
.fl.strong { color: var(--ink); font-weight: 600; }
.fl.warm { color: var(--warm); font-weight: 600; }
.fl.head { color: var(--ink); font-weight: 600; margin: 0 0 .7rem; }
.art-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ground { fill: var(--sage); }
.moss { fill: var(--moss); stroke: var(--moss-dark); stroke-width: 1.6; }
.water { fill: none; stroke: var(--teal); stroke-width: 2.6; opacity: .75; }
.ice { fill: rgba(44, 127, 151, .16); stroke: var(--teal); stroke-width: 1.8; }
.larva { fill: var(--plum); stroke: var(--plum-dark); stroke-width: 1.2; }
.cell { fill: #fffdf7; stroke: var(--plum); stroke-width: 1.4; }
.amber { fill: var(--amber); stroke: var(--amber); }
.line { fill: none; stroke: #5b6660; stroke-width: 1.6; }
.rule { fill: none; stroke: var(--line); stroke-width: 1.2; }
.sheet { fill: #fffdf7; stroke: var(--ink); stroke-width: 2; }
svg text.lab { font: 600 24px var(--sans); fill: var(--ink); }
svg text.lab.warm { fill: var(--warm); }
svg text.lab.quiet { fill: var(--ink2); font-weight: 500; }
.flake { fill: none; stroke: var(--teal); stroke-width: 2.4; stroke-linecap: round; }
.key { display: flex; align-items: center; gap: .55rem; }
.key svg, .key i { flex: none; width: 1.3rem; height: 1.3rem; }
.key i.sheet-ico { width: .95rem; height: 1.3rem; background: #fffdf7; border: 2px solid var(--ink); border-radius: 2px; }

/* year bar */
.scale-bar { display: grid; grid-template-columns: 4.5fr 7.5fr 4.5fr 7.5fr .33fr; margin-top: 1.8rem; border-radius: 4px; overflow: hidden; }
.scale-seg { height: 4.2rem; border-right: 2px solid var(--bg); }
.scale-seg:last-child { border-right: 0; }
.scale-seg.active { background: repeating-linear-gradient(101deg, transparent 0 12px, rgba(255, 255, 255, .25) 12px 14px), var(--moss); }
.scale-seg.frozen { background: repeating-linear-gradient(74deg, rgba(255, 255, 255, .22) 0 2px, transparent 2px 11px), var(--teal); }
.scale-seg.adult { background: var(--amber); }
.scale-axis { display: grid; grid-template-columns: 1fr 1fr; margin-top: .5rem; font: 600 .85rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); }
.scale-axis span + span { border-left: 1px solid var(--line); padding-left: .6rem; }
.scale-key { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.scale-key b { display: flex; align-items: center; gap: .5rem; font: 600 .92rem var(--sans); }
.scale-key .swatch { width: 1.1rem; height: .8rem; border-radius: 2px; flex: none; }
.swatch.active { background: var(--moss); } .swatch.frozen { background: var(--teal); } .swatch.adult { background: var(--amber); }
.scale-key div > span { display: block; margin-top: .2rem; }

/* calendar */
.steps li { display: grid; grid-template-columns: 42% 1fr; gap: .8rem; align-items: center; padding: .55rem 0; }
.steps li + li { border-top: 1px dashed var(--line); }
.steps b { display: block; font: 600 .92rem/1.3 var(--sans); }
.steps b.summer { color: var(--accent); } .steps b.winter { color: var(--num); } .steps b.adult { color: var(--warm); }
.steps span.d { display: block; font: 400 .88rem/1.35 var(--sans); color: var(--ink2); margin-top: .15rem; }

/* cells before / during / after */
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.three p { font: 600 .85rem/1.25 var(--sans); margin-top: .4rem; }
.three p.on { color: var(--num); }

/* drying test, drawn to scale on a five-day track */
.track { display: grid; grid-template-columns: 2fr 2fr 1fr; height: 1.7rem; margin: .5rem 0 .6rem; }
.track i { border-radius: 999px; }
.track .dry { background: #e9c98f; border: 2px solid var(--amber); }
.track .cold { grid-column: 2 / 4; background: #bcd9e2; border: 2px solid var(--teal); }
.track .none { border-bottom: 2px dashed var(--line); border-radius: 0; height: 50%; }
.track .cold2 { background: #cfaebd; border: 2px solid var(--plum); }
.trial + .trial { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.sw { display: inline-block; width: .9rem; height: .9rem; border-radius: 50%; margin-right: .4rem; vertical-align: -.08em; }
.sw.dry { background: #e9c98f; border: 2px solid var(--amber); } .sw.cold { background: #bcd9e2; border: 2px solid var(--teal); } .sw.cold2 { background: #cfaebd; border: 2px solid var(--plum); }

/* moisture routes */
.routes { display: grid; gap: .9rem; }
.routes li { display: grid; grid-template-columns: 44% 1fr; gap: .8rem; align-items: center; }
.routes .unknown { display: grid; place-items: center; aspect-ratio: 218 / 182; border: 2px dashed var(--teal); font: 400 4rem/1 var(--serif); color: var(--amber); }
.axis { font: 600 .85rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); margin: .2rem 0 .6rem; }
.routes + .axis { margin: .7rem 0 0; }

/* genome and alarm */
.tagrow { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.tagrow .tag { font: 500 .85rem var(--sans); color: var(--ink2); white-space: nowrap; }
.divider { display: flex; align-items: center; gap: .8rem; margin: 1.5rem 0; font: 500 .88rem var(--sans); color: var(--ink2); }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.hsp { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem .8rem; align-items: center; margin-top: .6rem; font: 500 .92rem var(--sans); }
.hsp i { height: .8rem; border-radius: 999px; background: var(--amber); }
.hsp em { font-style: normal; font-weight: 600; color: var(--warm); }

/* asides, sources, links */
.aside { background: var(--card); border-left: 4px solid var(--amber); padding: 1.2rem 1.1rem; border-radius: 0 10px 10px 0; }
.src { font: 400 .85rem/1.6 var(--sans); color: var(--ink2); overflow-wrap: anywhere; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.next { display: block; margin-top: 1.3rem; padding: 1rem 1.1rem; border: 1.5px solid var(--line); border-radius: 14px; text-decoration: none; background: var(--card); }
.next small { display: block; font: 600 .85rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.next b { font: 500 1.2rem/1.25 var(--serif); }
.verdict { text-align: center; }
.verdict .q { font-size: clamp(1.5rem, 7.6vw, 2.2rem); line-height: 1.2; font-weight: 500; margin-top: .8rem; }
footer { text-align: center; padding: 3rem 1.1rem 5rem; border-top: 1px solid var(--line); }
footer .species { font-style: italic; color: var(--num); }
footer .coda { margin: 1.2rem auto 0; max-width: 31rem; }
footer .credit { margin: 1.6rem auto 0; max-width: 31rem; font: 400 .85rem/1.5 var(--sans); color: var(--ink2); }

/* ---- reading list ---- */
.reading-list li { display: grid; grid-template-columns: 2.1rem 1fr; padding: .9rem 0; border-top: 1px solid var(--line); }
.reading-list .index { font-style: italic; font-size: 1.1rem; color: var(--accent); }
.reading-list cite { font-style: normal; display: block; }
.reading-list small { display: block; font: 400 .85rem/1.5 var(--sans); margin-top: .3rem; overflow-wrap: anywhere; }
.back { display: inline-block; font: 600 .9rem var(--sans); padding: .6rem 0; min-height: 44px; }

/* ---- the experiment ---- */
.lab .screen { min-height: 0; padding-top: 2.4rem; padding-bottom: 2.4rem; }
#lab-canvas { display: block; width: 100%; height: 15rem; border-radius: 10px; background: #060d0b; }
.lab legend { font-weight: 500; font-size: 1.3rem; line-height: 1.2; margin: 1.4rem 0 .8rem; }
.gate-options { display: grid; gap: .6rem; }
.gate-option { position: relative; }
.gate-option input { position: absolute; top: 1.15rem; left: 1rem; width: 1.2rem; height: 1.2rem; accent-color: var(--num); }
.gate-option label { display: block; padding: .9rem 1rem .9rem 2.9rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; min-height: 44px; }
.gate-option label strong { display: block; font: 600 .88rem/1.35 var(--sans); letter-spacing: .04em; }
.gate-option label > span { display: block; font: 400 .9rem/1.45 var(--sans); color: var(--ink2); margin-top: .25rem; }
.gate-option input:checked + label { border-color: var(--num); box-shadow: inset 0 0 0 1.5px var(--num); }
.gate-option input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; }
.route-label { font-weight: 500; font-size: 1.7rem; line-height: 1.1; color: var(--warm); margin-top: 1.5rem; }
.status { font: 400 .92rem/1.5 var(--sans); margin-top: .7rem; }
.status strong { color: var(--warm); }
.lab-actions { display: grid; gap: .6rem; margin-top: 1.2rem; }
.lab-actions button { font: 600 .88rem var(--sans); letter-spacing: .04em; min-height: 48px; padding: .7rem 1rem; border-radius: 999px; cursor: pointer; border: 1.5px solid var(--ink); background: var(--bg); color: var(--ink); }
.lab-actions button:first-child { background: var(--ink); color: var(--bg); }
.experiment-note, .derived, .limits { font: 400 .88rem/1.5 var(--sans); color: var(--ink2); margin-top: 1rem; }
.lab-stage { font: 600 .85rem/1.4 var(--sans); letter-spacing: .04em; padding: .7rem .9rem; border: 1.5px solid var(--amber); border-radius: 8px; background: var(--card); }
.cohort { margin-top: 1.8rem; }
.cohort h3 { font-weight: 500; font-size: 1.3rem; }
.cohort-marks { display: grid; grid-template-columns: repeat(11, 1fr); gap: 5px; margin: .8rem 0; padding-bottom: .6rem; border-bottom: 1px solid var(--line); max-width: 24rem; }
.cohort-marks span { position: relative; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--plum); background: var(--plum); transition: background .35s ease, border-color .35s ease, opacity .35s ease; }
.cohort-marks .mark-neutral { background: var(--plum); }
.cohort-marks .mark-lost { border-radius: 0; border-color: transparent; background: linear-gradient(45deg, transparent 42%, #8c8778 43% 57%, transparent 58%), linear-gradient(-45deg, transparent 42%, #8c8778 43% 57%, transparent 58%); }
.cohort-marks .mark-alive { border-color: var(--teal); background: radial-gradient(circle, var(--plum) 0 42%, #d7e9ee 45%); }
.cohort-marks .mark-adult { border-color: var(--amber); background: radial-gradient(circle, var(--amber) 0 48%, #f3e2c3 52%); border-radius: 30% 30% 50% 50%; }
.cohort-result { font: 600 .88rem/1.4 var(--sans); letter-spacing: .03em; }
.marks-key { display: grid; gap: .3rem; margin-top: 1rem; font: 500 .88rem var(--sans); color: var(--ink2); }
.marks-key .cohort-marks { display: inline-grid; grid-template-columns: 1.1rem; margin: 0 .5rem 0 0; padding: 0; border: 0; vertical-align: middle; }
.cohort-table { width: 100%; border-collapse: collapse; margin-top: 1.6rem; font: 400 .9rem/1.45 var(--sans); }
.cohort-table caption { text-align: left; font: 500 1.3rem/1.2 var(--serif); padding-bottom: .6rem; }
.cohort-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cohort-table tr { display: block; padding: .8rem 0; border-top: 1px solid var(--line); }
.cohort-table th, .cohort-table td { display: block; text-align: left; padding: 0; }
.cohort-table tbody th { font-weight: 600; letter-spacing: .03em; }
.cohort-table td:first-of-type { font-weight: 600; color: var(--warm); margin: .15rem 0; }
.cohort-table td:last-child { color: var(--ink2); }

@media (min-width: 46rem) {
  html { font-size: 137.5%; }
  .screen { padding-left: 2rem; padding-right: 2rem; }
  .h { font-size: 2.9rem; }
  .cover-art { width: 12rem; }
  .lab-actions { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cohort-marks span { transition: none; }
}
@media print {
  #menu-btn, .skip { display: none; }
  .screen { min-height: 0; padding: 1.2rem 0; }
}
.lab-head p:not(.kick) { margin-top: 1rem; }
.lab-head .kick { margin-top: 1rem; }
#lab-canvas { margin-top: 1.5rem; }
.cohort-panel { margin-top: 2.2rem; }
.lab fieldset { margin-top: 1.4rem; }
