/* Static species and country pages: the globe's look (night sky, the left column, the paper panel), no JavaScript. */
@font-face { font-family: 'Bricolage Grotesque'; src: url(bricolage.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Source Serif 4'; src: url(serif-italic.woff2) format('woff2'); font-style: italic; font-weight: 200 900; font-display: swap; }
@font-face { font-family: 'Source Serif 4'; src: url(serif.woff2) format('woff2'); font-style: normal; font-weight: 200 900; font-display: swap; }
:root {
  --forest: #14261c; --deep: #22402f; --ochre: #e9b44c; --paper: #f3f6f1; --ink: #1b2a20; --muted: #5b6e60;
  --line: #d6e0d3; --link: #2d6a3e; --sans: 'Bricolage Grotesque', system-ui, sans-serif; --serif: 'Source Serif 4', Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(32px, 5vw, 48px); margin: 0 0 6px; }
h2 { font-size: 24px; margin: 40px 0 14px; }
h3 { font-size: 18px; margin: 24px 0 8px; }
.n { font-size: 15px; font-weight: 500; color: var(--muted); }
.fine { font-size: 14px; color: var(--muted); }
.lede { font-size: 19px; max-width: 46rem; }

.bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px); background: var(--forest); color: var(--paper); }
.bar a { color: var(--paper); text-decoration: none; }
.brand img { display: block; height: 32px; width: auto; }
.bar nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.bar nav a:hover { text-decoration: underline; }
.bar .cta { background: var(--ochre); color: var(--forest); padding: 7px 14px; border-radius: 999px; font-weight: 600; }
.bar .cta:hover { text-decoration: none; filter: brightness(1.05); }

main { max-width: 1040px; margin: 0 auto; padding: 18px clamp(16px, 4vw, 40px) 40px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--muted); }

.btn { display: inline-block; background: var(--forest); color: var(--paper); text-decoration: none; padding: 11px 20px;
  border-radius: 999px; font-weight: 600; }
.btn:hover { background: var(--deep); }

