/* npc.quest - The Descent */
/* Palette: Bioluminescent Teal #5EC4B0, Coral Sunset #E8885A, Deco Gold #C4956A,
   Deep Ocean #1E3038, Trench Black #0A1A1E, Iridescent Lilac #A88EC4, Pearl #E8E0D4 */

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

html {
    scroll-snap-type: y mandatory;
}

body {
    background-color: #1E3038;
    color: #E8E0D4;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Quest Progress Bar */
.quest-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(30, 48, 56, 0.8);
    z-index: 100;
}

.quest-fill {
    height: 100%;
    width: 0%;
    background-color: #5EC4B0;
    transition: width 0.3s ease;
}

.quest-notch {
    position: absolute;
    top: -2px;
    width: 8px;
    height: 8px;
    background-color: #1E3038;
    border: 1px solid #5EC4B0;
    transform: translateX(-50%) rotate(45deg);
}

/* Cursor Wake */
.cursor-wake {
    position: fixed;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94, 196, 176, 0.15), transparent 70%);
    pointer-events: none;
    z-index: 50;
    transform: translate(-50%, -50%);
    transition: left 0.1s ease, top 0.1s ease;
}

/* Underwater Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: #5EC4B0;
    border-radius: 50%;
    opacity: 0.2;
    animation: riseUp linear infinite;
}

@keyframes riseUp {
    from { transform: translateY(0); }
    to { transform: translateY(-100vh); }
}

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

/* Room Frame */
.room-frame {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    bottom: 24px;
    border: 2px solid #C4956A;
    pointer-events: none;
    z-index: 3;
}

.room-frame::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid #C4956A;
    opacity: 0.5;
}

.corner-ornament {
    position: absolute;
    width: 24px;
    height: 24px;
}

.corner-ornament.top-left { top: -1px; left: -1px; }
.corner-ornament.top-right { top: -1px; right: -1px; }
.corner-ornament.bottom-left { bottom: -1px; left: -1px; }
.corner-ornament.bottom-right { bottom: -1px; right: -1px; }

/* Room Content */
.room-content {
    position: relative;
    z-index: 4;
    width: 100%;
    max-width: 1000px;
    padding: 60px 56px;
}

/* Surface Content */
.surface-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.surface-ornament {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sunburst-left, .sunburst-right {
    width: 60px;
    height: 24px;
}

.surface-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: #C4956A;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.surface-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-weight: 300;
    font-size: 16px;
    color: #E8E0D4;
    opacity: 0.7;
}

.chevron-down {
    width: 30px;
    height: 20px;
    animation: bounceDown 2s infinite ease-in-out;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* Split Screen Layout */
.split-screen {
    display: flex;
    align-items: center;
    gap: 40px;
}

.split-screen.reverse {
    flex-direction: row-reverse;
}

.npc-panel {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.dialogue-panel {
    flex: 0 0 55%;
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* NPC Figures */
.npc-figure {
    width: 120px;
    height: 200px;
}

.keeper { animation: bobFloat 3s infinite ease-in-out; }
.guide { animation: bobFloat 3.5s infinite ease-in-out; }
.oracle { animation: pulseRotate 3s infinite ease-in-out; }
.void-npc { animation: pulseSlow 4s infinite ease-in-out; }
.echo { animation: bobFloat 2.5s infinite ease-in-out; }

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

@keyframes pulseRotate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(5deg) scale(1.02); }
}

@keyframes pulseSlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.room-number {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #5EC4B0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* NPC Name */
.npc-name {
    font-family: 'Poiret One', cursive;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #C4956A;
}

/* Ornamental Rule */
.ornamental-rule {
    width: 100%;
    height: 1px;
    background-color: #C4956A;
    opacity: 0.4;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rule-diamond {
    width: 8px;
    height: 8px;
    background-color: #1E3038;
    border: 1px solid #C4956A;
    transform: rotate(45deg);
    position: relative;
}

/* NPC Dialogue */
.npc-dialogue {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 17px;
    line-height: 1.7;
    color: #E8E0D4;
}

/* End Sunburst */
.end-sunburst {
    width: 48px;
    height: 48px;
    margin-top: 20px;
}

/* Deep Room Styling */
.deep-room .npc-dialogue {
    font-size: 20px;
    font-weight: 300;
    opacity: 0.8;
}

/* Mobile */
@media (max-width: 768px) {
    html {
        scroll-snap-type: none;
    }

    .split-screen,
    .split-screen.reverse {
        flex-direction: column;
    }

    .npc-panel {
        flex: none;
    }

    .dialogue-panel {
        flex: none;
        padding: 24px 16px;
    }

    .room-content {
        padding: 60px 40px;
    }

    .room-frame {
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .cursor-wake {
        display: none;
    }
}

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

    .sunburst-left, .sunburst-right {
        display: none;
    }
}
