/* =============================================================================
   GENPATSU.IO - STYLES
   Nuclear Archive: A Cold War Institutional Aesthetic
   ============================================================================= */

/* =============================================================================
   ROOT & CUSTOM PROPERTIES
   ============================================================================= */

:root {
    /* Color Palette */
    --absolute-depth: #0A0408;
    --near-black-burgundy: #1A0A10;
    --deeper-burgundy: #140810;
    --critical-red: #8B1A2A;
    --oxidized-copper: #6B3A2A;
    --reactor-amber: #C4873A;
    --tarnished-brass: #A89060;
    --aged-document: #D4B896;
    --parchment: #C8B090;
    --redacted-black: #2A0E14;
    --dark-variant: #3A1A20;

    /* Typography */
    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'Lora', serif;
    --font-mono: 'IBM Plex Mono', monospace;

    /* Scroll Progress */
    --scroll-progress: 0;
    --compress: 700px;

    /* Background Color Management */
    --bg-color: var(--near-black-burgundy);
}

/* =============================================================================
   GLOBAL STYLES
   ============================================================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: rgba(200, 176, 144, 0.85);
    transition: background-color 1.2s ease;
    overflow-x: hidden;
    position: relative;
}

/* Grain overlay - persistent noise texture across entire viewport */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.04;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" result="noise" /></filter><rect width="100" height="100" fill="%23D4B896" filter="url(%23noise)" /></svg>');
    background-size: 200px 200px;
    will-change: transform;
}

/* =============================================================================
   DOSIMETER PROGRESS INDICATOR
   ============================================================================= */

.dosimeter {
    position: fixed;
    left: 0;
    top: 0;
    width: 4px;
    height: 100vh;
    z-index: 9999;
    overflow: hidden;
}

.dosimeter-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: calc(var(--scroll-progress) * 100%);
    background: linear-gradient(
        to bottom,
        var(--reactor-amber) 0%,
        var(--oxidized-copper) 50%,
        var(--critical-red) 100%
    );
    transition: height 0.05s linear;
}

.dosimeter-indicator {
    position: absolute;
    left: -3px;
    top: calc(var(--scroll-progress) * 100vh - 5px);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(
        to bottom,
        var(--reactor-amber) 0%,
        var(--oxidized-copper) 50%,
        var(--critical-red) 100%
    );
    animation: pulse 2s ease-in-out infinite;
    z-index: 10000;
}

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

/* =============================================================================
   SECTION STRUCTURE - LEVELS
   ============================================================================= */

.level {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.level-0 {
    background-color: var(--near-black-burgundy);
    min-height: 100vh;
}

.level-1 {
    background-color: var(--near-black-burgundy);
    min-height: 120vh;
}

.level-2 {
    background-color: var(--deeper-burgundy);
    min-height: 150vh;
}

.level-3 {
    background-color: var(--deeper-burgundy);
    min-height: 130vh;
}

.level-4 {
    background-color: var(--absolute-depth);
    min-height: 100vh;
}

.level-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* =============================================================================
   LEVEL 0 - THE SURFACE
   ============================================================================= */

.level-0 h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--aged-document);
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1;
}

.epigraph {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--tarnished-brass);
    letter-spacing: 0.05em;
    text-align: center;
}

/* =============================================================================
   LEVEL 1 - THE ANTEROOM
   ============================================================================= */

.dossier {
    position: relative;
    max-width: var(--compress);
    width: 90%;
    background: transparent;
    border: 1px solid var(--oxidized-copper);
    padding: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dossier.revealed {
    opacity: 1;
    transform: translateY(0);
}

.confidential-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-family: var(--font-display);
    font-size: 15vw;
    font-weight: 600;
    color: rgba(139, 26, 42, 0.06);
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
}

.dossier h2 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 600;
    font-variant: small-caps;
    letter-spacing: 0.06em;
    color: var(--tarnished-brass);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.dossier-content {
    position: relative;
    z-index: 1;
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    color: rgba(200, 176, 144, 0.85);
}

.dossier-content p {
    margin-bottom: 1.2rem;
    text-align: left;
}

.dossier-content p:last-child {
    margin-bottom: 0;
}

/* =============================================================================
   LEVEL 2 - THE TECHNICAL ARCHIVE
   ============================================================================= */

.two-column-layout {
    display: grid;
    grid-template-columns: 40% 55%;
    gap: 5%;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.column-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.column-right {
    padding-top: 1rem;
}

.document-fragment {
    display: block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.document-fragment.revealed {
    opacity: 1;
    transform: translateY(0);
}

.document-fragment:nth-child(2).revealed {
    transition-delay: 0.1s;
}

.document-fragment:nth-child(3).revealed {
    transition-delay: 0.2s;
}

.fragment-header {
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.08em;
    color: rgba(196, 135, 58, 0.7);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.document-fragment p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(200, 176, 144, 0.85);
}

.column-right > p {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    color: rgba(200, 176, 144, 0.85);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.column-right > p.revealed {
    opacity: 1;
    transform: translateY(0);
}

.column-right > p:nth-of-type(1) {
    transition-delay: 0s;
}

.column-right > p:nth-of-type(2) {
    transition-delay: 0.1s;
}

.column-right > p:nth-of-type(3) {
    transition-delay: 0.2s;
}

/* =============================================================================
   LEVEL 3 - THE RESTRICTED SECTION
   ============================================================================= */

.restricted-content {
    max-width: 480px;
    width: 90%;
    padding: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.restricted-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.restricted-content h3 {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 600;
    font-variant: small-caps;
    letter-spacing: 0.03em;
    color: var(--tarnished-brass);
    margin-bottom: 1.5rem;
}

.restricted-content p {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    color: rgba(200, 176, 144, 0.85);
    margin-bottom: 1.5rem;
}

.restricted-content p:last-of-type {
    margin-bottom: 0;
}

.redacted-passage {
    margin: 2rem 0;
    padding: 1.5rem;
    border-left: 2px solid var(--oxidized-copper);
    background: rgba(58, 26, 32, 0.15);
    color: var(--parchment);
}

.redaction {
    position: relative;
    white-space: nowrap;
}

.redaction::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background-color: var(--redacted-black);
    line-height: 1.75;
}

.redaction.animated::after {
    animation: redact-expand 0.4s ease-out forwards;
}

@keyframes redact-expand {
    from {
        width: 0;
    }
    to {
        width: calc(100% + 2px);
    }
}

/* =============================================================================
   LEVEL 4 - THE CORE
   ============================================================================= */

.core-content {
    max-width: 600px;
    width: 90%;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.core-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.final-statement {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 24px;
    line-height: 1.8;
    color: var(--redacted-black);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 1200px) {
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .column-left,
    .column-right {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .dossier {
        padding: 2rem;
    }

    .restricted-content {
        padding: 1rem;
    }

    .core-content {
        padding: 1rem;
    }

    .dosimeter {
        width: 3px;
    }

    .dosimeter-indicator {
        left: -2.5px;
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    .level-0 h1 {
        margin-bottom: 1rem;
    }

    .epigraph {
        font-size: 0.85rem;
    }

    .dossier {
        border: 1px solid var(--oxidized-copper);
        padding: 1.5rem;
    }

    .dossier h2 {
        font-size: 1.4rem;
    }

    .dossier-content {
        font-size: 16px;
    }

    .restricted-content h3 {
        font-size: 1.2rem;
    }

    .two-column-layout {
        width: 95%;
    }
}
