/**
 * Base Styles - CSS Variables, Reset, and Typography
 * Refined design system with #dc2626 (red-600) accent
 */

/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
  /* Accent Colors - More vibrant red scale */
  --accent-color: #dc2626;
  --accent-color-light: #ef4444;
  --accent-color-dark: #b91c1c;
  --accent-color-rgb: 220, 38, 38;
  --accent-glow: rgba(220, 38, 38, 0.4);

  /* Background Colors - Deep slate/black for premium feel */
  --bg-primary: #050505;
  --bg-primary-rgb: 5, 5, 5;
  --bg-secondary: #0a0a0a;
  --bg-secondary-rgb: 10, 10, 10;
  --bg-tertiary: #111111;
  --bg-tertiary-rgb: 17, 17, 17;
  --bg-elevated: #1a1a1a;
  --bg-elevated-rgb: 26, 26, 26;
  --bg-overlay: rgba(0, 0, 0, 0.85);

  /* Glassmorphism - Refined translucency */
  --glass-bg: rgba(10, 10, 10, 0.75);
  --glass-bg-light: rgba(17, 17, 17, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.12);
  --glass-blur: 12px;

  /* Gradients - More dramatic depth */
  --gradient-primary: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
  --gradient-primary-hover: linear-gradient(135deg, var(--accent-color-light) 0%, var(--accent-color) 100%);
  --gradient-surface: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  --gradient-surface-hover: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  --gradient-glow: radial-gradient(circle at center, rgba(var(--accent-color-rgb), 0.15) 0%, transparent 70%);
  --gradient-text: linear-gradient(90deg, #ffffff 0%, #ef4444 50%, #ffffff 100%);

  /* Text Colors - High contrast for readability */
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-muted: #52525b;

  /* Border Colors - Subtle but defined */
  --border-color: #1e1e1e;
  --border-color-light: #2a2a2a;
  --border-color-accent: rgba(var(--accent-color-rgb), 0.4);

  /* Typography */
  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows - Layered depth */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.02);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-glow: 0 0 30px rgba(var(--accent-color-rgb), 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.5);

  /* 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);

  /* Layout */
  --max-width: 1280px;
  --header-height: 72px;
}

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

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

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

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

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

button {
  cursor: pointer;
  background: none;
  border: none;
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

ul,
ol {
  list-style: none;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); }
h2 { font-size: clamp(2rem, 5vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: var(--text-xl); }

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

code {
  font-family: var(--font-family-mono);
  font-size: 0.9em;
  background-color: var(--bg-tertiary);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--accent-color-light);
  border: 1px solid var(--border-color);
}

/* Selection */
::selection {
  background-color: var(--accent-color);
  color: #ffffff;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-color-light);
}

/* ========================================
   Utility Classes
   ======================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.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;
}

.gradient-text {
  background: var(--gradient-text);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
