/* ============================================
   DDAZZL.com - Glitch Broadcast Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --void-black: #0a0a0a;
    --deep-charcoal: #111116;
    --electric-magenta: #ff00ff;
    --cyan-voltage: #00ffee;
    --neon-lime: #39ff14;
    --signal-red: #ff003c;
    --phosphor-white: #e0e0e0;
    --hot-white: #ffffff;
    --dim-circuit: #1a1a2e;
    --ghost-gray: rgba(255, 255, 255, 0.04);

    --font-display: 'Share Tech Mono', monospace;
    --font-body: 'Space Grotesk', sans-serif;
    --font-code: 'Fira Code', monospace;
}

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

html {
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
    scroll-behavior: auto;
}

body {
    background: var(--void-black);
    color: var(--phosphor-white);
    font-family: var(--font-body);
    font-weight: 300;
    overflow-x: hidden;
    cursor: crosshair;
}

/* --- Scanline Overlay (on body) --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 2px,
        rgba(255, 255, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: 9998;
}

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

@keyframes noiseShift {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-10px, 5px); }
    40% { transform: translate(5px, -10px); }
    60% { transform: translate(-5px, 10px); }
    80% { transform: translate(10px, -5px); }
    100% { transform: translate(0, 0); }
}

/* --- Scanline Sweep --- */
#scanline-sweep {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
    z-index: 9999;
    animation: scanSweep 8s linear infinite;
}

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

/* --- Static Burst (channel switch) --- */
#static-burst {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    opacity: 0;
    pointer-events: none;
    z-index: 10000;
    transition: none;
}

#static-burst.active {
    animation: staticBurst 80ms steps(3) forwards;
}

@keyframes staticBurst {
    0% { opacity: 0.3; background-position: 0 0; }
    33% { opacity: 0.25; background-position: -50px 30px; }
    66% { opacity: 0.2; background-position: 30px -40px; }
    100% { opacity: 0; background-position: 0 0; }
}

/* --- Cursor Trail --- */
#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9996;
}

.trail-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--electric-magenta);
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 0.2s ease-out;
}

.trail-dot.fading {
    opacity: 0;
}

/* --- Click Burst --- */
#click-burst {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9996;
}

.burst-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--electric-magenta);
    pointer-events: none;
    opacity: 1;
}

/* --- Navigation --- */
#nav-trigger {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10001;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.signal-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bar {
    display: block;
    height: 2px;
    background: var(--phosphor-white);
    transition: all 0.15s;
}

.bar-1 { width: 18px; }
.bar-2 { width: 14px; }
.bar-3 { width: 10px; }

#nav-trigger:hover .bar {
    background: var(--electric-magenta);
    box-shadow: 0 0 8px var(--electric-magenta);
}

#nav-trigger:hover .bar-1 { width: 22px; }
#nav-trigger:hover .bar-2 { width: 18px; }
#nav-trigger:hover .bar-3 { width: 14px; }

.nav-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--phosphor-white);
}

/* Nav overlay */
#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 10, 0.97);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

#nav-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.nav-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--cyan-voltage);
    opacity: 0;
    transition: none;
}

#nav-overlay.open .nav-scan-line {
    animation: navScan 0.6s ease-out forwards;
}

@keyframes navScan {
    0% { top: 0; opacity: 0.8; }
    100% { top: 100%; opacity: 0; }
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nav-link {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--phosphor-white);
    text-decoration: none;
    transition: color 0.1s, text-shadow 0.1s;
    position: relative;
}

.nav-link:hover {
    color: var(--electric-magenta);
    text-shadow:
        2px 0 var(--cyan-voltage),
        -2px 0 var(--signal-red);
}

/* --- Channel / Section Base --- */
.channel {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    overflow: hidden;
    scroll-snap-align: start;
    background: var(--void-black);
}

.channel:nth-child(even) {
    background: var(--deep-charcoal);
}

/* --- Circuit Background SVG --- */
.circuit-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.circuit-trace {
    fill: none;
    stroke: var(--dim-circuit);
    stroke-width: 1;
    transition: stroke 0.3s, filter 0.3s;
}

.circuit-trace.illuminated {
    stroke: var(--cyan-voltage);
    filter: drop-shadow(0 0 6px var(--cyan-voltage));
    animation: tracePulse 1s ease-in-out;
}

