/* ===== CSS Reset & Base Typography ===== */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@300;400;500;600;700;800&display=swap');

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

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

body {
    font-family: var(--font-family);
    font-size: var(--font-base);
    font-weight: var(--weight-normal);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    transition: background-color var(--transition-slow), color var(--transition-normal);
}

/* HUD atmospheric glow – orange + teal */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 15% 0%, rgba(255, 109, 0, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 100%, rgba(0, 229, 255, 0.05) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* HUD scan-line overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, var(--hud-scanline-opacity)) 2px,
            rgba(255, 255, 255, var(--hud-scanline-opacity)) 3px);
    pointer-events: none;
    z-index: 0;
}

#app {
    position: relative;
    z-index: var(--z-base);
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: var(--nav-height);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: 1.15;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

h1 {
    font-size: var(--font-3xl);
}

h2 {
    font-size: var(--font-2xl);
}

h3 {
    font-size: var(--font-xl);
}

h4 {
    font-size: var(--font-lg);
}

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

a {
    color: var(--accent-teal);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-teal-light);
}

ul,
ol {
    list-style: none;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    color: inherit;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 109, 0, 0.3);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 109, 0, 0.6);
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: black;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Screen reader only */
.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;
}

/* ===== Emergency Mode Body Override ===== */
body.emergency-mode {
    --bg-primary: #000000;
    --bg-secondary: #0d0000;
    --bg-card: rgba(20, 0, 0, 0.9);
    --hud-scanline-opacity: 0.04;
}

body.emergency-mode::before {
    background:
        radial-gradient(ellipse at 50% 20%, rgba(213, 0, 0, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 90%, rgba(213, 0, 0, 0.08) 0%, transparent 50%);
}