:root {
  color-scheme: light;
  --paper: #f6f7f0;
  --ink: #171c14;
  --text-muted: #50564b;
  --line: #d7dbc9;
  --lime: #d9ed9e;
  --lime-soft: #edf4d4;
  --white: #fff;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --title: "Bricolage Grotesque", var(--sans);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid #39682e; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--title); }
p { line-height: 1.6; }
img, svg { display: block; }
[hidden] { display: none !important; }
#figures, #research, .sources li { scroll-margin-top: 24px; }

.page-width { width: min(1120px, calc(100% - 88px)); margin-inline: auto; }
.site-header { min-height: 77px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; gap: 10px; align-items: center; font-weight: 720; font-size: 1rem; text-decoration: none; letter-spacing: -.025em; }
.site-header nav { display: flex; gap: 30px; }
.site-header nav a, .footer > a:last-child { color: var(--text-muted); font-weight: 600; font-size: .94rem; text-decoration: none; }
.site-header nav a:hover, .footer > a:last-child:hover { text-decoration: underline; }
#language {
  appearance: none;
  min-height: 40px;
  padding: 6px 28px 6px 10px;
  border: 1px solid #b7bfaa;
  border-radius: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2350564b' stroke-width='1.5'/%3E%3C/svg%3E") right 9px center / 11px no-repeat;
  color: var(--ink);
  font: 600 .94rem var(--sans);
  cursor: pointer;
}
#language:hover { background-color: var(--lime-soft); }

.hero { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: clamp(24px, 5vw, 82px); padding-block: 67px 75px; }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding-block: 11px; }
.hero h1 { font-size: clamp(4.3rem, 8.15vw, 7.5rem); font-weight: 780; letter-spacing: -.085em; line-height: .87; }
.hero p { max-width: 364px; margin-block: 25px 24px; color: var(--text-muted); font-size: 1.14rem; }
.hero-art { position: relative; overflow: hidden; min-height: 350px; border-radius: 20px; background: var(--lime); }
.hero-art svg { width: 100%; height: 100%; position: absolute; inset: 0; }

