/* ============================================================================
   DESIGN SYSTEM · 02 · TYPOGRAPHY
   ----------------------------------------------------------------------------
   Modern, clean, agency-style hierarchy.
   - Display & headings   → Plus Jakarta Sans (geometric, premium)
   - Body & UI            → Inter (neutral, optimized for screens)
   - Numbers / IDs / code → JetBrains Mono / ui-monospace
   ============================================================================ */

html {
  font-family: var(--ds-font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11", "calt";  /* Inter modern letterforms */
}

body {
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-base);
  line-height: var(--ds-leading-normal);
  color: var(--ds-text-default);
  letter-spacing: var(--ds-tracking-normal);
  background: var(--ds-surface-app);
}

/* ── Headings: Plus Jakarta Sans, tight tracking, balanced wrap ─────────── */
h1, h2, h3, h4, h5, h6,
.h-display, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--ds-font-display);
  color: var(--ds-text-strong);
  letter-spacing: var(--ds-tracking-tight);
  line-height: var(--ds-leading-tight);
  text-wrap: balance;
  font-weight: var(--ds-weight-bold);
  margin: 0;
}

/* Hero / login / onboarding heroes */
.h-display {
  font-size: var(--ds-text-5xl);
  font-weight: var(--ds-weight-black);
  letter-spacing: var(--ds-tracking-tighter);
  line-height: 1.05;
}

.h1 { font-size: var(--ds-text-4xl); font-weight: var(--ds-weight-bold); letter-spacing: var(--ds-tracking-tight); }
.h2 { font-size: var(--ds-text-3xl); font-weight: var(--ds-weight-bold); letter-spacing: var(--ds-tracking-tight); }
.h3 { font-size: var(--ds-text-2xl); font-weight: var(--ds-weight-semibold); letter-spacing: var(--ds-tracking-snug); }
.h4 { font-size: var(--ds-text-xl);  font-weight: var(--ds-weight-semibold); letter-spacing: var(--ds-tracking-snug); }
.h5 { font-size: var(--ds-text-lg);  font-weight: var(--ds-weight-semibold); }
.h6 { font-size: var(--ds-text-base); font-weight: var(--ds-weight-semibold); }

/* ── Body sizes (semantic) ──────────────────────────────────────────────── */
.body-lg { font-size: var(--ds-text-lg);  line-height: var(--ds-leading-relaxed); color: var(--ds-text-default); }
.body    { font-size: var(--ds-text-base); line-height: var(--ds-leading-normal); color: var(--ds-text-default); }
.body-sm { font-size: var(--ds-text-sm);  line-height: var(--ds-leading-normal); color: var(--ds-text-default); }
.caption { font-size: var(--ds-text-xs);  line-height: var(--ds-leading-snug);   color: var(--ds-text-muted);   }
.micro   { font-size: var(--ds-text-2xs); line-height: var(--ds-leading-snug);   color: var(--ds-text-muted);   }

/* ── Eyebrow (agency style — small uppercase label above a heading) ─────── */
.eyebrow {
  font-family: var(--ds-font-sans);
  font-size: var(--ds-text-2xs);
  font-weight: var(--ds-weight-semibold);
  letter-spacing: var(--ds-tracking-wider);
  text-transform: uppercase;
  color: var(--ds-text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
}

.eyebrow--brand { color: var(--ds-brand); }

.eyebrow::before {
  content: '';
  width: 1.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* ── Lead paragraph (intro under a heading) ─────────────────────────────── */
.lead {
  font-size: var(--ds-text-lg);
  line-height: var(--ds-leading-relaxed);
  color: var(--ds-text-muted);
  text-wrap: pretty;
  max-width: 65ch;
}

/* ── Mono (numbers, IDs, code) — tabular nums for aligned columns ───────── */
.mono, .num {
  font-family: var(--ds-font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  letter-spacing: 0;
}

/* Use .num inline for tabular numerics without monospace */
.num-tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ── Text utilities ─────────────────────────────────────────────────────── */
.text-strong  { color: var(--ds-text-strong)  !important; }
.text-default { color: var(--ds-text-default) !important; }
.text-muted   { color: var(--ds-text-muted)   !important; }
.text-subtle  { color: var(--ds-text-subtle)  !important; }
.text-brand   { color: var(--ds-brand)        !important; }
.text-success { color: var(--ds-success)      !important; }
.text-warning { color: var(--ds-warning)      !important; }
.text-danger  { color: var(--ds-danger)       !important; }
.text-info    { color: var(--ds-info)         !important; }

.text-balance { text-wrap: balance; }
.text-pretty  { text-wrap: pretty;  }

/* Truncation helpers (multi-line ellipsis) */
.truncate-1, .truncate-2, .truncate-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.truncate-1 { -webkit-line-clamp: 1; }
.truncate-2 { -webkit-line-clamp: 2; }
.truncate-3 { -webkit-line-clamp: 3; }

/* Page header pattern (agency-style: eyebrow + h1 + lead, stacked) */
.page-header {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-2);
  margin-bottom: var(--ds-space-5);
}

.page-header__title {
  font-family: var(--ds-font-display);
  font-size: var(--ds-text-3xl);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-text-strong);
  letter-spacing: var(--ds-tracking-tight);
  line-height: var(--ds-leading-tight);
}

.page-header__lead {
  font-size: var(--ds-text-base);
  color: var(--ds-text-muted);
  max-width: 65ch;
  line-height: var(--ds-leading-normal);
}

.page-header__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ds-space-4);
  flex-wrap: wrap;
}

.page-header__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  flex-wrap: wrap;
}

/* Mobile: stack actions full-width */
@media (max-width: 640px) {
  .page-header__row { flex-direction: column; align-items: stretch; }
  .page-header__actions { width: 100%; }
  .page-header__actions > * { flex: 1 1 auto; }
}