@keyframes tracePulse {
    0% { stroke-dashoffset: 200; stroke-dasharray: 200; }
    100% { stroke-dashoffset: 0; stroke-dasharray: 200; }
}

.circuit-node {
    fill: var(--dim-circuit);
    transition: fill 0.3s, filter 0.3s;
}

.circuit-node.illuminated {
    fill: var(--cyan-voltage);
    filter: drop-shadow(0 0 8px var(--cyan-voltage));
}

/* --- Glitch Stripes --- */
.glitch-stripes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.glitch-stripe {
    position: absolute;
    height: 3px;
    background: var(--electric-magenta);
    animation: stripeShift 3s ease-in-out infinite alternate;
}

.glitch-stripe.accent-cyan {
    background: var(--cyan-voltage);
    animation-duration: 4s;
    animation-delay: -1s;
}

.glitch-stripe.accent-lime {
    background: var(--neon-lime);
    animation-duration: 3.5s;
    animation-delay: -0.5s;
}

.glitch-stripe.accent-red {
    background: var(--signal-red);
    animation-duration: 2.8s;
    animation-delay: -1.5s;
}

@keyframes stripeShift {
    0% { transform: translateX(0); }
    25% { transform: translateX(12px); }
    50% { transform: translateX(-8px); }
    75% { transform: translateX(20px); }
    100% { transform: translateX(-4px); }
}

/* --- Binary Streams --- */
.binary-stream {
    position: absolute;
    top: 0;
    font-family: var(--font-display);
    font-size: 10px;
    color: var(--phosphor-white);
    opacity: 0.06;
    writing-mode: vertical-lr;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
    animation: binaryScroll 20s linear infinite;
    line-height: 1;
}

.stream-1 { left: 5%; animation-duration: 18s; }
.stream-2 { left: 60%; animation-duration: 25s; }
.stream-3 { left: 88%; animation-duration: 22s; }

@keyframes binaryScroll {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* --- Section Content --- */
.section-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px;
    text-align: center;
}

/* --- Typography: Display / Headings --- */
.scramble-text {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--phosphor-white);
    text-shadow:
        1px 0 var(--electric-magenta),
        -1px 0 var(--cyan-voltage),
        0 1px var(--neon-lime);
    transition: text-shadow 0.15s;
}

.scramble-text:hover {
    text-shadow:
        4px 2px var(--electric-magenta),
        -4px -1px var(--cyan-voltage),
        2px -3px var(--neon-lime);
}

.hero-title {
    font-size: clamp(5rem, 15vw, 12rem);
    line-height: 0.9;
    background: linear-gradient(135deg, var(--electric-magenta), var(--cyan-voltage));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(255, 0, 255, 0.3));
}

.hero-title:hover {
    filter: drop-shadow(0 0 60px rgba(255, 0, 255, 0.5));
}

.section-heading {
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.1;
    margin-bottom: 30px;
}

.mega-text {
    font-size: clamp(6rem, 20vw, 14rem);
    line-height: 0.85;
    margin-bottom: 30px;
}

/* --- Body Text --- */
.body-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.7;
    max-width: 700px;
    color: var(--phosphor-white);
    text-shadow: 0 0 10px rgba(224, 224, 224, 0.1);
}

/* --- Typewriter Text --- */
.typewriter-text {
    opacity: 0;
}

.typewriter-text.visible {
    opacity: 1;
}

/* --- Signal Status --- */
.signal-status {
    font-family: var(--font-code);
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    letter-spacing: 0.1em;
    color: var(--neon-lime);
    margin-top: 30px;
    text-shadow: 0 0 12px rgba(57, 255, 20, 0.5);
}

/* --- Signal Line (hero section) --- */
.signal-line {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 2px;
    background: var(--electric-magenta);
    box-shadow: 0 0 20px var(--electric-magenta), 0 0 40px var(--electric-magenta);
    z-index: 4;
    animation: signalExpand 1.5s ease-out 0.5s forwards;
}

@keyframes signalExpand {
    0% { width: 0; }
    100% { width: 80vw; opacity: 0.3; }
}

/* --- Channel Indicator --- */
.channel-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-code);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--cyan-voltage);
    margin-bottom: 20px;
    text-shadow: 0 0 8px rgba(0, 255, 238, 0.4);
}

