:root {
  color-scheme: dark;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  color: #fff;
  background: #000;
  --line: #444;
  --muted: #bbb;
}
* { box-sizing: border-box; }
body { margin: 0; background: #000; color: #fff; }
.site-nav { display: flex; align-items: center; gap: 28px; max-width: 1600px; margin: auto; padding: 14px 24px; border-bottom: 1px solid var(--line); font: 14px/1.6 Arial, Helvetica, sans-serif; }
.site-nav > a, .site-nav summary { color: #fff; text-decoration: none; font-weight: 600; }
.site-nav a:hover, .site-nav summary:hover { text-decoration: underline; }
.projects-menu { position: relative; }
.projects-menu summary { cursor: pointer; }
.project-links { position: absolute; top: calc(100% + 10px); left: 0; z-index: 20; width: 260px; max-width: calc(100vw - 112px); max-height: min(480px, 70dvh); overflow-y: auto; background: #111; border: 1px solid #666; padding: 6px; }
.project-links a { display: block; padding: 9px 10px; text-decoration: none; }
.project-links a:hover, .project-links a:focus-visible { background: #292929; }
.project-links [aria-current="page"] { background: #292929; font-weight: bold; }
header { padding: 24px 24px 20px; max-width: 1600px; margin: auto; }
h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.2; font-weight: 600; }
header > a { font-size: 15px; }
a { color: #fff; text-underline-offset: 3px; overflow-wrap: anywhere; }
button, input, output { font: inherit; }
button, input, .view-controls, .plot-footer, .graph-stats, #axis-labels, .graph-controls, aside {
  font-family: Arial, Helvetica, sans-serif;
}
button { cursor: pointer; padding: 7px 10px; border: 1px solid #999; border-radius: 0; background: #000; color: #fff; font-size: 14px; }
button:hover { background: #191919; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; padding: 0 24px 24px; max-width: 1600px; margin: auto; align-items: start; }
.graph-column { min-width: 0; position: sticky; top: 16px; }
.atlas {
  height: calc(100dvh - 332px); min-height: 420px;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: #000; color: #fff; border: 1px solid #999; overflow: hidden;
}
#viewport { grid-row: 2; position: relative; min-height: 0; background: #000; overflow: hidden; }
canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }
#axis-labels span { position: absolute; pointer-events: none; color: #fff; font-size: 12px; white-space: nowrap; }
#loading { position: absolute; top: 42%; left: 12%; right: 12%; padding: 16px; text-align: center; color: #fff; background: #000; border: 1px solid #999; font: 14px/1.5 Arial, sans-serif; }
.view-controls { grid-row: 1; display: flex; flex-wrap: wrap; gap: 12px; padding: 10px; background: #000; border-bottom: 1px solid #999; }
.view-controls button { background: #000; color: #fff; }
.view-controls button:hover { background: #333; }
.atlas button:focus-visible, .atlas canvas:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.segmented { display: flex; }
.segmented button + button { border-left: 0; }
.segmented button.active { background: #fff; color: #000; }
.graph-stats { grid-row: 3; padding: 8px 14px; font-size: 13px; }
.graph-stats strong { font-weight: 600; }
.graph-stats span { padding: 0 6px; }
.plot-footer { grid-row: 4; padding: 2px 14px 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 12px; line-height: 1.5; }
.plot-footer p { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 18px; border-top: 1px dashed #fff; }
.legend .p3 { border-top-style: solid; }
aside { min-width: 0; background: #000; font-size: 14px; line-height: 1.5; }
.explore-controls > label { font-weight: 500; }
.search-wrap { margin: 7px 0 14px; }
input[type=search] { width: 100%; border: 1px solid #999; border-radius: 0; background: #000; color: #fff; padding: 9px; font-size: 14px; }
input::placeholder { color: #aaa; }
#search-results { max-height: 220px; overflow: auto; }
#search-results button { display: block; width: 100%; text-align: left; margin-bottom: 5px; }
#search-results small { display: block; font-size: 12px; color: var(--muted); }
.graph-controls { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px 28px; padding: 16px 0; font-size: 14px; line-height: 1.5; }
.luminance-controls { grid-column: 1; grid-row: 1; }
.filter-controls { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.range-label { display: flex; justify-content: space-between; gap: 12px; margin-top: 0; }
.ranges { display: flex; gap: 14px; margin: 10px 0; }
.ranges label { display: flex; align-items: center; gap: 6px; width: 50%; font-size: 13px; }
input[type=range] { width: 100%; min-width: 0; height: 5px; accent-color: #ddd; cursor: pointer; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: #ddd; }
.check { display: flex; align-items: center; gap: 7px; margin: 0; }
.control-bottom { display: flex; align-items: center; gap: 16px; margin: 0; align-self: center; grid-column: 2; grid-row: 1; }
.control-bottom label { white-space: nowrap; }
.bird-panel { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); overflow-anchor: none; }
#empty-selection p { margin: 0 0 12px; }
#suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
#suggestions button { font-size: 13px; padding: 5px 8px; }
h2 { font: 600 23px/1.25 Georgia, 'Times New Roman', serif; margin: 0 0 5px; }
.bird-heading { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.bird-heading button { padding: 0 7px; font-size: 21px; }
#scientific-name { font-style: italic; margin: 0 0 14px; }
.muted { color: var(--muted); }
figure { margin: 0 0 14px; }
figure img { display: block; width: 100%; height: 200px; object-fit: contain; background: #191919; border: 1px solid #555; }
figcaption { font-size: 12px; margin-top: 6px; line-height: 1.5; }
.selected-color { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#swatch { width: 32px; height: 32px; flex-shrink: 0; border: 1px solid #777; }
.selected-color strong { font: 13px monospace; }
.selected-color small { display: block; font-size: 12px; color: var(--muted); }
#gamut-badge { font-size: 12px; margin-left: auto; max-width: 80px; }
dl { display: grid; grid-template-columns: 86px 1fr; gap: 7px; font-size: 13px; line-height: 1.5; margin: 16px 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.bird-actions { display: flex; gap: 7px; }
.bird-actions button:first-child { flex: 1; }
.sample-navigation { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; margin-top: 12px; }
.sample-navigation button { padding: 3px 10px; }
.source-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13px; margin-top: 16px; }
.about { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font: 14px/1.6 Georgia, 'Times New Roman', serif; }
.about summary { cursor: pointer; }
.note { font-size: 12px; }
#nearby { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
#nearby button { font-size: 12px; padding: 4px 7px; }
[hidden] { display: none !important; }
@media (max-width: 850px) {
  .site-nav { padding: 14px 16px; gap: 24px; }
  header { padding: 20px 16px 16px; }
  main { grid-template-columns: 1fr; padding: 0 16px 20px; gap: 20px; }
  .graph-column { position: static; }
  .atlas { height: 62dvh; min-height: 420px; }
  aside { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .bird-panel { margin: 0; padding: 0; border: 0; }
  .about { grid-column: 1 / -1; margin: 0; }
}
@media (max-width: 520px) {
  h1 { font-size: 26px; }
  header > a { font-size: 14px; }
  .graph-controls { grid-template-columns: 1fr; gap: 10px; }
  .control-bottom { grid-column: 1; grid-row: 2; }
  .filter-controls { grid-row: 3; }
  aside { display: block; }
  .bird-panel { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
  .about { margin-top: 22px; }
  .plot-footer, .graph-stats { padding-left: 10px; padding-right: 10px; }
  .legend { gap: 10px; }
}
