/* Mr Scott's Shed — calm, minimal, creative, fun */

:root {
  --paper: #FBF8F3;
  --card: #FFFFFF;
  --ink: #2B2A28;
  --muted: #6B675F;
  --faint: #9A958C;
  --line: #ECE6DC;
  --line-strong: #CFC8BC;
  --accent: #E85D3F;
  --accent-ink: #B8412A;
  --spark: #E8B23F;
  --good: #3F8A5C;
  --good-bg: #E3F1E6;
  --bad: #C2452D;
  --bad-bg: #FBE6E0;

  /* Year colours (overridden per page by .year-N classes) */
  --tint: #F3EEE6;
  --tint-ink: #2B2A28;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;

  --radius: 18px;
  --radius-sm: 10px;
  --wrap: 1080px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

.year-7  { --tint: #E3ECDF; --tint-ink: #24361F; }
.year-8  { --tint: #F7E2D3; --tint-ink: #4A2814; }
.year-9  { --tint: #E1E6F3; --tint-ink: #1F2B4A; }
.year-10 { --tint: #F6EDC9; --tint-ink: #4A3B0E; }
.year-11 { --tint: #F3DDE6; --tint-ink: #4A1F30; }
.year-12 { --tint: #DCEFEC; --tint-ink: #173F3A; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.dyslexic {
  --serif: "Lexend", var(--sans);
  --sans: "Lexend", system-ui, sans-serif;
  letter-spacing: .01em;
  word-spacing: .08em;
}

a { color: inherit; }
img, svg { display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.icon { width: 1.25em; height: 1.25em; flex: none; }
.icon path, .icon circle, .icon rect {
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Header ---------- */

.site-header { padding: 22px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .icon { width: 28px; height: 28px; transition: transform .4s var(--spring); }
.brand:hover .icon { transform: rotate(-8deg) scale(1.08); }
.brand span { font-family: var(--serif); font-size: 20px; font-weight: 500; letter-spacing: -.01em; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .nav button {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 15px; color: var(--muted); text-decoration: none;
  background: none; border: 0; cursor: pointer;
  padding: 8px 12px; border-radius: 999px;
  transition: background .2s, color .2s;
}
.nav a:hover, .nav button:hover, .nav a[aria-current="page"] { background: #F1ECE3; color: var(--ink); }

/* ---------- Hero (home) ---------- */

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; padding: 36px 0 20px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(42px, 6.5vw, 72px);
  line-height: 1.02; letter-spacing: -.025em; margin: 0;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); font-size: 18px; max-width: 30em; margin: 18px 0 0; }
.hand { font-family: var(--hand); color: var(--accent); font-size: 26px; line-height: 1.1; }
.hero .hand { margin-top: 14px; display: inline-block; transform: rotate(-2deg); }

.hero-art { width: 100%; max-width: 420px; justify-self: center; overflow: visible; }
.hero-art .ln { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hero-art .glow { fill: var(--spark); opacity: .55; transform-box: fill-box; transform-origin: center; }
.hero-art .spark { fill: var(--spark); transform-box: fill-box; transform-origin: center; }

.hero-ref { font-family: var(--hand); font-size: 24px; color: var(--muted); margin: 10px 0 0 !important; }

/* ---------- Bible verses ---------- */

.daily { text-align: center; padding: 56px 0 8px; }
.daily > .hand { color: var(--accent); font-size: 24px; }
.daily-verse { margin: 10px auto 0; max-width: 34em; }
.daily-verse blockquote { margin: 0; font-family: var(--serif); font-size: clamp(22px, 3vw, 30px); line-height: 1.35; letter-spacing: -.01em; }
.daily-verse figcaption { margin-top: 12px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.daily-verse figcaption::before, .daily-verse figcaption::after { content: ""; display: inline-block; width: 22px; border-top: 1.5px solid var(--line-strong); vertical-align: middle; margin: 0 10px; }

.banner-verse { margin: 20px 0 0; max-width: 36em; padding-left: 16px; border-left: 2px solid currentColor; border-radius: 0; opacity: .85; }
.banner-verse blockquote { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.5; }
.banner-verse figcaption { margin-top: 4px; font-family: var(--hand); font-size: 20px; }
.hero .banner-verse { color: var(--muted); }

.footer-verse { margin: 0; max-width: 30em; }
.footer-verse blockquote { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.45; color: var(--ink); }
.footer-verse figcaption { font-family: var(--hand); font-size: 20px; color: var(--accent); margin-top: 2px; }
.footer-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-align: right; }
.footer-side .small { font-size: 12.5px; color: var(--faint); max-width: 26em; }

/* ---------- Section headings ---------- */

.section-label { display: flex; align-items: center; gap: 12px; margin: 48px 0 16px; }
.section-label .hand { color: var(--ink); font-size: 26px; white-space: nowrap; }
.section-label::after { content: ""; flex: 1; border-top: 1.5px dashed var(--line-strong); order: 1; }
.section-label .see-all { order: 2; font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.section-label .see-all:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

h1.page-title {
  font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -.02em; line-height: 1.05; margin: 6px 0 0;
}
.page-intro { color: var(--muted); font-size: 18px; margin: 12px 0 0; max-width: 40em; }

/* ---------- Year cards ---------- */

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.year-card {
  display: flex; flex-direction: column; min-height: 190px;
  background: var(--tint); color: var(--tint-ink);
  border-radius: var(--radius); padding: 22px 22px 20px; text-decoration: none;
  transition: transform .45s var(--spring);
}
.year-card:hover { transform: translateY(-6px) rotate(-1.4deg); }
.year-card:nth-child(even):hover { transform: translateY(-6px) rotate(1.4deg); }
.year-card .top { display: flex; justify-content: space-between; align-items: baseline; }
.year-card .name { font-family: var(--serif); font-size: 34px; letter-spacing: -.02em; }
.year-card .top .icon { width: 22px; height: 22px; transition: transform .35s var(--spring); }
.year-card:hover .top .icon { transform: translate(3px, -3px); }
.year-card .icons { display: flex; gap: 12px; margin-top: auto; padding-top: 28px; }
.year-card .icons .icon { width: 24px; height: 24px; }
.year-card .subjects { font-size: 14px; margin-top: 8px; opacity: .85; }

/* ---------- Subject cards ---------- */

.subject-card {
  display: flex; flex-direction: column; gap: 6px; min-height: 170px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; text-decoration: none;
  transition: transform .45s var(--spring), border-color .2s;
}
.subject-card:hover { transform: translateY(-5px) rotate(-1deg); border-color: var(--line-strong); }
.subject-card .badge {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--tint); color: var(--tint-ink); margin-bottom: 12px;
  transition: transform .45s var(--spring);
}
.subject-card:hover .badge { transform: rotate(-10deg) scale(1.06); }
.subject-card .badge .icon { width: 28px; height: 28px; }
.subject-card .name { font-family: var(--serif); font-size: 26px; letter-spacing: -.01em; }
.subject-card .meta { color: var(--muted); font-size: 14px; margin-top: auto; }

/* ---------- Year banner ---------- */

.banner { background: var(--tint); color: var(--tint-ink); border-radius: 28px; padding: 32px 32px 34px; margin-top: 8px; position: relative; overflow: hidden; }
.banner .page-intro { color: inherit; opacity: .8; }
.banner .hand { color: var(--tint-ink); }
.banner .doodle { position: absolute; right: 26px; bottom: 18px; width: 120px; height: 120px; opacity: .55; }
.banner .doodle .icon { width: 100%; height: 100%; }
.banner .doodle .icon path, .banner .doodle .icon circle, .banner .doodle .icon rect { stroke-width: 1.1; }

/* ---------- Breadcrumbs ---------- */

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin: 6px 0 18px; }
.crumbs a { text-decoration: none; padding: 2px 4px; border-radius: 6px; }
.crumbs a:hover { color: var(--ink); background: #F1ECE3; }
.crumbs .icon { width: 14px; height: 14px; opacity: .6; }

/* ---------- Topic cards ---------- */

.topic-card {
  display: flex; flex-direction: column; gap: 6px; min-height: 150px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; position: relative;
  transition: transform .45s var(--spring), border-color .2s;
}
.topic-card::before { content: ""; width: 26px; height: 4px; border-radius: 4px; background: var(--tint-ink); opacity: .35; margin-bottom: 8px; transition: width .45s var(--spring), opacity .2s; }
.topic-card:hover { transform: translateY(-5px) rotate(-.8deg); border-color: var(--line-strong); }
.topic-card:hover::before { width: 48px; opacity: .7; }
.topic-card .title { font-family: var(--serif); font-size: 24px; line-height: 1.15; letter-spacing: -.01em; }
.topic-card .desc { color: var(--muted); font-size: 15px; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }

/* ---------- The Bible's big story ---------- */

.story-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: relative; margin: 8px 0 0; }
.story-strip::before { content: ""; position: absolute; left: 8%; right: 8%; top: 27px; border-top: 1.5px dashed var(--line-strong); }
.story-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; padding: 0 4px; text-align: center; }
.story-step .dot {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1.5px solid var(--ink); color: var(--ink);
  transition: transform .45s var(--spring), background .2s, color .2s;
}
.story-step .dot .icon { width: 24px; height: 24px; }
.story-step:hover .dot { transform: translateY(-4px) rotate(-6deg); background: var(--ink); color: var(--paper); }
.story-step .label { font-family: var(--serif); font-size: 16px; line-height: 1.2; }
.story-step .count { font-size: 12.5px; color: var(--muted); }
.story-strip.big { margin-top: 36px; }
.story-strip.big .dot { width: 62px; height: 62px; }
.story-strip.big::before { top: 31px; }

.year-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 36px 0 8px; }
.year-filter .hand { color: var(--ink); font-size: 22px; margin-right: 6px; }
.filter { font: inherit; font-size: 14px; color: var(--muted); background: var(--card); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: background .2s, color .2s; }
.filter:hover { color: var(--ink); border-color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filter:disabled { opacity: .4; cursor: default; }
.filter:disabled:hover { color: var(--muted); border-color: var(--line-strong); }

.chapter { margin-top: 56px; scroll-margin-top: 20px; }
.chapter-head { display: flex; gap: 16px; align-items: flex-start; }
.chapter-num { font-family: var(--hand); font-size: 30px; color: var(--accent); line-height: 1; padding-top: 6px; min-width: 16px; }
.chapter-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); flex: none; }
.chapter-icon .icon { width: 24px; height: 24px; }
.chapter h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; letter-spacing: -.015em; line-height: 1.1; margin: 4px 0 4px; }
.chapter-head p { color: var(--muted); margin: 0; max-width: 40em; }
.chapter-verse { margin: 14px 0 18px 78px; max-width: 36em; }
.chapter-verse blockquote { margin: 0; font-family: var(--serif); font-size: 16px; line-height: 1.5; color: var(--muted); }
.chapter-verse figcaption { font-family: var(--hand); font-size: 19px; color: var(--accent); }
.chapter .empty { margin-top: 4px; padding: 18px; }
.chapter .grid { margin-top: 8px; }

.term-block { margin-top: 44px; }
.term-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1.5px dashed var(--line-strong); }
.term-head h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -.01em; margin: 0; }
.term-head p { margin: 0; color: var(--muted); font-family: var(--hand); font-size: 22px; }
.term-empty { padding: 18px; }

.story-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.story-chip .icon { width: 15px; height: 15px; }
.topic-card.filtered-out { display: none; }
.story-more { margin-top: 24px; }

/* ---------- Course cards ---------- */

.course-card {
  display: flex; flex-direction: column; gap: 8px; min-height: 220px; text-decoration: none;
  background: var(--tint); color: var(--tint-ink); border-radius: var(--radius); padding: 22px;
  transition: transform .45s var(--spring);
}
.course-card:hover { transform: translateY(-6px) rotate(-1.2deg); }
.course-card.soon { opacity: .7; }
.course-card.soon:hover { transform: none; }
.course-card .top { display: flex; justify-content: space-between; align-items: center; }
.course-card .top .hand { color: var(--tint-ink); font-size: 22px; opacity: .8; }
.course-card .top .icon { width: 20px; height: 20px; transition: transform .35s var(--spring); }
.course-card:hover .top .icon { transform: translate(3px, -3px); }
.course-card .title { font-family: var(--serif); font-size: 28px; line-height: 1.1; letter-spacing: -.015em; }
.course-card .desc { font-size: 15px; opacity: .85; }
.course-card .chip, .banner .chip { background: rgba(255, 255, 255, .55); border-color: transparent; color: var(--tint-ink); }
.banner .counts { padding-top: 16px; }

/* ---------- Course page and lessons ---------- */

.course-start { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.progress-note { color: var(--muted); font-size: 15px; }

.lesson-row {
  display: flex; align-items: center; gap: 18px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 10px;
  transition: transform .4s var(--spring), border-color .2s;
}
.lesson-row:hover { transform: translateX(6px); border-color: var(--line-strong); }
.lesson-row .num {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--tint); color: var(--tint-ink); font-family: var(--serif); font-size: 18px;
}
.lesson-row .num .icon { display: none; width: 20px; height: 20px; }
.lesson-row.done .num { background: var(--good-bg); color: var(--good); }
.lesson-row.done .num .n { display: none; }
.lesson-row.done .num .icon { display: block; }
.lesson-row .body { flex: 1; min-width: 0; }
.lesson-row .title { font-family: var(--serif); font-size: 21px; line-height: 1.2; display: block; }
.lesson-row .desc { color: var(--muted); font-size: 15px; display: block; margin-top: 2px; }
.lesson-row > .icon { color: var(--faint); transition: transform .3s var(--spring); }
.lesson-row:hover > .icon { transform: translateX(4px); color: var(--ink); }

.prose { max-width: 40em; font-size: 18px; line-height: 1.75; }
.prose h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.2; letter-spacing: -.01em; margin: 1.8em 0 .4em; }
.prose h3, .prose h4 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 1.5em 0 .3em; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 500; background: linear-gradient(transparent 62%, var(--tint) 62%); }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); border-radius: 0; font-family: var(--serif); font-size: 21px; line-height: 1.5; color: var(--ink); }
.prose a { color: var(--accent-ink); text-underline-offset: 3px; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 1em 0; }
.prose hr { border: 0; border-top: 1.5px dashed var(--line-strong); margin: 2em 0; }

