/* ─── RESET + BASE ─────────────────────────────────────────────────── */

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

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

body {
  background: var(--black);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Selection */
::selection {
  background: var(--accent);
  color: var(--black);
}

/* Typography scale — precise and restrained */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.98;
  color: var(--text);
}

h1 { font-size: clamp(3rem, 8.5vw, 8rem); }
h2 { font-size: clamp(2.4rem, 5.5vw, 5rem); }
h3 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.1; }
h4 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.2; }

p {
  color: var(--text-2);
  max-width: 58ch;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

input, textarea, select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  outline: 0;
}

code, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 4px;
  border: 2px solid var(--black);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: 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: 0;
}

.skip-link {
  position: absolute;
  top: -48px; left: var(--s-4);
  z-index: 10000;
  background: var(--accent);
  color: var(--black);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: top var(--t-sm) var(--ease-out);
}
.skip-link:focus { top: var(--s-4); }

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

/* Layout primitives */
.wrap {
  max-width: var(--w-lg);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}
.wrap-sm { max-width: var(--w-sm); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-md { max-width: var(--w-md); margin: 0 auto; padding: 0 var(--gutter); }

/* Common utilities (sparingly) */
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.hi { color: var(--text); }
.accent { color: var(--accent); }

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}
