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

:root {
    --color-gold-primary: #E8B84B;
    --color-gold-secondary: #C4943A;
    --color-cream: #F0E6D3;
    --color-dark-navy: #231C4A;
    --color-void: #0E0B24;
    --color-navy: #2A2154;
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-tan: #C9B99A;
    --color-purple: #8B7BA8;
    --color-dark-purple: #1B1438;

    --font-display: 'Playfair Display', serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-accent: 'Josefin Sans', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-sans: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', 'Playfair Display', 'Josefin Sans', 'Space Mono', 'Inter', serif;
    background-color: var(--color-void);
    color: var(--color-cream);
    line-height: 1.8;
    overflow-x: hidden;
}

/* Typography */
h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 5.5vw, 4.8rem);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-gold-primary);
    text-align: center;
    margin-top: 2rem;
}

h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-gold-primary);
    font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.section-label {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    color: var(--color-gold-secondary);
    text-transform: uppercase;
    opacity: 0.7;
    font-weight: 400;
}

p {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    font-weight: 300;
    line-height: 1.9;
    color: var(--color-cream);
}

/* Sections */
section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Section I: The Seal Chamber */
.seal-chamber {
    background: linear-gradient(135deg, var(--color-void) 0%, var(--color-navy) 50%, var(--color-dark-purple) 100%);
}

.seal-container {
    text-align: center;
    margin-bottom: 3rem;
    z-index: 1;
    position: relative;
}

.seal-container svg {
    display: block;
    margin: 0 auto 2rem;
    filter: drop-shadow(0 0 20px rgba(232, 184, 75, 0.3));
    animation: seal-pulse 4s ease-in-out infinite;
}

@keyframes seal-pulse {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(232, 184, 75, 0.3));
    }
    50% {
        opacity: 0.85;
        filter: drop-shadow(0 0 40px rgba(232, 184, 75, 0.5));
    }
}

.opening-text {
    max-width: 45vw;
    text-align: center;
    z-index: 1;
    position: relative;
    margin-top: 3rem;
}

.opening-text p {
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    letter-spacing: 0.05em;
}

/* Section II: The Filing Chamber */
.filing-chamber {
    background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-dark-navy) 50%, var(--color-purple) 100%);
}

.chamber-header {
    text-align: center;
    margin-bottom: 4rem;
    z-index: 1;
    position: relative;
}

.chamber-header h2 {
    margin-top: 1rem;
}

.filing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 3rem;
    max-width: 50vw;
    margin-bottom: 4rem;
    z-index: 1;
    position: relative;
    width: 100%;
}

.filing-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.octagon-marker {
    margin-bottom: 1.5rem;
}

.octagon-marker svg {
    display: block;
    filter: drop-shadow(0 0 10px rgba(232, 184, 75, 0.2));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.filing-unit:hover .octagon-marker svg {
    transform: rotate(15deg) scale(1.1);
    filter: drop-shadow(0 0 20px rgba(232, 184, 75, 0.4));
}

.unit-text {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: var(--color-gold-secondary);
    font-weight: 400;
}

.chamber-prose {
    max-width: 45vw;
    text-align: center;
    z-index: 1;
    position: relative;
    margin-top: 2rem;
}

/* Section III: The Radiant Field */
.radiant-field {
    background: linear-gradient(180deg, var(--color-dark-purple) 0%, var(--color-navy) 50%, var(--color-void) 100%);
}

.field-header {
    text-align: center;
    margin-bottom: 3rem;
    z-index: 1;
    position: relative;
}

.field-header h2 {
    margin-top: 1rem;
}

.radiant-geometry {
    width: 100%;
    max-width: 600px;
    margin-bottom: 3rem;
    z-index: 1;
    position: relative;
    padding: 2rem;
}

.radiant-lines {
    opacity: 0.7;
    animation: radiant-glow 6s ease-in-out infinite;
}

@keyframes radiant-glow {
    0%, 100% {
        opacity: 0.6;
        filter: drop-shadow(0 0 10px rgba(232, 184, 75, 0.2));
    }
    50% {
        opacity: 0.9;
        filter: drop-shadow(0 0 30px rgba(232, 184, 75, 0.4));
    }
}

.field-prose {
    max-width: 45vw;
    text-align: center;
    z-index: 1;
    position: relative;
}

/* Section IV: The Descending Vault */
.descending-vault {
    background: var(--color-void);
    position: relative;
}

.descending-vault::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
}

.vault-header {
    text-align: center;
    margin-bottom: 3rem;
    z-index: 1;
    position: relative;
}

.vault-header h2 {
    margin-top: 1rem;
}

.vault-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    max-width: 50vw;
    z-index: 1;
    position: relative;
}

.chevron-array {
    width: 100%;
    max-width: 400px;
    margin-bottom: 2rem;
}

.chevron-array svg {
    opacity: 0.8;
    animation: chevron-flow 3s ease-in-out infinite;
}

@keyframes chevron-flow {
    0% {
        opacity: 0.6;
        transform: translateX(-10px);
    }
    50% {
        opacity: 1;
        transform: translateX(10px);
    }
    100% {
        opacity: 0.6;
        transform: translateX(-10px);
    }
}

.vault-prose {
    text-align: center;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    max-width: 45vw;
}

.final-seal {
    text-align: center;
}

.final-octagon {
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 30px rgba(196, 148, 58, 0.5));
    animation: final-seal-glow 5s ease-in-out infinite;
}

@keyframes final-seal-glow {
    0%, 100% {
        opacity: 0.7;
        filter: drop-shadow(0 0 15px rgba(196, 148, 58, 0.3));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 50px rgba(196, 148, 58, 0.7));
    }
}

/* Shake error animation (repurposed) */
@keyframes shake-error {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    50% {
        transform: translateX(10px);
    }
    75% {
        transform: translateX(-10px);
    }
}

.shake-error-active {
    animation: shake-error 0.5s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    section {
        padding: 3rem 1.5rem;
    }

    .seal-container svg {
        width: 200px;
        height: 200px;
    }

    .filing-grid {
        grid-template-columns: 1fr;
        max-width: 90vw;
        gap: 2rem;
    }

    .opening-text,
    .chamber-prose,
    .field-prose,
    .vault-prose {
        max-width: 90vw;
    }

    .radiant-geometry {
        max-width: 90vw;
        padding: 1rem;
    }

    .vault-content {
        max-width: 90vw;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .seal-container svg {
        width: 150px;
        height: 150px;
    }

    p {
        font-size: 0.95rem;
    }
}

/* Utility classes */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
}
