:root {
    --lecture-charcoal: #1C1C1E;
    --parchment-cream: #F5F0E1;
    --copper-teal: #2A7B6F;
    --bankers-amber: #D4A854;
    --ledger-green: #3B5E4F;
    --warm-stone: #8B7D6B;
    --midnight-ink: #0E0E10;
    --margin-red: #9B3B3B;
    --chalk-white: #EDEDED;
    --faded-teal: #6B8F82;
    --text-light: #D4CFC4;
    --text-dark: #3A3A3C;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--lecture-charcoal);
    color: var(--parchment-cream);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* ============================================
   THE LECTURE HALL
   ============================================ */

.lecture-hall {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 60% 40%;
    background-color: var(--lecture-charcoal);
}

.lecture-left {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.lecture-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: -0.03em;
    color: var(--parchment-cream);
    line-height: 1.05;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lecture-title span {
    display: block;
}

.lecture-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.sd-diagram {
    max-width: 100%;
    height: auto;
}

.sd-supply, .sd-demand {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: drawCurve 4s cubic-bezier(0.25, 0.1, 0.25, 1.0) 0.4s forwards;
}

.sd-demand {
    animation-delay: 0.8s;
}

@keyframes drawCurve {
    to { stroke-dashoffset: 0; }
}

/* ============================================
   THE PINBOARD
   ============================================ */

.pinboard {
    padding: 4rem 2rem;
    background-color: var(--lecture-charcoal);
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    grid-auto-flow: dense;
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.card {
    padding: 1.75rem;
    position: relative;
}

.card-large {
    grid-column: span 2;
}

.theorem-card {
    background-color: var(--parchment-cream);
    border: 1px solid var(--lecture-charcoal);
}

.paradox-card {
    background-color: var(--lecture-charcoal);
    border: 1px solid var(--warm-stone);
    background-image:
        repeating-linear-gradient(to right, rgba(58,58,60,0.06) 0px, rgba(58,58,60,0.06) 1px, transparent 1px, transparent 24px),
        repeating-linear-gradient(to bottom, rgba(58,58,60,0.06) 0px, rgba(58,58,60,0.06) 1px, transparent 1px, transparent 24px);
}

.quote-card {
    background-color: var(--copper-teal);
}

.card-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--copper-teal);
    display: block;
    margin-bottom: 0.75rem;
}

.label-light {
    color: var(--faded-teal);
}

.label-white {
    color: rgba(255, 255, 255, 0.7);
}

.card-heading {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: 1.5rem;
    color: var(--lecture-charcoal);
    margin-bottom: 0.75rem;
    line-height: 1.15;
}

.heading-light {
    color: var(--parchment-cream);
}

.card-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-dark);
}

.text-light {
    color: var(--text-light);
}

.card-quote {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ffffff;
    font-style: italic;
    margin-bottom: 0.75rem;
}

.card-attribution {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.03em;
}

.card-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.card-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   THE SEMINAR TABLE
   ============================================ */

.seminar-table {
    padding: 4rem 2rem;
    background-color: var(--bankers-amber);
}

.seminar-heading {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--lecture-charcoal);
    text-align: center;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--lecture-charcoal);
    border: 2px solid var(--lecture-charcoal);
}

.bento-cell {
    perspective: 800px;
    height: 200px;
    cursor: pointer;
}

.bento-front,
.bento-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    transition: transform 0.6s ease;
}

.bento-cell {
    position: relative;
}

.bento-front {
    background-color: var(--bankers-amber);
    z-index: 2;
}

.bento-back {
    background-color: var(--parchment-cream);
    transform: rotateY(180deg);
}

.bento-cell:hover .bento-front {
    transform: rotateY(180deg);
}

.bento-cell:hover .bento-back {
    transform: rotateY(0deg);
}

.bento-question {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: 1.25rem;
    color: var(--lecture-charcoal);
    text-align: center;
    line-height: 1.2;
}

.bento-answer {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-dark);
    text-align: center;
}

/* ============================================
   THE LIBRARY
   ============================================ */

.library-section {
    padding: 4rem 2rem;
    background-color: var(--lecture-charcoal);
}

.library-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--warm-stone);
    margin-bottom: 2rem;
    padding-left: 1rem;
}

.bookshelf {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    gap: 3px;
    padding-bottom: 1rem;
    height: 70vh;
    max-height: 500px;
}

.book-spine {
    flex-shrink: 0;
    width: clamp(40px, 6vw, 80px);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    cursor: pointer;
    transition: width 0.4s ease;
}

.book-spine:hover {
    width: 120px;
}

.spine-burgundy { background-color: #4A1A2C; }
.spine-forest { background-color: #1A3A2A; }
.spine-navy { background-color: #1A1A3A; }
.spine-ochre { background-color: #8B6914; }

.spine-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--parchment-cream);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    letter-spacing: 0.03em;
    opacity: 0.85;
}

/* ============================================
   THE CLOSING BELL
   ============================================ */

.closing-bell {
    background-color: var(--midnight-ink);
    padding: 4rem 0;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ticker-wrapper {
    width: 100%;
    overflow: hidden;
    margin-bottom: 2rem;
}

.ticker-tape {
    display: flex;
    gap: 3rem;
    white-space: nowrap;
    animation: ticker 40s linear infinite;
}

@keyframes ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.ticker-item {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--bankers-amber);
    letter-spacing: 0.03em;
}

.closing-colophon {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--warm-stone);
    opacity: 0.5;
    text-transform: lowercase;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .lecture-hall {
        grid-template-columns: 1fr;
    }

    .lecture-title {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .masonry-grid {
        grid-template-columns: 1fr;
    }

    .card-large {
        grid-column: span 1;
    }

    .bento-grid {
        grid-template-columns: 1fr 1fr;
    }

    .bento-cell {
        height: 160px;
    }

    .bookshelf {
        height: 50vh;
    }
}
