/* ============================================================
   BASE — reset, element defaults, accessibility primitives
   ============================================================ */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------- type ---------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-hero);
}

h2 {
  font-size: var(--fs-3xl);
}

h3 {
  font-size: var(--fs-xl);
  line-height: 1.14;
  letter-spacing: -0.015em;
}

h4 {
  font-size: var(--fs-lg);
  line-height: 1.24;
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 500;
  color: var(--ink);
}

em,
i {
  font-style: italic;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

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

img {
  height: auto;
}

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

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

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

hr {
  border: 0;
  border-top: var(--bw) solid var(--line);
}

/* ---------- selection & focus ---------- */

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

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

:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- accessibility primitives ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--s3);
  left: var(--s3);
  z-index: 200;
  padding: var(--s2) var(--s4);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--r1);
  transform: translateY(calc(-100% - var(--s5)));
  transition: transform var(--dur-2) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* ---------- global motion guard ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
