/* ============================================
   okurairi.net -- Aurora Cyberpunk Archive
   ============================================ */

/* --- RESET & BASE --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --void-dark: #0A0818;
    --aurora-purple: #8040C0;
    --aurora-teal: #30B0A0;
    --neon-cyan: #40E0E8;
    --duotone-warm: #C89068;
    --terminal-green: #40C870;
    --text-silver: #C0C0D0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void-dark);
    color: var(--text-silver);
    font-family: 'Recursive', monospace, sans-serif;
    font-weight: 400;
    font-variation-settings: 'CASL' 0, 'CRSV' 0, 'MONO' 0;
    font-size: clamp(14px, 1vw, 16px);
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- TERMINAL BOOT SCREEN --- */
#boot-screen {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--void-dark);
}

/* Aurora gradient bands */
.aurora-bands {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.aurora-band {
    position: absolute;
    width: 200%;
    height: 35%;
    opacity: 0.25;
    filter: blur(60px);
    animation: aurora-drift 30s ease-in-out infinite alternate;
}

.aurora-band--purple {
    top: 10%;
    left: -30%;
    background: linear-gradient(135deg, var(--aurora-purple) 0%, transparent 60%);
    animation-delay: 0s;
}

.aurora-band--teal {
    top: 40%;
    left: -10%;
    background: linear-gradient(225deg, var(--aurora-teal) 0%, transparent 60%);
    animation-delay: -10s;
}

.aurora-band--secondary {
    top: 65%;
    left: -50%;
    background: linear-gradient(180deg, var(--aurora-purple) 0%, var(--aurora-teal) 50%, transparent 100%);
    opacity: 0.15;
    animation-delay: -20s;
}

@keyframes aurora-drift {
    0% {
        transform: translateY(0) translateX(0);
    }
    33% {
        transform: translateY(-30px) translateX(20px);
    }
    66% {
        transform: translateY(20px) translateX(-15px);
    }
    100% {
        transform: translateY(-15px) translateX(10px);
    }
}

/* Fish container */
.fish-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.fish {
    position: absolute;
    width: 20px;
    height: 12px;
    pointer-events: auto;
    cursor: pointer;
}

.fish svg {
    width: 100%;
    height: 100%;
}

.fish--glitch {
    animation: fish-glitch 0.15s steps(2) forwards;
}

@keyframes fish-glitch {
    0% {
        filter: none;
        transform: translateX(0);
    }
    25% {
        filter: hue-rotate(90deg) brightness(2);
        transform: translateX(5px);
    }
    50% {
        filter: hue-rotate(-90deg) brightness(1.5);
        transform: translateX(-3px);
    }
    75% {
        filter: hue-rotate(45deg) saturate(3);
        transform: translateX(2px);
    }
    100% {
        filter: none;
        transform: translateX(0);
    }
}

/* Terminal output */
#terminal-output {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: min(600px, 80vw);
    height: 180px;
    overflow: hidden;
    z-index: 5;
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
}

#terminal-text {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0;
    font-weight: 400;
    font-size: 13px;
    color: var(--terminal-green);
    line-height: 1.8;
    animation: terminal-scroll 4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    transform: translateY(180px);
    opacity: 0.9;
}

#terminal-text p {
    white-space: nowrap;
    overflow: hidden;
}

.terminal-green {
    color: var(--terminal-green);
    font-weight: 700;
}

@keyframes terminal-scroll {
    0% {
        transform: translateY(180px);
    }
    100% {
        transform: translateY(-200px);
    }
}

#terminal-output:hover #terminal-text {
    animation-duration: 2s;
}

/* Site title */
#site-title {
    position: relative;
    z-index: 10;
    font-family: 'Recursive', sans-serif;
    font-variation-settings: 'CASL' 1, 'CRSV' 1;
    font-weight: 800;
    font-size: clamp(36px, 6vw, 80px);
    color: var(--text-silver);
    letter-spacing: -0.02em;
    opacity: 0;
    animation: title-fade-in 1.5s ease-out 1.2s forwards;
    text-shadow:
        0 0 40px rgba(128, 64, 192, 0.5),
        0 0 80px rgba(48, 176, 160, 0.3);
}

#site-subtitle {
    position: relative;
    z-index: 10;
    font-family: 'Recursive', monospace;
    font-variation-settings: 'MONO' 1;
    font-weight: 400;
    font-size: 13px;
    color: var(--neon-cyan);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    animation: title-fade-in 1s ease-out 2s forwards;
    margin-top: 12px;
}

@keyframes title-fade-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- INVESTIGATION SPREADS --- */
#spreads {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px;
}

.spread {
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: 24px;
    margin-bottom: 120px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.spread.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Labels */
.label {
    display: inline-block;
    font-family: 'Recursive', sans-serif;
    font-variation-settings: 'MONO' 1;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--neon-cyan);
    margin-bottom: 12px;
    opacity: 0.8;
}

