/* Base: reset, typography, focus, motion preferences. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-1);
  font: var(--fs-md) / 1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.25; }
h1 { font-size: var(--fs-2xl); font-weight: 700; }
h2 { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: var(--fs-md); font-weight: 650; color: var(--text-2); }
p { margin: 0; }

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--accent-hover); }

.num, .stat-value, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.pre-line { white-space: pre-line; }

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

::selection { background: rgba(62, 207, 142, 0.3); }

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

/* scrollbars (WebKit + Firefox) */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg-0); }

/* Entrance motion moves content but never hides it: if the browser pauses animations
   (background tab, power saving), everything is still visible. */
@keyframes ds-rise { from { transform: translateY(6px); } to { transform: none; } }
@keyframes ds-fade { from { opacity: 0.6; } to { opacity: 1; } }
@keyframes ds-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

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