
:root {
    --reactor-night: #0a1a0f;
    --canopy-green: #1a3a24;
    --moss-glow: #2d5a3a;
    --rose-chrome: #c4956a;
    --champagne-mist: #f0e0c8;
    --pale-sage: #d4dcc6;
    --sage-shadow: #8fa882;
    --cerenkov-blue: #4ae0c4;
    --amber-soft: #b8a55a;
    --deep-forest: #1a2e14;
    --brown-warm: #8b6f4e;
}

/* genpatsu.quest - McBling Academic Nuclear Design */
/* Colors: #0a1a0f, #1a3a24, #2d5a3a, #c4956a, #f0e0c8, #d4dcc6, #8fa882, #4ae0c4, #b8a55a */
/* Fonts: Playfair Display, Source Serif 4, Nunito Sans, Noto Serif JP */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0a1a0f;
    color: #d4dcc6; /* alt: #1a2e14 on light */
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ===== BOKEH LAYERS ===== */
.bokeh-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.bokeh-layer-0 {
    z-index: 0;
    background:
        radial-gradient(circle 120px at 15% 25%, rgba(184, 165, 90, 0.08) 0%, transparent 100%),
        radial-gradient(circle 90px at 75% 15%, rgba(196, 149, 106, 0.06) 0%, transparent 100%),
        radial-gradient(circle 150px at 55% 65%, rgba(74, 224, 196, 0.05) 0%, transparent 100%),
        radial-gradient(circle 130px at 85% 80%, rgba(184, 165, 90, 0.06) 0%, transparent 100%),
        radial-gradient(circle 100px at 30% 85%, rgba(196, 149, 106, 0.04) 0%, transparent 100%);
}

.bokeh-layer-1 {
    z-index: 1;
    background:
        radial-gradient(circle 60px at 25% 70%, rgba(45, 90, 58, 0.12) 0%, transparent 100%),
        radial-gradient(circle 45px at 85% 45%, rgba(26, 58, 36, 0.15) 0%, transparent 100%),
        radial-gradient(circle 70px at 40% 35%, rgba(143, 168, 130, 0.07) 0%, transparent 100%),
        radial-gradient(circle 55px at 65% 75%, rgba(45, 90, 58, 0.10) 0%, transparent 100%),
        radial-gradient(circle 50px at 10% 40%, rgba(26, 58, 36, 0.12) 0%, transparent 100%);
    animation: bokeh-drift-1 20s ease-in-out infinite alternate;
}

.bokeh-layer-2 {
    z-index: 2;
    background:
        radial-gradient(circle 8px at 30% 55%, rgba(74, 224, 196, 0.2) 0%, transparent 100%),
        radial-gradient(circle 5px at 60% 80%, rgba(240, 224, 200, 0.15) 0%, transparent 100%),
        radial-gradient(circle 6px at 70% 30%, rgba(184, 165, 90, 0.18) 0%, transparent 100%),
        radial-gradient(circle 4px at 20% 15%, rgba(74, 224, 196, 0.15) 0%, transparent 100%),
        radial-gradient(circle 7px at 80% 60%, rgba(240, 224, 200, 0.12) 0%, transparent 100%),
        radial-gradient(circle 3px at 45% 45%, rgba(74, 224, 196, 0.22) 0%, transparent 100%);
}

@keyframes bokeh-drift-1 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, -20px); }
}

/* ===== PARTICLE CANVAS ===== */
#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* ===== SCROLL PROGRESS ===== */
.scroll-progress {
    position: fixed;
    right: 12px;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: rgba(196, 149, 106, 0.15);
    z-index: 100;
}

.scroll-progress-fill {
    width: 100%;
    height: 0%;
    background: #c4956a;
    transition: height 0.1s linear;
}

/* ===== CHROME TEXT ===== */
.chrome-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    background: linear-gradient(135deg, #c4956a 0%, #f0e0c8 40%, #c4956a 60%, #8b6f4e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: chrome-shimmer 8s ease-in-out infinite;
}

@keyframes chrome-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ===== FADE REVEAL ===== */
.fade-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.9s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

