@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,400..900,0..100,0..1&display=swap');

:root {
  --bark: #241c33;
  --ink: #241c33;
  --paper: #fff8ec;
  --paper-2: #ffeed6;
  --card: #fffdf8;
  --moss: #16796a;
  --moss-dark: #0f5c51;
  --leaf: #7ed957;
  --ember: #d63a1f;
  --ember-bright: #ff5c33;
  --gold: #ffb627;
  --grape: #7b3fe4;
  --sky: #5ec5d6;
  --muted: #6b6280;
  --body: #3b3450;
  --edge: #241c33;
  --line: rgba(36, 28, 51, 0.15);
  --shadow: 4px 4px 0 var(--edge);
  --shadow-sm: 2px 2px 0 var(--edge);
  --radius: 18px;
  --wrap: 1120px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="night"] {
  --bark: #f4ecff;
  --ink: #f4ecff;
  --paper: #17131f;
  --paper-2: #1f1930;
  --card: #241d36;
  --moss: #35c2a5;
  --moss-dark: #5fd8bd;
  --leaf: #7ed957;
  --ember: #ff7a52;
  --ember-bright: #ff7a52;
  --gold: #ffcf5c;
  --grape: #a988ff;
  --sky: #4fb3c7;
  --muted: #a79db8;
  --body: #d9d2e6;
  --edge: #0d0a14;
  --line: rgba(244, 236, 255, 0.18);
  --shadow: 4px 4px 0 var(--edge);
  --shadow-sm: 2px 2px 0 var(--edge);
}

html { color-scheme: light; }
[data-theme="night"] { color-scheme: dark; }

* { box-sizing: border-box; }

/* class-level display rules otherwise beat the UA [hidden] rule */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 140px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}

h1, h2, h3 {
  font-family: var(--serif); line-height: 1.02; margin: 0 0 .5em;
  letter-spacing: -0.02em; font-weight: 800;
  font-variation-settings: "SOFT" 60, "WONK" 1;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
a { color: var(--moss-dark); }

img, svg { max-width: 100%; display: block; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap.narrow { width: min(100% - 2.5rem, 720px); }
.muted { color: var(--muted); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem;
  border-radius: 0 0 8px 8px; transition: top .2s;
}
.skip-link:focus { top: 0; }

:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; border-radius: 4px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: .4rem; flex: none; cursor: pointer;
  padding: .45rem .9rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  font: inherit; font-size: .85rem; font-weight: 500;
}
.theme-toggle:hover { background: var(--paper-2); border-color: var(--moss); }
.theme-icon { font-size: 1rem; line-height: 1; }
[data-theme="night"] .theme-label::after { content: ""; }
.site-nav { display: flex; align-items: center; gap: 1.2rem; }
.site-nav > ul { display: flex; gap: .2rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: .5rem .75rem; border-radius: 999px;
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: .93rem;
}
.site-nav a:hover { background: var(--paper-2); }
.site-nav a.is-current { background: var(--moss); color: var(--paper); }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  background: var(--moss); color: var(--gold); border-radius: 12px;
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; line-height: 1.05; }
.brand-text small { display: block; font-family: var(--sans); font-weight: 500; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line);
  background: transparent; border-radius: 10px; cursor: pointer; order: 3;
}
.bars, .bars::before, .bars::after {
  display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px;
  margin-inline: auto; position: relative; transition: transform .2s;
}
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; }
.bars::after  { top: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: .8rem 1.4rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s, background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--moss); color: var(--paper); box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--moss-dark); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.eyebrow { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ember); font-weight: 700; margin-bottom: .8rem; }
.lede { font-size: 1.1rem; color: var(--body); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.8rem 0 2.4rem; }

.stats { display: flex; flex-wrap: wrap; gap: 2.2rem; margin: 0; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.stats dt { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: .2rem 0 0; font-family: var(--serif); font-size: 1.6rem; font-weight: 700; }

.hero-art {
  position: relative; aspect-ratio: 1; border-radius: 24px;
  background: linear-gradient(170deg, var(--sky), #eef1e2 60%, var(--paper-2));
  box-shadow: var(--shadow); overflow: hidden;
}
.sun { position: absolute; top: 16%; right: 18%; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--gold), rgba(216,163,58,.15) 70%); }
.branch { position: absolute; inset: auto 0 -10% -20%; height: 55%; background: radial-gradient(120% 90% at 20% 100%, var(--moss-dark) 0 40%, transparent 41%); opacity: .85; }
.flock { position: absolute; width: 22px; height: 10px; color: var(--bark); }
.flock::before, .flock::after {
  content: ""; position: absolute; top: 0; width: 11px; height: 10px;
  border-top: 2px solid currentColor; border-radius: 50% 50% 0 0;
}
.flock::before { left: 0; transform: rotate(12deg); }
.flock::after  { right: 0; transform: rotate(-12deg); }
.f1 { top: 22%; left: 14%; animation: drift 9s ease-in-out infinite; }
.f2 { top: 34%; left: 32%; scale: .75; animation: drift 11s ease-in-out infinite .6s; }
.f3 { top: 15%; left: 46%; scale: .6;  animation: drift 13s ease-in-out infinite 1.2s; }
.f4 { top: 44%; left: 20%; scale: .5;  animation: drift 10s ease-in-out infinite .3s; }
.f5 { top: 28%; left: 60%; scale: .45; animation: drift 12s ease-in-out infinite .9s; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(14px, -12px); }
}

