/* Birds of Central Oklahoma
   Colors: Oklahoma red dirt for actions, the state flag's sky blue for data and a lighter
   sky blue for the logo, plain white paper so the bird photos carry the color. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ink: #16202a;
  --ink-soft: #4b5a68;
  --paper: #ffffff;
  --clay: #a8391d;
  --clay-dark: #852a12;
  --sky: #2b6cb0;
  --sky-pale: #e6eef7;
  --sky-light: #63a4e0;
  --grass: #2c7a31;
  --line: #d4dbe2;
  --gutter: 16px;
  --wide: 76rem;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 1.1875rem;
  line-height: 1.5;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--clay); text-underline-offset: 0.15em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--clay-dark); text-decoration-thickness: 0.14em; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

h1, h2, h3 { line-height: 1.1; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 6.5vw, 4.1rem); letter-spacing: -0.02em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.9em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: var(--gutter); }

.build-note {
  margin: 0; padding: 0.45rem var(--gutter);
  background: var(--ink); color: #fff; font-size: 0.85rem; text-align: center;
}

/* ---------- header and footer ---------- */

.site-header, main, .site-footer {
  max-width: var(--wide);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 0.9rem; padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.25rem; line-height: 1.1;
}
.brand:hover { color: var(--ink); }
.logo { width: 3.4rem; height: auto; fill: var(--sky-light); color: var(--sky-light); flex: none; }

.site-header nav ul { display: flex; flex-wrap: wrap; gap: 0 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-header nav a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 44px; padding: 0 0.75rem;
  color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.site-header nav a:hover { text-decoration: underline; }
.site-header nav a[aria-current] { box-shadow: inset 0 -3px 0 var(--clay); }
.seen-count:not(:empty) {
  min-width: 1.7em; padding: 0 0.4em; border-radius: 1em;
  background: var(--grass); color: #fff; font-size: 0.85rem; text-align: center; line-height: 1.6;
}

main { padding-top: 1.5rem; padding-bottom: 3rem; }

.site-footer {
  padding-top: 1.5rem; padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft); font-size: 0.95rem;
}
.site-footer p { margin-bottom: 0.4em; }

/* ---------- shared bits ---------- */