.prose .table-wrap { overflow-x: auto; margin: 1.2em 0 1.6em; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.prose th { text-align: left; font-weight: 500; background: var(--tint); color: var(--tint-ink); padding: 10px 14px; }
.prose td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.prose td:first-child { font-weight: 500; }
.prose li.sub { list-style: none; margin-left: 1.2em; position: relative; }
.prose li.sub::before { content: "–"; position: absolute; left: -1em; color: var(--faint); }
.prose ul.tasks { list-style: none; padding-left: 0; }
.prose li.task { position: relative; padding-left: 30px; }
.prose li.task::before { content: ""; position: absolute; left: 0; top: .3em; width: 16px; height: 16px; border: 1.5px solid var(--line-strong); border-radius: 4px; }
.prose li.task.done::before { background: var(--good-bg); border-color: var(--good); }

.interactive { position: relative; height: min(72vh, 640px); border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.interactive iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.interactive-open { margin: 12px 0 0; }

/* ---------- "On this page" list ---------- */

.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.lesson-main { min-width: 0; }
.toc details { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px; }
.toc summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary .hand { font-size: 22px; color: var(--ink); }
.toc summary .icon { width: 18px; height: 18px; color: var(--faint); transform: rotate(90deg); transition: transform .3s var(--spring); }
.toc details:not([open]) summary .icon { transform: none; }
.toc ol { list-style: none; margin: 4px 0 12px; padding: 0; counter-reset: toc; }
.toc li a {
  display: block; padding: 6px 0 6px 12px; text-decoration: none; color: var(--muted); font-size: 15px; line-height: 1.35;
  border-left: 2px solid var(--line); border-radius: 0; transition: color .2s, border-color .2s;
}
.toc li a:hover { color: var(--ink); border-left-color: var(--line-strong); }
.toc li a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); }

