/*
 * StreamScope Design System
 * Based on AGENTS.md Design Stack (Frontend)
 */

/* ========== COLOR PALETTE ========== */
:root {
    /* Primary */
    --color-black: #000000;
    --color-white: #FFFFFF;
    --color-crimson: #DC143C;
    --color-electric-red: #FF0033;

    /* Secondary/Accent */
    --color-charcoal: #0A0A0A;
    --color-gunmetal: #1A1A1A;
    --color-steel: #2A2A2A;
    --color-ruby-glow: rgba(255, 0, 34, 0.33);
    --color-neon-red: #FF0044;

    /* Utility */
    --color-error: #FF0033;
    --color-success: #00FF00;
    --color-warning: #FFA500;
    --color-muted: #999999;

    /* Semantic aliases */
    --bg-primary: var(--color-black);
    --bg-elevated: var(--color-charcoal);
    --bg-card: var(--color-gunmetal);
    --text-primary: var(--color-white);
    --text-muted: var(--color-muted);
    --accent-primary: var(--color-crimson);
    --accent-hover: var(--color-electric-red);
    --border-default: var(--color-steel);
    --border-accent: var(--color-crimson);

    /* ========== TYPOGRAPHY ========== */
    --font-primary: 'JetBrains Mono', monospace;
    --font-secondary: 'Inter', system-ui, sans-serif;
    --font-accent: 'Space Grotesk', sans-serif;

    /* Font weights */
    --weight-light: 300;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* Type scale */
    --text-display: 4rem;      /* 64px */
    --text-h1: 3rem;           /* 48px */
    --text-h2: 2.25rem;        /* 36px */
    --text-h3: 1.75rem;        /* 28px */
    --text-h4: 1.5rem;         /* 24px */
    --text-body-lg: 1.125rem;  /* 18px */
    --text-body: 1rem;         /* 16px */
    --text-small: 0.875rem;    /* 14px */
    --text-caption: 0.75rem;   /* 12px */

    /* ========== SPACING (8pt system) ========== */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;
    --space-10: 128px;

    /* ========== LAYOUT ========== */
    --max-width: 1440px;
    --gutter: 24px;
    --margin-desktop: 80px;
    --margin-mobile: 24px;

    /* ========== BORDERS ========== */
    --border-width: 1px;
    --radius-none: 0px;
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;

    /* ========== SHADOWS ========== */
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-red-glow: 0 0 20px rgba(220, 20, 60, 0.3);
    --shadow-red-glow-strong: 0 0 20px rgba(220, 20, 60, 0.4);
    --shadow-text-glow: 0 0 10px rgba(255, 0, 51, 0.6);

    /* ========== MOTION ========== */
    --duration-fast: 150ms;
    --duration-standard: 250ms;
    --duration-slow: 400ms;
    --ease-out: ease-out;
    --ease-in: ease-in;
    --ease-in-out: ease-in-out;
}

/* ========== BASE RESET ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    font-size: var(--text-body);
    font-weight: var(--weight-regular);
    line-height: 1.6;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== TYPOGRAPHY UTILITIES ========== */
.font-mono {
    font-family: var(--font-primary);
}

.font-body {
    font-family: var(--font-secondary);
}

.font-accent {
    font-family: var(--font-accent);
}

h1, h2, h3, h4, h5, h6,
.heading {
    font-family: var(--font-primary);
    font-weight: var(--weight-bold);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* ========== BUTTON COMPONENTS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-primary);
    font-size: var(--text-small);
    font-weight: var(--weight-regular);
    text-decoration: none;
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-5);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-primary);
    border: var(--border-width) solid var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-red-glow-strong);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: var(--border-width) solid var(--border-default);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ========== INPUT COMPONENTS ========== */
.input {
    font-family: var(--font-primary);
    font-size: var(--text-small);
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: var(--border-width) solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
    transition: all var(--duration-fast) var(--ease-out);
}

.input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(220, 20, 60, 0.2);
}

.input::placeholder {
    color: var(--text-muted);
}

/* ========== CARD COMPONENTS ========== */
.card {
    background: var(--bg-elevated);
    border: var(--border-width) solid var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    transition: border-color var(--duration-standard) var(--ease-out);
}

.card:hover {
    border-color: var(--border-default);
}

/* ========== NAVIGATION ========== */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: var(--border-width) solid var(--bg-card);
}

/* ========== CODE BLOCKS ========== */
.code-block {
    font-family: var(--font-primary);
    font-size: var(--text-small);
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-left: 2px solid var(--accent-primary);
    padding: var(--space-4);
}

/* ========== SECTION DIVIDERS ========== */
.divider {
    height: var(--border-width);
    background: var(--border-default);
}

.divider-accent {
    background: linear-gradient(to right, var(--accent-primary), transparent);
}

/* ========== FOCUS STATES (Accessibility) ========== */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lineDrawWidth {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

.animate-fade-in-up {
    animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

.animate-line-draw {
    animation: lineDrawWidth var(--duration-slow) var(--ease-out) forwards;
}

/* Staggered animation delays */
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; }

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== BREAKPOINTS ========== */
/* Mobile: 0-640px */
/* Tablet: 641-1024px */
/* Desktop: 1025-1440px */
/* Wide: 1441px+ */

@media (max-width: 640px) {
    :root {
        --text-display: 2.5rem;
        --text-h1: 2rem;
        --text-h2: 1.5rem;
        --text-h3: 1.25rem;
    }
}
