/* ============================================
   monopoleai.com - Anti-Design Immersive Scroll
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --electric-violet: #7B2FFF;
    --molten-amber: #FF8C2F;
    --signal-cyan: #00F0FF;
    --void-black: #08080A;
    --charcoal-ash: #2A2A2F;
    --raw-white: #F0EDE4;
    --corruption-red: #FF2040;
    --cyan-haze: rgba(0, 240, 255, 0.15);

    --zone-hue: 270;
    --zone-saturation: 100%;
    --scroll-progress: 0;
}

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

html {
    scroll-behavior: auto;
    overflow-x: hidden;
}

body {
    background: var(--void-black);
    color: var(--raw-white);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
    cursor: default;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Zone Base --- */
.zone {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.zone-1 { height: 100vh; }
.zone-2 { height: 150vh; }
.zone-3 { height: 150vh; }
.zone-4 { height: 150vh; }
.zone-5 { height: 100vh; }

/* --- Scanlines Overlay --- */
.zone-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.zone-scanlines::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 240, 255, 0.03) 2px,
        rgba(0, 240, 255, 0.03) 4px
    );
    pointer-events: none;
}

/* ============================================
   ZONE 1: SIGNAL ACQUISITION
   ============================================ */
.zone-1 {
    background: var(--void-black);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

/* Crosshair */
.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 40px;
    color: var(--raw-white);
    opacity: 0;
    z-index: 10;
    animation: crosshairFadeIn 300ms 600ms steps(1) forwards,
               crosshairRotate 200s 1200ms linear infinite;
}

@keyframes crosshairFadeIn {
    to { opacity: 1; }
}

@keyframes crosshairRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Hero Text */
.hero-text {
    position: absolute;
    bottom: 12vh;
    left: 0;
    overflow: hidden;
    width: 100vw;
    z-index: 5;
}

.hero-text-inner {
    display: inline-block;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(8rem, 22vw, 18rem);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--electric-violet);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-120vw);
    animation: heroSlam 200ms 1500ms steps(4) forwards,
               heroSettle 100ms 1700ms steps(2) forwards;
    position: relative;
}

/* Channel shift glitch effect on hero text */
.hero-text-inner::before,
.hero-text-inner::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-text-inner::before {
    color: var(--molten-amber);
    clip-path: inset(0 0 60% 0);
    transform: translate(3px, 0);
    opacity: 0.7;
}

.hero-text-inner::after {
    color: var(--signal-cyan);
    clip-path: inset(60% 0 0 0);
    transform: translate(-3px, 0);
    opacity: 0.7;
}

@keyframes heroSlam {
    from {
        opacity: 1;
        transform: translateX(-120vw);
    }
    to {
        opacity: 1;
        transform: translateX(8px);
    }
}

@keyframes heroSettle {
    from {
        transform: translateX(8px);
    }
    to {
        transform: translateX(0);
    }
}

/* Primary Counter */
.counter-primary {
    position: absolute;
    bottom: 4vh;
    left: 2vw;
    z-index: 5;
    opacity: 0;
    animation: counterFadeIn 300ms 2000ms steps(1) forwards;
}

@keyframes counterFadeIn {
    to { opacity: 1; }
}

.counter-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.6rem, 1vw, 0.8rem);
    color: var(--signal-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
    letter-spacing: 0.2em;
    margin-bottom: 0.3em;
}