@media (min-width: 1000px) {
  .lesson-layout { grid-template-columns: minmax(0, 1fr) 240px; column-gap: 48px; }
  .lesson-main { grid-column: 1; grid-row: 1; }
  .toc { grid-column: 2; grid-row: 1; }
  .toc details { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; margin-top: 40px; }
  .toc summary { cursor: default; pointer-events: none; }
  .toc summary .icon { display: none; }
}

.prose h2, .block, .chapter, .term-block { scroll-margin-top: 20px; }

.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 5; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--paper);
  opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s, transform .35s var(--spring);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: #000; }
.to-top .icon { width: 20px; height: 20px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .toc, .to-top { display: none; } }

.module-row .group-progress { flex: none; }
.lesson-row > .chip { flex: none; }

.prose .think { margin: 1em 0 1.4em; background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-size: 16.5px; line-height: 1.6; }
.prose .think summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; }
.prose .think summary::-webkit-details-marker { display: none; }
.prose .think .q { font-family: var(--serif); font-size: 18px; line-height: 1.45; }
.prose .think .q::before { content: "Think about it"; display: block; font-family: var(--hand); font-size: 20px; color: var(--accent); margin-bottom: 2px; }
.prose .think.objection .q { font-style: italic; }
.prose .think.objection .q::before { content: "They might say"; font-style: normal; }
.prose .think .reveal { align-self: flex-start; font-size: 14px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; transition: background .2s, color .2s; }
.prose .think summary:hover .reveal { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.prose .think[open] .reveal { display: none; }
.prose .think .answer { padding: 0 18px 16px; border-top: 1px dashed var(--line-strong); margin: 0 18px; padding: 14px 0 4px; }
.prose .think .answer p { margin: 0 0 .6em; }
.prose .think .points { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: .4em 0 .6em; }
.prose .think .points li { margin: 0; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--tint); color: var(--tint-ink); }
.prose .think.open { padding: 16px 18px; }
@media (prefers-reduced-motion: no-preference) { .prose .think[open] .answer { animation: rise .4s var(--spring) both; } }

