/* genpatsu.quest - Nuclear Power Contemplation */
/* Design: goblincore-meets-nuclear, dark-neon, calm-serene */

:root {
    --bg-deep: #0a0e14;
    --bg-surface: #141b24;
    --bg-elevated: #1c2636;
    --text-primary: #c4ccd8;
    --text-muted: #5e6b7a;
    --accent-green: #39ff14;
    --accent-blue: #00e5ff;
    --accent-amber: #d4a020;
    --danger: #ff2d55;
    --organic: #3a6b4f;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* ====== CANVAS LAYERS ====== */
#bubble-canvas,
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

#particle-canvas {
    z-index: 1;
}

/* ====== CORE SHAFT ====== */
#core-shaft {
    position: fixed;
    top: 0;
    left: calc((5 / 16) * 100%);
    width: 60px;
    height: 100vh;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(57, 255, 20, 0.03) 20%,
        rgba(57, 255, 20, 0.05) 50%,
        rgba(57, 255, 20, 0.03) 80%,
        transparent 100%
    );
    border-left: 1px solid rgba(57, 255, 20, 0.06);
    border-right: 1px solid rgba(57, 255, 20, 0.06);
    z-index: 2;
    pointer-events: none;
    transition: background 0.8s ease;
}

/* ====== GEIGER DOT NAVIGATION ====== */
#geiger-nav {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.geiger-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.2);
    border: 1px solid rgba(0, 229, 255, 0.3);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease,
                box-shadow 0.3s ease;
}

.geiger-dot:hover {
    transform: scale(1.4);
    background: rgba(0, 229, 255, 0.5);
}

.geiger-dot.active {
    background: var(--accent-blue);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.geiger-dot.pulsing {
    animation: geigerPulse var(--pulse-duration, 2s) ease-in-out infinite;
}

@keyframes geigerPulse {
    0%, 100% { box-shadow: 0 0 2px rgba(0, 229, 255, 0.2); }
    50% { box-shadow: 0 0 10px rgba(0, 229, 255, 0.6); }
}

/* ====== CONTENT SECTIONS ====== */
.content-section {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    padding: 8vh 0;
}

.section-inner {
    position: relative;
    z-index: 2;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 0 1.5vw;
    max-width: 100%;
    padding: 0 3vw;
}

/* Moss texture overlay */
.moss-texture {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(ellipse 400px 350px at 15% 30%, rgba(58, 107, 79, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 300px 250px at 75% 60%, rgba(58, 107, 79, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 500px 200px at 40% 80%, rgba(58, 107, 79, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 250px 400px at 85% 20%, rgba(58, 107, 79, 0.03) 0%, transparent 70%);
}

/* ====== SECTION: OPENING ====== */
.section-opening {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    clip-path: polygon(0 0, 8% 0, 22% 2%, 35% 0, 48% 1%, 62% 0, 78% 2%, 91% 0, 100% 0, 100% 95%, 93% 98%, 79% 96%, 64% 99%, 50% 97%, 34% 100%, 19% 97%, 7% 100%, 0 96%);
}

.section-opening .grid-layout {
    align-items: center;
}

.opening-kanji {
    grid-column: 2 / 10;
    grid-row: 1;
}

.kanji-char {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: clamp(8rem, 30vw, 35rem);
    color: var(--accent-green);
    line-height: 0.9;
    opacity: 0.12;
    display: block;
    animation: kanjiPulse 6s ease-in-out infinite;
    user-select: none;
}

@keyframes kanjiPulse {
    0%, 100% { opacity: 0.08; }
    50% { opacity: 0.15; }
}

.opening-title {
    grid-column: 3 / 12;
    grid-row: 1;
    position: relative;
    z-index: 2;
    text-align: left;
    padding-left: 2vw;
}

.opening-title h1 {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: clamp(2.4rem, 5.5vw, 5rem);
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 0.95;
    margin-bottom: 1.5rem;
}

.opening-subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--text-muted);
    line-height: 1.8;
}

/* ====== SECTION: THE ATOM ====== */
.section-atom {
    clip-path: polygon(0 2%, 8% 0, 22% 3%, 35% 1%, 48% 4%, 62% 0, 78% 3%, 91% 1%, 100% 2%, 100% 96%, 93% 99%, 79% 97%, 64% 100%, 50% 98%, 34% 100%, 19% 96%, 7% 99%, 0 97%);
    background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-surface) 50%, var(--bg-deep) 100%);
    padding-top: 12vh;
    padding-bottom: 12vh;
}

