:root {
  color-scheme: light; --ink: #183930; --subtle: #4d6057; --paper: #fbf8ef;
  --canvas: #f3efe3; --line: #d8d0ba; --green: #274c3e; --surface: #fffdf8;
  font-family: "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #94661e; outline-offset: 4px; }
.layout { width: min(1152px, calc(100% - 64px)); margin-inline: auto; }
.masthead { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.brand { font-family: Georgia, serif; font-size: clamp(1rem, 2.5vw, 1.35rem); font-weight: 700; text-decoration: none; }
.languages { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 30px; }
.languages button { border: 0; background: none; padding: 7px 12px; border-radius: 22px; line-height: 1.2; font-size: .88rem; min-height: 35px; }
.languages button[aria-pressed="true"] { background: var(--green); color: white; }
.intro { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(26px, 7vw, 100px); padding: clamp(46px, 7vw, 85px) 0; align-items: center; }
.edition { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 19px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; }
h1 { font-size: clamp(3.25rem, 7.6vw, 7.1rem); letter-spacing: -.059em; font-weight: 700; line-height: .97; margin: 0; }
.intro-copy > p:not(.edition) { font-size: clamp(1rem, 1.8vw, 1.14rem); color: var(--subtle); max-width: 38ch; line-height: 1.64; margin: 25px 0; }
.button { display: inline-flex; gap: 16px; align-items: center; border-radius: 5px; text-decoration: none; min-height: 44px; }
.primary { background: var(--green); color: white; padding: 10px 18px; font-weight: 650; }
.primary:hover { background: #183c2e; }
.intro-figure { margin: 0; background: #e6e9dd; border: 1px solid #ced6c6; padding: clamp(14px, 3vw, 34px); border-radius: 10px; }
.featured { display: block; width: 100%; border: 1px solid #e3ddcb; background: white; padding: 8px; border-radius: 5px; }
.featured img { width: 100%; height: auto; max-height: 355px; object-fit: contain; display: block; }
.intro-figure figcaption { color: var(--subtle); font-size: .88rem; margin-top: 12px; }
.collection { border-top: 1px solid var(--line); padding: 33px 0 45px; scroll-margin-top: 15px; }
.collection-top { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 22px; }
.collection h2 { font-size: clamp(2rem, 4.35vw, 3.35rem); letter-spacing: -.045em; margin: 0 0 9px; }
.collection-top p { color: var(--subtle); margin: 0; }
.search { display: block; width: min(300px, 100%); color: var(--ink); font-weight: 600; font-size: .86rem; }
.search input { display: block; color: var(--ink); background: var(--surface); width: 100%; height: 44px; margin-top: 5px; padding: 5px 11px; border: 1px solid #a5ae9e; border-radius: 5px; font-size: 1rem; }
.birds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(11px, 2vw, 20px); }
.bird-card { text-align: left; background: var(--surface); padding: 9px; display: grid; align-content: start; gap: 11px; min-width: 0; border: 1px solid var(--line); border-radius: 7px; }
.bird-card:hover { border-color: #587864; box-shadow: 0 3px 12px #173c3112; }
.bird-card img { display: block; width: 100%; aspect-ratio: 1; height: auto; object-fit: contain; background: white; border-radius: 3px; }
.bird-info { padding: 0 4px 7px; display: flex; flex-direction: column; gap: 4px; }
.bird-name { font-family: Georgia, serif; font-weight: 700; font-size: clamp(.94rem, 1.7vw, 1.2rem); }
.bird-page { color: var(--subtle); font-size: .8rem; }
.end { padding: 20px 0 29px; border-top: 1px solid var(--line); color: var(--subtle); }
.end p { margin: 0; line-height: 1.5; font-size: .92rem; }
dialog { color: var(--ink); width: min(900px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--paper); }
dialog::backdrop { background: #0c2119b5; }
body:has(dialog[open]) { overflow: hidden; }
.viewer-bar { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; background: var(--paper); border-bottom: 1px solid var(--line); padding: 7px 14px; }
.viewer-bar #position { text-align: center; color: var(--subtle); font-size: .85rem; white-space: nowrap; }
.nav-button { padding: 6px 8px; min-height: 44px; border: 0; background: none; border-radius: 4px; font-weight: 650; font-size: .88rem; }
.nav-button:hover:not(:disabled) { background: #e9edde; }
.nav-button:disabled { color: #718076; opacity: .66; }
.nav-button span[aria-hidden] { font-size: 1.35em; }
.close { font-size: 1.6rem; min-width: 44px; }
.viewer-content { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: clamp(15px, 3vw, 34px); padding: clamp(13px, 3vw, 32px); }
.viewer-art { background: white; padding: 8px; border: 1px solid #e4ddca; border-radius: 6px; }
.viewer-art img { display: block; width: 100%; max-height: 65vh; height: auto; object-fit: contain; }
.viewer-copy h2 { font-size: clamp(1.7rem, 3.7vw, 2.8rem); line-height: 1.02; letter-spacing: -.035em; margin: 0; overflow-wrap: anywhere; }
.viewer-copy #plumage { color: var(--subtle); margin: 10px 0 12px; }
.viewer-copy #color-tip { line-height: 1.6; margin: 14px 0; }
.palette { padding: 0; margin: 16px 0 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.palette li { display: flex; gap: 7px; align-items: center; font-size: .82rem; }
.swatch { border: 1px solid #817861; border-radius: 4px; flex: 0 0 20px; height: 19px; }
.viewer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 16px 0 1px; font-size: .86rem; }
.viewer-links a { text-underline-offset: 3px; }
.empty { color: var(--subtle); }
@media (max-width: 930px) { .birds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .layout { width: calc(100% - 34px); }
  .masthead { min-height: 63px; gap: 8px; }
  .languages button { padding-inline: 8px; font-size: .8rem; min-height: 38px; }
  .intro { grid-template-columns: 1fr; gap: 27px; padding: 33px 0; }
  .intro-figure { width: min(100%, 430px); }
  .featured img { max-height: 270px; }
  .collection-top { display: block; }
  .search { margin-top: 16px; }
  .birds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewer-content { grid-template-columns: 1fr; }
  .viewer-art img { max-height: 53dvh; }
  .viewer-copy { padding: 0 3px 8px; }
  .viewer-copy .edition { margin-bottom: 9px; }
  .viewer-bar { padding-inline: 7px; gap: 3px; }
}
@media (max-width: 345px) { .layout { width: calc(100% - 22px); } .brand { font-size: .9rem; } }