.quiz-why { color: var(--muted); font-size: 15px; margin: 6px 0 0; max-width: 40em; }

.flashcard {
  display: grid; width: 100%; min-height: 240px; padding: 0; cursor: pointer;
  background: none; border: 0; font: inherit; color: inherit; perspective: 1200px;
}
.flashcard .face {
  grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 28px; border-radius: 22px; border: 1.5px solid var(--line-strong); background: var(--paper);
  backface-visibility: hidden; transition: transform .6s var(--spring); text-align: left;
}
.flashcard .back { transform: rotateY(180deg); background: var(--tint); color: var(--tint-ink); border-color: transparent; }
.flashcard.flipped .front { transform: rotateY(-180deg); }
.flashcard.flipped .back { transform: rotateY(0); }
.flashcard .side-label { font-family: var(--hand); font-size: 20px; color: var(--accent); }
.flashcard .back .side-label { color: var(--tint-ink); opacity: .7; }
.flashcard .face-text { font-family: var(--serif); font-size: clamp(19px, 2.6vw, 24px); line-height: 1.4; }
.flashcard .back .face-text { font-family: var(--sans); font-size: 17px; line-height: 1.6; }
.card-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; min-height: 44px; }
.card-hint { color: var(--muted); font-size: 14px; text-align: center; margin: 14px 0 0; }

