/* ========================================================================== 
   Variables
   ========================================================================== */
:root {
  /* Color Palette - NecroDancer Neon */
  --color-bg: #05060a; /* Deep space black */
  --color-bg-elevated: #0a0c12;
  --color-bg-alt: #101320;

  --color-text: #e5ecff;
  --color-text-muted: #9aa4c6;

  --color-primary: #27e5ff;   /* Electric cyan */
  --color-primary-soft: rgba(39, 229, 255, 0.16);
  --color-accent: #ff3366;    /* Blood neon red */
  --color-accent-soft: rgba(255, 51, 102, 0.18);
  --color-purple: #a95cff;    /* Neon purple */
  --color-silver: #c4d0e8;    /* Metallic silver */

  --color-success: #4ade80;
  --color-warning: #facc15;
  --color-danger: #fb3b6a;

  --gray-50: #0b0d16;
  --gray-100: #151826;
  --gray-200: #1e2233;
  --gray-300: #2b3144;
  --gray-400: #3a4157;
  --gray-500: #4b5571;
  --gray-600: #646f8f;
  --gray-700: #8a95b5;
  --gray-800: #b5bfdc;
  --gray-900: #e2e7ff;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, 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.3;
  --line-height-normal: 1.6;

  /* 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 */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Shadows (neon-inspired) */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-strong: 0 18px 45px rgba(0, 0, 0, 0.9);
  --shadow-neon-cyan: 0 0 16px rgba(39, 229, 255, 0.5), 0 0 42px rgba(39, 229, 255, 0.25);
  --shadow-neon-magenta: 0 0 16px rgba(255, 51, 153, 0.5), 0 0 42px rgba(255, 51, 153, 0.25);

  /* Transitions & Motion */
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 320ms;

  --easing-standard: cubic-bezier(0.19, 1, 0.22, 1); /* cinematic ease-out */
  --easing-snappy: cubic-bezier(0.36, 0.66, 0.04, 1);

  /* Layout */
  --container-max-width: 1180px;
  --container-padding-x: 1.5rem;
}

/* Reduced motion variables */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-normal: 0ms;
    --duration-slow: 0ms;
  }
}


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

* {
  margin: 0;
}

html,
body {
  height: 100%;
}

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

body {
  -webkit-font-smoothing: antialiased;
}

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

img {
  height: auto;
}

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

button {
  border: none;
  padding: 0;
  background-color: transparent;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

textarea {
  resize: vertical;
}

[hidden] {
  display: none !important;
}


/* ========================================================================== 
   Base Typography & Layout
   ========================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  text-rendering: optimizeLegibility;

  /* Subtle star-field / vignette gradient to hint dungeon space */
  background-image:
    radial-gradient(circle at 10% 0%, rgba(39, 229, 255, 0.09) 0, transparent 50%),
    radial-gradient(circle at 90% 100%, rgba(169, 92, 255, 0.12) 0, transparent 55%),
    radial-gradient(circle at 50% 120%, rgba(255, 51, 102, 0.18) 0, transparent 60%),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0.85) 0, rgba(0, 0, 0, 0.98) 55%);
  background-attachment: fixed;
}

main {
  min-height: 100vh;
}

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

strong {
  font-weight: 600;
  color: var(--color-text);
}

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

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

/* Headings - retro-futuristic display style */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: var(--line-height-snug);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-silver);
}

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

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

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

h4 {
  font-size: var(--font-size-2xl);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

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

h6 {
  font-size: var(--font-size-lg);
  margin-top: var(--space-2);
  margin-bottom: var(--space-1);
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  position: relative;
  transition: color var(--duration-normal) var(--easing-standard),
    text-shadow var(--duration-normal) var(--easing-standard);
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.1em;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-purple));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform var(--duration-fast) var(--easing-snappy);
}

a:hover::after {
  transform: scaleX(1);
}

a:hover {
  color: var(--color-accent);
  text-shadow: 0 0 12px rgba(39, 229, 255, 0.7);
}

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


/* ========================================================================== 
   Accessibility & Focus States
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px rgba(5, 6, 10, 0.9), var(--shadow-neon-cyan);
}

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

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


/* ========================================================================== 
   Layout Utilities
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding-x);
}

.section {
  padding-block: var(--space-16);
}

.section--tight {
  padding-block: var(--space-10);
}

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

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

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

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

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

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

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

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

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

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

.flex-wrap {
  flex-wrap: wrap;
}

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

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

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

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

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-auto-fit-min-250 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

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

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


/* ========================================================================== 
   Utility Helpers
   ========================================================================== */
.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;
}

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

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

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

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

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

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

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

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

.mx-auto {
  margin-inline: auto;
}



