/* ---------------------------------------------------------------------------------------------
   Four palettes. Meow-Ludo, 25 September 2026: "can we please, please, please just generate like
   3 or 4 different designs for the page so it's not just ugly green?"

   Every colour on this site already came from a token, so a palette is a token block and nothing
   else changes. The :root block below is the fallback; the themes that the picker offers are
   generated into themes.css from the micrographs by tools/palette/site_themes.py, because there is
   no reason for this site's colours to be anyone's taste when the animal's own images are on disk.
   --------------------------------------------------------------------------------------------- */
:root {
  --bg: #070b0a; --bg2: #0d1412; --panel: #111a17; --ink: #e3ece8; --muted: #93a59e;
  --faint: #5f716a; --rule: rgba(147, 165, 158, 0.2);
  --accent: #86d3b2; --warm: #e0b46a; --on-accent: #06231a;
  color-scheme: dark;
}
:root {
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --cond: "IBM Plex Sans Condensed", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.62 var(--sans); padding-inline: 16px; }

/* On a desktop the page was still phone-sized: 16px type in a 720px column, which reads as a long
   narrow ribbon down the middle of a wide screen. Everything below grows the measure and the type
   together, so lines stay near 70 characters instead of near 45. */
@media (min-width: 1000px) {
  body { font-size: 17px; line-height: 1.68; padding-inline: 32px; }
  .narrow { max-width: 820px; }
  .lede { font-size: 21px; max-width: 64ch; }
  .lede2 { font-size: 19px; }
  p, li { max-width: 74ch; }
  h2 { font-size: 30px; margin-top: 6px; }
  h3 { font-size: 21px; }
  article > section, .band { padding-block: 10px; }
}
@media (min-width: 1500px) {
  body { font-size: 18px; padding-inline: 48px; }
  .wrap { max-width: 1260px; }
  .narrow { max-width: 880px; }
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; }
.narrow { max-width: 720px; margin: 0 auto; }
header.top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-block: 22px 8px; border-bottom: 1px solid var(--rule); }
header.top .brand { font: 600 20px/1 var(--cond); letter-spacing: .02em; color: var(--ink); text-decoration: none; }
header.top nav { display: flex; gap: 18px; font-size: 14px; }
header.top nav a { color: var(--muted); text-decoration: none; }
header.top nav a:hover, header.top nav a[aria-current] { color: var(--ink); }
h1 { font: 600 clamp(34px, 6vw, 60px)/1.02 var(--cond); letter-spacing: -.005em; margin: 0; text-wrap: balance; }
h2 { font: 600 26px/1.15 var(--cond); margin: 0 0 10px; text-wrap: balance; }
h3 { font: 600 19px/1.2 var(--cond); margin: 0 0 6px; }
.eyebrow { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--warm); }
/* uppercase turns the micro sign into a capital M, which reads as millimetres - a thousandfold
   error in a measurement. Anything inside .unit keeps its own case. */
