/* =========================================================================
   MPCC Design System — colors_and_type.css
   v0.2 — editorial calm warmth
   ========================================================================= */

/* ----- Fonts ------------------------------------------------------------- */
/* Loaded from Google Fonts — see <link> import or @import below.
   If self-hosting, drop the files in /fonts and update the @font-face rules. */

/* Geist + JetBrains Mono — still Google Fonts (@import must come first per CSS spec) */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* Newsreader — local variable fonts (uploaded by brand) */
@font-face {
  font-family: 'Newsreader';
  src: url('fonts/Newsreader-VariableFont_opsz_wght.ttf') format('truetype-variations'),
       url('fonts/Newsreader-VariableFont_opsz_wght.ttf') format('truetype');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('fonts/Newsreader-Italic-VariableFont_opsz_wght.ttf') format('truetype-variations'),
       url('fonts/Newsreader-Italic-VariableFont_opsz_wght.ttf') format('truetype');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

/* =========================================================================
   1. TOKENS
   ========================================================================= */

:root {
  /* ---- Color: surfaces ---- */
  --bg-primary:        #F5F0E6;   /* warm cream — "paper" */
  --bg-elevated:       #FBF7EE;   /* lifted cream for cards */
  --bg-paper:          #EBE3D4;   /* warm beige — dividers, chips */
  --bg-deep:           #2A2723;   /* warm dark brown-black — NEVER pure black */

  /* ---- Color: text ---- */
  --text-primary:      #2A2723;
  --text-secondary:    #6B5F52;   /* warm taupe-brown */
  --text-tertiary:     #9A8E7F;   /* muted warm gray */
  --text-on-deep:      #F5F0E6;   /* cream on dark */

  /* ---- Color: accents (use sparingly — <10% of any view) ---- */
  --accent-primary:    #A8523F;   /* deeper muted terracotta */
  --accent-primary-hover: #944735;
  --accent-secondary:  #7A8C6E;   /* muted sage */
  --accent-warm:       #D4A574;   /* dusty amber / clay */
  --accent-cool:       #4A5D6B;   /* slate blue — data accents only */

  /* ---- Color: state ---- */
  --success:           #6B7F4F;   /* deeper olive */
  --warning:           #B8823A;   /* deeper amber */
  --error:             #8E3A2D;
  --info:              #4A5D6B;

  /* ---- Type families ---- */
  --font-display:      'Newsreader', 'Source Serif 4', 'Georgia', serif;
  --font-sans:         'Geist', 'Geist Sans', system-ui, sans-serif;
  --font-mono:         'JetBrains Mono', ui-monospace, monospace;

  /* ---- Type scale (fluid where appropriate) ---- */
  --font-hero-display: clamp(2.75rem, 6vw, 5rem);     /* 44–80px */
  --font-section:      clamp(2rem, 4.5vw, 3.5rem);    /* 32–56px */
  --font-heading-1:    clamp(1.5rem, 2.5vw, 2rem);    /* 24–32px */
  --font-heading-2:    clamp(1.25rem, 2vw, 1.5rem);   /* 20–24px */
  --font-body-lead:    1.25rem;                        /* 20px */
  --font-body:         1.0625rem;                      /* 17px */
  --font-small:        0.9375rem;                      /* 15px */
  --font-caption:      0.8125rem;                      /* 13px */

  /* ---- Spacing (8px base) ---- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-8:  48px;
  --space-10: 64px;
  --space-12: 96px;
  --space-16: 128px;
  --space-20: 192px;
  --space-24: 256px;

  /* ---- Layout ---- */
  --max-frame:    1280px;
  --max-content:  720px;     /* editorial readable width */
  --max-readable: 62ch;
  --max-narrow:   48ch;

  /* ---- Radii (kept small — magazine signal) ---- */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-xl: 16px;

  /* ---- Borders ---- */
  --border-hair: 1px solid var(--bg-paper);
  --border-rule: 1px solid var(--text-tertiary);
  --border-accent: 2px solid var(--accent-primary);

  /* ---- Motion ---- */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-micro: 150ms;
  --dur-small: 250ms;
  --dur-medium: 500ms;
}

/* =========================================================================
   2. BASE / SEMANTIC
   ========================================================================= */

html, body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Headings ---- */
/* v0.2.3 — Newsreader (more editorial character than Source Serif 4) */
h1, .h1 {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 72, 'wght' 500;
  font-weight: 500;
  font-size: var(--font-hero-display);
  line-height: 1.08;
  letter-spacing: -0.018em;
  color: var(--text-primary);
  max-width: 18ch;
  margin: 0 0 var(--space-6);
}

h2, .h2 {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 48, 'wght' 500;
  font-weight: 500;
  font-size: var(--font-section);
  line-height: 1.12;
  letter-spacing: -0.013em;
  max-width: 22ch;
  margin: 0 0 var(--space-5);
}

h3, .h3 {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 24, 'wght' 550;
  font-weight: 550;
  font-size: var(--font-heading-1);
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0 0 var(--space-4);
}

h4, .h4 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--font-heading-2);
  line-height: 1.3;
  margin: 0 0 var(--space-3);
}

/* ---- Body ---- */
p, .body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--font-body);
  line-height: 1.65;
  max-width: var(--max-readable);
  color: var(--text-primary);
  margin: 0 0 var(--space-5);
}

.lead {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--font-body-lead);
  line-height: 1.55;
  max-width: 56ch;
  color: var(--text-secondary);
}

.caption {
  font-family: var(--font-sans);
  font-size: var(--font-caption);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--font-caption);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---- Editorial signature: pull quote ---- */
.pull-quote {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 24, 'wght' 450, 'ital' 1;
  font-style: italic;
  font-size: 1.75rem;
  line-height: 1.35;
  max-width: 32ch;
  margin: var(--space-8) 0;
  padding-left: var(--space-5);
  border-left: var(--border-accent);
  color: var(--text-primary);
}

.pull-quote cite {
  display: block;
  margin-top: var(--space-4);
  font-style: normal;
  font-family: var(--font-sans);
  font-size: var(--font-small);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* ---- Numbers / data ---- */
.mono, code, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

code {
  background: var(--bg-paper);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

/* ---- Links ---- */
a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--dur-small) ease;
}

a:hover { color: var(--accent-primary-hover); }

hr {
  border: 0;
  border-top: 1px solid var(--bg-paper);
  margin: var(--space-8) 0;
}
