/* ───────────────────────────────────────────────────────────
   Phinancer Design System — Colors & Type
   Hiper-DEX Protocol · Sprint 52-design
   Type stack matches the official brand kit (dashboards/phinancer_brandkit_v2.html)

   Type stack
     • Cormorant Garamond — wordmark & editorial. The "Phinancer"
       signature (always gold), hero statements, pull quotes.
       Weight 300 display / 400 italic for voice. Self-hosted
       (variable font in fonts/).
     • Urbanist          — headings & UI. All body, small
       headings, labels, buttons, the compact PHI/NANCER nav
       lockup. Self-hosted (Light/Medium/Bold in fonts/).
     • JetBrains Mono    — numbers, hashes, eyebrows, labels.
       Tabular by default. Self-hosted.
   ─────────────────────────────────────────────────────────── */

/* Cormorant Garamond — self-hosted variable font (weight 300-700 + italic). */
@font-face {
  font-family: 'Cormorant Garamond';
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  src: url('./fonts/CormorantGaramond-VF.ttf') format('truetype-variations');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
  src: url('./fonts/CormorantGaramond-Italic-VF.ttf') format('truetype-variations');
}

@font-face {
  font-family: 'Instrument Serif';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('./fonts/InstrumentSerif-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Instrument Serif';
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url('./fonts/InstrumentSerif-Italic.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter Tight';
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url('./fonts/InterTight-VF.ttf') format('truetype-variations');
}
@font-face {
  font-family: 'Inter Tight';
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  src: url('./fonts/InterTight-Italic-VF.ttf') format('truetype-variations');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('./fonts/JetBrainsMono-Medium.ttf') format('truetype');
}
/* Urbanist — self-hosted (headings & UI) */
@font-face {
  font-family: 'Urbanist';
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url('./fonts/Urbanist-Light.ttf') format('truetype');
}
@font-face {
  font-family: 'Urbanist';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('./fonts/Urbanist-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Urbanist';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('./fonts/Urbanist-Bold.ttf') format('truetype');
}

:root {
  /* ── Brand gold ────────────────────────────────────────── */
  --gold-100: #f4e4b5;          /* glints, hover highlights */
  --gold-200: #f0d78c;          /* PHI wordmark, titles */
  --gold-500: #d4a853;          /* PRIMARY — brand gold */
  --gold-600: #b8943f;          /* pressed / darker on light */
  --gold-700: #96782e;          /* print, light-theme gold */
  --gold-rgb: 212,168,83;       /* @kind color */
  --gold-light-rgb: 240,215,140; /* @kind color */

  /* ── Neutrals — dark canvas ───────────────────────────── */
  --bg-0: #07070b;              /* page background */
  --bg-1: #0c0e14;              /* logo canvas / primary surface */
  --bg-2: #11141b;              /* elevated panel */
  --bg-3: #151a21;              /* card / input bg */
  --bg-4: #1e242d;              /* chip / hover surface */
  --bg-terminal: #080a0f;

  /* ── Neutrals — light canvas (print / light theme) ────── */
  --bg-light-0: #f8f8f6;
  --bg-light-1: #ffffff;

  /* ── Borders & dividers ───────────────────────────────── */
  --line-soft: rgba(255,255,255,0.04);
  --line: rgba(255,255,255,0.06);
  --line-strong: rgba(255,255,255,0.10);
  --line-gold: rgba(212,168,83,0.18);

  /* ── Foreground (dark theme) ──────────────────────────── */
  --fg-1: #e6e8eb;              /* primary text */
  --fg-2: #9aa4b2;              /* secondary / muted body */
  --fg-3: #71717a;              /* tertiary / labels */
  --fg-4: #52525b;              /* captions */
  --fg-5: #3f3f46;              /* ghost / disabled */

  /* ── Foreground (light theme) ─────────────────────────── */
  --fg-light-1: #1a1a1a;
  --fg-light-2: #3f3f46;
  --fg-light-3: #71717a;

  /* ── Semantic ─────────────────────────────────────────── */
  --success: #14b079;           /* buy / positive / live */
  --success-soft: rgba(20,176,121,0.12);
  --danger: #e5484d;            /* sell / error / offline */
  --danger-soft: rgba(229,72,77,0.12);
  --warning: #f0a835;
  --warning-soft: rgba(240,168,53,0.12);
  --info: #5c6cff;              /* hash / link / explorer */
  --info-soft: rgba(92,108,255,0.12);

  /* ── Type families ────────────────────────────────────── */
  --font-editorial: 'Cormorant Garamond', 'Iowan Old Style', 'Georgia', serif;
  --font-ui:        'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:      'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* --font-display: numerics, stats, prices, big UI values — UI grotesk.
     (Editorial serif is --font-editorial; don't alias display to it.) */
  --font-display:   var(--font-ui);
  --font-body:      var(--font-ui);

  /* ── Spacing (8px grid) ───────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* ── Radii ────────────────────────────────────────────── */
  --radius-xs: 4px;             /* chips, tiny tags */
  --radius-sm: 6px;             /* buttons */
  --radius-md: 8px;             /* inputs, small cards */
  --radius-lg: 10px;            /* cards */
  --radius-xl: 12px;            /* panels */
  --radius-2xl: 16px;           /* large cards */
  --radius-pill: 999px;

  /* ── Shadows & elevation ──────────────────────────────── */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-3: 0 12px 40px rgba(0,0,0,0.55);
  --shadow-gold: 0 0 0 1px rgba(212,168,83,0.35), 0 4px 24px rgba(212,168,83,0.12);
  --glow-gold: 0 0 40px rgba(212,168,83,0.12);
  --inner-soft: inset 0 1px 0 rgba(255,255,255,0.04); /* @kind shadow */

  /* ── Motion ───────────────────────────────────────────── */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1); /* @kind other */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); /* @kind other */
  --dur-fast: 120ms; /* @kind other */
  --dur-med:  240ms; /* @kind other */
  --dur-slow: 420ms; /* @kind other */
}

/* ── Base reset / typography defaults ──────────────────── */
html, body {
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ═══════════════════════════════════════════════════════════
   SEMANTIC TYPE TOKENS
   ═══════════════════════════════════════════════════════════ */

/* Hero — editorial display. Use once per screen, max.
   Reserved for landing, section openers, major stats. */
.t-hero {
  font-family: var(--font-editorial);
  font-weight: 400;
  font-size: 88px;
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--fg-1);
}
.t-hero em, .t-hero .it {
  font-style: italic;
  color: var(--gold-200);
}

/* Display — editorial, for section hero / pull quote */
.t-display {
  font-family: var(--font-editorial);
  font-weight: 400;
  font-size: 56px;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.t-display em { font-style: italic; color: var(--gold-200); }

/* H1 — page titles (UI grotesk, tight) */
.t-h1, h1 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variation-settings: "wght" 600;
}

/* H2 — section titles */
.t-h2, h2 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-variation-settings: "wght" 600;
}

/* H3 — card titles */
.t-h3, h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-variation-settings: "wght" 600;
}

