/* ============================================================
   PaperTrade — base.css
   Reset, typography, focus ring, scrollbars, utility classes.
   ============================================================ */

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

* { margin: 0; }

html { block-size: 100%; }

body {
  min-block-size: 100%;
  background: var(--bg);
  color: var(--text);
  font: var(--text-body);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-align: start;
}

img, svg, video { display: block; max-inline-size: 100%; }
svg.icon { flex: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
fieldset { border: none; padding: 0; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; }
h1 { font-size: 32px; font-weight: 700; }  /* display */
h2 { font-size: 22px; }                    /* heading */
h3 { font-size: 16px; }
h4 { font-size: 14px; }

p { margin-block: 0 0; }

small { font-size: 12px; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 13px; }
pre { padding: var(--space-3); background: var(--raised); border-radius: var(--radius-md); overflow: auto; }

hr { border: none; border-block-start: 1px solid var(--border); margin-block: var(--space-4); }

/* Focus ring — 2px brand, keyboard only */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--brand) 35%, transparent); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { inline-size: 10px; block-size: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Utilities ---------- */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.caption { font-size: 12px; color: var(--muted); }
.up { color: var(--long); }
.down { color: var(--short); }

.row { display: flex; align-items: center; gap: var(--space-3); }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--space-3); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.center { display: flex; align-items: center; justify-content: center; }
.grow { flex: 1 1 auto; min-inline-size: 0; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* Author display values (flex/grid) must never defeat the hidden attribute */
[hidden] { display: none !important; }

/* .grid sets the gap; pages set columns via .grid-2/3/4 (layout.css) or inline styles */
.grid { display: grid; gap: var(--space-4); }

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