:root {
  color-scheme: light;
  --paper: #faf7f0;
  --panel: #fffdf7;
  --ink: #232927;
  --heading: #122943;
  --primary: #174360;
  --accent: #ad7b39;
  --line: #ded5c5;
  --quiet: #505752;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Trebuchet MS", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); }
body.heritage { --heading: #12373d; --primary: #12444b; --accent: #9d5529; --line: #dad6c9; }
h1, h2, h3, .brand, .brand-context, .footer-brand { color: var(--heading); font-family: var(--serif); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.25rem, 4.8vw, 4.15rem); line-height: 1.05; letter-spacing: -.028em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.15rem); line-height: 1.15; letter-spacing: -.018em; }
h3 { font-size: 1.23rem; line-height: 1.28; }
a { color: var(--primary); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #bd691e; outline-offset: 4px; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 1rem; }
.wrap { width: min(1330px, calc(100% - 6rem)); margin-inline: auto; }
.skip { position: fixed; z-index: 9; top: .75rem; left: .75rem; padding: .65em 1em; background: white; transform: translateY(-160%); }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header { background: #fcf9f2; border-bottom: 1px solid #d9d1c4; }
.header-inner { min-height: 80px; display: flex; align-items: center; gap: 1.35rem; }
.brand { text-decoration: none; font-size: clamp(1.75rem, 3.3vw, 2.7rem); line-height: 1; font-weight: bold; letter-spacing: -.043em; white-space: nowrap; }
.brand-context { border-left: 1px solid #aa8c60; padding-left: 1.35rem; font-weight: bold; line-height: 1.28; }
.brand-context small { display: block; font: 600 .66rem/1.5 var(--sans); text-transform: uppercase; letter-spacing: .16em; margin-top: .14rem; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .35rem; margin-left: auto; }
.site-header nav a { text-decoration: none; font: bold 1rem/1.2 var(--serif); display: inline-flex; align-items: center; min-height: 42px; padding: .45rem .9rem; border-radius: 5px; }
.site-header nav a:hover { background: #ece5d8; }
.site-header nav a[aria-current] { background: var(--primary); color: white; }
.home-hero { background: #271c16; isolation: isolate; position: relative; overflow: hidden; }
.home-hero::before { position: absolute; content: ""; inset: 0 0 0 28%; z-index: -2; background: url('/assets/open-bible.webp') right center / cover no-repeat; }
.home-hero::after { position: absolute; content: ""; inset: 0; z-index: -1; background: linear-gradient(90deg,#141c1d 0%,#211a16 28%,#211a16bd 37%,#211a1638 53%,transparent 71%); }
.hero-inner { min-height: clamp(275px, 27vw, 390px); padding-block: clamp(2.35rem,5vw,4.3rem); }
.hero-inner h1, .course-hero h1 { color: #fffaf2; text-shadow: 0 2px 14px #0e0b08ae; }
.hero-inner h1::after { content: ""; display: block; height: 4px; width: 6rem; margin-block: 1.15rem 1rem; background: #d2a55a; }
.hero-inner p, .course-hero p { color: #fff9ed; font: italic clamp(1.22rem, 2.5vw, 1.95rem)/1.2 var(--serif); text-shadow: 0 1px 10px #000; }
.features { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding-block: 1.65rem 1.8rem; border-bottom: 1px solid var(--line); }
.features article { display: grid; grid-template-columns: 3rem minmax(0,1fr); align-items: start; gap: 1rem; padding: .15rem 1.4rem; }
.features article:first-child { padding-left: 0; }
.features article + article { border-left: 1px solid var(--line); }
.features svg { width: 100%; color: var(--heading); margin-top: .15rem; }
.features h2 { font-size: clamp(1.2rem,2.15vw,1.7rem); margin-bottom: .32rem; }
.features h2 a, .course-card h3 a { color: inherit; text-decoration: none; }
.features h2 a:hover, .course-card h3 a:hover { text-decoration: underline; }
.features p { max-width: 28ch; }
.home-directory { display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr); gap: 2rem; padding-block: 2rem 3rem; }
.home-directory h2, .directory h2 { margin-bottom: 1rem; }
.about-teaser { align-self: end; border-left: 1px solid var(--line); padding: .4rem 0 .4rem 1.7rem; }
.about-teaser h2 { font-size: clamp(1.35rem, 2.15vw, 1.8rem); margin-bottom: .38rem; }
.about-teaser p { margin-bottom: .42rem; }
.text-link { font-weight: 600; }
.course-card { display: grid; grid-template-columns: 25% 1fr auto; align-items: center; gap: 1.25rem; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; box-shadow: 0 2px 7px #4338170e; }
.course-card + .course-card { margin-top: 1rem; }
.course-card img { object-fit: cover; width: 100%; height: 100%; min-height: 120px; }
.course-card h3 { font-size: clamp(1.25rem,2.65vw,1.95rem); }
.course-card p { margin-top: .16rem; font: italic clamp(1rem,2vw,1.3rem)/1.3 var(--serif); }
.course-card .button { margin-right: 1rem; white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: white; font: bold .96rem/1.2 var(--sans); border: 1px solid var(--primary); border-radius: 5px; padding: .72rem .95rem; text-decoration: none; min-height: 44px; }
.button:hover { filter: brightness(1.13); text-decoration: underline; }
.button.secondary { background: transparent; color: var(--primary); }
.site-footer { margin-top: 1rem; background: #f2ece0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-block: 1.25rem; gap: .7rem 1.5rem; }
.footer-brand { font-size: 1.2rem; font-weight: bold; text-decoration: none; }
.directory-intro { background: #eee8dc; border-bottom: 1px solid var(--line); padding-block: 2.8rem 2.4rem; }
.directory-intro p { font-size: 1.12rem; margin-top: .65rem; max-width: 56ch; }
.directory { padding-block: 2rem 3rem; }
.directory section + section { margin-top: 2rem; }
.prose p { max-width: 66ch; margin-bottom: 1rem; }
.course-hero { background: #221a15; position: relative; isolation: isolate; overflow: hidden; }
.course-hero::before, .course-hero::after { content: ""; position: absolute; inset-block: 0; width: 34%; z-index: -1; }
.course-hero::before { left: 0; background: linear-gradient(90deg,transparent 20%,#221a15 96%),url('/assets/heritage-books.webp') 20% center / auto 110% no-repeat; }
.course-hero::after { right: 0; background: linear-gradient(270deg,transparent 20%,#221a15 96%),url('/assets/heritage-globe.webp') right center / auto 115% no-repeat; }
.course-hero-inner { text-align: center; padding: clamp(2.6rem,5.7vw,5rem) 5rem; }
.course-hero p { margin-top: .55rem; }
.course-hero p::after { content: ""; display: block; width: 6rem; height: 3px; background: #c77b43; margin: 1.2rem auto 0; }
.course-layout { display: grid; grid-template-columns: minmax(215px,.85fr) minmax(0,2.6fr); gap: clamp(1rem,2.7vw,2.5rem); padding-block: 2rem 3rem; }
.course-sidebar { display: grid; align-content: start; gap: 1.05rem; }
.sidebar-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.sidebar-panel h2 { font-size: 1.27rem; background: var(--primary); color: white; padding: .67rem .9rem; }
.sidebar-panel > div { padding: .95rem; }
.sidebar-panel ul { margin: 0; padding-left: 1.12rem; }
.sidebar-panel .text-link { display: inline-block; margin-top: .7rem; }
.section-heading { margin-bottom: .82rem; display: flex; align-items: center; gap: .9rem; }
.section-heading::after { content: ""; flex: 1; height: 1px; background: var(--accent); }
.lesson-list, .resources-list { list-style: none; margin: 0; padding: 0; }
.lesson-list { display: grid; gap: .42rem; }
.lesson-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: .5rem; align-items: center; padding: .34rem .75rem; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; }
.lesson-title { display: flex; align-items: center; gap: .8rem; color: var(--heading); font: bold clamp(1.02rem,1.8vw,1.27rem)/1.2 var(--serif); text-decoration: none; min-height: 44px; }
.lesson-title:hover { text-decoration: underline; }
.lesson-number { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 2.45rem; border-radius: 4px; min-height: 1.84rem; color: white; background: #884419; }
.quick-links { display: flex; flex-wrap: wrap; align-items: center; }
.quick-link { padding: .6rem .45rem; font-size: .85rem; white-space: nowrap; }
.row-arrow { color: var(--accent); font-size: 1.6rem; }
.lesson-layout { max-width: 1050px; padding-block: 1.4rem 2.5rem; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .94rem; }
.lesson-heading { margin-block: 1.5rem 1.65rem; }
.lesson-heading p { font-weight: bold; color: #884419; margin-bottom: .4rem; }
.lesson-heading h1 { font-size: clamp(2rem,4.4vw,3.45rem); }
.lesson-layout h2 { font-size: clamp(1.36rem,2.3vw,1.72rem); margin-bottom: .75rem; }
.slide-viewer { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.slide-stage { display: grid; place-items: center; background: #172729; }
.slide-stage img { width: 100%; height: auto; }
.slide-controls { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem; background: #ece9de; border-bottom: 1px solid var(--line); }
.slide-controls button, .slide-controls select { font: inherit; color: var(--heading); background: var(--panel); border: 1px solid #8e9b94; border-radius: 4px; min-height: 44px; padding: .35rem .75rem; }
.slide-controls button { cursor: pointer; font-weight: bold; }
.slide-controls button:disabled { cursor: default; opacity: .52; }
.viewer-extra { padding: .65rem .85rem; }
.viewer-extra details { margin-top: .35rem; }
.viewer-extra summary { color: var(--primary); cursor: pointer; }
.viewer-extra details p { white-space: pre-line; max-width: 72ch; padding-block: .4rem; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .9rem; }
.lesson-materials { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-block: 2rem; }
.lesson-materials section { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1rem; }
.resource-item { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .35rem .8rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.resource-item div { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .9rem; }
.resource-item:last-child { border-bottom: none; }
.resource-directory { max-width: 1080px; }
.resource-directory h3 { margin-bottom: .65rem; }
.resource-directory .resources-list { padding-inline: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; }
.resource-directory section > section { margin-top: 1.8rem; }
.muted { color: var(--quiet); }
.lesson-pagination { display: flex; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.following { margin-left: auto; }

@media (max-width: 1000px) {
  .wrap { width: calc(100% - 3rem); }
  .header-inner { gap: .85rem; }
  .brand-context { padding-left: .85rem; }
  .site-header nav a { padding-inline: .6rem; }
  .quick-link { padding-inline: .32rem; }
  .course-layout { grid-template-columns: minmax(170px,.7fr) minmax(0,2fr); }
}
@media (max-width: 860px) {
  .wrap { width: calc(100% - 2rem); }
  .header-inner { display: grid; grid-template-columns: auto 1fr; gap: .65rem; padding-block: .75rem .4rem; }
  .site-header nav { grid-column: 1/-1; margin: 0; }
  .brand-context { font-size: .91rem; }
  .brand-context small { font-size: .55rem; }
  .features article { gap: .55rem; padding-inline: .65rem; grid-template-columns: 1.8rem minmax(0,1fr); }
  .features p { font-size: .92rem; }
  .home-directory { grid-template-columns: 1fr; gap: 1.35rem; }
  .about-teaser { border-left: 0; border-top: 1px solid var(--line); padding: 1rem 0 0; }
  .course-layout { grid-template-columns: 1fr; }
  .course-sidebar { grid-template-columns: 1fr 1fr; }
  .course-hero-inner { padding-inline: 1rem; }
  .course-hero::before, .course-hero::after { width: 46%; opacity: .62; }
}
@media (max-width: 480px) {
  .brand { font-size: 1.62rem; }
  .brand-context { font-size: .82rem; }
  .brand-context small { display: none; }
  .home-hero::before { inset: 22% 0 0; background-position: 68% center; }
  .home-hero::after { background: linear-gradient(180deg,#191d1a 3%,#211a16d8 36%,#211a1640 68%,transparent); }
  .hero-inner { min-height: 295px; padding-top: 1.8rem; }
  .hero-inner h1 { font-size: clamp(2rem,8vw,2.5rem); }
  .hero-inner p { max-width: 21ch; }
  .wide-break { display: none; }
  .features { grid-template-columns: 1fr; padding-block: .3rem; }
  .features article, .features article:first-child { padding: .75rem 0; }
  .features article + article { border-left: 0; border-top: 1px solid var(--line); }
  .features p { max-width: none; }
  .course-card { grid-template-columns: 31% minmax(0,1fr); gap: .65rem .85rem; padding-right: .65rem; }
  .course-card img { grid-row: span 2; }
  .course-card > div { align-self: end; padding-top: .6rem; }
  .course-card .button { justify-self: start; margin: 0 0 .65rem; padding: .45rem .65rem; min-height: 44px; }
  .course-sidebar, .lesson-materials { grid-template-columns: 1fr; }
  .lesson-row { grid-template-columns: 1fr auto; gap: 0 .4rem; }
  .quick-links { grid-row: 2; grid-column: 1/-1; padding-left: 3rem; }
  .quick-link { padding: .38rem .48rem; }
  .row-arrow { grid-row: 1; grid-column: 2; }
  .slide-controls button, .slide-controls select { padding-inline: .5rem; }
}
@media (max-width: 350px) {
  .slide-controls button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .site-header nav a { padding-inline: .45rem; }
}
