/* genpatsu.io - Cinematic Nuclear Surrealism */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0a0e17;
    color: #8a9bb0;
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.75;
    overflow: hidden;
    height: 100vh;
}

/* ===== Opening Overlay ===== */
#opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0e17;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cherenkov-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 1px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 207, 255, 0.06) 0%, transparent 70%);
    opacity: 0;
    animation: glow-expand 2.4s cubic-bezier(0.16, 1, 0.3, 1) 600ms forwards;
}

@keyframes glow-expand {
    0% {
        width: 1px;
        height: 1px;
        opacity: 0;
    }
    100% {
        width: 40vw;
        height: 40vw;
        opacity: 1;
    }
}

#opening-title {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    animation: title-fade 1.2s ease-in-out 1.8s forwards;
}

@keyframes title-fade {
    to { opacity: 1; }
}

#opening-domain {
    font-family: 'Baskervville', serif;
    font-weight: 400;
    font-size: 42px;
    color: #c8d8e8;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

#opening-subtitle {
    font-family: 'Azeret Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: #3d6a8a;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0;
    animation: title-fade 800ms ease-in-out 2.2s forwards;
}

/* ===== Grain Overlay ===== */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    animation: grain-in 1s ease 600ms forwards;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

@keyframes grain-in {
    to { opacity: 1; }
}

/* ===== Main Layout ===== */
#site-wrapper {
    display: flex;
    height: 100vh;
    opacity: 0;
    transform: translateX(0);
    transition: opacity 800ms ease;
}

#site-wrapper.revealed {
    opacity: 1;
}

/* ===== Left Panel: Containment Zone ===== */
#containment-zone {
    width: 45vw;
    height: 100vh;
    background: #0a0e17;
    position: relative;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

#containment-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 80px 48px 80px 64px;
    scrollbar-width: thin;
    scrollbar-color: #1a3f5c #0a0e17;
}

#containment-scroll::-webkit-scrollbar {
    width: 4px;
}

#containment-scroll::-webkit-scrollbar-track {
    background: #0a0e17;
}

#containment-scroll::-webkit-scrollbar-thumb {
    background: #1a3f5c;
}

/* ===== Scroll Progress Indicator ===== */
#scroll-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 0%;
    background: rgba(0, 207, 255, 0.4);
    z-index: 200;
    transition: height 100ms linear;
}

/* ===== Navigation ===== */
#main-nav {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 4px 0;
    transition: transform 200ms ease-out;
}

.nav-item:hover {
    transform: translateX(4px);
}

.nav-indicator {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #3d6a8a;
    transition: background 300ms ease, border-color 300ms ease;
}

.nav-item.active .nav-indicator {
    background: #00cfff;
    border-color: #00cfff;
}

.nav-label {
    font-family: 'Azeret Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: #3d6a8a;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    transition: color 200ms ease;
}

.nav-item.active .nav-label {
    color: #8a9bb0;
}

/* ===== Text Sections ===== */
.text-section {
    margin-bottom: 64px;
    padding-top: 20px;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.divider-rule {
    height: 1px;
    width: 40%;
    background: #1a3f5c;
}

/* ===== Containment Circles SVG ===== */
.containment-circles {
    display: block;
}

.c-ring {
    fill: none;
    stroke: #1a3f5c;
    stroke-width: 0.5;
    opacity: 0.3;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.5s ease-out;
}

.c-ring.drawn {
    stroke-dashoffset: 0;
}

.ring-2 { transition-delay: 200ms; }
.ring-3 { transition-delay: 400ms; }
.ring-4 { transition-delay: 600ms; }
.ring-5 { transition-delay: 800ms; }

/* ===== Section Headings ===== */
.section-heading {
    font-family: 'Baskervville', serif;
    font-weight: 400;
    font-size: 38px;
    color: #c8d8e8;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

/* ===== Blur Focus Animation ===== */
.blur-focus {
    filter: blur(4px);
    opacity: 0.4;
    transition: filter 500ms ease, opacity 500ms ease;
}

.blur-focus.focused {
    filter: blur(0);
    opacity: 1;
}

/* ===== Body Text ===== */
.body-text {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.75;
    color: #8a9bb0;
    max-width: 520px;
    margin-bottom: 20px;
}

/* ===== Text Links ===== */
.text-link {
    color: #00cfff;
    text-decoration: none;
    background-image: linear-gradient(#00cfff, #00cfff);
    background-size: 0% 1px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 300ms ease;
}

.text-link:hover {
    background-size: 100% 1px;
}

/* ===== Annotations ===== */
.annotation {
    font-family: 'Azeret Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.6;
    color: #3d6a8a;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #1a3f5c;
}

/* ===== Footer Decay Curve ===== */
#footer-area {
    margin-top: 64px;
    padding-top: 32px;
}

#decay-curve {
    display: block;
    max-width: 400px;
}

.decay-path {
    fill: none;
    stroke: #3d6a8a;
    stroke-width: 1;
    opacity: 0.4;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 3s ease-out;
}

.decay-path.drawn {
    stroke-dashoffset: 0;
}

#tick-marks {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    max-width: 400px;
}