/* ---------- sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-tight { padding-top: clamp(1.6rem, 3vw, 2.4rem); }
.section-alt { background: var(--paper-2); }
.section-head { max-width: 60ch; margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---------- page head ---------- */
.page-head { padding: clamp(2rem, 5vw, 3.4rem) 0 clamp(1.2rem, 3vw, 2rem); }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin-bottom: .4rem; }
.page-head .lede { font-size: 1.05rem; color: var(--body); max-width: 58ch; margin: 0; }
.page-head .breadcrumb { color: var(--muted); }
.page-head .breadcrumb a { color: var(--muted); }

/* ---------- on-page sub-nav ---------- */
.subnav {
  position: sticky; top: 68px; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-block: 1px solid var(--line);
}
.subnav-inner { overflow-x: auto; }
.subnav-inner ul {
  display: flex; gap: .3rem; list-style: none; margin: 0; padding: .55rem 0;
  white-space: nowrap;
}
.subnav a {
  display: block; padding: .35rem .85rem; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-size: .88rem; font-weight: 500;
}
.subnav a:hover { color: var(--ink); background: var(--paper-2); }
.subnav a.is-active { background: var(--moss); color: var(--paper); }

/* ---------- sticky guide bar ---------- */
.guidebar {
  position: sticky; top: 68px; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  border-block: 1px solid var(--line);
}
.guidebar-inner {
  display: flex; flex-wrap: wrap; gap: .8rem 1.2rem;
  align-items: center; justify-content: space-between; padding: .75rem 0;
}

/* ---------- hub cards ---------- */
.hub { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.2rem; }
.hub a {
  display: block; height: 100%; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); border-top: 3px solid var(--leaf);
  transition: transform .18s, border-color .18s;
}
.hub a:hover { transform: translateY(-3px); border-top-color: var(--ember); }
.hub h3 { margin-bottom: .35rem; }
.hub p { margin: 0; font-size: .95rem; color: var(--body); }

/* ---------- next links ---------- */
.next-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.next-card {
  display: block; text-decoration: none; color: inherit; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow);
  transition: transform .18s, border-color .18s;
}
.next-card:hover { transform: translateY(-3px); border-color: var(--moss); }
.next-card h2 { font-size: 1.35rem; margin: .2rem 0 .4rem; }
.next-card p { margin: 0; font-size: .95rem; color: var(--body); }
.next-card-img { padding: 0; display: grid; grid-template-columns: 40% 1fr; align-items: stretch; }
.next-card-img img { width: 100%; height: 100%; object-fit: cover; }
.next-card-img > div { padding: 1.5rem; }

/* ---------- back to top ---------- */
.to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 45;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 1.2rem; line-height: 1; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--moss); color: var(--paper); border-color: var(--moss); }

.empty-state { color: var(--muted); font-size: .95rem; padding: 1.5rem 0; }
.patch-actions { display: flex; flex-wrap: wrap; gap: .7rem; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip {
  font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer;
  padding: .45rem 1rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--moss); }
.chip.is-active { background: var(--moss); border-color: var(--moss); color: var(--paper); }
.result-count { font-size: .85rem; color: var(--muted); margin-bottom: 1.6rem; }

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.control-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.field input, .field select {
  font: inherit; font-size: .92rem; color: var(--ink);
  padding: .5rem .9rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  min-width: 190px;
}
.field select { min-width: 0; cursor: pointer; }
.field input:focus, .field select:focus { outline: 2px solid var(--moss); outline-offset: 1px; }

