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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ===== CSS VARIABLES / TOKENS — BLUE MEDIA THEME ===== */
:root {
  --bg-primary: #0b1220;
  --bg-secondary: #10192c;
  --bg-surface: #152238;
  --bg-card: #122033;
  --bg-card-hover: #172842;
  --bg-elevated: #1a2e4b;
  --bg-input: #101c2f;

  --border-subtle: rgba(201, 225, 255, 0.06);
  --border-default: rgba(201, 225, 255, 0.12);
  --border-accent: rgba(61, 148, 255, 0.24);
  --border-accent-strong: rgba(61, 148, 255, 0.4);

  --accent: #3793ff;
  --accent-hover: #247cf0;
  --accent-strong: #74b3ff;
  --accent-muted: rgba(61, 148, 255, 0.18);
  --accent-bg: rgba(61, 148, 255, 0.1);
  --accent-secondary: #67d2ff;

  --green: #52d7c9;
  --green-bg: rgba(52, 211, 153, 0.12);
  --red: #ff667d;
  --red-bg: rgba(255, 102, 125, 0.14);
  --yellow: #ffcf5c;
  --yellow-bg: rgba(255, 207, 92, 0.12);
  --purple: #99a6ff;
  --purple-bg: rgba(153, 166, 255, 0.14);
  --orange: #ff9b66;

  --text-primary: #f5f9ff;
  --text-secondary: #b6c6de;
  --text-muted: #8195b4;
  --text-faint: #5f708d;
  --text-inverse: #0e1726;

  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.3125rem;
  --text-2xl: 1.625rem;
  --text-3xl: 2rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-7xl: 4.5rem;

  --leading-tight: 1.25;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 900;

  /* Spacing - 4px system */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  --shadow-sm: 0 6px 14px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 14px 30px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 22px 48px rgba(0, 0, 0, 0.24);
  --shadow-xl: 0 36px 72px rgba(0, 0, 0, 0.34);

  /* Layout */
  --max-width: 1200px;
  --content-width: 700px;
  --sidebar-left: 220px;
  --sidebar-right: 300px;
  --header-height: 60px;

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 350ms ease;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;
}

/* ===== BASE TYPOGRAPHY ===== */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgba(61, 148, 255, 0.12), transparent 22%),
    radial-gradient(circle at 90% 10%, rgba(103, 210, 255, 0.08), transparent 18%),
    linear-gradient(180deg, #09111d 0%, #0b1220 52%, #0d1627 100%);
  line-height: var(--leading-normal);
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--leading-tight);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-base); font-weight: var(--weight-medium); }

/* Display font class for Orbitron headings */
.font-display,
.page-title,
.section-title {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

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

code, pre {
  font-family: var(--font-mono);
}

pre {
  background: hsl(224, 47%, 8%);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border-default);
  font-size: var(--text-sm);
}

code {
  background: rgba(201, 225, 255, 0.08);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
}

pre code {
  background: none;
  padding: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(255,255,255,0.12), transparent 80%);
  opacity: 0.35;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 16%);
}

::selection {
  background: rgba(0, 163, 255, 0.3);
  color: var(--text-primary);
}

/* Scrollbar — dark theme */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) var(--bg-primary);
}

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

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: var(--accent);
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  z-index: 9999;
  font-weight: var(--weight-semibold);
}

.skip-link:focus {
  top: var(--sp-2);
}

/* Utility */
.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;
}

/* ===== GLASS EFFECTS ===== */
.glass-panel {
  background: rgba(11, 14, 23, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.glass-panel:hover {
  border-color: rgba(0, 163, 255, 0.3);
}

/* ===== GLOW EFFECTS ===== */
.glow-text {
  text-shadow: 0 0 10px rgba(0, 163, 255, 0.5), 0 0 20px rgba(0, 163, 255, 0.3);
}

.glow-box {
  box-shadow: 0 0 15px rgba(0, 163, 255, 0.2), inset 0 0 10px rgba(0, 163, 255, 0.1);
  transition: all 0.3s ease;
}

.glow-box:hover {
  box-shadow: 0 0 25px rgba(0, 163, 255, 0.4), inset 0 0 15px rgba(0, 163, 255, 0.2);
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
