:root {
    --bg-primary: #0A0A0F;
    --bg-secondary: #2A0A1B;
    --emerald: #0B6E4F;
    --ruby: #8B1A2B;
    --sapphire: #1B3A6B;
    --gold: #C9A84C;
    --text-primary: #D4CFC4;
    --text-muted: #6B6560;
    --ruby-dark: #5C1018;
    --ruby-light: #C42B47;
    --ruby-highlight: #E8A0A0;
    --sapphire-dark: #0D1F3C;
    --sapphire-light: #2B5EA7;
    --sapphire-highlight: #8BADD4;
    --emerald-dark: #064C36;
    --emerald-light: #12A676;
    --emerald-highlight: #7EDBB8;
}

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

html {
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'EB Garamond', serif;
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    line-height: 1.9;
    overflow-x: hidden;
}

/* Progress Ring */
#progress-ring {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    opacity: 0.2;
    transition: opacity 0.3s ease;
}

/* Sections */
.section {
    min-height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Vault Door */
#vault-door {
    background: radial-gradient(ellipse at 50% 50%, #0B6E4F10 0%, var(--bg-primary) 70%);
    flex-direction: column;
}

.hero-word {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(5rem, 18vw, 14rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--emerald);
    line-height: 1;
    position: relative;
    z-index: 2;
}

.gold-rule {
    position: absolute;
    bottom: 15%;
    left: 50%;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: center;
    width: 60%;
    margin-left: -30%;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gold-rule.visible {
    transform: scaleX(1);
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.floater {
    position: absolute;
    border: 1px solid var(--gold);
    opacity: 0.15;
}

.floater.hex {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: float-horizontal 47s linear infinite;
}

.floater.diamond {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation: float-vertical 61s linear infinite;
}

.floater.circle {
    border-radius: 50%;
    animation: float-diagonal 53s linear infinite;
}

@keyframes float-horizontal {
    0% { transform: translateX(-20vw); }
    50% { transform: translateX(20vw); }
    100% { transform: translateX(-20vw); }
}

@keyframes float-vertical {
    0% { transform: translateY(-15vh); }
    50% { transform: translateY(15vh); }
    100% { transform: translateY(-15vh); }
}

@keyframes float-diagonal {
    0% { transform: translate(-10vw, -10vh); }
    25% { transform: translate(10vw, -5vh); }
    50% { transform: translate(5vw, 10vh); }
    75% { transform: translate(-8vw, 5vh); }
    100% { transform: translate(-10vw, -10vh); }
}

/* Chamber Sections */
.chamber {
    justify-content: flex-start;
    align-items: center;
}

.text-block {
    position: relative;
    z-index: 3;
    max-width: 28ch;
    margin-left: 15vw;
    align-self: center;
}

.section-label {
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    color: var(--gold);
    text-transform: uppercase;
    display: block;
    margin-bottom: 2rem;
}

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.15;
    margin-bottom: 2.5rem;
}

[data-jewel="ruby"] .section-title { color: var(--ruby); }
[data-jewel="sapphire"] .section-title { color: var(--sapphire); }
[data-jewel="emerald"] .section-title { color: var(--emerald); }

.text-block p {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Jewels */
.jewel {
    position: absolute;
    width: 30vmin;
    height: 30vmin;
    right: 12%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    animation: jewel-glitch 8s step-end infinite;
}

/* Ruby Jewel */
.ruby-jewel {
    clip-path: ellipse(50% 45% at 50% 50%);
    background:
        radial-gradient(ellipse at 40% 35%, rgba(232, 160, 160, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, var(--ruby-light) 0%, var(--ruby) 40%, var(--ruby-dark) 80%);
}

/* Sapphire Jewel */
.sapphire-jewel {
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    background:
        radial-gradient(ellipse at 40% 35%, rgba(139, 173, 212, 0.2) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, var(--sapphire-light) 0%, var(--sapphire) 40%, var(--sapphire-dark) 80%);
}

/* Emerald Jewel */
.emerald-jewel {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background:
        radial-gradient(ellipse at 40% 35%, rgba(126, 219, 184, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, var(--emerald-light) 0%, var(--emerald) 40%, var(--emerald-dark) 80%);
}

@keyframes jewel-glitch {
    0%, 98.125% { transform: translateY(-50%) translate(0, 0); }
    98.125%, 100% { transform: translateY(-50%) translate(2px, -1px); }
}

/* Section Dividers */
.section-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-divider.visible {
    transform: scaleX(1);
}

/* Display Case */
#display-case {
    padding: 0;
}

.display-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    width: 100vw;
    height: 100vh;
}

.display-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.display-column:nth-child(1),
.display-column:nth-child(2) {
    border-right: 1px solid var(--gold);
}

.display-jewel {
    width: 20vmin;
    height: 20vmin;
    margin-bottom: 2rem;
    animation: jewel-glitch 8s step-end infinite;
}

.display-label {
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    color: var(--gold);
    text-transform: uppercase;
}

/* Inscription */
#inscription {
    background: var(--bg-primary);
    flex-direction: column;
    transition: background-color 1.5s ease;
}

#inscription.active {
    background: var(--bg-secondary);
}

.inscription-ring {
    position: absolute;
    width: 50vmin;
    height: 50vmin;
    border: 1px solid var(--gold);
    border-radius: 50%;
    pointer-events: none;
}

.inscription-text {
    max-width: 36ch;
    text-align: center;
    position: relative;
    z-index: 2;
}

.inscription-text p {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    line-height: 1.9;
    color: var(--text-primary);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .floater,
    .jewel,
    .display-jewel {
        animation: none !important;
    }
    .gold-rule,
    .section-divider {
        transition: none !important;
        transform: scaleX(1) !important;
    }
}