/* ---------- today panels ---------- */
.today { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.4rem; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
#botd { display: grid; grid-template-columns: 40% 1fr; }
#botd img { width: 100%; height: 100%; object-fit: cover; }
.botd-body { padding: 1.5rem; display: flex; flex-direction: column; align-items: flex-start; }
.botd-body h3 { margin: 0 0 .1rem; font-size: 1.5rem; }
.botd-body .latin { font-style: italic; color: var(--muted); font-size: .85rem; margin: 0 0 .7rem; }
.botd-blurb { font-size: .93rem; color: var(--body); margin-bottom: 1.1rem; }

#month-panel { padding: 1.5rem; }
#month-panel h3 { margin: 0 0 .5rem; font-size: 1.5rem; }
.month-note { font-size: .95rem; color: var(--body); }
.month-birds { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.2rem 0 0; padding: 0; }
.month-bird {
  font: inherit; font-size: .88rem; font-weight: 500; cursor: pointer; color: var(--ink);
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .9rem .3rem .3rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent;
}
.month-bird:hover { border-color: var(--moss); }
.month-bird img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }

/* ---------- ear quiz ---------- */
.ear-head { display: flex; justify-content: space-between; gap: 1rem; }
#ear-audio { width: 100%; margin: .8rem 0 .4rem; }
.ear-hint { font-size: .85rem; color: var(--muted); margin: 0 0 .4rem; }
.ear-feedback { min-height: 1.5rem; margin: 0 0 1rem; font-size: .95rem; color: var(--body); }
.ear-feedback.is-right { color: var(--moss-dark); font-weight: 500; }
.ear-feedback.is-wrong { color: var(--ember); font-weight: 500; }

/* ---------- my patch ---------- */
.patch { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.patch-track { height: 10px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.patch-track span { display: block; height: 100%; width: 0; background: var(--moss); border-radius: 999px; transition: width .3s ease; }
.patch-count { font-size: .85rem; color: var(--muted); margin: .5rem 0 1.2rem; }
.patch-list { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; }
.patch-empty { color: var(--muted); font-size: .93rem; }
.patch-item { display: flex; align-items: center; gap: .8rem; padding: .5rem; border: 1px solid var(--line); border-radius: 12px; }
.patch-item img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; }
.patch-item div { display: flex; flex-direction: column; line-height: 1.3; }
.patch-item strong { font-size: .95rem; }
.patch-item span { font-size: .78rem; color: var(--muted); }
.patch-remove {
  margin-left: auto; font: inherit; font-size: .78rem; cursor: pointer;
  color: var(--muted); background: none; border: 0; text-decoration: underline;
}
.patch-remove:hover { color: var(--ember); }

/* ---------- size chart ---------- */
.size-chart, .chorus-chart { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.size-btn, .chorus-btn {
  width: 100%; font: inherit; cursor: pointer; text-align: left;
  display: grid; align-items: center; gap: .8rem;
  padding: .45rem .7rem; border-radius: 10px;
  background: none; border: 1px solid transparent; color: var(--ink);
}
.size-btn { grid-template-columns: 190px 1fr 70px; }
.size-btn:hover, .chorus-btn:hover { background: var(--card); border-color: var(--line); }
.size-name, .chorus-name { font-size: .92rem; font-weight: 500; }
.size-bar { height: 16px; border-radius: 999px; min-width: 4px; }
.size-value, .chorus-value { font-size: .82rem; color: var(--muted); text-align: right; }

/* ---------- dawn chorus ---------- */
.chorus-btn { grid-template-columns: 190px 1fr 110px; }
.chorus-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); padding: 0 .7rem; margin-bottom: .5rem; }
.chorus-track { position: relative; height: 4px; border-radius: 999px; background: var(--paper-2); }
[data-theme="night"] .chorus-track { background: rgba(234,228,216,.14); }
.chorus-track::after {
  content: ""; position: absolute; left: 50%; top: -6px; bottom: -6px;
  width: 2px; background: var(--gold); opacity: .7;
}
.chorus-dot { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--paper); }
.chorus-note { font-size: .84rem; margin-top: 1.2rem; }

/* ---------- bird detail dialog ---------- */
.bird-dialog {
  width: min(100% - 2rem, 620px); max-height: 88vh; padding: 0;
  border: none; border-radius: var(--radius); background: var(--paper);
  color: var(--ink); overflow: hidden; box-shadow: 0 30px 70px -30px rgba(0,0,0,.6);
}
.bird-dialog::backdrop { background: rgba(23, 33, 27, .55); backdrop-filter: blur(3px); }
.bird-dialog[open] { display: flex; flex-direction: column; animation: pop .2s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

#dialog-body { overflow-y: auto; min-height: 0; }

.dialog-close {
  position: absolute; top: .75rem; right: .75rem; z-index: 2;
  width: 38px; height: 38px; border: none; border-radius: 50%; cursor: pointer;
  background: rgba(23,33,27,.6); color: #fff; font-size: 1.4rem; line-height: 1;
}
.dialog-close:hover { background: var(--ink); }

.dialog-hero { width: 100%; height: clamp(180px, 28vh, 260px); object-fit: cover; }
.dialog-head { padding: 1.4rem 1.6rem 0; }
.dialog-head h2 { margin-bottom: .1rem; }
.dialog-head .latin { font-style: italic; color: var(--muted); margin: 0; }
.dialog-song { margin: .6rem 0 0; font-size: .92rem; color: var(--body); }

.dialog-player { margin: 1.3rem 1.6rem 0; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.player-label { margin: 0 0 .6rem; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ember); font-weight: 700; }
.dialog-player audio { width: 100%; height: 40px; }
.player-fallback { margin: 0; font-size: .9rem; }

.dialog-facts { margin: 1.4rem 0 0; padding: 0 1.6rem; display: grid; gap: 1rem; }
.dialog-facts dt {
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ember); font-weight: 700; margin-bottom: .2rem;
}
.dialog-facts dd { margin: 0; font-size: .96rem; }

