/* thesecond.day - Weimar avant-garde collage meets baroque opera */

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

:root {
    --deep-stage: #2A1C12;
    --burnt-umber: #8B5E3C;
    --tawny-gold: #C4956A;
    --antique-cream: #F2E6D9;
    --rose-dust: #C47A6E;
    --theatre-crimson: #9B2335;
    --warm-shadow: #5A3D2A;
    --parchment-white: #FAF4ED;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Crimson Pro', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.8;
    color: var(--deep-stage);
    background-color: var(--antique-cream);
    overflow-x: hidden;
}

/* === Side Navigation === */
.side-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 60px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: rgba(42, 28, 18, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
}

.nav-act {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--tawny-gold);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: transform 0.3s ease, color 0.3s ease;
    position: relative;
    padding: 4px 0;
}

.nav-act.active {
    transform: scale(1.5);
    color: var(--antique-cream);
}

.nav-act.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--tawny-gold);
}

/* === Overture === */
.overture {
    min-height: 100vh;
    background-color: var(--deep-stage);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-left: 60px;
}

.overture-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 7vw, 6rem);
    color: var(--antique-cream);
    letter-spacing: 0.1em;
    opacity: 0;
    animation: fadeInUp 1.5s 0.8s ease forwards;
}

.gold-thread-overture {
    width: 0;
    height: 1px;
    background-color: var(--tawny-gold);
    margin: 40px 0;
    animation: drawLine 1s 2.3s ease forwards;
}

@keyframes drawLine {
    to { width: 60%; }
}

.overture-tagline {
    font-family: 'Crimson Pro', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--tawny-gold);
    opacity: 0;
    animation: fadeInUp 1s 3s ease forwards;
}

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

/* === Bubbles === */
.bubble {
    border-radius: 50%;
    position: absolute;
    animation: floatBubble 6s ease-in-out infinite, bubbleRise 2s ease-out forwards;
    transition: transform 0.3s ease;
    pointer-events: auto;
}

.bubble:hover {
    transform: scale(1.05);
}

.bubble-sm {
    width: 36px;
    height: 36px;
    background-color: var(--rose-dust);
    opacity: 0.3;
}

.bubble-md {
    width: 90px;
    height: 90px;
    background-color: var(--tawny-gold);
    opacity: 0.5;
    border: 1px solid var(--burnt-umber);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bubble-lg {
    width: 200px;
    height: 200px;
    background-color: var(--antique-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 20px rgba(90, 61, 42, 0.15);
}

.bubble-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 1.2vw, 0.9375rem);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--deep-stage);
}

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

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

/* Stagger bubble rise in overture */
.overture .bubble:nth-child(3) { animation-delay: 0.8s, 0s; }
.overture .bubble:nth-child(4) { animation-delay: 1.0s, 0.2s; }
.overture .bubble:nth-child(5) { animation-delay: 1.2s, 0.4s; }
.overture .bubble:nth-child(6) { animation-delay: 1.4s, 0.6s; }
.overture .bubble:nth-child(7) { animation-delay: 1.6s, 0.8s; }
.overture .bubble:nth-child(8) { animation-delay: 1.8s, 1.0s; }
.overture .bubble:nth-child(9) { animation-delay: 2.0s, 1.2s; }
.overture .bubble:nth-child(10) { animation-delay: 2.2s, 1.4s; }

/* === Act Curtains === */
.act-curtain {
    position: relative;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 60px;
    overflow: hidden;
}

.curtain-line {
    position: absolute;
    left: 60px;
    right: 0;
    height: 4px;
}

.curtain-top {
    top: 28px;
    background-color: var(--deep-stage);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.8s ease-out;
}

.curtain-bottom {
    bottom: 28px;
    background-color: var(--burnt-umber);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.8s 0.2s ease-out;
}

.act-curtain.visible .curtain-top,
.act-curtain.visible .curtain-bottom {
    transform: scaleX(1);
}

.curtain-number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 48px;
    color: var(--theatre-crimson);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s 0.5s ease;
}

.act-curtain.visible .curtain-number {
    opacity: 1;
}

/* === Act Sections === */
.act-section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    padding: 80px 24px 80px 84px;
}

/* === Act I === */
.act-grid-1 {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: center;
    min-height: 60vh;
}

.collage-panel {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.panel-anchor {
    clip-path: polygon(0 2%, 98% 0, 100% 97%, 3% 100%);
}

.oversize-word {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(4rem, 12vw, 10rem);
    color: var(--antique-cream);
    opacity: 0.6;
    text-transform: lowercase;
}

.text-column {
    padding: 24px 0;
}

.act-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--deep-stage);
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.act-body {
    color: var(--warm-shadow);
    margin-bottom: 16px;
}

.act-body-italic {
    font-style: italic;
    color: var(--burnt-umber);
}

/* === Gold Thread SVGs === */
.gold-thread-svg {
    position: absolute;
    width: 100%;
    height: 200px;
    bottom: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.gold-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease;
}

.gold-thread-svg.animate .gold-line {
    stroke-dashoffset: 0;
}

/* === Act II === */
.collage-zone {
    position: relative;
    min-height: 50vh;
    margin-bottom: 40px;
}

.collage-fragment {
    position: absolute;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collage-fragment.visible {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 4px 4px 12px rgba(90, 61, 42, 0.2);
}

.collage-fragment:hover {
    box-shadow: 8px 8px 20px rgba(90, 61, 42, 0.3);
    transform: translateY(-4px);
}

.fragment-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--deep-stage);
}

