@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Libre+Caslon+Display&display=swap');

:root {
  --navy: #0b2538;
  --blue: #446b83;
  --mist: #eaf1f3;
  --cyan: #72c5cf;
  --gold: #f0c95e;
  --ink: #102535;
  --paper: #f7f6f1;
  --white: #fff;
  --header-h: 76px;
  --controls-h: 86px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #dfe7e9; color: var(--ink); }
body { font-family: 'DM Sans', Arial, sans-serif; overflow: hidden; }
button, a { font: inherit; }
.skip-link { position: fixed; left: 10px; top: -50px; z-index: 50; background: #fff; color: #000; padding: 10px; }
.skip-link:focus { top: 10px; }
.lesson { min-height: 100dvh; display: grid; grid-template-rows: var(--header-h) minmax(0, 1fr) var(--controls-h); }

.topbar { background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 10px clamp(18px, 4vw, 64px); border-bottom: 1px solid #dce4e6; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; }
.brand img { width: 54px; height: 54px; object-fit: contain; }
.brand span { display: grid; line-height: 1.05; }
.brand strong { letter-spacing: .16em; font-size: 20px; }
.brand small { margin-top: 5px; font-size: 10px; }
.lesson-meta { display: flex; align-items: center; gap: 24px; font-size: 13px; font-weight: 700; }
.lesson-meta strong { color: #0c6073; letter-spacing: .18em; }

.stage { min-height: 0; position: relative; overflow: hidden; }
.slide { display: none; height: 100%; overflow: auto; background: var(--paper); animation: reveal .35s ease both; }
.slide.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }

h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: 'Libre Caslon Display', Georgia, serif; font-weight: 400; line-height: .98; }
h1 { font-size: clamp(52px, 6.8vw, 108px); margin-bottom: 28px; }
h2 { font-size: clamp(38px, 4.7vw, 74px); margin-bottom: 24px; }
h3 { font-size: 22px; margin-bottom: 6px; }
.eyebrow { margin-bottom: 24px; color: var(--cyan); font-size: 12px; font-weight: 700; letter-spacing: .24em; }
.eyebrow.dark { color: #247b8b; }
.lead { max-width: 850px; font-size: clamp(18px, 1.65vw, 27px); line-height: 1.52; color: rgba(255,255,255,.86); }
.lead.dark { color: #4b5c66; }

.cover { padding: clamp(38px, 8vh, 100px) clamp(28px, 5.7vw, 110px); background: linear-gradient(125deg, #748fa3 0%, #88a8b6 52%, #69cad2 100%); color: #fff; position: relative; overflow: hidden; }
.cover::before { content: ''; position: absolute; width: 70vw; height: 70vw; right: -22vw; top: -48vw; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; box-shadow: 0 0 0 120px rgba(255,255,255,.025), 0 0 0 260px rgba(255,255,255,.02); }
.cover-copy { width: min(68%, 1080px); position: relative; z-index: 1; }
.cover h1 em { color: #ffdf83; font-style: normal; }
.tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.tags span { border: 1px solid rgba(255,255,255,.45); padding: 8px 14px; font-size: 12px; font-weight: 700; }
.cover-mark { position: absolute; right: 5vw; top: 50%; transform: translateY(-50%); width: min(25vw, 370px); padding: 40px; background: rgba(73,99,111,.34); border: 1px solid rgba(255,255,255,.18); display: grid; gap: 28px; }
.cover-mark img { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; justify-self: center; }
.cover-mark strong { font-family: 'Libre Caslon Display', Georgia, serif; font-size: clamp(28px, 2.8vw, 44px); line-height: 1.06; }
.cover-mark small { color: rgba(255,255,255,.7); }

.split { min-height: 100%; padding: clamp(42px, 8vh, 100px) clamp(30px, 6vw, 120px); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: clamp(40px, 7vw, 120px); align-items: center; }
.question-stack { border-left: 1px solid #b8cbd0; }
.question-stack div { display: grid; grid-template-columns: 70px 1fr; align-items: center; min-height: 110px; border-bottom: 1px solid #cddbdd; padding: 16px 22px; }
.question-stack span { color: #2e8190; font-weight: 700; }
.question-stack p { margin: 0; font-size: 19px; }

.wide-copy, .table-wrap, .checklist-wrap { min-height: 100%; padding: clamp(36px, 6vh, 74px) clamp(30px, 6vw, 120px); display: flex; flex-direction: column; justify-content: center; }
.wide-copy > h2 { max-width: 1200px; }
.objective-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #b9cdd0; border: 1px solid #b9cdd0; }
.objective-grid > div { background: #f7f6f1; padding: clamp(22px, 3vw, 42px); }
.objective-grid b { color: #238091; font-size: 12px; letter-spacing: .16em; }
.objective-grid p { margin-bottom: 0; color: #53636c; line-height: 1.5; }
.closing-line { margin: 28px 0 0; font-weight: 700; color: #a94d3c; }

.image-slide { position: relative; background: var(--navy); color: #fff; }
.image-slide > img { position: absolute; inset: 0; width: 58%; height: 100%; object-fit: cover; opacity: .76; }
.image-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,37,56,.04) 25%, var(--navy) 58%); }
.image-copy { position: relative; z-index: 1; margin-left: 53%; min-height: 100%; padding: clamp(50px, 8vh, 100px) clamp(34px, 6vw, 100px); display: flex; flex-direction: column; justify-content: center; }
.image-copy p:not(.eyebrow) { font-size: 21px; line-height: 1.55; color: #cbd8de; }
.big-quote { margin-top: 24px; padding: 24px 0; border-top: 1px solid #456273; color: var(--gold); font-family: 'Libre Caslon Display', Georgia, serif; font-size: 30px; }

.wide-copy.compact h2 { margin-bottom: 30px; }
.source-lines { border-top: 1px solid #bccdd1; }
.source-lines p { margin: 0; padding: 16px 0; border-bottom: 1px solid #bccdd1; display: grid; grid-template-columns: minmax(220px, .7fr) 1.3fr; align-items: center; }
.source-lines strong { font-size: 20px; }
.source-lines span { color: #5b6c75; }
.callout { align-self: flex-start; margin-top: 24px; background: var(--navy); color: #fff; padding: 16px 22px; font-weight: 700; }

.table-wrap table { width: 100%; max-width: 1220px; border-collapse: collapse; font-size: clamp(14px, 1.2vw, 19px); }
th { background: var(--navy); color: #fff; text-align: left; padding: 14px 18px; }
td { padding: 11px 18px; border-bottom: 1px solid #c2d1d4; }
tbody tr:nth-child(even) { background: #edf2f1; }
td:last-child { color: #226f7e; font-weight: 700; }

.visual-explain { min-height: 100%; grid-template-columns: .9fr 1.1fr; gap: 50px; align-items: center; padding: 36px 5vw; }
.visual-explain.active { display: grid; }
.visual-explain figure img { max-height: calc(100dvh - var(--header-h) - var(--controls-h) - 118px); }
.visual-copy ol { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid #bfd0d3; }
.visual-copy li { display: grid; grid-template-columns: 150px 1fr; padding: 13px 0; border-bottom: 1px solid #bfd0d3; }
.visual-copy li span { color: #5a6a72; }
figure { margin: 0; min-width: 0; }
figure img { display: block; max-width: 100%; max-height: calc(100dvh - var(--header-h) - var(--controls-h) - 78px); margin: auto; object-fit: contain; }
figcaption { margin-top: 8px; text-align: center; font-size: 12px; color: #65747a; }

.search-list { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #b6c9cd; border-left: 1px solid #b6c9cd; }
.search-list div { min-height: 130px; display: grid; grid-template-columns: 46px 1fr; grid-template-rows: auto auto; padding: 24px; border-right: 1px solid #b6c9cd; border-bottom: 1px solid #b6c9cd; }
.search-list span { grid-row: 1 / 3; color: #208092; font-size: 12px; font-weight: 700; }
.search-list strong { font-size: 19px; }
.search-list small { margin-top: 7px; color: #637179; line-height: 1.4; }

.formula { margin-top: 30px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.formula span { background: #dcebed; color: #126071; padding: 12px 16px; font-weight: 700; }
.formula b { color: #ad5b45; }
.steps p { display: grid; grid-template-columns: 54px 1fr; align-items: center; margin: 0; padding: 14px 0; border-bottom: 1px solid #bfcfd2; }
.steps b { color: #268092; }

.image-board { min-height: 100%; background: var(--navy); color: #fff; padding: clamp(28px, 5vh, 62px) 5vw; }
.image-board.active { display: grid; grid-template-columns: .65fr 1.35fr; align-items: center; gap: 4vw; }
.board-copy p:not(.eyebrow) { color: #cad6db; font-size: 19px; line-height: 1.55; }
.image-board > img { width: 100%; max-height: calc(100dvh - var(--header-h) - var(--controls-h) - 60px); object-fit: contain; }
.image-board h2 { font-size: clamp(36px, 3.8vw, 62px); }

.visual-wide { padding: 36px 5vw; min-height: 100%; align-items: center; grid-template-columns: .65fr 1.35fr; gap: 4vw; }
.visual-wide.active { display: grid; }
.visual-wide figure img { max-height: calc(100dvh - var(--header-h) - var(--controls-h) - 72px); }

.ai-slide .warning { background: var(--navy); color: #fff; padding: clamp(28px, 4vw, 58px); }
.warning > span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--gold); color: var(--navy); font-size: 30px; font-weight: 700; }
.warning h3 { margin-top: 26px; font-family: 'Libre Caslon Display', Georgia, serif; font-size: 38px; }
.warning p { color: #cad7dc; font-size: 18px; line-height: 1.55; }
.warning strong { color: var(--gold); letter-spacing: .08em; }

.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.checklist p { display: grid; grid-template-columns: 58px 1fr; align-items: center; margin: 0; min-height: 62px; border-bottom: 1px solid #bdcfd2; }
.checklist b { color: #1b7d8f; font-size: 12px; }
.checklist span { font-size: 17px; }

.visual-map { background: linear-gradient(110deg, var(--navy) 0 36%, #f3f2ed 36%); color: #fff; padding: 38px 4vw; min-height: 100%; align-items: center; grid-template-columns: .58fr 1.42fr; gap: 5vw; }
.visual-map.active { display: grid; }
.map-copy p:not(.eyebrow) { color: #c9d6dc; font-size: 18px; line-height: 1.55; }
.visual-map img { width: 100%; max-height: calc(100dvh - var(--header-h) - var(--controls-h) - 86px); object-fit: contain; }

.finale { min-height: 100%; padding: clamp(42px, 8vh, 90px) clamp(30px, 9vw, 170px); background: linear-gradient(125deg, #7895a7, #64c3cc); color: #fff; }
.finale > div { max-width: 1160px; }
.mission { margin: 32px 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid rgba(255,255,255,.38); border-bottom: 1px solid rgba(255,255,255,.38); }
.mission p { padding: 22px; margin: 0; border-right: 1px solid rgba(255,255,255,.25); line-height: 1.45; }
.mission p:last-child { border-right: 0; }
.mission b { display: block; color: var(--gold); margin-bottom: 10px; }
.final-line { font-family: 'Libre Caslon Display', Georgia, serif; font-size: clamp(28px, 3vw, 48px); color: #fff0b3; }

.controls { background: #fff; display: grid; grid-template-columns: 130px minmax(140px, 420px) 130px; justify-content: center; align-items: center; gap: 22px; padding: 14px 20px; border-top: 1px solid #d6e0e2; }
.controls button { height: 48px; border: 0; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.controls button:first-child { background: #8fa0aa; }
.controls button:disabled { opacity: .38; cursor: default; }
.controls button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.progress { height: 5px; background: #dce7e8; overflow: hidden; }
.progress span { display: block; height: 100%; width: 6.666%; background: var(--gold); transition: width .3s ease; }

@media (max-width: 980px) {
  :root { --header-h: 68px; --controls-h: 72px; }
  .lesson-meta > span, .brand small { display: none; }
  .brand img { width: 45px; height: 45px; }
  .cover-copy { width: 100%; }
  .cover-mark { display: none; }
  .split, .visual-explain.active, .visual-wide.active, .image-board.active, .visual-map.active { grid-template-columns: 1fr; align-content: start; gap: 28px; }
  .split { padding-top: 36px; }
  .question-stack { border-left: 0; }
  .objective-grid { grid-template-columns: 1fr 1fr; }
  .image-slide > img { width: 100%; opacity: .25; }
  .image-slide::after { background: rgba(11,37,56,.68); }
  .image-copy { margin-left: 0; }
  .search-list { grid-template-columns: 1fr 1fr; }
  .image-board > img, .visual-wide figure img, .visual-map img { max-height: 45vh; }
  .visual-map { background: var(--navy); }
  .mission { grid-template-columns: 1fr; }
  .mission p { padding: 10px 0; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.2); }
  .mission b { display: inline; margin-right: 8px; }
}

@media (max-width: 620px) {
  h1 { font-size: 46px; }
  h2 { font-size: 38px; }
  .topbar { padding-inline: 14px; }
  .lesson-meta { gap: 8px; }
  .cover, .wide-copy, .table-wrap, .checklist-wrap, .split, .finale { padding: 28px 20px; }
  .objective-grid, .search-list, .checklist { grid-template-columns: 1fr; }
  .source-lines p { grid-template-columns: 1fr; gap: 6px; }
  .table-wrap { justify-content: flex-start; }
  table { min-width: 720px; }
  .table-wrap { overflow-x: auto; }
  .controls { grid-template-columns: 100px 1fr 100px; gap: 9px; padding: 10px; }
  .controls button { font-size: 11px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .slide { animation: none; }
  .progress span { transition: none; }
}