.dialog-actions { display: flex; flex-wrap: wrap; gap: .7rem; padding: 1.6rem 1.6rem 0; }
.dialog-note { padding: .9rem 1.6rem 1.6rem; margin: 0; font-size: .8rem; color: var(--muted); }

/* ---------- bird grid ---------- */
.bird-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1.2rem;
}
.bird-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; gap: .5rem;
  animation: rise .35s ease both;
  transition: transform .18s, box-shadow .18s;
}
.bird-card:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(42,33,24,.06), 0 18px 34px -20px rgba(42,33,24,.6); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.bird-card > :not(.bird-photo) { padding-inline: 1.3rem; }
.bird-card h3 { margin: 1rem 0 0; }
.bird-open {
  font: inherit; color: inherit; background: none; border: 0; padding: 0;
  cursor: pointer; text-align: left;
}
.bird-open:hover { color: var(--moss-dark); text-decoration: underline; }
.bird-card .latin { font-style: italic; color: var(--muted); font-size: .85rem; margin: 0; }
.bird-card p.blurb { margin: .4rem 0 0; font-size: .95rem; }

.bird-photo { position: relative; margin: 0; aspect-ratio: 4 / 3; }
.bird-photo img { width: 100%; height: 100%; object-fit: cover; }
.bird-photo figcaption {
  position: absolute; right: .5rem; bottom: .5rem;
  background: rgba(23, 33, 27, .72); border-radius: 999px;
  padding: .15rem .6rem; font-size: .68rem; letter-spacing: .03em;
}
.bird-photo figcaption a { color: rgba(255,255,255,.9); text-decoration: none; }
.bird-photo figcaption a:hover { text-decoration: underline; }

.seen-tick {
  position: absolute; top: .6rem; left: .6rem;
  width: 28px; height: 28px; border-radius: 50%;
  display: none; place-items: center;
  background: var(--moss); color: #fff; font-size: .85rem; font-weight: 700;
}
.bird-card.is-seen .seen-tick { display: grid; }
.bird-card.is-seen { border-color: var(--moss); }
.btn.is-on { background: var(--moss-dark); }

.bird-meta { margin-top: auto; padding-top: .9rem; padding-bottom: 1.3rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; font-weight: 700;
  padding: .25rem .6rem; border-radius: 999px; background: var(--paper-2); color: var(--muted);
}
.tag.song { background: rgba(216,163,58,.22); color: #7a5714; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .8rem; }

/* ---------- tips ---------- */
.tips { counter-reset: tip; list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.tips li {
  counter-increment: tip; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.6rem 1.4rem 4.2rem; position: relative;
}
.tips li::before {
  content: counter(tip, decimal-leading-zero);
  position: absolute; left: 1.4rem; top: 1.3rem;
  font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--ember);
}
.tips h3 { margin-bottom: .3rem; }
.tips p { margin: 0; color: var(--body); }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); border-top: 3px solid var(--leaf);
}
.card p { margin: 0; font-size: .96rem; color: var(--body); }
.card-link { border-top-color: var(--ember); }
.card-link p + p { margin-top: .8rem; }
.card-link a { font-weight: 600; text-decoration: none; }
.card-link a:hover { text-decoration: underline; }

/* ---------- quiz ---------- */
.quiz { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.quiz-progress { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; }
.quiz-question { font-size: 1.4rem; }
.quiz-options { display: grid; gap: .6rem; margin: 1.2rem 0; }
.quiz-option {
  font: inherit; text-align: left; cursor: pointer;
  padding: .8rem 1.1rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  transition: border-color .2s, background .2s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--moss); background: var(--card); }
