/* ============================================
   genpatsu.quest — Exclusion Zone Pilgrimage
   ============================================ */

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

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

body {
    background-color: #0E110E;
    color: #D4CFC4;
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Geiger Grain Overlay --- */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: overlay;
}

#grain-overlay canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    transition: opacity 0.5s ease;
}

#grain-canvas-b {
    opacity: 0;
}

/* --- Dosimeter Bar --- */
#dosimeter {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 40vh;
    background: rgba(58, 74, 56, 0.15);
    z-index: 900;
    border-radius: 2px;
}

#dosimeter-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    border-radius: 2px;
    transition: height 0.6s ease, background-color 0.6s ease, box-shadow 0.6s ease;
    background: #4A6741;
}

#dosimeter-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Stint Ultra Expanded', sans-serif;
    font-size: clamp(0.55rem, 0.8vw, 0.7rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #4A6741;
    white-space: nowrap;
    transition: color 0.6s ease;
}

/* --- Zone Progress Indicator --- */
#zone-progress {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    height: 40vh;
    width: 8px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.progress-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background: rgba(58, 74, 56, 0.2);
}

.progress-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(58, 74, 56, 0.3);
    z-index: 1;
    transition: background 0.6s ease, transform 0.3s ease;
}

.progress-dot.active {
    background: #D4CFC4;
    transform: scale(1.4);
}

/* --- Zone Base Styles --- */
.zone {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.zone-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

/* --- Zone Header (Memorial Stone Typography) --- */
.zone-header {
    margin-bottom: 3rem;
}

.zone-number {
    display: block;
    font-family: 'Stint Ultra Expanded', sans-serif;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #4A6741;
    margin-bottom: 1rem;
}

.zone-title {
    font-family: 'Shippori Mincho', serif;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #D4CFC4;
    line-height: 1.2;
    text-shadow: 1px 1px 0 #0E110E;
}

.title-line {
    width: 30%;
    height: 0.5px;
    background: #D4CFC4;
    margin-top: 1.5rem;
    opacity: 0.4;
}

/* --- Zone Text --- */
.zone-text {
    font-family: 'Karla', sans-serif;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    font-weight: 300;
    line-height: 1.75;
    color: #9A9488;
    margin-bottom: 2rem;
}

.zone-text:last-child {
    margin-bottom: 0;
}

/* --- Reveal Animation ---
   IntersectionObserver at 30% threshold. Body text blocks use the same animation */
.reveal-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

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

.zone-text.reveal-element {
    transition-duration: 800ms;
    transition-delay: 200ms;
}

/* ============================================
   ZONE 0 — Outer Checkpoint
   ============================================ */
#zone-0 {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0E110E;
}

.zone-0-content {
    text-align: center;
    width: 100%;
}

.barrier-gate {
    width: 60vw;
    height: 1px;
    background: #3A4A38;
    margin: 0 auto;
    opacity: 0;
    transition: opacity 1s ease;
}

.barrier-gate.visible {
    opacity: 1;
}

.zone-0-title {
    font-family: 'Stint Ultra Expanded', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    color: #9A9488;
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.zone-0-title.visible {
    opacity: 1;
}

/* ============================================
   ZONE 1 — 30km Ring
   ============================================ */
#zone-1 {
    min-height: 200vh;
    padding: 20vh 0 15vh;
    background: linear-gradient(to bottom, #0E110E 0%, #0E110E 40%, #111611 100%);
}

.zone-1-layout {
    margin-left: 15%;
    margin-right: auto;
    max-width: 680px;
}

.zone-1-layout .zone-text {
    margin-bottom: 6rem;
}

/* Containment Silhouette */
.containment-silhouette {
    position: absolute;
    top: 10vh;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 160px;
    opacity: 0.3;
    z-index: 5;
    transition: opacity 2s ease;
}

.containment-silhouette.faded {
    opacity: 0;
}

/* Zone 1 Vegetation */
.veg-zone-1 {
    position: absolute;
    left: 0;
    top: 20%;
    width: 60px;
    height: 400px;
    z-index: 5;
}

/* ============================================
   ZONE 2 — 20km Ring
   ============================================ */
#zone-2 {
    min-height: 250vh;
    padding: 15vh 0;
    background: linear-gradient(to bottom, #111611 0%, #131813 30%, #141A14 100%);
}

.zone-2-layout {
    margin-left: auto;
    margin-right: 15%;
    max-width: 680px;
}

.zone-2-layout .zone-text {
    margin-bottom: 4rem;
}

#zone-2 .zone-number {
    color: #C4A048;
}

