:root {
  /* Color Palette */
  --color-bg: #02030a; /* deep space black */
  --color-bg-elevated: #05071a;
  --color-text: #f5f7ff;
  --color-text-muted: #a7b0d0;

  --color-primary: #00e5ff; /* neon cyan */
  --color-primary-soft: rgba(0, 229, 255, 0.15);
  --color-accent-pink: #ff2b8a;
  --color-accent-yellow: #ffd93b;
  --color-accent-silver: #cfd4ff;

  --color-success: #2ee77b;
  --color-warning: #ffb347;
  --color-danger: #ff4b5c;

  --gray-50: #0b0c1b;
  --gray-100: #14162a;
  --gray-200: #1f2238;
  --gray-300: #2a2f47;
  --gray-400: #3b4162;
  --gray-500: #51597e;
  --gray-600: #6b7497;
  --gray-700: #8b92b6;
  --gray-800: #b5bad8;
  --gray-900: #e0e4ff;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Press Start 2P", "VT323", system-ui, monospace; /* pixel / arcade style */

  --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.375rem;  /* 22px */
  --font-size-2xl: 1.75rem;  /* 28px */
  --font-size-3xl: 2.25rem;  /* 36px */
  --font-size-4xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

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

  /* Radii (slightly pixelated / chunky) */
  --radius-none: 0;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-pill: 999px;

  /* Shadows (neon / glow) */
  --shadow-soft: 0 0 0 1px rgba(0, 0, 0, 0.7), 0 12px 24px rgba(0, 0, 0, 0.5);
  --shadow-neon-cyan: 0 0 14px rgba(0, 229, 255, 0.8), 0 0 32px rgba(0, 229, 255, 0.5);
  --shadow-neon-pink: 0 0 14px rgba(255, 43, 138, 0.8), 0 0 32px rgba(255, 43, 138, 0.5);
  --shadow-focus: 0 0 0 2px #02030a, 0 0 0 4px #00e5ff;

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

  /* Layout */
  --container-max-width: 1120px;
}

/* ==========================
   RESET / NORMALIZE
   ========================== */

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

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

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

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

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

:root {
  color-scheme: dark;
}

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

/* ==========================
   BASE STYLES
   ========================== */

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background: radial-gradient(circle at top, #06133a 0, #02030a 55%, #000000 100%);
  color: var(--color-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: var(--line-height-tight);
  color: var(--color-accent-yellow);
}

h1 {
  font-size: clamp(var(--font-size-3xl), 4vw, var(--font-size-4xl));
  margin-bottom: var(--space-6);
}

h2 {
  font-size: clamp(var(--font-size-2xl), 3vw, var(--font-size-3xl));
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--font-size-xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

h4, h5, h6 {
  font-size: var(--font-size-lg);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

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

strong, b {
  font-weight: 600;
  color: var(--color-accent-silver);
}

code, pre {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent-pink));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

a:hover::after,
a:focus-visible::after {
  transform: scaleX(1);
}

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

hr {
  border: none;
  border-top: 1px solid var(--gray-300);
  margin: var(--space-8) 0;
}

/* ==========================
   ACCESSIBILITY & FOCUS
   ========================== */

:focus {
  outline: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

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

/* ==========================
   UTILITIES
   ========================== */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-6);
  }
}

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

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

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

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

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

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

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

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

/* Spacing utilities (small curated set) */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

.pt-4 { padding-top: var(--space-4); }
.pt-8 { padding-top: var(--space-8); }
.pb-4 { padding-bottom: var(--space-4); }
.pb-8 { padding-bottom: var(--space-8); }

/* Width helpers */
.w-full { width: 100%; }

/* ==========================
   COMPONENTS
   ========================== */

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-primary);
  background: radial-gradient(circle at top left, rgba(0, 229, 255, 0.25), rgba(0, 0, 0, 0.95));
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-neon-cyan);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: var(--color-accent-pink);
  box-shadow: var(--shadow-neon-pink);
  background: radial-gradient(circle at top left, rgba(255, 43, 138, 0.35), rgba(0, 0, 0, 0.95));
}

.btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: var(--shadow-soft);
}

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

.btn--secondary {
  border-color: var(--color-accent-yellow);
  background: linear-gradient(135deg, rgba(20, 22, 42, 0.9), rgba(43, 40, 84, 0.9));
  box-shadow: 0 0 0 1px rgba(255, 217, 59, 0.1);
}

.btn--secondary:hover {
  border-color: var(--color-accent-pink);
}

.btn--ghost {
  border-color: var(--gray-400);
  background: transparent;
  box-shadow: none;
}

/* --- Form inputs --- */

.input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-400);
  background-color: rgba(8, 10, 30, 0.95);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition:
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    background-color var(--transition-normal);
}

.input::placeholder,
textarea::placeholder {
  color: var(--gray-600);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.6), 0 0 18px rgba(0, 229, 255, 0.4);
  outline: none;
}

.input[disabled],
select[disabled],
textarea[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-display);
  color: var(--color-accent-silver);
}

/* --- Cards --- */

.card {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(10, 12, 38, 0.98), rgba(7, 12, 60, 0.98));
  border: 1px solid rgba(0, 229, 255, 0.25);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      135deg,
      rgba(0, 229, 255, 0.12) 0,
      transparent 40%,
      transparent 60%,
      rgba(255, 43, 138, 0.12) 100%
  );
  opacity: 0.4;
  mix-blend-mode: screen;
  pointer-events: none;
}

.card-header {
  position: relative;
  margin-bottom: var(--space-4);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent-yellow);
}

.card-body {
  position: relative;
  color: var(--color-text-muted);
}

/* --- Pixel / arcade accents (optional helpers) --- */

.pixel-border {
  border-radius: var(--radius-none);
  box-shadow:
    0 0 0 2px #000,
    0 0 0 4px var(--color-primary),
    0 0 12px rgba(0, 229, 255, 0.8);
}

.pixel-shadow {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.9),
    4px 4px 0 0 #000,
    8px 8px 0 0 rgba(0, 229, 255, 0.8);
}

/* ==========================
   RESPONSIVE TWEAKS
   ========================== */

@media (max-width: 600px) {
  h1 {
    margin-bottom: var(--space-4);
  }

  .card {
    padding: var(--space-4);
  }

  .btn {
    width: 100%;
  }
}
