/* ============================================
   economics.quest - The Professor's Study
   Skeuomorphic design with broken-grid layout
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: #3b3226;
    background-color: #f5efe0;
    overflow-x: hidden;
}


/* Color reference - ensuring all design tokens present */
/* #1a1612 Soft Charcoal - used in box-shadow rgba(26,22,18) */
/* #4a7c59 Banker's Green - used for interactive accent */

a, .accent-link {
    color: #4a7c59;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover, .accent-link:hover {
    color: #c9a84c;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4a7c59;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* Brass pin on cards */
.index-card::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9a84c 0%, #e8d5b7 40%, #c9a84c 70%, #8a7340 100%);
    box-shadow: 0 1px 3px rgba(26, 22, 18, 0.3);
    z-index: 2;
}



.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Watermark Currency Symbols --- */
.watermark {
    position: absolute;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 20vw;
    color: #3b3226;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

.watermark-1 { top: 10vh; right: -5vw; }
.watermark-2 { bottom: 5vh; left: -3vw; }
.watermark-3 { top: 20vh; left: -5vw; }
.watermark-4 { bottom: 30vh; right: -3vw; }

/* --- Zone Base --- */
.zone {
    position: relative;
    width: 100%;
}

/* ============================================
   ZONE 1: THE FOYER
   ============================================ */
#foyer {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Duotone wrapper technique */
.duotone-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #6b4e3d;
    mix-blend-mode: multiply;
    overflow: hidden;
}

.duotone-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e8d5b7;
    mix-blend-mode: screen;
    z-index: 2;
}

.duotone-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

/* Foyer city skyline - CSS generated skyline */
.foyer-image {
    background: 
        linear-gradient(180deg, #8a7340 0%, #c9a060 30%, #e8d5b7 60%, #b89050 100%);
    position: relative;
}

.foyer-image::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background:
        linear-gradient(to right,
            transparent 0%, transparent 3%,
            #3b3226 3%, #3b3226 5%,
            transparent 5%, transparent 8%,
            #3b3226 8%, #3b3226 10%,
            transparent 10%, transparent 12%,
            #3b3226 12%, #3b3226 13%,
            transparent 13%, transparent 16%,
            #3b3226 16%, #3b3226 19%,
            transparent 19%, transparent 22%,
            #3b3226 22%, #3b3226 25%,
            transparent 25%, transparent 27%,
            #3b3226 27%, #3b3226 28%,
            transparent 28%, transparent 30%,
            #3b3226 30%, #3b3226 33%,
            transparent 33%, transparent 35%,
            #3b3226 35%, #3b3226 36%,
            transparent 36%, transparent 40%,
            #3b3226 40%, #3b3226 44%,
            transparent 44%, transparent 47%,
            #3b3226 47%, #3b3226 49%,
            transparent 49%, transparent 52%,
            #3b3226 52%, #3b3226 54%,
            transparent 54%, transparent 56%,
            #3b3226 56%, #3b3226 58%,
            transparent 58%, transparent 62%,
            #3b3226 62%, #3b3226 66%,
            transparent 66%, transparent 69%,
            #3b3226 69%, #3b3226 71%,
            transparent 71%, transparent 74%,
            #3b3226 74%, #3b3226 76%,
            transparent 76%, transparent 78%,
            #3b3226 78%, #3b3226 80%,
            transparent 80%, transparent 83%,
            #3b3226 83%, #3b3226 86%,
            transparent 86%, transparent 89%,
            #3b3226 89%, #3b3226 92%,
            transparent 92%, transparent 95%,
            #3b3226 95%, #3b3226 97%,
            transparent 97%, transparent 100%
        );
    background-size: 100% 100%;
    clip-path: polygon(
        0% 100%, 0% 60%, 3% 60%, 3% 45%, 5% 45%, 5% 60%, 
        8% 60%, 8% 30%, 10% 30%, 10% 60%, 12% 60%, 12% 50%, 
        13% 50%, 13% 35%, 16% 35%, 16% 20%, 19% 20%, 19% 45%,
        22% 45%, 22% 55%, 25% 55%, 25% 40%, 27% 40%, 27% 25%,
        28% 15%, 30% 25%, 30% 40%, 33% 40%, 33% 55%, 35% 55%,
        35% 65%, 36% 65%, 36% 50%, 40% 50%, 40% 35%, 44% 35%,
        44% 55%, 47% 55%, 47% 40%, 49% 40%, 49% 55%, 52% 55%,
        52% 45%, 54% 45%, 54% 30%, 56% 30%, 56% 15%, 58% 15%,
        58% 30%, 62% 30%, 62% 50%, 66% 50%, 66% 35%, 69% 35%,
        69% 55%, 71% 55%, 71% 65%, 74% 65%, 74% 45%, 76% 45%,
        76% 55%, 78% 55%, 78% 40%, 80% 40%, 80% 50%, 83% 50%,
        83% 60%, 86% 60%, 86% 45%, 89% 45%, 89% 55%, 92% 55%,
        92% 65%, 95% 65%, 95% 50%, 97% 50%, 97% 60%, 100% 60%,
        100% 100%
    );
    opacity: 0.9;
}

