/* ============================================================
   dbx design system — colors & type foundations
   Pulled from dbut2/x · brand/src/tokens.css + base.css
   ============================================================
   Theme: dark-first terminal aesthetic. Mono body, display for
   hero/headings, sans for long-form prose. Lime-chartreuse (#caff33)
   is THE accent — single hit of color against near-black + bone.
   ============================================================ */

/* All four brand families are self-hosted from fonts/. No Google Fonts. */

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-VariableFont_opsz_wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/SpaceGrotesk-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* ---------- COLOR ---------- */
  /* Background stack — near-black, not pure #000. Three steps up. */
  --dbx-bg:         #0c0c0c;  /* page */
  --dbx-surface:    #161616;  /* code blocks, cards, covers */
  --dbx-surface-2:  #202020;  /* elevated surface */

  /* Ink stack — bone white → mid gray → graphite. Never pure #fff. */
  --dbx-ink:        #f0ede6;  /* primary text */
  --dbx-ink-2:      #888888;  /* secondary / tag / meta */
  --dbx-ink-3:      #444444;  /* tertiary / markdown sigils (## > ---) */

  /* Hairline rules — darker than ink-3, used to separate rows. */
  --dbx-rule:       #2a2a2a;  /* visible borders, section divider */
  --dbx-rule-2:     #1c1c1c;  /* barely-there row dividers */

  /* Accent — single chartreuse. Used for hover states, cursor,
     PS1 prompt, selection. Never for body copy. */
  --dbx-accent:     #caff33;
  --dbx-accent-dim: rgba(202, 255, 51, 0.12);

  /* Status — muted, not saturated. */
  --dbx-ok:         #4ade80;
  --dbx-warn:       #fcd34d;
  --dbx-err:        #f87171;

  /* ---------- SEMANTIC ALIASES ---------- */
  --fg-1: var(--dbx-ink);
  --fg-2: var(--dbx-ink-2);
  --fg-3: var(--dbx-ink-3);
  --bg:   var(--dbx-bg);
  --bg-1: var(--dbx-surface);
  --bg-2: var(--dbx-surface-2);
  --rule: var(--dbx-rule);
  --accent: var(--dbx-accent);

  /* ---------- TYPE FAMILIES ---------- */
  /* Display: Space Grotesk — geometric, for H1/H2/H3 (default) */
  --dbx-font-display: 'Space Grotesk', system-ui, sans-serif;
  /* Sans: Inter — only for long-form prose body (.dbx-prose p) */
  --dbx-font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  /* Mono: JetBrains Mono — the DEFAULT body font, terminal DNA */
  --dbx-font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* ---------- TYPE SCALE ---------- */
  /* Hero is fluid and enormous — designed to wrap aggressively */
  --dbx-text-hero:    clamp(64px, 17vw, 176px);
  --dbx-text-display: clamp(40px, 6vw, 56px);
  --dbx-text-title:   36px;   /* article H1 */
  --dbx-text-dek:     18px;
  --dbx-text-prose:   15.5px; /* Inter body in articles */
  --dbx-text-body:    14px;   /* mono body default */
  --dbx-text-sm:      13px;
  --dbx-text-xs:      12px;
  --dbx-text-meta:    11px;   /* uppercase figcaption, labels */

  /* ---------- LEADING ---------- */
  --dbx-leading-tight: 0.86;  /* hero only */
  --dbx-leading-snug:  1.2;
  --dbx-leading-body:  1.6;
  --dbx-leading-prose: 1.72;  /* Inter prose is airy */

  /* ---------- TRACKING ---------- */
  --dbx-tracking-tight: -0.055em;  /* hero / display — crunched */
  --dbx-tracking-body:  0;
  --dbx-tracking-meta:  0.13em;    /* uppercase labels — loose */

  /* ---------- SPACING (4px base) ---------- */
  --dbx-s-1:  4px;
  --dbx-s-2:  8px;
  --dbx-s-3:  12px;
  --dbx-s-4:  16px;
  --dbx-s-5:  20px;
  --dbx-s-6:  24px;
  --dbx-s-7:  28px;
  --dbx-s-8:  32px;
  --dbx-s-10: 40px;
  --dbx-s-12: 48px;
  --dbx-s-14: 56px;
  --dbx-s-16: 64px;
  --dbx-s-18: 72px;
  --dbx-s-20: 80px;
  --dbx-s-24: 96px;
  --dbx-s-30: 120px;
  --dbx-s-35: 140px;

  /* ---------- MEASURE (content width) ---------- */
  --dbx-measure-narrow: 640px;
  --dbx-measure:        780px;   /* default page width */
  --dbx-measure-prose:  65ch;

  /* ---------- MOTION ---------- */
  /* One easing, three speeds. No bounces. No spring. Everything is calm. */
  --dbx-ease:       cubic-bezier(.2, .8, .2, 1);
  --dbx-speed-fast: 120ms;
  --dbx-speed:      160ms;
  --dbx-speed-slow: 240ms;

  /* No radii tokens exist in the source — all corners are SQUARE,
     except `code` which uses 2px. Keep it that way. */
  --dbx-radius-code: 2px;
}

/* ============================================================
   SEMANTIC TYPE CLASSES
   Use these when you need named roles. All inherit from tokens.
   ============================================================ */

.t-hero {
  font-family: var(--dbx-font-mono);
  font-weight: 700;
  font-size: var(--dbx-text-hero);
  line-height: var(--dbx-leading-tight);
  letter-spacing: var(--dbx-tracking-tight);
  color: var(--dbx-ink);
}

.t-display, .t-h1 {
  font-family: var(--dbx-font-display);
  font-weight: 700;
  font-size: var(--dbx-text-title);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--dbx-ink);
}

.t-h2 {
  font-family: var(--dbx-font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--dbx-ink);
}

.t-h3 {
  font-family: var(--dbx-font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--dbx-ink);
}

.t-dek {
  font-family: var(--dbx-font-sans);
  font-size: var(--dbx-text-prose);
  line-height: 1.55;
  color: var(--dbx-ink-2);
}

.t-prose {
  font-family: var(--dbx-font-sans);
  font-size: var(--dbx-text-prose);
  line-height: var(--dbx-leading-prose);
  color: var(--dbx-ink);
}

.t-body {
  font-family: var(--dbx-font-mono);
  font-size: var(--dbx-text-body);
  line-height: var(--dbx-leading-body);
  color: var(--dbx-ink);
}

.t-meta {
  font-family: var(--dbx-font-mono);
  font-size: var(--dbx-text-meta);
  color: var(--dbx-ink-3);
  text-transform: uppercase;
  letter-spacing: var(--dbx-tracking-meta);
}

.t-code {
  font-family: var(--dbx-font-mono);
  font-variant-ligatures: none;
  font-size: 0.88em;
  background: var(--dbx-surface);
  padding: 1px 5px;
  border: 1px solid var(--dbx-rule);
  border-radius: var(--dbx-radius-code);
  color: var(--dbx-ink);
}

/* Muted "dim" helpers — apply over any text class. */
.t-fg-2 { color: var(--dbx-ink-2); }
.t-fg-3 { color: var(--dbx-ink-3); }
.t-accent { color: var(--dbx-accent); }
