/* ============================================================
   Rosette — the four rosette cats
   Ink #17150F · Gold #C9A227 · Bone #F0E6CE · Rust #A33B24
   ============================================================ */

:root {
  --ink: #17150F;
  --ink-2: #221F17;
  --ink-3: #2E2A20;
  --gold: #C9A227;
  --gold-dim: #9A7C1C;
  --bone: #F0E6CE;
  --bone-dim: #B7AC93;
  --rust: #A33B24;
  --amber: #C97B27;
  --moss: #2E6B4F;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --sans: "Helvetica Neue", Inter, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 68ch;
  --gutter: clamp(1.15rem, 4vw, 3rem);
  --rule: 1px solid rgba(240, 230, 206, 0.14);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--serif);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--ink); }

a { color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--bone); }
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

img, svg, video { max-width: 100%; display: block; }

/* visually hidden without pushing the scroll area — `left:-9999px` looks
   harmless but in RTL it makes the document 10,000px wide */
.skip {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; white-space: nowrap;
  clip: rect(0 0 0 0); clip-path: inset(50%); border: 0;
}
.skip:focus {
  position: fixed; top: 0; inset-inline-start: 0; z-index: 200;
  width: auto; height: auto; margin: 0; overflow: visible;
  clip: auto; clip-path: none;
  background: var(--gold); color: var(--ink); padding: .7rem 1.1rem;
  font-family: var(--sans); font-weight: 700;
}

/* ---------- canvas backgrounds ---------- */
#rosette-field {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -2; pointer-events: none;
}
#eyeshine {
  position: fixed; top: 0; left: 0; width: 480px; height: 480px;
  margin: -240px 0 0 -240px; z-index: -1; pointer-events: none;
  background: radial-gradient(circle closest-side,
    rgba(201, 162, 39, 0.42), rgba(201, 162, 39, 0) 72%);
  opacity: .14; mix-blend-mode: screen; will-change: transform;
}

/* ---------- header ---------- */
.masthead {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 1rem;
  padding: .62rem var(--gutter);
  background: rgba(23, 21, 15, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: var(--rule);
}

.wordmark {
  display: inline-flex; align-items: center; gap: .05em;
  font-family: var(--sans); font-weight: 700;
  font-size: .93rem; letter-spacing: .38em; text-indent: .38em;
  text-transform: uppercase; color: var(--bone);
  text-decoration: none; white-space: nowrap;
}
.wordmark:hover { color: var(--bone); }
.wordmark .mark {
  width: 1.18em; height: 1.18em; color: var(--gold);
  margin: 0 .1em; transform: translateY(.04em);
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.wordmark:hover .mark { transform: translateY(.04em) rotate(72deg); }
.wordmark .mark svg { width: 100%; height: 100%; }

.nav {
  margin-left: auto; display: flex; gap: .15rem; align-items: center;
  font-family: var(--sans); font-size: .74rem; letter-spacing: .13em;
  text-transform: uppercase;
}
.nav a {
  color: var(--bone-dim); text-decoration: none;
  padding: .5rem .62rem; border-radius: 3px; white-space: nowrap;
}
.nav a:hover { color: var(--bone); background: rgba(240, 230, 206, .07); }
.nav a[aria-current="page"] { color: var(--gold); }
.nav .nav-ask {
  border: 1px solid rgba(201, 162, 39, .5); color: var(--gold);
  margin-left: .35rem;
}
.nav .nav-ask:hover { background: var(--gold); color: var(--ink); }

@media (max-width: 1000px) {
  .nav { gap: 0; font-size: .66rem; }
  .nav a { padding: .45rem .4rem; }
  .nav .nav-lib, .nav .nav-about { display: none; }
}
@media (max-width: 640px) {
  .nav-more { display: none; }
  .wordmark { font-size: .72rem; letter-spacing: .22em; text-indent: .22em; }
  .masthead { gap: .5rem; padding: .55rem .9rem; }
  .nav { font-size: .62rem; }
  .nav a { padding: .42rem .34rem; }
  .nav .nav-ask { padding: .42rem .6rem; margin-left: .25rem; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: calc(100svh - 3.6rem);
  display: grid; align-items: end;
  padding: 0 0 clamp(1.8rem, 4.5vh, 2.8rem);
  overflow: hidden; isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -3; background: var(--ink); }
.hero-media video,
.hero-media img.poster {
  width: 100%; height: 100%; object-fit: cover; object-position: center 38%;
}
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(23,21,15,.80) 0%, rgba(23,21,15,.30) 26%,
                    rgba(23,21,15,.42) 55%, rgba(23,21,15,.93) 92%),
    radial-gradient(120% 78% at 50% 42%, rgba(23,21,15,0) 34%, rgba(23,21,15,.72) 100%);
}
.hero-inner { padding: 0 var(--gutter); position: relative; }

.hero-eyebrow {
  font-family: var(--sans); font-size: .68rem; letter-spacing: .34em;
  text-transform: uppercase; color: var(--gold);
  margin: 0 0 1rem; display: flex; align-items: center; gap: .7rem;
}
.hero-eyebrow::after {
  content: ""; flex: 1; height: 1px; max-width: 220px;
  background: linear-gradient(90deg, rgba(201,162,39,.55), transparent);
}

.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 5.6vw, 4.3rem);
  line-height: 1.02; letter-spacing: -0.022em;
  margin: 0 0 .7rem; max-width: 19ch;
  text-shadow: 0 2px 40px rgba(0,0,0,.6);
}
.hero h1 em { font-style: italic; color: var(--gold); }

.hero-dek {
  max-width: 54ch; color: #E4DAC4; margin: 0 0 1.5rem;
  font-size: clamp(1rem, 1.7vw, 1.16rem);
  text-shadow: 0 1px 20px rgba(0,0,0,.7);
}

/* ---------- the count strip ---------- */
.count {
  display: grid; gap: 1px;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(240,230,206,.14);
  border: 1px solid rgba(240,230,206,.14);
  border-radius: 4px; overflow: hidden;
}
@media (max-width: 900px) { .count { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .count { grid-template-columns: 1fr; } }

/* phones: tighten the hero so the first count cell sits at the fold */
@media (max-width: 640px) {
  .hero h1 { font-size: clamp(1.85rem, 8.4vw, 2.6rem); max-width: 16ch; }
  .hero-dek { font-size: .96rem; margin-bottom: 1.15rem; max-width: 42ch; }
  .hero-eyebrow { font-size: .6rem; letter-spacing: .26em; margin-bottom: .7rem; }
  .count-cell { padding: .8rem .95rem .9rem; }
  .count-num { font-size: 1.75rem; }
  .count-num.is-unknown { font-size: 1.45rem; }
  .count-meta { font-size: .62rem; }
  .cam-tag { display: none; }
  .scroll-hint { display: none; }
}

.count-cell {
  background: rgba(23,21,15,.80);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 1.05rem 1.15rem 1.15rem;
  text-decoration: none; color: inherit; display: block;
  position: relative; transition: background .25s ease;
}
.count-cell:hover { background: rgba(46,42,32,.9); color: inherit; }
.count-cell::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--c, var(--gold)); opacity: .85;
}
.count-name {
  font-family: var(--sans); font-size: .66rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--bone-dim);
  display: flex; align-items: baseline; gap: .5rem; margin-bottom: .34rem;
}
.count-num {
  font-family: var(--serif); font-variant-numeric: tabular-nums;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem); line-height: 1.06;
  color: var(--bone); letter-spacing: -.02em;
}
.count-num.is-unknown { font-style: italic; color: var(--bone-dim); font-size: clamp(1.3rem,2.6vw,1.9rem); }
.count-meta {
  font-family: var(--sans); font-size: .655rem; letter-spacing: .05em;
  color: var(--bone-dim); margin-top: .42rem; line-height: 1.5;
}
.count-bar {
  height: 3px; margin-top: .6rem; border-radius: 2px;
  background: rgba(240,230,206,.13); overflow: hidden; position: relative;
}
.count-bar span {
  position: absolute; top: 0; bottom: 0; border-radius: 2px;
  background: var(--c, var(--gold)); opacity: .75;
}
.count-bar.is-none span {
  left: 0; right: 0;
  background: repeating-linear-gradient(90deg,
    rgba(240,230,206,.3) 0 4px, transparent 4px 9px);
}

