/* =========================================================================
   Bromb Design Tokens
   Monospace-everywhere, dark canvas, peach-orange accent.
   ========================================================================= */

/* JetBrains Mono is loaded from Google Fonts in each HTML file's <head>:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,700;1,400&display=swap" rel="stylesheet"> */

:root {
  /* ---------- COLORS: surfaces (dark, blue-tinted) ---------- */
  --bg-0: #0a0c10;   /* deepest — code blocks, modal backdrop */
  --bg-1: #0f1115;   /* main canvas */
  --bg-2: #161922;   /* sidebar, surface */
  --bg-3: #1d2230;   /* raised — active item, hover-surface */
  --bg-4: #262b3a;   /* hairline borders, divider */

  /* ---------- COLORS: foreground (warm-cool greys) ---------- */
  --fg-0: #ffffff;   /* bold emphasis — sparingly */
  --fg-1: #e6e7eb;   /* body default */
  --fg-2: #caccd2;   /* body alt */
  --fg-3: #79808e;   /* muted, labels, meta */
  --fg-4: #4a5060;   /* dim, disabled, dividers in text */

  /* ---------- COLORS: accent ---------- */
  --accent: #ffb86b;       /* peach — headings, links, active, wordmark */
  --accent-2: #d99c5a;     /* amber — filled tabs, toggles */
  --accent-tint-10: rgba(255, 184, 107, 0.10);
  --accent-tint-16: rgba(255, 184, 107, 0.16);
  --accent-tint-24: rgba(255, 184, 107, 0.24);

  /* ---------- COLORS: semantic (muted, to coexist with peach) ---------- */
  --ok: #7fbf7a;
  --warn: #e5c46a;
  --err: #e57a7a;

  /* ---------- TYPE: family ---------- */
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;

  /* ---------- TYPE: scale ---------- */
  --t-12: 12px;
  --t-13: 13px;
  --t-14: 14px;
  --t-15: 15px;
  --t-18: 18px;
  --t-24: 24px;
  --t-32: 32px;
  --t-40: 40px;

  /* ---------- TYPE: leading ---------- */
  --lh-tight: 1.2;
  --lh-snug:  1.35;
  --lh-body:  1.6;
  --lh-loose: 1.75;

  /* ---------- TYPE: tracking ---------- */
  --tr-tight: -0.01em;
  --tr-normal: 0;
  --tr-wide: 0.08em;     /* uppercase labels */
  --tr-x-wide: 0.14em;   /* eyebrow labels */

  /* ---------- SPACING: 4-based ---------- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* ---------- RADII ---------- */
  --r-0: 0;
  --r-1: 4px;
  --r-2: 6px;
  --r-3: 8px;
  --r-pill: 999px;

  /* ---------- BORDERS ---------- */
  --bd: 1px solid var(--bg-3);
  --bd-strong: 1px solid var(--bg-4);

  /* ---------- SHADOWS ---------- */
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.4);

  /* ---------- MOTION ---------- */
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
}

/* =========================================================================
   Semantic / element-level
   ========================================================================= */

html, body {
  background: var(--bg-1);
  color: var(--fg-1);
  font-family: var(--font-mono);
  font-size: var(--t-15);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-tint-24);
  color: var(--fg-0);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: var(--lh-tight);
  margin: 0;
}

h1 { font-size: var(--t-40); color: var(--fg-0); letter-spacing: var(--tr-tight); }
h2 { font-size: var(--t-24); color: var(--accent); }
h3 { font-size: var(--t-18); color: var(--accent); }
h4 {
  font-size: var(--t-12);
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: var(--tr-wide);
  font-weight: 500;
}

p {
  margin: 0 0 var(--s-4) 0;
  color: var(--fg-1);
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-tint-24);
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
a:hover { border-bottom-color: var(--accent); }
a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  border-bottom-color: transparent;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
}

code {
  background: var(--bg-0);
  border: 1px solid var(--bg-3);
  border-radius: var(--r-1);
  padding: 1px 6px;
  font-size: 0.92em;
  color: var(--accent);
}

pre {
  background: var(--bg-0);
  border: var(--bd);
  border-radius: var(--r-1);
  padding: var(--s-4);
  overflow-x: auto;
  font-size: var(--t-14);
  line-height: var(--lh-snug);
  color: var(--fg-2);
}
pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

hr {
  border: 0;
  border-top: var(--bd);
  margin: var(--s-6) 0;
}

strong, b { color: var(--fg-0); font-weight: 700; }
em, i    { font-style: italic; }

/* Uppercase eyebrow / section label */
.label {
  font-size: var(--t-12);
  text-transform: uppercase;
  letter-spacing: var(--tr-wide);
  color: var(--fg-3);
  font-weight: 500;
}

/* Muted / dim helpers */
.muted { color: var(--fg-3); }
.dim   { color: var(--fg-4); }
.accent { color: var(--accent); }