/* ===== KANJI WATERMARKS ===== */
.kanji-watermark {
    position: absolute;
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    font-size: 25vw;
    color: rgba(74, 224, 196, 0.04);
    pointer-events: none;
    z-index: 0;
    top: 10%;
    left: 5%;
    line-height: 1;
    user-select: none;
}

.kanji-watermark-offset {
    top: 5%;
    left: auto;
    right: 5%;
    font-size: 20vw;
    color: rgba(143, 168, 130, 0.05);
}

.kanji-watermark-center {
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30vw;
    color: rgba(45, 90, 58, 0.06);
}

.kanji-watermark-right {
    top: 10%;
    right: 10%;
    left: auto;
    font-size: 22vw;
    color: rgba(184, 165, 90, 0.04);
}

.kanji-watermark-large {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20vw;
    color: rgba(74, 224, 196, 0.08);
    animation: kanji-pulse 6s ease-in-out infinite;
}

@keyframes kanji-pulse {
    0%, 100% { opacity: 0.08; }
    50% { opacity: 0.12; }
}

/* ===== ZONES ===== */
.zone {
    position: relative;
    z-index: 4;
}

/* Zone I: Reactor Pool */
.zone-reactor {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 8%;
    background: linear-gradient(180deg, #0a1a0f 0%, #1a3a24 100%);
}

.reactor-content {
    position: relative;
    z-index: 5;
    padding-left: 27%;
    padding-top: 10vh;
}

.site-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
    line-height: 1.1;
}

.reactor-definition {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    max-width: 520px;
    color: #d4dcc6;
    line-height: 1.8;
}

.kanji-inline {
    font-family: 'Noto Serif JP', serif;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #4ae0c4;
}

.romaji {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 0.9em;
    color: #8fa882;
    letter-spacing: 0.04em;
}

/* Zone II: Timeline Drift */
.zone-timeline {
    min-height: 150vh;
    position: relative;
    display: flex;
    padding: 10vh 0;
    background: linear-gradient(180deg, #1a3a24 0%, #0a1a0f 50%, #1a3a24 100%);
    overflow: hidden;
}

.timeline-panel {
    position: relative;
    z-index: 5;
    width: 280px;
    min-width: 240px;
    margin-left: 5%;
    padding-top: 0;
    flex-shrink: 0;
}

.timeline-panel .zone-title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    margin-bottom: 2.5rem;
    letter-spacing: 0.02em;
}

.timeline-entries {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.timeline-entry {
    position: relative;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(184, 165, 90, 0.3);
}

.timeline-year {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c4956a;
    display: block;
    margin-bottom: 0.5rem;
}

.timeline-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(0.85rem, 0.95vw, 0.95rem);
    line-height: 1.65;
    color: #8fa882;
}

.essay-panel {
    position: relative;
    z-index: 5;
    width: 45vw;
    margin-left: 15vw;
    padding-top: 20vh;
    flex-shrink: 0;
}

.essay-panel .zone-title {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
}

.essay-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    color: #d4dcc6;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.connection-lines {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

.connection-line {
    stroke: #b8a55a;
    stroke-opacity: 0.3;
    stroke-width: 0.15;
    stroke-dasharray: 1 1;
}

/* Zone III: Data Canopy */
.zone-data {
    min-height: 120vh;
    position: relative;
    padding: 10vh 10% 10vh 10%;
    background: linear-gradient(180deg, #1a3a24 0%, #0a1a0f 100%);
}

.data-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 1rem;
    text-align: left;
    padding-left: 5%;
}

.data-subtitle {
    padding-left: 5%;
    margin-bottom: 4rem;
}

.caption-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8fa882;
}

.data-viz {
    display: flex;
    align-items: center;
    gap: 8vw;
    flex-wrap: wrap;
    justify-content: center;
}

.reactor-rings {
    position: relative;
    width: clamp(280px, 35vw, 450px);
    height: clamp(280px, 35vw, 450px);
    flex-shrink: 0;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border-style: solid;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ring-pulse 4s ease-in-out infinite;
}

