/* ==========================================================================
   Cadence — Base: reset, typography, utilities
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute always wins over component display rules */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--color-primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

::selection { background: var(--color-primary-soft-2); }

/* ---------- Type hierarchy ---------- */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-heading);
  color: var(--color-text);
}
/* v0.4: one family (Inter). Hierarchy comes from size, weight and tight tracking. */
.t-display { font-family: var(--font-display); font-size: var(--text-5xl); font-weight: var(--weight-medium); letter-spacing: var(--tracking-display); line-height: 1.05; }
.t-h1 { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: var(--weight-semibold); letter-spacing: -0.03em; }
.t-h2 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-heading); }
.t-h3 { font-family: var(--font-display); font-size: var(--text-lg);  font-weight: var(--weight-semibold); letter-spacing: -0.01em; }
.t-body { font-size: var(--text-md); }
.t-small { font-size: var(--text-sm); }
.t-caption { font-size: var(--text-xs); color: var(--color-text-3); }
.t-overline { font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-3); }
.t-mono { font-family: var(--font-mono); font-size: var(--text-xs); }
.t-muted { color: var(--color-text-2); }
.t-subtle { color: var(--color-text-3); }
.t-num { font-variant-numeric: tabular-nums; }

p { margin: 0; }

/* ---------- Utilities ---------- */
.stack   { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-2 { display: flex; flex-direction: column; gap: var(--space-2); }
.row     { display: flex; align-items: center; gap: var(--space-3); }
.row-2   { display: flex; align-items: center; gap: var(--space-2); }
.between { justify-content: space-between; }
.wrap    { flex-wrap: wrap; }
.grow    { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon    { width: 16px; height: 16px; stroke-width: 1.8; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }
