/* ==========================================================================
   Mathematics for AI -- "Stripe docs meets 3Blue1Brown"
   Complete stylesheet for index.html
   ========================================================================== */

/* ---------- DESIGN TOKENS ---------- */
:root {
    --color-primary: #1a237e;
    --color-primary-light: #283593;
    --color-secondary: #00897b;
    --color-secondary-light: #26a69a;
    --color-accent: #ff8f00;
    --color-accent-light: #ffb300;
    --color-bg: #f5f7fa;
    --color-surface: #ffffff;
    --color-text: #212121;
    --color-text-light: #616161;
    --color-border: #e0e0e0;
    --color-math-bg: #e8eaf6;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
}


/* ==========================================================================
   1. BASE & RESET
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg {
    max-width: 100%;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent);
}

ul, ol {
    padding-left: 1.25em;
}

h1, h2, h3, h4 {
    line-height: 1.25;
}


/* ==========================================================================
   2. NAVIGATION (#navbar)
   ========================================================================== */

#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 var(--space-lg);
    background: rgba(26, 35, 126, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.3s ease;
}

#navbar.scrolled {
    background: rgba(26, 35, 126, 1);
    box-shadow: var(--shadow-md);
}

.nav-brand {
    font-weight: 700;
    font-size: 1.125rem;
    color: #ffffff;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-accent-light);
    border-bottom-color: var(--color-accent);
}

.nav-links a.active {
    background: rgba(255, 255, 255, 0.06);
}

/* -- Hamburger toggle -- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger -> X animation when nav open */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ==========================================================================
   3. HERO (#hero)
   ========================================================================== */

#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(64px + var(--space-xl)) var(--space-lg) var(--space-xl);
    position: relative;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 50%, #0d47a1 100%);
    color: #ffffff;
    overflow: hidden;
}

/* Subtle decorative grid pattern */
#hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.03) 0%, transparent 50%);
    pointer-events: none;
}

#hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    max-width: 800px;
    margin-bottom: var(--space-md);
    animation: fadeInUp 0.8s ease both;
}

#hero .subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    opacity: 0.9;
    max-width: 640px;
    margin-bottom: var(--space-lg);
    font-weight: 400;
    animation: fadeInUp 0.8s 0.15s ease both;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.8s 0.3s ease both;
}

.hero-badges .badge {
    padding: var(--space-xs) var(--space-md);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.hero-badges .badge:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.55);
}

#hero .speaker-info {
    font-size: 0.9rem;
    opacity: 0.7;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.8s 0.45s ease both;
}

/* -- Scroll indicator -- */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator span {
    font-size: 1.5rem;
    opacity: 0.6;
}


/* ==========================================================================
   4. SECTIONS (common)
   ========================================================================== */

section {
    padding: var(--space-2xl) var(--space-lg);
}

section > h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-light);
    font-size: 1.05rem;
    margin-bottom: var(--space-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Constrain content width */
section > h2,
section > p.section-subtitle,
.act-stepper,
.sections-grid,
.math-table-wrapper,
.formula-grid,
.timeline,
.bankbot-journey,
.interactive-list,
.resources-grid,
.speaker-notes-content,
.plans-grid {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Alternate section backgrounds */
#sections,
#cheat-sheet,
#interactive {
    background: #ffffff;
}

#overview,
#math-concepts,
#history,
#bankbot,
#resources {
    background: var(--color-bg);
}

#plans {
    background: #ffffff;
}

#speaker-notes {
    background: #fafafa;
}


/* ==========================================================================
   5. OVERVIEW / STORY ARC (#overview)
   ========================================================================== */

#overview > h2 {
    margin-bottom: var(--space-xl);
}

.act-stepper {
    display: flex;
    align-items: flex-start;
    gap: 0;
    position: relative;
}

.act-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 var(--space-sm);
}

/* Connector line between circles */
.act-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 24px;
    left: calc(50% + 28px);
    right: calc(-50% + 28px);
    height: 2px;
    background: var(--color-border);
    z-index: 0;
}

.act-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-secondary);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 137, 123, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.act-step:hover .act-number {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 137, 123, 0.35);
}

.act-content h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.act-content .time-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--color-accent);
    padding: 2px 10px;
    border-radius: 999px;
    margin-bottom: var(--space-xs);
}

.act-theme {
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-style: italic;
    margin-bottom: 2px;
}

.act-emotion {
    font-size: 0.8rem;
    color: var(--color-secondary);
    font-weight: 600;
}


/* ==========================================================================
   6. SECTION CARDS (#sections)
   ========================================================================== */

#sections > h2 {
    margin-bottom: var(--space-xl);
}

.sections-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.section-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.section-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #ffffff;
    flex-wrap: wrap;
}

.section-number {
    font-size: 1.75rem;
    font-weight: 700;
    opacity: 0.35;
    min-width: 2ch;
    line-height: 1;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.card-header .time-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-accent-light);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

/* Card body */
.section-card .key-message {
    padding: var(--space-lg) var(--space-lg) var(--space-sm);
    font-size: 0.95rem;
    color: var(--color-text);
    font-weight: 500;
    line-height: 1.5;
}

.section-card details {
    padding: 0 var(--space-lg) var(--space-lg);
}

.section-card summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-secondary);
    padding: var(--space-sm) 0;
    user-select: none;
    transition: color 0.2s ease;
    list-style: none;
}

.section-card summary::-webkit-details-marker {
    display: none;
}

.section-card summary::before {
    content: "\25B6\FE0E";
    display: inline-block;
    margin-right: var(--space-sm);
    font-size: 0.7em;
    transition: transform 0.2s ease;
}

.section-card details[open] > summary::before {
    transform: rotate(90deg);
}

.section-card summary:hover {
    color: var(--color-secondary-light);
}

.section-card details ul {
    margin-top: var(--space-sm);
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.section-card details li {
    margin-bottom: var(--space-sm);
    line-height: 1.55;
}

.section-card details li strong {
    color: var(--color-text);
}

.section-card details ul ul {
    margin-top: var(--space-xs);
}

.viz-link {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px dashed var(--color-border);
    font-size: 0.85rem;
}

.viz-link a {
    color: var(--color-secondary);
    font-weight: 600;
    transition: color 0.2s ease;
}

.viz-link a:hover {
    color: var(--color-accent);
}


/* ==========================================================================
   7. MATH CONCEPTS TABLE (#math-concepts)
   ========================================================================== */

#math-concepts > h2 {
    margin-bottom: var(--space-xl);
}

.math-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--color-surface);
}

.math-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 640px;
}

.math-table thead th {
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 600;
    text-align: left;
    padding: var(--space-md) var(--space-lg);
    white-space: nowrap;
}

.math-table thead th:first-child {
    border-radius: var(--radius-lg) 0 0 0;
}

.math-table thead th:last-child {
    border-radius: 0 var(--radius-lg) 0 0;
}

.math-table tbody td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.math-table tbody tr:nth-child(even) {
    background: rgba(232, 234, 246, 0.25);
}

.math-table tbody tr:last-child td {
    border-bottom: none;
}

.math-table tbody tr:hover {
    background: rgba(232, 234, 246, 0.45);
}

/* Formula cells -- give KaTeX room */
.math-table tbody td:last-child {
    background: var(--color-math-bg);
    text-align: center;
    padding: var(--space-md) var(--space-lg);
    font-size: 0.95rem;
    min-width: 220px;
}


/* ==========================================================================
   8. MATH CHEAT SHEET (#cheat-sheet)
   ========================================================================== */

#cheat-sheet {
    background: linear-gradient(180deg, #ffffff 0%, #fdf8f0 100%);
}

#cheat-sheet > h2 {
    margin-bottom: var(--space-sm);
}

.formula-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.formula-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.formula-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.formula-card h3 {
    color: var(--color-secondary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.formula-card .formula {
    font-size: 1.1em;
    text-align: center;
    padding: var(--space-md);
    background: var(--color-math-bg);
    border-radius: var(--radius-md);
    margin: var(--space-md) 0;
    overflow-x: auto;
}

.formula-english {
    color: var(--color-text-light);
    font-style: italic;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Bonus card highlight */
.formula-card-bonus {
    border-left: 4px solid var(--color-accent);
    background: linear-gradient(90deg, rgba(255, 143, 0, 0.04) 0%, var(--color-surface) 30%);
}

.formula-card-bonus h3 {
    color: var(--color-accent);
}


/* ==========================================================================
   9. HISTORY TIMELINE (#history)
   ========================================================================== */

#history > h2 {
    margin-bottom: var(--space-xl);
}

.timeline {
    position: relative;
    padding-left: 40px;
}

/* Vertical line */
.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 15px;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-xl);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -33px;
    top: var(--space-md);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-secondary);
    border: 3px solid var(--color-bg);
    box-shadow: 0 0 0 2px var(--color-secondary);
    z-index: 1;
}

.timeline-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.timeline-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.timeline-date {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--color-secondary);
    padding: 2px 10px;
    border-radius: 999px;
    margin-bottom: var(--space-sm);
}

.timeline-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.timeline-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
}

.timeline-card p:last-child {
    margin-bottom: 0;
}

.timeline-connection {
    font-size: 0.8rem !important;
    font-weight: 600;
    color: var(--color-secondary) !important;
    padding-top: var(--space-xs);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-sm) !important;
}


/* ==========================================================================
   10. BANKBOT JOURNEY (#bankbot)
   ========================================================================== */

#bankbot > h2 {
    margin-bottom: var(--space-sm);
}

.bankbot-journey {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.bankbot-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-lg);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--stage-color, var(--color-border));
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bankbot-stage:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.bankbot-icon {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
    line-height: 1;
}

.bankbot-stage blockquote {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.5;
    margin-bottom: var(--space-sm);
    max-width: 280px;
    padding: 0;
    border: none;
}

.bankbot-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-light);
}

.bankbot-stage[data-stage="8"] {
    background: linear-gradient(135deg, #e8f5e9 0%, #fff3e0 100%);
    border-top: 4px solid var(--color-secondary);
    box-shadow: var(--shadow-md);
    padding: var(--space-xl) var(--space-lg);
}

.bankbot-stage[data-stage="8"] .bankbot-icon {
    font-size: 4rem;
}

.bankbot-stage[data-stage="8"] blockquote {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-primary);
    max-width: 360px;
}

.bankbot-stage[data-stage="8"] .bankbot-label {
    font-size: 0.85rem;
    color: var(--color-secondary);
}


/* ==========================================================================
   11. INTERACTIVE ELEMENTS (#interactive)
   ========================================================================== */

#interactive > h2 {
    margin-bottom: var(--space-xl);
}

.interactive-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.interactive-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.interactive-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.interactive-icon {
    font-size: 2.5rem;
    min-width: 48px;
    text-align: center;
    line-height: 1;
    flex-shrink: 0;
}

.interactive-content {
    flex: 1;
    min-width: 0;
}

.interactive-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.interactive-content .time-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--color-accent);
    padding: 2px 10px;
    border-radius: 999px;
    margin-bottom: var(--space-sm);
}

.interactive-content p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
}


/* ==========================================================================
   12. RESOURCES (#resources)
   ========================================================================== */

#resources > h2 {
    margin-bottom: var(--space-xl);
}

.resources-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.resource-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    color: var(--color-text);
    text-decoration: none;
}

a.resource-card:hover,
.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

a.resource-card:hover {
    color: var(--color-text);
}

.resource-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    line-height: 1;
}

.resource-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.resource-card p {
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.55;
}

a.resource-card::after {
    content: "\2192";
    display: inline-block;
    margin-top: var(--space-md);
    font-weight: 600;
    color: var(--color-secondary);
    transition: transform 0.2s ease;
}

a.resource-card:hover::after {
    transform: translateX(4px);
}


/* ==========================================================================
   13. SPEAKER NOTES (#speaker-notes)
   ========================================================================== */

#speaker-notes {
    padding: var(--space-xl) var(--space-lg);
}

#speaker-notes > details {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

#speaker-notes > details > summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 1.125rem;
    padding: var(--space-lg);
    color: var(--color-primary);
    user-select: none;
    list-style: none;
    transition: background 0.2s ease;
}

#speaker-notes > details > summary::-webkit-details-marker {
    display: none;
}

#speaker-notes > details > summary::before {
    content: "\25B6\FE0E";
    display: inline-block;
    margin-right: var(--space-sm);
    font-size: 0.75em;
    transition: transform 0.2s ease;
}

#speaker-notes > details[open] > summary::before {
    transform: rotate(90deg);
}

#speaker-notes > details > summary:hover {
    background: rgba(232, 234, 246, 0.3);
}

.speaker-notes-content {
    padding: 0 var(--space-lg) var(--space-lg);
}

.speaker-notes-content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: var(--space-lg) 0 var(--space-md);
}

.speaker-notes-content h3:first-child {
    margin-top: 0;
}

/* Timing table */
.timing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: var(--space-lg);
    overflow-x: auto;
    display: block;
}

.timing-table thead,
.timing-table tbody,
.timing-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.timing-table thead th {
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 600;
    text-align: left;
    padding: var(--space-sm) var(--space-md);
}

.timing-table tbody td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.timing-table tbody tr:nth-child(even) {
    background: rgba(232, 234, 246, 0.2);
}

.timing-table tbody tr:hover {
    background: rgba(232, 234, 246, 0.45);
}

.speaker-notes-content > p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.speaker-notes-content > ul {
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.speaker-notes-content > ul li {
    margin-bottom: var(--space-sm);
}

.speaker-notes-content > ul li strong {
    color: var(--color-text);
}


/* ==========================================================================
   14. FOOTER
   ========================================================================== */

footer {
    background: var(--color-primary);
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
}

.footer-content p:last-child {
    margin-bottom: 0;
}

.footer-content a {
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-content a:hover {
    color: var(--color-accent-light);
}


/* ==========================================================================
   15. ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-12px);
    }
    60% {
        transform: translateX(-50%) translateY(-6px);
    }
}

/* Scroll reveal (JS toggles .visible) */
.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ==========================================================================
   16. KATEX OVERRIDES
   ========================================================================== */

.katex-display {
    margin: var(--space-md) 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: var(--space-xs) 0;
}

.katex {
    font-size: 1.1em;
}

/* Prevent formula overflow on mobile */
.formula,
.math-table tbody td:last-child {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


/* ==========================================================================
   17. RESPONSIVE -- MOBILE-FIRST BREAKPOINTS
   ========================================================================== */

/* ---- Tablet (>= 768px) ---- */
@media (min-width: 768px) {

    /* Sections grid: 2 columns */
    .sections-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Formula grid: 2 columns */
    .formula-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Resources grid: 2 columns */
    .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* BankBot journey: 2 columns */
    .bankbot-journey {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Timeline: alternating left/right */
    .timeline {
        padding-left: 0;
    }

    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-item {
        width: 50%;
        padding-right: var(--space-xl);
    }

    .timeline-item:nth-child(odd) {
        margin-left: 0;
        text-align: right;
    }

    .timeline-item:nth-child(even) {
        margin-left: 50%;
        padding-right: 0;
        padding-left: var(--space-xl);
    }

    .timeline-item:nth-child(odd) .timeline-dot {
        left: auto;
        right: -8px;
    }

    .timeline-item:nth-child(even) .timeline-dot {
        left: -8px;
    }

    .timeline-item:nth-child(odd) .timeline-card {
        text-align: left;
    }

    .timeline-item:nth-child(odd) .timeline-card:hover {
        transform: translateX(-4px);
    }

    .timeline-item:nth-child(even) .timeline-card:hover {
        transform: translateX(4px);
    }
}

/* ---- Desktop (>= 1024px) ---- */
@media (min-width: 1024px) {

    /* Act stepper: horizontal row */
    .act-stepper {
        flex-direction: row;
    }

    /* Sections grid: can show 2 columns (or 3 for wider) */
    .sections-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Resources grid: 3 columns */
    .resources-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* BankBot journey: 4 columns */
    .bankbot-journey {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Nav links: wider spacing */
    .nav-links {
        gap: var(--space-md);
    }

    .nav-links a {
        font-size: 0.9rem;
    }
}

/* ---- Large desktop (>= 1400px) ---- */
@media (min-width: 1400px) {

    /* Sections grid: 3 columns for large screens */
    .sections-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Formula grid: 3 for extra width */
    .formula-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---- Mobile nav collapse (< 768px) ---- */
@media (max-width: 767px) {

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(26, 35, 126, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: var(--space-md) 0;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
        border-bottom: none;
        border-left: 3px solid transparent;
        border-radius: 0;
    }

    .nav-links a:hover,
    .nav-links a.active {
        border-left-color: var(--color-accent);
        border-bottom-color: transparent;
        background: rgba(255, 255, 255, 0.06);
    }

    /* Act stepper: vertical on mobile */
    .act-stepper {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }

    .act-step {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: var(--space-md);
        padding: 0;
    }

    .act-step:not(:last-child)::after {
        /* Vertical connector on mobile */
        top: 48px;
        left: 23px;
        right: auto;
        width: 2px;
        height: calc(100% + var(--space-md));
    }

    .act-number {
        flex-shrink: 0;
    }

    .act-content {
        flex: 1;
    }

    /* BankBot journey stacks */
    .bankbot-journey {
        grid-template-columns: 1fr;
    }

    /* Math table mobile: still horizontal scroll */
    .math-table-wrapper {
        border-radius: var(--radius-md);
    }

    /* Spacing reductions */
    section {
        padding: var(--space-xl) var(--space-md);
    }

    /* Interactive cards stack tighter */
    .interactive-card {
        gap: var(--space-md);
        padding: var(--space-md);
    }

    .interactive-icon {
        font-size: 2rem;
    }
}

/* ---- Small mobile (< 480px) ---- */
@media (max-width: 479px) {

    #navbar {
        padding: 0 var(--space-md);
    }

    .nav-brand {
        font-size: 1rem;
    }

    .card-header {
        padding: var(--space-sm) var(--space-md);
    }

    .section-card .key-message {
        padding: var(--space-md) var(--space-md) var(--space-xs);
    }

    .section-card details {
        padding: 0 var(--space-md) var(--space-md);
    }

    .formula-card {
        padding: var(--space-md);
    }

    .timeline-card {
        padding: var(--space-md);
    }

    .resource-card {
        padding: var(--space-md);
    }

    .katex {
        font-size: 0.95em;
    }
}


/* ==========================================================================
   18. PRINT
   ========================================================================== */

@media print {

    #navbar,
    .nav-toggle,
    .scroll-indicator {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
    }

    #hero {
        min-height: auto;
        background: none;
        color: #000;
        padding: 2em 1em;
    }

    #hero h1 {
        font-size: 1.8em;
    }

    .hero-badges .badge {
        color: #000;
        border-color: #999;
    }

    section {
        padding: 1.5em 1em;
        page-break-inside: avoid;
    }

    .section-card,
    .formula-card,
    .timeline-card,
    .interactive-card,
    .resource-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .card-header {
        background: #eee !important;
        color: #000 !important;
    }

    .card-header .time-badge {
        color: #000;
        background: #ddd;
    }

    details {
        display: block;
    }

    details > summary {
        display: none;
    }

    details[open] > summary {
        display: block;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    footer {
        background: #eee;
        color: #000;
    }

    .footer-content a {
        color: #000;
    }
}


/* ==========================================================================
   19. ACCESSIBILITY: REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-reveal {
        opacity: 1;
        transform: none;
    }

    .scroll-indicator {
        animation: none;
    }
}


/* ==========================================================================
   20. SELECTION & FOCUS
   ========================================================================== */

::selection {
    background: rgba(26, 35, 126, 0.15);
    color: var(--color-text);
}

:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Skip-link (for keyboard users, if one is ever added) */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    background: var(--color-accent);
    color: #fff;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    z-index: 10000;
    font-weight: 600;
}

.skip-link:focus {
    top: var(--space-sm);
}


/* ==========================================================================
   21. VISUALIZATION CONTAINERS
   ========================================================================== */

/* Shared visualization wrapper */
[id^="viz-"] {
    width: 100%;
    overflow: hidden;
}

[id^="viz-"] svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Morning timeline section */
#morning-timeline {
    background: #ffffff;
}

/* Visualizations section */
#visualizations {
    background: #ffffff;
}

/* Careers section */
#careers {
    background: var(--color-bg);
}

/* Interactive game/widget containers */
#fraud-game-container,
#weight-slider-container,
#use-skip-container {
    margin-top: var(--space-md);
    width: 100%;
}

/* Override interactive-card to handle larger content */
.interactive-card:has(#fraud-game-container),
.interactive-card:has(#weight-slider-container),
.interactive-card:has(#use-skip-container) {
    flex-direction: column;
    align-items: stretch;
}

/* Historical visuals inside timeline cards */
.timeline-card [id^="viz-"] {
    margin-top: var(--space-md);
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-md);
}

/* Visualization containers responsive */
@media (min-width: 768px) {
    #visualizations .formula-card {
        padding: var(--space-xl);
    }
}


/* ==========================================================================
   22. PLAN PAGES
   ========================================================================== */

/* -- Plan page hero (compact, not full-viewport) -- */
.plan-hero {
    padding: calc(64px + var(--space-xl)) var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 50%, #0d47a1 100%);
    color: #ffffff;
    text-align: center;
}

.plan-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
}

.plan-hero .subtitle {
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    opacity: 0.85;
    max-width: 640px;
    margin: 0 auto var(--space-md);
}

.plan-hero .plan-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
}

.plan-hero .plan-meta .badge {
    padding: var(--space-xs) var(--space-md);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.08);
}

/* -- Plan page content area -- */
.plan-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

.plan-content section {
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--color-border);
    background: transparent;
}

.plan-content section:last-child {
    border-bottom: none;
}

.plan-content section > h2 {
    text-align: left;
    margin-bottom: var(--space-lg);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    padding-bottom: var(--space-sm);
    border-bottom: 3px solid var(--color-secondary);
    display: inline-block;
}

.plan-content section > h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: var(--space-lg) 0 var(--space-md);
}

.plan-content p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-text);
    margin-bottom: var(--space-md);
}

.plan-content ul,
.plan-content ol {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-text-light);
    margin-bottom: var(--space-md);
    padding-left: 1.5em;
}

.plan-content li {
    margin-bottom: var(--space-sm);
}

.plan-content li strong {
    color: var(--color-text);
}

.plan-content blockquote {
    border-left: 4px solid var(--color-secondary);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-md) 0;
    background: rgba(0, 137, 123, 0.05);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--color-text-light);
}

/* -- Plan page code blocks -- */
.plan-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}

.plan-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    background: var(--color-math-bg);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.plan-content pre code {
    background: transparent;
    padding: 0;
}

/* -- Plan page tables -- */
.plan-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: var(--space-lg);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.plan-content table thead th {
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 600;
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    white-space: nowrap;
}

.plan-content table tbody td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.plan-content table tbody tr:nth-child(even) {
    background: rgba(232, 234, 246, 0.2);
}

.plan-content table tbody tr:hover {
    background: rgba(232, 234, 246, 0.4);
}

/* -- Plan-specific table in scrollable wrapper -- */
.plan-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* -- Plan task cards -- */
.plan-task-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.plan-task-card .task-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #ffffff;
}

.plan-task-card .task-header .task-number {
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0.4;
}

.plan-task-card .task-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.plan-task-card .task-body {
    padding: var(--space-lg);
}

.plan-task-card .task-body p,
.plan-task-card .task-body ul,
.plan-task-card .task-body ol {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* -- Plan info cards grid -- */
.plan-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.plan-info-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-secondary);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.plan-info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.plan-info-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.plan-info-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* -- Plans index section (on main page) -- */
.plans-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    max-width: 1200px;
    margin: 0 auto;
}

.plan-link-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-secondary);
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.plan-link-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--color-text);
}

.plan-link-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.plan-link-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.55;
    flex: 1;
}

.plan-link-card .plan-link-arrow {
    margin-top: var(--space-md);
    font-weight: 600;
    color: var(--color-secondary);
    font-size: 0.9rem;
}


/* ---------- CONTENT TIER BADGES ---------- */

.tier-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2em 0.7em;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 0.6em;
    position: relative;
    top: -2px;
}

.tier-badge-talk {
    background: rgba(0, 137, 123, 0.12);
    color: #00897b;
}

.tier-badge-deep {
    background: rgba(255, 143, 0, 0.12);
    color: #e67e00;
}

.tier-badge-ref {
    background: rgba(26, 35, 126, 0.10);
    color: #1a237e;
}

/* ---------- "FOR THE CURIOUS" DETAILS BLOCKS ---------- */

.formula-card details,
.story-math details {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--color-math-bg);
    border-radius: var(--radius-md);
}

.formula-card details summary,
.story-math details summary {
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--color-primary);
}

.plan-link-card:hover .plan-link-arrow {
    color: var(--color-accent);
}

/* -- Plan pages responsive -- */
@media (min-width: 768px) {
    .plan-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .plans-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .plan-content {
        padding: var(--space-lg) var(--space-md);
    }

    .plan-hero {
        padding: calc(64px + var(--space-lg)) var(--space-md) var(--space-lg);
    }

    .plan-content table {
        font-size: 0.8rem;
    }

    .plan-content table thead th,
    .plan-content table tbody td {
        padding: var(--space-xs) var(--space-sm);
    }
}

/* ============================================================
   23. ORGANIZING COMMITTEE
   ============================================================ */
#committee {
    background: var(--color-bg);
}

.committee-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    max-width: 900px;
    margin: 0 auto;
}

.committee-card {
    text-align: center;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.committee-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.committee-photo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-accent);
    margin: 0 auto var(--space-md);
    display: block;
}

.committee-initials {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #303f9f);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.6rem;
    margin: 0 auto var(--space-md);
    border: 4px solid var(--color-accent);
}

.committee-card h3 {
    font-size: 1.05rem;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.committee-role {
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 12px;
    border-radius: 20px;
    margin-bottom: var(--space-xs);
}

.committee-affiliation {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin: 0;
}

@media (max-width: 767px) {
    .committee-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .committee-photo,
    .committee-initials {
        width: 90px;
        height: 90px;
    }

    .committee-initials {
        font-size: 1.3rem;
    }
}

@media (max-width: 479px) {
    .committee-grid {
        grid-template-columns: 1fr;
        max-width: 280px;
    }
}

/* ============================================================
   24. REGISTRATION FORM
   ============================================================ */
#register {
    background: #ffffff;
}

.form-wrapper {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 700px;
}

.form-wrapper iframe {
    width: 100%;
    max-width: 640px;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}


/* ==========================================================================
   25. LLM STORIES (#llm-stories)
   ========================================================================== */

#llm-stories {
    background: var(--color-bg);
}

/* -- Story Cluster Container -- */
.story-cluster {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-2xl);
}

/* -- Cluster Title -- */
.cluster-title {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-lg);
}

/* -- Cluster Number Badge -- */
.cluster-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    margin-right: var(--space-md);
}

/* -- Stories Grid -- */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: var(--space-lg);
}

/* -- Story Card -- */
.story-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    border-left: 5px solid var(--color-secondary);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.story-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Color cycling for left border by position */
.story-card:nth-child(4n + 1) {
    border-left-color: var(--color-primary);
}

.story-card:nth-child(4n + 2) {
    border-left-color: var(--color-secondary);
}

.story-card:nth-child(4n + 3) {
    border-left-color: var(--color-accent);
}

.story-card:nth-child(4n + 4) {
    border-left-color: #5c6bc0;
}

/* -- Story Header -- */
.story-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

/* -- Story Number Badge -- */
.story-number {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-math-bg);
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.15rem;
    border-radius: 50%;
}

/* -- Story Title & Year wrapper -- */
.story-title-group {
    flex: 1;
    min-width: 0;
}

.story-title-group h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
    line-height: 1.3;
}

/* -- Story Year Badge -- */
.story-year {
    display: inline-block;
    padding: 2px 10px;
    background: var(--color-math-bg);
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
}

/* -- Story Narrative -- */
.story-narrative {
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: var(--space-md);
    font-size: 0.95rem;
}

