/* ============================================================
   historical.quest — Grainy-Textured Art Deco Reverie
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #1a0a12;
    color: #e8d5be;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    line-height: 2.0;
    letter-spacing: 0.02em;
    font-feature-settings: 'liga' 1, 'kern' 1;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- SVG Filters (hidden) ---- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ---- Living Grain Overlay ---- */
.grain-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: 1000;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: 0.3;
    filter: url(#grain-filter);
    will-change: transform;
}

/* ---- Bokeh Particle Container ---- */
.bokeh-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.bokeh-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 168, 130, 0.12) 0%, transparent 70%);
    will-change: transform;
}

/* ---- Progress Indicator ---- */
.progress-indicator {
    position: fixed;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 0%;
    background-color: #c4a882;
    transition: height 0.3s ease-out;
}

.progress-waypoint {
    position: absolute;
    width: 12px;
    height: 12px;
    transform: translateX(-5px);
    z-index: 501;
    transition: transform 0.3s ease;
}

.progress-waypoint:nth-child(2) { top: 10%; }
.progress-waypoint:nth-child(3) { top: 30%; }
.progress-waypoint:nth-child(4) { top: 50%; }
.progress-waypoint:nth-child(5) { top: 70%; }
.progress-waypoint:nth-child(6) { top: 90%; }

.progress-waypoint.active svg polygon {
    fill: #c4a882;
    stroke: none;
}

/* ---- Reveal Animation ---- */
.reveal-element {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    transition: opacity 1200ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 1200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ---- Stratum Base ---- */
.stratum {
    position: relative;
    z-index: 2;
}

/* ============================================================
   STRATUM 1: The Summit
   ============================================================ */
.stratum-summit {
    min-height: 150vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: #1a0a12;
    overflow: hidden;
}

.summit-content {
    position: relative;
    z-index: 10;
    margin-top: -10vh;
    padding-left: 10%;
}

.site-title {
    font-family: 'Poiret One', 'Arial', sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #f5e1c8;
    text-shadow: 0 0 20px rgba(196, 168, 130, 0.3);
    line-height: 1.1;
}

.title-dot {
    color: #c4a882;
}

/* Mountain Silhouette */
.mountain-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    z-index: 5;
}

.mountain-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mountain-path {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    stroke: none;
}

.mountain-path.animated {
    animation: drawMountain 4s ease-out forwards;
}

@keyframes drawMountain {
    to {
        stroke-dashoffset: 0;
    }
}

/* Mountain fill animation */
.mountain-near,
.mountain-distant {
    opacity: 0;
    transition: opacity 3s ease-out;
}

.mountain-near.visible,
.mountain-distant.visible {
    opacity: 1;
}

/* Sunburst Divider */
.sunburst-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
    position: relative;
    z-index: 10;
}

.sunburst-svg .sunburst-ray {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    transition: stroke-dashoffset 1.5s ease-out;
}

.revealed .sunburst-ray {
    stroke-dashoffset: 0;
}

/* ============================================================
   STRATUM 2: The Ridgeline
   ============================================================ */
.stratum-ridgeline {
    min-height: 140vh;
    display: flex;
    position: relative;
    background-color: #1a0a12;
}

.ridgeline-content {
    width: 60%;
    padding: 10vh 5% 10vh 12%;
    position: relative;
}

.ridgeline-text {
    position: relative;
}

.stratum-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b6f5c;
    display: block;
    margin-bottom: 2rem;
}

.ridgeline-prose {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    color: #e8d5be;
    margin-bottom: 2rem;
    max-width: 55ch;
}

.ridgeline-line {
    position: absolute;
    right: 0;
    top: 100%;
    width: 1px;
    height: 60vh;
    background-color: #c4a882;
    opacity: 0;
    transition: opacity 2s ease-out 0.5s;
}

.ridgeline-text.revealed ~ .ridgeline-line {
    opacity: 1;
}

.ridgeline-grain-zone {
    width: 40%;
    position: relative;
}


/* Stratum transitions using Mountain Dusk */
.stratum-ridgeline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30vh;
    background-color: #2e1f2d;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}
/* ============================================================
   Section Dividers
   ============================================================ */
