/* ==================================================================
   Variables
   ================================================================== */
:root {
  /* Color Palette - modern fantasy, tactical, cinematic */
  --color-bg: #05070b;
  --color-bg-elevated: #0b1018;
  --color-bg-soft: #101624;

  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-text-soft: #64748b;

  --color-primary: #38bdf8; /* tactical cyan */
  --color-primary-soft: rgba(56, 189, 248, 0.12);
  --color-primary-strong: #0ea5e9;

  --color-accent: #22c55e; /* strategic success */
  --color-accent-soft: rgba(34, 197, 94, 0.12);

  --color-success: #22c55e;
  --color-warning: #facc15;
  --color-danger: #ef4444;

  --color-border-subtle: rgba(148, 163, 184, 0.25);
  --color-border-strong: rgba(148, 163, 184, 0.5);

  --color-neutral-50: #0b1120;
  --color-neutral-100: #111827;
  --color-neutral-200: #1f2937;
  --color-neutral-300: #374151;
  --color-neutral-400: #4b5563;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #9ca3af;
  --color-neutral-700: #d1d5db;
  --color-neutral-800: #e5e7eb;
  --color-neutral-900: #f9fafb;

  /* Cinematic glows & overlays */
  --color-glow-cyan: rgba(56, 189, 248, 0.35);
  --color-glow-emerald: rgba(16, 185, 129, 0.25);
  --color-overlay-dark: rgba(5, 7, 11, 0.88);

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "Fira Code", Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem; /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-md: 1rem; /* 16px */
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.25rem; /* 20px */
  --font-size-2xl: 1.5rem; /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem; /* 36px */
  --font-size-5xl: 3rem; /* 48px */

  --line-height-tight: 1.15;
  --line-height-snug: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (px) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radii */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Shadows (tactical, cinematic) */
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.8);
  --shadow-strong: 0 24px 80px rgba(0, 0, 0, 0.95);
  --shadow-glow-primary: 0 0 35px var(--color-glow-cyan);
  --shadow-glow-accent: 0 0 30px var(--color-glow-emerald);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-mid: 200ms ease-out;
  --transition-slow: 320ms ease;
}

/* ==================================================================
   Reset / Normalize
   ================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html,
body {
  padding: 0;
}

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

body {
  min-height: 100vh;
}

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

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border-radius: 0;
}

button {
  border: none;
  padding: 0;
  background: none;
}

ul,
ol {
  padding-left: 1.25rem;
}

/* Remove default button/input appearance in WebKit */
button,
[type="button"],
[type="submit"],
[type="reset"] {
  -webkit-appearance: none;
}

textarea {
  resize: vertical;
}

/* ==================================================================
   Base Styles
   ================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  min-height: 60vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-neutral-900);
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: 1.25rem;
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
}

strong {
  font-weight: 600;
}

small {
  font-size: var(--font-size-sm);
}

a {
  color: var(--color-primary);
  transition: color var(--transition-mid),
    text-shadow var(--transition-mid),
    opacity var(--transition-fast);
}

a:hover {
  color: var(--color-primary-strong);
  text-shadow: 0 0 14px var(--color-glow-cyan);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

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

hr {
  border: none;
  border-top: 1px solid var(--color-border-subtle);
  margin: var(--space-6) 0;
}

/* ==================================================================
   Accessibility & Motion
   ================================================================== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

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

/* ==================================================================
   Utilities
   ================================================================== */

/* Layout containers */
.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.container-wide {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Flex helpers */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

/* Grid helpers */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Spacing utilities (commonly needed) */
.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.py-section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

@media (max-width: 768px) {
  .py-section {
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
  }
}

/* Text utilities */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-soft {
  color: var(--color-text-soft);
}

.text-xs {
  font-size: var(--font-size-xs);
}

.text-sm {
  font-size: var(--font-size-sm);
}

.text-lg {
  font-size: var(--font-size-lg);
}

.text-uppercase {
  text-transform: uppercase;
}

/* Screen reader only */
.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;
}