.tick {
    width: 1px;
    height: 4px;
    background: rgba(26, 63, 92, 0.2);
}

/* ===== Right Panel: Exposure Zone ===== */
#exposure-zone {
    width: 55vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.visual-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    filter: blur(12px);
    transition: opacity 800ms ease, filter 800ms ease;
}

.visual-field.active {
    opacity: 1;
    filter: blur(0);
}

.visual-field.fading {
    opacity: 0.3;
    filter: blur(12px);
}

.field-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Different gradient positions for each field */
.field-1 .field-gradient {
    background: radial-gradient(circle at 50% 50%, rgba(0, 207, 255, 0.06) 0%, #0a0e17 70%);
}

.field-2 .field-gradient {
    background: radial-gradient(circle at 35% 60%, rgba(0, 207, 255, 0.08) 0%, #0a0e17 65%);
}

.field-3 .field-gradient {
    background: radial-gradient(circle at 60% 40%, rgba(0, 207, 255, 0.05) 0%, rgba(212, 160, 60, 0.03) 30%, #0a0e17 70%);
}

.field-4 .field-gradient {
    background: radial-gradient(circle at 40% 70%, rgba(0, 207, 255, 0.07) 0%, rgba(230, 57, 70, 0.02) 40%, #0a0e17 75%);
}

.field-5 .field-gradient {
    background: radial-gradient(circle at 50% 50%, rgba(0, 207, 255, 0.12) 0%, #0a0e17 60%);
}

/* Grain overlay per field */
.field-grain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
}

.field-5 .field-grain {
    opacity: 1.5;
}

/* Scan Line */
.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(0, 207, 255, 0.12);
    animation: scan-drift 20s linear infinite;
}

@keyframes scan-drift {
    0% { top: -1px; }
    100% { top: 100%; }
}

/* Tick marks at bottom of visual fields */
.field-ticks {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-image: repeating-linear-gradient(
        90deg,
        rgba(26, 63, 92, 0.2) 0px,
        rgba(26, 63, 92, 0.2) 1px,
        transparent 1px,
        transparent 12px
    );
}

/* Gradient pulse animation */
.visual-field.active .field-gradient {
    animation: gradient-pulse 8s ease-in-out infinite;
}

@keyframes gradient-pulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

/* ===== Mobile Layout ===== */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        height: auto;
    }

    #site-wrapper {
        flex-direction: column;
        height: auto;
    }

    #containment-zone {
        width: 100%;
        height: auto;
    }

    #containment-scroll {
        padding: 80px 24px 40px;
        overflow-y: visible;
    }

    #exposure-zone {
        display: none;
    }

    #main-nav {
        left: 16px;
        top: 16px;
    }

    .section-heading {
        font-size: 28px;
    }

    #opening-domain {
        font-size: 32px;
    }

    /* Mobile visual fields inline */
    .mobile-field {
        width: 100%;
        height: 60vh;
        position: relative;
        overflow: hidden;
    }
}
