/* ================================================================
   APEX — Base
   Reset + body + typography + layout primitives.
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* Typography helpers */
.display { font-size: var(--t-display); line-height: 1.02; font-weight: 600; letter-spacing: -0.035em; }
.h1 { font-size: var(--t-h1); line-height: 1.06; font-weight: 600; letter-spacing: -0.03em; }
.h2 { font-size: var(--t-h2); line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; }
.h3 { font-size: var(--t-h3); line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.h4 { font-size: var(--t-h4); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.lead { font-size: var(--t-lg); line-height: 1.55; color: var(--graphite); }
.muted { color: var(--graphite); }
.tiny { font-size: var(--t-sm); color: var(--graphite); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
}
.eyebrow::before { content: ""; width: 18px; height: 1.5px; background: var(--orange); }
.eyebrow--plain::before { display: none; }

/* Containers and sections */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { width: 100%; max-width: var(--container-narrow); margin: 0 auto; padding: 0 24px; }
.container-text { width: 100%; max-width: var(--container-text); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--sy) 0; }
.section-lg { padding: var(--sy-lg) 0; }
.section-sm { padding: calc(var(--sy) * 0.66) 0; }
.bg-paper { background: var(--paper); }
.bg-fog { background: var(--fog); }
.bg-ink { background: var(--ink); color: var(--white); }
.bg-ink .muted, .bg-ink .lead { color: rgba(255,255,255,0.7); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 960px) {
  .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { justify-content: center; text-align: center; }

.section-head { max-width: 760px; margin: 0 auto var(--s-8); text-align: center; }
.section-head .eyebrow { margin-bottom: 16px; }
.section-head .h2 { margin-bottom: 16px; }

/* Stagger-in animation */
.reveal { opacity: 0; transform: translateY(16px); animation: reveal 600ms var(--ease) forwards; }
.reveal-1 { animation-delay: 60ms; }
.reveal-2 { animation-delay: 160ms; }
.reveal-3 { animation-delay: 260ms; }
.reveal-4 { animation-delay: 360ms; }
.reveal-5 { animation-delay: 460ms; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
