/* Reset, typography scale and small utilities shared by every screen. */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 0;
}
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--brand-soft-2); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-xs); }
[hidden] { display: none !important; }

/* Type scale (1.2 minor third around 14px) */
.t-display { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.t-h1 { font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
.t-h2 { font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
.t-h3 { font-size: 15px; line-height: 1.35; font-weight: 600; }
.t-body { font-size: 14px; }
.t-sm { font-size: 13px; }
.t-xs { font-size: 12px; }
.t-muted { color: var(--text-2); }
.t-faint { color: var(--text-3); }
.t-strong { font-weight: 600; }
.t-num { font-variant-numeric: tabular-nums; }
.t-key { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--text-3); font-size: 12px; letter-spacing: .01em; }
.t-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.t-strike { text-decoration: line-through; color: var(--text-3); }

/* Layout helpers */
.row { display: flex; align-items: center; gap: 8px; }
.row-sm { display: flex; align-items: center; gap: 4px; }
.row-lg { display: flex; align-items: center; gap: 16px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.col-lg { display: flex; flex-direction: column; gap: 16px; }
.grow { flex: 1 1 auto; min-width: 0; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.ml-auto { margin-left: auto; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.divider { height: 1px; background: var(--line); border: 0; margin: 8px 0; }
.scroll-y { overflow-y: auto; }
.scroll-x { overflow-x: auto; }

/* Thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

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