/*
 * Qalqi Design System — Colors & Typography
 * Source: Qalqi Visual Identity + Typography Standards docs
 * Google Fonts: IBM Plex Serif, IBM Plex Mono, IBM Plex Sans
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&family=IBM+Plex+Serif:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

/* ─── BASE COLOR TOKENS ─────────────────────────────── */
:root {
  --substrate-black:   #0D0D0F;   /* The Void       — Primary Background */
  --soma-white:        #F8F9FA;   /* The Moon        — Primary Typography */
  --static-violet:     #8B5CF6;   /* The Electric Sword — Action/Intelligence */
  --aditya-gold:       #F59E0B;   /* The Sun         — Integrity/Rules */
  --structural-gray:   #424242;   /* The Cathedral   — Framework/Borders */

  /* Derived shades */
  --substrate-black-02: #16161A;  /* Slightly lifted surface */
  --substrate-black-03: #1E1E24;  /* Cards, panels */
  --soma-white-dim:     #A0A4AB;  /* Muted text */
  --static-violet-dim:  #6D3FD4;  /* Hover / pressed violet */
  --static-violet-glow: rgba(139,92,246,0.15); /* Violet background tint */
  --aditya-gold-dim:    #D97706;  /* Warning pressed */
  --aditya-gold-glow:   rgba(245,158,11,0.12);

  /* ─── SEMANTIC COLOR VARS ─── */
  --bg:           var(--substrate-black);
  --bg-surface:   var(--substrate-black-02);
  --bg-card:      var(--substrate-black-03);
  --fg:           var(--soma-white);
  --fg-muted:     var(--soma-white-dim);
  --border:       var(--structural-gray);
  --border-dim:   rgba(66,66,66,0.5);
  --accent:       var(--static-violet);
  --accent-hover: var(--static-violet-dim);
  --accent-bg:    var(--static-violet-glow);
  --warning:      var(--aditya-gold);
  --warning-bg:   var(--aditya-gold-glow);
  --link:         var(--static-violet);
  --link-hover:   var(--soma-white);
}

/* ─── TYPE SCALE ────────────────────────────────────── */
:root {
  --font-serif:  'IBM Plex Serif', Georgia, serif;
  --font-mono:   'IBM Plex Mono', 'Courier New', monospace;
  --font-sans:   'IBM Plex Sans', system-ui, sans-serif;

  /* Scale (major third — 1.25×) */
  --text-xs:    0.64rem;    /* 10.24px */
  --text-sm:    0.8rem;     /* 12.8px  */
  --text-base:  1rem;       /* 16px    */
  --text-md:    1.25rem;    /* 20px    */
  --text-lg:    1.563rem;   /* 25px    */
  --text-xl:    1.953rem;   /* 31.25px */
  --text-2xl:   2.441rem;   /* 39px    */
  --text-3xl:   3.052rem;   /* 48.8px  */
  --text-4xl:   3.815rem;   /* 61px    */

  /* Line heights */
  --leading-tight:  1.15;
  --leading-snug:   1.35;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  /* Letter spacing */
  --tracking-tight:  -0.02em;
  --tracking-normal:  0em;
  --tracking-wide:    0.05em;
  --tracking-wider:   0.12em;
}

/* ─── SEMANTIC TYPE ROLES ───────────────────────────── */

/* H1 — IBM Plex Serif Bold — "Cathedral" weight */
h1, .h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
}

/* H2 — IBM Plex Mono SemiBold — Technical signaling */
h2, .h2 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
  color: var(--fg);
}

/* H3 — IBM Plex Mono Medium */
h3, .h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--fg);
}

/* H4 — IBM Plex Sans SemiBold */
h4, .h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  color: var(--fg);
}

/* Body — IBM Plex Sans Regular */
body, p, .body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fg);
}

/* Small / Muted */
small, .text-sm {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* Data / Metrics — Mono Medium — looks like system output */
.metric, .data {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--text-md);
  color: var(--static-violet);
  letter-spacing: var(--tracking-tight);
}

/* Code / Terminal */
code, pre, .code {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--text-sm);
  color: var(--soma-white);
  background: var(--bg-card);
  border-radius: 3px;
}

pre {
  padding: 1.25rem;
  border: 1px solid var(--border-dim);
  overflow-x: auto;
  line-height: var(--leading-normal);
}

code {
  padding: 0.1em 0.35em;
}

/* Label / Tag */
.label {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* Accent label */
.label-accent {
  color: var(--static-violet);
}

/* ─── SPACING SCALE ─────────────────────────────────── */
:root {
  --space-1:   0.25rem;   /*  4px */
  --space-2:   0.5rem;    /*  8px */
  --space-3:   0.75rem;   /* 12px */
  --space-4:   1rem;      /* 16px */
  --space-5:   1.5rem;    /* 24px */
  --space-6:   2rem;      /* 32px */
  --space-7:   3rem;      /* 48px */
  --space-8:   4rem;      /* 64px */
  --space-9:   6rem;      /* 96px */
  --space-10:  8rem;      /* 128px */
}

/* ─── BORDER RADIUS ─────────────────────────────────── */
:root {
  --radius-sm:  2px;
  --radius-md:  4px;
  --radius-lg:  6px;
  --radius-xl:  8px;
  --radius-pill: 9999px;
}

/* ─── ELEVATION / SHADOWS ───────────────────────────── */
:root {
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.6);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.7);
  --shadow-violet: 0 0 24px rgba(139,92,246,0.2);
}
