/* ============================================================================
   progressed — base.css
   Reset, self-hosted font faces, root typography, and layout primitives.
   Depends on tokens.css (load tokens.css first).
   ============================================================================ */

/* ---- Self-hosted fonts -----------------------------------------------------
   Drop the woff2 files into assets/fonts/ (see assets/fonts/README.md for the
   exact files and their OFL licence). Until they are present the UI renders in
   the system-stack fallbacks declared in --font-* tokens, so nothing breaks.
   These @font-face rules are the ONLY web-font mechanism — no CDN <link>.     */
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 500 700;
  font-display: swap; src: url("fonts/SpaceGrotesk-Variable.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500;
  font-display: swap; src: url("fonts/IBMPlexSans-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700;
  font-display: swap; src: url("fonts/IBMPlexSans-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400 600;
  font-display: swap; src: url("fonts/IBMPlexMono-Variable.woff2") format("woff2");
}

/* ---- Reset ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-14);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, figure { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
::selection { background: #D8DCF7; }

/* ---- Root typography helpers ---------------------------------------------- */
.display  { font-family: var(--font-display); font-weight: var(--fw-semi);
            letter-spacing: var(--tracking-tight); line-height: var(--lh-tight); }
.eyebrow  { font-size: var(--fs-11); font-weight: var(--fw-bold);
            letter-spacing: var(--tracking-wide); text-transform: uppercase;
            color: var(--ink-3); }
/* Tabular numerals — MANDATORY on every date, duration, count and percentage
   so columns of figures align. */
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--font-mono); }

/* ---- Scrollbars ----------------------------------------------------------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: var(--border-heavy); border-radius: var(--radius);
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- Focus: visible everywhere, never removed ----------------------------- */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---- Layout primitives ---------------------------------------------------- */
.app        { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.screen     { flex: 1; overflow: auto; background: var(--slate-75); }
.container  { max-width: 1200px; margin: 0 auto; padding: var(--space-8) var(--space-8) var(--space-16); }
.row        { display: flex; align-items: center; }
.col        { display: flex; flex-direction: column; }
.gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); }
.grow { flex: 1; } .none { flex: none; }

/* ---- Animations ----------------------------------------------------------- */
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein  { from { opacity: 0; } to { opacity: 1; } }
@keyframes popin   { from { transform: translateY(6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
