/* ============================================
   BASE — Reset, Variables, Typography
   Stories WL — Glassmorphism Dark Theme
   ============================================ */

/* --- CSS Variables --- */
:root {
    /* Colors */
    --bg-primary: #050507;
    --bg-secondary: #0a0a0f;
    --bg-tertiary: #111118;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #F2F2F5;
    --text-secondary: rgba(242, 242, 245, 0.7);
    --text-tertiary: rgba(242, 242, 245, 0.4);
    --text-muted: rgba(242, 242, 245, 0.25);

    --red-primary: #C8102E;
    --red-bright: #FF1A3C;
    --red-glow: rgba(200, 16, 46, 0.4);
    --red-subtle: rgba(200, 16, 46, 0.15);

    /* Faction colors */
    --faction-civil: #6B8E4E;
    --faction-illegal: #E8842A;
    --faction-emergency: #2B7FFF;
    --faction-staff: #9B59B6;

    /* Glass */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --glass-blur: 16px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glass-shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.6);

    /* Typography */
    --font-display: 'Bebas Neue', cursive;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;
    --space-5xl: 128px;

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 600ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Navbar */
    --navbar-height: 80px;

    /* Z-index scale */
    --z-base: 1;
    --z-dropdown: 10;
    --z-sticky: 20;
    --z-overlay: 30;
    --z-modal: 40;
    --z-toast: 50;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(200, 16, 46, 0.3);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 16, 46, 0.5);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 16, 46, 0.3) var(--bg-primary);
}

/* --- Selection --- */
::selection {
    background: var(--red-primary);
    color: white;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

h1 { font-size: clamp(3rem, 8vw, 7rem); }
h2 { font-size: clamp(2rem, 5vw, 4rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.75rem); }

p {
    font-family: var(--font-body);
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

a {
    color: var(--red-bright);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input, textarea, select {
    font-family: var(--font-body);
    font-size: 1rem;
}

/* --- Utility --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-4xl) 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-red { color: var(--red-bright); }
.text-muted { color: var(--text-tertiary); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Divider --- */
.divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--red-primary), var(--red-bright));
    border-radius: var(--radius-full);
    margin: var(--space-lg) auto;
}

/* --- Noise texture overlay --- */
#app::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

#app > *:not(.navbar):not(.mobile-menu) {
    position: relative;
    z-index: var(--z-base);
}