/* status pills */
.pill {
  font-family: var(--sans); font-size: .58rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  padding: .18em .46em; border-radius: 2px; white-space: nowrap;
  border: 1px solid currentColor;
}
.pill.CR { color: #E4795D; }
.pill.EN { color: var(--amber); }
.pill.VU { color: var(--gold); }
.pill.NT { color: #59A87F; }

.trend { font-family: var(--sans); font-size: .62rem; letter-spacing: .1em; }
.trend.up { color: #59A87F; }
.trend.down { color: #E4795D; }

.scroll-hint {
  position: absolute; left: 50%; bottom: .55rem; transform: translateX(-50%);
  font-family: var(--sans); font-size: .6rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--bone-dim); opacity: .65;
}
@media (max-height: 720px) { .scroll-hint { display: none; } }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: var(--measure); }
.wrap.narrow { max-width: 1140px; }
.wrap.narrow > * { max-width: var(--measure); }
.wrap.narrow > .tbl-scroll { max-width: min(100%, 860px); }
section { padding: clamp(3rem, 8vh, 6rem) 0; }
section + section { border-top: var(--rule); }

.kicker {
  font-family: var(--sans); font-size: .66rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 .75rem;
}
h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.6rem, 3.6vw, 2.5rem); line-height: 1.1;
  letter-spacing: -.018em; margin: 0 0 .85rem; max-width: 22ch;
}
h3 {
  font-family: var(--sans); font-weight: 700; font-size: .82rem;
  letter-spacing: .16em; text-transform: uppercase;
  margin: 2.3rem 0 .7rem; color: var(--bone);
}
p { margin: 0 0 1.05rem; max-width: var(--measure); }
.lede { font-size: 1.12em; color: #DCD2BB; }
.muted { color: var(--bone-dim); }
small, .small { font-family: var(--sans); font-size: .74rem; line-height: 1.6; }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 1px; background: rgba(240,230,206,.13); border: var(--rule); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

.card { background: var(--ink); padding: 1.4rem 1.35rem; }
.card h4 {
  font-family: var(--sans); font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; margin: 0 0 .5rem; color: var(--gold);
}
.card p { margin: 0; font-size: .95rem; }
.card p + p { margin-top: .7rem; }

a.card { text-decoration: none; color: inherit; transition: background .22s; }
a.card:hover { background: var(--ink-2); color: inherit; }

/* rosette explainer */
.rosettes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
@media (max-width: 780px) { .rosettes { grid-template-columns: repeat(2, 1fr); } }
.rosette-fig { text-align: center; text-decoration: none; color: inherit; display: block; }
.rosette-fig:hover { color: inherit; }
.rosette-fig svg { width: 100%; max-width: 138px; margin: 0 auto .8rem; height: auto; }
.rosette-dia { width: 100%; height: auto; display: block; }
.rosette-fig:hover svg .ring { transform: scale(1.06); }
.rosette-fig svg .ring { transform-origin: center; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.rosette-fig strong {
  display: block; font-family: var(--sans); font-size: .74rem;
  letter-spacing: .16em; text-transform: uppercase; margin-bottom: .3rem;
}
.rosette-fig span { display: block; font-size: .88rem; color: var(--bone-dim); }

/* ---------- tables ---------- */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.2rem 0; }
table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .82rem; }
th, td {
  text-align: left; padding: .68rem .8rem;
  border-bottom: 1px solid rgba(240,230,206,.11); vertical-align: top;
}
th {
  font-size: .64rem; letter-spacing: .17em; text-transform: uppercase;
  color: var(--gold); font-weight: 700; white-space: nowrap;
}
tbody tr:hover { background: rgba(240,230,206,.035); }
td em { font-style: italic; color: var(--bone-dim); }

/* ---------- callouts ---------- */
.note {
  border-left: 3px solid var(--gold); background: rgba(201,162,39,.07);
  padding: 1rem 1.15rem; margin: 1.6rem 0; border-radius: 0 3px 3px 0;
}
.note.rust { border-left-color: var(--rust); background: rgba(163,59,36,.1); }
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--bone); }

/* ---------- species hero ---------- */
.species-head { padding: clamp(2.6rem, 8vh, 5rem) 0 clamp(1.6rem,4vh,2.6rem); position: relative; }
.species-head h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.1rem, 6.4vw, 4.2rem); line-height: 1; margin: .2rem 0 .35rem;
  letter-spacing: -.022em;
}
.sci { font-style: italic; color: var(--bone-dim); font-size: 1.05rem; }
.bignum {
  font-family: var(--serif); font-variant-numeric: tabular-nums;
  font-size: clamp(2.8rem, 10vw, 6.6rem); line-height: 1;
  letter-spacing: -.03em; margin: .3rem 0 .2rem; color: var(--bone);
}
.bignum.unknown { font-style: italic; color: var(--bone-dim); font-size: clamp(2rem,7vw,4.4rem); }
.conf {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--bone-dim);
}
.conf i { display: inline-block; width: 46px; height: 5px; border-radius: 3px; background: rgba(240,230,206,.16); position: relative; font-style: normal; }
.conf i::after { content: ""; position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--gold); }
.conf.high i::after { width: 100%; }
.conf.moderate i::after { width: 58%; }
.conf.low i::after { width: 24%; background: var(--amber); }
.conf.none i::after { width: 0; }

/* camera-trap overlay */
.cam { position: relative; isolation: isolate; }
.cam::before, .cam::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.cam::before {
  z-index: 3;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 50%, transparent 42%, rgba(0,0,0,.55) 100%);
}
.cam::after {
  z-index: 4; height: 2px; top: 0; bottom: auto;
  background: linear-gradient(90deg, transparent, rgba(240,230,206,.10), transparent);
  animation: sweep 8s linear infinite;
}
@keyframes sweep { from { transform: translateY(0); } to { transform: translateY(var(--camh, 420px)); } }

