/* base.css — shared fal design system (see fal-design-preferences).
   Pair with tokens.css. Philosophy: one contained column, hierarchy by
   size/weight/space (not hue), hairline rules, one Powder Blush accent,
   compact square UI surfaces, restraint. */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---- contained reading measure ---- */
.measure {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 24px;
}
.measure-wide {            /* for the data explorer grids only */
  max-width: 60rem;
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---- headings & labels: system sans, warm Deep Walnut ---- */
h1, h2, h3, h4, .sans {
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-strong);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
}
h1 { font-size: 2rem; margin: 0 0 0.4em; }
h2 { font-size: 1.4rem; margin: 1.8em 0 0.5em; padding-bottom: 0.35em; border-bottom: 1px solid var(--rule); }
h3 { font-size: 1.08rem; margin: 1.4em 0 0.4em; }

p { margin: 0 0 1.1em; }

/* ---- links: Deep Walnut text, Powder Blush underline; accent on hover ---- */
a {
  color: var(--text-strong);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  transition: color 120ms ease, border-color 120ms ease;
}
a:hover { color: var(--accent); }

strong { color: var(--text-strong); }
em { font-style: italic; }

/* ---- metadata: small, uppercase, muted (signature move) ---- */
.meta {
  font-family: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---- hairline rules: the structural device ---- */
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule-short {              /* signature short centered divider */
  border: 0;
  border-top: 1px solid var(--rule-strong);
  width: 70px;
  margin: 33px auto;
}

/* ---- open-sided framed blocks (figures, code, callouts) ---- */
.framed {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1.1em 0;
  margin: 1.6em 0;
}

/* code */
code, pre, .mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
pre {
  background: var(--bg-subtle);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1em 1.1em;
  overflow: auto;
  font-size: 0.82em;
  line-height: 1.5;
}
:not(pre) > code {
  background: var(--bg-subtle);
  padding: 0.08em 0.34em;
  border-radius: 3px;
  font-size: 0.86em;
}

/* ---- restrained buttons: hairline by default, accent on hover ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: Avenir, "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.7em 1.3em;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-strong);
}
.btn--primary {           /* the one emphasized action per view */
  background: var(--accent);
  border-color: var(--accent);
}
.btn--primary:hover { filter: brightness(0.97); }

/* ---- vertical rhythm helpers ---- */
.section { margin: 50px 0; }
.stack > * + * { margin-top: 1.1em; }

/* ---- responsive: single breakpoint at the measure ---- */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .measure, .measure-wide { padding-inline: 14px; }
  h1 { font-size: 1.6rem; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