.page-head { max-width: 46rem; margin-bottom: 2rem; }
.lede { font-size: 1.3rem; color: var(--ink-soft); }
.note, .credit, figcaption { color: var(--ink-soft); font-size: 0.85rem; line-height: 1.4; }
figure { margin: 0; }
figcaption { margin-top: 0.45rem; }
figcaption strong { color: var(--ink); }
.plain-list { padding-left: 1.2rem; }
.plain-list li { margin-bottom: 0.4rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  min-height: 52px; padding: 0 1.25rem;
  border: 2px solid var(--ink); border-radius: 10px;
  background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 800; font-size: 1.1rem; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-icon { width: 1.1rem; height: 1.1rem; flex: none; }

.btn-listen { background: var(--clay); border-color: var(--clay); color: #fff; }
.btn-listen:hover { background: var(--clay-dark); border-color: var(--clay-dark); }
.btn-listen .btn-icon { clip-path: polygon(15% 5%, 95% 50%, 15% 95%); background: currentColor; }
.btn-listen[aria-pressed="true"] .btn-icon { clip-path: polygon(10% 8%, 40% 8%, 40% 92%, 10% 92%, 10% 8%, 60% 8%, 90% 8%, 90% 92%, 60% 92%, 60% 8%); }

.btn-seen .btn-icon { border: 2px solid currentColor; border-radius: 4px; }
.btn-seen[aria-pressed="true"] { background: var(--grass); border-color: var(--grass); color: #fff; }
.btn-seen[aria-pressed="true"] .btn-icon {
  border: 0; border-radius: 0; background: currentColor;
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 37% 70%);
}

.listen { display: inline-flex; flex-direction: column; gap: 0.35rem; }
.progress { display: block; height: 4px; background: var(--sky-pale); border-radius: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; width: var(--p, 0%); background: var(--clay); }

/* ---------- month strip ---------- */

.months {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px;
  list-style: none; margin: 0 0 0.6rem; padding: 1.4rem 0 0;
}
.m { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; position: relative; }
.m .bar {
  width: 100%; height: 76px; background: var(--sky-pale); border-radius: 3px;
  position: relative; overflow: hidden;
}
.m .bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: var(--h); background: var(--sky);
}
.m-rare .bar::after { background: #8fb2d6; }
.m-name { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.m.is-now .bar { outline: 3px solid var(--clay); outline-offset: 1px; }
.m.is-now .m-name { color: var(--clay); }
.m.is-now::before {
  content: "Now"; position: absolute; top: -1.4rem;
  font-size: 0.75rem; font-weight: 800; color: var(--clay); text-transform: none;
}

.months-small { gap: 2px; padding: 0; margin: 0.35rem 0 0; }
.months-small .bar { height: 18px; border-radius: 1px; }
.months-small .m-name { display: none; }
.months-small .m.is-now::before { display: none; }
.months-small .m.is-now .bar { outline-width: 2px; outline-offset: 0; }

/* ---------- tiles ---------- */

.tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 11rem), 1fr));
  gap: 1.5rem 1rem; list-style: none; margin: 0; padding: 0;
}
.tile { position: relative; }
.tile a { color: var(--ink); text-decoration: none; display: block; }
.tile-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sky-pale); }
.tile-name { margin: 0.5rem 0 0.1rem; font-size: 1.1rem; }
.tile a:hover .tile-name { color: var(--clay); text-decoration: underline; }
.tile-season { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }
.seen-badge {
  display: none; position: absolute; top: 0.5rem; left: 0.5rem;
  padding: 0.15rem 0.5rem; background: var(--grass); color: #fff;
  font-size: 0.8rem; font-weight: 800;
}
.tile.is-seen .seen-badge { display: block; }

.family { margin-bottom: 2.5rem; }
.family h2 { font-size: 1.15rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; margin-bottom: 1rem; }