.lesson-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 56px; padding-top: 24px; border-top: 1.5px dashed var(--line-strong); }
.done-btn[aria-pressed="true"] { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.done-btn[aria-pressed="true"]:hover { background: var(--good-bg); color: var(--good); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; line-height: 1; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--muted); background: var(--card); white-space: nowrap;
}
.chip .icon { width: 14px; height: 14px; }
.chip.tint { background: var(--tint); border-color: transparent; color: var(--tint-ink); }

/* ---------- Unit page sections ---------- */

.block { margin-top: 40px; }
.block-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.block-head h2 { font-family: var(--hand); font-weight: 500; font-size: 30px; margin: 0; white-space: nowrap; }
.block-head::after { content: ""; flex: 1; border-top: 1.5px dashed var(--line-strong); }

.file-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 14px 18px; margin-bottom: 10px;
}
.file-type {
  width: 48px; height: 56px; border-radius: 8px; flex: none;
  display: grid; place-items: end center; padding-bottom: 7px;
  font-size: 11px; font-weight: 500; letter-spacing: .04em;
  border: 1.5px solid currentColor; position: relative;
}
.file-type::before { content: ""; position: absolute; top: -1.5px; right: -1.5px; width: 14px; height: 14px; background: var(--paper); border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; border-bottom-left-radius: 4px; }
.ft-pdf { color: #C2452D; } .ft-doc { color: #2F5DA8; } .ft-ppt { color: #C7662B; }
.ft-xls { color: #2E7D4F; } .ft-img { color: #7A4FA0; } .ft-other { color: var(--muted); }
.file-row .body { flex: 1; min-width: 0; }
.file-row .name { font-weight: 500; overflow-wrap: anywhere; }
.file-row .meta { color: var(--muted); font-size: 14px; }
.file-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
  background: var(--ink); color: var(--paper); border: 0; cursor: pointer;
  padding: 10px 16px; border-radius: 999px;
  transition: transform .3s var(--spring), background .2s;
}
.btn:hover { transform: translateY(-2px) rotate(-2deg); background: #000; }
.btn:active { transform: scale(.97); }
.btn .icon { width: 18px; height: 18px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: var(--accent-ink); }

.game-card {
  display: flex; align-items: center; gap: 16px; text-decoration: none;
  background: var(--tint); color: var(--tint-ink); border-radius: var(--radius);
  padding: 18px 20px; transition: transform .45s var(--spring);
}
.game-card:hover { transform: translateY(-4px) rotate(-1deg); }
.game-card .play {
  width: 50px; height: 50px; border-radius: 50%; background: var(--card); color: var(--ink);
  display: grid; place-items: center; flex: none; transition: transform .45s var(--spring);
}
.game-card:hover .play { transform: scale(1.1) rotate(8deg); }
.game-card .title { font-family: var(--serif); font-size: 21px; line-height: 1.2; }
.game-card .meta { font-size: 14px; opacity: .8; }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; margin-bottom: 14px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.link-row {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.link-row:hover .name { text-decoration: underline; text-underline-offset: 3px; }
.link-row .host { color: var(--faint); font-size: 14px; margin-left: auto; }

.empty { color: var(--muted); padding: 26px; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); }
.empty .hand { color: var(--ink); display: block; margin-bottom: 4px; }

/* ---------- Recent list ---------- */

.recent-row {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.recent-row:last-child { border-bottom: 0; }
.recent-row .name { flex: 1; min-width: 0; }
.recent-row:hover .name { text-decoration: underline; text-underline-offset: 3px; }
.recent-row > .icon { color: var(--faint); }

/* ---------- Search ---------- */

.search-box { position: relative; margin-top: 24px; }
.search-box .icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 22px; height: 22px; }
.search-box input {
  width: 100%; font: inherit; font-size: 20px; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line-strong); border-radius: 999px;
  padding: 16px 20px 16px 52px; outline: none; transition: border-color .2s;
}
.search-box input:focus { border-color: var(--ink); }
.search-results { margin-top: 20px; }
.search-results .recent-row .where { color: var(--muted); font-size: 14px; }

/* ---------- Game page ---------- */

.game-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 28px; margin-top: 20px; }
.game-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.game-bar .stats { display: flex; gap: 8px; }