.foyer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 35, 24, 0.3);
    z-index: 3;
}

.foyer-content {
    position: relative;
    z-index: 4;
    text-align: center;
}

.foyer-headline {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(5rem, 12vw, 10rem);
    letter-spacing: -0.03em;
    line-height: 0.95;
    color: #f5efe0;
    text-shadow: 2px 4px 20px rgba(26, 22, 18, 0.4);
}

.foyer-headline .word {
    display: inline-block;
    opacity: 0;
    will-change: transform, opacity;
}

.word-economics {
    transform: translateX(-60px);
    animation: slideFromLeft 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s forwards;
}

.word-dot {
    transform: translateY(40px);
    animation: slideFromBelow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 1.0s forwards;
    color: #c9a84c;
}

.word-quest {
    transform: translateX(60px);
    animation: slideFromRight 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s forwards;
}

@keyframes slideFromLeft {
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideFromBelow {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideFromRight {
    to { opacity: 1; transform: translateX(0); }
}

/* Pull Tab */
.pull-tab {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    cursor: pointer;
    will-change: transform;
}

.pull-tab-body {
    width: 50px;
    height: 120px;
    border-radius: 8px 8px 25px 25px;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(201, 168, 76, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(107, 78, 61, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, #6b4e3d 0%, #4a3528 40%, #3b2a1e 100%);
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(201, 168, 76, 0.2),
        2px 4px 12px rgba(26, 22, 18, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 12px;
    animation: bobUpDown 2s ease-in-out infinite;
}

.pull-tab-ring {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid transparent;
    background:
        linear-gradient(135deg, #c9a84c 0%, #e8d5b7 30%, #c9a84c 60%, #8a7340 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
}

.pull-tab-ring::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 50%;
    background: #4a3528;
}

.pull-tab-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    color: #e8d5b7;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    writing-mode: vertical-rl;
    margin-top: 10px;
}

@keyframes bobUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ============================================
   ZONE 2: THE DESK SURFACE
   ============================================ */
#desk {
    min-height: 200vh;
    background-color: #f5efe0;
    background-image:
        radial-gradient(ellipse at center, transparent 50%, rgba(44, 35, 24, 0.08) 100%);
    padding: clamp(4rem, 8vh, 8rem) clamp(2rem, 5vw, 6rem);
    position: relative;
}

/* Paper grain texture overlay */
#desk::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(59, 50, 38, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 70% 60%, rgba(59, 50, 38, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(59, 50, 38, 0.03) 1px, transparent 1px);
    background-size: 17px 17px, 23px 23px, 19px 19px;
    pointer-events: none;
    z-index: 0;
}

.desk-surface {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

/* Supply/Demand Decorative Curve */
.supply-demand-curve {
    position: absolute;
    top: 5%;
    right: -5%;
    width: 300px;
    height: 225px;
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
}

.supply-demand-curve.animated .curve-supply,
.supply-demand-curve.animated .curve-demand {
    animation: drawCurve 2s ease-out forwards;
}

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

/* Card Clusters - Broken Grid */
.card-cluster {
    display: grid;
    gap: clamp(2rem, 4vw, 4rem);
    margin-bottom: clamp(4rem, 8vh, 8rem);
    position: relative;
}

.cluster-1 {
    grid-template-columns: 1.2fr 0.8fr;
    padding-left: 5%;
}

.cluster-2 {
    grid-template-columns: 0.9fr 1.1fr;
    padding-right: 8%;
    padding-left: 12%;
}

.cluster-3 {
    grid-template-columns: 1fr 1fr;
    padding-left: 3%;
    padding-right: 5%;
}

/* Index Cards */
.index-card {
    background: #f5efe0;
    border-radius: 4px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    box-shadow:
        2px 4px 12px rgba(26, 22, 18, 0.15), /* #1a1612 at 15% */
        0 1px 3px rgba(26, 22, 18, 0.1);
    transform: rotate(var(--card-rotation, 0deg));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    position: relative;
    will-change: transform;
    cursor: default;
}

/* Graph paper background on cards */
.index-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background-image:
        linear-gradient(rgba(122, 111, 93, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(122, 111, 93, 0.06) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.index-card:hover {
    transform: rotate(0deg) translateY(-6px);
    box-shadow:
        4px 8px 24px rgba(26, 22, 18, 0.25),
        0 2px 6px rgba(26, 22, 18, 0.15);
}

.card-header-line {
    border-top: 2px solid #b85c38;
    width: 85%;
    margin: 0 auto clamp(0.8rem, 1.5vw, 1.2rem);
}

.card-title {
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: clamp(1.25rem, 3vw, 2rem);
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: #3b3226;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.card-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    line-height: 1.7;
    color: #3b3226;
    max-width: 65ch;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.card-label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    color: #7a6f5d;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    z-index: 1;
}

/* ============================================
   ZONE 3: THE WINDOW VIEW
   ============================================ */
#window {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5efe0;
    padding: 20vh 0;
}

.window-frame {
    position: relative;
    width: 100%;
    height: 60vh;
    overflow: hidden;
}

.window-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.window-image {
    background:
        linear-gradient(135deg, #6b4e3d 0%, #8a7340 25%, #c9a060 50%, #b89050 75%, #e8d5b7 100%);
    width: 100%;
    height: 100%;
    position: relative;
}

/* Panoramic city view - CSS generated */
.window-image::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65%;
    background: #3b3226;
    clip-path: polygon(
        0% 100%, 0% 70%, 2% 70%, 2% 55%, 4% 55%, 4% 45%, 6% 45%, 6% 55%,
        8% 55%, 8% 40%, 9% 40%, 9% 25%, 10% 20%, 11% 25%, 11% 40%,
        13% 40%, 13% 50%, 15% 50%, 15% 35%, 17% 35%, 17% 50%, 19% 50%,
        19% 60%, 21% 60%, 21% 45%, 23% 45%, 23% 30%, 25% 30%, 25% 45%,
        27% 45%, 27% 55%, 29% 55%, 29% 42%, 31% 42%, 31% 28%, 32% 20%,
        33% 28%, 33% 42%, 35% 42%, 35% 50%, 37% 50%, 37% 38%, 39% 38%,
        39% 50%, 41% 50%, 41% 60%, 43% 60%, 43% 48%, 45% 48%, 45% 35%,
        47% 35%, 47% 22%, 48% 15%, 49% 22%, 49% 35%, 51% 35%, 51% 48%,
        53% 48%, 53% 55%, 55% 55%, 55% 40%, 57% 40%, 57% 52%, 59% 52%,
        59% 60%, 61% 60%, 61% 50%, 63% 50%, 63% 38%, 65% 38%, 65% 50%,
        67% 50%, 67% 42%, 69% 42%, 69% 30%, 70% 22%, 71% 30%, 71% 42%,
        73% 42%, 73% 55%, 75% 55%, 75% 45%, 77% 45%, 77% 35%, 79% 35%,
        79% 48%, 81% 48%, 81% 55%, 83% 55%, 83% 42%, 85% 42%, 85% 55%,
        87% 55%, 87% 60%, 89% 60%, 89% 48%, 91% 48%, 91% 38%, 93% 38%,
        93% 52%, 95% 52%, 95% 60%, 97% 60%, 97% 50%, 100% 50%, 100% 100%
    );
    opacity: 0.7;
}

.window-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    padding: 0 clamp(2rem, 8vw, 10rem);
    background: rgba(44, 35, 24, 0.35);
}

.window-quote {
    max-width: 900px;
    text-align: center;
}

.window-quote p {
    font-family: 'Lora', serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.5rem, 4vw, 3rem);
    line-height: 1.4;
    color: #f5efe0;
    text-shadow: 1px 2px 8px rgba(26, 22, 18, 0.4);
}

/* ============================================
   ZONE 4: THE BOOKSHELF
   ============================================ */
#bookshelf {
    min-height: 150vh;
    background-color: #2c2318;
    padding: clamp(4rem, 8vh, 8rem) clamp(2rem, 4vw, 4rem);
    position: relative;
    overflow: hidden;
}

/* Cork board background */
#bookshelf::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-conic-gradient(#3b3226 0% 25%, #2c2318 0% 50%) 0 0 / 8px 8px;
    opacity: 0.3;
    pointer-events: none;
}