.ch-separator {
    color: var(--dim-circuit);
}

.ch-name {
    color: var(--phosphor-white);
    opacity: 0.6;
}

/* --- Data Readout --- */
.data-readout {
    display: flex;
    gap: 30px;
    margin-top: 40px;
    font-family: var(--font-code);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.readout-item {
    display: flex;
    gap: 6px;
}

.readout-label {
    color: var(--cyan-voltage);
    opacity: 0.7;
}

.readout-value {
    color: var(--neon-lime);
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
}

/* --- Amplify Grid --- */
.amplify-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 50px;
    max-width: 1000px;
    width: 100%;
}

.amp-block {
    text-align: left;
    padding: 24px;
    border-left: 2px solid var(--dim-circuit);
    transition: border-color 0.3s;
}

.amp-block:hover {
    border-color: var(--electric-magenta);
}

.amp-number {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--cyan-voltage);
    opacity: 0.6;
    display: block;
    margin-bottom: 8px;
}

.amp-label {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--phosphor-white);
    display: block;
    margin-bottom: 12px;
    text-shadow:
        1px 0 var(--electric-magenta),
        -1px 0 var(--cyan-voltage);
}

.amp-desc {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--phosphor-white);
    opacity: 0.8;
}

/* --- Broadcast Pulse --- */
.broadcast-pulse {
    width: 120px;
    height: 120px;
    border: 2px solid var(--electric-magenta);
    border-radius: 50%;
    margin-top: 40px;
    animation: pulse 2s ease-in-out infinite;
    position: relative;
}

.broadcast-pulse::before,
.broadcast-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid var(--electric-magenta);
    border-radius: 50%;
    animation: pulseRing 2s ease-out infinite;
}

.broadcast-pulse::before {
    width: 160px;
    height: 160px;
    animation-delay: 0.3s;
}

.broadcast-pulse::after {
    width: 200px;
    height: 200px;
    animation-delay: 0.6s;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 255, 0.3); }
    50% { box-shadow: 0 0 60px rgba(255, 0, 255, 0.6), 0 0 100px rgba(255, 0, 255, 0.2); }
}

@keyframes pulseRing {
    0% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

.broadcast-sub {
    font-family: var(--font-code);
    font-size: clamp(0.75rem, 1.1vw, 0.9rem);
    letter-spacing: 0.12em;
    color: var(--neon-lime);
    margin-top: 20px;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

/* --- Terminus --- */
.terminus-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    font-family: var(--font-code);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

.terminus-label {
    color: var(--electric-magenta);
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
}

.terminus-separator {
    color: var(--dim-circuit);
}

.terminus-status {
    color: var(--neon-lime);
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
    animation: statusBlink 2s step-end infinite;
}

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

/* --- Grid Drift Animation --- */
@keyframes gridDrift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, -1px); }
    50% { transform: translate(-1px, 2px); }
    75% { transform: translate(1px, -2px); }
    100% { transform: translate(0, 0); }
}

.channel:nth-child(3n+1) .section-content {
    animation: gridDrift 8s ease-in-out infinite;
}

.channel:nth-child(3n+2) .section-content {
    animation: gridDrift 10s ease-in-out infinite reverse;
}

.channel:nth-child(3n) .section-content {
    animation: gridDrift 12s ease-in-out infinite 2s;
}

/* --- RGB Chromatic Aberration (intensified during scroll) --- */
body.scrolling .scramble-text {
    text-shadow:
        5px 2px var(--electric-magenta),
        -5px -2px var(--cyan-voltage),
        2px -4px var(--neon-lime) !important;
}

/* --- Screen Shake on Nav Hover --- */
body.screen-shake {
    animation: screenShake 0.15s ease-in-out;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .amplify-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .data-readout {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .nav-link {
        font-size: 1.3rem;
    }

    .hero-title {
        font-size: clamp(3rem, 12vw, 8rem);
    }

    .section-heading {
        font-size: clamp(2rem, 5vw, 3.5rem);
    }

    .mega-text {
        font-size: clamp(4rem, 15vw, 10rem);
    }

    .section-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .terminus-info {
        flex-direction: column;
        gap: 8px;
    }

    .terminus-separator {
        display: none;
    }
}
