:root {
    --obsidian: #0A0A0F;
    --antique-gold: #C5A55A;
    --shadow-purple: #2D1B4E;
    --archetype-red: #6B1D35;
    --parchment: #E8E0D0;
    --oxidized-metal: #8B7355;
    --deep-blue: #1A1B3A;
    --spectral-green: #A8B5A0;
    --axis: 50vw;
    --margin: 5vw;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--obsidian);
    color: var(--parchment);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.8;
    overflow-x: hidden;
}

/* Scroll snap procession */
.procession {
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    height: 100vh;
}

.chamber {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Progress indicator */
#progress-line {
    position: fixed;
    right: 0;
    top: 0;
    width: 2px;
    height: 0%;
    background-color: var(--antique-gold);
    z-index: 100;
    transition: height 0.3s ease;
}

/* Bilateral borders */
.bilateral-border {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--oxidized-metal);
    opacity: 0.6;
    z-index: 50;
}

.bilateral-left {
    left: 5vw;
}

.bilateral-right {
    right: 5vw;
}

/* Chamber content */
.chamber-content {
    text-align: center;
    max-width: 640px;
    padding: 48px;
    z-index: 10;
}

/* ========== Chamber 1: The Threshold ========== */
.chamber-threshold {
    background-color: var(--obsidian);
}

.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.threshold-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(3rem, 14vw, 12rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--antique-gold);
    line-height: 1.1;
    margin-bottom: 96px;
}

.threshold-triangle {
    animation: trianglePulse 3s ease-in-out infinite;
}

@keyframes trianglePulse {
    0%, 100% {
        opacity: 0.4;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(8px);
    }
}

/* ========== Chamber 2: The Mask Gallery ========== */
.chamber-masks {
    background-color: var(--obsidian);
}

.masks-triptych {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    width: 100%;
    max-width: 800px;
}

.mask-container {
    width: 200px;
    text-align: center;
}

.mask-svg {
    display: block;
    margin: 0 auto 1.5rem;
}

.morph-shape {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.2s ease-out;
}

.chamber-masks.visible .morph-shape {
    stroke-dashoffset: 0;
}

.mask-1 .morph-shape { transition-delay: 0s; }
.mask-2 .morph-shape { transition-delay: 0.2s; }
.mask-3 .morph-shape { transition-delay: 0.4s; }

.mask-name {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--parchment);
}

.mask-container {
    animation: maskFloat 4s ease-in-out infinite;
}

.mask-1 { animation-delay: 0s; }
.mask-2 { animation-delay: 1.3s; }
.mask-3 { animation-delay: 2.6s; }

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

/* ========== Chamber 3: The Mirror ========== */
.chamber-mirror {
    background-color: var(--shadow-purple);
}

.mirror-planes {
    position: relative;
    width: 100%;
    max-width: 640px;
    padding: 48px;
}

.mirror-plane {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(197, 165, 90, 0.1);
}

.plane-back {
    transform: rotateY(2deg);
    opacity: 0.3;
}

.plane-mid {
    transform: rotateY(0deg);
    opacity: 0.6;
}

.plane-front {
    position: relative;
    opacity: 0.9;
    z-index: 2;
}

.sage-rule {
    width: 120px;
    height: 1px;
    background-color: var(--spectral-green);
    margin: 2rem auto;
}

.mirror-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--parchment);
    max-width: 500px;
    margin: 0 auto;
}

/* ========== Chamber 4: The Shadow ========== */
.chamber-shadow {
    background-color: var(--obsidian);
    box-shadow: inset 0 0 200px rgba(107, 29, 53, 0.15);
}

.shadow-content {
    opacity: 0.2;
    transition: opacity 2.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.chamber-shadow.visible .shadow-content {
    opacity: 1;
}

.shadow-text {
    max-width: 500px;
    margin: 0 auto 3rem;
}

.shadow-text p {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 1.125rem;
    line-height: 1.8;
}

.alchemy-symbols {
    display: flex;
    justify-content: center;
    gap: 48px;
}

/* ========== Chamber 5: The Return ========== */
.chamber-return {
    background-color: var(--obsidian);
}

.return-gold-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--antique-gold);
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 1;
}

.chamber-return.visible .return-gold-line {
    opacity: 0.3;
}

.self-mandala {
    margin-bottom: 48px;
}

.self-mandala svg {
    animation: none;
}

.chamber-return.visible .self-mandala svg {
    animation: mandalaRotate 20s linear infinite;
}

@keyframes mandalaRotate {
    to { transform: rotate(360deg); }
}

.return-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--parchment);
    max-width: 480px;
    margin: 0 auto;
}

/* Reveal text animation */
.reveal-text {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.chamber.visible .reveal-text {
    clip-path: inset(0 0 0 0);
}

/* Responsive */
@media (max-width: 768px) {
    .masks-triptych {
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }

    .threshold-title {
        font-size: clamp(2rem, 10vw, 5rem);
        letter-spacing: 0.08em;
    }

    .bilateral-border {
        display: none;
    }

    .mask-name {
        font-size: 1.2rem;
    }

    .chamber-content {
        padding: 24px;
    }
}