/* Act II fragment positions */
.frag-1 { top: 5%; left: 10%; width: 280px; height: 200px; transform: rotate(2deg); z-index: 2; }
.frag-2 { top: 15%; left: 35%; width: 240px; height: 180px; transform: rotate(-1deg); z-index: 3; }
.frag-3 { top: 30%; right: 15%; width: 200px; height: 260px; transform: rotate(3deg); z-index: 1; }
.frag-4 { bottom: 10%; left: 25%; width: 300px; height: 150px; transform: rotate(-2deg); z-index: 4; }

.act-content-overlap {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.text-rotated-left {
    transform: rotate(-2deg);
    padding: 24px;
    background-color: var(--parchment-white);
    box-shadow: 4px 4px 12px rgba(90, 61, 42, 0.15);
}

.text-rotated-right {
    transform: rotate(1.5deg);
    padding: 24px;
    background-color: var(--parchment-white);
    box-shadow: 4px 4px 12px rgba(90, 61, 42, 0.15);
    grid-column: 2;
}

.panel-secondary {
    min-height: 200px;
    clip-path: polygon(2% 0, 100% 3%, 97% 100%, 0 98%);
}

.thread-act2 {
    height: 400px;
}

/* === Act III - Dense === */
.collage-dense {
    min-height: 60vh;
}

.frag-dense-1 { top: 0; left: 5%; width: 250px; height: 180px; transform: rotate(-3deg); z-index: 2; }
.frag-dense-2 { top: 5%; left: 30%; width: 220px; height: 220px; transform: rotate(4deg); z-index: 4; }
.frag-dense-3 { top: 10%; right: 10%; width: 200px; height: 280px; transform: rotate(-2deg); z-index: 3; }
.frag-dense-4 { top: 35%; left: 15%; width: 300px; height: 140px; transform: rotate(1deg); z-index: 5; }
.frag-dense-5 { bottom: 15%; right: 20%; width: 180px; height: 200px; transform: rotate(-4deg); z-index: 2; }
.frag-dense-6 { bottom: 5%; left: 40%; width: 260px; height: 160px; transform: rotate(2deg); z-index: 6; }

.act-content-dense {
    position: relative;
    max-width: 900px;
    margin: 40px auto 0;
}

.act-title-dramatic {
    font-size: clamp(3rem, 7vw, 6rem);
    color: var(--theatre-crimson);
}

.text-angle-1 { transform: rotate(-1deg); margin-bottom: 24px; }
.text-angle-2 {
    transform: rotate(2deg);
    padding: 32px;
    background-color: var(--parchment-white);
    box-shadow: 4px 4px 16px rgba(90, 61, 42, 0.2);
    margin-bottom: 24px;
}
.text-angle-3 {
    transform: rotate(-1.5deg);
    padding: 24px;
    background-color: rgba(196, 149, 106, 0.15);
    max-width: 600px;
    margin-left: auto;
}

.oversize-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(4rem, 12vw, 10rem);
    color: var(--antique-cream);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    white-space: nowrap;
}

.thread-act3 {
    height: 400px;
}

/* === Curtain Call === */
.curtain-call {
    min-height: 100vh;
    background-color: var(--deep-stage);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-left: 60px;
}

.curtain-bubble {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background-color: var(--antique-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 3s ease, transform 3s ease;
}

.curtain-bubble.fade-out {
    opacity: 0;
    transform: translateY(-80px);
}

.curtain-bubble .bubble-text {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 500;
}

.curtain-final-text {
    font-family: 'Crimson Pro', serif;
    font-weight: 400;
    font-size: 18px;
    color: var(--tawny-gold);
    opacity: 0;
    transition: opacity 2s ease;
    margin-top: 60px;
    text-align: center;
}

.curtain-final-text.visible {
    opacity: 1;
}

/* === Hover-lift for all fragments & panels === */
.collage-panel,
.text-block {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.collage-panel:hover {
    transform: translateY(-4px);
    box-shadow: 8px 8px 24px rgba(90, 61, 42, 0.25);
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .overture-title, .overture-tagline {
        animation: none;
        opacity: 1;
    }
    .gold-thread-overture {
        animation: none;
        width: 60%;
    }
    .bubble {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .curtain-top, .curtain-bottom {
        transform: scaleX(1);
        transition: none;
    }
    .curtain-number {
        opacity: 1;
        transition: none;
    }
    .collage-fragment {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .gold-line {
        stroke-dashoffset: 0;
        transition: none;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .side-nav {
        width: 44px;
    }

    .act-section {
        padding-left: 54px;
    }

    .overture {
        padding-left: 44px;
    }

    .curtain-call {
        padding-left: 44px;
    }

    .act-curtain {
        padding-left: 44px;
    }

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

    .act-content-overlap {
        grid-template-columns: 1fr;
    }

    .collage-panel {
        min-height: 250px;
    }

    .bubble-lg {
        width: 140px;
        height: 140px;
    }

    .collage-fragment {
        position: relative;
        width: 100% !important;
        height: auto !important;
        min-height: 120px;
        transform: none !important;
        margin-bottom: 16px;
    }

    .frag-dense-1, .frag-dense-2, .frag-dense-3,
    .frag-dense-4, .frag-dense-5, .frag-dense-6 {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
    }

    .collage-zone, .collage-dense {
        display: flex;
        flex-direction: column;
        gap: 12px;
        min-height: auto;
    }
}