/* H4 — widget / subsection titles */
.t-h4, h4 {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  font-variation-settings: "wght" 550;
}

/* Eyebrow — section kickers (mono, upper, spaced) */
.t-eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-500);
}

/* Label — form labels, table heads */
.t-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Lede — editorial intro paragraph after a hero */
.t-lede {
  font-family: var(--font-editorial);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--fg-2);
}
.t-lede em { font-style: italic; color: var(--fg-1); }

/* Body */
.t-body, p {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg-1);
  font-variation-settings: "wght" 400;
}
.t-body-sm {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-2);
  font-variation-settings: "wght" 400;
}
.t-caption {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-3);
  font-variation-settings: "wght" 400;
}

/* Mono numeric — tabular figures for trading / hashes */
.t-num, .mono {
  font-family: var(--font-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Large display number — for hero KPIs (uses mono for
   precision / trading vibe, NOT serif) */
.t-num-display {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--fg-1);
}

/* Code blocks */
.t-code, code {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--gold-200);
}

/* Wordmark helper — "PHI" gold + "NANCER" white
   Uses editorial serif for distinctive, non-techy feel */
.wordmark {
  font-family: var(--font-editorial);
  font-weight: 400;
  letter-spacing: -0.02em;
}
.wordmark-phi     { color: var(--gold-200); }
.wordmark-nancer  { color: var(--fg-1); }
.wordmark-slash   { color: var(--gold-500); font-style: italic; padding: 0 0.08em; }

/* Pull quote — attribution */
.t-attribution {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Utility — rule divider matching design DNA */
.rule-dotted {
  border: 0;
  border-top: 1px dotted var(--line-strong);
  margin: var(--space-8) 0;
}
.rule-gold {
  border: 0;
  border-top: 1px solid var(--gold-500);
  width: 48px;
  margin: var(--space-6) 0;
}
