/* ========================================================================== 
   Variables
   ========================================================================== */

:root {
  /* Colors */
  --color-background: #050812;
  --color-surface: #0c1220;
  --color-surface-alt: #111828;
  --color-text: #f9fafb;
  --color-text-muted: #9ca3af;

  --color-primary: #2563eb; /* bold blue */
  --color-primary-soft: rgba(37, 99, 235, 0.16);

  --color-accent: #22c55e; /* energetic green */
  --color-accent-soft: rgba(34, 197, 94, 0.18);

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

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 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.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0 – 96px) */
  --space-0: 0;
  --space-4: 0.25rem;  /* 4px */
  --space-8: 0.5rem;   /* 8px */
  --space-12: 0.75rem; /* 12px */
  --space-16: 1rem;    /* 16px */
  --space-20: 1.25rem; /* 20px */
  --space-24: 1.5rem;  /* 24px */
  --space-32: 2rem;    /* 32px */
  --space-40: 2.5rem;  /* 40px */
  --space-48: 3rem;    /* 48px */
  --space-64: 4rem;    /* 64px */
  --space-80: 5rem;    /* 80px */
  --space-96: 6rem;    /* 96px */

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows (slightly neon / gaming inspired) */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.5);
  --shadow-sm: 0 4px 10px rgba(15, 23, 42, 0.55);
  --shadow-md: 0 14px 35px rgba(15, 23, 42, 0.75);
  --shadow-glow-primary: 0 0 0 1px rgba(37, 99, 235, 0.8), 0 0 18px rgba(37, 99, 235, 0.7);
  --shadow-glow-accent: 0 0 0 1px rgba(34, 197, 94, 0.8), 0 0 18px rgba(34, 197, 94, 0.7);

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

/* ========================================================================== 
   Reset / Normalize
   ========================================================================== */

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

html,
body {
  padding: 0;
  margin: 0;
}

body,
 h1,
 h2,
 h3,
 h4,
 h5,
 h6,
 p,
 ul,
 ol,
 figure,
 blockquote,
 dl,
 dd {
  margin: 0;
}

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

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

img {
  height: auto;
}

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

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

:root {
  scroll-behavior: smooth;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Remove built-in form element styles in modern browsers */
button,
input,
select,
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* ========================================================================== 
   Base
   ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background-color: var(--color-background);
  color: var(--color-text);
}

main {
  display: block;
}

/* Headings - scalable, immersive hierarchy */

h1,
.h1 {
  font-size: clamp(2.25rem, 1.4rem + 2vw, 3rem);
  line-height: var(--line-height-tight);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: var(--space-16);
}

h2,
.h2 {
  font-size: clamp(1.75rem, 1.2rem + 1.2vw, 2.25rem);
  line-height: var(--line-height-snug);
  font-weight: 650;
  margin-top: var(--space-32);
  margin-bottom: var(--space-12);
}

h3,
.h3 {
  font-size: clamp(1.4rem, 1.1rem + 0.6vw, 1.75rem);
  line-height: var(--line-height-snug);
  font-weight: 600;
  margin-top: var(--space-24);
  margin-bottom: var(--space-8);
}

h4,
.h4 {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-snug);
  font-weight: 600;
  margin-top: var(--space-20);
  margin-bottom: var(--space-8);
}

h5,
.h5 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-top: var(--space-16);
  margin-bottom: var(--space-4);
}

h6,
.h6 {
  font-size: var(--font-size-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-top: var(--space-16);
  margin-bottom: var(--space-4);
}

p {
  margin-bottom: var(--space-12);
  }

p:last-child {
  margin-bottom: 0;
}

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

strong {
  font-weight: 600;
}

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

pre {
  font-size: 0.95em;
  padding: var(--space-16);
  border-radius: var(--radius-md);
  background: #020617;
  overflow-x: auto;
}

/* Links - modern hover, no default underline */

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-normal),
              text-shadow var(--transition-normal);
}

a:hover {
  color: var(--color-accent);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

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

hr {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  margin: var(--space-24) 0;
}

/* Lists */

ul,
ol {
  margin-bottom: var(--space-12);
}

li + li {
  margin-top: 0.25em;
}

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

/* Layout helpers */

.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

.flex {
  display: flex;
}

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

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

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

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

.grid {
  display: grid;
}

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

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

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

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

.text-right {
  text-align: right;
}

.m-auto {
  margin: auto;
}

.mt-0 { margin-top: 0; }
.mt-16 { margin-top: var(--space-16); }
.mt-24 { margin-top: var(--space-24); }
.mt-32 { margin-top: var(--space-32); }
.mt-48 { margin-top: var(--space-48); }

.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: var(--space-16); }
.mb-24 { margin-bottom: var(--space-24); }
.mb-32 { margin-bottom: var(--space-32); }
.mb-48 { margin-bottom: var(--space-48); }

.p-16 { padding: var(--space-16); }
.p-24 { padding: var(--space-24); }
.p-32 { padding: var(--space-32); }

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

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

/* Buttons - primary, secondary, subtle variants */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color var(--transition-normal),
              color var(--transition-normal),
              box-shadow var(--transition-normal),
              transform var(--transition-fast),
              border-color var(--transition-normal);
  will-change: transform, box-shadow;
}

.btn-primary {
  background: radial-gradient(circle at 0 0, rgba(34, 197, 94, 0.22), transparent 55%),
              linear-gradient(135deg, #1d4ed8, #2563eb 45%, #22c55e 100%);
  color: #f9fafb;
  box-shadow: var(--shadow-md);
}

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

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
  border-color: rgba(148, 163, 184, 0.35);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}

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

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

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

/* Inputs & form controls */

.input,
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background-color: rgba(15, 23, 42, 0.95);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  transition: border-color var(--transition-normal),
              box-shadow var(--transition-normal),
              background-color var(--transition-normal);
}

.input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.85), 0 0 0 4px rgba(37, 99, 235, 0.35);
}

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

label {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.form-help {
  margin-top: 0.35rem;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Card component - for guides, tips, resources */

.card {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 0 0, rgba(37, 99, 235, 0.22), transparent 50%),
              linear-gradient(145deg, var(--color-surface), var(--color-surface-alt));
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-sm);
  padding: var(--space-20);
  overflow: hidden;
}

.card:hover {
  border-color: rgba(37, 99, 235, 0.85);
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.card-meta {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

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

/* Focus-visible global style for keyboard users */

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ========================================================================== 
   Accessibility & Motion
   ========================================================================== */

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

/* Utility background accents (for hero / immersive sections) */

.bg-gradient-gaming {
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.4), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(34, 197, 94, 0.35), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(15, 23, 42, 0.9), transparent 55%),
    #020617;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: var(--color-text-muted);
}

.badge-primary {
  background: var(--color-primary-soft);
  border-color: rgba(37, 99, 235, 0.75);
  color: #dbeafe;
}

.badge-accent {
  background: var(--color-accent-soft);
  border-color: rgba(34, 197, 94, 0.75);
  color: #dcfce7;
}
