/* ============================================================
   Afinko — Base reset + typography
   ============================================================ */

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }

a {
  color: var(--color-teal-700);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--dur-1) var(--ease-out);
}
a:hover { color: var(--color-teal-800); text-decoration: underline; }

p { margin: 0 0 1em; max-width: 64ch; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.25rem; margin: 0 0 1em; }
li { margin-bottom: .35em; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--color-ink-900);
  margin: 0 0 .5em;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-tight);
  text-wrap: balance;
}

h1 { font-size: clamp(var(--fs-40), 5.2vw, var(--fs-72)); }
h2 { font-size: clamp(var(--fs-28), 3.4vw, var(--fs-48)); }
h3 { font-size: var(--fs-24); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-18); line-height: var(--lh-snug); letter-spacing: var(--tracking-tight); }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-12) 0;
}

::selection { background: var(--color-teal-700); color: #fff; }

:where(button, input, select, textarea) { font: inherit; color: inherit; }

:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-2);
}

.skip-link {
  position: absolute;
  left: -9999px; top: 0;
  background: var(--color-ink-900); color: #fff;
  padding: .75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}
.section--tight { padding-block: clamp(var(--space-10), 6vw, var(--space-16)); }
.section--ink   { background: var(--color-ink-900); color: #e9edee; }
.section--ink h2, .section--ink h3, .section--ink h4 { color: #fff; }
.section--ink a { color: var(--color-teal-200); }
.section--paper { background: var(--color-surface-2); }
.section--well  { background: var(--color-surface-3); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-teal-700);
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  margin: 0 0 var(--space-5);
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--color-teal-700);
  display: block;
}
.section--ink .eyebrow { color: var(--color-teal-200); }
.section--ink .eyebrow::before { background: var(--color-teal-200); }

.lead {
  font-size: clamp(var(--fs-18), 1.6vw, var(--fs-20));
  line-height: var(--lh-relaxed);
  color: var(--color-ink-700);
  max-width: 56ch;
}

.measure { max-width: 64ch; }

/* utility text */
.t-mono { font-family: var(--font-mono); }
.t-display { font-family: var(--font-display); letter-spacing: var(--tracking-display); }
.t-muted { color: var(--color-fg-muted); }
.t-uppercase { text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); }
.t-small { font-size: var(--fs-14); }
.t-xsmall { font-size: var(--fs-12); }

/* visually-hidden but accessible */
.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;
}
