:root {
  --bg: #f7f4ec;
  --paper: #fffdf8;
  --ink: #1f2a24;
  --muted: #66706a;
  --line: #e4ded0;
  --green: #2f5d46;
  --green-dark: #1f4232;
  --accent: #c8792b;
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
img { max-width: 100%; display: block; }
a { color: var(--green); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.1rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.section { padding: 40px 0; }
.page-top { padding-top: 34px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lead { font-size: 1.12rem; color: #3b4640; max-width: 62ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; color: var(--accent); margin: 0 0 .6em; }

/* header */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.logo-mark { color: var(--green); display: flex; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a[aria-current] { background: #ebe5d6; }

/* hero */
.hero { background: radial-gradient(circle at 85% 20%, #3d7458 0, var(--green-dark) 55%); color: #f4f1e8; }
.hero-inner { padding: 72px 22px 80px; }
.hero h1 { color: #fffaf0; }
.hero .lead { color: #d9e3dc; }
.hero .eyebrow { color: #f0b46e; }
.search { display: flex; gap: 8px; margin-top: 26px; max-width: 560px; }
.search input, .filter { flex: 1; font: inherit; padding: 14px 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.search button, .btn { font: inherit; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer; text-decoration: none; display: inline-block; }
.search button:hover, .btn:hover { background: #b0661e; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn-outline { background: transparent; color: var(--green-dark); box-shadow: inset 0 0 0 2px var(--green); }
.btn-outline:hover { background: var(--green); color: #fff; }
#sounds, #watch { scroll-margin-top: 84px; } /* keeps the heading visible under the sticky header */
.filter { width: 100%; max-width: 560px; margin: 10px 0 6px; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.section-head a { font-weight: 600; text-decoration: none; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(31, 42, 36, .1); }
.card-img { aspect-ratio: 4 / 3; background: #ece6d8; display: flex; align-items: center; justify-content: center; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img.is-profile img { object-fit: contain; padding: 8px; }
.card-body { padding: 12px 14px 14px; }
.card-body h3 { margin: 0; font-size: 1.02rem; }
.sci { font-style: italic; color: var(--muted); margin: 2px 0 0; font-size: .9rem; }
.sci.big { font-size: 1.15rem; margin-bottom: 14px; }
.ph { color: #b9b09c; display: flex; }
.ph svg { width: 56px; height: 56px; }
.ph.big svg { width: 120px; height: 120px; }

/* groups */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.group { display: flex; align-items: center; gap: 16px; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.group:hover { border-color: var(--green); }
.group-img { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: #ece6d8; flex: none; display: flex; align-items: center; justify-content: center; color: #b9b09c; }
.group-img img { width: 100%; height: 100%; object-fit: cover; }
.group h3 { margin: 0; }
.group p { margin: 2px 0 0; }
.group-title { margin-top: 36px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }

.callout { background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.callout p { margin: 0; color: #3b4640; }

/* species */
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.species-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
.species-hero { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.species-hero img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.species-hero.is-profile img { object-fit: contain; padding: 16px; background: linear-gradient(#fffdf8, #f1ecdf); }
.species-hero .ph { aspect-ratio: 3 / 2; align-items: center; justify-content: center; }
.species-hero .credit { padding: 8px 14px; margin: 0; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tag { font-size: .8rem; font-weight: 600; background: #e3ece6; color: var(--green-dark); padding: 4px 10px; border-radius: 999px; text-decoration: none; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 18px 0 22px; }
.facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; }
.block { margin-top: 48px; }
.marks { padding-left: 1.2em; max-width: 70ch; }
.marks li { margin-bottom: 6px; }
.sounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.sound { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.sound audio { width: 100%; margin: 8px 0 4px; }
.credit { font-size: .78rem; color: var(--muted); line-height: 1.45; margin: 6px 0 0; }
.credit a { color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.shot { margin: 0; }
.shot-btn { border: 0; padding: 0; background: #ece6d8; border-radius: 10px; overflow: hidden; cursor: zoom-in; width: 100%; display: block; }
.shot-btn img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .2s; }
.shot-btn:hover img { transform: scale(1.03); }
.details { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; align-items: start; }
.details .facts { grid-template-columns: 1fr; margin-top: 8px; }
.range { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.range h3 { margin-bottom: 10px; }
.range img { width: 100%; height: auto; }
.placeholder { background: repeating-linear-gradient(45deg, #efe9dc, #efe9dc 12px, #e9e2d3 12px, #e9e2d3 24px); border: 1px dashed #c9bfa8; border-radius: 10px; color: var(--muted); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 220px; }
.video { position: relative; aspect-ratio: 16 / 9; max-width: 860px; border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video.placeholder { background: repeating-linear-gradient(45deg, #efe9dc, #efe9dc 12px, #e9e2d3 12px, #e9e2d3 24px); }
.video.placeholder span { width: 64px; height: 44px; border-radius: 12px; background: #c4302b; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }

/* photo slider */
.slider { position: relative; max-width: 960px; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; border-radius: var(--radius); scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; margin: 0; }
.slide .shot-btn img { aspect-ratio: 3 / 2; object-fit: contain; background: #1b221e; }
.slide .shot-btn { border-radius: var(--radius); }
.slide .credit { padding: 4px 2px; }
.sl-btn { position: absolute; top: calc(50% - 60px); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 253, 248, .92); color: var(--ink); font-size: 1.8rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.sl-prev { left: 12px; }
.sl-next { right: 12px; }
.sl-btn:hover { background: #fff; }
.sl-count { position: absolute; top: 12px; right: 12px; background: rgba(20, 28, 23, .7); color: #fff; font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; }
.thumb { flex: 0 0 84px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; opacity: .6; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.on { border-color: var(--accent); opacity: 1; }

.pager { display: flex; justify-content: space-between; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; font-weight: 600; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(10, 16, 12, .88); }
.lightbox img { max-width: 92vw; max-height: 82vh; margin: 0 auto; border-radius: 8px; }
.lightbox .credit { color: #d6ddd8; text-align: center; }
.lightbox .credit a { color: #d6ddd8; }
.lb-close { position: fixed; top: 14px; right: 18px; font-size: 2rem; background: none; border: 0; color: #fff; cursor: pointer; }

/* credits + prose */
.prose { max-width: 900px; }
.table-wrap { overflow-x: auto; }
table.credits { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--paper); }
.credits th, .credits td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.credits th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* footer */
.site-footer { background: var(--green-dark); color: #d9e3dc; margin-top: 60px; }
.site-footer .muted { color: #a9bbb0; }
.footer-inner { padding: 36px 22px; display: grid; grid-template-columns: 1fr auto; gap: 18px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: #fff; }
.footer-inner > .small { grid-column: 1 / -1; }

@media (max-width: 820px) {
  .species-head, .details { grid-template-columns: 1fr; gap: 24px; }
  .sl-btn { width: 38px; height: 38px; font-size: 1.4rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero-inner { padding: 48px 22px 56px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

.sz{max-width:560px;box-sizing:border-box;padding:16px 22px 14px;background:#fffdf8;border:1px solid #e4ded0;border-radius:12px}
.sz-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.sz-eyebrow{font-size:.68rem;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:#c8792b}
.sz-sum{font-family:"Fraunces",Georgia,serif;font-weight:500;font-size:1.15rem;color:#1f2a24}
.sz-stage,.sz-labels{display:grid;grid-template-columns:repeat(var(--sz-cols),1fr);column-gap:5%}
.sz-stage{align-items:end;aspect-ratio:100/26.8;border-bottom:1.5px solid #8a8f88;padding:0 2px}
.sz-cell{display:flex;justify-content:center;align-items:flex-end}
.sz-sil{background:#c9c1ae;-webkit-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}
.sz-sil.me{background:#c8792b}
.sz-labels{margin-top:6px}
.sz-lbl{min-height:3.9em;text-align:center;font-size:.72rem;line-height:1.3;color:#66706a}
.sz-lbl span{display:block;color:#8b928d}
.sz-lbl.me,.sz-lbl.me span{color:#1f2a24;font-weight:600}
.sz-foot{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:12px;font-size:.66rem;color:#8b928d}
.sz-scale{display:flex;align-items:center;gap:6px;flex:1}
.sz-scale i{display:block;height:5px;border:1px solid #8b928d;border-top:0;min-width:4px}

/* life history + cool facts */
.lh-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.lh-item{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:18px 20px}
.lh-item h3{font-size:1.05rem;margin-bottom:6px}
.lh-item p{margin:0}
.nest-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;margin:14px 0 0;padding-top:12px;border-top:1px solid var(--line)}
.nest-facts dt{font-size:.7rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:600}
.nest-facts dd{margin:2px 0 0;font-size:.92rem}
.cool-facts{list-style:none;counter-reset:cf;padding:0;margin:0;display:grid;gap:12px;max-width:760px}
.cool-facts li{counter-increment:cf;position:relative;padding:14px 18px 14px 58px;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius)}
.cool-facts li::before{content:counter(cf);position:absolute;left:16px;top:12px;width:28px;height:28px;border-radius:50%;background:var(--accent);color:#fff;font-weight:600;display:flex;align-items:center;justify-content:center;font-size:.9rem}
@media (max-width:820px){.lh-grid{grid-template-columns:1fr}}