/* Spread left (narrative) */
.spread-left {
    padding-right: 24px;
    border-left: 2px solid transparent;
    padding-left: 20px;
    transition: border-color 0.3s ease;
}

.spread-left:hover,
.spread:hover .spread-left {
    border-left-color: var(--neon-cyan);
    box-shadow: -4px 0 20px rgba(64, 224, 232, 0.1);
}

.spread-headline {
    font-family: 'Recursive', sans-serif;
    font-variation-settings: 'CASL' 0.7;
    font-weight: 800;
    font-size: clamp(28px, 3.5vw, 52px);
    color: var(--text-silver);
    line-height: 1.15;
    margin-bottom: 24px;
}

#spread-1 .spread-headline {
    font-variation-settings: 'CASL' 1;
}

#spread-2 .spread-headline {
    font-variation-settings: 'CASL' 0.5;
}

#spread-3 .spread-headline {
    font-variation-settings: 'CASL' 0.8;
}

.spread-body {
    color: var(--text-silver);
    margin-bottom: 20px;
    font-variation-settings: 'CASL' 0;
}

.highlight {
    color: var(--neon-cyan);
    font-weight: 600;
}

/* Code fragments */
.code-fragment {
    background: rgba(10, 8, 24, 0.8);
    border: 1px solid rgba(128, 64, 192, 0.3);
    border-radius: 4px;
    padding: 16px;
    margin: 24px 0;
    overflow-x: auto;
}

.code-fragment .label {
    margin-bottom: 8px;
    color: var(--aurora-purple);
}

.code-fragment pre {
    margin: 0;
}

.code-fragment code {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-silver);
}

/* Spread right (evidence) */
.spread-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Evidence panels */
.evidence-panel {
    position: relative;
    cursor: zoom-in;
    border: 1px solid rgba(128, 64, 192, 0.2);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.evidence-panel:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(64, 224, 232, 0.1);
}

.evidence-panel.wobble {
    animation: panel-wobble 0.6s ease-out;
}

@keyframes panel-wobble {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(0.3deg); }
    50% { transform: rotate(-0.2deg); }
    75% { transform: rotate(0.1deg); }
    100% { transform: rotate(0deg); }
}

.evidence-panel__image {
    width: 100%;
    background-color: var(--void-dark);
}

.evidence-panel__image svg {
    display: block;
    width: 100%;
    height: auto;
}

.evidence-panel__image.duotone {
    filter: grayscale(0.5) sepia(0.3) hue-rotate(200deg);
}

.evidence-panel .label {
    display: block;
    padding: 8px 12px;
    background: rgba(10, 8, 24, 0.9);
    color: var(--duotone-warm);
    border-top: 1px solid rgba(128, 64, 192, 0.15);
}

/* --- ZOOM OVERLAY --- */
.zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 8, 24, 0.92);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.zoom-overlay.active {
    opacity: 1;
    pointer-events: auto;
    cursor: zoom-out;
}

.evidence-panel.zoomed {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    z-index: 600;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    border-color: var(--neon-cyan);
    cursor: zoom-out;
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* --- NETWORK TOPOLOGY FOOTER --- */
#network-footer {
    position: relative;
    padding: 60px 24px 40px;
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid rgba(128, 64, 192, 0.2);
}

#network-footer .label {
    display: block;
    margin-bottom: 24px;
}

#network-topology {
    width: 100%;
    height: auto;
    max-height: 300px;
}

#network-connections line {
    stroke: var(--text-silver);
    stroke-width: 0.5;
    opacity: 0;
    stroke-dasharray: 4, 4;
    transition: opacity 1s ease;
}

#network-connections line.drawn {
    opacity: 0.3;
    animation: dash-flow 3s linear infinite;
}

@keyframes dash-flow {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -16;
    }
}

.network-node circle {
    transition: stroke-width 0.3s ease, filter 0.3s ease;
}

.network-node:hover circle {
    stroke-width: 2.5;
    filter: drop-shadow(0 0 8px currentColor);
}

.footer-status {
    text-align: center;
    font-family: 'Recursive', monospace;
    font-variation-settings: 'MONO' 1;
    font-size: 12px;
    color: var(--terminal-green);
    margin-top: 24px;
    opacity: 0.7;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .spread {
        grid-template-columns: 1fr;
    }

    .spread-left {
        padding-right: 0;
    }

    #terminal-output {
        width: 90vw;
        bottom: 20%;
    }

    #site-title {
        font-size: clamp(28px, 8vw, 52px);
    }

    .evidence-panel.zoomed {
        max-width: 95vw;
        max-height: 80vh;
    }
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--void-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--aurora-purple);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}

/* --- SELECTION --- */
::selection {
    background: rgba(128, 64, 192, 0.4);
    color: var(--neon-cyan);
}
