/* ==========================================================================
   LSPT Consulting — Foundations
   Colors, typography, spacing, radii, shadows.
   Import once globally:  <link rel="stylesheet" href="colors_and_type.css">
   ========================================================================== */

/* ---- Webfonts ----------------------------------------------------------- */
@font-face {
  font-family: "Blue Mirage";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/BlueMirage.woff") format("woff"),
       url("fonts/BlueMirage.ttf")  format("truetype");
}
@font-face {
  font-family: "Blue Mirage";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/BlueMirage-Italic.woff") format("woff"),
       url("fonts/BlueMirage-Italic.ttf")  format("truetype");
}
@font-face {
  font-family: "Jotosan";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Jotosan-Signature.ttf") format("truetype");
}

/* ==========================================================================
   TOKENS
   ========================================================================== */
:root {
  /* ---- Color: Ink (primary anchor, deep navy / near-black) -------------- */
  --ink-900: #0E1B2A;   /* headlines, darkest */
  --ink-800: #17263A;   /* body text on ivory, logo navy */
  --ink-700: #223449;   /* secondary text */
  --ink-600: #3A4C63;   /* muted heads */

  /* ---- Color: Ivory (warm off-white background ramp) -------------------- */
  --ivory-50:  #FBF7EF;  /* page bg, highest warmth */
  --ivory-100: #F5EFE2;  /* alt section bg */
  --ivory-200: #EDE4D2;  /* subtle card bg */
  --ivory-300: #E2D6BE;  /* hairlines on ivory */

  /* ---- Color: Warm Neutral Gray ramp (5 steps, supports charts/UI) ----- */
  --warm-50:  #F4F1EC;
  --warm-100: #E6E0D6;
  --warm-200: #CDC4B6;
  --warm-300: #A69C8D;
  --warm-400: #6F685C;
  --warm-500: #413D36;

  /* ---- Color: Terracotta accent (single warm accent) -------------------- */
  --clay-600: #B94A2C;   /* CTA hover, deep */
  --clay-500: #C85A3C;   /* CTA primary, logo underline */
  --clay-400: #D9755A;   /* data-viz highlight 1 */
  --clay-300: #E89A85;   /* data-viz highlight 2, tints */
  --clay-100: #F5D9CE;   /* soft wash, tags */
  --clay-50:  #FBEDE5;   /* subtle bg */

  /* ---- Color: Support (functional, only used in-product, kept warm) ---- */
  --ok-600:    #5B7A4E;  /* sage green, positive delta */
  --ok-100:    #DCE4D3;
  --warn-600:  #B08434;  /* amber, caution */
  --warn-100:  #EEE1C2;
  --err-600:   #9E3A2F;  /* brick, negative delta */
  --err-100:   #F0D2CB;

  /* ---- Semantic color roles (reference via these by default) ---------- */
  --bg-page:       var(--ivory-50);
  --bg-surface:    #FFFFFF;           /* white card on ivory */
  --bg-surface-2:  var(--ivory-100);
  --bg-inverse:    var(--ink-800);

  --fg-1: var(--ink-900);              /* primary text */
  --fg-2: var(--ink-700);              /* body */
  --fg-3: var(--warm-400);             /* muted, captions */
  --fg-4: var(--warm-300);             /* hints, meta */
  --fg-inverse: var(--ivory-50);       /* text on ink */

  --border-hairline: rgba(23, 38, 58, 0.10); /* 1px divider on ivory */
  --border-strong:   rgba(23, 38, 58, 0.22);
  --border-inverse:  rgba(251, 247, 239, 0.16);

  --accent:       var(--clay-500);
  --accent-hover: var(--clay-600);
  --accent-wash:  var(--clay-50);

  --focus-ring: 0 0 0 3px rgba(200, 90, 60, 0.35);

  /* ---- Type: families ------------------------------------------------- */
  --font-display: "Blue Mirage", "Canela", "Tiempos Headline", Georgia, serif;
  --font-serif:   "Blue Mirage", "Source Serif Pro", Georgia, serif;
  --font-sans:    "Söhne", "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-signature: "Jotosan", "Homemade Apple", cursive;

  /* ---- Type: sizes (fluid-ish, desktop) ------------------------------- */
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-md:   18px;
  --text-lg:   21px;
  --text-xl:   26px;
  --text-2xl:  34px;
  --text-3xl:  44px;
  --text-4xl:  58px;
  --text-5xl:  76px;
  --text-6xl:  104px;

  /* ---- Type: line heights / letter spacing ---------------------------- */
  --lh-display: 1.02;
  --lh-heading: 1.12;
  --lh-body:    1.55;
  --lh-tight:   1.25;

  --tr-display: -0.02em;   /* Blue Mirage holds up tight */
  --tr-heading: -0.015em;
  --tr-body:     0;
  --tr-label:    0.14em;   /* ALL CAPS eyebrows */

  /* ---- Spacing (4px base; 8 is the rhythm unit) ----------------------- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;
  --space-11: 160px;

  /* ---- Radii (restrained — editorial, not rounded-friendly-startup) --- */
  --radius-0: 0;
  --radius-1: 2px;
  --radius-2: 4px;          /* default UI (inputs, buttons) */
  --radius-3: 8px;          /* cards */
  --radius-4: 14px;         /* modals, large cards */
  --radius-pill: 999px;     /* rare — tags only */

  /* ---- Borders -------------------------------------------------------- */
  --border-1: 1px solid var(--border-hairline);
  --border-2: 1px solid var(--border-strong);
  --border-accent: 1px solid var(--accent);

  /* ---- Shadows (soft; warm ink tint, never pure black) --------------- */
  --shadow-xs: 0 1px 0 rgba(23, 38, 58, 0.04);
  --shadow-sm: 0 1px 2px rgba(23, 38, 58, 0.06), 0 1px 1px rgba(23, 38, 58, 0.04);
  --shadow-md: 0 6px 18px -8px rgba(23, 38, 58, 0.18), 0 2px 4px rgba(23, 38, 58, 0.06);
  --shadow-lg: 0 20px 40px -18px rgba(23, 38, 58, 0.24), 0 6px 12px -6px rgba(23, 38, 58, 0.10);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* ---- Motion --------------------------------------------------------- */
  --ease-out:   cubic-bezier(0.2, 0.7, 0.2, 1);   /* UI default */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:  120ms;
  --dur-med:   220ms;
  --dur-slow:  420ms;

  /* ---- Layout --------------------------------------------------------- */
  --maxw-prose:  680px;
  --maxw-text:   920px;
  --maxw-page:   1200px;
  --maxw-wide:   1440px;
  --gutter:      clamp(20px, 4vw, 64px);
}

