/* base.css — normalization + typography */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + var(--s4));
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  color: var(--ink);
  background-color: var(--bg);
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -0.005em;
  min-height: 100dvh;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
button { cursor: pointer; background: none; border: 0; color: inherit; font: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }

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

::selection { background: var(--accent-soft); color: var(--accent-ink); }

h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: var(--lh-tight); font-weight: 600; letter-spacing: -0.015em; }
p, li { text-wrap: pretty; }

/* Interactive element transitions */
a, button, [role="button"], input, textarea, select, .chip, .btn, .sidebar-link, .nav-group-head {
  transition: color var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.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;
}

/* Numeric tabular figures for data */
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
