/* Base: reset, typography, utilities, content placeholders (PRD §5, §9.3). */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-700);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Decorative motion (e.g. the rotating lens rings) must never cause sideways scrolling, on any browser. */
main { overflow-x: clip; }

[hidden] { display: none !important; }

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

a { color: inherit; }

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

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); line-height: 1.25; letter-spacing: -0.01em; }
h4 { font-size: var(--step-1); line-height: 1.3; letter-spacing: 0; }

/* Signature device: one italic accent phrase per headline (PRD §5.3). */
h1 em, h2 em, h3 em, .display em {
  font-style: italic;
  color: var(--accent, var(--detect-600));
}
/* Colour is spent once, in the hero; section headlines keep the italic voice in ink. */
.section h2 em { color: inherit; }

.accent-restore { --accent: var(--restore-600); }
.accent-detect { --accent: var(--detect-600); }

strong { font-weight: 600; color: var(--ink-900); }

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

::selection { background: var(--detect-100); color: var(--ink-900); }

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 300;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-s);
  background: var(--ink-900);
  color: var(--surface);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  color: var(--ink-500);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
}
.eyebrow.no-rule::before { display: none; }

.lede {
  max-width: 38rem;
  color: var(--ink-500);
  font-size: var(--step-1);
  line-height: 1.6;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.text-link {
  color: var(--detect-700);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.text-link:hover { text-decoration-thickness: 2px; }

.small { font-size: var(--step--1); }
.muted { color: var(--ink-500); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Small utilities (no inline styles: the CSP disallows them). */
.mt-s { margin-top: 1rem; }
.mt-m { margin-top: 1.5rem; }
.mt-l { margin-top: 2.5rem; }
.mx-auto { margin-inline: auto; }
.align-start { align-items: start !important; }
.center-text { text-align: center; }
