/* Reset, page background (dot grid and film grain), layout, type, reveals. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 96px;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--bg);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* the faint dot grid behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(245, 245, 244, 0.07) 1px, transparent 1.2px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 85%);
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 85%);
}
/* film grain: one static SVG noise tile, nothing animates */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, footer { position: relative; z-index: var(--z-content); }

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
img, svg, canvas, video { display: block; max-width: 100%; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
::selection { background: var(--accent); color: var(--bg); }

/* blue focus rings everywhere, never removed */
:focus-visible { outline: 2px solid var(--info); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed;
  left: var(--gutter);
  top: 12px;
  z-index: calc(var(--z-preloader) + 1);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform var(--base) var(--ease-out);
}
.skip:focus-visible { transform: none; }
main:focus { outline: none; }

.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;
}

/* ---------- layout ---------- */
.section {
  position: relative;
  padding: var(--section-y) var(--gutter);
}
.wrap { max-width: var(--max); margin: 0 auto; }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(32px, 6vh, 64px);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
  letter-spacing: 0.02em;
}
.eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--accent); }
.h2 {
  font-family: var(--display);
  font-size: var(--step-5);
  font-weight: 650;
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.h2 em { font-style: normal; color: var(--accent); }
.lede { max-width: 52ch; color: var(--muted); font-size: var(--step-1); line-height: 1.45; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* a visible placeholder for missing content: the audit's TODOs show on the page */
.todo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px dashed var(--info);
  border-radius: 6px;
  color: #9DC1FB;
  font-family: var(--mono);
  font-size: var(--step--2);
  font-weight: 500;
  line-height: 1.5;
}

/* ---------- reveals: children rise in with a stagger ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.is-in .reveal, .reveal.is-in { opacity: 1; transform: none; }

/* without JavaScript the page shows a plain card */
.nojs {
  display: none;
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding: var(--gutter);
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  max-width: 44rem;
}
.nojs h1 { font-family: var(--display); font-size: var(--step-5); line-height: 0.95; letter-spacing: -0.03em; }
.nojs a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
