/* =========================================================
   Base: reset, typography, grid, utilities
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--color-bg-page);
}

body {
  margin: 0;
  background: var(--color-bg-page);
  color: var(--color-text-primary);
  font: 500 var(--fs-body) / 1.4 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; font: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

:focus-visible {
  outline: 2px solid var(--color-border-strong);
  outline-offset: 3px;
}

/* ---------- typography (Figma text styles) ---------- */
.t-display-xl { font-size: var(--fs-display-xl); font-weight: 700; line-height: 0.88; letter-spacing: -0.05em; }
.t-display-l  { font-size: var(--fs-display-l);  font-weight: 600; line-height: 0.9;  letter-spacing: -0.05em; }
.t-copy-l     { font-size: var(--fs-copy-l);     font-weight: 600; line-height: 1.2;  letter-spacing: -0.03em; }
.t-heading-s  { font-size: var(--fs-heading-s);  font-weight: 600; line-height: 1.15; letter-spacing: -0.03em; }
.t-body       { font-size: var(--fs-body);       font-weight: 500; line-height: 1.4;  letter-spacing: -0.01em; }
.t-label      { font-size: var(--fs-label);      font-weight: 700; line-height: 1.2;  letter-spacing: -0.005em; }

/* bold in running text: an orange highlight, like the text selection (same weight, no extra
   space, so a highlight never moves the line breaks; clone keeps it neat across lines) */
:is(.t-copy-l, .t-body) :is(strong, b) {
  font-weight: inherit;
  background: var(--color-accent-surface);
  color: var(--color-accent-on);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.t-secondary { color: var(--color-text-secondary); }
.t-accent    { color: var(--color-text-accent); }

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--margin);
}

/* 12 / 8 / 4 columns, 12px gutter. Children place themselves with grid-column. */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
}

.section { padding-top: var(--space-section); }
.section--s { padding-top: var(--space-section-s); }

/* ---------- utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: var(--space-12);
  left: var(--margin);
  z-index: 100;
  padding: var(--space-8) var(--space-12);
  background: var(--color-accent-surface);
  color: var(--color-accent-on);
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

/* ---------- reveal primitives (driven by js/reveal.js) ----------
   Only hidden when JS runs and the user accepts motion,
   so the page is always readable without it. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { visibility: hidden; }
}
.js [data-reveal].is-ready { visibility: visible; }

/* SplitText line masks: room for ascenders and descenders under tight line heights,
   and sideways for glyphs that overhang under tight letter-spacing (the last "s" of a display title) */
.line-mask {
  padding-block: 0.08em 0.14em;
  margin-block: -0.08em -0.14em;
  padding-inline: 0.1em;
  margin-inline: -0.1em;
}
