/* ============================================================
   Base
   Element-level defaults only. Everything else styles semantic
   classes (no inline styles anywhere in the prototype).
   ============================================================ */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  /* Instrument Sans is a touch loose at UI sizes; the optical correction is
     applied once here rather than per component. */
  letter-spacing: var(--tracking-tight);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Headings inherit the page ramp — every real size is set by a component. */
h1, h2, h3, h4 {
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tighter);
  margin: 0;
}

::selection {
  background: rgb(255 255 255 / .14);
}

::placeholder {
  color: var(--placeholder);
}

a {
  color: var(--text-2);
  transition: color var(--dur) var(--ease);
}

a:hover {
  color: var(--text);
}

/* Keyboard only. Clicking a button focuses it too, and some browsers ring it
   anyway — on a filled button that ring reads as a glow, so it's turned off
   explicitly and :active carries the press instead. */
:focus-visible {
  outline: 2px solid var(--focus-border);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}