/* -- Story Math Box -- */
.story-math {
    background: var(--color-math-bg);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-md);
    border-left: 3px solid var(--color-primary);
}

.story-math h5 {
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.story-math .formula {
    text-align: center;
    margin: var(--space-md) 0;
    font-size: 1.1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.story-math p {
    font-size: 0.88rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* -- Story Hook -- */
.story-hook {
    background: linear-gradient(135deg, rgba(0, 137, 123, 0.08), rgba(26, 35, 126, 0.08));
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    border-left: 3px solid var(--color-secondary);
    color: var(--color-text);
    line-height: 1.6;
}

/* -- Story Sources (expandable) -- */
.story-sources {
    margin-top: var(--space-sm);
}

.story-sources summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-light);
    user-select: none;
    list-style: none;
    padding: var(--space-xs) 0;
    transition: color 0.2s ease;
}

.story-sources summary::-webkit-details-marker {
    display: none;
}

.story-sources summary::before {
    content: "\25B6\FE0E";
    display: inline-block;
    margin-right: var(--space-sm);
    font-size: 0.7em;
    transition: transform 0.2s ease;
}

.story-sources[open] > summary::before {
    transform: rotate(90deg);
}

.story-sources summary:hover {
    color: var(--color-text);
}

.story-sources ul {
    font-size: 0.82rem;
    list-style: none;
    padding-left: var(--space-md);
    margin-top: var(--space-xs);
}

.story-sources ul li {
    margin-bottom: var(--space-xs);
}

.story-sources ul a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.story-sources ul a:hover {
    color: var(--color-accent);
}

/* -- Benchmark Callout -- */
.llm-benchmark-callout {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.llm-benchmark-callout h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: #ffffff;
}

.llm-benchmark-callout > p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* -- Benchmark Grid -- */
.benchmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

/* -- Benchmark Item -- */
.benchmark-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

/* -- Benchmark Label -- */
.benchmark-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* -- Benchmark Value -- */
.benchmark-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin: var(--space-xs) 0;
    color: #ffffff;
}

/* -- Benchmark Detail -- */
.benchmark-detail {
    display: block;
    font-size: 0.82rem;
    opacity: 0.85;
}

/* -- Benchmark Note -- */
.benchmark-note {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-top: var(--space-md);
}

.benchmark-note a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.benchmark-note a:hover {
    opacity: 1;
    color: rgba(255, 255, 255, 0.9);
}

/* -- LLM Stories responsive -- */
@media (max-width: 768px) {
    .stories-grid {
        grid-template-columns: 1fr;
    }

    .benchmark-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .story-card {
        padding: var(--space-md);
    }

    .cluster-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .benchmark-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   26. LECTURE PATH PAGES
   ========================================================================== */

/* ---------- 26a. Lecture Hero ---------- */

.lecture-hero {
    padding: calc(64px + var(--space-xl)) var(--space-lg) var(--space-xl);
    background: linear-gradient(
        145deg,
        var(--color-primary) 0%,
        var(--color-primary-light) 55%,
        #1565c0 100%
    );
    color: #ffffff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle dot-grid overlay — lighter than the hero radials */
.lecture-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.lecture-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 15% 25%, rgba(255,255,255,0.05) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 85% 75%, rgba(0,137,123,0.15) 0%, transparent 70%);
    pointer-events: none;
}

/* Number badge sits above the title */
.lecture-number-badge {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: var(--space-md);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.lecture-hero h1 {
    position: relative;
    z-index: 1;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    max-width: 760px;
    margin: 0 auto var(--space-sm);
    animation: fadeInUp 0.7s ease both;
}

.lecture-hero .subtitle {
    position: relative;
    z-index: 1;
    font-size: clamp(0.95rem, 2vw, 1.15rem);
    opacity: 0.88;
    max-width: 620px;
    margin: 0 auto var(--space-md);
    font-weight: 400;
    line-height: 1.65;
    animation: fadeInUp 0.7s 0.12s ease both;
}

/* Era / path description pill row */
.lecture-meta {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    animation: fadeInUp 0.7s 0.24s ease both;
}

.lecture-meta .badge {
    padding: var(--space-xs) var(--space-md);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.lecture-meta .badge:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.55);
}

/* Era range — bolder, slightly larger */
.lecture-meta .era-range {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: rgba(255, 143, 0, 0.25);
    border-color: rgba(255, 179, 0, 0.55);
    color: #fff;
}


/* ---------- 26b. Lecture Content Wrapper ---------- */

.lecture-content {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}


/* ---------- 26c. Lecture Timeline ---------- */

.lecture-timeline {
    position: relative;
    margin: var(--space-xl) 0;
}

/* Continuous vertical line */
.timeline-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--color-primary) 5%,
        var(--color-primary) 95%,
        transparent 100%
    );
    z-index: 0;
}

/* Each milestone card */
.timeline-milestone {
    position: relative;
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
    align-items: flex-start;
}

.timeline-milestone:last-child {
    margin-bottom: 0;
}

/* Alternating layout: odd = card left, even = card right */
.timeline-milestone:nth-child(odd) {
    flex-direction: row;
    padding-right: calc(50% + var(--space-xl));
}

.timeline-milestone:nth-child(even) {
    flex-direction: row-reverse;
    padding-left: calc(50% + var(--space-xl));
}

/* Central dot on the spine */
.timeline-milestone::before {
    content: "";
    position: absolute;
    left: 50%;
    top: var(--space-lg);
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 3px solid var(--color-bg);
    box-shadow: 0 0 0 2px var(--color-primary);
    z-index: 1;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.timeline-milestone:hover::before {
    background: var(--color-secondary);
    box-shadow: 0 0 0 2px var(--color-secondary), 0 0 12px rgba(0, 137, 123, 0.35);
}

/* Card body */
.milestone-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    padding: var(--space-lg);
    width: 100%;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    position: relative;
    z-index: 1;
}