/* Zone 2 Vegetation */
.veg-zone-2-a {
    position: absolute;
    left: 0;
    top: 10%;
    width: 150px;
    height: 80%;
    z-index: 5;
}

.veg-zone-2-b {
    position: absolute;
    right: 0;
    top: 15%;
    width: 100px;
    height: 70%;
    z-index: 5;
}

/* ============================================
   ZONE 3 — 10km Ring
   ============================================ */
#zone-3 {
    min-height: 300vh;
    padding: 15vh 0;
    background: linear-gradient(to bottom, #141A14 0%, #161C16 40%, #181E18 100%);
}

.zone-3-fog {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Containment Mist #1A231A at 50% opacity */
    background: radial-gradient(ellipse at center, #1A231A80 0%, transparent 70%);
    pointer-events: none;
    z-index: 2;
}

.zone-3-layout {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.zone-3-layout .zone-text {
    text-align: left;
    margin-bottom: 3rem;
}

#zone-3 .zone-number {
    color: #C4A048;
}

/* Concentric Ring Map */
.concentric-map {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vw;
    max-width: 600px;
    max-height: 600px;
    z-index: 1;
    opacity: 0.5;
}

.core-pulse {
    animation: corePulse 3s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { opacity: 0.4; r: 4; }
    50% { opacity: 0.8; r: 6; }
}

/* Zone 3 Vegetation */
.veg-zone-3-left {
    position: absolute;
    left: 0;
    top: 5%;
    width: 25%;
    height: 90%;
    z-index: 5;
}

.veg-zone-3-right {
    position: absolute;
    right: 0;
    top: 5%;
    width: 25%;
    height: 90%;
    z-index: 5;
}

/* ============================================
   ZONE 4 — Reactor Core
   ============================================ */
#zone-4 {
    min-height: 120vh;
    padding: 15vh 0 0;
    background: linear-gradient(to bottom, #181E18 0%, #141A14 50%, #0E110E 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.zone-4-layout {
    max-width: 320px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 10;
}

.zone-4-layout .zone-text {
    text-align: left;
    margin-bottom: 2rem;
}

#zone-4 .zone-number {
    color: #8B3A3A;
}

#zone-4 .zone-title {
    color: #D4CFC4;
}

.final-text {
    font-family: 'Shippori Mincho', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: #D4CFC4;
    font-style: italic;
    line-height: 1.8;
}

.zone-4-end-space {
    height: 40vh;
    flex-shrink: 0;
}

/* Core Glow */
.core-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vw;
    max-width: 800px;
    max-height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 58, 58, 0.05) 0%, transparent 60%);
    animation: coreBreath 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes coreBreath {
    0%, 100% { transform: translate(-50%, -50%) scale(0.95); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

/* Zone 4 Root Ring Vegetation */
.veg-zone-4-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70vw;
    height: 70vw;
    max-width: 700px;
    max-height: 700px;
    z-index: 5;
}

/* ============================================
   Vegetation SVG Base Styles
   ============================================ */
.vegetation-svg {
    pointer-events: none;
}

.veg-path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .zone-1-layout {
        margin-left: 8%;
    }

    .zone-2-layout {
        margin-right: 8%;
    }

    .zone-3-layout {
        max-width: 85%;
    }

    .zone-4-layout {
        max-width: 85%;
    }

    #dosimeter {
        right: 12px;
    }

    #zone-progress {
        left: 12px;
    }

    .veg-zone-3-left,
    .veg-zone-3-right {
        width: 15%;
    }
}

@media (max-width: 480px) {
    .zone-1-layout {
        margin-left: 5%;
    }

    .zone-2-layout {
        margin-right: 5%;
    }

    .containment-silhouette {
        width: 140px;
        height: 112px;
    }

    #dosimeter {
        right: 8px;
        height: 30vh;
    }

    #zone-progress {
        left: 8px;
        height: 30vh;
    }
}
