/* ============================================
   bada.city -- Dopamine Cathedral
   Color Palette:
     Hot Coral:       #FF2D6B
     Electric Mint:   #00F5D4
     Dopamine Yellow: #FFD93D
     Obsidian:        #0D0D0D
     Void Purple:     #0A0019
     Crypt Black:     #050505
     Calacatta White: #F0EDE8
     Vein Grey:       #9B8E7E
     Verde Antico:    #1A1A2E
     Verde Vein:      #2D2D4E
     Flame Amber:     #FF8C42
     Near White:      #FAFAFA
     Smoke:           #6B6B7B
   Fonts: Outfit, Syne, JetBrains Mono
   ============================================ */

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    --scroll-weight: 400;
    --scroll-progress: 0;
}

body {
    background: #0D0D0D;
    color: #FAFAFA;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1rem, 1.2vw + 0.6rem, 1.4rem);
    line-height: 1.65;
    letter-spacing: -0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === TYPOGRAPHY CLASSES === */
.syne-display {
    font-family: 'Syne', sans-serif;
    font-variation-settings: 'wght' var(--scroll-weight, 400);
    letter-spacing: -0.03em;
    line-height: 1.1;
    transition: font-variation-settings 0.3s ease-out;
}

.outfit-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    line-height: 1.65;
    letter-spacing: -0.01em;
}

.jetbrains-mono {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: #6B6B7B;
    text-transform: uppercase;
}

/* === CHAMBER BASE === */
.chamber {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.chamber-tall {
    min-height: 150vh;
}

.chamber-extra-tall {
    min-height: 200vh;
}

/* ============================================
   CHAMBER 1: THE VESTIBULE
   ============================================ */
#chamber-vestibule {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F0EDE8;
    position: relative;
    z-index: 10;
}

.vestibule-marble {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.marble-surface.calacatta {
    position: absolute;
    inset: 0;
    background: #F0EDE8;
    filter: url(#marble-calacatta);
}

.marble-crack-left,
.marble-crack-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    background: #F0EDE8;
    filter: url(#marble-calacatta);
    transition: clip-path 1.2s cubic-bezier(0.65, 0, 0.35, 1), opacity 1s ease;
    z-index: 2;
}

.marble-crack-left {
    left: 0;
    clip-path: polygon(0 0, 52% 0, 50% 20%, 53% 40%, 49% 60%, 52% 80%, 50% 100%, 0 100%);
}

.marble-crack-right {
    right: 0;
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 48% 100%, 51% 80%, 47% 60%, 50% 40%, 48% 20%);
}

.marble-crack-left.cracked {
    clip-path: polygon(-50% 0, 2% 0, 0% 20%, 3% 40%, -1% 60%, 2% 80%, 0% 100%, -50% 100%);
    opacity: 0.3;
}

.marble-crack-right.cracked {
    clip-path: polygon(100% 0, 150% 0, 150% 100%, 98% 100%, 101% 80%, 97% 60%, 100% 40%, 98% 20%);
    opacity: 0.3;
}

.vestibule-content {
    position: relative;
    z-index: 5;
    text-align: center;
    pointer-events: none;
}

.domain-carved {
    font-family: 'Syne', sans-serif;
    font-size: clamp(3rem, 8vw + 1rem, 12rem);
    font-variation-settings: 'wght' 700;
    color: transparent;
    background: #1A1A2E;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow:
        1px 1px 0 #9B8E7E,
        2px 2px 0 rgba(155, 142, 126, 0.6),
        3px 3px 1px rgba(155, 142, 126, 0.3),
        0 0 20px rgba(26, 26, 46, 0.2);
    letter-spacing: -0.03em;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    position: relative;
}

.domain-carved.shake-easter-egg {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.vestibule-subtitle {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #9B8E7E;
    margin-top: 1.5rem;
    opacity: 0.7;
    animation: subtitlePulse 3s ease-in-out infinite;
}

@keyframes subtitlePulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.9; }
}