.cam-tag {
  position: absolute; z-index: 5; top: .7rem; inset-inline-end: .9rem;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .1em;
  color: rgba(240,230,206,.5);
}
.cam-tag .rec { color: #E4795D; }
.cam-tag .rec::before {
  content: "●"; margin-right: .35em; animation: blink 2s steps(1) infinite;
}
@keyframes blink { 50% { opacity: .15; } }

/* ---------- population pulse ---------- */
.pulse-wrap {
  border: var(--rule); border-radius: 4px; padding: 1.5rem;
  background: rgba(34,31,23,.55);
}
.pulse-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr));
  gap: 9px; margin-bottom: 1.3rem; max-width: 640px;
}
.pulse-grid svg { width: 100%; height: auto; cursor: default; }
.pulse-dot {
  animation: breathe 3s ease-in-out infinite; transform-origin: center;
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.pulse-dot:hover { transform: scale(1.45); }
@keyframes breathe { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .pulse-dot { animation: none; opacity: .85; }
  .cam::after { animation: none; display: none; }
  .cam-tag .rec::before { animation: none; }
}

/* ---------- ask ---------- */
.ask-shell { max-width: 800px; }
.ask-form { display: flex; gap: .55rem; margin: 1.4rem 0 .9rem; }
.ask-form input {
  flex: 1; background: rgba(240,230,206,.05); color: var(--bone);
  border: 1px solid rgba(240,230,206,.22); border-radius: 3px;
  padding: .85rem 1rem; font-family: var(--serif); font-size: 1rem;
}
.ask-form input::placeholder { color: rgba(240,230,206,.36); }
.btn {
  font-family: var(--sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  background: var(--gold); color: var(--ink); border: 1px solid var(--gold);
  padding: .85rem 1.3rem; border-radius: 3px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.btn:hover { background: transparent; color: var(--gold); }
.btn.ghost { background: transparent; color: var(--gold); }
.btn.ghost:hover { background: var(--gold); color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.6rem; }
.chip {
  font-family: var(--sans); font-size: .72rem; color: var(--bone-dim);
  border: 1px solid rgba(240,230,206,.2); background: transparent;
  padding: .42rem .72rem; border-radius: 100px; cursor: pointer; text-align: left;
}
.chip:hover { border-color: var(--gold); color: var(--gold); }

.answer {
  border: var(--rule); border-left: 3px solid var(--gold);
  background: rgba(34,31,23,.6); padding: 1.3rem 1.4rem; border-radius: 0 4px 4px 0;
  margin-bottom: 1.2rem;
}
.answer .q {
  font-family: var(--sans); font-size: .7rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 .7rem;
}
.answer p { max-width: none; }
.answer sup a { text-decoration: none; font-size: .68em; padding: 0 .1em; }
.sources { margin: 1rem 0 0; padding: .9rem 0 0; border-top: var(--rule); }
.sources ol { margin: 0; padding-left: 1.2rem; font-family: var(--sans); font-size: .76rem; color: var(--bone-dim); }
.sources li { margin-bottom: .35rem; }
.sources a { word-break: break-word; }

/* ---------- filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  padding: 1rem 0 1.5rem; border-bottom: var(--rule); margin-bottom: 1.8rem;
}
.filters label {
  font-family: var(--sans); font-size: .62rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--bone-dim); display: block; margin-bottom: .3rem;
}
.filters select {
  background: rgba(240,230,206,.05); color: var(--bone); font-family: var(--sans);
  border: 1px solid rgba(240,230,206,.22); border-radius: 3px;
  padding: .5rem .7rem; font-size: .82rem; min-width: 9rem;
}
.filters select option { background: var(--ink); }

.place {
  border: var(--rule); border-radius: 4px; padding: 1.3rem 1.35rem;
  margin-bottom: 1rem; background: rgba(34,31,23,.45);
}
.place-top { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: baseline; }
.place h3 { margin: 0; font-size: 1.02rem; font-family: var(--serif);
  letter-spacing: 0; text-transform: none; font-weight: 400; }
.place .where { font-family: var(--sans); font-size: .72rem; color: var(--bone-dim); letter-spacing: .08em; }
.place p { font-size: .93rem; margin: .7rem 0 .8rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; }
.tag {
  font-family: var(--sans); font-size: .6rem; letter-spacing: .12em;
  text-transform: uppercase; padding: .24em .55em; border-radius: 2px;
  border: 1px solid rgba(240,230,206,.24); color: var(--bone-dim);
}
.tag.odds-very-high { border-color: #59A87F; color: #59A87F; }
.tag.odds-high { border-color: #7FB58F; color: #7FB58F; }
.tag.odds-moderate-high, .tag.odds-moderate { border-color: var(--gold); color: var(--gold); }
.tag.odds-low-moderate, .tag.odds-low { border-color: var(--amber); color: var(--amber); }
.tag.odds-none { border-color: #E4795D; color: #E4795D; }
.tag.eth-wild-community { border-color: var(--moss); color: #6FB995; }
.tag.eth-captive-conservation { border-color: var(--bone-dim); }

/* ---------- footer ---------- */
footer {
  border-top: var(--rule); padding: 3rem 0 2.4rem; margin-top: 2rem;
  background: rgba(23,21,15,.9);
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }
footer h5 {
  font-family: var(--sans); font-size: .64rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 .8rem;
}
footer ul { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: .8rem; }
footer li { margin-bottom: .45rem; }
footer a { text-decoration: none; color: var(--bone-dim); }
footer a:hover { color: var(--gold); }
.colophon {
  margin-top: 2.4rem; padding-top: 1.4rem; border-top: var(--rule);
  font-family: var(--sans); font-size: .7rem; color: rgba(240,230,206,.42);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; line-height: 1.7;
}

/* floating ask button */
.ask-fab {
  position: fixed; inset-inline-end: clamp(.9rem, 3vw, 1.7rem);
  bottom: clamp(.9rem, 3vw, 1.7rem);
  z-index: 70; display: inline-flex; align-items: center; gap: .55rem;
  background: var(--gold); color: var(--ink); text-decoration: none;
  font-family: var(--sans); font-weight: 700; font-size: .72rem;
  letter-spacing: .16em; text-transform: uppercase;
  padding: .78rem 1.05rem; border-radius: 100px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.ask-fab:hover { color: var(--ink); transform: translateY(-2px); }
body.has-hero .ask-fab { opacity: 0; visibility: hidden;
  transform: translateY(12px); transition: opacity .35s, transform .35s, visibility .35s; }
body.has-hero.past-hero .ask-fab { opacity: 1; visibility: visible; transform: none; }
body[data-page="ask"] .ask-fab { display: none; }
.ask-fab svg { width: 1.05em; height: 1.05em; }
@media (max-width: 560px) { .ask-fab span { display: none; } .ask-fab { padding: .85rem; } }

/* reduced motion / data saver */
@media (prefers-reduced-motion: reduce) {
  .hero-media video { display: none; }
  .hero-media img.poster { display: block !important; }
  .wordmark .mark, .rosette-fig svg .ring { transition: none; }
  .ask-fab { transition: none; }
}
.no-video .hero-media video { display: none; }
.no-video .hero-media img.poster { display: block !important; }

/* ============================================================
   Language bar
   ============================================================ */
.langbar {
  display: flex; gap: 1px; margin-inline-start: .7rem;
  border: 1px solid rgba(240,230,206,.18); border-radius: 3px; overflow: hidden;
  flex: none;
}
.langbar a {
  font-family: var(--sans); font-size: .64rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  color: var(--bone-dim); padding: .42rem .5rem; line-height: 1;
  background: rgba(240,230,206,.03);
}
.langbar a:hover { color: var(--gold); background: rgba(240,230,206,.09); }
.langbar a[aria-current="true"] { color: var(--ink); background: var(--gold); }
.langbar .lg-full { display: none; }
.langbar a[lang="ar"] { font-size: .78rem; letter-spacing: 0; }

/* ============================================================
   The destination map
   ============================================================ */
.map-wrap { margin: 2rem 0 0; padding: 0; }
.map {
  border: var(--rule); border-radius: 4px; overflow: hidden;
  background: #0F0E0A; line-height: 0;
}
.map-svg { width: 100%; height: auto; display: block; }
.map-wrap figcaption {
  display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-items: center;
  padding: .7rem .2rem 0;
}
.map-legend { display: flex; flex-wrap: wrap; gap: .1rem 1rem; }
.lg-item { display: inline-flex; align-items: center; gap: .4rem; }
.lg-item i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.pin { cursor: pointer; }
.pin .pin-halo { opacity: 0; transition: opacity .25s, r .25s; }
.pin .pin-dot { stroke: #0F0E0A; stroke-width: 1.1; transition: r .2s; }
.pin:hover .pin-halo, .pin.is-hot .pin-halo, .pin:focus-visible .pin-halo { opacity: .22; }
.pin:hover .pin-dot, .pin.is-hot .pin-dot, .pin:focus-visible .pin-dot { r: 6; }
.pin:focus-visible { outline: none; }
.pin:focus-visible .pin-dot { stroke: var(--bone); stroke-width: 2; }
.pin.is-off { pointer-events: none; }
.pin.is-off .pin-dot { opacity: .16; r: 2.6; }
.pin.is-off .pin-halo { opacity: 0; }

.place.is-hot { border-color: rgba(201,162,39,.55); background: rgba(46,42,32,.6); }
.place.flash { animation: flash 1.4s ease-out; }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 rgba(201,162,39,.55); }
  100% { box-shadow: 0 0 0 14px rgba(201,162,39,0); }
}
@media (prefers-reduced-motion: reduce) {
  .place.flash { animation: none; border-color: var(--gold); }
  .pin .pin-halo, .pin .pin-dot { transition: none; }
}

.filters-end {
  margin-inline-start: auto; align-self: flex-end;
  display: flex; align-items: center; gap: .8rem;
}

/* ============================================================
   Ask — language affordances
   ============================================================ */
.ask-multi { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.ask-flags {
  font-family: var(--sans); font-size: .62rem; font-weight: 700;
  letter-spacing: .14em; color: var(--gold); white-space: nowrap;
  border: 1px solid rgba(201,162,39,.4); border-radius: 100px; padding: .2rem .6rem;
}
.answer .q { display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; }
.ans-lang {
  font-size: .62rem; letter-spacing: .12em; color: var(--bone-dim);
  border: 1px solid rgba(240,230,206,.22); border-radius: 100px;
  padding: .1rem .5rem; text-transform: none;
}
.answer[dir="rtl"] { text-align: right; }
.answer[dir="rtl"] .sources ol { padding-inline-start: 1.2rem; }

/* species header block */
.sp-head-row { display: flex; gap: 1.6rem; align-items: flex-start; flex-wrap: wrap; }
.sp-head-mark { width: 118px; flex: none; }
.sp-head-body { flex: 1; min-width: min(100%, 320px); }

/* ============================================================
   Right-to-left
   ============================================================ */
[dir="rtl"] body { font-family: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, serif; }
[dir="rtl"] .hero-eyebrow::after {
  background: linear-gradient(270deg, rgba(201,162,39,.55), transparent);
}
[dir="rtl"] .kicker, [dir="rtl"] .hero-eyebrow,
[dir="rtl"] .count-name, [dir="rtl"] .nav, [dir="rtl"] .langbar a,
[dir="rtl"] .wordmark { letter-spacing: 0; }
[dir="rtl"] .wordmark { text-indent: 0; direction: ltr; }
[dir="rtl"] h2 { letter-spacing: 0; }
[dir="rtl"] .count-cell::before { left: auto; right: 0; }
[dir="rtl"] .count-bar span { left: auto; right: 0; }
[dir="rtl"] .conf i::after { inset: 0 0 0 auto; }
[dir="rtl"] .note { border-left: none; border-right: 3px solid var(--gold);
  border-radius: 3px 0 0 3px; }
[dir="rtl"] .note.rust { border-right-color: var(--rust); }
[dir="rtl"] .answer { border-left: none; border-right: 3px solid var(--gold);
  border-radius: 4px 0 0 4px; }
[dir="rtl"] ul, [dir="rtl"] ol { padding-right: 1.3rem; padding-left: 0; }
[dir="rtl"] .sources ol { padding-right: 1.2rem; padding-left: 0; }
[dir="rtl"] .scroll-hint { letter-spacing: 0; }

/* the map is a geographic image: it must not mirror */
[dir="rtl"] .map, [dir="rtl"] .map-svg { direction: ltr; }
[dir="rtl"] .pulse-grid { direction: ltr; }

@media (min-width: 1440px) {
  .langbar .lg-full { display: inline; }
  .langbar .lg-short { display: none; }
  .langbar a { padding: .42rem .62rem; letter-spacing: .06em; }
}
@media (max-width: 900px) {
  .langbar { margin-inline-start: .45rem; }
  .langbar a { padding: .4rem .38rem; font-size: .6rem; }
}
@media (max-width: 640px) {
  .masthead { flex-wrap: wrap; row-gap: .4rem; }
  .langbar { margin-inline-start: auto; }
  .map-wrap { margin-top: 1.4rem; }
}

/* ============================================================
   The conversation
   ============================================================ */
.ask-section { padding-bottom: clamp(2rem, 5vh, 3rem); }

.thread {
  display: flex; flex-direction: column; gap: 1.1rem;
  margin: 1.8rem 0 0;
  max-height: min(64vh, 660px); min-height: 320px;
  overflow-y: auto; overscroll-behavior: contain;
  padding: .2rem .9rem 1.1rem 0;
  scrollbar-width: thin; scrollbar-color: rgba(201,162,39,.4) transparent;
}
.thread::-webkit-scrollbar { width: 8px; }
.thread::-webkit-scrollbar-thumb {
  background: rgba(201,162,39,.35); border-radius: 4px;
}
[dir="rtl"] .thread { padding: .2rem 0 1.1rem .9rem; }

.msg { display: flex; gap: .7rem; align-items: flex-start; max-width: 100%; }
.msg .bubble {
  border-radius: 4px; padding: 1rem 1.15rem;
  border: var(--rule); background: rgba(34,31,23,.62);
  min-width: 0;
}
.msg p { margin: 0 0 .7rem; max-width: 62ch; }
.msg p:last-child { margin-bottom: 0; }

/* what you said */
.msg-you { justify-content: flex-end; }
.msg-you .bubble {
  background: rgba(201,162,39,.11);
  border-color: rgba(201,162,39,.32);
  border-start-end-radius: 0;
  font-family: var(--sans); font-size: .92rem;
  color: #EFE6CF; max-width: 46ch;
}

/* what she said */
.msg-rosette .bubble {
  border-inline-start: 3px solid var(--gold);
  border-start-start-radius: 0;
  flex: 1;
}
.msg-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; margin-top: .15rem;
  background: rgba(201,162,39,.13); border: 1px solid rgba(201,162,39,.34);
  color: var(--gold);
}
.msg-avatar svg { width: 20px; height: 20px; }

/* the thinking beat */
.dots { display: inline-flex; gap: 5px; align-items: center; height: 1.2em; }
.dots i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
  opacity: .35; animation: blip 1.1s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: .16s; }
.dots i:nth-child(3) { animation-delay: .32s; }
@keyframes blip { 30% { opacity: 1; transform: translateY(-3px); } }

/* a misconception headed off before the answer */
.msg-fix, .msg-aside {
  font-family: var(--sans); font-size: .84rem; line-height: 1.6;
  color: var(--bone-dim); border-inline-start: 2px solid rgba(201,162,39,.5);
  padding-inline-start: .8rem; margin-bottom: .85rem !important;
}
.msg-aside { border-inline-start-color: rgba(240,230,206,.25); }

/* how sure she is */
.msg-conf {
  font-family: var(--sans); font-size: .82rem; line-height: 1.6;
  color: var(--bone-dim); display: flex; gap: .55rem; align-items: baseline;
  margin-top: .9rem !important;
}
.conf-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  transform: translateY(1px); background: var(--gold);
}
.conf-dot.conf-high { background: #59A87F; }
.conf-dot.conf-moderate { background: var(--gold); }
.conf-dot.conf-low { background: var(--amber); }
.conf-dot.conf-none { background: #D2604A; }

/* one more thing */
.msg-extra {
  margin-top: 1rem; padding: .85rem 1rem;
  background: rgba(201,162,39,.07); border-radius: 3px;
}
.extra-label {
  font-family: var(--sans); font-size: .62rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 .4rem !important;
}
.msg-extra p { font-size: .94rem; }
.extra-src { font-family: var(--sans); font-size: .74rem; white-space: nowrap; }

/* sources, folded away until wanted */
.msg-src { margin-top: 1rem; border-top: var(--rule); padding-top: .8rem; }
.msg-src summary {
  font-family: var(--sans); font-size: .7rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold); cursor: pointer;
  list-style: none;
}
.msg-src summary::-webkit-details-marker { display: none; }
.msg-src summary::before { content: "▸ "; }
.msg-src[open] summary::before { content: "▾ "; }
.msg-src ol {
  margin: .7rem 0 0; padding-inline-start: 1.2rem;
  font-family: var(--sans); font-size: .76rem; color: var(--bone-dim);
}
.msg-src li { margin-bottom: .35rem; }
.msg-src a { word-break: break-word; }

/* what to ask next */
.msg-next { margin-top: 1.1rem; }
.next-label {
  font-family: var(--sans); font-size: .62rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--bone-dim); margin: 0 0 .5rem !important;
}
.msg-next .chips { margin: 0; }

.ask-form { margin: .9rem 0 0; padding-top: .9rem; border-top: var(--rule); }

@media (prefers-reduced-motion: reduce) {
  .dots i { animation: none; opacity: .7; }
}
@media (max-width: 560px) {
  .msg { gap: .5rem; }
  .msg-avatar { width: 28px; height: 28px; }
  .msg-avatar svg { width: 16px; height: 16px; }
  .msg .bubble { padding: .85rem .95rem; }
  .msg-you .bubble { max-width: 100%; }
}
[dir="rtl"] .msg-src summary::before { content: "◂ "; }
[dir="rtl"] .msg-src[open] summary::before { content: "▾ "; }

/* ============================================================
   The image library
   ============================================================ */
.shots {
  display: grid; gap: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  margin-top: 2.2rem;
}
.shot { margin: 0; }
.shot-btn {
  display: block; width: 100%; padding: 0; border: var(--rule);
  background: var(--ink-2); border-radius: 4px; overflow: hidden;
  cursor: zoom-in; position: relative; line-height: 0;
  transition: border-color .25s, transform .35s cubic-bezier(.2,.8,.2,1);
}
.shot-btn img { width: 100%; height: auto; display: block;
  transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.shot-btn:hover { border-color: rgba(201,162,39,.5); }
.shot-btn:hover img { transform: scale(1.035); }
.shot-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.shot figcaption { padding-top: 1rem; }
.shot figcaption h3 {
  font-family: var(--serif); font-size: 1.06rem; font-weight: 400;
  letter-spacing: 0; text-transform: none; margin: 0 0 .35rem;
}
.shot-look {
  font-family: var(--sans); font-size: .68rem; letter-spacing: .1em;
  color: var(--gold); margin: 0 0 .6rem !important;
}
.shot figcaption p { font-size: .93rem; }

/* ---------- lightbox ---------- */
body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: clamp(.6rem, 3vw, 2rem); }
.lightbox[hidden] { display: none; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(9,8,5,.93);
  backdrop-filter: blur(6px); }
.lb-panel {
  position: relative; z-index: 1; max-width: 1080px; width: 100%;
  max-height: 94vh; overflow: auto; background: var(--ink);
  border: var(--rule); border-radius: 5px;
}
/* the FIGURE is the grid, not the panel — and a figure carries a 40px UA
   margin that quietly breaks any layout you build on top of it */
.lb-fig {
  margin: 0; display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
@media (max-width: 820px) { .lb-fig { grid-template-columns: 1fr; } }
.lb-imgwrap { position: relative; line-height: 0; background: #0F0E0A; }
.lb-img { width: 100%; height: auto; display: block; }
.lb-cap { padding: 1.5rem 1.6rem; align-self: center; }
.lb-title { font-family: var(--serif); font-weight: 400; font-size: 1.35rem;
  letter-spacing: 0; text-transform: none; margin: 0 0 .5rem; }
.lb-look { font-family: var(--sans); font-size: .7rem; letter-spacing: .1em;
  color: var(--gold); margin: 0 0 .9rem; }
.lb-text { font-size: .96rem; margin-bottom: 1.2rem; }
.lb-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.lb-links .btn { font-size: .66rem; padding: .6rem .9rem; }
.lb-btn {
  position: absolute; z-index: 2; width: 42px; height: 42px;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(23,21,15,.8); color: var(--bone);
  border: 1px solid rgba(240,230,206,.24); border-radius: 50%;
  font-size: 1.5rem; line-height: 1; font-family: var(--sans);
}
.lb-btn:hover { background: var(--gold); color: var(--ink); }
.lb-close { top: .6rem; inset-inline-end: .6rem; z-index: 3; }
.lb-prev { top: 50%; inset-inline-start: .6rem; transform: translateY(-50%); }
.lb-next { top: 50%; inset-inline-end: .6rem; transform: translateY(-50%); }
[dir="rtl"] .lb-prev svg, [dir="rtl"] .lb-next svg { transform: scaleX(-1); }

/* ============================================================
   The film
   ============================================================ */
.reel-row {
  display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(1.2rem, 4vw, 2.6rem); align-items: center; margin-top: 2rem;
}
@media (max-width: 720px) { .reel-row { grid-template-columns: 1fr; } }
.reel {
  position: relative; border: var(--rule); border-radius: 5px;
  overflow: hidden; background: #0F0E0A; line-height: 0;
  aspect-ratio: 9 / 16;
}
.reel video, .reel img { width: 100%; height: 100%; object-fit: cover; }
.reel.is-playing video { object-fit: contain; }
.reel-play, .film-play {
  position: absolute; inset: 0; margin: auto; width: max-content; height: max-content;
  display: inline-flex; align-items: center; gap: .6rem; cursor: pointer;
  background: rgba(23,21,15,.78); color: var(--gold);
  border: 1px solid rgba(201,162,39,.5); border-radius: 100px;
  padding: .8rem 1.2rem; font-family: var(--sans); font-weight: 700;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  backdrop-filter: blur(6px);
  transition: background .25s, color .25s, transform .25s;
}
.reel-play svg, .film-play svg { width: 1.15em; height: 1.15em; }
.reel-play:hover, .film-thumb:hover .film-play {
  background: var(--gold); color: var(--ink);
}
.reel-side p { font-size: .98rem; }
.reel-side .btn { margin-inline-end: .5rem; margin-bottom: .5rem; }

.film-strip {
  display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: clamp(1.2rem, 4vw, 2.6rem); align-items: center;
}
@media (max-width: 620px) { .film-strip { grid-template-columns: 1fr; } }
.film-thumb {
  position: relative; display: block; border: var(--rule); border-radius: 5px;
  overflow: hidden; line-height: 0; background: #0F0E0A;
}
.film-thumb img { width: 100%; height: auto; display: block; opacity: .82;
  transition: opacity .3s, transform .5s cubic-bezier(.2,.8,.2,1); }
.film-thumb:hover img { opacity: 1; transform: scale(1.03); }
.film-play { width: max-content; }

@media (max-width: 1000px) { .nav .nav-gal { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .shot-btn, .shot-btn img, .film-thumb img, .reel-play, .film-play {
    transition: none;
  }
}

/* ============================================================
   The home page: the film, the way in, the assistant
   ============================================================ */
body[data-page="home"] { background: #0B0A07; }

/* the film sits behind everything on the page, not inside a hero box */
.home-film {
  position: fixed; inset: 0; z-index: -3; overflow: hidden;
  /* stands in for the video's own `poster`, which only takes one URL */
  background: #0B0A07 url("../img/poster-day.webp") center / cover no-repeat;
}
.home-film video {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  display: block;
}

/* Both films are portrait now, so a phone fills with either and only a wide
   window has to crop. The paw sits a little below centre. */
.is-day .home-film { background-position: center 45%; }
.is-day .home-film video { object-position: center 45%; }

/* The jaguar: a wide window takes a band from 30% down, where the eyes are. */
.is-night .home-film {
  background-image: url("../img/poster-night.webp");
  background-size: cover;
  background-position: center 30%;
}
.is-night .home-film video {
  object-fit: cover;
  object-position: center 30%;
}

/* ---- good night --------------------------------------------------------
   One line, after dark, and nowhere else. */
.home-hello { display: none; }
.is-night .home-hello {
  display: block;
  position: absolute;
  inset-inline: 0;
  bottom: clamp(4.6rem, 14vh, 8rem);
  margin: 0;
  text-align: center;
  font-family: var(--sans);
  font-size: clamp(.62rem, .55rem + .5vw, .76rem);
  letter-spacing: .38em;
  text-transform: uppercase;
  text-indent: .38em;
  color: var(--bone);
  text-shadow: 0 1px 14px rgba(11, 10, 7, .95), 0 0 40px rgba(11, 10, 7, .7);
  opacity: 0;
  animation: hello 1.6s cubic-bezier(.2, .8, .2, 1) .9s forwards;
}
@keyframes hello {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: .92; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .is-night .home-hello { animation: none; opacity: .92; }
}

/* no film at all when the visitor has asked for less motion or less data */
.no-video .home-film video { display: none; }
.home-film::after {
  content: ""; position: absolute; inset: 0;
  /* the text column is left-aligned, so it gets its own scrim — the film
     has bright bokeh frames that would otherwise swallow the headline */
  background:
    linear-gradient(90deg, rgba(11,10,7,.80) 0%, rgba(11,10,7,.52) 42%,
                    rgba(11,10,7,.18) 72%, rgba(11,10,7,.30) 100%),
    linear-gradient(180deg, rgba(11,10,7,.80) 0%, rgba(11,10,7,.30) 24%,
                    rgba(11,10,7,.42) 55%, rgba(11,10,7,.92) 100%),
    radial-gradient(120% 85% at 45% 45%, rgba(11,10,7,0) 28%, rgba(11,10,7,.70) 100%);
}
/* drifting rosettes would be noise on top of film */
body[data-page="home"] #rosette-field { display: none; }

body[data-page="home"] .masthead {
  background: linear-gradient(180deg, rgba(11,10,7,.74), rgba(11,10,7,0));
  backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0;
}

.home-main {
  min-height: calc(100svh - 4.4rem);
  display: grid; align-items: center;
  padding: clamp(1.6rem, 5vh, 3rem) 0;
}
.home-inner { width: 100%; }
.home-main h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 5.4vw, 4.1rem); line-height: 1.03;
  letter-spacing: -.022em; margin: 0 0 clamp(1.6rem, 4vh, 2.6rem);
  max-width: 19ch; text-shadow: 0 2px 40px rgba(0,0,0,.65);
}
.home-main h1 em { font-style: italic; color: var(--gold); }

/* the ways in */
.ways {
  display: grid; gap: 1px; max-width: 760px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: rgba(240,230,206,.15);
  border: 1px solid rgba(240,230,206,.15);
  border-radius: 4px; overflow: hidden;
}
@media (max-width: 620px) { .ways { grid-template-columns: 1fr; } }
.way {
  display: flex; align-items: center; gap: .85rem;
  padding: .95rem 1.1rem; text-decoration: none; color: var(--bone);
  background: rgba(15,14,10,.72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-family: var(--sans); font-size: .82rem; letter-spacing: .1em;
  text-transform: uppercase;
  transition: background .22s ease, color .22s ease;
}
.way:hover, .way:focus-visible { background: var(--gold); color: var(--ink); }
.way-n {
  font-size: .64rem; letter-spacing: .16em; color: var(--gold);
  flex: none; transition: color .22s ease;
}
.way:hover .way-n, .way:focus-visible .way-n { color: var(--ink); }
.way-t { flex: 1; }
.way-go { opacity: .45; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.way:hover .way-go { opacity: 1; transform: translateX(3px); }
[dir="rtl"] .home-film::after {
  background:
    linear-gradient(270deg, rgba(11,10,7,.80) 0%, rgba(11,10,7,.52) 42%,
                    rgba(11,10,7,.18) 72%, rgba(11,10,7,.30) 100%),
    linear-gradient(180deg, rgba(11,10,7,.80) 0%, rgba(11,10,7,.30) 24%,
                    rgba(11,10,7,.42) 55%, rgba(11,10,7,.92) 100%),
    radial-gradient(120% 85% at 55% 45%, rgba(11,10,7,0) 28%, rgba(11,10,7,.70) 100%);
}
[dir="rtl"] .way-go { transform: scaleX(-1); }
[dir="rtl"] .way:hover .way-go { transform: scaleX(-1) translateX(3px); }

/* the assistant, on the doorstep */
.home-ask {
  display: flex; gap: .55rem; max-width: 760px;
  margin: clamp(1.4rem, 3.5vh, 2rem) 0 .7rem;
}
.home-ask input {
  flex: 1; min-width: 0; color: var(--bone);
  background: rgba(15,14,10,.72);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(240,230,206,.22); border-radius: 3px;
  padding: .85rem 1rem; font-family: var(--serif); font-size: 1rem;
}
.home-ask input::placeholder { color: rgba(240,230,206,.4); }
.home-note { max-width: 60ch; margin: 0; }

body[data-page="home"] footer {
  background: transparent; border-top: 1px solid rgba(240,230,206,.12);
  padding: 2.2rem 0 1.8rem; margin-top: 0;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
body[data-page="home"] .ask-fab { display: none; }

/* the count page keeps the camera-trap treatment the home page had */
.count-head {
  padding: clamp(2.6rem, 8vh, 5rem) 0 clamp(2rem, 5vh, 3rem);
  border-bottom: 1px solid rgba(240,230,206,.14);
}

@media (prefers-reduced-motion: reduce) {
  .home-film video { display: none; }
  .home-film img.poster { display: block !important; }
  .way, .way-go, .way-n { transition: none; }
}
.no-video .home-film video { display: none; }
.no-video .home-film img.poster { display: block !important; }

/* ============================================================
   The bar: a mark and a hamburger. No words, at any width.
   ============================================================ */
.masthead {
  justify-content: space-between; gap: .75rem;
  padding: .55rem var(--gutter);
}
.markonly {
  display: inline-flex; width: 34px; height: 34px; color: var(--gold);
  flex: none; transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.markonly svg { width: 100%; height: 100%; }
.markonly:hover { transform: rotate(72deg); }
.markonly:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px;
  border-radius: 50%; }

.burger {
  --bar: 2px;
  position: relative; z-index: 120; flex: none;
  width: 44px; height: 44px; padding: 0; cursor: pointer;
  background: transparent; border: 1px solid rgba(240,230,206,.22);
  border-radius: 3px; display: grid; place-content: center; gap: 6px;
  transition: border-color .2s, background .2s;
}
.burger:hover { border-color: rgba(201,162,39,.6); background: rgba(201,162,39,.08); }
.burger span {
  display: block; width: 20px; height: var(--bar); background: var(--bone);
  border-radius: 2px;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .18s;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.burger[aria-expanded="true"] span { background: var(--gold); }

/* the panel */
body.menu-open { overflow: hidden; }
.menu {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(13,12,8,.97);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  overflow-y: auto; opacity: 0; visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}
.menu.is-open { opacity: 1; visibility: visible; }
.menu-inner {
  min-height: 100%; display: grid; align-content: center;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(1.6rem, 5vw, 4rem);
  padding: clamp(5rem, 12vh, 8rem) var(--gutter) clamp(2.5rem, 8vh, 4rem);
  max-width: 1140px; margin: 0 auto;
}
@media (max-width: 760px) { .menu-inner { grid-template-columns: 1fr; align-content: start; } }

.menu ul { list-style: none; margin: 0; padding: 0; }
.menu-main li { border-bottom: 1px solid rgba(240,230,206,.10); }
.menu-main a {
  display: block; padding: .55rem 0; text-decoration: none;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.5rem, 4.4vw, 2.5rem); line-height: 1.18;
  letter-spacing: -.015em; color: var(--bone);
  transition: color .2s, padding-inline-start .3s cubic-bezier(.2,.8,.2,1);
}
.menu-main a:hover, .menu-main a:focus-visible {
  color: var(--gold); padding-inline-start: .5rem;
}

.menu-side { align-self: center; }
.menu-cats { margin-bottom: 1.6rem; }
.menu-cats li { margin-bottom: .3rem; }
.menu-cats a {
  font-family: var(--sans); font-size: .8rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--bone-dim); text-decoration: none;
}
.menu-cats a:hover { color: var(--gold); }

.menu-langs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1.6rem; }
.menu-langs a {
  font-family: var(--sans); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; text-decoration: none; color: var(--bone-dim);
  border: 1px solid rgba(240,230,206,.2); border-radius: 3px;
  padding: .38rem .6rem;
}
.menu-langs a:hover { color: var(--gold); border-color: rgba(201,162,39,.55); }
.menu-langs a[aria-current="true"] { background: var(--gold); color: var(--ink);
  border-color: var(--gold); }

.menu-minor { margin-bottom: 1.2rem; }
.menu-minor li { margin-bottom: .3rem; }
.menu-minor a {
  font-family: var(--sans); font-size: .78rem; color: var(--bone-dim);
  text-decoration: none;
}
.menu-minor a:hover { color: var(--gold); }
.menu-colophon {
  font-family: var(--sans); font-size: .68rem; line-height: 1.6;
  color: rgba(240,230,206,.42); margin: 0; max-width: 38ch;
}

/* the old inline nav and language bar are gone from the bar */
.masthead .nav, .masthead .langbar { display: none; }

/* the assistant button is now an icon only */
.ask-fab { padding: .9rem; }
.ask-fab svg { width: 1.3em; height: 1.3em; }

/* ============================================================
   Home: the film, edge to edge, and nothing else
   ============================================================ */
body[data-page="home"] .home-film::after {
  /* only enough shade to keep the mark and the hamburger legible */
  background: linear-gradient(180deg, rgba(11,10,7,.55) 0%,
    rgba(11,10,7,.10) 14%, rgba(11,10,7,0) 32%, rgba(11,10,7,.30) 100%);
}
[dir="rtl"] .home-film::after {
  background: linear-gradient(180deg, rgba(11,10,7,.55) 0%,
    rgba(11,10,7,.10) 14%, rgba(11,10,7,0) 32%, rgba(11,10,7,.30) 100%);
}
body[data-page="home"] .home-main { min-height: 100svh; padding: 0; }
body[data-page="home"] { overflow: hidden; }
body[data-page="home"].menu-open { overflow: hidden; }
body[data-page="home"] .masthead { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  .markonly, .burger span, .menu, .menu-main a { transition: none; }
}

/* the masthead creates its own stacking context, so the hamburger's z-index
   is scoped inside it — lift the whole bar above the panel while it is open */
body.menu-open .masthead { z-index: 130; background: transparent; backdrop-filter: none; }
body.menu-open .masthead .markonly { opacity: 0; pointer-events: none; }

/* the mark and the hamburger sit on live video, so give them their own shade
   rather than relying on the frame being dark */
.markonly, .burger {
  filter: drop-shadow(0 1px 6px rgba(0,0,0,.55));
}
body[data-page="home"] .burger {
  background: rgba(13,12,8,.42);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
body[data-page="home"] .markonly::before {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  background: radial-gradient(circle, rgba(13,12,8,.5), rgba(13,12,8,0) 72%);
  z-index: -1;
}
.markonly { position: relative; }

.menu-cats { margin-bottom: 1.9rem; }
.menu-langs { margin-bottom: 1.9rem; }

/* ---------------------------------------------------------------------------
   Credits — we name the organisation instead of linking to it
--------------------------------------------------------------------------- */
.credit {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .1rem .5rem;
  margin: .55rem 0 0;
  font-family: var(--sans);
  font-size: .78rem;
  line-height: 1.5;
  color: var(--bone-dim);
}
.credit-k {
  font-size: .65rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--gold-dim);
  flex: none;
}
.credit-org { color: var(--bone); }
.credit-copy {
  appearance: none;
  border: 1px solid rgba(240, 230, 206, .18);
  background: none;
  color: var(--bone-dim);
  border-radius: 5px;
  padding: 0;
  width: 26px;
  height: 26px;
  min-width: 26px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: color .18s, border-color .18s, background .18s;
  align-self: center;
}
.credit-copy svg { width: 13px; height: 13px; }
.credit-copy:hover,
.credit-copy:focus-visible { color: var(--gold); border-color: var(--gold-dim); }
.credit-copy.is-done { color: #6FB995; border-color: var(--moss); background: rgba(46,107,79,.18); }
.credit-copy.is-fail { color: #E4795D; border-color: var(--rust); }
.credit-copy.is-done::after { content: "\2713"; position: absolute; opacity: 0; }

.cite-org,
.extra-src { color: var(--bone-dim); font-style: italic; }
.msg-src .cite-org { font-style: normal; color: var(--gold-dim); }

.sp-fact .credit,
.card .credit { margin-top: .7rem; }

/* ===========================================================================
   The register — individual animals held by named institutions
   ======================================================================== */
.vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; white-space: nowrap;
  clip: rect(0 0 0 0); clip-path: inset(50%); border: 0;
}

.linkish {
  appearance: none; background: none; border: 0; padding: 0;
  color: var(--gold); font: inherit; font-size: .84rem;
  cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.linkish:hover { color: var(--bone); }

.btn.danger { background: transparent; color: #E4795D; border-color: #A33B24; }
.btn.danger:hover { background: var(--rust); color: var(--bone); border-color: var(--rust); }

/* ---- the public grid --------------------------------------------------- */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.1rem;
}
.res {
  border: var(--rule);
  border-radius: 3px;
  background: rgba(34, 31, 23, .5);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, transform .2s, background .2s;
  display: flex;
  flex-direction: column;
}
.res:hover, .res:focus-visible {
  border-color: rgba(201, 162, 39, .5);
  background: rgba(46, 42, 32, .62);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) { .res:hover { transform: none; } }
.res-photo { position: relative; aspect-ratio: 4 / 3; background: var(--ink-3); }
.res-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-nophoto {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: var(--bone-dim); font-family: var(--serif); font-size: 2.2rem; opacity: .35;
}
.res-body { padding: .85rem .9rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.res-body h3 { margin: 0; font-family: var(--serif); font-size: 1.12rem; }
.res-sp {
  margin: 0; font-family: var(--sans); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--bone-dim);
}
.res-age { margin: .2rem 0 0; font-family: var(--sans); font-size: .92rem; color: var(--gold); }
.res-asof {
  display: block; margin-top: .12rem;
  font-size: .58rem; letter-spacing: .11em; text-transform: uppercase;
  color: var(--bone-dim);
}
.res-born {
  margin: .2rem 0 0; font-family: var(--sans); font-size: .76rem;
  color: var(--bone-dim);
}
.res-where { margin: .25rem 0 .5rem; font-size: .82rem; line-height: 1.45; }
.res-body .tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: auto; padding-top: .4rem; }

/* ---- the detail sheet --------------------------------------------------- */
.rs {
  position: fixed; inset: 0; z-index: 140;
  background: rgba(15, 14, 10, .92);
  overflow-y: auto; padding: clamp(1rem, 4vw, 3rem);
}
body.sheet-open { overflow: hidden; }
.rs-inner {
  max-width: 62rem; margin: 0 auto; position: relative;
  background: var(--ink-2); border: var(--rule); border-radius: 4px;
  padding: clamp(1.2rem, 3vw, 2.2rem);
}
.rs-close {
  position: absolute; inset-block-start: .5rem; inset-inline-end: .5rem;
  appearance: none; background: none; border: 0; color: var(--bone-dim);
  font-size: 1.9rem; line-height: 1; width: 44px; height: 44px; cursor: pointer;
}
.rs-close:hover { color: var(--gold); }
.rs-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
@media (min-width: 760px) { .rs-grid { grid-template-columns: 22rem minmax(0, 1fr); } }
.rs-photo { position: relative; }
.rs-photo img { width: 100%; border-radius: 3px; display: block; }
.rs-text h2 { margin: .1rem 0 .3rem; }
.rs-dl { margin: 1.2rem 0 0; display: grid; gap: 0; }
.rs-row {
  display: grid; grid-template-columns: 12rem minmax(0, 1fr);
  gap: .4rem 1rem; padding: .45rem 0; border-top: var(--rule);
  font-family: var(--sans); font-size: .84rem;
}
.rs-row dt {
  color: var(--bone-dim); font-size: .66rem; letter-spacing: .11em;
  text-transform: uppercase; padding-top: .12rem;
}
.rs-row dd { margin: 0; }
@media (max-width: 560px) { .rs-row { grid-template-columns: 1fr; gap: .1rem; } }
.rs-pledge {
  margin: 1.3rem 0 0; padding: .7rem .9rem;
  border-inline-start: 3px solid var(--moss);
  background: rgba(46, 107, 79, .12);
  font-family: var(--sans); font-size: .8rem; color: var(--bone);
}

/* ===========================================================================
   The keeper's console
   ======================================================================== */
/* an author `display` beats the UA rule for [hidden], so say it once, loudly */
[hidden] { display: none !important; }
.adm-gate { min-height: 60vh; display: grid; align-items: center; }
.gate-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .8rem; }
.gate-form p { flex: 1 0 100%; margin: 0 0 .2rem; color: var(--bone-dim); }
.gate-form input {
  flex: 1 1 16rem; background: var(--ink-3); color: var(--bone);
  border: var(--rule); border-radius: 3px; padding: .62rem .8rem;
  font: inherit; font-family: var(--sans); font-size: .92rem;
}
.gate-form input[aria-invalid="true"] { border-color: var(--rust); }

.adm-stats {
  display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: 1.4rem 0 1.6rem;
  font-family: var(--sans); font-size: .72rem;
}
.adm-stats span {
  border: var(--rule); border-radius: 999px; padding: .22rem .7rem;
  color: var(--bone-dim);
}
.adm-stats span strong { color: var(--bone); font-weight: 700; }
.adm-stats span.is-warn { border-color: rgba(201, 123, 39, .5); color: var(--amber); }
.adm-stats span.is-warn strong { color: var(--amber); }

.adm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
@media (min-width: 940px) {
  .adm-grid { grid-template-columns: 20rem minmax(0, 1fr); align-items: start; }
  .adm-side { position: sticky; top: 5rem; }
}
.adm-side { display: flex; flex-direction: column; gap: .6rem; }
.adm-side input[type="search"] {
  background: var(--ink-3); color: var(--bone); border: var(--rule);
  border-radius: 3px; padding: .55rem .75rem; font-family: var(--sans); font-size: .88rem;
}
.adm-list {
  border: var(--rule); border-radius: 3px; max-height: 34rem; overflow-y: auto;
}
.adm-row {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  appearance: none; background: none; border: 0;
  border-bottom: var(--rule); padding: .6rem .7rem;
  text-align: start; cursor: pointer; color: var(--bone);
  font-family: var(--sans);
}
.adm-row:last-child { border-bottom: 0; }
.adm-row:hover { background: rgba(46, 42, 32, .6); }
.adm-row.is-on { background: rgba(201, 162, 39, .12); }
.adm-row-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--bone-dim); }
.adm-row-dot.sp-jaguar { background: #2E6B4F; }
.adm-row-dot.sp-leopard { background: #C9A227; }
.adm-row-dot.sp-snow-leopard { background: #B7AC93; }
.adm-row-dot.sp-amur-leopard { background: #A33B24; }
.adm-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.adm-row-main strong { font-size: .9rem; font-weight: 600; }
.adm-row-main span { font-size: .7rem; color: var(--bone-dim); }
.adm-state {
  font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .12rem .4rem; border-radius: 2px; border: 1px solid currentColor; flex: none;
}
.adm-state.st-live { color: #6FB995; }
.adm-state.st-edited { color: var(--amber); }
.adm-state.st-draft { color: var(--bone-dim); }

.adm-main fieldset {
  border: var(--rule); border-radius: 3px;
  padding: 1rem 1.1rem 1.2rem; margin: 0 0 1.2rem;
}
.adm-main legend {
  font-family: var(--sans); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold); padding: 0 .4rem;
}
.f-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .9rem 1.1rem; }
.f { display: flex; flex-direction: column; gap: .28rem; margin: 0; }
.f label {
  font-family: var(--sans); font-size: .66rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--bone-dim);
}
.f input, .f select, .f textarea {
  background: var(--ink-3); color: var(--bone); border: var(--rule);
  border-radius: 3px; padding: .5rem .65rem;
  font-family: var(--sans); font-size: .9rem; width: 100%;
}
.f textarea { resize: vertical; line-height: 1.55; font-family: var(--serif); font-size: .95rem; }
.f select option { background: var(--ink); }
.hint {
  font-family: var(--sans); font-size: .72rem; color: var(--bone-dim);
  line-height: 1.5; margin: .2rem 0 0; display: block;
}
fieldset > .hint { margin: -.2rem 0 .9rem; }
.check { font-family: var(--sans); font-size: .86rem; margin: .7rem 0 0; }
.check label { display: flex; gap: .55rem; align-items: flex-start; cursor: pointer; }
.check input { margin-top: .25rem; accent-color: var(--gold); width: 16px; height: 16px; }
.pledge label { color: var(--bone); }
.pledge { padding: .6rem .8rem; border-inline-start: 3px solid var(--moss);
  background: rgba(46, 107, 79, .1); }

.sp-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: .6rem; margin-bottom: 1rem; }
.sp-pick { position: relative; display: block; }
.sp-pick input {
  position: absolute; inset-block-start: 50%; inset-inline-start: 50%;
  width: 1px; height: 1px; opacity: 0; pointer-events: none; margin: 0;
}
.sp-pick-in {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  border: var(--rule); border-radius: 3px; padding: .6rem .4rem;
  cursor: pointer; transition: border-color .18s, background .18s;
  font-family: var(--sans); font-size: .72rem; text-align: center;
}
.sp-pick-in .rosette-dia { width: 42px; height: 42px; }
.sp-pick input:checked + .sp-pick-in {
  border-color: var(--gold); background: rgba(201, 162, 39, .12);
}
.sp-pick input:focus-visible + .sp-pick-in { outline: 2px solid var(--gold); outline-offset: 2px; }

.age-preview {
  margin: 1rem 0 0; font-family: var(--sans); font-size: .84rem; color: var(--bone-dim);
}
.age-preview strong { color: var(--gold); font-size: 1rem; }

.f-photo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 620px) { .f-photo { grid-template-columns: 14rem minmax(0, 1fr); } }
.f-photo-prev {
  aspect-ratio: 4 / 3; border: var(--rule); border-radius: 3px;
  background: var(--ink-3); display: grid; place-items: center; overflow: hidden;
}
.f-photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.f-photo-none { color: var(--bone-dim); font-family: var(--sans); font-size: .74rem; }
.f-drop {
  border: 1px dashed rgba(240, 230, 206, .28); border-radius: 3px;
  padding: 1rem; text-align: center; transition: border-color .18s, background .18s;
}
.f-drop.is-over { border-color: var(--gold); background: rgba(201, 162, 39, .1); }
.f-drop p { margin: 0 0 .6rem; font-family: var(--sans); font-size: .8rem; color: var(--bone-dim); }

.adm-actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.adm-flash {
  position: fixed; inset-block-end: 1rem; inset-inline-start: 50%;
  transform: translate(-50%, 2rem); z-index: 150;
  background: var(--ink-3); border: 1px solid var(--gold-dim); color: var(--bone);
  padding: .6rem 1.1rem; border-radius: 3px; font-family: var(--sans); font-size: .84rem;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  margin: 0; max-width: 90vw; text-align: center;
}
.adm-flash.is-on { opacity: 1; transform: translate(-50%, 0); }
.adm-flash.is-bad { border-color: var(--rust); color: #E4795D; }
[dir="rtl"] .adm-flash { transform: translate(50%, 2rem); }
[dir="rtl"] .adm-flash.is-on { transform: translate(50%, 0); }



.music-btn {
  appearance: none;
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 39, .55);
  background: rgba(23, 21, 15, .86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--gold);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .45);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background .2s, color .2s;
}
.music-btn:hover { transform: translateY(-2px); background: var(--gold); color: var(--ink); }
.music-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.music-btn svg { width: 19px; height: 19px; }

/* the note is the resting state; the bars take over while it plays */
.music .eq { display: none; align-items: flex-end; gap: 2.5px; height: 15px; }
.music .eq i {
  display: block; width: 3px; background: currentColor; border-radius: 1px;
  animation: eqbar .9s ease-in-out infinite;
}
.music .eq i:nth-child(1) { height: 7px;  animation-delay: -.15s; }
.music .eq i:nth-child(2) { height: 14px; animation-delay: -.55s; }
.music .eq i:nth-child(3) { height: 10px; animation-delay: -.35s; }
@keyframes eqbar {
  0%, 100% { transform: scaleY(.35); }
  50%      { transform: scaleY(1); }
}
.music[data-state="on"] .ic-note { display: none; }
.music[data-state="on"] .eq { display: flex; }
.music[data-state="on"] .music-btn { border-color: var(--gold); }

/* still waiting for the visitor to touch the page */
.music.is-waiting .music-btn { animation: musicwait 2.4s ease-in-out infinite; }
@keyframes musicwait {
  0%, 100% { box-shadow: 0 6px 22px rgba(0,0,0,.45), 0 0 0 0 rgba(201,162,39,.42); }
  55%      { box-shadow: 0 6px 22px rgba(0,0,0,.45), 0 0 0 9px rgba(201,162,39,0); }
}

/* the now-playing pill */
.music-now {
  display: flex; align-items: center; gap: .3rem;
  max-width: 0; overflow: hidden;
  opacity: 0;
  border-radius: 100px;
  background: rgba(23, 21, 15, .9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(240, 230, 206, .16);
  transition: max-width .32s cubic-bezier(.2,.8,.2,1), opacity .25s, padding .32s;
  padding: 0;
}
.music.is-open .music-now,
.music:hover .music-now,
.music:focus-within .music-now {
  max-width: 17rem; opacity: 1; padding: .3rem .35rem .3rem .85rem;
}
.music-title {
  font-family: var(--sans); font-size: .7rem; letter-spacing: .05em;
  color: var(--bone); white-space: nowrap;
}
.music-set {
  margin-inline-start: .45rem; color: var(--gold-dim);
  font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
}
.music-skip {
  appearance: none; border: 0; background: none; color: var(--bone-dim);
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
}
.music-skip svg { width: 12px; height: 12px; }
.music-skip:hover { color: var(--gold); background: rgba(201, 162, 39, .14); }

/* nothing to play: say so rather than sit there looking broken */
.music.is-dead .music-btn {
  color: var(--bone-dim); border-color: rgba(240, 230, 206, .22); cursor: default;
}
.music.is-dead .music-btn:hover { transform: none; background: rgba(23, 21, 15, .86); }
.music.is-dead .music-skip { display: none; }
.music.is-dead .music-title { color: var(--bone-dim); white-space: normal; max-width: 14rem; }

/* on the home page the control waits for the hero, like the ask button does */
body.has-hero .music { opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .35s, transform .35s, visibility .35s; }
body.has-hero.past-hero .music { opacity: 1; visibility: visible; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .music-btn, .music-now { transition: none; }
  .music .eq i { animation: none; transform: scaleY(.8); }
  .music.is-waiting .music-btn { animation: none; border-color: var(--bone); }
}
@media (max-width: 560px) {
  .music { bottom: calc(clamp(.9rem, 3vw, 1.7rem) + 3.4rem); }
  .music.is-open .music-now, .music:hover .music-now { max-width: 12rem; }
}

/* where there is no Ask button to stack above, the note takes its place */
body[data-page="home"] .music,
body[data-page="ask"] .music { bottom: clamp(.9rem, 3vw, 1.7rem); }

/* the register form stands alone — no sidebar, no console */
.wrap.narrow-wide { max-width: 58rem; }
.adm-solo fieldset { max-width: none; }
.adm-have { margin-top: 2.4rem; }
.adm-have h3 { margin: 0 0 .7rem; font-size: 1.02rem; }
.adm-have h3 span { color: var(--bone-dim); font-family: var(--sans); font-size: .8rem; }
.adm-edit {
  font-family: var(--sans); font-size: .6rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold-dim); flex: none;
}
.adm-row:hover .adm-edit { color: var(--gold); }