.atom-diagram-container {
    grid-column: 2 / 8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.atom-svg {
    width: 100%;
    max-width: 320px;
}

.orbit {
    transform-origin: 150px 150px;
}

.orbit-1 {
    animation: orbitRotate1 20s linear infinite;
}

.orbit-2 {
    animation: orbitRotate2 25s linear infinite;
}

.orbit-3 {
    animation: orbitRotate3 30s linear infinite;
}

@keyframes orbitRotate1 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes orbitRotate2 {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@keyframes orbitRotate3 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.atom-text {
    grid-column: 9 / 16;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2rem;
}

/* ====== TYPOGRAPHY ====== */
.section-heading {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: clamp(2.4rem, 5.5vw, 5rem);
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 0.95;
    margin-bottom: 1.5rem;
}

.body-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    color: var(--text-primary);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    margin-bottom: 1rem;
}

.data-highlight {
    color: var(--accent-blue);
    font-family: 'Overpass Mono', monospace;
    font-weight: 400;
    letter-spacing: 0.08em;
}

/* ====== SECTION: CHAIN REACTION ====== */
.section-chain {
    clip-path: polygon(0 1%, 10% 3%, 20% 0, 33% 2%, 47% 0, 60% 3%, 75% 0, 88% 2%, 100% 0, 100% 98%, 90% 96%, 78% 100%, 65% 97%, 52% 100%, 38% 97%, 23% 100%, 10% 97%, 0 100%);
    background: linear-gradient(180deg, rgba(10, 14, 20, 0.95) 0%, var(--bg-surface) 40%, var(--bg-deep) 100%);
}

.chain-text {
    grid-column: 2 / 10;
}

.chain-data {
    grid-column: 11 / 16;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: 4rem;
}

/* ====== DATA CARDS ====== */
.data-card {
    background: var(--bg-surface);
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, var(--accent-green), transparent 40%, var(--accent-blue)) 1;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
}

.data-card:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.08);
}