.eyebrow .unit { text-transform: none; }
.lede { font-size: 19px; color: var(--muted); max-width: 62ch; margin: 14px 0 0; }
.hero { padding-block: 44px 28px; display: grid; gap: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 18px; padding-block: 12px 40px; }
.card { display: grid; grid-template-rows: auto 1fr; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: #000; }
.card .body { padding: 14px 16px 16px; display: grid; gap: 6px; align-content: start; }
.card .kind { font: 12px var(--mono); color: var(--warm); }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }
section.band { padding-block: 34px; border-top: 1px solid var(--rule); }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.videos figure { margin: 0; }
video { width: 100%; max-width: 100%; border-radius: 8px; background: #000; display: block; }
figcaption, .small { font-size: 13.5px; color: var(--muted); }
.dl { font: 13px var(--mono); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
footer { padding-block: 30px 50px; border-top: 1px solid var(--rule); color: var(--faint); font-size: 13.5px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--muted); }
/* long-form */
article { padding-block: 34px 20px; }
article p, article li { color: #cbd7d2; max-width: 68ch; }
article h2 { margin-top: 44px; }
article figure { margin: 22px 0 26px; }
article figure img { width: 100%; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--rule); display: block; background: #000; }
article .step { font: 12px var(--mono); color: var(--warm); display: block; margin-top: 44px; }
article .step + h2 { margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; margin: 18px 0; }
.facts div { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; }
.facts b { display: block; font: 600 22px var(--cond); color: var(--ink); font-variant-numeric: tabular-nums; }
.facts span { font-size: 13px; color: var(--muted); }
table.refs { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tablewrap { overflow-x: auto; }
table.refs th, table.refs td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); }
table.refs th { font: 500 12px var(--mono); color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
code { font: 0.9em var(--mono); color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
.sec-h { margin-top: 8px; }
.topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 22px; margin-top: 14px; }
.topic-group { display: grid; gap: 8px; align-content: start; }
.topic-group h3 { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--warm); margin: 6px 0 0; }
.topic { display: grid; gap: 2px; padding: 11px 14px; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; color: inherit; text-decoration: none; }
.topic:hover { border-color: var(--accent); }
.topic b { font: 600 17px var(--cond); color: var(--ink); }
.topic span { font-size: 14px; color: var(--muted); }
header.top nav { flex-wrap: wrap; row-gap: 6px; }
.eyebrow a { color: inherit; }
.note { border-left: 3px solid var(--warm); padding: 8px 14px; background: var(--panel); border-radius: 0 8px 8px 0; color: #cbd7d2; margin: 18px 0; max-width: 68ch; }
.dltable td:first-child { font: 13.5px var(--mono); white-space: nowrap; }
.dltable td .size { color: var(--faint); font: 12px var(--mono); }
pre.cite { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font: 13px/1.5 var(--mono); color: #cbd7d2; white-space: pre-wrap; }
button.copy { font: 12.5px var(--sans); color: var(--ink); background: rgba(134, 211, 178, 0.1); border: 1px solid var(--rule); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.chart { max-width: 100%; }
.chart text { fill: var(--muted); font: 12px var(--sans); }
.chart .val { fill: var(--ink); font: 12px var(--mono); }
.cards.four { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
/* species tree and profiles (/species/) */
.treebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 6px; }
.treebar input, .treebar select { font: 15px var(--sans); color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 7px 10px; }
.treebar input { flex: 1 1 260px; min-width: 0; }
.treebar input:focus-visible, .treebar select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.legend { margin: 4px 0 12px; }
.tree { font-size: 15px; padding-bottom: 20px; }
.tree details { margin-left: 14px; }
.tree > details { margin-left: 0; }
.tree summary { cursor: pointer; padding: 3px 0; list-style-position: inside; overflow-wrap: anywhere; }
.tree summary:hover .nm { color: var(--accent); }
.tree .rk { font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.tree .r-class > summary .nm, .tree .r-order > summary .nm { font: 600 18px var(--cond); }
.tree .r-family > summary .nm, .tree .r-superfamily > summary .nm { font-weight: 500; }
.tree .ct { font: 12px var(--mono); color: var(--warm); }
.tree .au { color: var(--faint); font-size: 13px; }
.tree ul.sp { list-style: none; margin: 2px 0 8px 18px; padding: 0; border-left: 1px solid var(--rule); }
.tree ul.sp li { padding: 2px 0 2px 12px; overflow-wrap: anywhere; }
.tree ul.sp li.dz a { color: var(--muted); }
.b { font: 10.5px var(--mono); border-radius: 4px; padding: 1px 5px; border: 1px solid var(--rule); color: var(--muted); white-space: nowrap; }
.b.f { color: var(--warm); border-color: rgba(224, 180, 106, .5); }
.b.m, .b.s, .b.g, .b.p { color: var(--accent); border-color: rgba(134, 211, 178, .35); }
.dz { color: var(--muted); font-style: italic; }
.sp .authority { font-size: 17px; color: var(--muted); margin: 8px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.tag { font: 12px var(--mono); color: var(--muted); border: 1px solid var(--rule); border-radius: 5px; padding: 2px 7px; }
.tag.fossil { color: var(--warm); border-color: rgba(224, 180, 106, .5); }
.tag.doubt { color: #e39a8a; border-color: rgba(227, 154, 138, .45); }
.tag.new { color: var(--accent); border-color: rgba(134, 211, 178, .4); }
ul.claims { padding-left: 18px; }
ul.claims li { margin-bottom: 10px; }
ul.claims .src, ul.cites .loc, ul.claims .loc { display: block; font-size: 13px; color: var(--faint); }
ul.claims .src a { color: var(--muted); }
.loc { color: var(--faint); font-size: 13px; }
ul.papers li { margin-bottom: 6px; font-size: 15px; }
.photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; margin: 22px 0 6px; }
.photos figure { margin: 0; }
.photos img { width: 100%; height: auto; max-height: 460px; object-fit: contain; background: #000; border-radius: 8px; border: 1px solid var(--rule); display: block; }
.mapfig { margin: 16px 0 20px; }
.mapfig svg, .mapfig img { width: 100%; height: auto; display: block; background: #0a1210; border: 1px solid var(--rule); border-radius: 8px; }
.recmap .dots { fill: var(--warm); fill-opacity: .85; }
table.cls th { width: 9em; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sources { color: var(--faint); margin-top: 18px; }
.sources a { color: var(--muted); }
.timeline { width: 100%; height: auto; color: var(--muted); }
.timeline .val { fill: var(--ink); font: italic 12px var(--sans); }
ul.fossils { list-style: none; padding: 0; display: grid; gap: 10px; }
ul.fossils li { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 14px; }
ul.fossils li .meta { display: block; font-size: 14px; color: var(--muted); }

/* grouped site menu (drop-downs) */
header.top nav { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
details.navg { position: relative; }
details.navg summary { list-style: none; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 6px; font-size: 14px; user-select: none; }
details.navg summary::-webkit-details-marker { display: none; }
details.navg summary::after { content: " ▾"; font-size: 11px; opacity: .7; }
details.navg summary:hover, details.navg.here summary, details.navg[open] summary { color: var(--ink); }
details.navg.here summary { box-shadow: inset 0 -2px 0 var(--accent, #e0762f); }
details.navg .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 170px; display: flex; flex-direction: column; padding: 6px;
  background: var(--panel, #111a17); border: 1px solid var(--rule, #2a2a2a); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
details.navg .menu a { padding: 7px 10px; border-radius: 5px; white-space: nowrap; }
details.navg .menu a:hover, details.navg .menu a[aria-current] { background: var(--bg2, #0d1412); color: var(--ink); }
details.navg summary:focus-visible, details.navg .menu a:focus-visible { outline: 2px solid var(--accent, #e0762f); outline-offset: 2px; }
@media (max-width: 560px) { details.navg .menu { right: auto; left: 0; } }
/* figure library embeds (tools/site/figures.py figures_for) */
.figlib { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; margin: 18px 0 22px; align-items: start; }
.figlib-h, .figlib-more { grid-column: 1 / -1; margin: 0; }
.figlib-more { font-size: 13.5px; }
.figlib-item { margin: 0; display: grid; gap: 6px; }
.figlib-item img { width: 100%; height: auto; max-height: 340px; object-fit: contain; background: #000; border: 1px solid var(--rule); border-radius: 8px; display: block; }
.figlib-item figcaption { font-size: 13px; color: var(--muted); }
.figlib-credit { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.figlib-credit a { color: var(--muted); }

/* "How this is built": one per page or major section (Meow-Ludo, 19 September 2026) */
details.built { margin: 18px 0 26px; border: 1px solid var(--rule); border-left: 3px solid var(--warm); border-radius: 8px; background: var(--bg2); padding: 0 14px; }
details.built > summary { cursor: pointer; padding: 10px 0; font: 600 13px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--warm); }
details.built > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.built[open] > summary { border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
details.built dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 4px 0 12px; font-size: 14px; }
details.built dt { color: var(--muted); font: 500 12px var(--mono); padding-top: 2px; }
details.built dd { margin: 0; }
details.built code { font: 12.5px var(--mono); color: var(--accent); }
@media (max-width: 560px) { details.built dl { grid-template-columns: 1fr; } details.built dt { padding-top: 6px; } }

/* Front-page build log. The process is the output, so it gets a section rather than a link. */
.buildlog{list-style:none;margin:22px 0 14px;padding:0;display:grid;gap:26px}
.buildlog li{border-left:2px solid var(--rule);padding-left:18px}
.buildlog li:first-child{border-left-color:var(--accent)}
.bl-date{font:500 11.5px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--faint)}
.buildlog h3{margin:5px 0 8px;font:600 clamp(18px,2.4vw,22px)/1.3 var(--cond)}
.buildlog h3 a{color:var(--ink);text-decoration:none}
.buildlog h3 a:hover{color:var(--accent)}
.buildlog p{margin:0 0 8px;font-size:15px;line-height:1.65;color:var(--muted);max-width:68ch}
.buildlog .bl-out{font-size:13.5px;color:var(--faint)}
.buildlog .bl-out a{color:var(--accent);text-decoration:none}
.buildlog .bl-out a:hover{text-decoration:underline}
@media (max-width:560px){.buildlog li{padding-left:14px}}

/* Front page "newest first" strip, generated by tools/site/build_map.py */
.latest{display:grid;gap:1px;margin:14px 0 0;border-top:1px solid var(--rule)}
.latest .lat{display:grid;grid-template-columns:72px 1fr;gap:14px;align-items:baseline;
  padding:12px 4px;border-bottom:1px solid var(--rule);text-decoration:none;color:var(--ink)}
.latest .lat:hover{background:rgba(134,211,178,.06)}
.latest .when{font:500 12.5px var(--mono);color:var(--faint);font-variant-numeric:tabular-nums;white-space:nowrap}
.latest .what b{display:block;font:600 15.5px var(--sans);color:var(--ink)}
.latest .what .sub{display:block;font-size:13.5px;line-height:1.55;color:var(--muted);margin-top:3px}
@media (max-width:560px){.latest .lat{grid-template-columns:1fr;gap:3px}}

/* Contact block */
.contact{background:var(--panel);border:1px solid var(--rule);border-radius:12px;
  padding:20px 22px;margin:28px 0}
.contact h2{margin:0 0 8px;font:600 19px var(--sans);color:var(--ink)}
.contact p{margin:0 0 12px;font-size:15px;line-height:1.65;color:var(--muted);max-width:64ch}
.contact .ways{display:flex;flex-wrap:wrap;gap:9px}
.contact .ways a{display:inline-block;background:transparent;border:1px solid var(--rule);
  border-radius:99px;padding:8px 15px;font:500 14px var(--sans);color:var(--ink);text-decoration:none}
.contact .ways a:hover{border-color:var(--accent)}
.contact .ways a.key{background:var(--accent);border-color:var(--accent);color:#06231a}

/* Palette switcher in the header */
.themepick { position: relative; display: inline-flex; align-items: center; }
.themepick .tt { background: transparent; border: 1px solid var(--rule); border-radius: 99px;
  color: var(--muted); font-size: 15px; line-height: 1; padding: 5px 9px; cursor: pointer; }
.themepick .tt:hover { color: var(--ink); border-color: var(--accent); }
.themepick .tmenu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 6px;
  display: grid; gap: 2px; min-width: 148px; box-shadow: 0 12px 34px -16px rgba(0,0,0,.75); }
/* display:grid above would otherwise override the hidden attribute and pin the menu open */
.themepick .tmenu[hidden] { display: none; }
.themepick .tmenu button { display: flex; align-items: center; gap: 9px; width: 100%;
  background: transparent; border: 0; border-radius: 7px; color: var(--ink); cursor: pointer;
  font: 500 14px var(--sans); padding: 7px 9px; text-align: left; }
.themepick .tmenu button:hover { background: var(--bg2); }
.themepick .tmenu i { width: 13px; height: 13px; border-radius: 50%; display: inline-block;
  border: 1px solid rgba(255,255,255,.22); }
.sw-moss { background: linear-gradient(135deg, #86d3b2 50%, #0d1412 50%); }
.sw-slate { background: linear-gradient(135deg, #7fb2f0 50%, #121722 50%); }
.sw-amber { background: linear-gradient(135deg, #e2a24a 50%, #171008 50%); }
.sw-paper { background: linear-gradient(135deg, #2f6b4a 50%, #f6f3ec 50%); }

/* Things that were hard-coded dark and break in the paper palette */

/* Full-bleed illustration, for the renders of the animal */
figure.still { margin: 24px 0; }
figure.still img { width: 100%; height: auto; display: block; border-radius: 12px;
  border: 1px solid var(--rule); background: var(--bg2); }
figure.still figcaption { color: var(--muted); font-size: 13.5px; line-height: 1.55;
  margin-top: 9px; max-width: 74ch; }
figure.still figcaption b { color: var(--ink); font-weight: 600; }


/* Front-page banner: the animal walking above a word that is made of the graph.
   The <h1> underneath it is the real heading and is what a screen reader and a
   search engine get; the canvas is decoration over the top of it and is hidden
   from both. Without that the site's name would exist only as pixels. */
.banner{position:relative;margin:0 0 30px;height:min(46vh,340px);min-height:210px}
.banner canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.banner .wordmark-alt{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
@media(max-width:640px){ .banner{height:200px;min-height:160px} }
