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

:root {
    --bg: #09090b;
    --bg-elevated: #18181b;
    --bg-subtle: #27272a;
    --border: rgba(255,255,255,0.06);
    --text: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --accent: #ef4444;
    --accent-bright: #f87171;
    --accent-glow: rgba(239,68,68,0.15);
    --terminal: var(--accent-bright);
    --terminal-dim: var(--accent-glow);
    --terminal-border: rgba(239,68,68,0.25);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.65;
}

html { scroll-behavior: smooth; }

p { line-height: 1.7; }

h1, h2, h3, h4, h5 {
    font-family: 'Space Grotesk', sans-serif;
}

/* === Global Micro-Interactions === */

/* Button press */
button:active:not(:disabled),
.btn:active:not(:disabled),
a.btn:active {
    transform: scale(0.97);
    transition-duration: 0.05s;
}

/* Card entrance animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.card, .stat-card, .plan-card, .node-card, .pricing-card, .cap-card, .step {
    animation: fadeInUp 0.4s ease-out both;
}
/* Stagger cards in grids */
.card:nth-child(2), .stat-card:nth-child(2), .pricing-card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3), .stat-card:nth-child(3), .pricing-card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4), .stat-card:nth-child(4), .pricing-card:nth-child(4) { animation-delay: 0.18s; }
.card:nth-child(5), .pricing-card:nth-child(5) { animation-delay: 0.24s; }

/* Stat card hover lift */
.stat-card {
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover, rgba(255,255,255,0.12));
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* Card hover glow */
.card {
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
    border-color: rgba(255,255,255,0.1);
}

/* Badge pulse for training/active states */
.badge-training::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--warning);
    animation: badgePulse 1.5s ease-in-out infinite;
    margin-right: 0.25rem;
    flex-shrink: 0;
}
@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Focus-visible ring for accessibility + polish */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent, #ef4444);
    outline-offset: 2px;
}

/* Smooth image/SVG transitions */
svg { transition: transform 0.15s; }
a:hover svg { transform: scale(1.05); }

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