.filters { display: grid; gap: 0.75rem; margin: 0 0 2rem; }
.filters fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.filters legend { font-weight: 800; float: left; margin-right: 0.6rem; padding: 0; }
.filters label { position: relative; }
.filters input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.filters label {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 0.8rem;
  border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 0.95rem;
}
.filters label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: #fff; }
.filters label:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
.filter-count { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- bird page ---------- */

.crumbs { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 1rem; }

.bird-top { display: grid; gap: 1.25rem 2.5rem; margin-bottom: 2.5rem; }
.bird-photo img { width: 100%; max-height: 78vh; object-fit: cover; }
.bird-id h1 { margin-bottom: 0.15rem; }
.sci { font-style: italic; color: var(--ink-soft); margin-bottom: 1rem; }
.season-line { font-size: 1.2rem; }
.now:not(:empty) { display: inline-block; color: var(--clay); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; margin: 1.25rem 0 0.6rem; }
.bird-id h2 { margin-top: 1.75rem; }
.marks { padding-left: 1.4rem; margin: 0; }
.marks li { margin-bottom: 0.5rem; padding-left: 0.2rem; }
.marks li::marker { font-weight: 800; color: var(--clay); }

.bird-body { display: grid; gap: 2.5rem 3rem; margin-bottom: 2.5rem; }
.bird-read { max-width: 40rem; }
.bird-read section + section { margin-top: 2rem; }
.bird-facts section { border-top: 2px solid var(--ink); padding-top: 0.9rem; margin-bottom: 2rem; }
.bird-facts h2 { font-size: 1.2rem; }

.fun p { font-size: 1.5rem; line-height: 1.35; font-weight: 700; max-width: 32ch; }

.size-chart { width: 100%; height: auto; max-height: 11rem; margin-bottom: 0.6rem; }
.size-bird { fill: #c8d1d9; color: #c8d1d9; }
.size-bird.is-match { fill: var(--ink); color: var(--ink); }
.size-label { font-size: 15px; fill: var(--ink-soft); font-family: inherit; }
.size-label.is-match { fill: var(--ink); font-weight: 800; }

.tags { list-style: none; padding: 0; margin: 0 0 0.8rem; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-weight: 700; }
.tags li::before { content: "\2022"; color: var(--sky); margin-right: 0.4rem; }

.looks-like, .more-photos, .sources { border-top: 1px solid var(--line); padding-top: 1.5rem; margin-bottom: 2.5rem; }
.looks-like ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem 2.5rem; }
.looks-like p { margin: 0; }
.more-photos figure { max-width: 34rem; }
.sources ul { padding-left: 1.2rem; font-size: 0.95rem; }

/* ---------- home ---------- */

.home-intro { max-width: 48rem; margin-bottom: 2.5rem; }
.featured { display: grid; gap: 0.75rem 2.5rem; margin-bottom: 3rem; }
.featured h2 { margin: 0; }
.featured-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.featured-name { margin: 0 0 0.6rem; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.featured-name a { color: var(--ink); text-decoration: none; }
.featured-name a:hover { color: var(--clay); text-decoration: underline; }
.featured-fun { font-size: 1.3rem; font-weight: 700; max-width: 34ch; margin: 0; }

.here-now, .gone, .coming { margin-bottom: 3rem; }
.more-link { margin-top: 1.5rem; font-weight: 700; }
.gone-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.gone-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.gone-list a { font-weight: 700; }
.gone-list span { color: var(--ink-soft); }

/* ---------- my birds and about ---------- */

.my-count { font-size: 1.3rem; }
.milestones { list-style: none; padding: 0; margin: 0 0 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.milestones li { padding: 0.35rem 0.8rem; border: 2px dashed var(--line); color: var(--ink-soft); font-weight: 700; font-size: 0.95rem; }
.milestones li.is-done { border-style: solid; border-color: var(--grass); background: var(--grass); color: #fff; }

.prose { max-width: 44rem; }
.prose h2 { margin-top: 2rem; }
.credits { padding-left: 1.2rem; font-size: 0.95rem; }
.credits li { margin-bottom: 0.5rem; }

/* ---------- play ---------- */

.game-list { list-style: none; padding: 0; margin: 0 0 2.5rem; }
.game-list li { border-top: 2px solid var(--ink); padding-top: 0.9rem; max-width: 40rem; }
.game-list h2 { font-size: 1.8rem; margin-bottom: 0.3rem; }
.play-callout { font-size: 1.2rem; }

.game { max-width: 56rem; }
.is-playing .page-head .lede { display: none; }
.is-playing .page-head { margin-bottom: 1rem; }
.levels { display: grid; gap: 0.75rem; }
.level {
  display: grid; gap: 0.2rem; text-align: left; width: 100%;
  padding: 1rem 1.25rem; border: 2px solid var(--ink); border-radius: 10px;
  background: var(--paper); color: var(--ink); font: inherit; cursor: pointer;
}
.level:hover { border-color: var(--clay); }
.level:disabled { opacity: 0.45; cursor: not-allowed; }
.level-name { font-weight: 800; font-size: 1.35rem; }
.level-note { color: var(--ink-soft); }
.level-best:not(:empty) { color: var(--grass); font-weight: 700; font-size: 0.95rem; }

.round-status { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-weight: 700; color: var(--ink-soft); }
.round-status [data-streak]:not(:empty) { color: var(--grass); }
.listen-row { display: grid; gap: 0.4rem; justify-items: start; margin: 0.5rem 0 1.5rem; }
.btn-big { min-height: 64px; padding: 0 1.75rem; font-size: 1.3rem; }
.listen-row .progress { width: min(100%, 20rem); }
.listen-row .progress span { width: 0; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; list-style: none; padding: 0; margin: 0 0 1.25rem; }
.choice {
  display: block; width: 100%; padding: 0; text-align: left;
  border: 3px solid transparent; background: var(--paper); color: var(--ink);
  font: inherit; cursor: pointer;
}
.choice img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sky-pale); }
.choice-name { display: block; padding: 0.4rem 0.2rem 0.2rem; font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.choice:hover:not(:disabled) { border-color: var(--clay); }
.choice:disabled { cursor: default; }
.choice:disabled:not(.is-right):not(.is-wrong) { opacity: 0.55; }
.choice.is-right { border-color: var(--grass); }
.choice.is-right .choice-name { color: var(--grass); }
.choice.is-right .choice-name::before { content: "\2713  "; }
.choice.is-wrong { border-color: var(--clay); }
.choice.is-wrong .choice-name { color: var(--clay); }

.answer:not(:empty) { border-top: 2px solid var(--ink); padding-top: 1rem; }
.answer-head { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.4rem; }
.answer-fun { font-size: 1.2rem; max-width: 40rem; }
.answer .btn { margin-top: 0.5rem; }

.game-end h2 { font-size: clamp(2rem, 6vw, 3.2rem); }
.end-note { font-size: 1.2rem; max-width: 40rem; }
.heard { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.heard li { display: flex; justify-content: space-between; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.heard li.is-right span { color: var(--grass); font-weight: 700; }
.heard li.is-wrong span { color: var(--clay); font-weight: 700; }

/* ---------- bird finder ---------- */

.finder { max-width: 56rem; display: grid; gap: 1.75rem; margin-bottom: 2rem; }
.finder fieldset { border: 0; margin: 0; padding: 0; }
.finder legend { font-weight: 800; font-size: 1.3rem; margin-bottom: 0.6rem; padding: 0; }
.legend-note { font-weight: 400; font-size: 1rem; color: var(--ink-soft); }
.picks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 48px; padding: 0.35rem 0.9rem;
  border: 2px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 700;
}
.pick:hover { border-color: var(--ink-soft); }
.pick:has(input:checked) { border-color: var(--ink); background: var(--ink); color: #fff; }
.pick:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
.pick-size { flex-direction: column; gap: 0.2rem; padding: 0.5rem 0.9rem; }
.pick-size { justify-content: flex-end; }
.pick-size svg { height: auto; fill: currentColor; color: var(--ink); }
.pick-size:has(input:checked) svg { color: #fff; }
.swatch { width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--c); border: 1px solid rgba(0, 0, 0, 0.25); flex: none; }
.finder-month { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-weight: 800; margin: 0; }
.finder-month select { font: inherit; font-weight: 400; min-height: 44px; padding: 0 0.6rem; border: 2px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }

.finder-results { max-width: 56rem; border-top: 2px solid var(--ink); padding-top: 1rem; }
.matches { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.75rem; }
.match a { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; align-items: center; color: var(--ink); text-decoration: none; }
.match img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sky-pale); }
.match-name { display: block; font-weight: 800; font-size: 1.25rem; }
.match a:hover .match-name { color: var(--clay); text-decoration: underline; }
.match-why { display: block; color: var(--ink-soft); }

/* ---------- wider screens ---------- */

@media (min-width: 760px) {
  :root { --gutter: 32px; }
  body { font-size: 1.25rem; }
  .looks-like ul { grid-template-columns: 1fr 1fr; }
  .choices { grid-template-columns: repeat(4, 1fr); }
  .levels { grid-template-columns: repeat(3, 1fr); }
  .match a { grid-template-columns: 10rem 1fr; }
}

@media (min-width: 900px) {
  .bird-top { grid-template-columns: 7fr 5fr; align-items: start; }
  .bird-body { grid-template-columns: 7fr 5fr; }
  .featured { grid-template-columns: 3fr 2fr; align-items: end; }
  .featured h2 { grid-column: 1 / -1; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}

@media print {
  .site-header nav, .build-note, .actions, .filters, .site-footer { display: none; }
}