.odometer {
    display: flex;
    align-items: baseline;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--signal-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.odometer-small {
    font-size: clamp(1.2rem, 2.5vw, 2rem);
}

.digit-col {
    display: inline-block;
    overflow: hidden;
    height: 1.2em;
    width: 0.65em;
    position: relative;
}

.digit-roll {
    display: block;
    transition: transform 0.4s steps(1);
}

.digit-separator {
    font-family: 'Share Tech Mono', monospace;
    color: var(--signal-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
    opacity: 0.7;
}

.digit-exponent {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.5em;
    color: var(--signal-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
    vertical-align: super;
}

/* ============================================
   ZONE 2: FIELD DISTORTION
   ============================================ */
.zone-2 {
    background: var(--void-black);
    position: relative;
}

.broken-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 0.5fr 1.5fr 1fr;
    gap: 0;
    width: 100%;
    height: 100%;
    padding: 8vh 2vw;
    position: relative;
}

.grid-block {
    padding: 2rem;
    position: relative;
    transition: transform 0.1s linear;
}

.block-1 {
    grid-column: 2 / 5;
    grid-row: 1;
    transform: rotate(-3deg);
    align-self: start;
    margin-top: 5vh;
}

.block-2 {
    grid-column: 1 / 2;
    grid-row: 2;
    transform: rotate(5deg);
    align-self: start;
    margin-top: 8vh;
}

.block-3 {
    grid-column: 4 / 6;
    grid-row: 2;
    transform: rotate(7deg);
    align-self: center;
}

.block-4 {
    grid-column: 2 / 4;
    grid-row: 3;
    transform: rotate(-2deg);
    align-self: start;
    margin-top: 5vh;
}

.block-5 {
    grid-column: 1 / 3;
    grid-row: 4;
    transform: rotate(4deg);
    align-self: start;
    margin-top: 3vh;
}

.zone-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--signal-cyan);
    line-height: 1;
    margin-bottom: 1rem;
    position: relative;
}

/* Channel shift on headings */
.zone-heading::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 2px;
    color: var(--molten-amber);
    opacity: 0.5;
    pointer-events: none;
}

.zone-subheading {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--electric-violet);
    line-height: 1.1;
    margin-bottom: 0.8rem;
}

.body-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    line-height: 1.85;
    color: var(--signal-cyan);
    max-width: 38ch;
}

.body-text-small {
    font-size: 14px;
}

.counter-inline {
    background: var(--cyan-haze);
    padding: 1.5rem;
    border-left: 2px solid var(--signal-cyan);
}

/* ============================================
   ZONE 3: CELESTIAL MAPPING
   ============================================ */
.zone-3 {
    background: var(--void-black);
    position: relative;
}

.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.constellation-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0.8;
}

.constellation-line {
    animation: lineFlicker 4s steps(2) infinite;
}

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

.star-data {
    position: absolute;
    z-index: 10;
    padding: 1rem 1.2rem;
    border: 1px solid var(--signal-cyan);
    background: rgba(8, 8, 10, 0.85);
    animation: telemetryPulse 3s steps(4) infinite;
    transform: translate(-50%, -50%);
}

@keyframes telemetryPulse {
    0%, 100% {
        border-color: var(--signal-cyan);
        box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
    }
    50% {
        border-color: var(--electric-violet);
        box-shadow: 0 0 20px rgba(123, 47, 255, 0.3);
    }
}

.data-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.6rem, 1vw, 0.8rem);
    color: var(--molten-amber);
    letter-spacing: 0.15em;
    margin-bottom: 0.4em;
}

