/* ── fomi · reset + primitives ──────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 8px);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.55;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  overflow-x: clip;
}

img, canvas, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

::selection { background: var(--acc); color: var(--on-acc); }

/* ── type primitives ─────────────────────────────────────────────── */

.mono {
  font-family: var(--mono);
  font-size: var(--t-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.num {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lbl {
  display: block;
  font-size: var(--t-lbl);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.fine   { font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
.quiet  { color: var(--ink-2); }
.ta-r   { text-align: right; }

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.035em; line-height: 1.0; }

.up   { color: var(--pos); }
.down { color: var(--neg); }

/* ── controls ────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 20px;
  background: var(--ink); color: var(--ink-inv);
  font-size: 14px; font-weight: 700; letter-spacing: -0.015em;
  border-radius: var(--r2);
  transition: background var(--fast), transform var(--fast);
}
.btn:hover { background: var(--acc); color: var(--on-acc); }
.btn:active { transform: translateY(1px); }

.btn-txt {
  display: inline-flex; align-items: center; height: 42px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
  transition: color var(--fast), border-color var(--fast);
}
.btn-txt:hover { color: var(--ink); border-color: var(--acc); }

.btn-sq {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: var(--r2);
  color: var(--ink-2); font-size: 13px;
  transition: color var(--fast), border-color var(--fast), background var(--fast);
}
.btn-sq:hover { color: var(--ink); border-color: var(--ink-3); background: var(--bg-3); }

.inp {
  height: 30px; width: 100%; min-width: 0;
  padding: 0 9px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r2);
  color: var(--ink);
  transition: border-color var(--fast), background var(--fast);
}
.inp::placeholder { color: var(--ink-3); }
.inp:focus { outline: none; border-color: var(--ink-3); background: var(--bg-3); }

kbd {
  display: inline-block; min-width: 18px; padding: 1px 5px;
  font-family: var(--mono); font-size: 10.5px; line-height: 16px;
  text-align: center;
  color: var(--ink-2);
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 3px;
}

.lnk {
  color: var(--ink-2); font-size: var(--t-sm); font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color var(--fast), border-color var(--fast);
}
.lnk:hover { color: var(--ink); border-color: var(--acc); }

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 16px; background: var(--ink); color: var(--ink-inv);
  font-weight: 700; border-radius: var(--r2);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }
