/* gabs.wiki - Cyberpunk Knowledge Archive with Watercolor Dissolution */
/* Colors: #0a0a12, #12121e, #00fff2, #ff2d6b, #b84dff, #ffe03d, #c8d6e5, #5c6b7a */

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

:root {
    --void-base: #0a0a12;
    --panel-surface: #12121e;
    --cyan-pulse: #00fff2;
    --magenta-bleed: #ff2d6b;
    --violet-haze: #b84dff;
    --amber-signal: #ffe03d;
    --pale-circuit: #c8d6e5;
    --dampened-wire: #5c6b7a;
    --cursor-x: 50%;
    --cursor-y: 50%;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void-base);
    color: var(--pale-circuit);
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   CURSOR SPOTLIGHT
   ======================================== */

#cursor-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(
        300px circle at var(--cursor-x) var(--cursor-y),
        rgba(0, 255, 242, 0.04) 0%,
        transparent 100%
    );
    transition: background 200ms ease;
}

body.node-hovered #cursor-spotlight {
    background: radial-gradient(
        300px circle at var(--cursor-x) var(--cursor-y),
        rgba(0, 255, 242, 0.08) 0%,
        transparent 100%
    );
}

/* ========================================
   SCAN LINES OVERLAY
   ======================================== */

#scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 255, 242, 0.02) 2px,
        rgba(0, 255, 242, 0.02) 3px
    );
    animation: scanScroll 60s linear infinite;
}

@keyframes scanScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* ========================================
   SUBSTRATE - Watercolor Pools
   ======================================== */

#substrate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.pigment-pool {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.06;
}

.pool-cyan {
    width: 500px;
    height: 500px;
    background: var(--cyan-pulse);
    top: 10%;
    left: 15%;
    animation: poolDrift1 30s ease-in-out infinite alternate;
}

.pool-magenta {
    width: 400px;
    height: 400px;
    background: var(--magenta-bleed);
    top: 40%;
    right: 10%;
    animation: poolDrift2 25s ease-in-out infinite alternate;
}

.pool-violet {
    width: 450px;
    height: 450px;
    background: var(--violet-haze);
    bottom: 15%;
    left: 30%;
    animation: poolDrift3 35s ease-in-out infinite alternate;
}

.pool-amber {
    width: 300px;
    height: 300px;
    background: var(--amber-signal);
    top: 60%;
    left: 60%;
    animation: poolDrift4 28s ease-in-out infinite alternate;
    opacity: 0.04;
}

@keyframes poolDrift1 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.06; }
    50% { transform: translate(60px, 30px) scale(1.1); opacity: 0.08; }
    100% { transform: translate(-40px, 60px) scale(0.95); opacity: 0.05; }
}

@keyframes poolDrift2 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.06; }
    50% { transform: translate(-50px, 40px) scale(1.15); opacity: 0.07; }
    100% { transform: translate(30px, -30px) scale(0.9); opacity: 0.05; }
}

@keyframes poolDrift3 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.06; }
    50% { transform: translate(40px, -50px) scale(1.05); opacity: 0.08; }
    100% { transform: translate(-60px, 20px) scale(1.1); opacity: 0.06; }
}

@keyframes poolDrift4 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.04; }
    50% { transform: translate(-30px, -40px) scale(1.2); opacity: 0.05; }
    100% { transform: translate(50px, 10px) scale(0.85); opacity: 0.03; }
}

/* ========================================
   COMMAND BAR
   ======================================== */

#command-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: rgba(10, 10, 18, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 200;
    border-bottom: 1px solid rgba(0, 255, 242, 0.1);
}

#command-title {
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: var(--cyan-pulse);
    text-shadow: 0 0 8px rgba(0, 255, 242, 0.6);
}

#status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan-pulse);
    box-shadow: 0 0 4px var(--cyan-pulse);
    animation: statusPulse 3s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { background: var(--cyan-pulse); box-shadow: 0 0 4px var(--cyan-pulse); }
    25% { background: var(--magenta-bleed); box-shadow: 0 0 4px var(--magenta-bleed); }
    50% { background: var(--violet-haze); box-shadow: 0 0 4px var(--violet-haze); }
    75% { background: var(--amber-signal); box-shadow: 0 0 4px var(--amber-signal); }
}

.status-label {
    font-family: "Share Tech Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--dampened-wire);
    animation: flicker 3s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ========================================
   ZONE 1 - ACCESS TERMINAL
   ======================================== */

#access-terminal {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

#terminal-content {
    text-align: center;
    position: relative;
    z-index: 3;
}

