/* ── BASE & RESET ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
}

/* ── TYPOGRAPHY ──────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

h1 { font-size: clamp(2.6rem, 7vw, 5.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3.2rem); line-height: 1.05; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); letter-spacing: -0.02em; line-height: 1.2; font-family: var(--font-body); font-weight: 700; }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

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

/* ── ACCESSIBILITY ──────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--sp-3);
  z-index: 9999;
  padding: var(--sp-2) var(--sp-4);
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  /* Off-screen link that cannot widen the page; revealed on keyboard focus. */
  clip-path: inset(50%);
}
.skip-link:focus {
  left: var(--sp-3);
  clip-path: none;
}

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

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

.container {
  width: var(--container);
  margin-inline: auto;
}

.container-sm {
  width: var(--container-sm);
  margin-inline: auto;
}

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