/* Blackboard chalk theme */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400&family=JetBrains+Mono:wght@300;400&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Hide scrollbars everywhere but keep scrolling functional */
* {
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE / old Edge */
}
*::-webkit-scrollbar {
    display: none;                  /* Chrome / Safari / Edge */
    width: 0;
    height: 0;
}

body {
    background: #1a1a1a;
    color: #e8e4df;
    font-family: 'EB Garamond', Georgia, serif;
    height: 100vh;
    overflow: hidden;
    cursor: default;
}

/* Slide container */
.deck {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 55px 100px 50px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
    pointer-events: all;
}

/* Typography */
h1 {
    font-size: 3rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 1px;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 30px;
    text-align: center;
}

h3 {
    font-size: 1.3rem;
    font-weight: 400;
    color: #e0e0e0;
    margin-bottom: 20px;
}

p, li {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #eee;
    max-width: 800px;
}

ul {
    list-style: none;
    padding: 0;
}

ul li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

ul li::before {
    content: '\2014';
    position: absolute;
    left: 0;
    color: #999;
}

.subtitle {
    font-size: 1.3rem;
    color: #888;
    font-style: italic;
    margin-bottom: 10px;
}

.part-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #999;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 15px;
    display: block;
}

/* Equation box */
.eq-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 30px 50px;
    margin: 25px 0;
    text-align: center;
    font-size: 1.8rem;
}

.eq-box.small {
    font-size: 1.2rem;
    padding: 15px 30px;
}

.eq-highlight {
    color: #fff;
    font-weight: 600;
}

/* Animation container within a slide */
.anim-container {
    width: 100%;
    max-width: 900px;
    height: 400px;
    position: relative;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.anim-container canvas {
    width: 100%;
    height: 100%;
}

.anim-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #999;
    text-align: center;
    margin-top: 8px;
    letter-spacing: 1px;
}

/* Back to website button */
.back-btn {
    position: fixed;
    top: 25px;
    left: 30px;
    z-index: 100;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #888;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 3px;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* Navigation */
.nav {
    position: fixed;
    bottom: 25px;
    right: 30px;
    z-index: 100;
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav button {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #888;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s;
}

.nav button:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.slide-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #999;
    margin: 0 8px;
}

/* Progress bar */
.progress {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.4s ease;
    z-index: 100;
}

/* ===== Era timeline bar ===== */
.era-timeline {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: 420px;
    height: 28px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow: visible;
}

.era-timeline.visible {
    opacity: 1;
}

.era-line {
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.era-dot {
    position: absolute;
    bottom: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-50%);
    transition: all 0.4s ease;
    overflow: visible;
}

/* Position each dot along the timeline */
.era-dot[data-era="1915"] { left: 0%; }
.era-dot[data-era="1959"] { left: 20%; }
.era-dot[data-era="1995"] { left: 40%; }
.era-dot[data-era="2005"] { left: 58%; }
.era-dot[data-era="2015"] { left: 78%; }
.era-dot[data-era="2026"] { left: 100%; }

.era-dot.active {
    background: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
    width: 6px;
    height: 6px;
}

.era-year {
    position: absolute;
    bottom: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.3px;
    white-space: nowrap;
    transition: color 0.4s ease;
    line-height: 1;
    pointer-events: none;
    transform: translateX(-50%);
}

/* Position year labels to match dot positions */
.era-year[data-era="1915"] { left: 0%; }
.era-year[data-era="1959"] { left: 20%; }
.era-year[data-era="1995"] { left: 40%; }
.era-year[data-era="2005"] { left: 58%; }
.era-year[data-era="2015"] { left: 78%; }
.era-year[data-era="2026"] { left: 100%; }

.era-timeline.active-1915 .era-year[data-era="1915"],
.era-timeline.active-1959 .era-year[data-era="1959"],
.era-timeline.active-1995 .era-year[data-era="1995"],
.era-timeline.active-2005 .era-year[data-era="2005"],
.era-timeline.active-2015 .era-year[data-era="2015"],
.era-timeline.active-2026 .era-year[data-era="2026"] {
    color: rgba(255, 255, 255, 0.9);
}

.era-label {
    display: none;
}

/* Glowing segment between dots for the active era range */
.era-timeline .era-segment {
    position: absolute;
    bottom: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    border-radius: 1px;
}

/* Separator line */
.sep {
    width: 60px;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 25px 0;
}

/* Two column layout */
.columns {
    display: flex;
    gap: 60px;
    width: 100%;
    max-width: 1000px;
    align-items: flex-start;
}

.col {
    flex: 1;
}

/* Fade-in items (click to reveal) */
.reveal-item {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal-item.shown {
    opacity: 1;
    transform: translateY(0);
}

/* Paper reference link */
.paper-ref {
    display: inline-block;
    margin-top: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #bbb;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 18px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

.paper-ref:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.03);
}

.paper-ref .paper-label {
    color: #999;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 4px;
}

/* Concept notes: hidden source inside slides; shown in side panel */
.slide-note {
    display: none;
}

/* Right-side Key Concepts panel */
#notesPanel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 0;
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    color: #c8c4bc;
    background: linear-gradient(180deg, #161616 0%, #121212 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 300;
    transition: width 0.3s ease;
}

#notesPanel.visible {
    width: 340px;
}

