/* genpatsu.quest - Surreal Nuclear Quest */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0A0A14;
    color: #B0BEC5;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.8;
    overflow-x: hidden;
}

/* ===== Progress Bar ===== */
#progress-bar {
    position: fixed;
    top: 0;
    right: 0;
    width: 4px;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #39FF14;
    opacity: 0.4;
    transition: height 0.3s ease;
}

.quest-token {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #39FF14;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: #39FF14;
    background: rgba(10, 10, 20, 0.9);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    right: 10px;
}

.quest-token.active {
    opacity: 1;
    transform: translateX(-10px);
}

.quest-token[data-zone-token="1"] { top: 10%; }
.quest-token[data-zone-token="2"] { top: 30%; }
.quest-token[data-zone-token="3"] { top: 50%; }
.quest-token[data-zone-token="4"] { top: 70%; }
.quest-token[data-zone-token="5"] { top: 90%; }

/* ===== Zone Base ===== */
.zone {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.zone-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: opacity 0.8s ease;
}

.zone-mid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.zone-content {
    position: relative;
    z-index: 3;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 60px 20px;
}

/* ===== Content Panel ===== */
.content-panel {
    max-width: 720px;
    width: 100%;
    background: rgba(10, 10, 20, 0.85);
    border-radius: 12px;
    padding: 48px;
    border: 1px solid rgba(57, 255, 20, 0.15);
}

.core-panel {
    border-color: rgba(57, 255, 20, 0.3);
}

.heart-panel {
    text-align: center;
}

/* ===== Zone 1: The Gate ===== */
.zone-1 .zone-bg {
    background: #1A1410;
    background-image: radial-gradient(ellipse at center, rgba(255, 179, 0, 0.08) 0%, transparent 70%);
}

.zone-1 .trefoil-glyph {
    position: absolute;
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: trefoil-rotate 60s linear infinite;
}

@keyframes trefoil-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero-title {
    font-family: 'Noto Serif JP', serif;
    font-weight: 900;
    font-size: clamp(40px, 7vw, 80px);
    color: #E8F5E9;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
    text-align: center;
}

.hero-subtitle {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
    font-size: 20px;
    color: #B0BEC5;
    text-align: center;
    margin-bottom: 32px;
    letter-spacing: 0em;
}

.quest-status {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #39FF14;
    letter-spacing: 0.06em;
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
    text-align: center;
    margin-bottom: 24px;
}

.status-label {
    opacity: 0.7;
}

.status-value {
    margin-left: 8px;
}

.zone-intro {
    text-align: center;
    color: #78909C;
    font-size: 15px;
}

/* ===== Zone 2: The Approach ===== */
.zone-2 .zone-bg {
    background: #0D1B2A;
    background-image: radial-gradient(ellipse at 30% 50%, rgba(13, 27, 42, 0.8) 0%, transparent 60%);
}

.cooling-tower {
    position: absolute;
    height: 300px;
    opacity: 0.1;
}

.tower-left {
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
}

.tower-right {
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
}

.zone-title {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
    font-size: 32px;
    color: #E8F5E9;
    letter-spacing: 0.04em;
    margin-bottom: 28px;
}

.body-text {
    color: #B0BEC5;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.body-text mark {
    background: rgba(255, 179, 0, 0.15);
    color: #FFB300;
    border-bottom: 1px solid #FFB300;
    padding: 0 4px;
    border-radius: 2px;
}

.quest-badge {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.badge-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #39FF14;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #39FF14;
}

/* ===== Zone 3: The Core ===== */
.zone-3 .zone-bg {
    background: #0A1A0A;
    background-image: radial-gradient(ellipse at center, rgba(57, 255, 20, 0.06) 0%, transparent 60%);
}

/* Particle Field */
.particle-field {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #39FF14;
    animation: particle-drift linear infinite;
}