/* ==========================================================================
   SEMANTIC TYPE STYLES
   Use these classes directly, or @extend via custom properties.
   ========================================================================== */

html { color: var(--fg-1); background: var(--bg-page); }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--fg-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Display — marketing hero, report covers */
.t-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-6xl);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
  color: var(--fg-1);
  text-wrap: balance;
}
.t-display-sm {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-5xl);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
  color: var(--fg-1);
  text-wrap: balance;
}

/* Headings */
h1, .t-h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-4xl);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
  color: var(--fg-1);
  text-wrap: balance;
}
h2, .t-h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-3xl);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-heading);
  color: var(--fg-1);
  text-wrap: balance;
}
h3, .t-h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: var(--lh-tight);
  letter-spacing: -0.005em;
  color: var(--fg-1);
}
h4, .t-h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-lg);
  line-height: var(--lh-tight);
  color: var(--fg-1);
}

/* Body */
.t-lead {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--fg-2);
  text-wrap: pretty;
}
p, .t-body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--fg-2);
  text-wrap: pretty;
}
.t-body-sm {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--fg-2);
}

/* Meta / UI */
.t-eyebrow {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tr-label);
  color: var(--accent);
}
.t-caption {
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--fg-3);
}
.t-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--fg-1);
}
.t-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--fg-2);
}

/* Editorial bits */
.t-pullquote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--text-3xl);
  line-height: 1.18;
  letter-spacing: var(--tr-heading);
  color: var(--fg-1);
  text-wrap: balance;
}
.t-signature {
  font-family: var(--font-signature);
  font-size: var(--text-2xl);
  color: var(--accent);
  line-height: 1;
}

/* ---- Links ----------------------------------------------------------- */
a {
  color: var(--fg-1);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: text-decoration-thickness var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
a:hover { text-decoration-thickness: 2.5px; color: var(--accent-hover); }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 2px; }

/* ---- Selection ------------------------------------------------------- */
::selection { background: var(--clay-100); color: var(--ink-900); }

/* ---- Focus (global baseline; components can override) --------------- */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-2);
}
