/* ============================================================
   archetypos.dev - Styles
   Retro-futuristic glitch-art bento-box layout
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --void-black: #0A0A0F;
    --charcoal-static: #14141F;
    --circuit-trace: #1E1E2E;
    --rebel-red: #FF003C;
    --plasma-cyan: #00F0FF;
    --acid-green: #39FF14;
    --signal-magenta: #FF00FF;
    --static-white: #E8E8F0;
    --muted-fog: #8888AA;
    --elevated-bg: #1A1A2F;
    --grid-gap: 3px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void-black);
    color: var(--static-white);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
}

/* --- CRT Scan-Line Overlay --- */
#scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    transition: background 0.3s;
}

#scanline-overlay.intense {
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.25) 2px,
        rgba(0, 0, 0, 0.25) 4px
    );
}

/* --- Opening Scan Sweep --- */
#scan-sweep {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--rebel-red) 30%, var(--rebel-red) 70%, transparent 100%);
    box-shadow: 0 0 10px var(--rebel-red), 0 0 30px rgba(255, 0, 60, 0.5);
    z-index: 10000;
    animation: scanSweep 0.6s 0.4s ease-out forwards;
    opacity: 0;
    pointer-events: none;
}

@keyframes scanSweep {
    0% { top: 0; opacity: 1; }
    100% { top: 100vh; opacity: 0; }
}

/* --- Background Circuit Pattern --- */
#circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cpath d='M20 100 H60 V60 H100 V100 H140' stroke='%231E1E2E' stroke-width='1' fill='none'/%3E%3Cpath d='M100 20 V60 H140 V100' stroke='%231E1E2E' stroke-width='1' fill='none'/%3E%3Cpath d='M60 140 H100 V180' stroke='%231E1E2E' stroke-width='1' fill='none'/%3E%3Ccircle cx='60' cy='60' r='3' fill='%231E1E2E'/%3E%3Ccircle cx='100' cy='100' r='3' fill='%231E1E2E'/%3E%3Ccircle cx='140' cy='100' r='3' fill='%231E1E2E'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* --- Noise Overlay --- */
#noise-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    animation: noiseShift 0.08s steps(4) infinite;
}

@keyframes noiseShift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-5%, -5%); }
    50% { transform: translate(5%, 0); }
    75% { transform: translate(0, 5%); }
    100% { transform: translate(-5%, 5%); }
}

/* --- Section Base --- */
.section {
    position: relative;
    z-index: 1;
}

/* --- Bento Grid Base --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
    padding: var(--grid-gap);
    position: relative;
}

/* Grid gap glow effect via outline on cells */
.bento-cell {
    background: var(--charcoal-static);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 6px rgba(255, 0, 60, 0.15), 0 0 12px rgba(255, 0, 60, 0.05);
    opacity: 0;
    animation: cellReveal 0.3s ease-out forwards;
    animation-play-state: paused;
}

.bento-cell.revealed {
    animation-play-state: running;
}

@keyframes cellReveal {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

/* --- Corner Connectors (PCB style) --- */
.corner-connector {
    position: absolute;
    width: 12px;
    height: 12px;
    z-index: 2;
}

.corner-connector.tl { top: 0; left: 0; border-top: 2px solid var(--circuit-trace); border-left: 2px solid var(--circuit-trace); }
.corner-connector.tr { top: 0; right: 0; border-top: 2px solid var(--circuit-trace); border-right: 2px solid var(--circuit-trace); }
.corner-connector.bl { bottom: 0; left: 0; border-bottom: 2px solid var(--circuit-trace); border-left: 2px solid var(--circuit-trace); }
.corner-connector.br { bottom: 0; right: 0; border-bottom: 2px solid var(--circuit-trace); border-right: 2px solid var(--circuit-trace); }

.bento-cell:hover .corner-connector {
    border-color: var(--plasma-cyan);
    transition: border-color 0.3s;
}

/* --- Cell Labels --- */
.cell-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--muted-fog);
}

.cell-label.mono {
    color: var(--acid-green);
}

/* ============================================================
   SECTION 1: THE INTERCEPT
   ============================================================ */
#intercept {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.intercept-grid {
    grid-template-rows: 1fr 1fr 80px;
    min-height: 100vh;
    width: 100%;
}

