/* ================================================================
   TrkFit V4 — css/reset.css
   Modern CSS Reset — normalize browser inconsistencies
================================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background var(--tr), color var(--tr);
}

/* ── Typography resets ───────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--c-text);
}

p { line-height: var(--lh-loose); }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--tr);
}

a:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

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

/* ── Media resets ────────────────────────────────────────────── */
img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
  height: auto;
}

img { object-fit: cover; }

/* ── Form resets ─────────────────────────────────────────────── */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
  cursor: pointer;
}

button { -webkit-tap-highlight-color: transparent; }

input, textarea, select {
  cursor: text;
  -webkit-appearance: none;
  appearance: none;
}

textarea { resize: vertical; }

select { cursor: pointer; }

/* ── Table resets ────────────────────────────────────────────── */
table { border-collapse: collapse; border-spacing: 0; }

/* ── Remove animations for users who prefer reduced motion ───── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Focus styles (accessibility) ───────────────────────────── */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

/* ── Selection colour ────────────────────────────────────────── */
::selection {
  background: var(--c-accent-md);
  color: var(--c-text);
}

/* ── Scrollbar (thin on desktop) ─────────────────────────────── */
@media (min-width: 640px) {
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: var(--c-bg2); }
  ::-webkit-scrollbar-thumb { background: var(--c-border2); border-radius: var(--r-full); }
  ::-webkit-scrollbar-thumb:hover { background: var(--c-text3); }
}

/* ── SVG ─────────────────────────────────────────────────────── */
svg { flex-shrink: 0; }

/* ── Body scroll lock ────────────────────────────────────────── */
body.nav-open,
body.modal-open { overflow: hidden; }