.particle:nth-child(1)  { left: 5%;  opacity: 0.3; animation-duration: 18s; animation-delay: 0s; }
.particle:nth-child(2)  { left: 12%; opacity: 0.15; animation-duration: 22s; animation-delay: -3s; }
.particle:nth-child(3)  { left: 20%; opacity: 0.4;  animation-duration: 15s; animation-delay: -7s; }
.particle:nth-child(4)  { left: 28%; opacity: 0.2;  animation-duration: 25s; animation-delay: -2s; }
.particle:nth-child(5)  { left: 35%; opacity: 0.35; animation-duration: 20s; animation-delay: -10s; }
.particle:nth-child(6)  { left: 42%; opacity: 0.1;  animation-duration: 28s; animation-delay: -5s; }
.particle:nth-child(7)  { left: 50%; opacity: 0.3;  animation-duration: 17s; animation-delay: -8s; }
.particle:nth-child(8)  { left: 58%; opacity: 0.25; animation-duration: 23s; animation-delay: -1s; }
.particle:nth-child(9)  { left: 65%; opacity: 0.4;  animation-duration: 16s; animation-delay: -12s; }
.particle:nth-child(10) { left: 72%; opacity: 0.15; animation-duration: 26s; animation-delay: -4s; }
.particle:nth-child(11) { left: 78%; opacity: 0.3;  animation-duration: 19s; animation-delay: -9s; }
.particle:nth-child(12) { left: 85%; opacity: 0.2;  animation-duration: 24s; animation-delay: -6s; }
.particle:nth-child(13) { left: 92%; opacity: 0.35; animation-duration: 21s; animation-delay: -11s; }
.particle:nth-child(14) { left: 8%;  opacity: 0.1;  animation-duration: 30s; animation-delay: -14s; }
.particle:nth-child(15) { left: 15%; opacity: 0.25; animation-duration: 18s; animation-delay: -3s; }
.particle:nth-child(16) { left: 38%; opacity: 0.3;  animation-duration: 22s; animation-delay: -7s; }
.particle:nth-child(17) { left: 55%; opacity: 0.2;  animation-duration: 27s; animation-delay: -13s; }
.particle:nth-child(18) { left: 68%; opacity: 0.4;  animation-duration: 16s; animation-delay: -2s; }
.particle:nth-child(19) { left: 82%; opacity: 0.15; animation-duration: 25s; animation-delay: -8s; }
.particle:nth-child(20) { left: 95%; opacity: 0.3;  animation-duration: 20s; animation-delay: -5s; }

@keyframes particle-drift {
    0% { transform: translateY(100vh); }
    100% { transform: translateY(-10vh); }
}

/* Tech Readout */
.tech-readout {
    background: rgba(10, 26, 10, 0.6);
    border: 1px solid rgba(57, 255, 20, 0.2);
    border-radius: 8px;
    padding: 24px;
    margin: 28px 0;
}

.readout-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.06em;
}

.readout-label {
    color: #78909C;
    min-width: 140px;
}

.readout-value {
    color: #39FF14;
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
    min-width: 60px;
    text-align: right;
}

.readout-unit {
    color: #78909C;
    font-size: 12px;
}

/* ===== Zone 4: The Heart ===== */
.zone-4 .zone-bg {
    background: #1A0A1A;
    background-image: radial-gradient(ellipse at center, rgba(26, 10, 26, 0.9) 0%, rgba(10, 10, 20, 0.95) 70%);
}

.zone-4 .trefoil-heart {
    position: absolute;
    width: 500px;
    height: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: trefoil-rotate 60s linear infinite;
}

.heart-text {
    font-size: 18px;
    line-height: 2.0;
    text-align: center;
}

.pull-quote {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
    font-style: italic;
    font-size: 28px;
    color: #E8F5E9;
    line-height: 1.6;
    margin: 32px 0;
    padding: 24px 0;
    border-top: 1px solid rgba(57, 255, 20, 0.15);
    border-bottom: 1px solid rgba(57, 255, 20, 0.15);
}

.quote-translation {
    display: block;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    color: #78909C;
    margin-top: 12px;
}

/* ===== Zone 5: The Return ===== */
.zone-5 .zone-bg {
    background: #0A0A14;
    background-image: radial-gradient(ellipse at center, rgba(57, 255, 20, 0.03) 0%, transparent 60%);
}

.quest-tokens-final {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 32px 0;
}

.token-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #39FF14;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #39FF14;
    transition: background 0.5s ease;
}

.token-circle.completed {
    background: rgba(57, 255, 20, 0.15);
}

.domain-echo {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
    font-size: 24px;
    color: #E8F5E9;
    text-align: center;
    margin-bottom: 24px;
    opacity: 0.6;
}

.typewriter-container {
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #39FF14;
    letter-spacing: 0.06em;
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
    min-height: 24px;
}

.typewriter-text {
    /* filled by JS */
}

.typewriter-cursor {
    animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== Animations ===== */
.fade-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1000ms ease, transform 1000ms ease;
}

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

.slide-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 600ms ease, transform 600ms ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .content-panel {
        padding: 32px 24px;
        margin: 0 12px;
    }

    .hero-title {
        font-size: clamp(32px, 8vw, 56px);
    }

    .pull-quote {
        font-size: 22px;
    }

    .zone-title {
        font-size: 26px;
    }

    .trefoil-glyph {
        width: 250px;
        height: 250px;
    }

    .cooling-tower {
        height: 200px;
    }

    .readout-row {
        flex-wrap: wrap;
    }

    .readout-label {
        min-width: 100px;
    }
}