/* Simple rhythm-inspired accent line */
.hr-glow {
  border: 0;
  height: 1px;
  width: 100%;
  margin-block: var(--space-6);
  background: linear-gradient(90deg,
      rgba(39, 229, 255, 0),
      rgba(39, 229, 255, 0.9),
      rgba(255, 51, 102, 0.9),
      rgba(169, 92, 255, 0.9),
      rgba(39, 229, 255, 0));
  box-shadow: 0 0 18px rgba(39, 229, 255, 0.5);
}


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

/* Buttons - neon, high-energy */
.button,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  --btn-bg: linear-gradient(135deg, var(--color-primary), var(--color-purple));
  --btn-bg-hover: linear-gradient(135deg, var(--color-accent), var(--color-primary));

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-inline: 1.4rem;
  padding-block: 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(196, 208, 232, 0.3);
  background-image: var(--btn-bg);
  color: #02030a!important;
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: var(--shadow-neon-cyan);
  transition:
    background-image var(--duration-fast) var(--easing-snappy),
    transform var(--duration-fast) var(--easing-snappy),
    box-shadow var(--duration-fast) var(--easing-snappy),
    border-color var(--duration-fast) var(--easing-snappy),
    opacity var(--duration-fast) linear;
}

.button:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  background-image: var(--btn-bg-hover);
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow-neon-magenta);
}

.button:active,
button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 0 0 1px rgba(2, 3, 10, 0.8), 0 0 12px rgba(39, 229, 255, 0.7);
}

.button:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="reset"]:disabled {
  opacity: 0.4;
  box-shadow: none;
}

.button--ghost {
  background-image: none;
  background-color: rgba(12, 16, 32, 0.9);
  color: var(--color-silver)!important;
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: var(--shadow-soft);
}

.button--ghost:hover {
  background-color: rgba(25, 32, 64, 0.95);
  box-shadow: var(--shadow-neon-cyan);
}


/* Inputs & form controls */
.input,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"] {
  width: 100%;
  padding-inline: 0.9rem;
  padding-block: 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-400);
  background-color: rgba(10, 12, 20, 0.95);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  box-shadow: inset 0 0 0 1px rgba(5, 6, 10, 0.9);
  transition: border-color var(--duration-normal) var(--easing-standard),
    box-shadow var(--duration-normal) var(--easing-standard),
    background-color var(--duration-normal) var(--easing-standard);
}

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

.input:focus-visible,
select:focus-visible,
textarea:focus-visible,
input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="search"]:focus-visible,
input[type="url"]:focus-visible,
input[type="number"]:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(5, 6, 10, 0.9), var(--shadow-neon-cyan);
  background-color: #050714;
}

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

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-700);
}


/* Cards - elevated neon panels for sections like soundtrack, gallery, challenges */
.card {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(39, 229, 255, 0.18), transparent 60%),
    radial-gradient(circle at bottom right, rgba(255, 51, 102, 0.14), transparent 55%),
    linear-gradient(145deg, rgba(8, 10, 20, 0.96), rgba(12, 14, 26, 0.98));
  border: 1px solid rgba(157, 178, 206, 0.32);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

.card::before {
  /* Subtle animated scanline / rhythm glow overlay */
  content: "";
  position: absolute;
  inset-inline: -40%;
  top: -120%;
  height: 260%;
  background: linear-gradient(
      120deg,
      transparent 0,
      rgba(39, 229, 255, 0.08) 15%,
      rgba(169, 92, 255, 0.16) 50%,
      rgba(255, 51, 102, 0.08) 85%,
      transparent 100%
    );
  opacity: 0;
  transform: translate3d(0, 0, 0);
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
  animation: cardSweep 1.4s var(--easing-standard) 1;
}

@keyframes cardSweep {
  0% {
    transform: translate3d(-30%, -30%, 0);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: translate3d(30%, 30%, 0);
    opacity: 0;
  }
}

.card--subtle {
  background: linear-gradient(135deg, rgba(10, 12, 22, 0.96), rgba(16, 18, 30, 0.98));
  border-color: rgba(75, 85, 99, 0.6);
  box-shadow: var(--shadow-soft);
}

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

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

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

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


/* ========================================================================== 
   Rhythm & Neon Micro-Effects (generic, optional)
   ========================================================================== */

/* Subtle pulsing effect for key CTA buttons or badges */
.pulse-soft {
  animation: pulseSoft 1.6s ease-in-out infinite;
}

@keyframes pulseSoft {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(39, 229, 255, 0.6);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 12px rgba(39, 229, 255, 0);
  }
}

/* Faux scanline overlay utility for hero / media sections */
.scanlines::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px
    );
  background-size: 100% 2px;
  mix-blend-mode: soft-light;
  opacity: 0.2;
}

@media (prefers-reduced-motion: reduce) {
  .pulse-soft {
    animation: none;
  }
  .card:hover::before {
    animation: none;
    opacity: 0;
  }
}