#notesPanel .notes-inner {
    width: 340px;
    height: 100%;
    padding: 64px 22px 90px;
    overflow-y: auto;
    text-align: left;
    box-sizing: border-box;
}

.concept-label {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.concept-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.concept-list li {
    position: relative;
    max-width: none;
    padding: 0 0 12px 14px;
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.5;
    color: #d8d4cc;
}

.concept-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(232, 125, 125, 0.85);
}

.concept-detail-label {
    margin-top: 22px;
}

.concept-detail {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #cfcabf;
    max-width: none;
}

.concept-empty {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.3);
    max-width: none;
}

/* When concepts are on, shrink the deck to make room on the right */
body.notes-on .deck {
    width: calc(100vw - 340px);
}

body.notes-on .slide {
    width: 100%;
    padding-left: 70px;
    padding-right: 36px;
}

body.notes-on .nav {
    right: calc(340px + 30px);
}

body.notes-on .anim-container {
    max-width: 100%;
}

body.notes-on h1 {
    font-size: 2.55rem;
}

body.notes-on h2 {
    font-size: 1.75rem;
    margin-bottom: 22px;
}

body.notes-on p,
body.notes-on li {
    font-size: 1.15rem;
    line-height: 1.65;
}

.notes-toggle {
    position: fixed;
    bottom: 25px;
    left: 30px;
    z-index: 250;
    background: rgba(20, 20, 20, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #999;
    padding: 6px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    cursor: pointer;
    border-radius: 3px;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.notes-toggle:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.notes-toggle.active {
    color: #fff;
    border-color: rgba(232, 125, 125, 0.55);
    background: rgba(232, 125, 125, 0.12);
}

/* Remaining reveal clicks before next slide */
.steps-hint {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 260;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 8px 10px 7px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(18, 18, 18, 0.82);
    font-family: 'JetBrains Mono', monospace;
    color: #ddd;
    line-height: 1.1;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.steps-hint.visible {
    display: flex;
}

body.notes-on .steps-hint {
    right: calc(340px + 18px);
}

.steps-hint .steps-num {
    font-size: 1.05rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.5px;
}

.steps-hint .steps-label {
    margin-top: 3px;
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.steps-hint.ready .steps-num {
    color: rgba(143, 220, 156, 0.95);
}

.steps-hint.ready .steps-label {
    color: rgba(143, 220, 156, 0.55);
}

/* Table of contents — side arrow button */
.toc-toggle {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 450;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    border-radius: 0 5px 5px 0;
    color: rgba(255,255,255,0.4);
    padding: 18px 5px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.toc-toggle:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    background: rgba(30, 30, 30, 0.95);
}

.toc-toggle.active {
    color: #fff;
    left: 280px;
}

/* Side panel */
.toc-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #111;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 400;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 16px 0;
}

.toc-panel.visible {
    transform: translateX(0);
}

/* Push the deck, nav, notes-toggle, and progress bar when TOC is open */
body.toc-open .deck,
body.toc-open .nav,
body.toc-open .notes-toggle,
body.toc-open .progress {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

body.toc-open .deck {
    width: calc(100vw - 280px);
}

body.toc-open.notes-on .deck {
    width: calc(100vw - 280px - 340px);
}

body.toc-open .slide {
    width: 100%;
}

.toc-panel .toc-header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 8px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.toc-panel .toc-section {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 12px 16px 3px;
}

.toc-panel .toc-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 16px;
    cursor: pointer;
    transition: background 0.15s;
    font-family: 'EB Garamond', serif;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.toc-panel .toc-item:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.95);
}

.toc-panel .toc-item.active {
    color: #fff;
    background: rgba(255,255,255,0.07);
}

.toc-panel .toc-item .toc-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: rgba(255,255,255,0.25);
    min-width: 20px;
}

/* Chalk-dust subtle texture overlay */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='4' height='4' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1' height='1' fill='rgba(255,255,255,0.008)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

/* ===== Mobile responsive ===== */
@media (max-width: 768px) {
    .slide {
        padding: 50px 20px;
        justify-content: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    h3 {
        font-size: 1.1rem;
    }

    p, li {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .part-label {
        font-size: 0.65rem;
        letter-spacing: 2px;
    }

    .eq-box {
        font-size: 1.1rem;
        padding: 15px 20px;
        margin: 15px 0;
    }

    .eq-box.small {
        font-size: 0.85rem;
        padding: 10px 15px;
    }

    .anim-container {
        max-width: 100%;
        height: 280px;
        margin: 12px 0;
    }

    .columns {
        flex-direction: column;
        gap: 20px;
    }

    .sep {
        margin: 15px 0;
    }

    /* Timeline - narrower on mobile */
    .era-timeline {
        width: 250px;
        top: 5px;
    }

    /* Back button - smaller on mobile */
    .back-btn {
        top: 12px;
        left: 12px;
        font-size: 0.65rem;
        padding: 6px 10px;
    }

    /* Nav buttons - bigger touch targets, bottom-right */
    .nav {
        bottom: 15px;
        right: 15px;
        gap: 6px;
    }

    .nav button {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .slide-counter {
        font-size: 0.65rem;
    }

    /* Notes toggle - smaller, avoid overlap with back button */
    .notes-toggle {
        bottom: 15px;
        left: 15px;
        font-size: 0.6rem;
        padding: 5px 10px;
    }

    .steps-hint {
        top: 12px;
        right: 12px;
        min-width: 40px;
        padding: 6px 8px;
    }

    body.notes-on .steps-hint {
        right: 12px;
        top: 12px;
    }

    /* TOC panel - full width on mobile */
    .toc-panel {
        width: 85vw;
    }

    .toc-toggle.active {
        left: 85vw;
    }

    body.toc-open .deck,
    body.toc-open .nav,
    body.toc-open .notes-toggle,
    body.toc-open .progress,
    body.toc-open #notesPanel {
        margin-left: 0;
    }

    body.toc-open .deck {
        width: 100vw;
    }

    body.toc-open .slide {
        width: 100%;
    }

    /* Concepts panel: bottom drawer on mobile */
    body.notes-on .deck {
        width: 100vw;
        height: 72vh;
    }

    body.notes-on .slide {
        height: 72vh;
        padding-left: 20px;
        padding-right: 20px;
    }

    body.notes-on .nav {
        right: 15px;
        bottom: calc(28vh + 10px);
    }

    body.notes-on .progress {
        right: 0;
        bottom: 28vh;
        left: 0;
    }

    #notesPanel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        transition: height 0.3s ease;
    }

    #notesPanel.visible {
        width: 100%;
        height: 28vh;
    }

    #notesPanel .notes-inner {
        width: 100%;
        height: 100%;
        padding: 14px 18px 20px;
    }

    .concept-list li {
        font-size: 0.64rem;
        padding-bottom: 8px;
    }

    .concept-detail {
        font-size: 0.95rem;
    }
}