.quiz-option:disabled { cursor: default; opacity: .75; }
.quiz-option.correct { background: rgba(127,168,96,.25); border-color: var(--moss); opacity: 1; }
.quiz-option.wrong { background: rgba(194,89,31,.15); border-color: var(--ember); opacity: 1; }
.quiz-feedback { min-height: 1.5rem; margin: 0 0 1rem; font-size: .95rem; color: var(--body); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--paper-2); padding: 3rem 0 2rem; margin-top: 2rem; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem;
  padding-bottom: 2rem; border-bottom: 1px solid rgba(247,243,233,.14);
}
.site-footer p { margin: 0; font-size: .92rem; }
.footer-brand p:first-child { font-family: var(--serif); font-size: 1.15rem; }
.site-footer h2 {
  font-family: var(--sans); font-size: .74rem; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(247,243,233,.55); margin: 0 0 .7rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-footer li a { color: var(--paper-2); text-decoration: none; font-size: .92rem; }
.site-footer li a:hover { color: var(--gold); text-decoration: underline; }
.site-footer .muted { color: rgba(247,243,233,.6); }
.site-footer a { color: var(--gold); }
.footer-note { padding-top: 1.4rem; }

[data-theme="night"] .site-footer { background: #0e1411; }

/* ---------- nest box page ---------- */
.nestbox-hero { background: linear-gradient(160deg, #2f4632, #46603f 55%, #6d7f47); }
.feeder-hero { background: linear-gradient(160deg, #26424a, #35606a 55%, #5b8a7a); }

.warn {
  background: rgba(194,89,31,.1); border-left: 4px solid var(--ember);
  padding: .9rem 1.2rem; border-radius: 0 10px 10px 0; font-size: .95rem;
}

.diagram {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 2rem;
}
.diagram svg { width: 100%; height: auto; }
.diagram svg text.outside { fill: var(--muted); }

.build { display: grid; grid-template-columns: 1.35fr .65fr; gap: 2rem; align-items: start; }
.build .tips { margin: 0; }
.build-photo {
  margin: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: sticky; top: 92px;
}
.build-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.build-photo figcaption { padding: .9rem 1.1rem 1.2rem; font-size: .88rem; color: var(--muted); }
.build-photo figcaption strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.02rem; margin-bottom: .2rem; }
.build-photo figcaption a { display: inline-block; margin-top: .4rem; font-size: .78rem; }

.table-wrap { overflow-x: auto; }
.holes {
  width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  font-size: .95rem; min-width: 560px;
}
.holes th, .holes td { padding: .9rem 1.1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.holes thead th {
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: var(--paper-2);
}
.holes tbody tr:last-child td { border-bottom: 0; }
.holes td b { font-family: var(--serif); font-size: 1.05rem; white-space: nowrap; }
.holes td:last-child { color: var(--muted); }

/* ---------- pheasant page ---------- */
.page-hero {
  background: linear-gradient(160deg, #43301c, #6d4a22 55%, #a2702c);
  color: var(--paper); padding: clamp(3rem, 8vw, 5.5rem) 0;
}
.page-hero .eyebrow { color: var(--gold); }
.page-hero h1 { color: #fff; }
.page-hero .lede { color: rgba(247,243,233,.86); }
.breadcrumb { font-size: .85rem; margin-bottom: 1.5rem; color: rgba(247,243,233,.7); }
.breadcrumb a { color: rgba(247,243,233,.9); }

.page-hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero-portrait { border-radius: 20px; overflow: hidden; box-shadow: 0 24px 50px -24px rgba(0,0,0,.7); background: #cfe0d2; aspect-ratio: 3 / 2; }
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }

.prose { max-width: 68ch; }
.prose h2 { margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .5rem; }

.pull {
  font-family: var(--serif); font-size: clamp(1.3rem, 2.6vw, 1.8rem); line-height: 1.3;
  border-left: 4px solid var(--ember); padding: .3rem 0 .3rem 1.4rem;
  margin: 2.5rem 0; color: var(--bark);
}
.pull cite { display: block; font-family: var(--sans); font-size: .85rem; font-style: normal; color: var(--muted); margin-top: .8rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; }
.gallery figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery .frame { aspect-ratio: 4 / 3; background: #dfe9dc; }
.gallery .frame img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { padding: .9rem 1.1rem 1.2rem; font-size: .9rem; color: var(--muted); }
.gallery figcaption strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.05rem; margin-bottom: .2rem; }
.gallery figcaption a { display: inline-block; margin-top: .4rem; font-size: .78rem; }

.facts { list-style: none; margin: 2rem 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.facts li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.facts b { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--moss-dark); }
.facts span { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.reasons li {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--ember);
  border-radius: var(--radius); padding: 1.3rem 1.5rem;
}
.reasons h3 { margin-bottom: .3rem; }
.reasons p { margin: 0; color: var(--body); font-size: .96rem; }

.callout {
  background: var(--moss-dark); color: var(--paper); border-radius: var(--radius);
  padding: 2rem 2.2rem; margin-top: 2.5rem;
}
.callout h2 { color: #fff; margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout a { color: var(--gold); }

@media (max-width: 900px) {
  .hero-inner, .page-hero-inner { grid-template-columns: 1fr; }
  .hero-art { max-width: 460px; }
  #botd { grid-template-columns: 1fr; }
  #botd img { height: 220px; }
  .size-btn { grid-template-columns: 120px 1fr 60px; gap: .5rem; }
  .chorus-btn { grid-template-columns: 120px 1fr 92px; gap: .5rem; }
  .build { grid-template-columns: 1fr; }
  .build-photo { position: static; max-width: 420px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .next-card-img { grid-template-columns: 1fr; }
  .next-card-img img { height: 180px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; right: 1.25rem; top: 64px;
    flex-direction: column; align-items: stretch; gap: .6rem; min-width: 210px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; padding: .6rem; box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-nav > ul { flex-direction: column; gap: .1rem; }
  .theme-toggle { justify-content: center; }
  .stats { gap: 1.4rem; }
  .subnav-inner ul { gap: .1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============================================================
   Funk layer — chunky edges, hard shadows, rotating accents.
   Kept last so it overrides the base component styles.
   ============================================================ */

.card, .hub a, .next-card, .panel, .quiz, .patch, .bird-card,
.facts li, .reasons li, .tips li, .diagram, .build-photo,
.gallery figure, .holes, .to-top, .bird-dialog {
  border: 2px solid var(--edge);
  box-shadow: var(--shadow);
}

.bird-dialog { box-shadow: 8px 8px 0 var(--edge); }

/* accent rotation */
.card:nth-child(4n+1), .hub li:nth-child(4n+1) a { border-top: 6px solid var(--ember-bright); }
.card:nth-child(4n+2), .hub li:nth-child(4n+2) a { border-top: 6px solid var(--gold); }
.card:nth-child(4n+3), .hub li:nth-child(4n+3) a { border-top: 6px solid var(--sky); }
.card:nth-child(4n+4), .hub li:nth-child(4n+4) a { border-top: 6px solid var(--grape); }
.next-card:nth-child(odd) { border-bottom: 6px solid var(--ember-bright); }
.next-card:nth-child(even) { border-bottom: 6px solid var(--sky); }

/* buttons */
.btn {
  border: 2px solid var(--edge);
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .82rem;
  font-weight: 700;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--edge); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--edge); }
.btn-ghost { background: var(--card); }
.btn-ghost:hover { background: var(--gold); color: var(--edge); }

/* chips and fields */
.chip, .field input, .field select {
  border: 2px solid var(--edge);
  font-weight: 600;
}
.chip:hover { background: var(--gold); }
.chip.is-active { background: var(--ember-bright); border-color: var(--edge); color: var(--edge); }

/* header and nav */
.site-header { border-bottom: 3px solid var(--edge); }
.brand-mark { border: 2px solid var(--edge); background: var(--gold); color: var(--edge); box-shadow: var(--shadow-sm); }
.brand-text { font-variation-settings: "SOFT" 60, "WONK" 1; }
.site-nav a.is-current { box-shadow: var(--shadow-sm); border: 2px solid var(--edge); }
.theme-toggle { border: 2px solid var(--edge); font-weight: 600; }
.theme-toggle:hover { background: var(--gold); }
.nav-toggle { border: 2px solid var(--edge); }
.subnav, .guidebar { border-block: 2px solid var(--edge); }
.subnav a.is-active { border: 2px solid var(--edge); }

/* eyebrows and section heads */
.eyebrow {
  display: inline-block; color: var(--edge); background: var(--gold);
  border: 2px solid var(--edge); border-radius: 999px;
  padding: .2rem .8rem; font-size: .72rem;
}
.section-head h2::after {
  content: ""; display: block; width: 90px; height: 6px; margin-top: .6rem;
  background: var(--ember-bright); border-radius: 999px;
}

/* hero */
.hero-art { border: 3px solid var(--edge); box-shadow: 10px 10px 0 var(--edge); }
.sun { background: radial-gradient(circle, var(--gold), transparent 70%); }
.stats dd { font-variation-settings: "SOFT" 60, "WONK" 1; }

/* cards and lists */
.bird-card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--edge); }
.bird-photo { border-bottom: 2px solid var(--edge); }
.tag { border: 1.5px solid var(--edge); background: var(--card); color: var(--body); font-weight: 700; }
.tag.song { background: var(--sky); color: var(--edge); }
.seen-tick { border: 2px solid var(--edge); }
.tips li::before { color: var(--ember); font-size: 1.5rem; }
.facts b, .size-name, .chorus-name { font-variation-settings: "SOFT" 60, "WONK" 1; }
.hub a:hover, .next-card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--edge); }

/* charts */
.size-bar, .chorus-dot { border: 2px solid var(--edge); }
.patch-track { border: 2px solid var(--edge); height: 16px; }
.patch-track span { background: var(--ember-bright); }
.quiz-option { border: 2px solid var(--edge); font-weight: 600; }
.quiz-option.correct { background: var(--leaf); }
.quiz-option.wrong { background: var(--ember-bright); color: #fff; }

/* callouts */
.callout { border: 3px solid var(--edge); box-shadow: 8px 8px 0 var(--edge); background: var(--grape); }
.warn { border: 2px solid var(--edge); border-left-width: 8px; background: var(--gold); color: var(--edge); border-radius: 12px; }
.pull { border-left: 8px solid var(--ember-bright); }

/* footer */
.site-footer { background: var(--edge); border-top: 3px solid var(--edge); }
[data-theme="night"] .site-footer { background: #0d0a14; }
.site-footer h2 { font-variation-settings: "SOFT" 60, "WONK" 1; color: var(--gold); }

/* ============================================================
   Tap-a-bird page for pre-readers
   ============================================================ */
.little-body { background: var(--paper); }

.little-header {
  background: var(--gold); border-bottom: 4px solid var(--edge);
  padding: 1.1rem 0; position: sticky; top: 0; z-index: 20;
}
.little-header-inner { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; }
.little-header h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--edge); }
.little-controls { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

.little-say, .little-out {
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
  padding: .6rem 1rem; border-radius: 999px; text-decoration: none;
  border: 2px solid var(--edge); background: var(--card); color: var(--edge);
  box-shadow: var(--shadow-sm);
}
.little-say.is-off { opacity: .5; }
.little-out { background: var(--edge); color: var(--paper); }

.little-hint {
  text-align: center; font-size: 1.15rem; font-weight: 600;
  color: var(--body); margin: 1.6rem auto .4rem; padding-inline: 1rem;
}

.little-grid {
  list-style: none; margin: 0 auto; padding: 1rem;
  width: min(100%, 1200px);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 1rem;
}

.little-tile {
  width: 100%; cursor: pointer; font: inherit; padding: 0; overflow: hidden;
  position: relative; display: block;
  background: var(--card); border: 3px solid var(--edge);
  border-radius: 22px; box-shadow: var(--shadow);
  transition: transform .12s;
}
.little-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.little-name {
  display: block; padding: .7rem .5rem;
  font-family: var(--serif); font-weight: 800; font-size: 1.15rem;
  font-variation-settings: "SOFT" 60, "WONK" 1;
  color: var(--edge); text-align: center; line-height: 1.15;
}
.little-note {
  position: absolute; top: .5rem; right: .5rem;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.2rem;
  background: var(--gold); border: 2px solid var(--edge); color: var(--edge);
}
.little-tile:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--edge); }
.little-tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge); }
.little-tile.is-playing { border-color: var(--ember-bright); animation: wiggle .5s ease-in-out infinite; }
.little-tile.is-playing .little-note { background: var(--ember-bright); }
@keyframes wiggle {
  0%, 100% { transform: rotate(-1.5deg) scale(1.02); }
  50% { transform: rotate(1.5deg) scale(1.02); }
}

.little-footer {
  background: var(--edge); color: var(--paper); text-align: center;
  padding: 1.6rem 0; margin-top: 2rem;
}
.little-footer a { color: var(--gold); }

.simple-toggle.is-on { background: var(--leaf); color: var(--edge); }

/* ============================================================
   Side-by-side comparison
   ============================================================ */
.compare-picker {
  list-style: none; margin: 0 0 1rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: .6rem;
}
.compare-pick {
  font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--ink);
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .9rem .3rem .3rem; border-radius: 999px;
  border: 2px solid var(--edge); background: var(--card);
}
.compare-pick img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.compare-pick:hover:not(:disabled) { background: var(--gold); }
.compare-pick.is-on { background: var(--ember-bright); color: var(--edge); box-shadow: var(--shadow-sm); }
.compare-pick:disabled { opacity: .4; cursor: not-allowed; }

.compare-bar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.compare-count { font-size: .88rem; color: var(--muted); margin: 0; }

.compare-table {
  border-collapse: collapse; width: 100%; min-width: 520px;
  background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius);
  overflow: hidden; font-size: .92rem;
}
.compare-table th, .compare-table td {
  padding: .8rem 1rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.compare-table tbody tr:last-child th, .compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-table thead th { background: var(--paper-2); border-bottom: 2px solid var(--edge); vertical-align: bottom; }
.compare-table thead th img { width: 100%; max-width: 130px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 2px solid var(--edge); margin-bottom: .5rem; }
.compare-name {
  font: inherit; font-family: var(--serif); font-weight: 800; font-size: 1.05rem;
  font-variation-settings: "SOFT" 60, "WONK" 1;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-align: left;
}
.compare-name:hover { color: var(--moss-dark); text-decoration: underline; }
.compare-table tbody th {
  font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; white-space: nowrap;
  background: var(--paper-2);
}
.compare-table td.latin { font-style: italic; color: var(--muted); }
.compare-table audio { width: 100%; min-width: 150px; }

/* keep the row labels visible while scrolling wide comparisons */
.compare-table th[scope="row"], .compare-corner {
  position: sticky; left: 0; z-index: 1;
  border-right: 2px solid var(--edge);
}
.compare-corner { background: var(--paper-2); }

.compare-hint { display: none; font-size: .82rem; color: var(--muted); margin: .7rem 0 0; }

/* needs the extra class to outrank .next-card:nth-child() in the funk layer */
.next-card.little-promo { max-width: 760px; border-bottom: 6px solid var(--gold); }
.little-promo h2 { font-size: 1.6rem; }

@media (max-width: 700px) {
  .compare-hint { display: block; }
  .compare-table { min-width: 460px; font-size: .86rem; }
  .compare-table th, .compare-table td { padding: .6rem .7rem; }
  .compare-table tbody th { font-size: .66rem; letter-spacing: .05em; white-space: normal; max-width: 92px; }
  .compare-table thead th img { max-width: 100px; }
  .compare-pick { font-size: .82rem; padding-right: .7rem; }
  .compare-pick img { width: 30px; height: 30px; }
}

/* dotted paper on the alternating sections */
.section-alt {
  background-color: var(--paper-2);
  background-image: radial-gradient(var(--line) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

/* ============================================================
   Responsive layer
   ============================================================ */

/* panels must be allowed below their minmax floor on narrow screens */
.today { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.bird-grid { grid-template-columns: repeat(auto-fill, minmax(min(255px, 100%), 1fr)); }
.hub, .next-links { grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); }
.cards { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.gallery { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.patch-list { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.facts { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }

@media (max-width: 700px) {
  .wrap { width: min(100% - 2rem, var(--wrap)); }

  /* the filter bar was eating a third of a phone screen */
  .guidebar-inner { padding: .6rem 0; gap: .5rem; }
  .filters {
    flex-wrap: nowrap; overflow-x: auto; margin: 0; padding-bottom: .15rem;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .control-row { width: 100%; gap: .5rem; }
  .control-row .field { flex: 1 1 0; min-width: 0; }
  .field input, .field select { width: 100%; min-width: 0; }

  /* stack the comparison rows so the bars get the full width */
  .size-btn, .chorus-btn {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name value" "bar bar";
    gap: .35rem .6rem; padding: .6rem .7rem;
  }
  .size-name, .chorus-name { grid-area: name; }
  .size-value, .chorus-value { grid-area: value; }
  .size-bar, .chorus-track { grid-area: bar; }
  .size-bar { height: 20px; }
  .chorus-scale { font-size: .68rem; }

  /* tables read better stacked than side-scrolled */
  .holes { min-width: 0; }
  .holes, .holes tbody, .holes tr, .holes td { display: block; width: 100%; }
  .holes thead { display: none; }
  .holes tr { padding: 1rem 1.1rem; border-bottom: 2px solid var(--line); }
  .holes tr:last-child { border-bottom: 0; }
  .holes td { border: 0; padding: 0 0 .45rem; }
  .holes td:last-child { padding-bottom: 0; }
  .holes td b { font-size: 1.2rem; }

  /* comfortable touch targets */
  .chip, .subnav a, .site-nav a { min-height: 42px; display: inline-flex; align-items: center; }
  .btn { padding: .85rem 1.3rem; }

  .section-head { margin-bottom: 1.8rem; }
  .quiz, .patch { padding: 1.2rem; }
  .dialog-head, .dialog-facts, .dialog-actions { padding-inline: 1.1rem; }
  .dialog-player { margin-inline: 1.1rem; }
  .dialog-note { padding-inline: 1.1rem; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .hero-actions .btn, .patch-actions .btn { flex: 1 1 100%; text-align: center; }
  .stats { gap: 1rem 1.6rem; }
  .stats dd { font-size: 1.35rem; }
  .to-top { right: .8rem; bottom: .8rem; }
  .tips li { padding: 1.2rem 1.1rem 1.2rem 3.4rem; }
  .tips li::before { left: 1.1rem; }
  .callout { padding: 1.4rem 1.2rem; box-shadow: 5px 5px 0 var(--edge); }
  .bird-dialog { box-shadow: 5px 5px 0 var(--edge); }
}

@media (max-width: 380px) {
  body { font-size: 16px; }
  .brand-text { font-size: 1rem; }
  .brand-text small { font-size: .65rem; }
  .size-name, .chorus-name { font-size: .86rem; }
}


