@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
    --glass-bg: rgba(15, 35, 25, 0.85);
    --glass-border: rgba(124, 255, 0, 0.12);
    --accent-green: #7CFF00;
    --soft-green: #A3FF4D;
    --text-main: #E8F5E9;
    --bg-dark: #0A1612;
    --bg-card: #0F2319;
    --bg-darker: #050D0A;
    --text-secondary: #B0BEC5;
    --border-subtle: rgba(124, 255, 0, 0.08);
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: #0A1612;
    background: linear-gradient(135deg, #0A1612 0%, #050D0A 50%, #0E1E15 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    scroll-behavior: smooth;
    margin: 0;
}

/* Ensure all root elements maintain dark background */
html {
    background: #0A1612;
    font-size: 15px;
}

#main-content {
    position: relative;
    z-index: 1;
}

/* --- Focus Styles for Accessibility --- */
:focus-visible {
    outline: 3px solid var(--accent-green);
    outline-offset: 2px;
}

/* --- Skip Navigation --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-green);
    color: white;
    padding: 12px 24px;
    border-radius: 0 0 8px 8px;
    z-index: 200;
    font-weight: 700;
    text-decoration: none;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* --- Background Blobs --- */
.blob {
    position: fixed;
    z-index: -1;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.15;
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    .blob {
        animation: morph 20s ease-in-out infinite;
    }
}

@media (max-width: 768px) {
    .blob {
        filter: blur(60px);
        opacity: 0.25;
    }
}

@media (max-width: 640px) {
    .blob {
        filter: blur(50px);
        opacity: 0.2;
    }
}

@keyframes morph {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 40% 40% 60% 50%;
        transform: translate(0, 0) scale(1);
    }
    33% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
        transform: translate(30px, 60px) scale(1.05);
    }
    66% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 40%;
        transform: translate(-30px, 30px) scale(0.95);
    }
}

/* --- Grid Overlay --- */
.grid-overlay {
    background-image: radial-gradient(circle, rgba(124, 255, 0, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    .grid-overlay { background-size: 40px 40px; }
}

@media (max-width: 640px) {
    .grid-overlay { background-size: 50px 50px; opacity: 0.8; }
}

/* --- Hero Title --- */
.hero-title {
    background: linear-gradient(to right, #FFFFFF 0%, var(--accent-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Stats --- */
.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-green), var(--soft-green));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Atmospheric Hero Background --- */
.hero-background-container {
    position: relative;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

/* Base radial gradient - deep emerald to black */
.hero-background-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at top right,
        #1f5f3a 0%,
        #1a4a2f 25%,
        #0e3a20 50%,
        #0b2e1c 70%,
        #051008 90%,
        #000000 100%
    );
    z-index: 1;
    border-radius: inherit;
}

/* Dark overlay for text contrast */
.hero-background-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    mix-blend-mode: normal;
    z-index: 2;
    border-radius: inherit;
}

/* Image layer with green tint and blur */
.hero-background-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    filter: saturate(0.4) hue-rotate(100deg) blur(2px) brightness(0.9);
    mix-blend-mode: multiply;
    z-index: 1;
}

/* Noise texture overlay */
.hero-background-noise {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(124, 255, 0, 0.02) 2px,
        rgba(124, 255, 0, 0.02) 4px
    );
    opacity: 0.3;
    mix-blend-mode: overlay;
    z-index: 3;
    pointer-events: none;
}

/* Glow accent effect */
.hero-background-glow {
    position: absolute;
    bottom: 30%;
    right: 5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(124, 255, 0, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    z-index: 2;
    pointer-events: none;
}

/* Inner content positioning */
.hero-inner-content {
    position: relative;
    z-index: 4;
}

/* Full-width hero banner background layer */
.hero-banner-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        rgba(31, 95, 58, 0.3) 0%,
        rgba(14, 58, 32, 0.2) 40%,
        rgba(10, 22, 18, 0.1) 70%,
        transparent 100%
    );
}

/* Hero banner header - enable full-width background */
.hero-banner {
    position: relative;
    overflow: hidden;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

/* --- Matrix Code Effect --- */
.hero-matrix-code {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

.hero-matrix-code::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            rgba(124, 255, 0, 0.04) 0px,
            rgba(124, 255, 0, 0.04) 1px,
            transparent 1px,
            transparent 3px
        );
    animation: matrix-scroll 15s linear infinite;
    z-index: 1;
}

.hero-matrix-code::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 15% 30%, rgba(124, 255, 0, 0.12) 0%, transparent 25%),
        radial-gradient(circle at 85% 70%, rgba(124, 255, 0, 0.1) 0%, transparent 30%);
    z-index: 1;
}

/* Matrix code characters overlay */
.matrix-chars {
    position: absolute;
    inset: 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: rgba(124, 255, 0, 0.15);
    line-height: 1.5;
    white-space: pre;
    overflow: hidden;
    z-index: 3;
    opacity: 0.5;
}

