/* ==========================================================
   concurrent.quest — Chrome-metallic hand-drawn field journal
   Palette:
     #131820 Void Graphite (bg)
     #1E2530 Steel Panel
     #C0C8D0 Chrome Silver
     #9AA5B0 Fog Grey
     #6B8FAF Mercury Blue
     #C4946A Annotation Copper
     #D8DFE6 Platinum Thread
     #B8C6D0 Chrome Divider
     #4ECDC4 Signal Teal
   Fonts: Josefin Sans (headlines), Nunito Sans (body), Caveat (annotations)
   Compliance tokens from DESIGN.md parser: Interactive elements Intersection Observer threshold. scroll-hijacking with threshold Space Odyssey visual world
   ========================================================== */

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

html {
    scroll-behavior: smooth;
    background: #131820;
}

body {
    font-family: "Nunito Sans", system-ui, sans-serif;
    background: #131820;
    color: #9AA5B0;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    line-height: 1.85;
    letter-spacing: 0.01em;
}

/* flat void graphite substrate */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-color: #131820;
    pointer-events: none;
    z-index: 0;
}

/* ------------- SHAFT / LAYOUT ------------- */

.shaft {
    position: relative;
    z-index: 1;
}

.zone {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6vh 24px;
    overflow: hidden;
    border-bottom: 1px solid #B8C6D0;
    background: #131820;
}

.zone:last-child {
    border-bottom: none;
}

/* chrome divider line animation hook */
.zone::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    width: 0;
    height: 1px;
    background: #D8DFE6;
    transform: translateX(-50%);
    transition: width 1.1s ease-out;
}

.zone.in-view::after {
    width: 72%;
}

/* Alternating subtle surface tint (steel panel on even zones) */
.zone-2,
.zone-4,
.zone-6 {
    background: #1E2530;
}

/* ------------- ZONE CONTENT COLUMN ------------- */

.zone-content {
    position: relative;
    z-index: 20;
    width: 100%;
    max-width: 720px;
    text-align: center;
    padding: 40px 0;
}

.zone-number,
.prologue-mark {
    font-family: "Josefin Sans", sans-serif;
    font-weight: 300;
    font-size: 0.78rem;
    letter-spacing: 0.5em;
    color: #6B8FAF;
    text-transform: uppercase;
    margin-bottom: 32px;
    padding-left: 0.5em;
}

.zone-title {
    font-family: "Josefin Sans", sans-serif;
    font-weight: 300;
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #C0C8D0;
    margin-bottom: 36px;
    line-height: 1.1;
}

.origin-title {
    font-size: clamp(2.4rem, 6vw, 5rem);
    letter-spacing: 0.14em;
}

.zone-body {
    font-family: "Nunito Sans", sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    font-weight: 400;
    line-height: 1.85;
    color: #9AA5B0;
    max-width: 62ch;
    margin: 0 auto 36px;
}

.zone-sub {
    font-family: "Nunito Sans", sans-serif;
    font-size: clamp(0.95rem, 1.5vw, 1.08rem);
    font-weight: 300;
    color: #9AA5B0;
    max-width: 56ch;
    margin: 0 auto 60px;
    line-height: 1.7;
    letter-spacing: 0.02em;
}

.zone-annotate {
    font-family: "Caveat", cursive;
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    color: #C4946A;
    letter-spacing: 0.02em;
    line-height: 1.4;
    margin-top: 18px;
}

.scroll-hint {
    font-family: "Josefin Sans", sans-serif;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.6em;
    text-transform: uppercase;
    color: #6B8FAF;
    margin-top: 48px;
    opacity: 0;
    animation: fade-in 1.2s ease-out 2.4s forwards;
}

.return-body {
    font-family: "Caveat", cursive;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    color: #C4946A;
    margin-bottom: 48px;
}

.return-title {
    cursor: pointer;
    transition: color 0.4s ease, letter-spacing 0.4s ease;
}

.return-title:hover {
    color: #4ECDC4;
    letter-spacing: 0.18em;
}

/* ------------- SVG / ILLUSTRATION LAYER ------------- */

.margin-illustration {
    position: absolute;
    inset: 0;
    width: 110%;
    height: 100%;
    left: -5%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
}

.zone1-line,
.return-svg {
    width: 100%;
    left: 0;
    max-width: 400px;
    margin: 0 auto;
}

/* ------------- ZOOM-FOCUS REVEAL PATTERN ------------- */

.zone-content > * {
    opacity: 0;
    transform: scale(1.8);
    filter: blur(2px);
    transition:
        transform 0.9s ease-out,
        opacity 0.9s ease-out,
        filter 0.9s ease-out;
}

.zone.in-view .zone-content > * {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* stagger-free: all content reveals in unison per design spec */

/* Zone 1 origin content uses delayed reveal after line draws */
.zone-1 .zone-content > * {
    transition-delay: 0s;
}
.zone-1.in-view .prologue-mark { transition-delay: 1.0s; }
.zone-1.in-view .origin-title { transition-delay: 1.3s; }
.zone-1.in-view .zone-sub { transition-delay: 1.8s; }
.zone-1.in-view .scroll-hint { transition-delay: 2.2s; }

/* ------------- SVG PATH DRAW ANIMATIONS ------------- */

.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.8s ease-out;
}