.timeline-milestone:nth-child(odd) .milestone-card:hover {
    transform: translateX(-4px);
    box-shadow: var(--shadow-md);
}

.timeline-milestone:nth-child(even) .milestone-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

/* Connector arrow pointing toward the spine */
.timeline-milestone:nth-child(odd) .milestone-card::after {
    content: "";
    position: absolute;
    right: -10px;
    top: calc(var(--space-lg) + 4px);
    border: 8px solid transparent;
    border-left-color: var(--color-border);
}

.timeline-milestone:nth-child(odd) .milestone-card::before {
    content: "";
    position: absolute;
    right: -8px;
    top: calc(var(--space-lg) + 5px);
    border: 7px solid transparent;
    border-left-color: var(--color-surface);
    z-index: 1;
}

.timeline-milestone:nth-child(even) .milestone-card::after {
    content: "";
    position: absolute;
    left: -10px;
    top: calc(var(--space-lg) + 4px);
    border: 8px solid transparent;
    border-right-color: var(--color-border);
}

.timeline-milestone:nth-child(even) .milestone-card::before {
    content: "";
    position: absolute;
    left: -8px;
    top: calc(var(--space-lg) + 5px);
    border: 7px solid transparent;
    border-right-color: var(--color-surface);
    z-index: 1;
}

/* Era badge (date / period) */
.milestone-era {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--color-secondary);
    padding: 2px 10px;
    border-radius: 999px;
    margin-bottom: var(--space-xs);
    letter-spacing: 0.02em;
}

/* Mathematician / scientist name */
.milestone-figure {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
    line-height: 1.3;
}

/* Narrative paragraph */
.milestone-content {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.milestone-content:last-child {
    margin-bottom: 0;
}

/* Formula box inside milestone */
.milestone-formula {
    background: var(--color-math-bg);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-top: var(--space-sm);
    text-align: center;
    font-size: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-left: 3px solid var(--color-primary);
}

/* Milestone type label badges */
.milestone-type {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 9px;
    border-radius: 999px;
    margin-bottom: var(--space-sm);
    margin-right: var(--space-xs);
}

.milestone-type-origin {
    background: rgba(26, 35, 126, 0.1);
    color: var(--color-primary);
}

.milestone-type-unsolved {
    background: rgba(198, 40, 40, 0.1);
    color: #c62828;
}

.milestone-type-breakthrough {
    background: rgba(0, 137, 123, 0.12);
    color: var(--color-secondary);
}

.milestone-type-discovery {
    background: rgba(92, 107, 192, 0.12);
    color: #3949ab;
}

.milestone-type-ai-connection {
    background: rgba(255, 143, 0, 0.12);
    color: #e65100;
}


/* ---------- 26d. Callout Boxes (milestone type callouts) ---------- */

.callout {
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-md) 0;
    border-left: 4px solid;
    position: relative;
}

.callout-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-xs);
}

.callout p,
.callout-desc {
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0;
}

/* Origin — primary blue tint */
.callout-origin {
    background: rgba(26, 35, 126, 0.06);
    border-left-color: var(--color-primary);
}

.callout-origin .callout-label {
    color: var(--color-primary);
}

.callout-origin p,
.callout-origin .callout-desc {
    color: #303f9f;
}

/* Unsolved — warm red tint */
.callout-unsolved {
    background: rgba(198, 40, 40, 0.06);
    border-left-color: #c62828;
}

.callout-unsolved .callout-label {
    color: #c62828;
}

.callout-unsolved p,
.callout-unsolved .callout-desc {
    color: #b71c1c;
}

/* Breakthrough — secondary green tint */
.callout-breakthrough {
    background: rgba(0, 137, 123, 0.07);
    border-left-color: var(--color-secondary);
}

.callout-breakthrough .callout-label {
    color: var(--color-secondary);
}

.callout-breakthrough p,
.callout-breakthrough .callout-desc {
    color: #00695c;
}

/* Discovery — indigo tint */
.callout-discovery {
    background: rgba(92, 107, 192, 0.08);
    border-left-color: #5c6bc0;
}

.callout-discovery .callout-label {
    color: #3949ab;
}

.callout-discovery p,
.callout-discovery .callout-desc {
    color: #3f51b5;
}

/* AI connection — accent orange tint */
.callout-ai-connection {
    background: rgba(255, 143, 0, 0.07);
    border-left-color: var(--color-accent);
}

.callout-ai-connection .callout-label {
    color: #e65100;
}

.callout-ai-connection p,
.callout-ai-connection .callout-desc {
    color: #bf360c;
}


/* ---------- 26e. Key Formula Box ---------- */

.key-formula {
    background: var(--color-surface);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-lg);
    margin: var(--space-xl) 0;
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

/* Faint primary watermark overlay */
.key-formula::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(26, 35, 126, 0.03) 0%,
        transparent 60%
    );
    pointer-events: none;
}

.key-formula .formula {
    font-size: 1.3em;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-md) 0;
    position: relative;
    z-index: 1;
}

.key-formula-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.key-formula-caption {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-light);
    font-style: italic;
    margin-top: var(--space-sm);
    line-height: 1.55;
}


/* ---------- 26f. Lecture Navigation ---------- */