.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.photo { margin: 0; border-radius: 16px; overflow: hidden; background: var(--deep); }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% 30%; }
.photo figcaption { font-size: 12px; padding: 6px 10px; background: #fff; color: var(--muted); }
.photo figcaption a { color: var(--muted); }
.latin, .sci { font-family: var(--serif); font-style: italic; }
.latin { font-size: 22px; margin: 0 0 10px; color: var(--muted); }
.lineage { margin: 0 0 12px; color: var(--muted); }
.uz { color: var(--muted); }
.iucn { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; background: #dde7da; }
.iucn-CR, .iucn-EN { background: #f2c3b5; } .iucn-VU { background: #f6dc8a; } .iucn-NT { background: #e9e6b6; }
.iucn-EX, .iucn-EW { background: #3a3a3a; color: #fff; }
.extract { font-family: var(--serif); font-size: 19px; line-height: 1.6; max-width: 46rem; } /* upright: long italic text is hard to read */

.map { position: relative; margin: 0; aspect-ratio: 1 / 0.87; max-width: 760px; border-radius: 14px; overflow: hidden; background: #0b2233; }
/* the map is cut at about 79° S: the tiles keep their square and overflow the box */
.map > span { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 1; display: grid; grid-template-columns: 1fr 1fr; }
.map img { width: 100%; height: 100%; display: block; }
.facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 18px 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-size: 22px; font-weight: 600; }
.countries { columns: 2 220px; padding-left: 1.4em; margin: 0; }
.countries span { color: var(--muted); font-size: 14px; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.card .ph { display: block; aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; }
.card img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; } /* heads sit high in most animal photos */
.card .nm { font-weight: 600; margin-top: 6px; line-height: 1.25; }
.card .sci { font-size: 14px; color: var(--muted); }
.card .nt { font-size: 13px; color: var(--muted); }
.card:hover .nm { text-decoration: underline; }
.also { font-size: 15px; }

.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-width: 46rem; }
.bars li { display: grid; grid-template-columns: 15rem 1fr 7rem; gap: 12px; align-items: center; font-size: 15px; }
.bars .br { height: 12px; background: #e4ece2; border-radius: 6px; overflow: hidden; }
.bars .br span { display: block; height: 100%; border-radius: 6px; }
.bars .v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.names { list-style: none; padding: 0; columns: 4 200px; column-gap: 24px; }
.names li { break-inside: avoid; padding: 2px 0; }
.names span { color: var(--muted); font-size: 13px; }
.jump { font-size: 15px; }

.g-mammals { background: #6b5440; } .g-birds { background: #3d5a73; } .g-reptiles { background: #5a6b3d; }
.g-amphibians { background: #3d6b4f; } .g-fish { background: #1d5a6c; } .g-sharks { background: #234a63; }
.g-insects { background: #6b603d; } .g-spiders { background: #4f4a4a; } .g-crustaceans { background: #6b4f3d; }
.g-molluscs { background: #4f4a6b; } .g-corals { background: #6b4a5e; } .g-echinoderms { background: #6b3d3d; }
.g-worms { background: #6b4b52; } .g-other { background: #3d4f4a; }

footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 20px clamp(16px, 4vw, 40px) 36px; font-size: 14px; color: var(--muted); }
footer p { max-width: 1040px; margin: 0 auto; }
footer .powered { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 1040px; margin: 0 auto 12px; color: var(--ink); text-decoration: none; font-size: 13px; }
footer .powered img { border-radius: 4px; }
footer .powered:hover b { text-decoration: underline; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .bar nav a:not(.cta) { display: none; }
  .bars li { grid-template-columns: 9rem 1fr 5.5rem; font-size: 14px; }
}

/* jump links (#mammals) land below the sticky bar, not under it */
section[id] { scroll-margin-top: 76px; }

/* =====================================================================================================
   Layout v2 (2026-11-27): the globe's night sky, its left column (logo, ways in, credit), the content on a
   paper sheet like the globe's panel. The brand orange marks where you are.
   ===================================================================================================== */
:root { --accent: #f26430; --rail: 240px; --night: #070d0a; }
body {
  background-color: var(--night);
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgb(255 255 255 / 0.55), transparent),
    radial-gradient(1px 1px at 140px 90px, rgb(255 255 255 / 0.35), transparent),
    radial-gradient(1.5px 1.5px at 260px 160px, rgb(255 240 210 / 0.5), transparent),
    radial-gradient(1px 1px at 330px 40px, rgb(210 230 255 / 0.4), transparent),
    radial-gradient(1px 1px at 90px 210px, rgb(255 255 255 / 0.3), transparent),
    radial-gradient(ellipse 80% 50% at 50% 110%, rgb(70 160 120 / 0.18), transparent 70%),
    radial-gradient(circle at 40% 30%, #10211a, var(--night) 70%);
  background-size: 380px 260px, 380px 260px, 380px 260px, 380px 260px, 380px 260px, 100% 100%, 100% 100%;
  background-attachment: fixed;
}
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); gap: 20px; max-width: 1360px; margin: 0 auto; padding: 16px; min-height: 100vh; }
.rail { position: sticky; top: 16px; align-self: start; height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 16px; }
.rail .brand img { display: block; height: 35px; width: auto; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 14px; background: rgb(12 24 17 / 0.74); }
.rail-nav a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--paper); text-decoration: none; font-weight: 560; font-size: 15px; position: relative; }
.rail-nav a:hover { background: rgb(255 255 255 / 0.07); }
.rail-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.rail-nav a[aria-current='page'] { background: rgb(242 100 48 / 0.16); color: #ffe1d4; }
.rail-nav a[aria-current='page']::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--accent); }
.rail .powered { margin-top: auto; display: flex; align-items: center; gap: 8px; width: fit-content; padding: 3px 10px 3px 3px; border-radius: 15px; background: rgb(12 24 17 / 0.62); color: #dfe8e1; text-decoration: none; font-size: 11.5px; }
.rail .powered img { border-radius: 4px; display: block; }
.sheet { background: var(--paper); border-radius: 18px; box-shadow: 0 16px 48px rgb(0 0 0 / 0.45); overflow: hidden; min-width: 0; }
main { max-width: 900px; margin: 0; padding: 22px clamp(18px, 3.5vw, 44px) 36px; }
footer { margin-top: 12px; padding: 18px clamp(18px, 3.5vw, 44px) 26px; }
footer p { max-width: 900px; margin: 0; }
:focus-visible { outline-color: var(--accent); }
/* species page: a smaller photo beside the name, not a wide banner */
.hero { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 28px; }
.photo img { aspect-ratio: 4 / 3; }
h1 { font-size: clamp(30px, 4vw, 44px); }
.btn { background: var(--forest); }
.btn:hover { background: #1f3a2a; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; gap: 12px; padding: 10px; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
  .rail .brand img { height: 30px; }
  .rail-nav { flex-direction: row; padding: 4px; }
  .rail-nav { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .rail-nav a { height: 36px; padding: 0 10px; font-size: 14px; white-space: nowrap; flex: none; }
  .photo img { max-height: 260px; }
  .rail .powered { display: none; }
  .hero { grid-template-columns: 1fr; }
}
.filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 18px; }
.filter input[type='search'] { flex: 1 1 260px; max-width: 420px; height: 40px; padding: 0 12px; border: 1px solid var(--line, #d3e1df); border-radius: 10px; font: inherit; font-size: 15px; }
.filter input[type='search']:focus { outline: 2px solid #f26430; outline-offset: 1px; }
.filter label { display: flex; gap: 6px; align-items: center; font-size: 15px; }
.filter #fn { color: var(--muted); font-size: 14px; }
.names li[hidden], section[hidden] { display: none; }
