:root {
  --paper: #f7f6ee;
  --cream: #f0efe2;
  --ink: #223526;
  --muted: #515b48;
  --line: #dcdccf;
  --accent: #a3492c;
  --serif: Literata, Georgia, serif;
  --sans: Manrope, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--sans); }
[hidden] { display: none !important; }
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.13; }
h2 { font-size: clamp(2.05rem, 4.1vw, 3.45rem); letter-spacing: -.055em; }
h3 { font-size: clamp(1.46rem, 2.3vw, 1.95rem); letter-spacing: -.047em; }
section[id] { scroll-margin-top: 20px; }
.container { width: min(1184px, calc(100% - 104px)); margin-inline: auto; }
.skip { position: fixed; z-index: 5; top: 12px; left: 12px; transform: translateY(-160%); background: white; padding: 8px 14px; }
.skip:focus { transform: none; }

.header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 74px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font: 600 1.4rem/1 var(--serif); letter-spacing: -.045em; text-decoration: none; }
.brand-mark { width: 31px; height: 31px; border-radius: 50%; background: var(--ink); position: relative; display: inline-block; flex: none; }
.brand-mark::before, .brand-mark::after { content: ''; width: 5px; height: 12px; position: absolute; top: 6px; border-radius: 65% 65% 50% 50%; background: var(--paper); }
.brand-mark::before { left: 10px; transform: rotate(-16deg); }
.brand-mark::after { left: 16px; transform: rotate(13deg); }
.brand-mark span { position: absolute; width: 15px; height: 10px; bottom: 6px; left: 8px; border-radius: 56% 56% 52% 52%; background: var(--paper); }
.header nav { display: flex; align-items: center; gap: clamp(18px, 3.4vw, 50px); }
.header nav a, .header-link, .back-top { text-decoration: none; font-weight: 700; font-size: .9rem; }
.header nav a:hover, .back-top:hover { color: var(--accent); }
.header-link { justify-self: end; padding: 8px 18px; border: 1px solid #b7bca9; border-radius: 99px; }
.header-link:hover { background: var(--cream); border-color: var(--ink); }

.hero { display: grid; grid-template-columns: .88fr 1.12fr; margin-top: 29px; min-height: 495px; background: #edeee0; border-radius: 20px; overflow: hidden; }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 46px clamp(28px, 4.1vw, 61px) 54px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 21px; color: var(--muted); font-size: .82rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow span { width: 20px; height: 1px; background: var(--accent); }
h1 { font-size: clamp(3.35rem, 7vw, 6.45rem); line-height: .98; letter-spacing: -.078em; }
h1 em { font-weight: 400; color: #566742; white-space: nowrap; }
.hero-description { max-width: 350px; margin: 26px 0; font-size: 1.08rem; line-height: 1.58; color: var(--muted); }
.button { background: var(--ink); color: #fffdf5; border: 1px solid var(--ink); display: inline-flex; justify-content: center; align-items: center; min-height: 47px; padding: 10px 21px; border-radius: 8px; font-weight: 800; font-size: .91rem; text-decoration: none; cursor: pointer; }
.button:hover { background: #3d5037; }
.hero-picture { position: relative; min-width: 0; min-height: 100%; background: #89904e; }
.hero-picture picture, .hero-picture img { display: block; width: 100%; height: 100%; }
.hero-picture img { position: absolute; inset: 0; object-fit: cover; object-position: 53% 56%; }
.hero-picture figcaption { position: absolute; right: 19px; bottom: 19px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 12px; border-radius: 7px; background: #f7f6ee; padding: 8px 12px; font-weight: 800; font-size: .83rem; }
.hero-picture figcaption span { font: italic 400 .89rem var(--serif); color: var(--muted); }

.section { padding-block: 69px; }
.section-header { margin-bottom: 23px; }
.section-header p { margin-top: 9px; color: var(--muted); }
.species-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.species-card { overflow: hidden; background: #fbfaf4; border: 1px solid var(--line); border-radius: 13px; }
.species-card img { width: 100%; height: auto; aspect-ratio: 1.65; object-fit: cover; background: #d9dbcc; }
.species-card:nth-child(1) img { object-position: 50% 14%; }
.species-card:nth-child(2) img { object-position: 50% 56%; }
.species-card:nth-child(3) img { object-position: 50% 30%; }
.card-copy { padding: 19px 22px 23px; }
.card-copy p { color: var(--muted); }
.card-copy .scientific { margin: 7px 0 13px; color: var(--accent); font: italic 500 .98rem/1.3 var(--serif); }

.comparison { background: #e8ebdf; border-block: 1px solid #dfe3d6; }
.comparison table { width: 100%; border-spacing: 0; overflow: hidden; border: 1px solid #cdd4c6; border-radius: 11px; background: #f8f9f1; text-align: left; table-layout: fixed; }
th, td { padding: 15px 20px; vertical-align: top; }
tr > :first-child { width: 25%; }
thead th { background: #304632; color: #f8f9f1; font-weight: 800; }
tbody th { font-weight: 800; }
td { color: #435343; }
tbody tr + tr > * { border-top: 1px solid #dce1d5; }

.facts { display: grid; grid-template-columns: .8fr 1.2fr; gap: 30px; }
.fact-list { border-top: 1px solid var(--line); }
.fact-list details { border-bottom: 1px solid var(--line); }
.fact-list summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; font-size: 1.04rem; font-weight: 800; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.fact-list summary::after { content: ''; width: .55rem; height: .55rem; flex: none; margin-right: 5px; margin-top: -4px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.fact-list details[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.fact-list p { color: var(--muted); padding: 0 25px 17px 0; }

.quiz { background: #edeee0; border-radius: 16px; display: grid; grid-template-columns: .69fr 1.31fr; gap: 25px; padding: 37px 40px; }
.quiz h2 { font-size: clamp(2rem, 3.7vw, 2.9rem); margin-bottom: 9px; }
[data-progress], [data-feedback] { color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, [data-score] { font-weight: 800; font-size: 1.12rem; margin-bottom: 10px; }
[data-options] { display: grid; gap: 7px; }
[data-options] label { display: flex; align-items: center; gap: 9px; width: fit-content; cursor: pointer; }
[data-options] input { margin: 0; accent-color: var(--ink); width: 1.1rem; height: 1.1rem; flex: none; }
.quiz-actions { margin-top: 15px; }
[data-feedback]:not(:empty) { margin-top: 10px; }
.footer { padding-block: 41px 30px; }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.credits { margin-top: 13px; color: var(--muted); font-size: .88rem; }
.credits summary { cursor: pointer; font-weight: 700; width: fit-content; }
.credits a { text-underline-offset: 2px; }
.credits ul { padding-left: 19px; }

@media (max-width: 960px) {
  .container { width: calc(100% - 60px); }
  .hero { min-height: 420px; }
  .hero-copy { padding: 33px 24px 35px 34px; }
  .hero-description { font-size: 1rem; }
  .species-grid { gap: 13px; }
  .card-copy { padding-inline: 15px; }
}
@media (max-width: 700px) {
  .container { width: calc(100% - 36px); }
  .hero { grid-template-columns: 1fr; margin-top: 17px; }
  .hero-copy { padding: 31px 24px 30px; }
  .eyebrow { margin-bottom: 15px; }
  h1 { font-size: clamp(2.9rem, 13vw, 5.4rem); }
  .hero-description { margin: 16px 0 19px; }
  .hero-picture { aspect-ratio: 1.5; }
  .hero-picture figcaption { right: 11px; bottom: 11px; }
  .section { padding-block: 45px; }
  .species-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts, .quiz { grid-template-columns: 1fr; gap: 18px; }
  .quiz { padding: 23px; }
  th, td { padding: 11px 8px; }
}
@media (max-width: 490px) {
  .header-inner { grid-template-columns: 1fr auto; min-height: 0; padding-block: 13px 10px; gap: 11px; }
  .header nav { grid-column: 1 / -1; grid-row: 2; gap: 23px; }
  .header-link { grid-column: 2; grid-row: 1; padding: 6px 12px; }
  .species-grid { grid-template-columns: 1fr; gap: 15px; }
  .species-card img { aspect-ratio: 1.85; }
  .card-copy { padding: 15px 17px 19px; }
  th, td { overflow-wrap: anywhere; font-size: .89rem; }
  tr > :first-child { width: 28%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
