/* base.css — global element styles & typography
   Applies the design tokens from variables.css to raw HTML elements. */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---- Headings ---- */
h1,
h2,
h3,
h4 {
  line-height: var(--lh-tight);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 {
  font-size: var(--fs-2xl);
}
h2 {
  font-size: var(--fs-xl);
}
h3 {
  font-size: var(--fs-lg);
}
h4 {
  font-size: var(--fs-base);
}

/* ---- Text ---- */
p {
  color: var(--color-text);
  line-height: var(--lh-relaxed);
}

small,
.text-muted {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* ---- Visually hidden (screen-reader only) ----
   For content that must exist for assistive tech but not be seen, e.g. the
   page's <h1> when its visible equivalent is baked into a banner image. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

code {
  background: var(--color-surface-alt);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

/* ---- Links ---- */
a.text-link {
  color: var(--color-primary);
  font-weight: 500;
  text-underline-offset: 3px;
}

a.text-link:hover {
  text-decoration: underline;
}

/* ---- Selection ---- */
::selection {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

/* ---- Scrollbar (desktop only, subtle) ---- */
@media (pointer: fine) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
  }
}