.data-label {
    display: block;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.data-value {
    display: block;
    font-family: 'Overpass Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--accent-blue);
    letter-spacing: 0.08em;
}

.card-detail {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 0.8rem;
}

/* ====== BREATHING ZONES ====== */
.breathing-zone {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.breathing-data {
    text-align: center;
}

.breathing-number {
    display: block;
    font-family: 'Overpass Mono', monospace;
    font-weight: 400;
    font-size: clamp(3rem, 12vw, 10rem);
    color: var(--accent-blue);
    letter-spacing: 0.08em;
    line-height: 1;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.breathing-label {
    display: block;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: lowercase;
}

/* ====== SECTION: REACTOR ====== */
.section-reactor {
    clip-path: polygon(0 4%, 6% 1%, 18% 3%, 30% 0, 44% 2%, 58% 0, 72% 3%, 85% 0, 100% 2%, 100% 97%, 92% 100%, 80% 97%, 66% 100%, 52% 98%, 38% 100%, 25% 97%, 12% 100%, 0 98%);
    background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-surface) 50%, var(--bg-deep) 100%);
}

.reactor-text {
    grid-column: 2 / 9;
}

.reactor-diagram {
    grid-column: 10 / 16;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reactor-svg {
    width: 100%;
    max-width: 280px;
    opacity: 0.8;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reactor-svg:hover {
    transform: scale(1.03);
}

/* ====== SECTION: RISK ====== */
.section-risk {
    clip-path: polygon(0 2%, 12% 0, 25% 3%, 38% 1%, 52% 4%, 65% 0, 80% 2%, 92% 0, 100% 3%, 100% 96%, 88% 100%, 75% 97%, 60% 100%, 48% 97%, 32% 100%, 18% 96%, 5% 99%, 0 97%);
    background: linear-gradient(180deg, var(--bg-deep) 0%, rgba(20, 27, 36, 0.9) 50%, var(--bg-deep) 100%);
}

.risk-heading {
    grid-column: 2 / 8;
}

.risk-intro {
    grid-column: 2 / 11;
    margin-bottom: 3rem;
}

.risk-cards {
    grid-column: 2 / 16;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.risk-card {
    border-image: linear-gradient(135deg, var(--danger), transparent 50%, var(--accent-amber)) 1;
}

.risk-card .data-value {
    color: var(--danger);
}

/* ====== SECTION: HALF-LIFE ====== */
.section-halflife {
    clip-path: polygon(0 3%, 7% 0, 20% 2%, 33% 0, 46% 3%, 60% 0, 73% 2%, 87% 0, 100% 1%, 100% 98%, 91% 100%, 77% 97%, 63% 100%, 49% 97%, 35% 100%, 21% 98%, 9% 100%, 0 97%);
    background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-surface) 50%, var(--bg-deep) 100%);
}

.halflife-text {
    grid-column: 2 / 9;
}

.halflife-data {
    grid-column: 10 / 16;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 2rem;
}

.halflife-item {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 229, 255, 0.08);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.halflife-item:hover {
    transform: scale(1.03);
}

.isotope-name {
    display: block;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.halflife-value {
    display: block;
    font-family: 'Overpass Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: var(--accent-blue);
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
}

.decay-bar {
    height: 3px;
    background: rgba(0, 229, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.decay-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 2s ease-out;
}

[data-decay="fast"] .decay-fill {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
}

[data-decay="medium"] .decay-fill {
    background: var(--accent-amber);
    box-shadow: 0 0 6px rgba(212, 160, 32, 0.4);
}

[data-decay="slow"] .decay-fill {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(255, 45, 85, 0.3);
}

[data-decay="geological"] .decay-fill {
    background: var(--accent-blue);
    box-shadow: 0 0 6px rgba(0, 229, 255, 0.3);
}

/* ====== SECTION: THE QUESTION ====== */
.section-question {
    clip-path: polygon(0 5%, 8% 2%, 22% 4%, 35% 0, 48% 3%, 62% 1%, 78% 4%, 91% 0, 100% 3%, 100% 100%, 0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.question-content {
    grid-column: 3 / 14;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.question-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--text-primary);
    line-height: 1.8;
    letter-spacing: 0.02em;
}

.question-isotope {
    width: 120px;
    height: 120px;
    opacity: 0.5;
    animation: isotopeRotate 30s linear infinite;
}

@keyframes isotopeRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.isotope-svg {
    width: 100%;
    height: 100%;
}

.question-domain {
    font-family: 'Overpass Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: lowercase;
}

/* ====== SCROLL ANIMATIONS ====== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Stagger children */
.fade-in.visible .body-text:nth-child(1) { transition-delay: 0ms; }
.fade-in.visible .body-text:nth-child(2) { transition-delay: 80ms; }
.fade-in.visible .body-text:nth-child(3) { transition-delay: 160ms; }
.fade-in.visible .data-card:nth-child(1) { transition-delay: 0ms; }
.fade-in.visible .data-card:nth-child(2) { transition-delay: 80ms; }
.fade-in.visible .data-card:nth-child(3) { transition-delay: 160ms; }

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: repeat(8, 1fr);
        padding: 0 5vw;
    }

    .opening-kanji {
        grid-column: 1 / -1;
    }

    .opening-title {
        grid-column: 1 / -1;
        padding-left: 0;
    }

    .atom-diagram-container {
        grid-column: 1 / -1;
        margin-bottom: 2rem;
    }

    .atom-text {
        grid-column: 1 / -1;
    }

    .chain-text {
        grid-column: 1 / -1;
    }

    .chain-data {
        grid-column: 1 / -1;
        padding-top: 2rem;
    }

    .reactor-text {
        grid-column: 1 / -1;
    }

    .reactor-diagram {
        grid-column: 1 / -1;
        margin-top: 2rem;
    }

    .risk-heading {
        grid-column: 1 / -1;
    }

    .risk-intro {
        grid-column: 1 / -1;
    }

    .risk-cards {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
    }

    .halflife-text {
        grid-column: 1 / -1;
    }

    .halflife-data {
        grid-column: 1 / -1;
    }

    .question-content {
        grid-column: 1 / -1;
    }

    #core-shaft {
        display: none;
    }

    .kanji-char {
        font-size: clamp(5rem, 25vw, 12rem);
    }
}

/* Selection color */
::selection {
    background: rgba(57, 255, 20, 0.2);
    color: var(--accent-green);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.2);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.4);
}

/* Palette: Text on light backgrounds */
.text-on-light {
    color: #2A2F3A;
}
