/* ============================================================
   Base — reset, typography, layout primitives
   ============================================================ */

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

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

body {
  font-family: var(--font-display);
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(83, 252, 24, 0.03) 0%, transparent 100%), var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: var(--fs-md);
  font-weight: 500;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
svg { flex-shrink: 0; }

::selection { background: var(--accent); color: #000; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

/* Mono utility — labels, eyebrows, counts */
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
}

/* Skip link for a11y */
.skip-link {
  position: absolute; left: -9999px; top: var(--sp-3); z-index: var(--z-toast);
  background: var(--accent); color: #000;
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm);
  font-weight: 700;
}
.skip-link:focus { left: var(--sp-3); }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

/* Pages sit below the fixed header and above the mobile bottom nav */
.page {
  padding-block: var(--sp-6) calc(var(--sp-8) + var(--bottomnav-h));
  min-height: 70vh;
}

.section { margin-block: var(--sp-7); }
.section:first-child { margin-top: var(--sp-5); }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); margin-bottom: var(--sp-5);
}
.section-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  display: inline-flex; align-items: center; gap: var(--sp-3);
}
.section-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: var(--radius-pill);
}
.section-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--fs-sm);
  display: inline-flex; align-items: center; gap: var(--sp-1);
  transition: color var(--dur) var(--ease);
}
.section-link:hover { color: var(--text); }

/* Headings */
h1, h2, h3 {
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}

.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;
}
.hidden { display: none !important; }

/* Scrollbars — thin, dark */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); }
*::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