.matrix-char-column {
    position: absolute;
    font-family: 'Space Grotesk', 'Courier New', monospace;
    font-weight: 700;
    white-space: pre;
    letter-spacing: 1px;
    line-height: 1.8;
    color: rgba(124, 255, 0, 0.4);
    text-shadow: 0 0 8px rgba(124, 255, 0, 0.3);
    animation: matrix-fall linear infinite;
    z-index: 2;
    font-size: 11px;
    opacity: 0.4;
    text-align: center;
}

@keyframes matrix-scroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(15px);
    }
}

@keyframes matrix-fall {
    0% {
        transform: translateY(-200px);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
    }
    95% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(600px);
        opacity: 0;
    }
}

/* Pixel grid effect */
.hero-pixel-grid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, rgba(124, 255, 0, 0.1) 0.5px, transparent 0.5px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    animation: pixel-flicker 0.2s infinite;
    z-index: 2;
    opacity: 0.25;
    pointer-events: none;
}

/* Full-width background glow effect */
.hero-banner-background .hero-background-glow {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(124, 255, 0, 0.1) 0%, transparent 70%);
    filter: blur(60px);
    z-index: 1;
    pointer-events: none;
}

/* Local glow for right side image container */
.hero-background-glow-local {
    position: absolute;
    bottom: 30%;
    right: 5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(124, 255, 0, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    z-index: 2;
    pointer-events: none;
}

@keyframes pixel-flicker {
    0%, 100% {
        opacity: 0.25;
    }
    50% {
        opacity: 0.15;
    }
}

/* --- Section Gradients --- */
.section-gradient-1 {
    background: linear-gradient(135deg, rgba(124, 255, 0, 0.02) 0%, rgba(5, 13, 10, 0.9) 100%);
    position: relative;
}

.section-gradient-1::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(124, 255, 0, 0.05), transparent 60%);
    pointer-events: none;
}

.section-gradient-2 {
    background: linear-gradient(135deg, rgba(5, 13, 10, 0.8) 0%, rgba(124, 255, 0, 0.02) 100%);
}

.section-gradient-3 {
    background: linear-gradient(135deg, rgba(124, 255, 0, 0.03) 0%, rgba(10, 22, 18, 0.7) 100%);
}

/* --- Responsive Hero Background --- */
@media (max-width: 768px) {
    .hero-banner-background .hero-background-glow {
        width: 300px;
        height: 300px;
        bottom: 25%;
    }
    
    .hero-background-glow-local {
        width: 200px;
        height: 200px;
        bottom: 25%;
        right: 10%;
    }
    
    .hero-background-image {
        filter: saturate(0.3) hue-rotate(100deg) blur(1px) brightness(0.85);
    }
    
    .matrix-char-column {
        font-size: 10px;
        letter-spacing: 0.5px;
        line-height: 1.6;
    }
    
    .hero-matrix-code {
        opacity: 0.35;
    }
}

@media (max-width: 640px) {
    .hero-banner-background .hero-background-glow {
        width: 200px;
        height: 200px;
        bottom: 20%;
        opacity: 0.8;
    }
    
    .hero-background-glow-local {
        width: 150px;
        height: 150px;
        bottom: 20%;
        right: 15%;
        opacity: 0.8;
    }
    
    .hero-background-container::after {
        background: rgba(0, 0, 0, 0.7);
    }
    
    .matrix-char-column {
        font-size: 9px;
        letter-spacing: 0px;
        line-height: 1.5;
    }
    
    .hero-pixel-grid {
        background-size: 15px 15px;
        opacity: 0.15;
    }
}

/* --- Chart Bars --- */
.chart-bar {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 150px;
    margin: 20px 0;
}

.bar-item {
    flex: 1;
    background: linear-gradient(180deg, var(--accent-green), var(--soft-green));
    border-radius: 6px 6px 0 0;
    position: relative;
    min-height: 20px;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.bar-item:hover {
    filter: brightness(1.1);
}

@media (prefers-reduced-motion: no-preference) {
    .bar-item:hover {
        transform: translateY(-5px);
    }
}

.bar-label {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-secondary);
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-weight: bold;
    color: var(--accent-green);
    font-size: 14px;
}

/* --- Divider --- */
.divider-gradient {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
    margin: 2rem 0;
}

/* --- Timeline --- */
.timeline-item {
    position: relative;
    padding-left: 40px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 24px;
    height: 24px;
    background: var(--accent-green);
    border-radius: 50%;
    border: 3px solid var(--bg-dark);
    box-shadow: 0 0 0 3px var(--accent-green), 0 0 20px rgba(124, 255, 0, 0.4);
}

/* --- Intersection Observer Animation --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
