/* The home page: a warm, illustrated journey through history. */
body.history-page { padding-top: 155px; }
.history-home { --history-ink: #492408; --history-muted: #783F11; --history-line: rgba(120,63,17,.18); --history-paper: #FFF6EE; --history-wash: #F7E8DA; }
body.dark-mode .history-home { --history-ink: #FFF6EE; --history-muted: #CEAD90; --history-line: rgba(255,177,65,.2); --history-paper: #2F1505; --history-wash: #492408; }
.history-home { position: relative; padding-bottom: 32px; }
.history-home h1, .history-home h2, .history-home h3 { color: var(--history-ink); }
.history-home a, .history-home button { -webkit-tap-highlight-color: transparent; }
.history-home a:focus-visible, .history-home button:focus-visible { outline: 3px solid #FFB141; outline-offset: 5px; }
.history-hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 48px; width: min(1200px, calc(100% - 64px)); margin: 0 auto 52px; padding: 24px 0; }
.history-hero-copy { position: relative; z-index: 2; }
.history-eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--history-muted); font-size: .82rem; font-weight: 700; letter-spacing: .02em; }
.history-eyebrow > span { width: 7px; height: 7px; border-radius: 50%; background: #FFB141; box-shadow: 0 0 0 5px rgba(255,177,65,.13); }
.history-intro { margin: 22px 0 12px; color: var(--history-muted); font-size: 1.13rem; }
.history-intro strong { color: var(--history-ink); }
.history-hero h1 { font-size: clamp(2.5rem,4.4vw,4.4rem); line-height: 1.5; letter-spacing: -.045em; margin: 0 0 18px; }
.history-hero h1 span { position: relative; color: var(--history-muted); white-space: nowrap; }
.history-hero h1 span::after { content: ''; position: absolute; height: 9px; border-radius: 50%; background: #FFB141; opacity: .7; bottom: -3px; right: 0; left: 0; transform: rotate(-3deg); }
.history-lead { max-width: 470px; font-size: 1rem; line-height: 2.1; color: var(--history-muted); margin: 0 0 28px; }
.history-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.history-button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 52px; border-radius: 14px; padding: 12px 24px; font-size: .95rem; font-weight: 700; transition: transform .2s, box-shadow .2s, background .2s; }
.history-button:hover { transform: translateY(-3px); }
.history-button-primary { background: #FFB141; color: #270F04; box-shadow: 0 8px 24px rgba(255,177,65,.2); }
.history-button-primary:hover { background: #FFD59A; box-shadow: 0 12px 28px rgba(120,63,17,.18); }
.history-button-secondary { color: var(--history-ink); border: 1px solid var(--history-line); background: var(--history-paper); }
.history-button-secondary i { font-size: .65rem; border: 1px solid var(--history-line); border-radius: 50%; padding: 7px; }
.history-hero-notes { display: flex; gap: 20px; margin-top: 25px; color: var(--history-muted); font-size: .77rem; flex-wrap: wrap; }
.history-hero-notes span { display: inline-flex; align-items: center; gap: 7px; }
.history-hero-notes i { color: var(--history-muted); }
.history-install.app-install-wrap { margin: 20px 0 0; text-align: right; }
.history-install .app-install-btn { position: relative; display: inline-flex; align-items: center; gap: 13px; isolation: isolate; overflow: hidden; max-width: 100%; margin: 0; padding: 12px 16px; min-height: 66px; border: 1px solid #FFD59A; border-radius: 18px; background: linear-gradient(115deg, #FFD59A, #FFB141 65%); color: #270F04; box-shadow: 0 8px 24px rgba(255,177,65,.24), inset 0 1px 0 rgba(255,246,238,.65); text-align: right; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.history-install .app-install-btn::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 25%, rgba(255,246,238,.5) 50%, transparent 75%); transform: translateX(120%); transition: transform .65s; pointer-events: none; }
.history-install .app-install-btn:hover { background: linear-gradient(115deg, #FFD59A, #FFB141 65%); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(255,177,65,.35), inset 0 1px 0 rgba(255,246,238,.65); }
.history-install .app-install-btn:hover::before { transform: translateX(-120%); }
.history-install .app-install-btn:active { transform: translateY(0); }
.history-install-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: #492408; color: #FFB141; font-size: 1rem; box-shadow: 0 3px 8px rgba(73,36,8,.18); }
.history-install-copy { display: flex; flex-direction: column; gap: 2px; }
.history-install-copy strong { font-size: .9rem; line-height: 1.7; }
.history-install-copy small { color: #492408; font-size: .65rem; line-height: 1.6; }
.history-install-arrow { margin-inline-start: 14px; font-size: .8rem; transition: transform .2s; }
.history-install .app-install-btn:hover .history-install-arrow { transform: translateX(-3px); }
.history-portrait-scene { position: relative; min-width: 0; width: 100%; max-width: 500px; aspect-ratio: 1 / 1.13; justify-self: center; isolation: isolate; }
.history-arch { position: absolute; inset: 9% 10% 4%; border-radius: 48% 48% 16px 16px; overflow: hidden; background: radial-gradient(ellipse at 45% 25%, #A96425 0%, #783F11 48%, #492408 100%); border: 1px solid rgba(255,177,65,.4); box-shadow: 0 28px 65px rgba(73,36,8,.18); }
.history-arch::before { content: ''; position: absolute; inset: 12px; border: 1px solid rgba(255,213,154,.3); border-radius: inherit; background-image: repeating-linear-gradient(0deg,transparent 0 39px,rgba(255,246,238,.04) 39px 40px), repeating-linear-gradient(90deg,transparent 0 39px,rgba(255,246,238,.04) 39px 40px); }
.history-arch > span { position: absolute; bottom: 16px; inset-inline: 0; text-align: center; color: #FFD59A; font-size: .7rem; }
.history-orbit { position: absolute; border: 1px dashed var(--history-line); border-radius: 50%; pointer-events: none; }
.history-orbit-outer { inset: 0 -3% 5%; transform: rotate(-18deg); }
.history-orbit-inner { inset: 4% 1% 0; transform: rotate(18deg); border-style: solid; opacity: .55; }
.history-teacher-photo { position: absolute; bottom: 5%; left: 8%; width: 84%; height: 94%; object-fit: contain; object-position: bottom; z-index: 2; filter: drop-shadow(0 14px 18px rgba(39,15,4,.18)); }
.history-compass { position: absolute; width: 104px; height: 104px; right: -1%; top: 0; z-index: 3; color: var(--history-muted); transform: rotate(-16deg); }
.history-compass svg { width: 100%; height: 100%; }
.history-float { position: absolute; z-index: 3; display: flex; align-items: center; gap: 11px; border: 1px solid var(--history-line); border-radius: 16px; box-shadow: 0 12px 28px rgba(39,15,4,.13); animation: history-drift 6s ease-in-out infinite; pointer-events: none; }
.history-float-date { left: -3%; top: 22%; padding: 14px 18px; color: var(--history-ink); background: var(--history-paper); transform: rotate(-7deg); }
.history-float-date > i { font-size: 1.5rem; color: var(--history-muted); }
.history-float-date span { display: block; font-size: .62rem; color: var(--history-muted); }
.history-float-date strong { display: block; font-size: 1.8rem; line-height: 1.4; }
.history-float-date small { font-size: .75rem; }
.history-float-scroll { right: -3%; bottom: 24%; padding: 15px 17px; background: #FFB141; color: #492408; animation-delay: -3s; rotate: 5deg; }
.history-float-scroll i { font-size: 1.6rem; }
.history-float-scroll span { font-size: .75rem; line-height: 1.8; }
.history-float-scroll strong { font-size: .9rem; }
.history-portrait-caption { position: absolute; bottom: 0; left: 9%; right: 9%; z-index: 4; display: flex; align-items: center; gap: 12px; padding: 17px 18px; border: 1px solid var(--history-line); background: var(--history-paper); border-radius: 18px; box-shadow: 0 14px 36px rgba(39,15,4,.12); }
.history-caption-icon { display: grid; place-items: center; width: 45px; height: 45px; flex-shrink: 0; background: var(--history-wash); border-radius: 12px; color: var(--history-muted); font-size: 1.3rem; }
.history-portrait-caption strong { display: block; font-size: 1.1rem; color: var(--history-ink); }
.history-portrait-caption div > span { display: block; font-size: .65rem; color: var(--history-muted); margin-top: 2px; }
.history-caption-seal { margin-inline-start: auto; border: 1px dashed var(--history-muted); border-radius: 50%; padding: 6px; font-size: .55rem; text-align: center; line-height: 1.5; color: var(--history-muted); transform: rotate(-12deg); }
.history-spark { position: absolute; font-family: serif; color: #FFB141; font-size: 2.4rem; }
.history-spark-one { top: 5%; left: 14%; }
.history-spark-two { bottom: 11%; right: 0; font-size: 3rem; }
@keyframes history-drift { 0%,100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.history-learning-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; width: min(1140px,calc(100% - 48px)); margin: 20px auto 74px; border-block: 1px solid var(--history-line); }
.history-learning-strip > div { display: flex; align-items: center; gap: 16px; padding: 28px 20px; position: relative; }
.history-learning-strip > div + div { border-inline-start: 1px solid var(--history-line); }
.history-learning-strip i { font-size: 1.55rem; color: var(--history-muted); }
.history-learning-strip strong { display: block; color: var(--history-ink); font-size: .92rem; }
.history-learning-strip small { display: block; color: var(--history-muted); font-size: .72rem; margin-top: 4px; }
.history-step-number { font-size: .7rem; color: var(--history-muted); opacity: .75; }
.history-section-heading { text-align: center; margin: 0 auto 32px; padding: 0 20px; }
.history-section-heading h2 { font-size: clamp(1.65rem,3vw,2.4rem); line-height: 1.7; margin: 9px 0; }
.history-section-heading h2 span { color: var(--history-muted); }
.history-section-heading p { color: var(--history-muted); font-size: .85rem; line-height: 1.9; }
.history-section-heading img { display: block; max-width: min(450px,80%); height: auto; margin: 0 auto; }
.history-study-heading { scroll-margin-top: 160px; }
.history-empty-note { text-align: center; color: var(--history-muted); padding: 0 24px; font-size: .9rem; }
.history-timeline-section { display: grid; grid-template-columns: .8fr 1.5fr; gap: 44px; width: min(1180px,calc(100% - 48px)); margin: 84px auto; padding: 44px; border: 1px solid var(--history-line); border-radius: 28px; background: var(--history-paper); background-image: radial-gradient(circle at 0 100%,rgba(255,177,65,.11),transparent 45%); }
.history-timeline-intro h2 { font-size: clamp(1.7rem,2.5vw,2.4rem); line-height: 1.6; margin: 12px 0; }
.history-timeline-intro h2 span { color: var(--history-muted); }
.history-timeline-intro p { font-size: .83rem; line-height: 2; color: var(--history-muted); }
.history-timeline-hint { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; font-size: .7rem; color: var(--history-muted); }
.history-timeline-explorer { min-width: 0; }
.history-timeline-track { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); position: relative; }
.history-timeline-track::before { content: ''; position: absolute; top: 90px; left: 12%; right: 12%; height: 1px; background: var(--history-line); }
.history-home .history-moment { display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; border: 0; background: transparent; color: var(--history-muted); cursor: pointer; margin: 0; padding: 8px 3px; border-radius: 12px; font-family: inherit; box-shadow: none; transition: background .2s,color .2s; }
.history-moment > i { font-size: 1.1rem; height: 26px; }
.history-moment strong { font-size: 1.35rem; line-height: 1.7; }
.history-moment small { font-size: .61rem; line-height: 1.8; max-width: 100px; }
.history-moment-dot { width: 9px; height: 9px; margin: 5px 0 10px; border-radius: 50%; background: var(--history-paper); border: 2px solid var(--history-muted); z-index: 1; }
.history-home .history-moment:hover { background: rgba(255,177,65,.1); transform: none; }
.history-home .history-moment.is-active { color: var(--history-ink); background: rgba(255,177,65,.12); }
.history-moment.is-active > i { color: var(--history-muted); }
.history-moment.is-active .history-moment-dot { background: #FFB141; border-color: #FFB141; box-shadow: 0 0 0 5px rgba(255,177,65,.16); }
.history-moment-panel { margin-top: 22px; padding: 22px; display: flex; align-items: flex-start; gap: 20px; border: 1px solid var(--history-line); border-radius: 16px; background: var(--history-wash); }
.history-panel-year { color: var(--history-muted); font-size: 1.7rem; line-height: 1.7; border-inline-end: 1px solid var(--history-line); padding-inline-end: 20px; }
.history-panel-label { color: var(--history-muted); font-size: .62rem; }
.history-moment-panel h3 { font-size: .97rem; margin: 3px 0 9px; }
.history-moment-panel p { font-size: .77rem; line-height: 2; color: var(--history-muted); margin: 0; }
.history-home .premium-course-card { border-color: var(--history-line); }
.history-home .premium-course-card { border-radius: 22px; box-shadow: 0 8px 30px rgba(73,36,8,.06); }
.history-home .study-years-slider { margin-bottom: 16px; }
@media (max-width: 1000px) {
    .history-hero { gap: 24px; width: calc(100% - 48px); }
    .history-hero h1 { font-size: clamp(2.2rem,4.5vw,3.3rem); }
    .history-float-date { left: -1%; padding: 10px; }
    .history-float-scroll { right: -2%; padding: 10px; }
    .history-timeline-section { gap: 24px; padding: 28px; }
    .history-learning-strip > div { gap: 10px; padding: 24px 12px; }
    .history-step-number { display: none; }
}
@media (max-width: 760px) {
    body.history-page { padding-top: 140px; }
    .history-hero { grid-template-columns: minmax(0,1fr); width: calc(100% - 40px); gap: 30px; padding: 10px 0 0; margin-bottom: 35px; }
    .history-hero-copy { text-align: center; }
    .history-intro { margin-top: 16px; }
    .history-hero h1 { font-size: clamp(2.2rem,8.2vw,3.5rem); }
    .history-lead { margin-inline: auto; font-size: .9rem; }
    .history-actions, .history-hero-notes { justify-content: center; }
    .history-install.app-install-wrap { text-align: center; margin-top: 12px; }
    .history-portrait-scene { width: min(420px,94%); }
    .history-compass { width: 85px; height: 85px; }
    .history-learning-strip { grid-template-columns: 1fr; margin-bottom: 48px; }
    .history-learning-strip > div { padding: 18px 12px; gap: 18px; }
    .history-learning-strip > div + div { border-inline-start: 0; border-top: 1px solid var(--history-line); }
    .history-step-number { display: block; margin-inline-start: auto; order: 3; }
    .history-learning-strip i { width: 30px; text-align: center; }
    .history-timeline-section { grid-template-columns: minmax(0,1fr); padding: 26px 18px; width: calc(100% - 32px); margin-block: 52px; gap: 26px; }
    .history-timeline-intro { text-align: center; }
    .history-timeline-intro h2 br { display: none; }
    .history-timeline-hint { margin-top: 12px; }
    .history-moment-panel { padding: 16px; gap: 12px; }
    .history-panel-year { font-size: 1.4rem; padding-inline-end: 12px; }
}
@media (max-width: 380px) {
    .history-hero { width: calc(100% - 28px); }
    .history-button { padding: 11px 16px; gap: 10px; font-size: .8rem; }
    .history-hero-notes { gap: 12px; font-size: .68rem; }
    .history-float-date strong { font-size: 1.35rem; }
    .history-float-date > i { font-size: 1.15rem; }
    .history-float-scroll span { font-size: .62rem; }
    .history-float-scroll strong { font-size: .75rem; }
    .history-portrait-caption { padding: 12px; gap: 9px; left: 5%; right: 5%; }
    .history-caption-seal { display: none; }
    .history-moment-panel { flex-direction: column; }
    .history-panel-year { border-inline-end: 0; line-height: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .history-home *, .history-home *::before, .history-home *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Preserve the original student and video cards on very narrow screens. */
@media (max-width: 360px) {
    .history-home .course-card { min-width: 0; max-width: 100%; }
}
