/**
 * TekCapitol public site — authoritative typography system (P0).
 * Primary: Inter (SIL OFL 1.1 via Google Fonts).
 * Mono: IBM Plex Mono for code, IDs, logs, evidence payloads only.
 * Do not add page-local font-family stacks for marketing UI.
 */

:root {
  /* Families */
  --tc-font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tc-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Legacy aliases → one system */
  --caa-sans: var(--tc-font-sans);
  --caa-mono: var(--tc-font-mono);
  --sans: var(--tc-font-sans);
  --mono: var(--tc-font-mono);
  --rd-sans: var(--tc-font-sans);
  --rd-mono: var(--tc-font-mono);
  --ob-sans: var(--tc-font-sans);
  --ob-mono: var(--tc-font-mono);
  --cw-sans: var(--tc-font-sans);
  --cw-mono: var(--tc-font-mono);

  /* Weights (loaded faces only — avoid synthetic bold) */
  --tc-fw-regular: 400;
  --tc-fw-medium: 500;
  --tc-fw-semibold: 600;
  --tc-fw-bold: 700;

  /* Type scale (mobile-first, fluid where useful) */
  --tc-fs-caption: 0.75rem; /* 12 */
  --tc-fs-label: 0.8125rem; /* 13 */
  --tc-fs-body-sm: 0.875rem; /* 14 */
  --tc-fs-body: 1rem; /* 16 */
  --tc-fs-body-lg: 1.0625rem; /* 17 */
  --tc-fs-button: 0.9375rem; /* 15 */
  --tc-fs-h4: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  --tc-fs-h3: clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem);
  --tc-fs-h2: clamp(1.45rem, 1.2rem + 1.1vw, 2rem);
  --tc-fs-h1: clamp(1.85rem, 1.35rem + 2vw, 2.75rem);
  --tc-fs-display: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);

  /* Line heights */
  --tc-lh-tight: 1.15;
  --tc-lh-snug: 1.25;
  --tc-lh-body: 1.55;
  --tc-lh-relaxed: 1.65;

  /* Letter spacing — keep modest; avoid heavy uppercase tracking */
  --tc-ls-tight: -0.02em;
  --tc-ls-display: -0.025em;
  --tc-ls-normal: 0;
  --tc-ls-label: 0.02em;
}

html {
  font-family: var(--tc-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--tc-font-sans);
  font-weight: var(--tc-fw-regular);
  font-size: var(--tc-fs-body-lg);
  line-height: var(--tc-lh-body);
  letter-spacing: var(--tc-ls-normal);
  font-synthesis: none;
}

h1, h2, h3, h4, h5, h6,
.caa-h1, .caa-h2, .caa-h3,
.tc-h1, .tc-h2, .tc-h3 {
  font-family: var(--tc-font-sans);
  font-weight: var(--tc-fw-bold);
  line-height: var(--tc-lh-tight);
  letter-spacing: var(--tc-ls-tight);
  font-synthesis: none;
}

h1, .caa-h1, .tc-h1 { font-size: var(--tc-fs-h1); letter-spacing: var(--tc-ls-display); }
h2, .caa-h2, .tc-h2 { font-size: var(--tc-fs-h2); }
h3, .caa-h3, .tc-h3 { font-size: var(--tc-fs-h3); }
h4 { font-size: var(--tc-fs-h4); font-weight: var(--tc-fw-semibold); }

p, li, label, input, select, textarea, button, a {
  font-family: inherit;
}

button, .caa-btn, .btn, .ue-btn, .ob-btn, [type="submit"], [type="button"] {
  font-family: var(--tc-font-sans);
  font-weight: var(--tc-fw-semibold);
  font-size: var(--tc-fs-button);
  letter-spacing: var(--tc-ls-normal);
  font-synthesis: none;
}

small, .caption, .caa-eyebrow, .eyebrow, .brand-tag {
  font-size: var(--tc-fs-caption);
  line-height: var(--tc-lh-snug);
}

/* Eyebrows / labels: prefer case as authored; light tracking only */
.caa-eyebrow, .eyebrow, .label, .tc-label {
  font-family: var(--tc-font-sans);
  font-weight: var(--tc-fw-semibold);
  letter-spacing: var(--tc-ls-label);
  font-size: var(--tc-fs-label);
}

/* Mono reserved for technical surfaces */
code, kbd, samp, pre,
.caa-mono, .cw-mono, .tc-mono,
[data-mono="1"],
.caa-trace-id, .evidence-payload, .log-line {
  font-family: var(--tc-font-mono);
  font-synthesis: none;
}

/* Remap heavier weights that are not loaded */
.caa-body [style*="font-weight: 800"],
.caa-body .caa-h1,
body {
  font-optical-sizing: auto;
}

/* Loaded faces stop at 700 — keep headings on bold, not 800 */
.caa-h1,
.caa-brand-name,
h1 {
  font-weight: var(--tc-fw-bold);
}

/* Prefer sans + modest tracking for marketing eyebrows (keep authored casing) */
body.caa-body .caa-eyebrow,
.eyebrow {
  font-family: var(--tc-font-sans) !important;
  letter-spacing: var(--tc-ls-label);
  font-weight: var(--tc-fw-semibold);
}

@media (max-width: 640px) {
  body {
    font-size: var(--tc-fs-body);
  }
}