.action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 45px; padding: 10px 17px; border: 1px solid transparent; border-radius: 9px; font-size: .94rem; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.primary { background: var(--ink); color: var(--white); }
.primary:hover { background: #394332; }
.secondary { background: transparent; color: var(--ink); border-color: #b7bfaa; }
.secondary:hover { background: var(--lime-soft); }

.gallery-section { border-top: 1px solid var(--line); padding-block: 40px 65px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 10px 32px; }
.section-heading h2 { font-size: clamp(2.3rem, 4vw, 3.8rem); line-height: .99; letter-spacing: -.065em; }
.section-heading p { max-width: 365px; color: var(--text-muted); }
.age-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-block: 28px 30px; }
.age-option { display: grid; gap: 4px; min-height: 74px; padding: 12px 15px; border-radius: 11px; border: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.age-option strong { font-size: 1.02rem; }
.age-option span { color: var(--text-muted); font-size: .875rem; line-height: 1.25; }
.age-option:hover { background: var(--lime-soft); border-color: #a7b875; }
.age-option[aria-pressed="true"] { background: var(--lime); border-color: #8d9d5e; }
.age-option[aria-pressed="true"] span { color: #424a33; }
.group-info { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 20px; }
.group-info h3 { font-size: clamp(1.7rem, 3vw, 2.1rem); letter-spacing: -.05em; }
.group-info p { margin-top: 5px; max-width: 650px; color: var(--text-muted); }
.group-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 27px 29px; }
.figure-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.figure-card { display: grid; min-width: 0; gap: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--white); color: var(--ink); text-align: left; cursor: zoom-in; }
.figure-card:hover { border-color: #788e5b; }
.figure-thumb { display: block; aspect-ratio: 1; }
.figure-thumb svg { width: 100%; height: auto; }
.figure-caption { display: block; padding: 11px 12px; border-top: 1px solid #e5e8dc; background: #fcfcf8; font-size: .94rem; font-weight: 640; }
.figure-card:hover .figure-caption { background: var(--lime-soft); }

.research-section { padding-block: 58px 62px; background: #e9eee0; border-top: 1px solid var(--line); }
.research-heading { align-items: start; margin-bottom: 35px; }
.research-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 40px; }
.research-grid article { border-top: 1px solid #b9c3aa; padding-top: 16px; }
.research-grid h3, .design-guide h3, .sources h3 { margin-bottom: 9px; font-size: 1.42rem; letter-spacing: -.035em; }
.research-grid p, .design-guide p, .sources { color: #424b3d; }
.ref { white-space: nowrap; font-size: .875rem; font-weight: 650; text-underline-offset: 3px; }
.design-guide { margin-top: 34px; padding: clamp(16px, 4vw, 32px); border: 1px solid #c8d1b7; border-radius: 14px; background: var(--paper); }
.design-guide p { max-width: 870px; }
.design-guide p + p { margin-top: 12px; }
table { width: 100%; margin-top: 20px; border-collapse: collapse; text-align: left; table-layout: fixed; font-size: .95rem; line-height: 1.45; }
thead { color: var(--ink); }
thead th:first-child { width: 21%; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child { padding-left: 0; }
tbody td:last-child, thead th:last-child { padding-right: 0; }
tbody tr:last-child > * { border-bottom: 0; }
.sources { margin-top: 34px; }
.sources ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 36px; margin: 13px 0 0; padding-left: 1.4em; line-height: 1.5; font-size: .94rem; }
.sources li { padding-left: .25em; }
.sources li:target { background: var(--lime); }
.sources a { text-decoration-color: #8b977e; text-underline-offset: 3px; }
.sources a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.credit { margin-top: 25px; }
.footer { min-height: 86px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.viewer { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 18px 65px #171c1444; }
.viewer::backdrop { background: #171c14b8; }
.viewer-header, .viewer-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.viewer-header h2 { font-size: clamp(1.25rem, 5vw, 1.7rem); letter-spacing: -.04em; }
.viewer-header p { color: var(--text-muted); font-size: .875rem; }
.viewer-figure { width: min(100%, max(170px, calc(100dvh - 186px))); margin: 12px auto; border: 1px solid var(--line); overflow: hidden; border-radius: 9px; }
.viewer-figure svg { width: 100%; aspect-ratio: 1; }
.viewer-controls button:disabled { opacity: .48; cursor: default; }
.viewer-controls button:disabled:hover { background: transparent; }
.viewer-controls .primary:disabled:hover { background: var(--ink); }
body:has(.viewer[open]) { overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
#print-cards { display: none; }

@media (max-width: 820px) {
  .page-width { width: calc(100% - 48px); }
  .hero { gap: 22px; padding-block: 50px; }
  .hero h1 { font-size: clamp(3.55rem, 8.8vw, 5.3rem); }
  .hero-art { min-height: 300px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading p { max-width: 540px; }
}
@media (max-width: 580px) {
  .page-width { width: calc(100% - 32px); }
  .site-header { min-height: 62px; gap: 12px; }
  .site-header nav { gap: 13px; }
  .site-header nav a { font-size: .875rem; }
  .site-header .wordmark { gap: 6px; font-size: .91rem; }
  .site-header .wordmark img { width: 26px; height: 26px; }
  .hero { grid-template-columns: 1fr; padding-block: 28px 35px; }
  .hero-copy { padding: 4px 0 0; }
  .hero h1 { font-size: clamp(3.4rem, 13.7vw, 5.15rem); }
  .hero p { margin-block: 16px 18px; font-size: 1.02rem; }
  .hero-art { min-height: 0; aspect-ratio: 1.9; border-radius: 13px; }
  .hero-art svg { height: 130%; top: -15%; }
  .gallery-section, .research-section { padding-block: 29px 42px; }
  .age-options { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block: 21px; }
  .gallery { grid-template-columns: 1fr; gap: 20px; }
  .group-info { align-items: start; flex-direction: column; }
  .research-grid, .sources ol { grid-template-columns: 1fr; }
  .research-heading, .research-grid { margin-bottom: 23px; }
  th, td { font-size: .875rem; padding-inline: 5px; }
  thead th:first-child { width: 24%; }
}
@media (max-width: 430px) {
  .site-header { grid-template-columns: 1fr auto; row-gap: 8px; padding-block: 9px 11px; }
  .site-header nav { grid-row: 2; grid-column: 1 / -1; gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@page { size: A4 portrait; margin: 12mm; }
@media print {
  html, body { background: #fff; }
  body > :not(#print-cards) { display: none !important; }
  #print-cards { display: block; }
  .print-sheet { display: grid; grid-template-columns: repeat(2, 88mm); justify-content: center; gap: 4mm; break-after: page; }
  .print-sheet:last-child { break-after: auto; }
  .print-card { border: .2mm solid #aeb0a7; break-inside: avoid; }
  .print-card svg { width: 100%; height: auto; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
