/* ============================================
   GLOBAL DESIGN SYSTEM — DynamicATR Grid
   Unified CSS for all 4 pages
   ============================================ */

/* ============================================
   VARIABLES & TOKENS
   ============================================ */
:root {
    /* Backgrounds */
    --bg: #050509;
    --bg-elevated: #0a0a14;
    --bg-glass: rgba(16, 16, 36, 0.85);

    /* Text */
    --text: #eeeef5;
    --text2: #b0b0c8;
    --muted: #707090;

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    /* Accent colors */
    --indigo: #6366f1;
    --indigo-secondary: #818cf8;
    --indigo-glow: rgba(99, 102, 241, 0.3);
    --purple: #a855f7;
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.3);
    --red: #f43f5e;
    --red-glow: rgba(244, 63, 94, 0.3);
    --orange: #f59e0b;
    --cyan: #06b6d4;

    /* Gradients */
    --gradient-main: linear-gradient(135deg, var(--indigo), var(--purple), var(--cyan));
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    --gradient-green: linear-gradient(135deg, #10b981, #34d399);
    --gradient-warm: linear-gradient(135deg, #f59e0b, #f97316);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--indigo-glow);

    /* Radius */
    --radius: 16px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 50px;

    /* Typography */
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', monospace;

    /* Transitions */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--indigo) var(--bg-elevated);
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-elevated); }
::-webkit-scrollbar-thumb { background: var(--indigo); border-radius: 4px; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
}

h1 {
    font-weight: 900;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    letter-spacing: -0.03em;
}

h2 {
    font-weight: 800;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    margin-bottom: 0.75rem;
}

p {
    color: var(--text2);
    font-size: 0.95rem;
    line-height: 1.7;
}

a {
    color: var(--indigo-secondary);
    text-decoration: none;
    transition: var(--transition);
}

strong {
    color: var(--text);
    font-weight: 600;
}

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-danger { color: var(--red); font-weight: 700; }

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.section {
    padding: 8rem 0;
    position: relative;
    overflow: hidden;
}

.section-dark {
    background: var(--bg-elevated);
}

.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 4rem;
    gap: 0.75rem;
}

.section-header h2 {
    position: relative;
    display: inline-block;
    margin: 0;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.section-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--indigo);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.3rem 1rem;
    border-radius: var(--radius-pill);
}

.section-desc {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.6rem 1.6rem;
    background: rgba(5, 5, 9, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.navbar.scrolled {
    background: rgba(5, 5, 9, 0.85);
    backdrop-filter: blur(20px);
}

.navbar.hidden {
    transform: translateX(-50%) translateY(-120%);
    opacity: 0;
    pointer-events: none;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    color: var(--text);
}

.logo-icon {
    font-size: 1.1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.nav-links a {
    color: var(--text2);
    font-size: 0.78rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.2rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    width: auto;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
    opacity: 0;
    transition: var(--transition);
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { opacity: 1; }

.nav-links a.nav-page-active { color: var(--text); }
.nav-links a.nav-page-active::after { opacity: 1; }

.mobile-menu a.nav-page-active { color: var(--indigo-secondary); }

/* Page entrance transition */
body.page-enter {
    opacity: 0;
    transform: translateY(6px);
}

body.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
}

.nav-hamburger span {
    width: 18px;
    height: 1.5px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 9, 0.98);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.mobile-menu.active { display: flex; }

.mobile-menu a {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 600;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    padding-top: 10rem;
    padding-bottom: 2rem;
}

.hero-content {
    text-align: center;
    z-index: 2;
    padding: 0 2rem;
}

.hero-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--indigo-secondary);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-pill);
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text2);
    max-width: 600px;
    margin: 0 auto 3rem;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--mono);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1.05rem;
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px var(--indigo-glow);
    color: white;
}

.hero-cta svg {
    animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--indigo);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

/* ============================================
   GRID FLOOR (Hero background)
   ============================================ */
.grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* ============================================
   FLOATING PARTICLES
   ============================================ */
.floating-particles {
    position: absolute;
    inset: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--indigo);
    opacity: 0.3;
    animation: float linear infinite;
}

@keyframes float {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

/* ============================================
   GLASSMORPHISM CARD SYSTEM
   ============================================ */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Glass card with top highlight line */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* ============================================
   TAG / BADGE SYSTEM
   ============================================ */
.tag {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tag-indigo {
    background: rgba(99, 102, 241, 0.15);
    color: var(--indigo-secondary);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.tag-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.tag-cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--cyan);
    border: 1px solid rgba(6, 182, 212, 0.25);
}

.tag-purple {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.tag-orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--orange);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.tag-red {
    background: rgba(244, 63, 94, 0.15);
    color: var(--red);
    border: 1px solid rgba(244, 63, 94, 0.25);
}

.tag-gray {
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   REVEAL ANIMATIONS (Scroll-triggered)
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1) rotate(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Stagger support via data-delay attribute */
.reveal[data-delay],
.reveal-left[data-delay],
.reveal-right[data-delay],
.reveal-scale[data-delay] {
    transition-delay: calc(var(--reveal-delay, 0) * 1ms);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.footer-content {
    text-align: center;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.footer-text {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--text2);
}

.footer-links a:hover {
    color: var(--text);
}

.footer-tech {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--muted);
}

/* ============================================
   GRAIN TEXTURE OVERLAY
   ============================================ */
.grain {
    position: relative;
}

.grain::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    filter: url(#grainFilter);
    opacity: 0.03;
    mix-blend-mode: overlay;
}

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--gradient-main);
    z-index: 10001;
    transition: width 0.1s linear;
}

/* ============================================
   UTILITIES
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Mobile */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }

    .section { padding: 4rem 0; }
    .container { padding: 0 1.25rem; }

    .hero-title { font-size: clamp(2.5rem, 10vw, 4rem); }
    .hero-stats { gap: 0.75rem; }
    .stat-pill { padding: 0.75rem 1rem; min-width: 100px; }
    .stat-number { font-size: 2rem; }

    .section-header { margin-bottom: 2.5rem; }
}

@media (max-width: 480px) {
    .hero-stats { flex-direction: column; align-items: center; }
    .stat-pill { width: 100%; max-width: 280px; }
}