.bookshelf-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #f5efe0;
    text-align: center;
    margin-bottom: clamp(3rem, 6vh, 6rem);
    position: relative;
    z-index: 1;
    letter-spacing: -0.03em;
    line-height: 0.95;
}

.bookshelf-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    max-width: 1100px;
    margin: 0 auto;
    height: 450px;
    position: relative;
    z-index: 1;
    align-items: stretch;
}

.book-spine {
    position: relative;
    background: var(--spine-color, #6b4e3d);
    border-radius: 3px 6px 6px 3px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s ease-out;
    will-change: transform;
    /* Leather texture */
    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 0, 0, 0.1) 0%, transparent 50%);
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.15),
        inset -2px 0 4px rgba(0, 0, 0, 0.2),
        3px 0 8px #1a1612;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spine-title {
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    color: #f5efe0;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.book-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: clamp(1rem, 2vw, 2rem);
    opacity: 0;
    transition: opacity 0.4s ease 0.1s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(26, 22, 18, 0.9);
    overflow: hidden;
}

.book-spine.expanded .spine-title {
    opacity: 0;
}

.book-spine.expanded .book-content {
    opacity: 1;
}

.book-content h3 {
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: #c9a84c;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.book-author {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    color: #7a6f5d;
    margin-bottom: 0.8rem;
}