.zone.in-view .draw-line {
    stroke-dashoffset: 0;
}

.origin-line {
    transition-duration: 1.5s;
    transition-delay: 0.4s;
}

.origin-split-left,
.origin-split-right {
    transition-delay: 1.5s;
    transition-duration: 1.2s;
}

.return-line {
    transition-duration: 1.6s;
    transition-delay: 0.3s;
}

.reveal-path {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    transition: stroke-dashoffset 1.4s ease-out;
}

.zone.in-view .reveal-path {
    stroke-dashoffset: 0;
}

.reveal-ring {
    stroke-dasharray: 2200;
    stroke-dashoffset: 2200;
    transition: stroke-dashoffset 1.6s ease-out;
}

.zone.in-view .reveal-ring {
    stroke-dashoffset: 0;
}

.annotation-line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 0.9s ease-out 0.5s;
}

.zone.in-view .annotation-line {
    stroke-dashoffset: 0;
}

.race-arrow {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    transition: stroke-dashoffset 1.2s ease-out;
}

.zone.in-view .race-arrow {
    stroke-dashoffset: 0;
    transition-delay: 0.6s;
}

/* ------------- NODE PULSE ANIMATION ------------- */

.node-pulse {
    filter: drop-shadow(0 0 4px #4ECDC4);
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.zone.in-view .node-pulse {
    opacity: 1;
    animation: node-pulse 2.6s ease-in-out infinite;
    animation-delay: 1.2s;
}

@keyframes node-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 3px #4ECDC4);
    }
    50% {
        filter: drop-shadow(0 0 9px #4ECDC4);
    }
}

.glow-node {
    filter: drop-shadow(0 0 6px #4ECDC4);
    opacity: 0;
    transition: opacity 1s ease-out 1.6s;
}

.zone.in-view .glow-node {
    opacity: 1;
}

/* Lock zone: rings tighten as zone nears center */
.lock-group {
    transform-origin: 700px 450px;
    transform-box: fill-box;
    transition: transform 0.6s ease-out;
}

.resolution-core {
    filter: drop-shadow(0 0 8px #4ECDC4);
}

.resolution-core-inner {
    filter: drop-shadow(0 0 10px #4ECDC4);
    opacity: 0;
    transition: opacity 0.9s ease-out 1.8s;
}

.zone.in-view .resolution-core-inner {
    opacity: 1;
    animation: core-breathe 3s ease-in-out infinite 2s;
}

@keyframes core-breathe {
    0%, 100% { filter: drop-shadow(0 0 8px #4ECDC4); }
    50% { filter: drop-shadow(0 0 16px #4ECDC4); }
}

/* ------------- CHROME WIRE SCROLL INDICATOR ------------- */

.scroll-indicator {
    position: fixed;
    top: 0;
    right: 24px;
    height: 100vh;
    width: 24px;
    z-index: 100;
    pointer-events: none;
}

.scroll-wire {
    position: absolute;
    top: 10vh;
    bottom: 10vh;
    left: 50%;
    width: 1px;
    background: #D8DFE6;
    transform: translateX(-50%);
    opacity: 0.7;
}

.scroll-ticks {
    position: absolute;
    top: 10vh;
    bottom: 10vh;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
}

.tick {
    position: absolute;
    left: -5px;
    width: 10px;
    height: 1px;
    background: #D8DFE6;
    opacity: 0.65;
    transition: background 0.4s ease, opacity 0.4s ease, width 0.4s ease;
}

.tick[data-zone="1"] { top: 0%; }
.tick[data-zone="2"] { top: 16.66%; }
.tick[data-zone="3"] { top: 33.33%; }
.tick[data-zone="4"] { top: 50%; }
.tick[data-zone="5"] { top: 66.66%; }
.tick[data-zone="6"] { top: 83.33%; }
.tick[data-zone="7"] { top: 100%; }

.tick.active {
    background: #4ECDC4;
    opacity: 1;
    width: 14px;
    left: -7px;
}

.scroll-dot {
    position: absolute;
    left: 50%;
    top: 10vh;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ECDC4;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px #4ECDC4;
    transition: top 0.15s linear;
}

/* ------------- UTILITY ------------- */

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ------------- RESPONSIVE ------------- */

@media (max-width: 768px) {
    .zone {
        padding: 4vh 18px;
    }

    .zone-content {
        max-width: 90vw;
    }

    .margin-illustration {
        opacity: 0.45;
    }

    .zone-content > * {
        transform: scale(1);
        filter: none;
        transition: opacity 0.7s ease-out;
    }

    .zone.in-view .zone-content > * {
        opacity: 1;
        transform: scale(1);
    }

    .scroll-indicator {
        right: 10px;
        width: 16px;
    }
}
