/* The field guide (/guide/): an index of every species and a page for each. Builds on site.css. */

/* Each landscape's colour: --land is the accent, --stage-a/b the pale stage the portraits stand on. */
[data-land] { --land: #a9c98f; --stage-a: #eef0dc; --stage-b: #c3cdad; }
[data-land="pnw"] { --land: #8fc79b; --stage-a: #e7f0de; --stage-b: #b4cdaa; }
[data-land="amazon"] { --land: #4fc890; --stage-a: #dcefe1; --stage-b: #9fcfae; }
[data-land="serengeti"] { --land: #e8b75a; --stage-a: #f5ecd2; --stage-b: #dcc48d; }
[data-land="atlanta"] { --land: #f19d76; --stage-a: #f7e6d9; --stage-b: #e0b9a2; }
[data-land="chinandega"] { --land: #77cbbb; --stage-a: #e1f1ea; --stage-b: #a6d1c4; }
[data-land="reef"] { --land: #67b9f0; --stage-a: #dcedf8; --stage-b: #9cc4e0; }
[data-land="sumatra"] { --land: #b2d462; --stage-a: #ebf2d4; --stage-b: #bdd190; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.guide svg { width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; }
.guide .eyebrow { font-size: 11px; letter-spacing: 1.6px; }

/* The top of every guide page: a game still behind a glass header, as on the homepage. */
.g-top { position: relative; isolation: isolate; padding-top: 18px; overflow: hidden; }
.g-backdrop { position: absolute; inset: 0; z-index: -3; }
.g-backdrop img { display: block; width: 100%; height: 100%; object-fit: cover; }
.g-backdrop.blur img { filter: blur(10px) saturate(1.15); transform: scale(1.08); }
.g-shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(0deg, var(--forest), #173a3000 32%), linear-gradient(90deg, #0d2a22d9, #0d2a2280 55%, #0d2a2240); }
.g-top[data-land]:not([data-land=""]) .g-shade { background: linear-gradient(0deg, var(--forest), #173a3000 32%), radial-gradient(ellipse 60% 70% at 78% 50%, color-mix(in srgb, var(--land) 22%, transparent), transparent 70%), linear-gradient(90deg, #0c2620eb, #0c2620b3 55%, #0c262080); }
.guide .header { position: relative; z-index: 3; height: 66px; padding: 17px 25px; border: 1px solid #e5efda3d; border-radius: 24px; background: #1020194f; box-shadow: 0 12px 40px #0a28191a; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.guide .header .brand { color: #f6f0d9; }
.guide .site-nav { color: #eff1df; }
.guide .site-nav [aria-current="page"] { color: var(--sprout); }
.guide .button { border-radius: 100px; background: var(--sprout); color: var(--ink); box-shadow: 0 3px 0 #0000; }
.guide .button:hover { background: var(--sprout-hi); }
.guide .header .button { box-shadow: none; }

/* Index hero */
.gi-hero { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); align-items: end; gap: 30px; padding-block: 56px 96px; }
.gi-copy { padding: 30px 34px; border: 1px solid #eff2d535; border-radius: 30px 42px 30px 30px; background: #1020196b; box-shadow: 0 20px 60px #061e2133, inset 0 1px 0 #ffffff0d; -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); }
.gi-copy .eyebrow { color: #e0e8c9; }
.gi-copy h1 { font: 500 clamp(46px, 5.6vw, 76px)/1 var(--display); letter-spacing: -2.6px; color: var(--cream); margin-block: 14px 16px; }
.gi-copy > p:not(.eyebrow) { font-size: 15px; color: #f1eedb; max-width: 440px; }
.gi-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 4px 28px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #eff2d52e; }
.gi-stats div { display: flex; flex-direction: column-reverse; }
.gi-stats dt { font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #cddab8; }
.gi-stats dd { font: 600 32px/1.1 var(--display); color: var(--cream); }
.gi-parade { list-style: none; margin: 0; padding: 0; display: flex; justify-content: flex-end; align-items: end; }
.gi-parade li { width: 150px; aspect-ratio: 1; margin-left: -18px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #f6f1dc, #c9d4b2 72%); border: 3px solid #f6f0d9cc; box-shadow: 0 14px 30px #061e2155; display: grid; place-items: center; animation: bob 6s ease-in-out infinite; }
.gi-parade li:nth-child(2) { animation-delay: -1.2s; width: 128px; }
.gi-parade li:nth-child(3) { animation-delay: -2.4s; width: 168px; }
.gi-parade li:nth-child(4) { animation-delay: -3.6s; width: 132px; }
.gi-parade li:nth-child(5) { animation-delay: -4.8s; }
.gi-parade img { width: 118%; height: auto; margin-top: -8%; filter: drop-shadow(0 6px 6px #2a3a2040); }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* Index tools: search, kind toggle, count, landscape chips. */
.guide-tools { position: sticky; top: 10px; z-index: 4; margin-top: -48px; padding: 14px 16px 12px; border: 1px solid #e5efda2e; border-radius: 24px; background: #102019e6; box-shadow: 0 18px 40px #05181333; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.tools-row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.guide-search { position: relative; flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; }
.guide-search svg { position: absolute; left: 16px; width: 18px; height: 18px; color: #b8c8ad; pointer-events: none; }
.guide-search input { width: 100%; font: 600 15px var(--sans); color: var(--cream); background: #ffffff10; border: 1px solid #ffffff1f; border-radius: 100px; padding: 11px 18px 11px 44px; transition: border-color .2s, background .2s; }
.guide-search input::placeholder { color: #a9bea4; font-weight: 400; }
.guide-search input:focus { border-color: var(--sprout); background: #ffffff16; }
.guide-search input:focus-visible { outline: 3px solid var(--sprout)66; outline-offset: 1px; }
.kind-toggle { display: inline-flex; padding: 4px; border-radius: 100px; background: #ffffff0d; border: 1px solid #ffffff1a; }
.kind-toggle[hidden] { display: none; }
.kind-toggle button { border: 0; background: none; color: #d5ddcc; font-size: 13px; font-weight: 800; padding: 7px 15px; border-radius: 100px; transition: background .2s, color .2s; }
.kind-toggle button[aria-pressed="true"] { background: var(--sprout); color: var(--ink); }
.kind-toggle button:focus-visible { outline: 3px solid var(--sprout); outline-offset: 1px; }
.guide-count { margin-left: auto; font-size: 13px; font-weight: 700; color: #b9c9ae; }
.land-chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.land-chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 100px; border: 1px solid #ffffff1f; background: #ffffff08; font-size: 13px; font-weight: 700; color: #e1e7d6; white-space: nowrap; transition: background .2s, border-color .2s, color .2s; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--land); box-shadow: 0 0 0 3px color-mix(in srgb, var(--land) 25%, transparent); }
.chip small { font-size: 11px; font-weight: 800; color: #a9bea4; }
.chip:hover { border-color: var(--land, var(--sprout)); }
.chip[data-land="all"] { --land: var(--sprout); }
.chip[aria-current="true"] { background: var(--land); border-color: var(--land); color: var(--ink); }
.chip[aria-current="true"] small { color: var(--ink)b3; }
.chip[aria-current="true"] i { background: var(--ink); box-shadow: none; }
.chip.none { opacity: .45; }
.chip:focus-visible { outline: 3px solid var(--sprout); outline-offset: 2px; }
.guide-empty { padding-block: 60px 20px; font-size: 17px; color: var(--muted); text-align: center; }

/* A landscape on the index: a banner of its still, then its animals and plants. */
.guide-map { padding-top: 46px; scroll-margin-top: 150px; }
.land-banner { position: relative; isolation: isolate; display: flex; align-items: end; justify-content: space-between; gap: 20px; min-height: 210px; padding: 26px 30px; border-radius: 30px; overflow: hidden; }
.land-banner > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.land-banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #0b241ddb, #0b241d66 60%, #0b241d33), linear-gradient(0deg, #0b241d99, transparent 60%); }
.land-text .eyebrow { color: #e3ead2; }
.land-text h2 { font: 500 clamp(36px, 4.4vw, 54px)/1.05 var(--display); letter-spacing: -1.6px; color: var(--cream); margin-top: 8px; }
.land-count { font-size: 13px; font-weight: 700; color: var(--land); margin-top: 6px; }
.land-banner .map-play { margin-top: 0; flex-shrink: 0; background: #0b241d80; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.land-banner .map-play:hover { background: var(--sprout); }
.kind-group h3 { display: flex; align-items: baseline; gap: 10px; font: 600 22px/1.2 var(--display); margin: 34px 0 18px; }
.kind-group h3 small { font: 800 12px var(--sans); color: var(--land); }

/* Species cards: the portrait stands on a pale stage tinted for its landscape and leans out of it. */
.guide-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 30px 16px; }
.card { position: relative; display: flex; flex-direction: column; height: 100%; padding: 8px; border-radius: 24px; background: #ffffff09; border: 1px solid #ffffff12; transition: transform .25s, border-color .25s, background .25s, box-shadow .25s; }
.card-stage { position: relative; display: block; aspect-ratio: 4/3; border-radius: 18px; background: radial-gradient(ellipse 80% 75% at 50% 42%, var(--stage-a), var(--stage-b)); }
.card-stage::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 9%; height: 9%; border-radius: 50%; background: #1a2c1a26; filter: blur(4px); }
.card-stage img { position: relative; z-index: 1; display: block; width: 100%; height: auto; transform: translateY(-8%); transition: transform .3s; filter: drop-shadow(0 6px 5px #1c2a1830); }
.card-text { display: flex; flex-direction: column; flex: 1; padding: 12px 8px 6px; }
.card strong { font-size: 15px; line-height: 1.3; font-weight: 800; }
.card em { font: italic 13px/1.4 var(--sans); color: var(--muted); margin-top: 3px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.badges:empty { display: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 100px; background: #ffffff12; color: #d8e1cc; font-size: 11px; font-weight: 800; letter-spacing: .3px; }
.badge svg { width: 13px; height: 13px; }
.badge.invasive { background: #f0a07f; color: #3b1a0c; }
.badge.call, .badge.night { padding: 4px 6px; }
.card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--land) 60%, transparent); background: #ffffff10; box-shadow: 0 18px 34px #05181340; }
.card:hover .card-stage img { transform: translateY(-12%) scale(1.07); }
.card:focus-visible { outline: 3px solid var(--sprout); outline-offset: 3px; }

/* Species page hero */
.sp-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 40px; padding-block: 30px 96px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; font-weight: 700; color: #cbd6bf; }
.crumbs a { color: #eef0de; text-decoration: underline; text-decoration-color: #eef0de55; text-underline-offset: 4px; }
.crumbs a:hover { text-decoration-color: currentColor; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.chip-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 100px; background: #ffffff14; border: 1px solid #ffffff1f; font-size: 12px; font-weight: 800; color: #eef0de; }
.chip-tag[data-land] { background: var(--land); border-color: var(--land); color: var(--ink); }
.chip-tag.invasive { background: #f0a07f; border-color: #f0a07f; color: #3b1a0c; }
.chip-tag svg { width: 14px; height: 14px; }
.sp-title h1 { font: 500 clamp(48px, 6.4vw, 92px)/.98 var(--display); letter-spacing: -2.8px; color: var(--cream); margin-top: 18px; overflow-wrap: anywhere; hyphens: auto; }
.sci { font: italic 400 21px/1.4 var(--sans); color: var(--sprout); margin-top: 12px; }
.sp-desc { font: 400 20px/1.55 var(--sans); letter-spacing: -.2px; color: #f3efdc; margin-top: 22px; max-width: 560px; }
.sp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 28px; }
.sp-actions .button { gap: 22px; }
.sp-listen { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--sprout); }
.sp-listen svg { width: 20px; height: 20px; }
.sp-listen:hover { text-decoration: underline; text-underline-offset: 5px; }
.sp-portrait { position: relative; margin: 0; display: grid; justify-items: center; }
.sp-portrait::before { content: ""; position: absolute; inset: 6% 0 8%; z-index: 0; border-radius: 36px; background: radial-gradient(ellipse 80% 75% at 50% 42%, var(--stage-a), var(--stage-b)); box-shadow: 0 30px 80px #04140f66, inset 0 1px 0 #ffffff80; }
.sp-portrait::after { content: ""; position: absolute; left: 24%; right: 24%; bottom: 14%; height: 7%; z-index: 0; border-radius: 50%; background: #1a2c1a2e; filter: blur(8px); }
.sp-portrait img { position: relative; z-index: 1; display: block; width: 100%; max-width: 620px; height: auto; transform: translateY(-3%); filter: drop-shadow(0 16px 14px #1a2a1840); }
.sp-portrait figcaption { position: relative; z-index: 1; margin-top: 6px; padding: 5px 12px; border-radius: 100px; background: #0c2620b3; color: #dfe6d2; font-size: 11px; font-weight: 700; max-width: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* Species page body */
.sp-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: -46px; position: relative; z-index: 2; }
.sp-stats div { flex: 1 1 190px; max-width: 300px; padding: 18px 20px; border-radius: 22px; background: #172c23f0; border: 1px solid #ffffff17; box-shadow: 0 14px 30px #05181330; }
.sp-stats dt { font-size: 10px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: #b2c295; }
.sp-stats dd { font: 600 22px/1.25 var(--display); color: var(--cream); margin-top: 6px; }
.sp-stats small { display: block; font: 600 12px var(--sans); color: #a9bea4; }
.sp-about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px; align-items: center; padding-block: 48px 20px; }
.sp-about.solo { grid-template-columns: minmax(0, 760px); }
.sp-lead { font-size: 17px; line-height: 1.8; color: var(--muted); }
.sp-lead p + p { margin-top: 14px; }
.sp-lead a { color: var(--sprout); text-underline-offset: 3px; }
.call-player { padding: 22px 24px; border-radius: 26px; background: linear-gradient(135deg, #1f382d, var(--moss)); border: 1px solid #ffffff17; scroll-margin-top: 30px; }
.call-player .eyebrow { color: #d8d0a7; }
.call-player audio { display: block; width: 100%; margin-top: 12px; }
.player { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.player .play { flex-shrink: 0; display: grid; place-items: center; width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--sprout); color: var(--ink); box-shadow: 0 4px 0 #0000; transition: transform .2s, background .2s; }
.player .play:hover { background: var(--sprout-hi); transform: scale(1.05); }
.player .play svg { width: 26px; height: 26px; }
.wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 48px; cursor: pointer; }
.wave i { flex: 1; height: calc(var(--h) * 100%); border-radius: 3px; background: #ffffff2b; transition: background .15s; }
.wave i.on { background: var(--sprout); }
.player.playing .wave i { animation: pulse 1.1s ease-in-out infinite; }
.player.playing .wave i:nth-child(3n) { animation-delay: -.35s; }
.player.playing .wave i:nth-child(3n+1) { animation-delay: -.7s; }
@keyframes pulse { 50% { transform: scaleY(.7); } }
.time { flex-shrink: 0; min-width: 72px; text-align: right; font-size: 13px; font-weight: 700; color: #cfd9c4; font-variant-numeric: tabular-nums; }
.call-player .credit { font-size: 12px; color: #a9bea4; margin-top: 14px; }
.call-player a { text-decoration: underline; text-underline-offset: 3px; }

.sp-where, .sp-more { padding-top: 56px; }
.sp-where h2, .sp-more h2 { font: 500 clamp(32px, 3.6vw, 44px)/1.1 var(--display); letter-spacing: -1.3px; margin: 0 0 24px; }
.where-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.where-cards li { display: flex; flex-direction: column; border-radius: 26px; overflow: hidden; background: var(--moss); border: 1px solid #ffffff14; }
.where-cards img { display: block; width: 100%; height: 170px; object-fit: cover; border-bottom: 4px solid var(--land); }
.where-text { display: flex; flex-direction: column; align-items: start; flex: 1; padding: 20px 22px 22px; }
.where-text .eyebrow { color: #b8c79b; }
.where-text h3 { font: 600 26px/1.15 var(--display); margin-top: 6px; }
.where-hint { font-size: 14px; color: var(--muted); margin-top: 10px; }
.where-hint span { display: block; font-size: 10px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; color: var(--land); }
.where-text .map-play { margin-top: auto; }
.where-text .where-hint + .map-play, .where-text h3 + .map-play { margin-top: 20px; }
.more-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.more-head h2 { margin: 0; }
.more-all { flex-shrink: 0; font-size: 14px; font-weight: 800; color: var(--sprout); }
.more-all:hover { text-decoration: underline; text-underline-offset: 5px; }
.guide-note { margin-block: 64px; }

@media (max-width: 1100px) {
  .gi-parade li { width: 120px; } .gi-parade li:nth-child(2) { width: 100px; } .gi-parade li:nth-child(3) { width: 134px; } .gi-parade li:nth-child(4) { width: 104px; }
}
@media (max-width: 900px) {
  .gi-hero { grid-template-columns: 1fr; padding-block: 34px 84px; }
  .gi-parade { justify-content: center; }
  .sp-about { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .guide .header { height: auto; padding: 14px 16px 11px; gap: 10px; border-radius: 23px; }
  .guide .header .brand { font-size: 23px; }
  .guide .header > .button { padding: 9px 14px; gap: 19px; font-size: 11px; }
  .guide .site-nav { border-top: 1px solid #dce8c92e; border-bottom: 0; padding: 11px 0 0; font-size: 12px; gap: 12px; }
  .gi-copy { padding: 22px 22px; border-radius: 26px 32px 26px 26px; background: #10201999; }
  .gi-stats { grid-template-columns: repeat(2, auto); gap: 10px 32px; }
  .gi-parade li { width: 86px; margin-left: -12px; border-width: 2px; } .gi-parade li:nth-child(5) { display: none; } .gi-parade li:nth-child(2) { width: 74px; } .gi-parade li:nth-child(3) { width: 96px; } .gi-parade li:nth-child(4) { width: 76px; }
  .guide-tools { top: 6px; padding: 12px; border-radius: 20px; }
  .guide-search { flex-basis: 100%; max-width: none; }
  .guide-count { font-size: 12px; }
  .land-chips { margin-inline: -12px; padding-inline: 12px; }
  .land-banner { flex-direction: column; align-items: start; min-height: 190px; padding: 20px; border-radius: 24px; }
  .land-banner .map-play { padding: 9px 16px; font-size: 12px; }
  .guide-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 10px; }
  .card { border-radius: 20px; padding: 6px; }
  .card strong { font-size: 14px; }
  .card em { font-size: 12px; }
  .sp-hero { grid-template-columns: 1fr; gap: 6px; padding-block: 20px 80px; }
  .sp-portrait { order: -1; width: min(100%, 420px); justify-self: center; }
  .sp-title h1 { font-size: clamp(42px, 13vw, 58px); letter-spacing: -2px; }
  .sp-chips { margin-top: 18px; }
  .sp-desc { font-size: 18px; }
  .sp-stats { gap: 10px; }
  .sp-stats div { flex-basis: calc(50% - 5px); max-width: none; padding: 14px 16px; border-radius: 18px; }
  .sp-stats dd { font-size: 18px; }
  .where-cards { grid-template-columns: 1fr; }
  .player .play { width: 50px; height: 50px; }
  .wave { height: 40px; gap: 2px; }
  .more-head { flex-direction: column; gap: 6px; }
}
/* Phones held sideways: the height is tight, so the filters scroll away instead of sticking. */
@media (max-height: 500px) and (orientation: landscape) {
  .guide-tools { position: relative; top: 0; }
  .gi-hero { grid-template-columns: minmax(0, 560px); padding-block: 24px 80px; }
  .gi-copy { padding: 22px 26px; }
  .gi-copy h1 { font-size: 46px; }
  .gi-parade { display: none; }
  .sp-hero { padding-block: 20px 80px; }
  .sp-title h1 { font-size: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  .gi-parade li, .player.playing .wave i { animation: none; }
  .card:hover { transform: none; }
  .card:hover .card-stage img { transform: translateY(-8%); }
}
@media (prefers-reduced-transparency: reduce) {
  .guide .header, .gi-copy, .guide-tools { background: #102019f2; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .guide .header, .gi-copy, .guide-tools { background: #102019ee; }
}

/* Help pages (tools/build-help.mjs) */
.help { max-width: 760px; padding-block: 56px 72px; }
.help section + section { margin-top: 44px; }
.help h2 { font: 500 clamp(26px, 3vw, 34px)/1.15 var(--display); letter-spacing: -0.8px; margin: 0 0 14px; }
.help p, .help li { font-size: 17px; line-height: 1.75; color: var(--muted); }
.help p + p { margin-top: 12px; }
.help-list { margin: 10px 0 0 1.2em; }
.help-play { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 52px; }
