/* =============================================
   gabs.quest — Surrealist Dreamscape Styles
   ============================================= */

/* Palette */
:root {
    --void-indigo: #0F1020;
    --vellum-cream: #F4F1EB;
    --midnight-ink: #2B2D42;
    --parchment-mist: #E8E4DC;
    --cartographer-gold: #D4AF37;
    --fog-meridian: #7B8FA1;
    --eclipse-navy: #1A1B2E;
    --terracotta-signal: #C17F59;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0F1020;
}

/* ---- Typography ---- */

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.85;
    letter-spacing: 0.015em;
    color: #2B2D42;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Horizontal Scroll Container ---- */

#scroll-container {
    display: flex;
    flex-direction: row;
    width: max-content;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

/* Hide scrollbar but keep functionality */
#scroll-container::-webkit-scrollbar {
    display: none;
}
#scroll-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ---- Chamber Base ---- */

.chamber {
    position: relative;
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
}

/* Dark chambers */
.chamber-dark {
    background: #0F1020;
    color: #E8E4DC;
    box-shadow: inset 0 0 120px rgba(26, 27, 46, 0.8); /* #1A1B2E Eclipse Navy shadow */
}

/* Light chambers */
.chamber-light {
    background: #F4F1EB;
    color: #2B2D42;
}

/* ---- Depth Layers ---- */

.chamber-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    will-change: transform;
}

.chamber-bg .contour-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.chamber-dark .chamber-bg .contour-lines {
    opacity: 0.08;
}

.chamber-light .chamber-bg .contour-lines {
    opacity: 0.1;
}

.chamber-mid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8%;
    will-change: transform;
}

.chamber-fg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    will-change: transform;
}

/* ---- Magazine Spread Layout (38% / 62%) ---- */

.chamber-text {
    position: absolute;
    top: 15vh;
    left: 6%;
    width: 32%;
    z-index: 4;
}

.illustration {
    width: 55%;
    max-width: 500px;
    height: auto;
}

/* ---- SVG Illustration Hover ---- */

.illustration {
    transition: none;
}

.illustration line,
.illustration circle,
.illustration ellipse,
.illustration path,
.illustration rect,
.illustration polygon {
    transition: stroke 600ms ease;
}

.illustration:hover line,
.illustration:hover circle,
.illustration:hover ellipse,
.illustration:hover path,
.illustration:hover rect,
.illustration:hover polygon {
    stroke: #D4AF37;
}

/* Terracotta accent for emphasis words */
.accent-warm {
    color: #C17F59;
}

/* Terracotta hover on nav arrows */
.nav-arrow:hover {
    color: #C17F59;
    opacity: 0.7;
}

/* ---- Divider Line ---- */

.divider-line {
    position: absolute;
    top: 0;
    left: 38%;
    width: 4px;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.divider-line svg {
    width: 100%;
    height: 100%;
}

/* ---- Titles ---- */

.site-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 56px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #D4AF37;
    text-shadow: 0 0 24px rgba(212, 175, 55, 0.15);
    opacity: 0;
    transform: translateY(40px);
}

.site-title.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.site-subtitle {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: 16px;
    color: #E8E4DC;
    margin-top: 32px;
    opacity: 0;
}

.site-subtitle.revealed {
    opacity: 1;
    transition: opacity 800ms ease-out;
}

.chamber-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 56px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #D4AF37;
    text-shadow: 0 0 24px rgba(212, 175, 55, 0.15);
    margin-bottom: 32px;
}

/* ---- Field Notes ---- */

.field-note {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.85;
    letter-spacing: 0.015em;
    max-width: 400px;
}

.chamber-dark .field-note {
    color: #E8E4DC;
}

.chamber-light .field-note {
    color: #2B2D42;
}

/* ---- Coordinate Annotations ---- */

.coordinate {
    font-family: 'DM Mono', monospace;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7B8FA1;
    opacity: 0.6;
    position: absolute;
    bottom: 20vh;
    right: 12%;
    z-index: 4;
    transition: opacity 600ms ease;
}

.illustration:hover ~ .chamber-fg .coordinate,
.chamber-mid:hover + .chamber-fg .coordinate {
    opacity: 1;
}

/* ---- Navigation Arrows ---- */

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    font-size: 24px;
    color: #D4AF37;
    opacity: 0.3;
    cursor: pointer;
    animation: arrowPulse 3s ease-in-out infinite;
    user-select: none;
}

.nav-arrow-left {
    left: 24px;
}

.nav-arrow-right {
    right: 24px;
}

@keyframes arrowPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.4; }
}

/* ---- Scroll Hint (Chamber 1) ---- */

.scroll-hint {
    position: absolute;
    top: 50%;
    right: 32px;
    transform: translateY(-50%);
    z-index: 10;
    font-size: 28px;
    color: #D4AF37;
    opacity: 0.4;
    animation: scrollHintSlide 2s ease-in-out infinite;
    user-select: none;
    pointer-events: none;
}

.scroll-hint.hidden {
    display: none;
}

@keyframes scrollHintSlide {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(12px); }
}

/* ---- Progress Bar ---- */

#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: #D4AF37;
    z-index: 100;
    transition: width 100ms linear;
}

/* ---- Entry Animation: Contour Lines Fade In ---- */

#chamber-1 .chamber-bg .contour-lines {
    opacity: 0;
    transition: opacity 1200ms ease;
}

#chamber-1.bg-visible .chamber-bg .contour-lines {
    opacity: 0.08;
}

/* ---- SVG Path Draw Animation ---- */

#svg-threshold {
    opacity: 0;
}

#svg-threshold.draw {
    opacity: 1;
}

#svg-threshold.draw line {
    animation: pathDraw 2000ms ease forwards;
}

@keyframes pathDraw {
    from {
        stroke-dashoffset: 500;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* ---- Responsive: Vertical on narrow viewports ---- */

@media (max-width: 768px) {
    html, body {
        overflow: auto;
        overflow-x: hidden;
    }

    #scroll-container {
        flex-direction: column;
        width: 100%;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
    }

    .chamber {
        flex: 0 0 auto;
        width: 100vw;
        height: 100vh;
        scroll-snap-align: start;
    }

    .chamber-text {
        position: relative;
        top: auto;
        left: auto;
        width: 85%;
        margin: 0 auto;
        padding-top: 12vh;
        text-align: center;
    }

    .chamber-mid {
        position: relative;
        justify-content: center;
        padding-right: 0;
        padding-top: 4vh;
        height: auto;
    }

    .illustration {
        width: 70%;
        max-width: 320px;
    }

    .chamber-fg {
        position: relative;
        flex-direction: column;
        align-items: center;
    }

    .divider-line {
        display: none;
    }

    .site-title,
    .chamber-title {
        font-size: 36px;
    }

    .field-note {
        font-size: 16px;
    }

    .coordinate {
        position: relative;
        bottom: auto;
        right: auto;
        display: block;
        text-align: center;
        margin-top: 16px;
    }

    .nav-arrow {
        display: none;
    }

    .scroll-hint {
        display: none;
    }

    #progress-bar {
        display: none;
    }
}
