/* =============================================================================
 * BASE — reset, editorial typography, accessibility primitives
 * ===========================================================================*/

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

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

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-strong);
  text-wrap: balance;
}
h1 { font-size: var(--step-5); line-height: var(--lh-tight); letter-spacing: -0.02em; }
h2 { font-size: var(--step-4); line-height: var(--lh-tight); letter-spacing: -0.02em; }
h3 { font-size: var(--step-2); line-height: var(--lh-snug); letter-spacing: -0.012em; }
h4 { font-size: var(--step-1); line-height: var(--lh-snug); letter-spacing: -0.006em; }

p { text-wrap: pretty; max-width: var(--measure); }

a { color: inherit; text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }

button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
ul, ol { padding: 0; list-style: none; }
input, textarea, select, button { font: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

::selection { background: color-mix(in srgb, var(--cobalt) 18%, transparent); color: var(--text-strong); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  padding: 10px 16px; background: var(--accent); color: var(--on-accent);
  border-radius: var(--r-sm); font-weight: 600;
  transition: top var(--dur) var(--ease-out);
}
.skip-link:focus { top: 12px; }

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

/* Serif — used only for a few strategic phrases/words */
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: 0; }
em.serif, .serif em { font-style: italic; }

/* Quiet mono label (subtle, no decorative tick). */
.mono {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: none;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.mono::before { content: none; }

.text-muted { color: var(--text-muted); }
.accent-mint, .accent-peri { color: var(--accent-ink); }
.accent-clay { color: var(--clay); }

.lead {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 56ch;
}

/* Decorative techy layers are intentionally neutralized (kept as no-ops so any
   leftover markup class does nothing). */
.has-noise::after, .has-grid::before { content: none !important; display: none !important; }
.has-noise, .has-grid { position: relative; }

/* Hairline divider */
.rule, hr.rule { height: 1px; background: var(--border); border: 0; }
