:root {
  --ink: #1d1d1b;
  --paper: #f5f2eb;
  --warm: #e6b3a6;
  --red: #a85747;
  --green: #2d7857;
  --soft-green: #dcebe3;
  --line: rgba(29, 29, 27, .14);
  --muted: #77736e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, a { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 720px; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 20px 114px; }
.topbar, .section-heading { display: flex; align-items: center; justify-content: space-between; }
.topbar { margin-bottom: 48px; }
.brand { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
.avatar { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: Georgia, serif; }
.eyebrow { margin: 0 0 11px; color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: .14em; line-height: 1.3; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.045em; }
h1 { max-width: 600px; margin-bottom: 17px; font-size: clamp(42px, 10vw, 68px); line-height: .98; }
h2 { margin-bottom: 0; font-size: 30px; line-height: 1.05; }
.lead { max-width: 470px; margin-bottom: 46px; color: #57534f; font-size: 15px; line-height: 1.48; }
.featured { overflow: hidden; border-radius: 4px; background: var(--ink); color: #fffdf8; box-shadow: 0 18px 34px rgba(47, 37, 31, .12); }
.featured-image { min-height: 220px; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.42)), url("assets/renoir-moulin.jpg") center/cover; }
.featured-content { padding: 26px 24px 25px; }
.featured .eyebrow { color: var(--warm); }
.featured h2 { font-size: 42px; }
.period { margin: 8px 0 23px; color: rgba(255,255,255,.66); font-size: 13px; }
.formula { display: flex; align-items: center; gap: 9px; margin-bottom: 28px; color: var(--warm); font-size: 13px; }
.formula i { width: 3px; height: 3px; border-radius: 50%; background: var(--warm); }
.primary-button, .secondary-button { border: 0; border-radius: 2px; transition: transform .2s ease, background .2s ease; }
.primary-button { width: 100%; padding: 15px 16px; background: var(--warm); color: var(--ink); font-weight: 750; text-align: left; }
.lesson-link { display: block; text-decoration: none; }
.primary-button span, .secondary-button span { float: right; font-size: 20px; line-height: .75; }
.primary-button:hover, .secondary-button:hover { transform: translateY(-2px); }
.progress-section { padding: 49px 0 38px; }
.progress-section h2 { font-size: 35px; }
.progress-count { color: var(--muted); font-size: 12px; }
.progress-track { height: 5px; margin-top: 18px; overflow: hidden; background: #ddd8cf; border-radius: 10px; }
.progress-track span { display: block; width: 4%; height: 100%; border-radius: inherit; background: var(--green); }
.section-heading.compact { margin-bottom: 14px; }
.section-heading.compact h2 { font-size: 35px; }
.text-button { border: 0; background: transparent; color: var(--red); font-size: 13px; font-weight: 700; }
.epoch-list { border-top: 1px solid var(--line); }
.epoch-card { display: flex; width: 100%; align-items: center; gap: 15px; padding: 20px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; }
.epoch-card:hover .epoch-copy strong { color: var(--red); }
.epoch-number { color: var(--red); font: 600 12px/1 Georgia, serif; }
.epoch-copy { flex: 1; }
.epoch-copy strong { display: block; margin-bottom: 5px; font: 400 24px/1 Georgia, serif; letter-spacing: -.03em; transition: color .2s ease; }
.epoch-copy small { color: var(--muted); font-size: 12px; }
.round-arrow { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: var(--green); color: white; font-size: 17px; }
.lock { color: #aaa6a0; font-size: 22px; }
.ritual { margin-top: 47px; padding: 25px 23px; background: var(--soft-green); }
.ritual h2 { margin-bottom: 9px; font-size: 34px; }
.ritual p:not(.eyebrow) { max-width: 390px; color: #46544c; font-size: 14px; line-height: 1.45; }
.secondary-button { width: 100%; margin-top: 10px; padding: 13px 0; border-bottom: 1px solid #779283; border-radius: 0; background: transparent; color: #285d45; font-weight: 750; text-align: left; }
.bottom-nav { position: fixed; z-index: 3; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; gap: min(9vw, 68px); padding: 13px 16px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(29,29,27,.08); background: rgba(250,248,243,.93); backdrop-filter: blur(12px); }
.nav-item { display: grid; gap: 4px; min-width: 49px; border: 0; background: transparent; color: #8b8780; font-size: 10px; place-items: center; }
.nav-item span { font-size: 20px; line-height: 1; }
.nav-item.active { color: var(--ink); font-weight: 700; }
.lesson-dialog { width: min(calc(100% - 38px), 440px); padding: 33px 26px 25px; border: 0; border-radius: 4px; background: var(--ink); color: white; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.lesson-dialog::backdrop { background: rgba(15, 14, 13, .55); backdrop-filter: blur(3px); }
.lesson-dialog h2 { margin-bottom: 15px; font-size: 43px; }
.lesson-dialog p:not(.eyebrow) { color: rgba(255,255,255,.75); line-height: 1.45; }
.lesson-dialog .eyebrow { color: var(--warm); }
.dialog-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: white; font-size: 30px; line-height: 1; }
.dialog-meta { display: flex; gap: 10px; margin: 24px 0; color: var(--warm); font-size: 12px; }
.dialog-meta span + span::before { margin-right: 10px; content: "·"; }
.toast { position: fixed; z-index: 5; left: 50%; bottom: 91px; width: max-content; max-width: calc(100% - 40px); padding: 12px 16px; border-radius: 99px; background: var(--ink); color: white; font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: opacity .25s ease, transform .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 620px) { .app-shell { padding-right: 34px; padding-left: 34px; } .featured { display: grid; grid-template-columns: .88fr 1fr; } .featured-image { min-height: 100%; } .featured-content { padding: 37px 34px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }

/* Lesson route */
.lesson-body { min-height: 100vh; background: var(--ink); }
.lesson-shell { position: relative; min-height: 100svh; max-width: 720px; margin: 0 auto; background: var(--ink); }
.lesson-topbar { position: absolute; z-index: 2; top: 0; right: 0; left: 0; display: flex; align-items: center; padding: max(18px, env(safe-area-inset-top)) 20px 15px; color: white; }
.back-link, .lesson-close { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; background: rgba(0,0,0,.3); color: white; font-size: 26px; text-decoration: none; }
.lesson-close { margin-left: auto; font-size: 29px; }
.lesson-top-copy { display: grid; gap: 3px; margin-left: 12px; color: white; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.lesson-top-copy small { color: rgba(255,255,255,.62); font-size: 10px; font-weight: 500; letter-spacing: .02em; }
.lesson-progress { position: absolute; z-index: 4; top: 0; right: 0; left: 0; height: 3px; background: rgba(255,255,255,.18); }
.lesson-progress span { display: block; width: 20%; height: 100%; background: var(--warm); transition: width .35s ease; }
.lesson-screen { min-height: calc(100svh - 76px); padding-bottom: 86px; }
.lesson-art { min-height: 43svh; background-position: center; background-size: cover; }
.lesson-art--hero { background-image: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.48)), url("assets/renoir-moulin.jpg"); }
.lesson-art--bridge { min-height: 39svh; background-image: url("assets/sisley-bridge.jpg"); background-position: center; }
.lesson-content { min-height: calc(57svh - 76px); padding: 30px 20px; }
.lesson-content--dark { background: var(--ink); color: white; }
.lesson-content--paper { background: var(--paper); color: var(--ink); }
.lesson-content h1 { max-width: 610px; margin-bottom: 19px; font-size: clamp(38px, 9.5vw, 60px); }
.lesson-content--dark .lesson-lead { color: rgba(255,255,255,.7); }
.lesson-lead { max-width: 540px; margin-bottom: 22px; color: #625e59; font-size: 17px; line-height: 1.45; }
.lesson-content p:not(.eyebrow):not(.lesson-lead):not(.art-caption):not(.answer-note) { max-width: 530px; font-size: 15px; line-height: 1.5; }
.art-caption { margin: 28px 0 0; color: rgba(255,255,255,.52); font-size: 11px; line-height: 1.4; }
.art-caption--dark { color: var(--muted); }
.fact-grid { display: grid; gap: 10px; margin: 29px 0; }
.fact-grid div { padding: 15px; border-left: 3px solid var(--red); background: #ebe6de; }
.fact-grid strong { display: block; margin-bottom: 5px; font-family: Georgia, serif; font-size: 19px; }
.fact-grid span { color: #5e5954; font-size: 13px; line-height: 1.35; }
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 34px; }
.timeline div { position: relative; padding: 18px 8px 0 0; border-top: 1px solid var(--ink); }
.timeline div::before { position: absolute; top: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); content: ""; }
.timeline b { display: block; margin-bottom: 8px; color: var(--red); font: 700 18px Georgia, serif; }
.timeline span { color: var(--muted); font-size: 10px; line-height: 1.25; }
.lesson-footer { position: fixed; z-index: 4; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: space-between; max-width: 720px; min-height: 76px; margin: 0 auto; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.13); background: rgba(29,29,27,.96); backdrop-filter: blur(10px); }
.screen-label { color: rgba(255,255,255,.62); font-size: 12px; }
.next-button { min-width: 158px; padding: 13px 16px; border: 0; border-radius: 2px; background: var(--warm); color: var(--ink); font-weight: 800; text-align: left; }
.next-button span { float: right; font-size: 18px; line-height: .8; }
.next-button:disabled { cursor: not-allowed; opacity: .42; }
.quiz-screen { display: flex; min-height: calc(100svh - 76px); flex-direction: column; justify-content: center; }
.answers { display: grid; gap: 10px; margin: 28px 0 16px; }
.answers button { padding: 16px; border: 1px solid rgba(255,255,255,.25); border-radius: 2px; background: transparent; color: white; font-size: 15px; line-height: 1.3; text-align: left; transition: background .2s ease, border-color .2s ease; }
.answers button:hover { border-color: var(--warm); }
.answers button.is-correct { border-color: #77c49b; background: #1d5e45; }
.answers button.is-wrong { border-color: #d0806e; background: #703e35; }
.answer-note { min-height: 45px; color: var(--warm); font-size: 14px; line-height: 1.4; }
.completion { display: flex; min-height: calc(100svh - 76px); flex-direction: column; justify-content: center; }
.completion-mark { display: grid; width: 55px; height: 55px; margin-bottom: 22px; place-items: center; border-radius: 50%; background: var(--green); color: white; font-size: 29px; }
.completion .lesson-link { margin-top: 14px; }
@media (min-width: 620px) { .lesson-content { padding: 56px 52px; } .lesson-art--hero { min-height: 53svh; } .lesson-art--bridge { min-height: 47svh; } .lesson-content h1 { font-size: 60px; } .fact-grid { grid-template-columns: 1fr 1fr; } }

/* Complete impressionism course */
.course-body { background: var(--paper); color: var(--ink); }
.course-header { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; max-width: 960px; margin: 0 auto; padding: 10px 18px; border-bottom: 1px solid var(--line); background: rgba(245,242,235,.93); backdrop-filter: blur(12px); }
.course-header .back-link { width: 34px; height: 34px; background: var(--ink); font-size: 21px; }
.course-brand { display: grid; margin-left: 11px; color: var(--ink); font: 700 17px/1 Georgia, serif; text-decoration: none; }
.course-brand span { margin-top: 4px; color: var(--muted); font: 10px/1.1 Inter, sans-serif; }
.course-progress { width: 42px; height: 42px; margin-left: auto; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 11px; }
.course-progress b { color: var(--green); }
.course { max-width: 960px; margin: 0 auto; }
.course-hero { overflow: hidden; background: var(--ink); color: white; }
.course-hero-image { min-height: 360px; background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.45)), url("assets/renoir-moulin.jpg") center/cover; }
.course-hero-copy { padding: 34px 21px 39px; }
.course-hero-copy h1 { margin-bottom: 14px; font-size: clamp(49px, 12vw, 85px); }
.course-hero-copy > p:not(.eyebrow) { max-width: 500px; color: rgba(255,255,255,.7); font-size: 16px; line-height: 1.48; }
.course-hero-copy .primary-button { max-width: 330px; margin-top: 25px; }
.course-map { display: flex; overflow-x: auto; gap: 21px; padding: 20px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.course-map a { display: grid; min-width: max-content; gap: 4px; color: var(--ink); font: 16px/1 Georgia, serif; text-decoration: none; }
.course-map b { color: var(--red); font: 700 10px/1 Inter, sans-serif; letter-spacing: .12em; }
.course-chapter { padding: 58px 20px; scroll-margin-top: 65px; }
.course-chapter > h2 { margin-bottom: 14px; font-size: clamp(42px, 10vw, 64px); }
.chapter-intro { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; max-width: 650px; margin-bottom: 29px; color: #5e5954; font-size: 17px; line-height: 1.45; }
.chapter-intro p { margin: 0; }
.chapter-intro span { min-width: max-content; color: var(--red); font-size: 11px; font-weight: 700; }
.story-card { margin-top: 14px; padding: 25px 20px; }
.story-card h3, .quiz h3, .final-test h3 { margin: 0 0 12px; font: 400 clamp(28px, 7vw, 42px)/1.05 Georgia, serif; letter-spacing: -.04em; }
.story-card p { max-width: 650px; margin-bottom: 0; font-size: 15px; line-height: 1.55; }
.story-card--paper { background: #e8e2d9; }
.story-card--dark { background: var(--ink); color: white; }
.story-card--dark p:not(.eyebrow) { color: rgba(255,255,255,.74); }
.story-card img { display: block; width: 100%; max-width: 570px; margin-top: 24px; }
.story-card small { display: block; margin-top: 9px; color: rgba(255,255,255,.55); font-size: 10px; }
.course-chapter--dark { background: var(--ink); color: white; }
.course-chapter--dark .chapter-intro { color: rgba(255,255,255,.7); }
.formula-lesson { display: grid; gap: 2px; }
.formula-lesson > div { padding: 19px; background: #2a2a28; }
.formula-lesson b { color: var(--warm); font: 400 44px/1 Georgia, serif; }
.formula-lesson h3 { margin: -35px 0 10px 55px; font: 400 25px/1 Georgia, serif; }
.formula-lesson p { margin: 0; color: rgba(255,255,255,.65); font-size: 13px; line-height: 1.45; }
.featured-art { margin: 25px 0 0; }
.featured-art img { display: block; width: 100%; max-height: 610px; object-fit: cover; }
.featured-art figcaption { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.course-chapter--dark .featured-art figcaption { color: rgba(255,255,255,.53); }
.cheatsheet { margin-top: 22px; border-top: 1px solid rgba(255,255,255,.24); border-bottom: 1px solid rgba(255,255,255,.24); }
.cheatsheet summary { padding: 18px 0; cursor: pointer; font: 400 24px/1 Georgia, serif; list-style: none; }
.cheatsheet summary::-webkit-details-marker { display: none; }
.cheatsheet summary span { float: right; color: var(--warm); }
.cheatsheet div { padding: 0 0 14px; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.4; }
.cheatsheet p { margin: 10px 0; }
.quiz { margin-top: 30px; padding: 25px 20px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.course-chapter--dark .quiz { border: 0; background: #f1eee7; }
.quiz .answers, .final-test .answers { margin: 22px 0 12px; }
.quiz .answers button, .final-test .answers button { border-color: var(--line); color: var(--ink); }
.quiz .answers button.is-correct, .final-test .answers button.is-correct { border-color: #77c49b; background: #d7f0e1; color: #15432e; }
.quiz .answers button.is-wrong, .final-test .answers button.is-wrong { border-color: #cf978a; background: #f5dcd5; color: #68362c; }
.quiz .answer-note { min-height: 22px; color: var(--green); }
.artist-grid { display: grid; gap: 12px; }
.artist-card { display: grid; grid-template-columns: 39% 1fr; min-height: 170px; overflow: hidden; background: #e8e2d9; }
.artist-card img { width: 100%; height: 100%; min-height: 170px; object-fit: cover; }
.artist-card div { padding: 17px 15px; }
.artist-card .eyebrow { margin-bottom: 7px; font-size: 9px; }
.artist-card h3 { margin: 0 0 9px; font: 400 24px/1 Georgia, serif; letter-spacing: -.03em; }
.artist-card p:not(.eyebrow) { margin: 0; color: #615c55; font-size: 12px; line-height: 1.35; }
.notice { margin-top: 18px; padding: 18px; border-left: 3px solid var(--red); background: #ebe6de; font-size: 14px; line-height: 1.45; }
.notice b { display: block; margin-bottom: 4px; font-family: Georgia, serif; font-size: 18px; }
.memory-grid { display: grid; gap: 2px; }
.memory-grid article { display: grid; gap: 9px; padding: 19px; background: #2a2a28; }
.memory-grid b { color: var(--warm); font: 400 24px/1 Georgia, serif; }
.memory-grid span { font: 15px/1.4 Georgia, serif; }
.memory-grid small { color: rgba(255,255,255,.58); font-size: 11px; line-height: 1.35; }
.final-test { max-width: 620px; padding: 24px 20px; background: #e8e2d9; }
.final-test article > span { display: block; margin-bottom: 20px; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.final-result { padding: 10px 0; }
.final-result p:not(.eyebrow) { color: #5e5954; font-size: 15px; line-height: 1.45; }
.source-note { padding: 25px 20px 50px; background: #ddd8cf; color: #6b655d; font-size: 11px; line-height: 1.45; }
.source-note p { max-width: 670px; margin: 0; }
@media (min-width: 720px) { .course-hero { display: grid; grid-template-columns: 1.03fr .97fr; } .course-hero-image { min-height: 520px; } .course-hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 54px; } .course-chapter { padding: 78px 60px; } .course-map { padding: 23px 60px; } .story-card { padding: 33px; } .formula-lesson { grid-template-columns: repeat(3, 1fr); } .artist-grid { grid-template-columns: repeat(2, 1fr); } .artist-card { grid-template-columns: 44% 1fr; } .memory-grid { grid-template-columns: repeat(2, 1fr); } .course-header { padding-right: 35px; padding-left: 35px; } }