/* Hero cell: 8 cols, 2 rows */
.cell-hero {
    grid-column: 1 / 9;
    grid-row: 1 / 3;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Data scroll cells */
.cell-data-1 {
    grid-column: 9 / 11;
    grid-row: 1 / 2;
    overflow: hidden;
    padding: 0.5rem;
}

.cell-data-2 {
    grid-column: 11 / 13;
    grid-row: 1 / 2;
    overflow: hidden;
    padding: 0.5rem;
}

/* Accent cells */
.cell-accent-1 {
    grid-column: 9 / 11;
    grid-row: 2 / 3;
}

.cell-accent-2 {
    grid-column: 11 / 13;
    grid-row: 2 / 3;
}

/* Tagline cell: full width bottom */
.cell-tagline {
    grid-column: 1 / 13;
    grid-row: 3 / 4;
    height: 80px;
    flex-direction: row;
    justify-content: center;
    gap: 0;
    padding: 0 2rem;
}

/* --- Chromatic Aberration Text --- */
.chromatic-text {
    position: relative;
    display: inline-block;
}

.chr-layer {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    user-select: none;
}

.chr-layer.chr-red {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--rebel-red);
    opacity: 0.6;
    mix-blend-mode: screen;
    animation: chrDriftRed 6s ease-in-out infinite;
}

.chr-layer.chr-cyan {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--plasma-cyan);
    opacity: 0.6;
    mix-blend-mode: screen;
    animation: chrDriftCyan 6s ease-in-out infinite;
}

.chr-layer.chr-white {
    position: relative;
    color: var(--static-white);
}

@keyframes chrDriftRed {
    0%, 100% { transform: translate(-1px, 1px); }
    25% { transform: translate(2px, -1px); }
    50% { transform: translate(-2px, -1px); }
    75% { transform: translate(1px, 2px); }
}

@keyframes chrDriftCyan {
    0%, 100% { transform: translate(1px, -1px); }
    25% { transform: translate(-2px, 1px); }
    50% { transform: translate(2px, 1px); }
    75% { transform: translate(-1px, -2px); }
}

/* --- Data Scroll --- */
.data-scroll {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--acid-green);
    opacity: 0.6;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
    animation: dataScrollUp 20s linear infinite;
    transform: translateY(0);
}

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

/* --- Typewriter --- */
.typewriter-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--static-white);
}

.cursor-blink {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--acid-green);
    animation: blink 1s step-end infinite;
}

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

/* --- Shake Error --- */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
}

.shake-error {
    animation: shake 0.15s ease-in-out;
}

/* ============================================================
   SECTION 2: THE ARCHIVE
   ============================================================ */
#archive {
    min-height: 200vh;
    padding: 4rem 0;
    position: relative;
}

.sticky-label {
    position: sticky;
    top: 1rem;
    left: 1rem;
    z-index: 10;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--acid-green);
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    pointer-events: none;
    width: fit-content;
}

.animated-ellipsis::after {
    content: '';
    animation: ellipsis 2s steps(3, end) infinite;
}

@keyframes ellipsis {
    0% { content: ''; }
    33% { content: '.'; }
    66% { content: '..'; }
    100% { content: '...'; }
}

.archive-grid {
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: var(--grid-gap);
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem var(--grid-gap);
}

/* Archetype cell sizes */
.cell-4x2 {
    grid-column: span 6;
    grid-row: span 1;
    min-height: 200px;
}

.cell-2x3 {
    grid-column: span 3;
    grid-row: span 2;
    min-height: 350px;
}

.cell-4x4 {
    grid-column: span 6;
    grid-row: span 2;
    min-height: 400px;
}

/* Archetype cell styling */
.archetype-cell {
    padding: 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    gap: 0.75rem;
}

.archetype-cell:hover {
    background: var(--elevated-bg);
}

.archetype-cell:hover .sigil-chromatic.chr-red {
    transform: translate(-6px, 2px);
}

.archetype-cell:hover .sigil-chromatic.chr-cyan {
    transform: translate(6px, -2px);
}

/* Entrance animations for archetype cells */
.archetype-cell {
    opacity: 0;
    transition: opacity 0.6s, transform 0.6s;
}

.archetype-cell[data-entrance="left"] {
    transform: translateX(-80px);
}

.archetype-cell[data-entrance="right"] {
    transform: translateX(80px);
}

.archetype-cell.in-view {
    opacity: 1;
    transform: translateX(0);
}

/* --- Archetype Sigils --- */
.archetype-sigil {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 0.5rem;
}