.section-divider {
    position: relative;
    z-index: 2;
    background-color: #1a0a12;
    padding: 2rem 0;
}

/* ============================================================
   STRATUM 3: The Cirque
   ============================================================ */
.stratum-cirque {
    min-height: 160vh;
    background-color: #1a0a12;
    position: relative;
    padding: 8vh 0;
}

.cirque-content {
    display: flex;
    gap: 0;
    padding: 0 4%;
    position: relative;
}

.cirque-left {
    width: 35%;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding-left: 8%;
}

.cirque-gap {
    width: 10%;
    position: relative;
    overflow: hidden;
}

.chevron-pattern {
    opacity: 1;
}

.cirque-right {
    width: 55%;
    padding-right: 8%;
    padding-top: 4rem;
}

.cirque-prose {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    color: #e8d5be;
    line-height: 2.0;
    margin-bottom: 2rem;
}

/* Deco Cards with Ziggurat Borders */
.deco-card {
    position: relative;
    padding: 0;
    background-color: #3a1428;
}

.deco-card-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ziggurat-border {
    width: 100%;
    height: 100%;
}

.deco-card-inner {
    position: relative;
    padding: 1.8rem 1.5rem;
    z-index: 2;
}

.card-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b6f5c;
    display: block;
    margin-bottom: 0.5rem;
}

.card-title {
    font-family: 'Poiret One', 'Arial', sans-serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f5e1c8;
    text-shadow: 0 0 15px rgba(196, 168, 130, 0.2);
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.card-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    color: #e8d5be;
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ============================================================
   STRATUM 4: The Moraine
   ============================================================ */
.stratum-moraine {
    min-height: 150vh;
    background-color: #1a0a12;
    position: relative;
    display: flex;
    justify-content: flex-end;
    padding: 10vh 0;
}

.stratum-moraine::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #2e1f2d;
    opacity: 0.4;
    z-index: 0;
}

.moraine-content {
    width: 45%;
    margin-right: 10%;
    position: relative;
    z-index: 2;
    padding: 4rem 0;
}

.moraine-prose {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    color: #e8d5be;
    line-height: 2.0;
    margin-bottom: 2rem;
}

.moraine-prose.quote {
    border-left: 2px solid #c4a882;
    padding-left: 1.5rem;
    color: #d4a0a0;
    font-style: italic;
}

.moraine-prose.quote em {
    font-weight: 600;
}

/* ============================================================
   STRATUM 5: The Valley Floor
   ============================================================ */
.stratum-valley {
    min-height: 180vh;
    background-color: #1a0a12;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.valley-content {
    text-align: center;
    max-width: 50ch;
}

.valley-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 0.8rem;
    color: #8b6f5c;
    letter-spacing: 0.04em;
    line-height: 2.0;
}

/* ============================================================
   Bokeh Particle Animations
   ============================================================ */
@keyframes bokehDrift1 {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

@keyframes bokehDrift2 {
    0%, 100% { transform: translateY(0) scale(0.95); }
    50% { transform: translateY(-15px) scale(1.0); }
}

@keyframes bokehDrift3 {
    0%, 100% { transform: translateY(5px) scale(1.02); }
    50% { transform: translateY(-25px) scale(0.97); }
}

@keyframes bokehDrift4 {
    0%, 100% { transform: translateY(-5px) scale(0.98); }
    50% { transform: translateY(-18px) scale(1.03); }
}

@keyframes bokehDrift5 {
    0%, 100% { transform: translateY(0) scale(1.0); }
    50% { transform: translateY(-22px) scale(0.96); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .ridgeline-content {
        width: 85%;
        padding: 6vh 5% 6vh 8%;
    }

    .ridgeline-grain-zone {
        width: 15%;
    }

    .cirque-content {
        flex-direction: column;
        padding: 0 6%;
    }

    .cirque-left {
        width: 100%;
        padding-left: 0;
    }

    .cirque-gap {
        display: none;
    }

    .cirque-right {
        width: 100%;
        padding-right: 0;
        padding-top: 2rem;
    }

    .moraine-content {
        width: 80%;
        margin-right: 5%;
        margin-left: 5%;
    }

    .summit-content {
        padding-left: 5%;
    }

    .site-title {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .progress-indicator {
        display: none;
    }
}
