/* ============================================
   courthouse.stream -- Styles
   Blobitecture as Institutional Surrealism
   ============================================ */

:root {
    --deep-ground: #1E1D2B;
    --surface: #2C2B3C;
    --brass: #A8926E;
    --verdigris: #5B7B7A;
    --paper: #D4CFC4;
    --fog: #E8E4DD;
    --ember: #8B4F3A;
    --void: #0F0E17;
    --steel: #6B6E7B;
    --aged-gray: #8E8A82;
    --accent-display: #2C2B3C;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Commissioner', sans-serif;
    background-color: var(--void);
    color: var(--paper);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- Persistent Glyph Seal ---- */

.glyph-seal {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
    opacity: 0.6;
    animation: glyphPulse 4s ease-in-out infinite;
}

@keyframes glyphPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* ---- Watermark Seals ---- */

.watermark-seal {
    position: fixed;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

.watermark-seal-1 {
    top: 10%;
    right: -5%;
    animation: watermarkRotate1 720s linear infinite;
}

.watermark-seal-2 {
    bottom: 5%;
    left: -3%;
    animation: watermarkRotate2 600s linear infinite;
}

@keyframes watermarkRotate1 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes watermarkRotate2 {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* ---- Scenes (Sections) ---- */

.scene {
    position: relative;
    width: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
}

/* ---- Scene 1: The Foyer ---- */

.scene-foyer {
    height: 100vh;
    background-color: var(--void);
    z-index: 1;
}

.foyer-illustration {
    position: absolute;
    width: 60vw;
    max-width: 800px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    opacity: 0;
    transition: opacity 1s ease;
}

.foyer-illustration.visible {
    opacity: 1;
}

.courthouse-elevation {
    width: 100%;
    height: auto;
}

.draw-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.foyer-illustration.visible .draw-path {
    animation: drawStroke 3s ease-out forwards;
}

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

.foyer-title {
    position: absolute;
    top: 45%;
    left: 20%;
    font-family: 'Commissioner', sans-serif;
    font-weight: 900;
    font-size: clamp(48px, 8vw, 96px);
    color: var(--paper);
    letter-spacing: 0.04em;
    text-transform: lowercase;
    opacity: 0;
    transition: opacity 1.5s ease 2.5s;
    z-index: 2;
}

.foyer-title.visible {
    opacity: 1;
}

/* ---- Scene 2: The Corridor ---- */

.scene-corridor {
    min-height: 130vh;
    background-color: var(--deep-ground);
    display: grid;
    grid-template-columns: 1fr 1fr;
    place-items: center;
    gap: 0;
    padding: 10vh 5vw;
}

.blob-container {
    position: relative;
    background: rgba(44, 43, 60, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 48px;
    animation: blobBreathe 10s ease-in-out infinite;
}

.blob-left {
    border-radius: 30% 70% 60% 40% / 50% 30% 70% 50%;
    max-width: 520px;
    transform: translateX(-100vw);
    opacity: 0;
    transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1), opacity 800ms ease;
}

.blob-left.visible {
    transform: translateX(0);
    opacity: 1;
}

.blob-right {
    border-radius: 60% 40% 30% 70% / 40% 60% 50% 50%;
    max-width: 480px;
    transform: translateX(100vw);
    opacity: 0;
    transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1), opacity 800ms ease;
    transition-delay: 200ms;
}

.blob-right.visible {
    transform: translateX(0);
    opacity: 1;
}

@keyframes blobBreathe {
    0% { border-radius: 30% 70% 60% 40% / 50% 30% 70% 50%; }
    25% { border-radius: 35% 65% 55% 45% / 45% 35% 65% 55%; }
    50% { border-radius: 40% 60% 50% 50% / 55% 40% 60% 45%; }
    75% { border-radius: 32% 68% 58% 42% / 48% 32% 68% 52%; }
    100% { border-radius: 30% 70% 60% 40% / 50% 30% 70% 50%; }
}

.blob-content {
    position: relative;
    z-index: 2;
}

.blob-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
}

.corridor-blueprint {
    width: 100%;
    max-width: 360px;
    height: auto;
}

/* ---- Scene 3: The Chamber ---- */

.scene-chamber {
    height: 70vh;
    background-color: var(--deep-ground);
    position: relative;
    display: grid;
    place-items: center;
}

.chamber-layer {
    position: absolute;
    width: 70%;
    max-width: 700px;
    height: 60%;
}

.chamber-back {
    background: rgba(44, 43, 60, 0.4);
    border-radius: 45% 55% 50% 50% / 40% 60% 50% 55%;
    transform: translate(8px, 12px);
    filter: blur(4px);
    opacity: 0;
    transition: opacity 1s ease;
    mix-blend-mode: overlay;
}

.chamber-back.visible {
    opacity: 0.4;
}

.chamber-mid {
    display: grid;
    place-items: center;
    border-radius: 50% 50% 45% 55% / 55% 45% 55% 50%;
    opacity: 0;
    transition: opacity 1s ease 200ms;
}

.chamber-mid.visible {
    opacity: 0.2;
}

.contour-pattern {
    width: 100%;
    height: auto;
}

.chamber-front {
    position: relative;
    width: 65%;
    max-width: 640px;
    z-index: 3;
    border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
    background: rgba(44, 43, 60, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 48px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 800ms ease 400ms, transform 800ms cubic-bezier(0.16, 1, 0.3, 1) 400ms;
}

.chamber-front.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Scene 4: The Archive ---- */

.scene-archive {
    min-height: 130vh;
    background-color: var(--deep-ground);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 15vh;
}

.archive-label {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.archive-label.visible {
    opacity: 1;
    transform: translateY(0);
}

.annotation-large {
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: clamp(11px, 1.2vw, 13px);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--aged-gray);
}

.archive-seals {
    margin-top: 40vh;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.archive-seals.visible {
    opacity: 1;
    transform: translateY(0);
}

.seal-grid {
    display: grid;
    grid-template-columns: repeat(6, 80px);
    grid-template-rows: repeat(4, 80px);
    gap: 24px;
}

.seal-item {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
}

.seal-item svg {
    width: 80px;
    height: 80px;
}

/* ---- Scene 5: The Seal Room ---- */

.scene-seal {
    height: 100vh;
    background-color: var(--void);
    display: grid;
    place-items: center;
}

.seal-main {
    width: 60vw;
    max-width: 600px;
    opacity: 0;
    transition: opacity 1s ease;
}

.seal-main.visible {
    opacity: 1;
}

.grand-seal {
    width: 100%;
    height: auto;
}

.seal-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.seal-main.visible .seal-path {
    animation: drawSealStroke 3s ease-out forwards;
}

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

.seal-text {
    opacity: 0;
    transition: opacity 1s ease 2.8s;
}

.seal-main.visible .seal-text {
    opacity: 1;
}

.seal-main.pulse {
    animation: sealPulse 2s ease-in-out;
}

@keyframes sealPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* ---- Typography ---- */

.section-heading {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4vw, 48px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--paper);
    margin-bottom: 24px;
    line-height: 1.2;
}

.body-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(16px, 1.3vw, 20px);
    line-height: 1.75;
    color: var(--steel);
    margin-bottom: 20px;
}

.body-text:last-of-type {
    margin-bottom: 0;
}

.annotation {
    display: block;
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: clamp(10px, 0.9vw, 13px);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--aged-gray);
    margin-bottom: 20px;
}

.annotation:last-child {
    margin-bottom: 0;
    margin-top: 24px;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
    .scene-corridor {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 8vh 6vw;
    }

    .blob-left,
    .blob-right {
        max-width: 90%;
    }

    .seal-grid {
        grid-template-columns: repeat(4, 80px);
        grid-template-rows: repeat(6, 80px);
    }

    .chamber-front {
        width: 85%;
    }

    .foyer-title {
        left: 10%;
    }
}

@media (max-width: 600px) {
    .seal-grid {
        grid-template-columns: repeat(3, 70px);
        grid-template-rows: repeat(8, 70px);
        gap: 16px;
    }

    .seal-item {
        width: 70px;
        height: 70px;
    }

    .seal-item svg {
        width: 70px;
        height: 70px;
    }

    .blob-container {
        padding: 32px;
    }

    .chamber-front {
        padding: 32px;
        width: 90%;
    }

    .foyer-title {
        left: 8%;
        top: 50%;
    }

    .seal-main {
        width: 85vw;
    }
}
