/* ============================================================
   BASE — reset, ground, and the three type roles.
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--s4));
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--t-primary);
  font-family: var(--sans);
  font-size: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* the horizontal swipe switches category; it must not also drive the
     browser's back/forward gesture */
  overscroll-behavior-x: none;
}

h1, h2, h3, h4, p, figure { margin: 0; font-size: inherit; font-weight: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }

button {
  font: inherit; color: inherit;
  background: none; border: 0; padding: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

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

:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 3px;
  border-radius: 1px;
}

.sr {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---- the three type roles ------------------------------------ */

/* 1. mono, quiet register — chrome, section labels, chips */
.mono {
  font-family: var(--mono);
  font-size: var(--mono-size);
  line-height: var(--mono-lh);
  letter-spacing: var(--mono-track);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

/* 2. mono, reading register — ledes, row items, captions.
      Same face and tracking, two points larger. This is the size that
      carries the content; 10px is for labels only. */
.mono-body {
  font-family: var(--mono);
  font-size: var(--mono-body);
  line-height: var(--mono-body-lh);
  letter-spacing: var(--mono-track);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

/* 3. sans — column titles only. One size, one weight. */
.title {
  font-family: var(--sans);
  font-size: var(--title);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.25;
  text-transform: none;
}

/* 4. serif — display headlines, inside preview plates only */
.display {
  font-family: var(--serif);
  font-size: var(--display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.005em;
  text-transform: none;
}

/* custom scrollbars — present but quiet */
.scroller { scrollbar-width: thin; scrollbar-color: var(--hair) transparent; }
.scroller::-webkit-scrollbar { width: 8px; height: 8px; }
.scroller::-webkit-scrollbar-thumb {
  background: var(--hair); border-radius: 4px;
  border: 2px solid transparent; background-clip: content-box;
}
.scroller::-webkit-scrollbar-thumb:hover { background-color: var(--chip-hi); background-clip: content-box; }
.scroller::-webkit-scrollbar-track { background: transparent; }
