/* ============================================================
   Base · typography, body, layout primitives
   ============================================================ */

html {
  background-color: var(--bg-base);
  color-scheme: dark;
}

body {
  background-color: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  letter-spacing: var(--tracking-normal);
  overflow-x: hidden;
  position: relative;
}

/* --- Headings -------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--fs-6xl);
  font-weight: var(--fw-bold);
}

h2 {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-bold);
}

h3 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-semibold);
}

h4 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}

h5 {
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
}

h6 {
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
}

/* --- Paragraphs ------------------------------------------ */
p {
  color: var(--text-muted);
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  max-width: 65ch;
}

/* --- Links ----------------------------------------------- */
a {
  color: var(--accent-400);
  transition: color var(--dur-fast) var(--ease-quick);
}

a:hover {
  color: var(--accent-300);
}

/* --- Code & mono ----------------------------------------- */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
  letter-spacing: var(--tracking-mono);
}

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

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* --- Layout: sections ------------------------------------ */
.section {
  padding-block: clamp(4rem, 8vw, 7rem);
  position: relative;
}

.section-tight {
  padding-block: clamp(3rem, 5vw, 4.5rem);
}

/* --- Eyebrow (used sparingly, max 3 per page) ----------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-500);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background-color: var(--accent-500);
  opacity: 0.6;
}

/* --- Section headings ------------------------------------ */
.section-header {
  margin-block-end: clamp(2.5rem, 5vw, 4rem);
}

.section-header h2 {
  margin-block-start: var(--space-3);
  max-width: 22ch;
}

.section-header p {
  margin-block-start: var(--space-5);
  font-size: var(--fs-lg);
  color: var(--text-muted);
  max-width: 60ch;
}

.section-header.text-center {
  text-align: center;
}

.section-header.text-center h2,
.section-header.text-center p {
  margin-inline: auto;
}

/* --- Utilities ------------------------------------------- */
.text-center { text-align: center; }
.text-mono   { font-family: var(--font-mono); }
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-accent { color: var(--accent-500); }

.text-balance { text-wrap: balance; }
.text-pretty  { text-wrap: pretty; }

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

/* --- Skip link ------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background-color: var(--accent-500);
  color: var(--text-onAccent);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-md);
  z-index: var(--z-toast);
  transition: top var(--dur-fast) var(--ease-quick);
}

.skip-link:focus {
  top: var(--space-4);
}

/* --- Section divider (subtle hairline) ------------------- */
.section-divider {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 0;
}