.ring-total {
    inset: 0;
    border-width: 1.5px;
    border-color: rgba(45, 90, 58, 0.5);
}

.ring-operable {
    inset: 18%;
    border-width: 2px;
    border-color: rgba(143, 168, 130, 0.6);
}

.ring-active {
    inset: 35%;
    border-width: 2.5px;
    border-color: rgba(74, 224, 196, 0.7);
}

.ring-core {
    position: absolute;
    inset: 45%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 224, 196, 0.3) 0%, rgba(74, 224, 196, 0.05) 70%, transparent 100%);
    animation: core-glow 3s ease-in-out infinite alternate;
}

@keyframes ring-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes core-glow {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

.ring-label {
    position: absolute;
    white-space: nowrap;
}

.ring-total .ring-label {
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
}

.ring-operable .ring-label {
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
}

.ring-active .ring-label {
    top: 50%;
    right: -6rem;
    transform: translateY(-50%);
}

.data-legend {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot-total {
    background: rgba(45, 90, 58, 0.8);
    border: 1px solid #2d5a3a;
}

.legend-dot-operable {
    background: rgba(143, 168, 130, 0.8);
    border: 1px solid #8fa882;
}

.legend-dot-active {
    background: rgba(74, 224, 196, 0.8);
    border: 1px solid #4ae0c4;
}

.legend-dot-decommissioned {
    background: rgba(139, 111, 78, 0.8);
    border: 1px solid #8b6f4e;
}

.legend-text {
    text-transform: none;
    font-weight: 300;
}

/* Zone IV: Glossary Garden */
.zone-glossary {
    min-height: 130vh;
    position: relative;
    padding: 8vh 5%;
    background: linear-gradient(180deg, #0a1a0f 0%, #1a3a24 50%, #0a1a0f 100%);
}

.glossary-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 3rem;
    padding-left: 10%;
}

.glossary-grid {
    position: relative;
    width: 100%;
    height: 110vh;
}

.glossary-card {
    position: absolute;
    width: clamp(240px, 28vw, 340px);
    padding: 1.5rem 1.8rem;
    background: rgba(26, 58, 36, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(143, 168, 130, 0.15);
    border-radius: 4px;
}

.glossary-term {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    color: #f0e0c8;
    display: block;
    margin-bottom: 0.7rem;
    letter-spacing: 0.02em;
}

.glossary-def {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(0.85rem, 0.95vw, 0.95rem);
    line-height: 1.65;
    color: #8fa882;
}

/* Zone V: Afterglow */
.zone-afterglow {
    min-height: 80vh;
    position: relative;
    padding: 10vh 0;
    background: linear-gradient(180deg, #0a1a0f 0%, #050d08 100%);
    overflow: hidden;
}

.afterglow-content {
    position: relative;
    z-index: 5;
    margin-left: 55%;
    max-width: 500px;
    padding-right: 5%;
}

.afterglow-content .zone-title {
    font-size: clamp(2rem, 3.5vw, 3rem);
    margin-bottom: 2rem;
}

.afterglow-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    color: #d4dcc6;
    margin-bottom: 1.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .reactor-content {
        padding-left: 10%;
        padding-top: 5vh;
    }

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

    .zone-timeline {
        flex-direction: column;
        padding: 5vh 5%;
    }

    .timeline-panel {
        width: 85%;
        margin-left: 10%;
        margin-bottom: 5vh;
    }

    .essay-panel {
        width: 85%;
        margin-left: 10%;
        padding-top: 0;
    }

    .connection-lines {
        display: none;
    }

    .data-viz {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 5%;
    }

    .reactor-rings {
        width: 250px;
        height: 250px;
        margin: 0 auto 3rem;
    }

    .glossary-grid {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .glossary-card {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 90%;
        margin-left: 5%;
    }

    .afterglow-content {
        margin-left: 10%;
        max-width: 80%;
    }

    .kanji-watermark {
        font-size: 40vw;
    }

    .kanji-watermark-large {
        font-size: 35vw;
    }
}