#main-title {
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan-pulse);
    text-shadow: 0 0 20px rgba(0, 255, 242, 0.6), 0 0 60px rgba(0, 255, 242, 0.2);
    margin-bottom: 16px;
}

#subtitle {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: var(--dampened-wire);
    letter-spacing: 0.15em;
    opacity: 0;
    transition: opacity 1s ease;
}

#subtitle.visible {
    opacity: 1;
}

#terminal-line {
    width: 0;
    height: 1px;
    background: var(--cyan-pulse);
    opacity: 0.2;
    margin: 32px auto;
    transition: width 2s ease;
}

#terminal-line.expanded {
    width: min(80vw, 600px);
}

#scroll-chevron {
    margin-top: 48px;
    opacity: 0;
    transition: opacity 1s ease 2.5s;
}

#scroll-chevron.visible {
    opacity: 1;
}

.chevron-text {
    font-family: "Share Tech Mono", monospace;
    font-size: 0.85rem;
    color: var(--dampened-wire);
    animation: chevronPulse 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 0.8; transform: translateY(4px); }
}

/* Terminal Background Pools */
.terminal-pools {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.pool-cyan-lg {
    width: 600px;
    height: 600px;
    background: var(--cyan-pulse);
    position: absolute;
    top: 20%;
    left: 10%;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.06;
    animation: poolDrift1 30s ease-in-out infinite alternate;
}

.pool-magenta-lg {
    width: 500px;
    height: 500px;
    background: var(--magenta-bleed);
    position: absolute;
    top: 30%;
    right: 15%;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.05;
    animation: poolDrift2 25s ease-in-out infinite alternate;
}

.pool-violet-lg {
    width: 550px;
    height: 550px;
    background: var(--violet-haze);
    position: absolute;
    bottom: 10%;
    left: 40%;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.05;
    animation: poolDrift3 35s ease-in-out infinite alternate;
}

/* ========================================
   ZONE 2 - KNOWLEDGE SURFACE (MASONRY)
   ======================================== */

#knowledge-surface {
    position: relative;
    z-index: 2;
    padding: 0 24px 80px;
}

#masonry-grid {
    columns: 3;
    column-gap: 2px;
}

/* ========================================
   KNOWLEDGE NODES
   ======================================== */

.knowledge-node {
    break-inside: avoid;
    position: relative;
    background: var(--panel-surface);
    border: 1px solid rgba(0, 255, 242, 0.15);
    margin-bottom: 2px;
    padding: 24px;
    overflow: hidden;
    box-shadow: 0 0 1px var(--cyan-pulse), 0 0 3px rgba(0, 255, 242, 0.3);
    opacity: 0;
    filter: blur(8px);
    transform: translateY(12px);
    transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.knowledge-node.visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.knowledge-node:hover {
    border-color: rgba(0, 255, 242, 0.35);
    box-shadow: 0 0 2px var(--cyan-pulse), 0 0 8px rgba(0, 255, 242, 0.3);
}

/* Watercolor bleed on select nodes */
.knowledge-node[data-bleed="true"] {
    filter: blur(0) url(#watercolor-bleed);
}

.knowledge-node[data-bleed="true"].visible {
    filter: blur(0);
}

/* Node watercolor background washes */
.node-watercolor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.node-wash-cyan::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    top: -30%;
    left: -40%;
    background: radial-gradient(ellipse at 30% 40%, rgba(0, 255, 242, 0.08) 0%, transparent 70%);
    filter: blur(40px);
}

.node-wash-magenta::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    top: -20%;
    left: -30%;
    background: radial-gradient(ellipse at 60% 30%, rgba(255, 45, 107, 0.06) 0%, transparent 70%);
    filter: blur(40px);
}

.node-wash-violet::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    top: -40%;
    left: -20%;
    background: radial-gradient(ellipse at 40% 60%, rgba(184, 77, 255, 0.07) 0%, transparent 70%);
    filter: blur(40px);
}

.node-wash-amber::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    top: -25%;
    left: -35%;
    background: radial-gradient(ellipse at 50% 40%, rgba(255, 224, 61, 0.05) 0%, transparent 70%);
    filter: blur(40px);
}