.lecture-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin: var(--space-2xl) 0 var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.lecture-nav-prev,
.lecture-nav-hub,
.lecture-nav-next {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.lecture-nav-prev {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.lecture-nav-prev:hover {
    background: var(--color-math-bg);
    color: var(--color-primary);
    transform: translateX(-3px);
    box-shadow: var(--shadow-md);
}

.lecture-nav-hub {
    background: var(--color-primary);
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.lecture-nav-hub:hover {
    background: var(--color-primary-light);
    color: #ffffff;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.lecture-nav-next {
    background: var(--color-secondary);
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.lecture-nav-next:hover {
    background: var(--color-secondary-light);
    color: #ffffff;
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
}

/* Arrow glyphs inside nav buttons */
.lecture-nav-prev::before {
    content: "\2190";
}

.lecture-nav-next::after {
    content: "\2192";
}


/* ---------- 26g. Lecture Hub Grid ---------- */

.lecture-hub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    max-width: 1000px;
    margin: 0 auto;
}

.lecture-hub-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--lhc-color, var(--color-secondary));
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.lecture-hub-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at top right, rgba(26, 35, 126, 0.04), transparent 70%);
    pointer-events: none;
}

.lecture-hub-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    color: var(--color-text);
}

/* Color cycling for hub cards (7 colors, matching story-card pattern) */
.lecture-hub-card:nth-child(7n + 1) { --lhc-color: var(--color-primary); }
.lecture-hub-card:nth-child(7n + 2) { --lhc-color: var(--color-secondary); }
.lecture-hub-card:nth-child(7n + 3) { --lhc-color: var(--color-accent); }
.lecture-hub-card:nth-child(7n + 4) { --lhc-color: #5c6bc0; }
.lecture-hub-card:nth-child(7n + 5) { --lhc-color: #00897b; }
.lecture-hub-card:nth-child(7n + 6) { --lhc-color: #e65100; }
.lecture-hub-card:nth-child(7n + 7) { --lhc-color: #283593; }

/* Large lecture number */
.lecture-hub-number {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--lhc-color, var(--color-primary));
    opacity: 0.22;
    line-height: 1;
    margin-bottom: var(--space-xs);
    font-variant-numeric: tabular-nums;
}

.lecture-hub-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
    line-height: 1.3;
}

/* Era range pill beneath the title */
.lecture-hub-era {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--color-math-bg);
    color: var(--color-primary);
    margin-bottom: var(--space-md);
    align-self: flex-start;
}

.lecture-hub-desc {
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.6;
    flex: 1;
    margin-bottom: var(--space-md);
}

.lecture-hub-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--lhc-color, var(--color-secondary));
    margin-top: auto;
    transition: color 0.2s ease;
}

.lecture-hub-card:hover .lecture-hub-link {
    color: var(--color-accent);
}

.lecture-hub-link::after {
    content: " \2192";
}


/* ---------- 26h. Cross-references ---------- */

.cross-ref {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-secondary);
    background: rgba(0, 137, 123, 0.08);
    border: 1px solid rgba(0, 137, 123, 0.2);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    vertical-align: middle;
    margin: 0 2px;
}

.cross-ref::before {
    content: "\2192";
    font-size: 0.85em;
}

.cross-ref:hover {
    background: rgba(0, 137, 123, 0.15);
    color: var(--color-secondary);
    border-color: rgba(0, 137, 123, 0.4);
}


/* ---------- 26i. Era Dividers ---------- */

.era-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-2xl) 0;
    position: relative;
    z-index: 1;
}

.era-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-border), transparent);
}

.era-divider-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-light);
    background: var(--color-bg);
    padding: var(--space-xs) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* On white-background pages, override the era-divider background */
.lecture-content .era-divider-label {
    background: var(--color-surface);
}


/* ---------- 26j. Section heading inside lecture pages ---------- */

.lecture-section-heading {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: var(--color-primary);
    margin: var(--space-xl) 0 var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 3px solid var(--color-secondary);
    display: inline-block;
}


/* ---------- 26k. Lecture path responsive ---------- */

/* Tablet and up: 2-column hub grid */
@media (min-width: 768px) {
    .lecture-hub-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lecture-nav-prev,
    .lecture-nav-hub,
    .lecture-nav-next {
        padding: var(--space-sm) var(--space-xl);
    }
}

/* Mobile: stacked timeline, single column */
@media (max-width: 767px) {
    .lecture-hero {
        padding: calc(64px + var(--space-lg)) var(--space-md) var(--space-lg);
    }

    .lecture-number-badge {
        width: 56px;
        height: 56px;
        font-size: 1.35rem;
    }

    /* Collapse to left-anchored single column */
    .timeline-line {
        left: 20px;
        transform: none;
    }

    .timeline-milestone,
    .timeline-milestone:nth-child(odd),
    .timeline-milestone:nth-child(even) {
        flex-direction: column;
        padding-right: 0;
        padding-left: calc(20px + var(--space-lg) + var(--space-md));
    }

    .timeline-milestone::before {
        left: 20px;
        transform: none;
    }

    /* Remove connector arrows on mobile */
    .timeline-milestone:nth-child(odd) .milestone-card::after,
    .timeline-milestone:nth-child(odd) .milestone-card::before,
    .timeline-milestone:nth-child(even) .milestone-card::after,
    .timeline-milestone:nth-child(even) .milestone-card::before {
        display: none;
    }

    .timeline-milestone:nth-child(odd) .milestone-card:hover,
    .timeline-milestone:nth-child(even) .milestone-card:hover {
        transform: translateY(-2px);
    }

    .lecture-content {
        padding: var(--space-lg) var(--space-md);
    }

    .key-formula {
        padding: var(--space-lg) var(--space-md);
    }

    .lecture-nav {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .lecture-nav-prev,
    .lecture-nav-hub,
    .lecture-nav-next {
        justify-content: center;
    }

    .lecture-hub-card {
        padding: var(--space-md);
    }
}

/* Small mobile */
@media (max-width: 479px) {
    .lecture-hub-number {
        font-size: 1.75rem;
    }

    .milestone-card {
        padding: var(--space-md);
    }

    .callout {
        padding: var(--space-sm) var(--space-md);
    }
}
