/* Base: design tokens + resets */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

:root {
  color-scheme: dark;

  --bg: #030407;
  --bg-elev: rgba(20, 26, 36, 0.4);
  --bg-elev-2: rgba(30, 38, 50, 0.6);
  --border: rgba(100, 116, 139, 0.2);
  --border-strong: rgba(100, 116, 139, 0.35);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --subtle: #64748b;

  /* Optimus Prime Palette - Refined */
  --op-red: #e62e2e;
  --op-red-dim: #8b0000;
  --op-blue: #2563eb;
  --op-blue-dim: #1e3a8a;
  --metal: #94a3b8;
  --metal-dark: #475569;
  --gunmetal: #0f172a;
  
  --accent: var(--op-blue);
  --accent-2: var(--op-red);
  
  --radius-sm: 2px; /* Slight bevel feel */
  --radius-md: 4px;
  --bevel: 12px;

  --container: 1200px;
  --gutter: 24px;

  /* Typography */
  --font-display: 'Orbitron', 'Rajdhani', sans-serif;
  --font-body: 'Rajdhani', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --font: var(--font-body);

  /* Fluid Type Scale - More dramatic */
  --step--1: clamp(0.87rem, 0.82rem + 0.2vw, 0.97rem);
  --step-0: clamp(1rem, 0.96rem + 0.35vw, 1.12rem);
  --step-1: clamp(1.25rem, 1.1rem + 0.7vw, 1.45rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.1rem);
  --step-3: clamp(2.1rem, 1.7rem + 2.2vw, 3.2rem);
  --step-4: clamp(2.6rem, 2.2rem + 3vw, 4rem);

  --fs-hero: var(--step-4);
  --fs-section: var(--step-2);
  --fs-card-title: var(--step-1);
  --fs-body-lg: var(--step-0);
  --fs-body: var(--step--1);
  --fs-meta: clamp(0.8rem, 0.76rem + 0.18vw, 0.9rem);

  --lh: 1.7;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;

  /* Effects */
  --shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7);
  --shadow-struct: 
    0 1px 0 rgba(255, 255, 255, 0.08) inset, 
    0 -1px 0 rgba(0, 0, 0, 0.8) inset,
    0 10px 30px -10px rgba(0, 0, 0, 0.8);
    
  --glow-blue: 0 0 20px rgba(37, 99, 235, 0.4);
  --glow-red: 0 0 20px rgba(230, 46, 46, 0.4);
}

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

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  line-height: var(--lh);
  color: var(--text);
  background-color: var(--bg);
  /* Cinematic Vignette + Grid + Dual Tone Glows */
  background-image: 
    /* Primary Glow (Blue Top) */
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.12), transparent 70%),
    /* Secondary Glow (Red Accent Side) */
    radial-gradient(circle at 90% 20%, rgba(230, 46, 46, 0.06), transparent 50%),
    /* Base Fade */
    linear-gradient(to bottom, transparent 0%, var(--bg) 100%),
    /* Major Grid */
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.04) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.04) 0 1px, transparent 1px 80px),
    /* Minor Grid */
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.02) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.02) 0 1px, transparent 1px 20px);
  background-attachment: fixed; /* Parallax-like feel for grid */
  min-height: 100svh;
  overflow-x: hidden;
  z-index: 1;
}

* {
  scrollbar-color: rgba(10, 75, 255, 0.55) rgba(10, 12, 18, 0.55);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(10, 12, 18, 0.55);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(10, 75, 255, 0.55), rgba(139, 0, 0, 0.45));
  border: 1px solid rgba(186, 199, 220, 0.16);
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

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

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

p {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: none;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid rgba(10, 75, 255, 0.85);
  outline-offset: 3px;
  border-radius: 0;
}

.container {
  width: min(var(--container), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
  position: relative;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 10px;
  z-index: 999;
  padding: 10px 12px;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(20, 26, 36, 0.92), rgba(10, 14, 20, 0.92));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-struct);
  transform: translateY(-140%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.link {
  color: rgba(10, 75, 255, 0.92);
  background-image: linear-gradient(90deg, rgba(10, 75, 255, 0.0), rgba(10, 75, 255, 0.75), rgba(139, 0, 0, 0.65));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 180ms ease, color 180ms ease;
}

.link:hover {
  color: rgba(242, 248, 255, 0.94);
  background-size: 100% 2px;
}

::selection {
  background: rgba(10, 75, 255, 0.28);
  color: rgba(255, 255, 255, 0.98);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