/* Node Brackets (HUD corners) */
.node-brackets {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.bracket {
    position: absolute;
    width: 16px;
    height: 16px;
    transition: all 300ms ease;
}

.bracket-tl {
    top: 6px;
    left: 6px;
    border-top: 2px solid rgba(0, 255, 242, 0.4);
    border-left: 2px solid rgba(0, 255, 242, 0.4);
}

.bracket-br {
    bottom: 6px;
    right: 6px;
    border-bottom: 2px solid rgba(0, 255, 242, 0.4);
    border-right: 2px solid rgba(0, 255, 242, 0.4);
}

.knowledge-node:hover .bracket-tl {
    top: 2px;
    left: 2px;
    border-color: rgba(0, 255, 242, 0.8);
}

.knowledge-node:hover .bracket-br {
    bottom: 2px;
    right: 2px;
    border-color: rgba(0, 255, 242, 0.8);
}

/* Node Content */
.node-content {
    position: relative;
    z-index: 2;
}

.node-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.node-category {
    font-family: "Share Tech Mono", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--cyan-pulse);
    opacity: 0.7;
    background: rgba(0, 255, 242, 0.06);
    padding: 2px 8px;
    border: 1px solid rgba(0, 255, 242, 0.15);
}

.node-timestamp {
    font-family: "Share Tech Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--dampened-wire);
    animation: flicker 3s ease-in-out infinite;
}

.node-title {
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan-pulse);
    text-shadow: 0 0 8px rgba(0, 255, 242, 0.6);
    margin-bottom: 12px;
    line-height: 1.3;
}

.node-body {
    color: var(--pale-circuit);
    margin-bottom: 10px;
    line-height: 1.72;
}

.node-body:last-child {
    margin-bottom: 0;
}

/* Drip Accents */
.drip-accent {
    position: absolute;
    bottom: -15px;
    left: 20%;
    width: 3px;
    height: 30px;
    background: linear-gradient(to bottom, rgba(0, 255, 242, 0.3), transparent);
    animation: dripDrift 8s ease-in-out infinite alternate;
    z-index: 1;
}

.drip-violet {
    background: linear-gradient(to bottom, rgba(184, 77, 255, 0.3), transparent);
    left: 40%;
}

.drip-magenta {
    background: linear-gradient(to bottom, rgba(255, 45, 107, 0.3), transparent);
    left: 60%;
}

@keyframes dripDrift {
    0% { transform: translateY(0); opacity: 0.6; }
    100% { transform: translateY(8px); opacity: 0.3; }
}

/* ========================================
   ZONE 3 - DEEP ARCHIVE
   ======================================== */

#deep-archive {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

#archive-content {
    text-align: center;
    position: relative;
    z-index: 3;
}

#archive-title {
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dampened-wire);
    margin-bottom: 24px;
}

#archive-cursors {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.blink-cursor {
    font-family: "Share Tech Mono", monospace;
    font-size: 1.2rem;
    color: var(--dampened-wire);
    animation: cursorBlink 1.2s step-end infinite;
}

.blink-cursor:nth-child(2) {
    animation-delay: 0.4s;
}

.blink-cursor:nth-child(3) {
    animation-delay: 0.8s;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Archive Background Pools (muted) */
.archive-pools {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.pool-cyan-muted {
    width: 500px;
    height: 500px;
    background: var(--cyan-pulse);
    position: absolute;
    top: 25%;
    left: 20%;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.03;
    animation: poolDrift1 30s ease-in-out infinite alternate;
}

.pool-magenta-muted {
    width: 400px;
    height: 400px;
    background: var(--magenta-bleed);
    position: absolute;
    top: 35%;
    right: 20%;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.025;
    animation: poolDrift2 25s ease-in-out infinite alternate;
}

.pool-violet-muted {
    width: 450px;
    height: 450px;
    background: var(--violet-haze);
    position: absolute;
    bottom: 20%;
    left: 45%;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.025;
    animation: poolDrift3 35s ease-in-out infinite alternate;
}

/* ========================================
   SVG FILTER STYLES
   ======================================== */

#svg-filters {
    position: absolute;
    width: 0;
    height: 0;
}

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

@media (max-width: 1024px) {
    #masonry-grid {
        columns: 2;
    }
}

@media (max-width: 640px) {
    #masonry-grid {
        columns: 1;
    }

    #knowledge-surface {
        padding: 0 16px 60px;
    }

    #command-bar {
        padding: 0 16px;
    }

    #main-title {
        letter-spacing: 0.06em;
    }

    .node-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    #cursor-spotlight {
        display: none;
    }
}

/* ========================================
   SELECTION STYLES
   ======================================== */

::selection {
    background: rgba(0, 255, 242, 0.2);
    color: var(--pale-circuit);
}