/* Background helpers */
.bg-elevated {
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(circle at bottom, rgba(15, 23, 42, 0.9), transparent 60%),
    var(--color-bg-elevated);
}

.bg-soft-panel {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
}

/* ==================================================================
   Components
   ================================================================== */

/* Buttons - primary, ghost, subtle */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--transition-mid),
    border-color var(--transition-mid),
    color var(--transition-mid),
    box-shadow var(--transition-mid),
    transform var(--transition-fast),
    opacity var(--transition-fast);
}

.btn-primary {
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.4), transparent 60%),
    linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #0b1120;
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: var(--shadow-soft), var(--shadow-glow-primary);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-strong), var(--shadow-glow-primary);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-soft);
}

.btn-ghost {
  background: rgba(15, 23, 42, 0.85);
  color: var(--color-text);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-soft), var(--shadow-glow-primary);
}

.btn-subtle {
  background: rgba(15, 23, 42, 0.7);
  color: var(--color-text-muted);
  border-color: transparent;
}

.btn-subtle:hover {
  background: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Inputs & form controls */
.input,
.textarea,
.select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition: border-color var(--transition-mid),
    box-shadow var(--transition-mid),
    background-color var(--transition-mid);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--color-text-soft);
}

.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.7), var(--shadow-glow-primary);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--color-danger);
}

label {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: var(--font-size-sm);
  color: var(--color-text-soft);
}

.form-field {
  margin-bottom: var(--space-4);
}

/* Card - used for guides, maps, news items */
.card {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.12), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(148, 163, 184, 0.12), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  margin-bottom: var(--space-3);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-meta {
  margin-top: 0.25rem;
  font-size: var(--font-size-xs);
  color: var(--color-text-soft);
}

.card-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Tag / pill for strategy labels, difficulty, etc. */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
  background: rgba(15, 23, 42, 0.9);
}

.tag--primary {
  border-color: rgba(56, 189, 248, 0.8);
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.tag--success {
  border-color: rgba(34, 197, 94, 0.8);
  color: var(--color-success);
  background: var(--color-accent-soft);
}

/* Hero-specific helpers (for home page) */
.hero {
  position: relative;
  padding-top: var(--space-20);
  padding-bottom: var(--space-16);
  color: var(--color-text);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0, rgba(56, 189, 248, 0.35), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(16, 185, 129, 0.25), transparent 60%),
    linear-gradient(180deg, #020617 0%, #020617 40%, #020617 100%);
  opacity: 0.95;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  font-size: var(--font-size-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-soft);
  margin-bottom: var(--space-2);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4rem);
  line-height: var(--line-height-tight);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.hero-subtitle {
  max-width: 34rem;
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

@media (max-width: 768px) {
  .hero {
    padding-top: var(--space-16);
    padding-bottom: var(--space-12);
  }

  .hero-subtitle {
    font-size: var(--font-size-md);
  }
}

/* Navigation bar (global) */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.88));
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
}

.navbar-brand {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  font-family: var(--font-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.navbar-brand span {
  color: var(--color-primary);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.navbar-link {
  position: relative;
  color: var(--color-text-soft);
}

.navbar-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width var(--transition-mid);
}

.navbar-link:hover {
  color: var(--color-text);
}

.navbar-link:hover::after {
  width: 100%;
}

.navbar-link--active {
  color: var(--color-primary);
}

.navbar-link--active::after {
  width: 100%;
}

@media (max-width: 900px) {
  .navbar-links {
    display: none;
  }
}

/* Footer */
.footer {
  padding: var(--space-10) 0 var(--space-6);
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, #020617 0%, #000 100%);
  color: var(--color-text-soft);
  font-size: var(--font-size-sm);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  padding-top: var(--space-4);
}

@media (max-width: 768px) {
  .footer-top {
    flex-direction: column;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
