/* ============================================
   PIXELCLUB — Base / Reset Styles
   ============================================ */

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Keyboard Focus Accessibility ── */
:focus-visible {
  outline: 2px solid var(--accent-games) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 10px var(--accent-games) !important;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-normal);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Selection ── */
::selection {
  background-color: var(--accent-games);
  color: var(--text-inverse);
}
::-moz-selection {
  background-color: var(--accent-games);
  color: var(--text-inverse);
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-games);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-card) var(--bg-primary);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-pixel);
  line-height: var(--line-height-tight);
  letter-spacing: 1px;
  color: var(--text-primary);
}

h1 { font-size: var(--pixel-3xl); }
h2 { font-size: var(--pixel-2xl); }
h3 { font-size: var(--pixel-xl); }
h4 { font-size: var(--pixel-lg); }
h5 { font-size: var(--pixel-base); }
h6 { font-size: var(--pixel-sm); }

p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

/* ── Links ── */
a {
  color: var(--accent-games);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-hover);
}

/* ── Images ── */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Lists ── */
ul, ol {
  list-style: none;
}

/* ── Buttons ── */
button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  background: none;
  color: inherit;
}

/* ── Inputs ── */
input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  outline: none;
  border: none;
}

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }

/* ── Flex Utilities ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.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-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ── Grid Utilities ── */
.grid { display: grid; }

/* ── Text Utilities ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-pixel { font-family: var(--font-pixel); }
.text-body { font-family: var(--font-body); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-cyan { color: var(--accent-games); }
.text-magenta { color: var(--accent-movies); }
.text-yellow { color: var(--accent-series); }
.text-green { color: var(--pixel-green); }

/* ── Spacing Utilities ── */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.pt-navbar { padding-top: var(--navbar-height); }

/* ── Visibility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.hidden { display: none !important; }

/* ── App wrapper ── */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#page-content {
  flex: 1;
  padding-top: var(--navbar-height);
  position: relative;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
  h1 { font-size: var(--pixel-xl); }
  h2 { font-size: var(--pixel-lg); }
  h3 { font-size: var(--pixel-base); }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-sm);
  }
  h1 { font-size: var(--pixel-lg); }
  h2 { font-size: var(--pixel-base); }
}

/* ============================================
   REDUCED MOTION — Accessibility
   Respects the user's OS-level "reduce motion" setting.
   Neutralizes infinite/decorative animations (CRT flicker, glitch, floating
   pixels, shimmer, neon pulse…) that can trigger vestibular or photosensitive
   discomfort, while keeping the UI fully functional.
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  /* Ensure elements that start hidden for an entrance animation stay visible */
  .slide-up,
  .stagger-item,
  .content-card-image img,
  .img-fade-in {
    opacity: 1 !important;
    transform: none !important;
  }
}