.sigil-shape {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.sigil-chromatic {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    mix-blend-mode: screen;
    transition: transform 0.3s;
}

.sigil-chromatic.chr-red {
    opacity: 0.6;
    transform: translate(-2px, 1px);
}

.sigil-chromatic.chr-cyan {
    opacity: 0.6;
    transform: translate(2px, -1px);
}

/* Sigil shapes using clip-path */
.sigil-hero .sigil-shape { background: var(--static-white); clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.sigil-hero .chr-red { background: var(--rebel-red); clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.sigil-hero .chr-cyan { background: var(--plasma-cyan); clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }

.sigil-shadow .sigil-shape { background: var(--static-white); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.sigil-shadow .chr-red { background: var(--rebel-red); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.sigil-shadow .chr-cyan { background: var(--plasma-cyan); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }

.sigil-trickster .sigil-shape { background: var(--static-white); clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }
.sigil-trickster .chr-red { background: var(--rebel-red); clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }
.sigil-trickster .chr-cyan { background: var(--plasma-cyan); clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }

.sigil-self .sigil-shape { background: var(--static-white); border-radius: 50%; width: 100%; height: 100%; clip-path: none; }
.sigil-self .chr-red { background: var(--rebel-red); border-radius: 50%; clip-path: none; }
.sigil-self .chr-cyan { background: var(--plasma-cyan); border-radius: 50%; clip-path: none; }

.sigil-anima .sigil-shape { background: var(--static-white); clip-path: polygon(50% 0%, 80% 30%, 100% 50%, 80% 80%, 50% 100%, 20% 80%, 0% 50%, 20% 30%); }
.sigil-anima .chr-red { background: var(--rebel-red); clip-path: polygon(50% 0%, 80% 30%, 100% 50%, 80% 80%, 50% 100%, 20% 80%, 0% 50%, 20% 30%); }
.sigil-anima .chr-cyan { background: var(--plasma-cyan); clip-path: polygon(50% 0%, 80% 30%, 100% 50%, 80% 80%, 50% 100%, 20% 80%, 0% 50%, 20% 30%); }

.sigil-sage .sigil-shape { background: var(--static-white); clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); }
.sigil-sage .chr-red { background: var(--rebel-red); clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); }
.sigil-sage .chr-cyan { background: var(--plasma-cyan); clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); }

.sigil-rebel .sigil-shape { background: var(--static-white); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); transform: rotate(45deg) scale(0.7); }
.sigil-rebel .chr-red { background: var(--rebel-red); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); transform: rotate(45deg) scale(0.7) translate(-2px, 1px); }
.sigil-rebel .chr-cyan { background: var(--plasma-cyan); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); transform: rotate(45deg) scale(0.7) translate(2px, -1px); }

.sigil-mother .sigil-shape { background: var(--static-white); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.sigil-mother .chr-red { background: var(--rebel-red); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.sigil-mother .chr-cyan { background: var(--plasma-cyan); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

/* Archetype name and description */
.archetype-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.4rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--static-white);
}

.archetype-desc {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--muted-fog);
    line-height: 1.5;
}

/* Scan line intensification on hover */
.archetype-cell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.12) 2px,
        rgba(0, 0, 0, 0.12) 4px
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.archetype-cell:hover::after {
    opacity: 1;
    animation: scanPulse 0.3s ease-in-out;
}

@keyframes scanPulse {
    0% { opacity: 0; }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; }
}

/* ============================================================
   SECTION 3: THE SIGNAL
   ============================================================ */
#signal {
    min-height: 150vh;
    padding: 4rem 0;
}

/* --- Marquee Band --- */
.marquee-band {
    width: 100%;
    overflow: hidden;
    padding: 1rem 0;
    border-top: 1px solid var(--circuit-trace);
    border-bottom: 1px solid var(--circuit-trace);
    position: relative;
    margin-bottom: 3rem;
}

.marquee-band::before,
.marquee-band::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}

.marquee-band::before {
    left: 0;
    background: linear-gradient(90deg, var(--void-black), transparent);
}

.marquee-band::after {
    right: 0;
    background: linear-gradient(-90deg, var(--void-black), transparent);
}

.marquee-track {
    display: flex;
    align-items: center;
    gap: 2rem;
    animation: marqueeScroll 30s linear infinite;
    width: max-content;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--muted-fog);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.marquee-item.circuit-svg {
    display: flex;
    align-items: center;
}

/* --- Signal Grid --- */
.signal-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem var(--grid-gap);
    gap: var(--grid-gap);
}

.signal-cell {
    padding: 2rem;
    text-align: left;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1.5rem;
    min-height: 350px;
}

.signal-cell[data-entrance="up"] {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.6s, transform 0.6s;
}

.signal-cell.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* --- Pull Quotes --- */
.pull-quote {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: var(--rebel-red);
    border-left: 4px solid var(--rebel-red);
    padding-left: 1rem;
    line-height: 1.3;
    position: relative;
}

.pull-quote.glitch-active {
    animation: quoteGlitch 0.15s steps(2) forwards;
}

@keyframes quoteGlitch {
    0% { transform: translateX(0); clip-path: inset(0 0 0 0); }
    25% { transform: translateX(4px); clip-path: inset(10% 0 80% 0); }
    50% { transform: translateX(-6px); clip-path: inset(40% 0 30% 0); }
    75% { transform: translateX(8px); clip-path: inset(70% 0 10% 0); }
    100% { transform: translateX(0); clip-path: inset(0 0 0 0); }
}

