/*
 * base.css — Element resets, base typography, global defaults
 *
 * Depends on: tokens.css (must be loaded first)
 */


/* ── Box sizing ───────────────────────────────────────────────────── */

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


/* ── Hidden attribute override ───────────────────────────────────── */

[hidden] {
  display: none !important;
}


/* ── Root & scroll ───────────────────────────────────────────────── */

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

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


/* ── Body ────────────────────────────────────────────────────────── */

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ── Headings ────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }


/* ── Body text ───────────────────────────────────────────────────── */

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

.lead {
  font-size: var(--text-lead);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

strong, b {
  font-weight: 700;
}

em, i {
  font-style: italic;
}

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


/* ── Links ───────────────────────────────────────────────────────── */

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

a:visited {
  color: var(--color-primary);
}


/* ── Lists ───────────────────────────────────────────────────────── */

ul, ol {
  padding-left: var(--space-6);
}

li {
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}


/* ── Images & media ──────────────────────────────────────────────── */

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

img {
  height: auto;
}


/* ── Forms (element-level defaults) ──────────────────────────────── */

input, button, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}


/* ── Tables ──────────────────────────────────────────────────────── */

table {
  border-collapse: collapse;
  width: 100%;
}


/* ── Horizontal rule ─────────────────────────────────────────────── */

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}


/* ── Focus styles (accessibility) ────────────────────────────────── */

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}


/* ── Container utility ───────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container-default);
  margin-inline: auto;
  padding-inline: var(--container-px-mobile);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

@media (min-width: 640px) {
  .container {
    padding-inline: var(--container-px-desktop);
  }
}


/* ── Section spacing ─────────────────────────────────────────────── */

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

@media (min-width: 1024px) {
  .section {
    padding-block: var(--space-24);
  }
}


/* ── Visually hidden (accessible, not display:none) ──────────────── */

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


/* ── Long-form content (Privacy, Terms pages) ────────────────────── */

.prose h2 {
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  font-size: var(--text-h2);
  color: var(--color-primary);
}

.prose h3 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

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

.prose ul,
.prose ol {
  margin-bottom: var(--space-4);
}

.prose li {
  margin-bottom: var(--space-2);
}
