/* ============================================================
   Warrant — Colors & Typography
   ------------------------------------------------------------
   Semantic, ready-to-use type/color rules built on tokens.css.
   Import order:
     <link rel="stylesheet" href="/tokens.css">
     <link rel="stylesheet" href="/colors_and_type.css">
   ============================================================ */

/* ---------- Web fonts (self-hosted woff2) ----------
   Stack rationale (legal-brief logic, not consumer SaaS):
   • JetBrains Mono — UI, citations, headings, code, all metadata. The voice.
   • Newsreader     — long-form serif body for editorial/docs + writ subtitles. The reading.
   • Inter          — interface body for forms/tables where mono is too dense.
   No Roboto. No Helvetica. No Fraunces.

   Fonts shipped from web/assets/fonts/ (woff2 only, latin subset). A regulator-
   grade compliance product should not load fonts from a third-party CDN —
   Google Fonts leaks the referrer and is blockable in EU privacy reviews and
   in China. Self-hosted: all font requests stay on warrant.build. */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/JetBrainsMono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("assets/fonts/JetBrainsMono-500.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("assets/fonts/JetBrainsMono-600.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("assets/fonts/JetBrainsMono-700.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/Inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("assets/fonts/Inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("assets/fonts/Inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("assets/fonts/Inter-700.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/Newsreader-400.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("assets/fonts/Newsreader-500.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("assets/fonts/Newsreader-600.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic; font-weight: 400; font-display: swap;
  src: url("assets/fonts/Newsreader-400-italic.woff2") format("woff2");
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
}

::selection {
  background: var(--text-primary);
  color: var(--bg-base);
}

/* ---------- Headings (display = JetBrains Mono) ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

h1 {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
}
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-secondary);
  font-weight: 500;
}

/* Hero display sizes — use sparingly */
.display-hero {
  font-family: var(--font-mono);
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
}
.display-brutalist {
  font-family: var(--font-mono);
  font-size: var(--text-5xl);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 700;
}

/* ---------- Body type ---------- */
p {
  margin: 0 0 var(--space-4) 0;
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}
p:last-child { margin-bottom: 0; }

.lead {
  font-size: var(--text-md);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

small, .text-small {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-secondary);
  font-weight: 500;
}

.metadata {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: var(--tracking-wide);
}

/* ---------- Code & data ---------- */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9375em; /* visually balance against Inter */
}

code {
  background: var(--bg-raised);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 0.125rem 0.375rem;
  color: var(--text-primary);
}

pre {
  background: var(--bg-raised);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0 0 var(--space-4) 0;
}
pre code {
  background: transparent;
  border: 0;
  padding: 0;
}

/* ---------- Links ---------- */
a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border-mid);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration-color) var(--ease-out);
}
a:hover { text-decoration-color: var(--text-primary); }
a:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* ---------- HR ---------- */
hr {
  border: 0;
  border-top: 1px solid var(--border-dim);
  margin: var(--space-8) 0;
}

/* ---------- Lists ---------- */
ul, ol {
  margin: 0 0 var(--space-4) 0;
  padding-left: var(--space-6);
  color: var(--text-primary);
}
li { margin-bottom: var(--space-2); }
li:last-child { margin-bottom: 0; }

/* ---------- Color utilities (semantic) ---------- */
.fg-primary    { color: var(--text-primary); }
.fg-secondary  { color: var(--text-secondary); }
.fg-tertiary   { color: var(--text-tertiary); }
.fg-warning    { color: var(--accent-warning); }
.fg-error      { color: var(--accent-error); }
.fg-success    { color: var(--accent-success); }

.bg-base       { background: var(--bg-base); }
.bg-raised     { background: var(--bg-raised); }
.bg-overlay    { background: var(--bg-overlay); }

.font-mono     { font-family: var(--font-mono); }
.font-sans     { font-family: var(--font-sans); }
.font-serif    { font-family: var(--font-serif); }

/* ---------- Long-form reading column (Newsreader serif) ----------
   Use on /docs, /blog/<post>, regulatory citations, and writ subtitles.
   Not for UI. Not for headlines. */
.prose {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.7;
  color: var(--text-primary);
  max-width: 68ch;
}
.prose p { font-family: var(--font-serif); font-size: 19px; line-height: 1.7; margin: 0 0 1.1em; }
.prose em { font-style: italic; }
.prose strong { font-weight: 600; }

/* Italic serif subtitle — used beside marks ("an instrument for evidence") */
.writ-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  letter-spacing: 0;
}

/* ---------- Focus ring (universal) ---------- */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* ---------- Reading column ---------- */
.reading-column {
  max-width: var(--reading-max);
  margin-inline: auto;
}

/* ---------- Container ---------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
@media (min-width: 1024px) {
  .container { padding-inline: var(--space-8); }
}