.data-value {
    display: flex;
    align-items: baseline;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    color: var(--signal-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.data-value .digit-col {
    height: 1.2em;
    width: 0.65em;
}

.data-value .digit-separator {
    font-size: inherit;
}

/* ============================================
   ZONE 4: DATA CORRUPTION
   ============================================ */
.zone-4 {
    background: var(--void-black);
    position: relative;
}

.corruption-layer {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 10vh 5vw;
}

.corrupt-block {
    position: absolute;
    padding: 2rem;
}

.cb-1 {
    top: 8%;
    left: 10%;
    width: 70%;
}

.cb-2 {
    top: 18%;
    left: 25%;
    width: 50%;
    mix-blend-mode: difference;
    background: var(--charcoal-ash);
}

.cb-3 {
    top: 30%;
    left: 5%;
    width: 60%;
}

.corrupt-display {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: 120px;
    color: var(--corruption-red);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.9;
    position: relative;
}

.corrupt-display::before {
    content: '10^34';
    position: absolute;
    top: 3px;
    left: 3px;
    color: var(--signal-cyan);
    opacity: 0.4;
}

.cb-4 {
    top: 45%;
    left: 40%;
    width: 55%;
    clip-path: polygon(0% 0%, 100% 0%, 100% 35%, 72% 35%, 72% 55%, 100% 55%, 100% 100%, 0% 100%, 0% 60%, 28% 60%, 28% 40%, 0% 40%);
    background: rgba(42, 42, 47, 0.6);
}

.cb-5 {
    top: 55%;
    left: 8%;
    width: 40%;
}

.cb-6 {
    top: 70%;
    left: 30%;
    width: 50%;
    mix-blend-mode: difference;
}

.cb-6 .body-text {
    color: var(--corruption-red);
    font-weight: 500;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    max-width: 50ch;
}

.cb-7 {
    top: 80%;
    left: 15%;
    width: 35%;
    border-left: 2px solid var(--corruption-red);
    padding-left: 1.5rem;
}

.cb-7 .zone-subheading {
    color: var(--corruption-red);
}

.corrupt-heading {
    color: var(--corruption-red);
    position: relative;
}

.corrupt-heading::after {
    content: 'DATA CORRUPTION';
    position: absolute;
    top: 4px;
    left: -4px;
    color: var(--signal-cyan);
    opacity: 0.4;
    z-index: -1;
}

/* ============================================
   ZONE 5: SINGULARITY
   ============================================ */
.zone-5 {
    background: var(--void-black);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s linear;
}

.singularity-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.convergence-element {
    position: absolute;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--raw-white);
    opacity: 0.7;
    transition: transform 1s ease-in, opacity 0.5s linear;
}

.conv-1 { top: 10%; left: 5%; }
.conv-2 { top: 15%; right: 10%; }
.conv-3 { bottom: 20%; left: 8%; }
.conv-4 { bottom: 10%; right: 5%; }
.conv-5 { top: 50%; left: 3%; }

.convergence-element.converged {
    transform: translate(var(--conv-x), var(--conv-y)) scale(0.2);
    opacity: 0;
}

/* Six-pointed star */
.singularity-star {
    position: relative;
    width: 80px;
    height: 80px;
    z-index: 20;
    animation: starPulse 2s steps(4) infinite;
}

@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px var(--electric-violet));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 40px var(--electric-violet)) drop-shadow(0 0 60px var(--molten-amber));
    }
}

.star-triangle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.star-tri-1 {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    background: var(--electric-violet);
}

.star-tri-2 {
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
    background: var(--electric-violet);
    opacity: 0.85;
}

.counter-final {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.odometer-final {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--raw-white);
    text-shadow: 0 0 8px rgba(240, 237, 228, 0.6);
}

.odometer-final .digit-separator {
    color: var(--raw-white);
    text-shadow: 0 0 8px rgba(240, 237, 228, 0.6);
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */
.section-divider {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s steps(2);
}

.divider-star {
    display: inline-block;
    width: 12px;
    height: 12px;
    position: relative;
}

.divider-star::before,
.divider-star::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.divider-star::before {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    background: var(--molten-amber);
}

.divider-star::after {
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
    background: var(--molten-amber);
    opacity: 0.85;
}

/* ============================================
   RESPONSIVE: ANTI-STRATEGY (below 768px)
   ============================================ */
@media (max-width: 768px) {
    .hero-text-inner {
        font-size: clamp(10rem, 35vw, 22rem);
    }

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

    .block-1 {
        grid-column: 1 / 3;
        transform: rotate(-5deg);
    }

    .block-2 {
        grid-column: 1;
        transform: rotate(8deg);
    }

    .block-3 {
        grid-column: 2;
        transform: rotate(12deg);
    }

    .block-4 {
        grid-column: 1 / 3;
        transform: rotate(-4deg);
    }

    .block-5 {
        grid-column: 1 / 3;
        transform: rotate(10deg);
    }

    .star-data {
        padding: 0.6rem 0.8rem;
    }

    .corrupt-display {
        font-size: 60px;
    }

    .counter-label {
        font-size: 0.55rem;
    }
}

/* ============================================
   NOISE FILTER OVERLAY
   ============================================ */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    filter: url(#noise-filter);
    opacity: 0.06;
    mix-blend-mode: overlay;
}

/* ============================================
   GLITCH CHANNEL SHIFT ANIMATION
   ============================================ */
.glitch-shift {
    position: relative;
}

.glitch-shift::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: 2px 0 var(--molten-amber), -2px 0 var(--signal-cyan);
    opacity: 0;
    animation: channelShift 8s steps(2) infinite;
    pointer-events: none;
}

@keyframes channelShift {
    0%, 85%, 100% { opacity: 0; }
    87% { opacity: 0.6; transform: translateX(2px); }
    89% { opacity: 0; }
    91% { opacity: 0.4; transform: translateX(-3px); }
    93% { opacity: 0; }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 4px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--electric-violet);
}