/* Pulsing border on pull-quote */
.pull-quote {
    border-image: linear-gradient(180deg, var(--rebel-red), var(--plasma-cyan)) 1;
    animation: borderPulse 8s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { border-image: linear-gradient(180deg, var(--rebel-red), var(--rebel-red)) 1; }
    33% { border-image: linear-gradient(180deg, var(--rebel-red), var(--plasma-cyan)) 1; }
    66% { border-image: linear-gradient(180deg, var(--plasma-cyan), var(--acid-green)) 1; }
}

.signal-body {
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--muted-fog);
    line-height: 1.65;
}

/* ============================================================
   SECTION 4: THE TERMINUS
   ============================================================ */
#terminus {
    min-height: 100vh;
    padding: 4rem 0;
    position: relative;
}

.terminus-grid {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(2, 200px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem var(--grid-gap);
    gap: var(--grid-gap);
}

.terminus-cell {
    padding: 1.5rem;
    transition: transform 1s, filter 1s;
}

.cell-drift-1 {
    grid-column: 1 / 7;
    grid-row: 1;
}

.cell-drift-2 {
    grid-column: 7 / 13;
    grid-row: 1;
}

.cell-drift-3 {
    grid-column: 1 / 5;
    grid-row: 2;
}

.cell-drift-4 {
    grid-column: 5 / 13;
    grid-row: 2;
}

/* Corruption overlay */
.corruption-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 3px,
        rgba(255, 0, 60, 0.03) 3px,
        rgba(255, 0, 60, 0.03) 6px
    );
    animation: corruptionFlicker 8s steps(3) infinite;
}

@keyframes corruptionFlicker {
    0%, 90%, 100% { opacity: 0.3; }
    92% { opacity: 0.8; }
    95% { opacity: 0.1; }
}

/* Terminus cell drift classes applied by JS */
.terminus-cell.drifting {
    filter: saturate(0.5);
}

/* --- Terminal Void --- */
.terminal-void {
    width: 100%;
    max-width: 800px;
    min-height: 300px;
    margin: 4rem auto;
    background: var(--void-black);
    border: 1px solid var(--circuit-trace);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.terminal-void::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
}

.terminal-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--acid-green);
    padding: 2rem;
}

.terminal-prompt {
    color: var(--acid-green);
}

.terminal-text {
    color: var(--acid-green);
}

.terminal-cursor {
    color: var(--acid-green);
}

/* ============================================================
   GLITCH BURST (applied randomly to elements)
   ============================================================ */
@keyframes glitchBurst {
    0% { clip-path: inset(0 0 0 0); transform: translateX(0); }
    10% { clip-path: inset(20% 0 60% 0); transform: translateX(-4px); }
    20% { clip-path: inset(60% 0 10% 0); transform: translateX(6px); }
    30% { clip-path: inset(40% 0 40% 0); transform: translateX(-2px); }
    40% { clip-path: inset(80% 0 5% 0); transform: translateX(4px); }
    50% { clip-path: inset(10% 0 70% 0); transform: translateX(-6px); }
    60% { clip-path: inset(0 0 0 0); transform: translateX(0); }
    100% { clip-path: inset(0 0 0 0); transform: translateX(0); }
}

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

/* ============================================================
   ANIMATED GRADIENT RULE (section dividers)
   ============================================================ */
.gradient-rule {
    width: 100%;
    height: 2px;
    border: none;
    background: linear-gradient(90deg, var(--rebel-red), var(--plasma-cyan), var(--acid-green), var(--rebel-red));
    background-size: 300% 100%;
    animation: gradientPulse 8s linear infinite;
}

@keyframes gradientPulse {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* ============================================================
   SECTION STATIC BURST (triggered on section entry)
   ============================================================ */
.static-burst {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9997;
    opacity: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 100px 100px;
}

.static-burst.active {
    animation: staticBurstAnim 0.2s ease-out forwards;
}

@keyframes staticBurstAnim {
    0% { opacity: 0.3; }
    100% { opacity: 0; }
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 768px) {
    .intercept-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto auto auto 80px;
    }

    .cell-hero {
        grid-column: 1;
        grid-row: 1;
    }

    .cell-data-1 {
        grid-column: 1;
        grid-row: 2;
        min-height: 60px;
    }

    .cell-data-2 {
        grid-column: 1;
        grid-row: 3;
        min-height: 60px;
    }

    .cell-accent-1, .cell-accent-2 {
        display: none;
    }

    .cell-tagline {
        grid-column: 1;
        grid-row: 5;
    }

    .chr-layer {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .archive-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .cell-4x2,
    .cell-4x4 {
        grid-column: span 6;
    }

    .cell-2x3 {
        grid-column: span 3;
        grid-row: span 1;
        min-height: 200px;
    }

    .signal-grid {
        grid-template-columns: 1fr;
    }

    .terminus-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .cell-drift-1,
    .cell-drift-2,
    .cell-drift-3,
    .cell-drift-4 {
        grid-column: 1;
        grid-row: auto;
    }
}
