/* ──────────────────────────────────────────────────────────────────────────
   Creatin Systems · Design Tokens
   Single source of truth for the Cobalt theme — dark + light modes.
   ─────────────────────────────────────────────────────────────────────── */

/* ── Cobalt Dark (default) ─────────────────────────────────────────────── */
:root,
:root[data-theme="dark"] {
  /* surface */
  --paper:      #0a1638;
  --paper-2:    #0f1d44;
  --sheet:      #081230;

  /* foreground */
  --ink:        #e8edfa;
  --dim:        #8b96be;
  --dim-2:      #525d8a;

  /* rules */
  --line:       rgba(150, 170, 230, 0.16);
  --line-2:     rgba(150, 170, 230, 0.30);

  /* accent */
  --accent:     #8ca6ff;
  --accent-dim: #5d75d8;
  --highlight:  #b29765;
  --ok:         #7fd0a3;
}

/* ── Cobalt Light — neutralized (less yellow, more paper) ─────────────── */
/* Matches the root (whole-page toggle) AND any sub-tree marked
   data-theme="light", so a single light card/section can pull the print palette
   without re-declaring hex (brandbook.html's light + reverse surfaces rely on this). */
:root[data-theme="light"],
[data-theme="light"] {
  --paper:      #efeee8;   /* was #f1ede2 — saturation cut ~50% */
  --paper-2:    #e6e4dc;   /* was #e8e4d6 */
  --sheet:      #f5f3ec;   /* was #f7f3e8 */

  --ink:        #0a1638;
  --dim:        #585e7a;
  --dim-2:      #9a9eae;

  --line:       rgba(20, 28, 70, 0.13);
  --line-2:     rgba(20, 28, 70, 0.24);

  --accent:     #1c3fc3;
  --accent-dim: #6f7fd4;
  --highlight:  #7a5e2a;
  --ok:         #137a4d;
}

/* ── Typography ───────────────────────────────────────────────────────── */
:root {
  /* Families */
  --display:    'Newsreader', 'Times New Roman', Georgia, serif;
  --sans:       'Inter', system-ui, -apple-system, sans-serif;
  --mono:       'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Display scale — for hero + section heads */
  --t-display-xl: 104px;
  --t-display:    72px;
  --t-h1:         48px;
  --t-h2:         32px;
  --t-h3:         24px;
  --t-h4:         19px;

  /* Body scale */
  --t-lead:       19px;
  --t-body:       16px;
  --t-small:      14px;

  /* Technical / metadata */
  --t-eyebrow:    11px;
  --t-meta:       10px;

  /* Tracking */
  --tr-display:   -0.025em;
  --tr-body:      0;
  --tr-eyebrow:   0.18em;
  --tr-meta:      0.14em;

  /* Weights */
  --w-light:    300;
  --w-regular:  400;
  --w-medium:   500;
  --w-semibold: 600;
}

/* ── Spacing ──────────────────────────────────────────────────────────── */
:root {
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;
  --sp-7:  48px;
  --sp-8:  64px;
  --sp-9:  96px;
  --sp-10: 128px;

  /* Component padding presets */
  --pad-hero:    96px;
  --pad-section: 96px;
  --pad-card:    30px;
  --pad-card-sm: 20px;

  /* Page margins */
  --page-margin:    56px;
  --page-margin-pr: 16mm;  /* print */
}

/* ── Rules & rhythm ───────────────────────────────────────────────────── */
:root {
  --rule:    0.5px;
  --rule-2:  1px;
  --rule-3:  1.5px;
  --dash:    4 4;
  --dash-2:  2 2;

  /* radii — we use almost none; design language is square */
  --radius-0: 0;
  --radius-1: 2px;
  --radius-2: 4px;
}

/* ── Base reset for system docs + templates ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.5;
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
}

/* Type defaults */
.t-display-xl { font-family: var(--display); font-size: var(--t-display-xl); line-height: 0.96; letter-spacing: var(--tr-display); font-weight: var(--w-regular); }
.t-display    { font-family: var(--display); font-size: var(--t-display);    line-height: 1.02; letter-spacing: var(--tr-display); font-weight: var(--w-regular); }
.t-h1         { font-family: var(--display); font-size: var(--t-h1);         line-height: 1.08; letter-spacing: -0.02em; font-weight: var(--w-regular); }
.t-h2         { font-family: var(--display); font-size: var(--t-h2);         line-height: 1.15; letter-spacing: -0.015em; font-weight: var(--w-regular); }
.t-h3         { font-family: var(--display); font-size: var(--t-h3);         line-height: 1.25; letter-spacing: -0.01em;  font-weight: var(--w-medium); }
.t-h4         { font-family: var(--display); font-size: var(--t-h4);         line-height: 1.3;  font-weight: var(--w-medium); }

.t-lead       { font-family: var(--sans); font-size: var(--t-lead);  line-height: 1.55; color: var(--dim); }
.t-body       { font-family: var(--sans); font-size: var(--t-body);  line-height: 1.55; }
.t-small      { font-family: var(--sans); font-size: var(--t-small); line-height: 1.5; }

.t-eyebrow    { font-family: var(--mono); font-size: var(--t-eyebrow); letter-spacing: var(--tr-eyebrow); text-transform: uppercase; color: var(--accent); }
.t-meta       { font-family: var(--mono); font-size: var(--t-meta);    letter-spacing: var(--tr-meta);    text-transform: uppercase; color: var(--dim-2); }

.italic-display { font-style: italic; font-weight: var(--w-regular); }

/* Common eyebrow component — leading dash + label */
.eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: var(--t-eyebrow);
  letter-spacing: var(--tr-eyebrow); text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: ""; width: 28px; height: 1px; background: currentColor;
}

/* Hairline rule */
.rule    { border: 0; border-top: var(--rule) solid var(--line-2); margin: 0; }
.rule-2  { border: 0; border-top: var(--rule-2) solid var(--line-2); margin: 0; }

/* Dashed crosshair marker — for diagrams + figures */
.dashed-h { background-image: linear-gradient(to right, var(--line-2) 50%, transparent 0); background-size: 6px 1px; background-repeat: repeat-x; background-position: 0 50%; }

/* Roman numeral inline */
.roman { font-family: var(--display); font-style: italic; font-weight: 300; }
