/* ============================================================
   Velocity Design System — tokens.css v1.6.0
   Centralized design tokens for all pages
   ============================================================ */

/* ---------- Color Palette ---------- */
:root {
  /* Brand */
  --v-brand-50:  #fef2f2;
  --v-brand-100: #fee2e2;
  --v-brand-200: #fecaca;
  --v-brand-300: #fca5a5;
  --v-brand-400: #f87171;
  --v-brand-500: #e61919;
  --v-brand-600: #cc1616;
  --v-brand-700: #b31313;
  --v-brand-800: #991b1b;
  --v-brand-900: #7f1d1d;

  /* Surfaces (dark theme — default) */
  --v-bg:        #08080d;
  --v-surface-1: #0f0f16;
  --v-surface-2: #16161f;
  --v-surface-3: #1e1e2a;
  --v-surface-4: #26263a;

  /* Text */
  --v-text:        #ffffff;
  --v-text-secondary: #cccccc;
  --v-text-muted:  #999999;  /* WCAG AA on dark: 7.2:1 ✓ */
  --v-text-faint:  #666666;

  /* Semantic */
  --v-success:  #22c55e;
  --v-warning:  #eab308;
  --v-error:    #ef4444;
  --v-info:     #3b82f6;

  /* Borders & overlays */
  --v-border:       rgba(255,255,255,0.08);
  --v-border-hover: rgba(255,255,255,0.15);
  --v-overlay:      rgba(0,0,0,0.6);
  --v-glass:        rgba(255,255,255,0.05);
  --v-glass-hover:  rgba(255,255,255,0.08);

  /* Brand glow */
  --v-glow-sm:  0 0 15px rgba(230,25,25,0.2);
  --v-glow-md:  0 0 25px rgba(230,25,25,0.35);
  --v-glow-lg:  0 0 40px rgba(230,25,25,0.5);

  /* ---------- Typography ---------- */
  --v-font:       'Inter', 'Inter Fallback', system-ui, -apple-system, sans-serif;
  --v-font-mono:  'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Type scale (fluid) */
  --v-text-xs:   0.75rem;   /* 12px */
  --v-text-sm:   0.875rem;  /* 14px */
  --v-text-base: 1rem;      /* 16px */
  --v-text-lg:   1.125rem;  /* 18px */
  --v-text-xl:   1.25rem;   /* 20px */
  --v-text-2xl:  1.5rem;    /* 24px */
  --v-text-3xl:  1.875rem;  /* 30px */
  --v-text-4xl:  2.25rem;   /* 36px */
  --v-text-5xl:  3rem;      /* 48px */

  /* Line heights */
  --v-leading-tight:  1.15;
  --v-leading-snug:   1.35;
  --v-leading-normal: 1.6;
  --v-leading-loose:  1.8;

  /* Letter spacing */
  --v-tracking-tight:  -0.03em;
  --v-tracking-normal:  0;
  --v-tracking-wide:    0.05em;
  --v-tracking-wider:   0.08em;

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

  /* ---------- Layout ---------- */
  --v-container: 1200px;
  --v-radius-sm:  8px;
  --v-radius:     12px;
  --v-radius-lg:  16px;
  --v-radius-xl:  24px;
  --v-radius-full: 9999px;

  /* ---------- Shadows ---------- */
  --v-shadow-sm:  0 1px 3px rgba(0,0,0,0.12);
  --v-shadow:     0 4px 12px rgba(0,0,0,0.15);
  --v-shadow-lg:  0 8px 30px rgba(0,0,0,0.25);
  --v-shadow-xl:  0 16px 50px rgba(0,0,0,0.35);

  /* ---------- Transitions ---------- */
  --v-ease:       cubic-bezier(0.16, 1, 0.3, 1);
  --v-ease-slow:  cubic-bezier(0.32, 0.72, 0, 1);
  --v-duration:   0.3s;
  --v-duration-fast: 0.15s;
  --v-duration-slow: 0.5s;

  /* ---------- Z-index scale ---------- */
  --v-z-dropdown: 100;
  --v-z-sticky:   200;
  --v-z-overlay:  500;
  --v-z-modal:    1000;
  --v-z-toast:    2000;
  --v-z-tooltip:  3000;
}

/* ---------- Light Theme ---------- */
:root.light,
[data-theme="light"] {
  --v-bg:        #f5f5f7;
  --v-surface-1: #ffffff;
  --v-surface-2: #f0f0f2;
  --v-surface-3: #e8e8ec;
  --v-surface-4: #dddde3;

  --v-text:        #1a1a2e;
  --v-text-secondary: #444444;
  --v-text-muted:  #666666;
  --v-text-faint:  #999999;

  --v-border:       rgba(0,0,0,0.08);
  --v-border-hover: rgba(0,0,0,0.15);
  --v-overlay:      rgba(0,0,0,0.4);
  --v-glass:        rgba(0,0,0,0.03);
  --v-glass-hover:  rgba(0,0,0,0.06);

  --v-glow-sm:  0 0 15px rgba(230,25,25,0.1);
  --v-glow-md:  0 0 25px rgba(230,25,25,0.2);
  --v-glow-lg:  0 0 40px rgba(230,25,25,0.3);

  --v-shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --v-shadow:     0 4px 12px rgba(0,0,0,0.08);
  --v-shadow-lg:  0 8px 30px rgba(0,0,0,0.12);
  --v-shadow-xl:  0 16px 50px rgba(0,0,0,0.18);
}

/* Auto-detect system preference — DISABLED
   Site is dark-mode only; pages have hardcoded dark colors.
   Light theme class kept above for future opt-in use.
@media (prefers-color-scheme: light) {
  :root:not(.dark) { ... }
}
*/

/* ============================================================
   Global Accessibility Fixes
   ============================================================ */

/* Focus indicators — all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--v-brand-500);
  outline-offset: 2px;
}

/* Remove default outline only when focus-visible handles it */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* Skip-to-content link (screen readers) */
.v-skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 99999;
  padding: 12px 24px;
  background: var(--v-brand-500);
  color: #fff;
  font-weight: 700;
  border-radius: var(--v-radius);
  text-decoration: none;
  transition: top 0.2s;
}
.v-skip-link:focus {
  top: 16px;
}

/* Reduced motion preference */
@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;
  }
}

/* Minimum touch target size (48x48) */
@media (pointer: coarse) {
  button, a, [role="button"], input[type="checkbox"], input[type="radio"] {
    min-height: 48px;
    min-width: 48px;
  }
}

/* Prevent mobile text size adjustment */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Smooth scrolling (respects reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