/* Vestibule Candle */
.candle-single {
    position: absolute;
    bottom: 15vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.flame-inner {
    width: 6px;
    height: 14px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: #FFD93D;
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 3;
    animation: flickerScale 2s ease-in-out infinite, flickerOpacity 1.5s ease-in-out infinite;
}

.flame-outer {
    width: 10px;
    height: 22px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: linear-gradient(#FF8C42, #FF2D6B);
    opacity: 0.7;
    position: absolute;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%);
    z-index: 2;
    animation: flickerScale 2s ease-in-out infinite 0.1s, flickerSkew 3s ease-in-out infinite;
}

.flame-glow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(#FFD93D 0%, transparent 70%);
    opacity: 0.3;
    filter: blur(8px);
    position: absolute;
    left: 50%;
    bottom: -4px;
    transform: translateX(-50%);
    z-index: 1;
    animation: flickerOpacity 1.5s ease-in-out infinite 0.3s;
}

@keyframes flickerScale {
    0%, 100% { transform: translateX(-50%) scaleY(1); }
    50% { transform: translateX(-50%) scaleY(1.15); }
}

@keyframes flickerSkew {
    0%, 100% { transform: translateX(-50%) skewX(0deg); }
    25% { transform: translateX(-50%) skewX(3deg); }
    75% { transform: translateX(-50%) skewX(-3deg); }
}

@keyframes flickerOpacity {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Vestibule candle glow on marble */
#chamber-vestibule::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    height: 40vh;
    background: radial-gradient(ellipse at bottom, rgba(255, 217, 61, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 4;
}

/* ============================================
   CHAMBER 2: THE PASSAGE
   ============================================ */
#chamber-passage {
    min-height: 150vh;
    background: #0D0D0D;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10vh 5vw;
}

.passage-fragments {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.marble-fragment {
    position: absolute;
    background: #F0EDE8;
    filter: url(#marble-fragment);
    opacity: 0.15;
    will-change: transform;
}

.fragment-1 {
    width: 120px;
    height: 80px;
    top: 10%;
    left: 15%;
    clip-path: polygon(10% 0%, 90% 5%, 100% 70%, 80% 100%, 0% 85%);
    animation: floatFragment 25s ease-in-out infinite;
}

.fragment-2 {
    width: 80px;
    height: 100px;
    top: 25%;
    right: 20%;
    clip-path: polygon(20% 0%, 100% 10%, 85% 90%, 5% 100%, 0% 30%);
    animation: floatFragment 32s ease-in-out infinite reverse;
}

.fragment-3 {
    width: 150px;
    height: 60px;
    top: 45%;
    left: 60%;
    clip-path: polygon(0% 15%, 80% 0%, 100% 60%, 90% 100%, 10% 85%);
    animation: floatFragment 28s ease-in-out infinite 5s;
}

.fragment-4 {
    width: 60px;
    height: 90px;
    top: 60%;
    left: 10%;
    clip-path: polygon(15% 0%, 100% 10%, 85% 100%, 0% 90%);
    animation: floatFragment 35s ease-in-out infinite 2s;
}

.fragment-5 {
    width: 100px;
    height: 70px;
    top: 70%;
    right: 15%;
    clip-path: polygon(5% 0%, 95% 10%, 100% 80%, 20% 100%, 0% 60%);
    animation: floatFragment 22s ease-in-out infinite 8s;
}

.fragment-6 {
    width: 90px;
    height: 110px;
    top: 15%;
    left: 70%;
    clip-path: polygon(25% 0%, 100% 15%, 80% 100%, 0% 85%, 10% 20%);
    animation: floatFragment 30s ease-in-out infinite 3s;
}

.fragment-7 {
    width: 70px;
    height: 55px;
    top: 85%;
    left: 40%;
    clip-path: polygon(0% 10%, 90% 0%, 100% 75%, 15% 100%);
    animation: floatFragment 40s ease-in-out infinite 6s;
}

@keyframes floatFragment {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    25% {
        transform: translate3d(20px, -30px, 0) rotate(3deg);
    }
    50% {
        transform: translate3d(-15px, 15px, 0) rotate(-2deg);
    }
    75% {
        transform: translate3d(10px, -10px, 0) rotate(1deg);
    }
}

.passage-text-blocks {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 15vh;
    width: 100%;
    max-width: 1200px;
}

.passage-text {
    font-size: clamp(2rem, 6vw + 0.5rem, 8rem);
    font-weight: 700;
    opacity: 0;
    transform: translateY(60px) scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.passage-text.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.neon-coral { color: #FF2D6B; }
.neon-mint { color: #00F5D4; }
.neon-yellow { color: #FFD93D; }

/* Neon reflection on nearby surface */
.passage-text::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    transform: scaleY(-1);
    filter: blur(12px);
    opacity: 0.15;
    pointer-events: none;
}

.passage-text.neon-coral::after { color: #FF2D6B; }
.passage-text.neon-mint::after { color: #00F5D4; }
.passage-text.neon-yellow::after { color: #FFD93D; }

/* ============================================
   CHAMBER 3: THE ALTAR
   ============================================ */
#chamber-altar {
    height: 100vh;
    background: #1A1A2E;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.altar-layout {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.altar-circle {
    width: 60vmin;
    height: 60vmin;
    border-radius: 50%;
    background: #1A1A2E;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.verde-marble-surface {
    position: absolute;
    inset: 0;
    background: #1A1A2E;
    border-radius: 50%;
    filter: url(#marble-verde);
}

.verde-marble-surface::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, #2D2D4E 0%, transparent 40%, rgba(26, 26, 46, 0.6) 100%);
    opacity: 0.5;
}

/* Altar Candles - Clock Face Arrangement */
.altar-candles {
    position: absolute;
    width: 70vmin;
    height: 70vmin;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.altar-candle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-35vmin) rotate(calc(-1 * var(--angle)));
}

.altar-candle .flame-inner {
    animation-delay: calc(var(--angle) / 360 * 0.3s);
}

.altar-candle .flame-outer {
    animation-delay: calc(var(--angle) / 360 * 0.3s + 0.1s);
}

.altar-candle .flame-glow {
    animation-delay: calc(var(--angle) / 360 * 0.3s + 0.2s);
}

.altar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 3;
    max-width: 45vmin;
    pointer-events: none;
}

.altar-message {
    font-size: clamp(1.5rem, 3vw + 0.5rem, 3.5rem);
    color: #FAFAFA;
    margin-bottom: 1.5rem;
}

.altar-body {
    font-size: clamp(0.9rem, 1vw + 0.4rem, 1.2rem);
    color: #9B8E7E;
    font-weight: 300;
    margin-bottom: 1.5rem;
}

.altar-meta {
    color: #6B6B7B;
}

/* Wax Drips */
.wax-drips {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    justify-content: space-around;
    pointer-events: none;
}

.wax-drip {
    width: 20px;
    background: rgba(240, 237, 232, 0.4);
    border-radius: 0 0 90% 90%;
    align-self: flex-start;
}

.drip-1 { height: 60px; width: 18px; }
.drip-2 { height: 45px; width: 14px; }
.drip-3 { height: 70px; width: 22px; }
.drip-4 { height: 35px; width: 16px; }
.drip-5 { height: 55px; width: 20px; }

/* ============================================
   CHAMBER 4: THE ARCADE
   ============================================ */
#chamber-arcade {
    min-height: 200vh;
    background: #0A0019;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10vh 5vw;
    gap: 5vh;
}

.arcade-shelf {
    width: 100vw;
    height: 8vh;
    position: relative;
    margin-left: -5vw;
    margin-right: -5vw;
    overflow: hidden;
}

.marble-shelf-surface {
    position: absolute;
    inset: 0;
    background: #F0EDE8;
    filter: url(#marble-calacatta);
    opacity: 0.5;
}

.arcade-card {
    width: 100%;
    max-width: 800px;
    position: relative;
    padding: 3rem;
    overflow: hidden;
    border-radius: 2px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.arcade-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.arcade-card.shake-active {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.card-marble-bg {
    position: absolute;
    inset: 0;
    background: #F0EDE8;
    filter: url(#marble-calacatta);
    opacity: 0.08;
}

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

.card-label {
    display: block;
    margin-bottom: 1rem;
    color: #00F5D4;
    font-size: 0.75rem;
}

.card-title {
    font-size: clamp(1.5rem, 3vw + 0.5rem, 3rem);
    color: #FAFAFA;
    margin-bottom: 1rem;
}

.card-body {
    color: #9B8E7E;
    font-weight: 300;
    max-width: 600px;
}

/* Neon reflection under cards */
.arcade-card::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 10%;
    right: 10%;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(0, 245, 212, 0.1) 0%, transparent 70%);
    filter: blur(8px);
    pointer-events: none;
}

/* ============================================
   CHAMBER 5: THE CRYPT
   ============================================ */
#chamber-crypt {
    height: 100vh;
    background: #050505;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.crypt-candle-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    animation: cryptFlicker 3s ease-in-out infinite alternate;
}

@keyframes cryptFlicker {
    0% {
        filter: blur(0px);
    }
    50% {
        filter: blur(0.3px);
    }
    100% {
        filter: blur(0px);
    }
}

.crypt-candle-field.hover-active {
    animation: cryptFlickerIntense 0.15s infinite alternate;
}

@keyframes cryptFlickerIntense {
    0% { filter: blur(0px) brightness(1); }
    100% { filter: blur(0.5px) brightness(1.2); }
}

.crypt-message {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.crypt-title {
    font-size: clamp(2rem, 5vw + 1rem, 7rem);
    color: #FAFAFA;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #FAFAFA 0%, #9B8E7E 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.crypt-subtitle {
    font-size: clamp(1rem, 1.5vw + 0.5rem, 1.8rem);
    color: #6B6B7B;
    margin-bottom: 2rem;
    font-weight: 200;
}

.crypt-meta {
    display: block;
    color: #6B6B7B;
}

/* ============================================
   SHAKE ANIMATION
   ============================================ */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* ============================================
   MARBLE VEIN DIVIDER
   ============================================ */
.vein-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        #9B8E7E 15%,
        transparent 30%,
        #9B8E7E 50%,
        transparent 65%,
        #9B8E7E 80%,
        transparent 100%
    );
    opacity: 0.3;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .altar-circle {
        width: 70vmin;
        height: 70vmin;
    }

    .altar-candles {
        width: 85vmin;
        height: 85vmin;
    }

    .altar-text {
        max-width: 55vmin;
    }

    .arcade-card {
        padding: 2rem;
    }

    .passage-text {
        font-size: clamp(1.5rem, 5vw, 4rem);
    }
}

@media (max-width: 480px) {
    .passage-text-blocks {
        gap: 10vh;
    }

    .altar-text {
        max-width: 65vmin;
    }

    .altar-body {
        font-size: 0.85rem;
    }
}