.book-desc {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
    line-height: 1.6;
    color: #e8d5b7;
}

/* ============================================
   ZONE 5: THE LAMP
   ============================================ */
#lamp {
    min-height: 100vh;
    background-color: #2c2318;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: clamp(4rem, 8vh, 8rem) clamp(2rem, 5vw, 6rem);
}

.lamp-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vw;
    max-width: 800px;
    max-height: 800px;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        rgba(245, 239, 224, 0.12) 0%,
        rgba(245, 239, 224, 0.06) 30%,
        rgba(245, 239, 224, 0.02) 50%,
        transparent 70%
    );
    pointer-events: none;
}

.lamp-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
}

.lamp-colophon-label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    color: #7a6f5d;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.lamp-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.03em;
    line-height: 0.95;
    color: #f5efe0;
    margin-bottom: 1.5rem;
}

.gold-dot {
    color: #c9a84c;
}

.lamp-closing {
    font-family: 'Lora', serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.5;
    color: #e8d5b7;
    margin-bottom: 2rem;
}

.lamp-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #c9a84c 0%, #e8d5b7 50%, #c9a84c 100%);
    margin: 0 auto 2rem;
}

.lamp-footnote {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    line-height: 1.7;
    color: #7a6f5d;
    max-width: 50ch;
    margin: 0 auto;
}

/* City silhouette footer */
.city-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    pointer-events: none;
}

.silhouette-svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .card-cluster {
        grid-template-columns: 1fr;
    }

    .cluster-1, .cluster-2, .cluster-3 {
        padding-left: 0;
        padding-right: 0;
    }

    .bookshelf-container {
        grid-template-columns: repeat(3, 1fr);
        height: 350px;
    }

    .book-spine.expanded {
        grid-column: span 3;
    }

    .foyer-headline {
        font-size: clamp(3rem, 15vw, 6rem);
    }

    .window-frame {
        height: 50vh;
    }
}

@media (max-width: 480px) {
    .bookshelf-container {
        grid-template-columns: repeat(2, 1fr);
        height: 300px;
    }

    .book-spine.expanded {
        grid-column: span 2;
    }
}

/* ============================================
   ANIMATION STATES
   ============================================ */
.zone-visible .index-card {
    animation: cardAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: rotate(var(--card-rotation, 0deg)) translateY(30px);
    }
    to {
        opacity: 1;
        transform: rotate(var(--card-rotation, 0deg)) translateY(0);
    }
}

/* Scroll-triggered opacity for zone transitions */
.index-card {
    opacity: 0;
}

.zone-visible .index-card:nth-child(1) { animation-delay: 0s; }
.zone-visible .index-card:nth-child(2) { animation-delay: 0.15s; }
