/* ============================================================
   base.css
   Reset + body defaults + typography baseline.
   Loaded after tokens.css on every page.
   ============================================================ */

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

html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--f-grot);
  background: var(--c-paper);
  color: var(--c-ink);
  font-size: var(--t-body);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Text selection uses brand accent */
::selection { background: var(--c-accent); color: var(--c-accent-ink); }

/* Default paragraph rhythm */
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* Links — Swiss = subtle by default, accent on hover */
a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-accent); }

/* Headings reset (we always style explicitly per use) */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: normal;
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

/* Lists reset */
ul, ol { margin: 0; padding: 0; list-style: none; }

/* Images sit nicely in a layout */
img, svg, video { max-width: 100%; display: block; }

/* Forms inherit body font */
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

/* ─── Focus styles — accessibility ──────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* ─── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ─── Utility atoms ─────────────────────────────────────── */
.mono {
  font-family: var(--f-mono);
  font-size: var(--t-meta);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.serif {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
}
.accent { color: var(--c-accent); }
.hidden { display: none !important; }
.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;
}

/* Page-level wrapper. Use on <main> for consistent horizontal padding. */
.page-pad { padding-left: var(--pad); padding-right: var(--pad); }

/* ─── Section head — the recurring 3-col kicker / title / meta row */
.section-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: var(--space-gutter);
  padding-bottom: var(--space-md);
  border-bottom: var(--bw) solid var(--c-rule);
}
.section-head__l, .section-head__r {
  font-family: var(--f-mono);
  font-size: var(--t-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-ink-mute);
}
.section-head__r { text-align: right; }
.section-head__title {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: var(--t-h2);
  letter-spacing: -0.01em;
  font-weight: 400;
  line-height: 1;
  color: var(--c-ink);
  text-align: center;
}

/* Larger section title alt — for hero sections */
.section-head--big .section-head__title { font-size: var(--t-h1); }

/* Scroll-reveal default state (toggled by /js/reveal.js) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Mobile overrides ──────────────────────────────────── */
@media (max-width: 960px) {
  body { font-size: 15px; }
  .section-head {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .section-head__title { text-align: left; font-size: clamp(24px, 5.6vw, 40px); }
  .section-head__r { display: none; }
}

@media (max-width: 640px) {
  :root { --pad: 16px; }
}
