/* ==========================================================================
   GenPvP Design System - Base Styles & CSS Variables
   Dark-first with high contrast, WCAG AA compliance (≥ 4.5:1 text contrast)
   ========================================================================== */

:root {
  /* Color Palette - Cyber Medieval Minecraft */
  --bg-primary: #090b10;
  --bg-surface: #0f141f;
  --bg-surface-elevated: #161e2e;
  --bg-surface-hover: #1e293b;
  --bg-glass: rgba(15, 20, 31, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(56, 189, 248, 0.4);

  /* Primary Accent: Electric Cyan / Generator Energy */
  --accent-primary: #38bdf8;
  --accent-primary-hover: #7dd3fc;
  --accent-primary-glow: rgba(56, 189, 248, 0.25);

  /* Economy & Wealth: Emerald & Gold */
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.2);
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.2);

  /* Siege & Raid / Danger: Crimson Red & BossBar Purple */
  --accent-crimson: #ef4444;
  --accent-crimson-glow: rgba(239, 68, 68, 0.25);
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.2);

  /* Text & Readability (WCAG AAA / AA) */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #090b10;

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Layout & Spacing */
  --container-max: 1240px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Focus Ring */
  --focus-ring: 0 0 0 3px rgba(56, 189, 248, 0.5);
}

/* Light Theme Support */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --bg-glass: rgba(255, 255, 255, 0.9);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --border-accent: rgba(2, 132, 199, 0.5);

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-primary-glow: rgba(2, 132, 199, 0.15);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  color-scheme: dark light;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.06) 0%, transparent 60%),
    radial-gradient(circle at 100% 50%, rgba(168, 85, 247, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Accessibility: Skip to Content */
.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--accent-primary);
  color: var(--text-inverse);
  padding: 10px 18px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  z-index: 99999;
  transition: top var(--transition-fast);
  text-decoration: none;
}

.skip-link:focus {
  top: 15px;
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Focus Visible Styling (Keyboard Accessibility) */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

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

/* Screen Reader Only 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: 0;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.015em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: 1.15rem; }

p {
  color: var(--text-secondary);
  font-size: 1rem;
}

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

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

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

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