/* Reset, page defaults, type styles, and the shared section scaffold. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font: var(--type-sans-small);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

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

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

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

/* Trims the line box to cap-height/baseline where Figma uses "text-box-trim". */
.trim { text-box: trim-both cap alphabetic; }

/* ---------- Type styles (one class per Figma text style) ---------- */
.t-serif-xl          { font: var(--type-serif-xl); }
.t-serif-large-bold  { font: var(--type-serif-large-bold); letter-spacing: var(--tracking-tight); }
.t-serif-large       { font: var(--type-serif-large); letter-spacing: var(--tracking-tight); }
.t-serif-medium-bold { font: var(--type-serif-medium-bold); }
.t-serif-small-bold  { font: var(--type-serif-small-bold); }
.t-sans-large        { font: var(--type-sans-large); }
.t-sans-medium-bold  { font: var(--type-sans-medium-bold); }
.t-sans-small-bold   { font: var(--type-sans-small-bold); }
.t-sans-small        { font: var(--type-sans-small); }
.t-sans-xs-bold      { font: var(--type-sans-xs-bold); }
.t-sans-caption-bold { font: var(--type-sans-caption-bold); }
.t-sans-caption      { font: var(--type-sans-caption); }

/* ---------- Section scaffold ---------- */
.section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--section-space) var(--page-gutter);
  overflow: clip;
}

/* Centered title + supporting line, used at the top of most sections. */
.section-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  text-align: center;
}
.section-title > * { width: 100%; }
.section-title__sub { color: var(--text-secondary); text-wrap: pretty; } /* no lone last word */

.on-dark { color: var(--text-on-dark); }
.on-dark .section-title__sub { color: var(--text-on-dark-tertiary); }