.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.match-col { display: flex; flex-direction: column; gap: 10px; }
.tile {
  font: inherit; font-size: 16px; text-align: left; color: var(--ink); cursor: pointer;
  background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: 14px;
  padding: 14px 16px; min-height: 56px;
  transition: transform .3s var(--spring), background .2s, border-color .2s, opacity .4s;
}
.tile:hover { transform: translateY(-2px); border-color: var(--ink); }
.tile.selected { background: var(--tint); border-color: var(--tint-ink); color: var(--tint-ink); transform: scale(1.03) rotate(-1deg); }
.tile.matched { background: var(--good-bg); border-color: var(--good); color: var(--good); cursor: default; transform: none; opacity: .75; }
.tile.wrong { background: var(--bad-bg); border-color: var(--bad); animation: shake .4s; }

.quiz-q { font-family: var(--serif); font-size: clamp(22px, 3.2vw, 30px); line-height: 1.25; margin: 4px 0 20px; }
.quiz-options { display: grid; gap: 10px; }
.quiz-options .tile.correct { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.quiz-options .tile:disabled { cursor: default; }
.quiz-options .tile:disabled:hover { transform: none; }
.quiz-feedback { min-height: 36px; margin-top: 16px; font-family: var(--hand); font-size: 26px; }
.progress { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 18px; }
.progress span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .5s var(--spring); }

