/* The original light palette is the fallback for older browsers. */
:root {
  color-scheme:light dark;
  --ink:light-dark(#29483e,#ecf4eb);
  --sage:light-dark(#476b60,#b5d5be);
  --line:light-dark(#cfdbce,#49675c);
  --body:light-dark(#43544d,#d3e1d6);
  --paper:light-dark(#fdfdfa,#15261f);
  --tint:light-dark(#edf2eb,#20392e);
  --edge:light-dark(#81968a,#88a595);
}
:root[data-theme=dark] { color-scheme:dark }
:root[data-theme=light] { color-scheme:light }
body, header, .skip { background:var(--paper) }
body { overflow-wrap:anywhere }
.bar { gap:16px }
.bar .brand { margin-right:auto }
.bar nav { gap:clamp(16px,2vw,32px) }
.bar nav a { min-height:44px }
.contact, .btn:not(.solid), .menu, #theme { border-color:light-dark(#a7b9ab,#88a595) }
#theme {
  width:44px;
  height:44px;
  flex:none;
  border:1px solid var(--edge);
  border-radius:50%;
  background:transparent;
  display:grid;
  place-items:center;
}
#theme svg { width:20px }
#theme[aria-pressed=true] .moon, #theme[aria-pressed=false] .sun { display:none }
.hero {
  background:linear-gradient(114deg,light-dark(#f7f8f1,#192f26) 15%,light-dark(#eef3e9,#223e32) 63%,light-dark(#e1eadf,#304c40));
}
.btn.solid { color:light-dark(#fff,#15261f) }
.btn.solid:hover { background:light-dark(#375b4f,#b5d5be) }
.btn:not(.solid):hover, #theme:hover, .menu:hover { background:light-dark(#e0e8dc,#20392e) }
.seal { color:#29483e }
.art-caption { color:#15291e; text-shadow:0 0 4px #fff,0 0 8px #fff }
.arch picture { display:block; height:100% }
.arch .portrait { object-position:50% 30% }
.about,.contact-section { background:var(--tint) }
.topic {
  border-color:light-dark(#ced9cc,#49675c);
  background:linear-gradient(135deg,light-dark(#f3f6ee,#20392e),light-dark(#fafbf6,#15261f));
}
.topic:nth-child(2n) {
  background:linear-gradient(135deg,light-dark(#ebf1ea,#263f33),light-dark(#f7f9f5,#192d25));
}
.topic:hover { border-color:#799482 }
.about h1 { font:normal clamp(2.6rem,5vw,4.5rem)/1.12 var(--serif);letter-spacing:-.05em;margin:12px 0 }
details { border-color:light-dark(#bdcbbd,#49675c) }
.topic h2, .article h2 { font-size:1.52rem; margin:20px 0 10px }
.ico { background:light-dark(#dfe9db,#314e40);color:light-dark(#416550,#ecf4eb) }
.article:first-child h2 { font-size:2.25rem }
.article.with-cover:first-child { background:#29483e }
.article img { width:100%;height:140px;object-fit:cover;border-radius:8px }
.article:only-child { grid-column:1/-1 }
.detail h2 { font-size:1.8rem; margin-top:28px }
.detail p,.detail li { line-height:1.8 }
.detail img,video { width:100%;height:auto;border-radius:16px }
video { aspect-ratio:16/9;background:#182920 }
.detail a,.text-link,.social a { text-decoration:underline;text-underline-offset:.23em }
.section-head h1 { font:normal clamp(2.6rem,5vw,4.5rem)/1.12 var(--serif);letter-spacing:-.05em;margin:12px 0 }
.contact-info a, .text-link { min-height:44px;display:inline-flex;align-items:center }
.contact-info>a { display:flex;margin:0;min-height:42px }
.contact-info p { font-size:.94rem }
footer { background:light-dark(#29483e,#102119) }
footer a { min-height:24px }
:focus-visible { outline:3px solid light-dark(#8b5812,#ffd592)!important;outline-offset:4px }
footer :focus-visible { outline-color:#ffd592!important }
@media(max-width:1040px){
  .bar { gap:8px }
  .bar nav { order:4;gap:4px }
  .menu { min-height:44px }
}
@media(max-width:620px){
  .brand small { font-size:.75rem }
}
@media(max-width:440px){
  .menu { font-size:0;width:44px;padding:0 }
  .menu span { font-size:1.1rem }
  .bar.wrap { width:94%;gap:5px }
  .bar .brand { font-size:1.16rem;gap:7px }
  .bar .brand small { letter-spacing:0 }
}
.about .section-head,.contact-section .section-head { margin-bottom:8px }
body { min-height:100vh;display:flex;flex-direction:column }
main { flex:1 }
@supports not (color:light-dark(white,black)){
  :root,:root[data-theme] {
    --ink:#29483e;--sage:#476b60;--body:#43544d;--paper:#fdfdfa;
    --tint:#edf2eb;--line:#cfdbce;--edge:#81968a;color-scheme:light;
  }
  #theme { display:none }
}
@media (min-width:371px) and (max-width:440px) {
  .bar.wrap { width:88% }
  .bar .brand { gap:12px;font-size:1.3rem }
  .bar .brand small { letter-spacing:.045em }
}
@media (max-width:340px) {
  .hero h1 { font-size:4rem }
}

/* Profile records stay inside the existing disclosure panels. */
.record { padding:12px 0 18px;color:var(--body) }
.record + .record { border-top:1px solid var(--line);padding-top:19px }
.record strong,.record span,.record small { display:block }
.record strong { color:var(--ink);font-weight:600;line-height:1.45;margin-bottom:6px }
.record small { font-size:.9rem;margin-bottom:5px }
.record ul { padding-left:1.25rem;margin-bottom:0 }
.record a { color:var(--sage);font-weight:600 }
.social a { display:inline-flex;gap:7px;align-items:center;min-height:44px;text-decoration:none }
.social svg { width:20px;height:20px }
.social a:hover { text-decoration:underline }
.viewing-document { overflow:hidden }
#certificate-viewer {
  width:min(1050px,96vw);
  max-width:96vw;
  height:92vh;
  height:92dvh;
  max-height:96%;
  padding:0;
  border:1px solid var(--line);
  border-radius:16px;
  color:var(--ink);
  background:var(--paper);
}
#certificate-viewer[open] { display:grid;grid-template-rows:auto minmax(100px,1fr) auto }
#certificate-viewer::backdrop { background:#0f221cd6 }
.document-tools { display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px 17px }
.document-tools strong { line-height:1.4;font-weight:600 }
.document-tools button { flex:none;border-radius:24px;border:1px solid var(--edge);padding:7px 15px;min-height:44px;background:var(--tint) }
.document-tools a { text-decoration:underline;line-height:1.3 }
.document-frame { background:var(--tint);overflow:auto;min-width:0;overscroll-behavior:contain }
.document-frame:focus-visible { outline-offset:-4px }
.document-frame img { display:block;width:100%;height:100%;object-fit:contain }
.document-frame.magnified img { width:max(180%,1200px);height:auto }
@media(max-width:620px){
  .document-tools { font-size:.91rem;padding:10px 12px }
  .document-tools button { padding-inline:12px }
}

.art-caption { background:#f5f8f5; color:#29483e; border-radius:30px; padding:5px 12px }
.arch img[src$="aile.webp"] { object-position:62% center }
@media(min-width:901px){
 .hero:has(img[src$="aile.webp"]) .art { position:absolute; inset:0 0 0 40%; margin:0;align-self:stretch }
 .hero:has(img[src$="aile.webp"]) .art:before {display:none}
 .hero:has(img[src$="aile.webp"]) .arch {height:100%;border-radius:0;box-shadow:none;mask-image:linear-gradient(to right,transparent 5%,black 34%)}
 .hero-copy {z-index:1}
 .hero:has(img[src$="aile.webp"]) .seal {left:22%}
}
.article.with-cover picture {display:block;margin:-7px -7px 14px}
.article.with-cover img {display:block;object-position:center 40%}
.article.with-cover:first-child img {height:auto}
.detail .credit {font-size:.88rem}
.detail ul {padding-left:1.3em}
.detail li {margin-bottom:.65em}

.topic picture {display:block;margin:-9px -9px 0}
.topic picture img {display:block;width:100%;height:auto;aspect-ratio:1.85;object-fit:cover;object-position:center 38%;border-radius:10px}
.topic picture + .ico {position:relative;margin-top:-19px;box-shadow:0 0 0 3px var(--paper)}
.family-block {background:var(--tint);padding:clamp(28px,5vw,64px) 0}
.family-block .two {align-items:start;padding-block:0}
.family-block h2 {margin:.3em 0}
.family-block p {color:var(--body);line-height:1.65}
.family-block summary {min-height:44px;cursor:pointer}
.family-block a,.reader a {text-decoration:underline}
.reader {display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
.reader button,.reader a,.finder input {font:inherit;color:var(--ink);background:var(--paper);border:1px solid var(--edge);border-radius:10px;min-height:44px;padding:8px 12px}
.reader button {cursor:pointer}
.reader [hidden],.finder[hidden] {display:none}
.read-large .reading p {font-size:1.25em}
.read-largest .reading p {font-size:1.5em}
.crumb {margin:0 0 1rem;font-size:.9rem}
.finder input {width:min(100%,30rem)}
.finder li {padding:.35em}
@media print {header,footer,.reader,.crumb,.skip,.finder {display:none!important}.detail {max-width:none}.detail picture{display:none}}

/* Visitor paths, search and article navigation. */
.start-here {padding-block:clamp(1.75rem,5vw,3.75rem) 0}
.start-here h2 {font-size:clamp(1.55rem,3vw,2.1rem);margin:0 0 1rem}
.start-links {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));gap:.8rem}
.start-links a {display:grid;gap:.15rem;padding:1rem 1.15rem;border:1px solid var(--line);border-radius:1rem;background:var(--tint)}
.start-links strong {font-size:1.05rem}
.start-links a:hover strong,.start-links a:focus-visible strong {text-decoration:underline;text-underline-offset:.2em}
.start-links span {color:var(--body);font-size:.95rem}
.finder {margin:1rem 0 2rem;padding:clamp(1rem,3vw,1.5rem);border:1px solid var(--line);border-radius:1rem;background:var(--tint)}
.finder-fields {display:grid;grid-template-columns:minmax(0,3fr) minmax(9rem,1fr);gap:.75rem}
.finder label {display:grid;gap:.25rem;font-weight:600}
.finder input,.finder select {width:100%;max-width:none}
.finder select {font:inherit;color:var(--ink);background:var(--paper);border:1px solid var(--edge);border-radius:10px;min-height:44px;padding:.45rem .7rem}
.finder :is(select,input):focus-visible {outline:3px solid var(--sage);outline-offset:2px}
.finder [role=status] {margin:.65rem 0 0;min-height:1.5em}
.finder ul {padding:0;margin:.4rem 0 0;list-style:none}
.finder li {display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;padding:.35rem 0;border-top:1px solid var(--line)}
.finder li a {display:flex;align-items:center;min-height:44px;padding:.35rem 0;text-decoration:underline;text-underline-offset:.2em}
.finder li span {font-size:.875rem;color:var(--sage)}
.reading-toc {display:block;margin:1.25rem 0;padding:.75rem 1rem;border:1px solid var(--line);border-radius:.8rem;background:var(--tint)}
.reading-toc summary {align-content:center;min-height:44px;cursor:pointer;font-weight:600}
.reading-toc ul {margin:.5rem 0 0;padding-inline-start:1.25rem}
.reading-toc a {display:inline-block;min-height:24px;padding-block:.2em;text-decoration:underline;text-underline-offset:.2em}
@media (max-width:560px) {.finder-fields{grid-template-columns:1fr}}
@media print {.reading-toc{display:none!important}}

.family-quick {padding-inline-start:1.4rem}
.family-quick a {display:inline-flex;align-items:center;min-height:44px;text-decoration:underline;text-underline-offset:.2em}

.family-print .activity-download .btn {display:inline-flex;min-height:44px;white-space:normal}
.family-print .activity-card {border-block-start:1px solid var(--line);padding-block:1rem;margin-block:1rem}
.family-print .activity-card h2 {margin-block:0 .5rem}
@media print {
  .family-print {color:#111;background:white;width:auto;margin:0}
  .family-print .activity-download {display:none}
  .family-print .activity-card {break-inside:avoid}
  .family-print .reading a {text-decoration:underline}
}

.finder-feedback {display:flex;align-items:center;flex-wrap:wrap;gap:.35rem .8rem}
.finder-feedback button {font:inherit;color:var(--ink);background:var(--paper);border:1px solid var(--edge);border-radius:10px;min-height:44px;padding:.4rem .8rem}

/* V4 · shared editorial rhythm and family resources */
.hero-inner {padding-block:clamp(2.8rem,6vw,6rem)}
.hero-copy p {max-width:42ch}
.hero .arch {border-radius:46% 46% 1.4rem 1.4rem / 37% 37% 1.4rem 1.4rem}
.hero .art:before {border-radius:inherit;border:0}
.hero .arch img {object-position:52% 42%}
.section-head h1,.workshop h1 {font:normal clamp(2.5rem,5vw,4.6rem)/1.08 var(--serif);letter-spacing:-.044em;max-width:22ch}
.start-links a {padding:1.15rem .5rem;border:0;border-top:1px solid var(--edge);border-radius:0;background:transparent}
.finder li[hidden],.exercise[hidden],.filters[hidden],.play-area[hidden] {display:none}
.topic picture img,.article picture img {transition:filter .2s}
.topic:hover picture img,.article:hover picture img {filter:brightness(1.04)}
.about .record {padding-inline-start:.9rem;border-inline-start:2px solid var(--line)}
.detail .reading {max-width:70ch;margin-inline:auto}
.detail .reading p,.workshop p {line-height:1.75}
.detail .reading h2 {text-wrap:balance;line-height:1.2}
.workshop .intro {max-width:61ch;margin-bottom:2rem}
.work-links,.sheet-grid,.activity-grid {display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr))}
.work-links a,.sheet-card,.play-panel {padding:clamp(1.25rem,3vw,2.25rem);border-radius:1rem;background:var(--tint);color:var(--ink)}
.work-links strong {display:block;font:normal 1.9rem/1.15 var(--serif);margin:.8rem 0}
.work-links small,.sheet-card small,.exercise small,.play-panel small {font-size:.8rem;font-weight:650;letter-spacing:.035em;color:var(--sage)}
.work-links a:focus-visible,.sheet-card:focus-visible,.exercise summary:focus-visible {outline:3px solid var(--sage);outline-offset:3px}
.sheet-card {border-top:2px solid var(--sage);border-radius:0 0 .8rem .8rem}
.sheet-card h2 {font-size:1.65rem;line-height:1.18;margin:.7rem 0}
.sheet-card p {margin:0}
.filters {display:flex;flex-wrap:wrap;gap:.8rem;align-items:end;padding-block:1rem 1.7rem}
.filters label,.play-area label {display:grid;gap:.3rem;font-size:.95rem}
.filters select,.filters input,.play-area select,.game-buttons button {font:inherit;color:var(--ink);background:var(--paper);border:1px solid var(--edge);border-radius:.6rem;padding:.5rem .7rem;min-height:44px;max-width:100%}
.activity-grid {align-items:start;grid-template-columns:repeat(auto-fit,minmax(min(100%,20rem),1fr))}
.exercise {margin:0;scroll-margin-top:7rem}
.exercise summary {min-height:75px}
.exercise strong {display:block;font:normal 1.6rem/1.2 var(--serif);margin-top:.28rem}
.exercise blockquote {border-left:2px solid var(--sage);margin:1rem 0;padding:.5rem 1rem;font:italic 1.3rem var(--serif)}
.play-area {max-width:52rem}
.play-area select {width:max-content}
.play-panel {margin-top:1.2rem}
.play-panel h2 {font-size:clamp(1.7rem,4vw,2.8rem);line-height:1.15;max-width:26ch}
.game-buttons {display:flex;gap:.6rem;flex-wrap:wrap}
.game-buttons button {cursor:pointer;min-width:6rem}
.game-buttons button:disabled {opacity:.65}
footer .fine {line-height:1.6}
@media(max-width:640px){.filters label {width:100%}.section-head h1,.workshop h1 {font-size:2.4rem}.hero-inner {padding-block:2rem}.work-links,.sheet-grid {gap:.75rem}}
@media(prefers-reduced-motion:reduce){.topic picture img,.article picture img {transition:none}}

.access-paths {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));gap:1rem;margin:1.5rem 0}
.access-paths a {display:grid;align-content:start;gap:.45rem;padding:1.2rem;border:1px solid currentColor;border-radius:1rem;text-decoration:none;color:inherit}
.access-paths svg {width:1.65rem;height:1.65rem}
.access-paths strong {font:inherit;font-weight:bold;font-size:1.15em}
.access-paths a:hover strong,.access-paths a:focus-visible strong {text-decoration:underline}
.sock-guide{margin:1.25rem 0;padding:1rem;border-block:1px solid currentColor}
.sock-guide figcaption{font-weight:600}.sock-guide ol{display:flex;flex-wrap:wrap;gap:1rem;padding-left:1.5rem}
.sock-guide li{flex:1 1 9rem;margin-right:.7rem}.sock-guide svg{display:block;width:100%;max-width:9rem;height:3.6rem}
.activity-voice{font:inherit;color:inherit;background:transparent;border:1px solid currentColor;border-radius:.6rem;padding:.65rem .85rem}
@media print{.activity-voice,.filters,.reader{display:none!important}.sock-guide{break-inside:avoid}}
