/* =============================================================
   MCU Tracker — Base Styles (base.css)
   Reset, typography defaults, global elements
   ============================================================= */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-void);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Links ────────────────────────────────────────────────── */
a {
  color: var(--color-hero-red);
  text-decoration: none;
  transition: color var(--transition-tap);
}
a:hover {
  color: var(--color-text-primary);
}

/* ── Headings (Barlow Condensed) ──────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-text-primary);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.display-xl {
  font-size: var(--text-display-xl);
  font-weight: var(--weight-bold);
  line-height: 1.05;
}

.display {
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  line-height: 1.1;
}

h1, .h1 {
  font-size: var(--text-h1);
  font-weight: var(--weight-semibold);
}

h2, .h2 {
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
}

/* Micro / Eyebrow label style */
.micro {
  font-family: var(--font-display);
  font-size: var(--text-micro);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
}

/* ── Body text helpers ────────────────────────────────────── */
.text-secondary {
  color: var(--color-text-secondary);
}
.text-muted {
  color: var(--color-text-muted);
}

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

/* ── Monospace (stats, scores, countdowns) ────────────────── */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── Selection ────────────────────────────────────────────── */
::selection {
  background: var(--color-hero-red);
  color: var(--color-text-primary);
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-void);
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) var(--color-void);
}

/* ── Focus ────────────────────────────────────────────────── */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

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

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

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

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

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

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Animations ───────────────────────────────────────────── */
.rise-in {
  animation: riseIn 0.6s ease-out forwards;
  opacity: 0;
  transform: translateY(16px);
}

@keyframes riseIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rise-in-1 { animation-delay: 0.1s; }
.rise-in-2 { animation-delay: 0.2s; }
.rise-in-3 { animation-delay: 0.3s; }
.rise-in-4 { animation-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .rise-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
