/* =============================================================================
   VERTEX DIMENSION — Base
   Reset, root typography, utilities. The floor; tokens carry opinion.
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Reserve space for the fixed nav when jumping to anchors */
  scroll-padding-top: var(--nav-h);
}

body {
  background-color: var(--surface);
  color: var(--ink-090);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--weight-regular);
  line-height: var(--lh-text);
  letter-spacing: var(--track-tight);
  font-feature-settings: "ss01", "cv05", "tnum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* Prevent layout shift / give a true black field while fonts load */
  min-height: 100vh;
}

/* The generative field lives behind everything */
body::selection,
*::selection {
  background: var(--vd-white);
  color: var(--vd-black);
}

h1,
h2,
h3,
h4 {
  font-weight: var(--weight-light);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  color: var(--ink-100);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

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

ul,
ol {
  list-style: none;
}

:focus-visible {
  outline: 1px solid var(--ink-090);
  outline-offset: 4px;
}

/* --- Custom scrollbar: a thin, instrument-grade rail -------------------- */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: var(--vd-black);
}
::-webkit-scrollbar-thumb {
  background: var(--ink-012);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ink-020);
}
html {
  scrollbar-width: thin;
  scrollbar-color: var(--ink-012) var(--vd-black);
}

/* =============================================================================
   Typographic primitives
   ========================================================================== */

/* Monospace label — the "data layer": indices, coordinates, tickers */
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "zero";
}

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: var(--weight-regular);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--ink-035);
}

.label--micro {
  font-size: var(--fs-micro);
  letter-spacing: var(--track-wider);
}

.lead {
  font-size: var(--fs-lead);
  font-weight: var(--weight-light);
  line-height: 1.5;
  color: var(--ink-070);
  letter-spacing: 0;
}

.measure {
  max-width: var(--measure);
}

.dim {
  color: var(--ink-050);
}

.bright {
  color: var(--ink-100);
}

/* =============================================================================
   Utilities
   ========================================================================== */

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

.u-nowrap {
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

/* Skip link for keyboard users */
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--gutter);
  z-index: var(--z-overlay);
  padding: var(--space-3) var(--space-5);
  background: var(--vd-white);
  color: var(--vd-black);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
}
.skip-link:focus {
  top: var(--space-4);
}