.finish { text-align: center; padding: 24px 0 8px; }
.finish .big { font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); line-height: 1.05; margin: 8px 0; }
.finish .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall 2.4s ease-in forwards; }

/* ---------- Footer ---------- */

.site-footer { margin-top: 80px; padding: 34px 0 40px; border-top: 1.5px dashed var(--line-strong); color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.site-footer .hand { color: var(--ink); font-size: 22px; }
.text-toggle { font: inherit; font-size: 14px; color: var(--muted); background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.text-toggle:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Motion ---------- */

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scaleX(.2); } to { opacity: 1; transform: scaleX(1); } }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes glow { from { opacity: 0; transform: scale(.2); } to { opacity: .55; transform: scale(1); } }
@keyframes shine { 0% { transform: scale(1); } 100% { transform: scale(1.9); opacity: .9; } }

@media (prefers-reduced-motion: no-preference) {
  .hero-art .ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2s ease forwards; }
  .hero-art .ln:nth-of-type(2) { animation-delay: .2s; }
  .hero-art .ln:nth-of-type(3) { animation-delay: .6s; }
  .hero-art .ln:nth-of-type(4) { animation-delay: .8s; }
  .hero-art .ln:nth-of-type(5) { animation-delay: 1s; }
  .hero-art .ln:nth-of-type(6) { animation-delay: 1.8s; }
  .hero-art .glow { opacity: 0; animation: glow .6s 1.7s var(--spring) forwards; }
  .hero-art .spark { animation: twinkle 2.6s ease-in-out infinite; }
  .hero-art.opening .glow { animation: shine .45s ease-in forwards; opacity: 1; }
  .rise { animation: rise .6s var(--spring) backwards; }
  .rise-2 { animation-delay: .08s; } .rise-3 { animation-delay: .16s; } .rise-4 { animation-delay: .24s; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; padding-top: 12px; }
  .hero-art { max-width: 280px; order: -1; }
  .lesson-nav .done-btn { order: -1; width: 100%; justify-content: center; }
  .footer-side { align-items: flex-start; text-align: left; }
  .story-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
  .story-strip::before { display: none; }
  .story-step .dot, .story-strip.big .dot { width: 48px; height: 48px; }
  .chapter-verse { margin-left: 0; }
  .chapter h2 { font-size: 26px; }
  .daily { padding-top: 40px; }
  .prose { font-size: 17px; }
  .nav .label { display: none; }
  .banner { padding: 24px 22px 26px; border-radius: 22px; }
  .banner .doodle { display: none; }
  .brand span { font-size: 17px; white-space: nowrap; }
  .brand .icon { width: 24px; height: 24px; }
  .nav { gap: 0; }
  .nav a, .nav button { padding: 8px 9px; }
  .file-row { flex-wrap: wrap; }
  .file-buttons { width: 100%; }
  .file-row .btn { flex: 1; justify-content: center; }
  .match-board { gap: 10px; }
  .tile { font-size: 15px; padding: 12px; }
  .game-wrap { padding: 20px 16px; border-radius: 22px; }
}

@media print {
  .site-header, .site-footer, .btn { display: none; }
}
