:root {
  color-scheme: dark;
  font: 1rem/1.5 system-ui, sans-serif;
  color: #fff2cf;
  background: #10352f;
}
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at top, #226353, transparent 62%); }
main, .site-header { max-width: 66rem; padding: 1rem clamp(1rem, 4vw, 2.5rem); margin: auto; }
main { padding-bottom: 3rem; }
a { color: inherit; }
a:focus-visible { outline: 3px solid #ffde93; outline-offset: 5px; }
.site-header a { display: inline-grid; min-height: 44px; align-items: center; font-weight: 700; }
h1 { margin: .35rem 0 1.45rem; font: 700 clamp(2rem, 6vw, 4rem)/1.12 Georgia, serif; }
.shelf, .comic { padding: 0; margin: 0; list-style: none; display: grid; gap: 1rem; }
.shelf { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 23rem)); }
.comic { grid-template-columns: repeat(2,minmax(0,1fr)); }
figure, .story-card { margin: 0; overflow: hidden; border: 1px solid #d6b77c; border-radius: 1rem; background: #142b25; }
.story-card { display: block; box-sizing: border-box; text-decoration: none; }
.story-card:hover { border-color: #ffde93; }
img { display: block; width: 100%; height: auto; }
.story-card span { display: block; margin: .15rem 1rem .8rem; }
.story-card .card-title { margin-top: .9rem; margin-bottom: 0; font: 700 1.45rem/1.2 Georgia, serif; }
figcaption { padding: .75rem 1rem 1rem; font-size: clamp(1.1rem, 2.4vw, 1.4rem); font-weight: 650; }
.notes { color: #dddfc8; margin: 1.2rem 0; }
.next { display: inline-block; padding: .75rem 1rem; border-radius: 2rem; background: #ffdc87; color: #3c2915; font-weight: 750; text-decoration: none; }
@media (max-width: 620px) { .comic { grid-template-columns: minmax(0,1fr); } }

.family-tree {
  margin-top: .6rem;
  padding: .7rem 1rem;
  border: 1px solid #d6b77c;
  border-radius: .8rem;
  background: #183c32;
}
.family-tree summary { min-height: 34px; cursor: pointer; font-weight: 750; }
.family-tree summary:focus-visible { outline: 3px solid #ffde93; outline-offset: 4px; }
.family-tree ol { columns: 2; padding-left: 1.65rem; margin: .4rem 0; }
.family-tree li { break-inside: avoid; padding: .12rem .2rem; }

h2 { margin: 0 0 .8rem; font: 700 clamp(1.45rem, 4vw, 2.2rem)/1.2 Georgia, serif; }
.main-stories { margin-top: 2rem; }
.main-stories .shelf { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.featured-picture {
  aspect-ratio: 2.32;
  background: #214b3e url("../story-previews.png") calc(var(--x) * 100%) calc(13.5% + var(--y) * 20.45%) / 434% 640%;
}
.ark-picture { background-position: 0 13.5%; }
.featured-adventure p { margin: .4rem 1rem 1rem; color: #dddfc8; }
.feature-links { padding: .5rem 1rem 1rem; margin: 0; list-style: none; display: grid; gap: .35rem; }
.feature-links a { display: inline-flex; min-height: 44px; align-items: center; text-underline-offset: .2em; }

/* The Bible book library */
[hidden] { display: none !important; }
.site-header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.library-intro { color: #e2eddf; font-size: clamp(1.1rem, 2vw, 1.35rem); margin: -0.4rem 0 1.5rem; }
.genesis-feature { display: grid; grid-template-columns: 1fr 1.1fr; margin-bottom: 2rem; border-radius: 1.4rem; overflow: hidden; border: 1px solid #e3bd70; color: #fff3d3; text-decoration: none; background: #1d4d3f; box-shadow: 0 1rem 2.5rem #071e1940; }
.genesis-feature > img { height: 100%; object-fit: cover; }
.genesis-feature > span { padding: clamp(1.2rem,3vw,2rem); display: grid; gap: .7rem; align-content: center; }
.genesis-feature small, .book-kicker { font-size: .88rem; font-weight: 800; letter-spacing: .12em; color: #ffdc87; }
.genesis-feature strong { font: 700 clamp(1.8rem,4vw,2.9rem)/1.15 Georgia,serif; }
.genesis-feature b { background: #ffdc87; color: #382b16; padding: .65rem 1rem; border-radius: 2rem; width: fit-content; }
.library-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; }
.book-search { display: grid; gap: .4rem; flex: 1 1 16rem; font-weight: 700; }
.book-search input { box-sizing: border-box; width: 100%; background: #0d2b25; color: #fff4dc; font: inherit; border: 1px solid #8daf99; border-radius: .8rem; padding: .8rem 1rem; min-height: 48px; }
.testament-filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.testament-filters button { font: inherit; font-weight: 700; background: #143c31; border: 1px solid #8daf99; border-radius: 2rem; min-height: 48px; padding: .65rem 1rem; color: #fff4dc; cursor: pointer; }
.testament-filters button[aria-pressed="true"] { background: #ffdc87; border-color: #ffdc87; color: #3c2915; }
button:focus-visible, input:focus-visible { outline: 3px solid #ffde93; outline-offset: 4px; }
.library-note { color: #d4e3d6; }
.testament { margin-top: 2rem; }
.book-total { color: #bdd3c3; font: 600 1rem system-ui,sans-serif; white-space: nowrap; }
.books-grid { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill,minmax(9.3rem,1fr)); gap: 1rem; }
.bible-book { min-height: 10.5rem; box-sizing: border-box; height: 100%; border: 1px solid #b5a477; border-radius: .35rem .9rem .9rem .35rem; display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; padding: 1rem 1rem 1rem 1.3rem; text-decoration: none; background: linear-gradient(90deg,#05181199 0 5px,transparent 5px 10px,#ffffff18 10px 12px,transparent 12px),linear-gradient(135deg,hsl(var(--book-hue) 36% 28%),hsl(var(--book-hue) 32% 15%)); box-shadow: 3px 4px 0 #091f19; transition: transform .15s; }
.bible-book:hover { transform: translateY(-3px); border-color: #ffdc87; }
.book-emblem { font-size: 1.5rem; color: #f4ce83; }
.book-name { font: 700 1.2rem/1.15 Georgia,serif; overflow-wrap: anywhere; }
.book-status { font-size: .88rem; color: #d9e3dc; margin-top: auto; }
.book-ready { border: 2px solid #ffdc87; }
.book-ready .book-status { color: #ffe099; font-weight: 700; }
.genesis-chapters { margin-top: 2.5rem; }
.chapter-grid { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill,minmax(10rem,1fr)); gap: .75rem; }
.chapter-grid a, .chapter-soon { display: grid; gap: .3rem; box-sizing: border-box; height: 100%; min-height: 5rem; padding: 1rem; border-radius: .8rem; border: 1px solid #587d68; background: #173d31; text-decoration: none; }
.chapter-grid a { border-color: #e3bd70; background: #235541; }
.chapter-grid span { font-size: .88rem; color: #d5dfd0; }
.chapter-soon { color: #c1d3c5; }
.book-waiting { padding: clamp(1.5rem,5vw,3rem); border: 1px solid #b89c62; background: #173d31; border-radius: 1.4rem; max-width: 40rem; }
.waiting-book { display: block; font-size: 3rem; color: #ffdc87; margin-bottom: 1rem; }
.text-link { display: inline-flex; min-height: 44px; align-items: center; margin: 1rem; text-underline-offset: .2em; }
@media(max-width:600px) { .genesis-feature { grid-template-columns: 1fr; } .genesis-feature > img { max-height: 12rem; } .books-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap:.75rem; } }
@media(prefers-reduced-motion:reduce) { .bible-book { transition:none; } }

.noah-story-cover { display:block; width:100%; aspect-ratio:1.7; object-fit:cover; object-position:45% 28%; }

/* Bright, touch-friendly story launch buttons. */
.featured-adventure{display:flex;flex-direction:column}.featured-adventure .feature-links{margin-top:auto;gap:.7rem;padding-bottom:1.3rem}
.feature-links a.story-action{box-sizing:border-box;display:flex;width:100%;min-height:54px;justify-content:flex-start;gap:.7rem;padding:.8rem 1rem;border:1px solid #ffffff70;border-radius:1rem;text-decoration:none;font:800 1rem/1.2 system-ui,sans-serif;box-shadow:0 4px 0 var(--button-shadow);transition:transform .15s,filter .15s}
.story-action>span{font-size:1.35rem;line-height:1;width:1.5rem;text-align:center}
.action-story{background:linear-gradient(135deg,#ffe995,#ffc753);color:#3d2b12;--button-shadow:#9c6a1e}
.action-activities{background:linear-gradient(135deg,#a5efbd,#52cda1);color:#123d30;--button-shadow:#237c61}
.action-explore{background:linear-gradient(135deg,#b6edff,#70c7f3);color:#123d58;--button-shadow:#33769c}
.action-songs{background:linear-gradient(135deg,#f3c6ff,#d6a0f8);color:#48245f;--button-shadow:#81519e}
.feature-links a.story-action:hover{filter:brightness(1.07);transform:translateY(-2px)}.feature-links a.story-action:active{transform:translateY(3px);box-shadow:0 1px 0 var(--button-shadow)}
.feature-links a.story-action:focus-visible{outline:3px solid #fff4b5;outline-offset:5px}
.song-hero{border:1px solid #e4c184;border-radius:1.5rem;overflow:hidden;background:#17483f;max-width:850px;margin:1.5rem auto}.song-hero img{display:block;width:100%;height:auto}.song-welcome{padding:clamp(1.2rem,4vw,2.3rem);text-align:center}.song-symbol{display:block;font-size:3.5rem;color:#f0c2ff}.song-welcome p{font-size:1.15rem;line-height:1.6;color:#e4eddf}.song-back{display:inline-flex;padding:.8rem 1.3rem;border-radius:1rem;background:#ffdf89;color:#3d2b12;font-weight:800;text-decoration:none;min-height:48px;box-sizing:border-box;align-items:center}
@media(prefers-reduced-motion:reduce){.feature-links a.story-action{transition:none}}

.featured-adventure img.ark-ready-cover{width:100%;height:auto;aspect-ratio:auto;object-fit:contain;display:block}

.song-player{display:block;width:100%;max-width:620px;min-height:56px;margin:1.2rem auto;accent-color:#6b37aa;color-scheme:light}.song-duration{font-size:1rem!important;color:#ffdf89!important}.song-player-help{font-size:1rem!important;margin-bottom:1.6rem}

.upcoming-cover,.adventure-preview-art{display:block;width:100%;height:auto;object-fit:contain}.upcoming-art-link{display:block}.upcoming-story .upcoming-notice,.upcoming-notice{color:#ffdc8c;font-weight:800}.upcoming-adventure{max-width:1050px}.adventure-preview-art{border:1px solid #e4c184;border-radius:1.3rem}.adventure-plan{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin:1.5rem 0}.adventure-plan section{padding:1.2rem;border:1px solid #d9bd7b;border-radius:1rem;background:#19453b;scroll-margin-top:1rem}.adventure-plan p{line-height:1.65}.planned-note{font-size:.95rem;color:#c7d9c8}.adventure-plan h2{font-size:1.5rem;margin:0 0 .8rem}.adventure-plan a{color:#ffe49d}@media(max-width:720px){.adventure-plan{grid-template-columns:1fr}}

.song-lyrics{margin:1.4rem 0 1.8rem;text-align:left;border:1px solid #c9a6ea;border-radius:1.2rem;overflow:hidden;background:#123e36}.song-lyrics summary{cursor:pointer;min-height:52px;box-sizing:border-box;padding:1rem 1.3rem;background:linear-gradient(135deg,#f3c6ff,#d6a0f8);color:#48245f;font:800 1.1rem system-ui,sans-serif}.song-lyrics summary:focus-visible{outline:4px solid #ffdf89;outline-offset:-4px}.song-lyrics:not([open]) .lyrics-hide,.song-lyrics[open] .lyrics-show{display:none}.song-lyric-sheet{padding:clamp(1rem,4vw,2rem);overflow-wrap:anywhere}.song-lyric-sheet h3{font-size:1.6rem;color:#ffe099;margin-top:0}.song-lyric-verse{margin:1.6rem 0}.song-lyric-verse h4{font:800 1rem system-ui,sans-serif;color:#edc6ff;margin:0 0 .65rem}.song-lyric-verse p{font-size:clamp(1.1rem,2.6vw,1.3rem);line-height:1.85;margin:0;color:#f2f3df}

.chapter-movie{display:inline-flex;align-items:center;min-height:44px;margin:8px 0 12px;padding:8px 16px;border-radius:24px;background:#f5d28a;color:#203c30;font-weight:750;text-decoration:none;font-size:15px}.chapter-movie:focus-visible{outline:3px solid #fff0b6;outline-offset:3px}

/* Chapter movie actions match the illustrated story controls. */
.action-movie{background:linear-gradient(135deg,#d5f1ff,#a8d5ef);color:#173e56;--button-shadow:#507e99}
.feature-links a.action-movie>span{display:inline-flex;align-items:center;justify-content:center;flex:0 0 30px;width:30px;height:30px;border-radius:50%;background:#28556d;color:#fff8df;font-size:14px;padding-left:2px}
.chapter-movie{gap:9px;background:linear-gradient(135deg,#d5f1ff,#a8d5ef);color:#173e56;border:1px solid #e4f6ff;box-shadow:0 3px 0 #507e99}
.chapter-movie::before{content:'▶';font-size:12px}

/* Movies selected for Bible Adventures stay out of Little Explorers. */
html:not([data-bible-experience="bible"]) [data-bible-only]{display:none!important}

/* Videos chosen for younger children are shown on their own track. */
html:not([data-bible-experience="little"]) [data-little-only]{display:none!important}

/* v271: Genesis library only; chapter actions must not each fill the entire grid row. */
.genesis-library .chapter-grid{grid-template-columns:repeat(auto-fill,minmax(9.4rem,1fr));align-items:start;gap:.65rem}
.genesis-library .chapter-grid>li{display:flex;flex-direction:column;gap:.35rem;min-width:0}
.genesis-library .chapter-grid a:not(.chapter-movie),.genesis-library .chapter-soon{height:auto;min-height:4.4rem;display:flex;flex-direction:column;justify-content:flex-start;gap:.2rem;padding:.65rem .75rem;line-height:1.35}
.genesis-library .chapter-grid .chapter-movie{height:auto;min-height:44px;display:flex;align-items:center;gap:.35rem;margin:0;padding:.45rem .65rem;font-size:.78rem;line-height:1.25;background:linear-gradient(135deg,#d5f1ff,#a8d5ef);color:#173e56;border:1px solid #e4f6ff;border-radius:.65rem}
.genesis-library .shelf{grid-template-columns:repeat(auto-fit,minmax(min(100%,19rem),1fr));align-items:stretch}
.genesis-library .shelf>li{display:flex;min-width:0}
.genesis-library .shelf .story-card{width:100%;height:100%;background:linear-gradient(145deg,#214d40,#142b25)}
.genesis-library .story-card img{aspect-ratio:16/10;object-fit:cover;height:auto}
.genesis-library .collection-range{color:#ffdc87;font-weight:750}
@media(max-width:480px){.genesis-library .chapter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.genesis-library .chapter-grid a:not(.chapter-movie),.genesis-library .chapter-soon{padding:.6rem}}

/* v276: richer Genesis chapter backgrounds; movie controls remain blue. */
.genesis-library .chapter-grid a:not(.chapter-movie),.genesis-library .chapter-soon{background:#193f35}
