:root {
    color-scheme: light;
    --paper: #fbf9f5;
    --ink: #243342;
    --muted: #4b5b66;
    --line: #d4d9dc;
    --accent: #125d9a;
    --accent-hover: #0b4b80;
    --forest: #173c31;
    --light: #fcfdff;
    --serif: Georgia, "Times New Roman", serif;
    --body: Optima, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 5.5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--body); overflow-wrap: anywhere; }
img { display: block; width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 3px solid #a05b21; outline-offset: 3px; }
button, input { font: inherit; }
h1, h2, legend { font-family: var(--serif); font-weight: 400; line-height: 1.13; text-wrap: balance; }
h1 { margin: 0 0 1rem; font-size: clamp(2.55rem, 6vw, 4.85rem); letter-spacing: -.05em; }
h2 { margin: 0 0 .65rem; font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.028em; }
p { margin: 0 0 .9rem; }
figure { margin: 0; }
figcaption, .source { font-size: .875rem; color: var(--muted); }
.shell { width: calc(100% - 2rem); max-width: 68rem; margin-inline: auto; }
.reading { max-width: 51rem; min-height: 64vh; padding-block: clamp(2rem, 5vw, 5rem); }
.skip { position: absolute; left: 1rem; top: 1rem; transform: translateY(-180%); padding: .6rem; background: var(--paper); z-index: 1; }
.skip:focus { transform: translateY(0); }
.header { position: sticky; top: 0; z-index: 4; background: var(--paper); border-bottom: 1px solid #293a5124; }
@supports ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))) {
    .header { background: rgb(250 247 240 / .67); -webkit-backdrop-filter: blur(14px) saturate(145%); backdrop-filter: blur(14px) saturate(145%); }
}
.header-inner { min-height: 4.25rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1rem; }
.header-inner > * { min-width: 0; max-width: 100%; }
.wordmark { display: inline-flex; align-items: center; gap: .62rem; line-height: 1.1; font-family: var(--serif); font-size: clamp(1rem, 3.5vw, 1.3rem); font-weight: 700; text-decoration: none; color: #152942; }
.wordmark img { flex: 0 0 auto; width: 2.625rem; height: 2.625rem; border-radius: .63rem; }
.header nav, .footer nav { display: flex; gap: clamp(.65rem, 3vw, 1.6rem); flex-wrap: wrap; }
.header nav { gap: .25rem; }
.header nav a { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .7rem; border-radius: .45rem; font-weight: 700; text-decoration: none; color: #173556; }
.header nav a:hover, .header nav a[aria-current] { background: #1e549012; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .58rem 1rem; border: 1px solid transparent; border-radius: .25rem; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; transition: background-color .17s ease, border-color .17s ease; }
.primary { color: var(--light); background: var(--accent); }
.primary:hover { background: var(--accent-hover); }
.secondary { color: var(--accent); background: transparent; border-color: #7e9aaf; }
.secondary:hover { background: #e9f0f7; border-color: var(--accent); }
button:disabled { cursor: default; opacity: .48; }
.hero {
    position: relative;
    isolation: isolate;
    background: #efe6d8;
    border-bottom: 1px solid #ddd0bf;
}
.hero::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    opacity: .28;
    background:
        linear-gradient(90deg, #efe6d8 5%, #efe6d8e0 34%, #efe6d859 70%, #efe6d83d),
        url("ev-1066.jpg") right 42% center / cover no-repeat;
    pointer-events: none;
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 1.65rem; padding-block: clamp(1.75rem, 6svh, 3.4rem); }
.hero h1 { font-size: clamp(2.35rem, 6.8vw, 5.45rem); }
.hero .eyebrow { color: #735033; }
.hero p:not(.eyebrow) { max-width: 36ch; color: #364a58; font-size: 1.125rem; }
.hero p.hero-note { font-size: .9rem; margin: 0; }
.app-screen { width: 100%; max-width: 14rem; }
.app-screen img { border: 1px solid var(--line); border-radius: .9rem; }
.hero-demo { width: min(100%, 15rem); justify-self: center; scroll-margin-top: 1rem; }
.phone-frame { padding: .35rem; border-radius: 2rem; background: #26333d; box-shadow: 0 .55rem 1.5rem #41362526; }
.phone-frame video { display: block; width: 100%; height: auto; aspect-ratio: 608 / 1322; border-radius: 1.65rem; background: #f7f8f8; }
.demo-controls { display: flex; justify-content: center; gap: .7rem; margin-top: .12rem; }
.demo-controls button { border: 0; background: transparent; color: #344b5d; min-height: 44px; padding: .15rem .22rem; cursor: pointer; font-size: .85rem; }
.demo-controls button:hover, .demo-controls button[aria-pressed="true"] { color: var(--accent); text-decoration: underline; }
.eyebrow, .label { color: #34604c; font-size: .875rem; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.topics { padding-block: clamp(2.1rem, 6vw, 4.4rem); }
.topic-list, .place-list { padding: 0; list-style: none; }
.topic-list li { border-top: 1px solid var(--line); }
.topic-list li:last-child { border-bottom: 1px solid var(--line); }
.topic-list a { display: grid; gap: .08rem .8rem; padding: .8rem 0; text-decoration: none; }
.topic-list a:hover strong { text-decoration: underline; }
.topic-list span { color: var(--muted); }
.app-callout { display: flex; align-items: start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 0 2.7rem; }
.app-callout p { margin-bottom: 0; }
.footer { padding: 1.4rem 0 2.1rem; border-top: 1px solid var(--line); font-size: .9rem; }
.footer p { color: var(--muted); }
.footer a { display: inline-flex; align-items: center; min-height: 44px; }
.analytics-choice { position: fixed; inset: auto 0 0; z-index: 5; max-height: 45vh; overflow: auto; background: var(--paper, #fff); border-top: 1px solid var(--line); box-shadow: 0 -.25rem 1.25rem rgb(0 0 0 / .12); }
.analytics-layout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .9rem 1.5rem; padding-block: .9rem; }
.analytics-layout > div:first-child { flex: 2 1 24rem; }
.analytics-layout h2 { margin: 0 0 .3rem; font-size: 1.1rem; }
.analytics-layout p { margin: 0; font-size: .9rem; }
.analytics-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.analytics-actions .button { font-size: .9rem; }
.page-lead { margin-bottom: 1.7rem; }
.intro { max-width: 54ch; color: var(--muted); font-size: 1.15rem; }
.page-action { margin-block: 1.8rem; display: flex; gap: .7rem 1rem; flex-wrap: wrap; align-items: center; }
.lesson, .place-list li { padding-block: 1.25rem; border-top: 1px solid var(--line); }
.lesson > :last-child, .place-list li > :last-child { margin-bottom: 0; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.people-grid, .place-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.portrait { margin-bottom: .65rem; }
.portrait img { aspect-ratio: 1; object-fit: cover; object-position: 50% 22%; background: #dbe5d6; }
.study-image { max-width: 28rem; }
figcaption { margin-top: .38rem; }
.check, .review { margin-block: 1.6rem; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: .8rem .2rem; font-weight: 700; }
details p { padding-inline: 1.2rem .2rem; }
.audio-note { font-size: .9rem; font-weight: 700; color: var(--muted); }
.paper-picker, .timer-option { display: flex; align-items: center; gap: .6rem; min-height: 44px; }
.paper-picker select { min-width: 8rem; min-height: 44px; font: inherit; color: var(--ink); background: var(--light); border: 1px solid #7e9aaf; border-radius: .25rem; padding-inline: .55rem; }
.test-status > .label { grid-column: 1 / -1; }
input { accent-color: var(--forest); }
.test-status { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .35rem .8rem; margin-bottom: 1.5rem; }
.test-status p { margin: 0; }
#timer { font-variant-numeric: tabular-nums; font-weight: 700; }
progress { grid-column: 1 / -1; width: 100%; height: .8rem; accent-color: var(--forest); }
.question { margin: 0; padding: 0; border: 0; min-width: 0; }
.question legend { display: block; max-width: 100%; padding: 0; margin-bottom: .5rem; font-size: clamp(1.45rem, 4vw, 2rem); text-wrap: pretty; }
.question-type { color: var(--muted); }
.choice { display: flex; align-items: center; gap: .7rem; margin-bottom: .5rem; min-height: 48px; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .25rem; cursor: pointer; }
.choice:has(:checked) { border-color: #366550; background: #e8f0e6; }
.choice input { flex: none; width: 1.12rem; height: 1.12rem; margin: 0; }
.test-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 1.1rem; }
.quiet-button { color: var(--accent); border: 0; background: transparent; padding: .5rem 0; margin-block: .25rem; min-height: 44px; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.notice { padding: .82rem; background: #f2ead6; border: 1px solid #d6c29c; }
.score-box { background: #e8f0e6; padding: 1.2rem 1.4rem; margin-bottom: 1.25rem; }
.score-box h2 { font-size: clamp(2.2rem, 6vw, 3.7rem); }
.score-box p:last-child { margin-bottom: 0; }

@media (max-width: 30rem) {
    .header-inner { min-height: 3.75rem; padding-block: .25rem; gap: 0 .25rem; }
    .wordmark { gap: .38rem; }
    .wordmark img { width: 2.15rem; height: 2.15rem; border-radius: .52rem; }
    .header nav a { padding-inline: .48rem; font-size: .91rem; }
}
@media (max-width: 22rem) {
    html { scroll-padding-top: 7rem; }
}
@media (min-width: 39rem) {
    .shell { width: calc(100% - 3.5rem); }
    .reading { max-width: 51rem; }
    .hero-inner { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
    .hero-demo { width: min(100%, 16rem, max(12rem, calc(37svh - 2rem))); }
    .topic-list a { grid-template-columns: minmax(11rem, .7fr) minmax(0, 2fr); }
    .app-lesson .lesson-layout:has(.app-screen) { grid-template-columns: minmax(0, 1fr) minmax(0, 14rem); }
    .place-photos { gap: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-block: 1.15rem .65rem; }
.hero-actions .secondary { background: #fbf9f5d9; }
.hero-actions .secondary:hover { background: #e9f0f7; }
.reference-filter { display: grid; gap: .3rem; margin-block: 1rem 1.2rem; }
.reference-filter label { font-weight: 700; }
.reference-filter input { width: min(100%, 30rem); min-height: 46px; padding: .5rem .7rem; border: 1px solid #7e9aaf; border-radius: .25rem; background: var(--light); color: var(--ink); }
.reference-filter p { margin: 0; color: var(--muted); font-size: .875rem; }
.reference-index ul { display: flex; flex-wrap: wrap; gap: .1rem 1rem; list-style: none; padding: 0; margin: 0; }
.reference-index a { display: inline-flex; align-items: center; min-height: 44px; }
.reference-group { margin-block: 2rem 2.65rem; }
.reference-group h2 { margin-bottom: .85rem; }
.reference-prehistory { border-top: 1px solid var(--line); padding-block: .75rem; }
.reference-prehistory p { margin: .16rem 0 0; }
.reference-entry summary { min-height: 44px; padding-inline: .25rem; }
.reference-entry summary strong { color: var(--ink); }
.reference-entry summary span { display: block; padding-inline-start: 1.12rem; font-size: .91rem; font-weight: 400; color: var(--muted); }
.reference-entry summary time { display: inline-block; min-width: 3.4rem; color: #34604c; }
.reference-entry summary:hover strong { text-decoration: underline; text-underline-offset: .18em; }
.reference-entry[open] { background: #fffdf9; }
.reference-body { padding: .25rem clamp(.65rem, 3vw, 1.4rem) 1.15rem; max-width: 70ch; }
.reference-body p { padding: 0; }
.reference-body h3 { font-size: 1rem; margin-block: 1.15rem .4rem; }
.reference-body .study-image { margin-top: .8rem; }
.reference-body .portrait { max-width: 14rem; }
.reference-notes { border-inline-start: 2px solid var(--line); padding-inline-start: .8rem; margin-block: .65rem 1rem; }
.reference-notes dt { font-weight: 700; }
.reference-notes dd { margin: 0; }
.reference-notes dt:not(:first-child) { margin-top: .65rem; }
.reference-hint { font-size: .875rem; color: var(--muted); }

.guide-lead h1 { font-size: clamp(2.15rem, 5.3vw, 3.85rem); }
.guide-lead .intro, .guide-topic > p { max-width: 68ch; }
.guide-topic h2, main:has(.guide-lead) > section > h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
.guide-chapters { margin-block: .8rem 0; padding-inline-start: 1.4rem; }
.guide-chapters li { padding-inline-start: .45rem; }
.guide-chapters li + li { margin-top: .95rem; }
.guide-chapters a { display: inline-flex; min-height: 42px; align-items: center; }
.guide-chapters p { margin: 0; }
.guide-quick-group { margin-block: 1.35rem; max-width: 72ch; }
.guide-quick-group h3 { margin-bottom: .45rem; }
.guide-quick-group dl { margin: 0; }
.guide-quick-group dt { font-weight: 700; }
.guide-quick-group dd { margin: .1rem 0 .65rem; }
.guide-contents { margin-block: 1.3rem; }
.guide-contents nav { padding: .1rem .4rem .75rem; }
.guide-footer { border-top: 1px solid var(--line); padding-top: 1rem; }
.app-download { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }
.app-store-badge { display: inline-flex; border-radius: .35rem; }
.app-store-badge img { width: 150px; height: 50px; }
.app-store-qr { width: max-content; max-width: 100%; }
.app-store-qr img { width: 168px; height: auto; margin-inline: auto; }
.app-store-qr figcaption { text-align: center; }

.study-reading { max-width: 68rem; }
.study-reading .page-lead h1 { font-size: clamp(2.15rem, 5.3vw, 3.85rem); }
.study-reading .app-lesson p, .study-reading .check p { max-width: 68ch; }
.dates-grid, .study-feature-grid, .geography-layout, .chapter-layout, .guide-quick-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: clamp(1.5rem, 4vw, 3rem);
}
.study-feature-grid { row-gap: .8rem; }
.study-feature-grid .study-image { max-width: 22rem; }
.geography-layout { align-items: start; }
.geography-layout .map { width: min(100%, 29rem); }
.geography-layout .map img { border: 1px solid var(--line); }
.geography-layout .place-list { margin: 1rem 0 .75rem; }
.chapter-toc-desktop { display: none; }

@media (max-width: 39rem) {
    .app-store-qr img { width: 148px; }
}

@media (min-width: 52rem) {
    .dates-grid, .study-feature-grid, .geography-layout, .guide-quick-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .geography-layout .place-list { margin-top: 0; }
    .chapter-layout { grid-template-columns: minmax(0, 1fr) minmax(14rem, 17rem); align-items: start; }
    .chapter-main { grid-column: 1; grid-row: 1; }
    .chapter-main .guide-contents { display: none; }
    .chapter-toc-desktop {
        display: block;
        grid-column: 2;
        grid-row: 1;
        position: sticky;
        top: 5.5rem;
        max-height: calc(100vh - 7rem);
        overflow-y: auto;
        border-inline-start: 1px solid var(--line);
        padding-inline: 1rem .4rem;
    }
    .chapter-toc-desktop h2 { font-size: 1.25rem; margin-bottom: .4rem; }
    .chapter-toc-desktop .reference-index ul { display: block; }
    .chapter-toc-desktop .reference-index a { min-height: 38px; padding-block: .25rem; }
}
