/* =============================================================
   Civic Arts — Colors & Type
   Foundation tokens for all Civic Arts design work.
   Import this file at the top of any HTML/CSS surface.
   ============================================================= */

/* ---------- Webfonts (self-hosted) ---------- */
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSansMedium-regular.ttf") format("truetype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSansSemiBold-regular.ttf") format("truetype");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-boldItalic.ttf") format("truetype");
  font-weight: 700; font-style: italic; font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("fonts/Lora-regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("fonts/Lora-italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("fonts/Lora-bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("fonts/Lora-boldItalic.ttf") format("truetype");
  font-weight: 700; font-style: italic; font-display: swap;
}

:root {
  /* ---------- Brand Color Primitives ---------- */
  /* Ink — deep navy sampled from the wordmark. Primary text + structure. */
  --ca-ink-900: #13293d;   /* wordmark navy, headings, plots */
  --ca-ink-800: #1a3a4f;   /* rich navy, section surfaces */
  --ca-ink-700: #2a4d63;   /* muted navy, secondary surfaces */
  --ca-ink-600: #456578;   /* support ink */
  --ca-body:    #1a1818;   /* near-black body text (sampled from doc template) */

  /* Tide — paint-stroke blues sampled from the logo mark. Accent + energy. */
  --ca-tide-700: #155c85;  /* deep tide, hover/pressed */
  --ca-tide-600: #2486b8;  /* mid tide, focus/accent */
  --ca-tide-500: #2fa8d4;  /* bright paint-stroke blue */
  --ca-tide-400: #7cc6e0;  /* splashy tint */
  --ca-tide-300: #bfe1ee;  /* soft tint, backgrounds */
  --ca-tide-100: #e8f3f7;  /* palest tide wash */

  /* Paper — neutrals. Threshold-warm, not ivory. */
  --ca-paper:   #fbfaf7;   /* warm paper, primary page */
  --ca-cream:   #f4f0e8;   /* cream fill, highlight cards */
  --ca-sand:    #e8e2d5;   /* sand border / divider */
  --ca-stone:   #c4bdb0;   /* stone rule, disabled text */
  --ca-shadow:  #6b6459;   /* muted text on paper */

  /* Stained Glass — Lynn's personal palette, for faith-informed register
     and for editorial / long-form work. Use sparingly, never on municipal
     proposals without intent. See README §Visual Foundations. */
  --ca-slate:   #5b7a8c;   /* slate blue */
  --ca-plum:    #6b4a5a;   /* dusky plum */
  --ca-sage:    #5b6e55;   /* deep sage */
  --ca-umber:   #8a5a3b;   /* warm umber */
  --ca-violet:  #7a6788;   /* dusty violet */
  --ca-lead:    #2b2a2f;   /* dark lead line */

  /* Graphic Palette — for flat, geometric graphic compositions only:
     hero illustrations, section dividers, stat plates, report covers,
     duotone photography. NEVER use these for body type, UI chrome, or
     municipal proposal surfaces. See README §Graphic Palette.

     Hierarchy:
       · Citron is the SYSTEM accent — used everywhere at identity level
         (rules, italic emphasis, masthead dots, CTA plates).
       · Coral / Clay / Brass / Slate-accent / Teal are the CRAFT palette —
         used inside individual small graphics (pull-quotes, key-takeaways,
         charts, tags) to give each piece mood without fragmenting identity.
     Never let a craft color take Citron's role; never put two craft
     colors in the same composition (one per graphic). */
  --ca-citron:  #e6c24a;   /* sunlit yellow — primary graphic pop */
  --ca-citron-soft: #f0d982; /* tinted citron for grounds */
  --ca-coral:   #d96a4a;   /* warm bright — CTA plates, accents in graphics */
  --ca-coral-soft: #e89a82;/* tinted coral for grounds */
  --ca-clay:    #b5543a;   /* terracotta — earthier than coral */
  --ca-clay-soft:   #d99a80;/* tinted clay for grounds */
  --ca-brass:   #b8944a;   /* muted gold — institutional cousin of Citron */
  --ca-brass-soft:  #d9c28a;/* tinted brass for grounds */
  --ca-slate-accent: #5b7a8c; /* slate blue as graphic accent (alias of --ca-slate) */
  --ca-slate-soft:  #9eb1bc;  /* tinted slate for grounds */
  --ca-teal:    #2d7a7a;   /* deep teal — modern civic pivot */
  --ca-teal-soft:   #7fa6a6;  /* tinted teal for grounds */

  /* Semantic status — used sparingly in product UI */
  --ca-success: #3d7a5c;
  --ca-warning: #b07a2b;
  --ca-danger:  #9b3a3a;
  --ca-info:    var(--ca-tide-600);

  /* ---------- Semantic surfaces ---------- */
  --bg:         var(--ca-paper);
  --bg-alt:     var(--ca-cream);
  --bg-deep:    var(--ca-ink-900);
  --surface:    #ffffff;
  --surface-alt:var(--ca-tide-100);

  --fg:         var(--ca-body);
  --fg-muted:   var(--ca-shadow);
  --fg-soft:    #8a8377;
  --fg-invert:  #fbfaf7;

  --accent:     var(--ca-tide-600);
  --accent-ink: var(--ca-ink-900);

  --border:     var(--ca-sand);
  --border-strong: var(--ca-stone);
  --rule:       #d8d2c4;

  --focus-ring: color-mix(in oklab, var(--ca-tide-500) 55%, transparent);

  /* ---------- Type families ---------- */
  --font-sans:  "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---------- Type scale (1.200 minor third, anchored 16px) ---------- */
  --fs-12: 0.75rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-28: 1.75rem;
  --fs-32: 2rem;
  --fs-40: 2.5rem;
  --fs-48: 3rem;
  --fs-64: 4rem;
  --fs-80: 5rem;

  /* ---------- Line heights ---------- */
  --lh-tight:  1.08; /* @kind other */
  --lh-snug:   1.2;  /* @kind other */
  --lh-normal: 1.45; /* @kind other */
  --lh-prose:  1.6;  /* @kind other */

  /* ---------- Tracking ---------- */
  --ls-eyebrow: 0.14em;  /* ALL-CAPS labels, wordmark vibe */
  --ls-display: -0.01em;
  --ls-tight:  -0.015em;
  --ls-normal: 0; /* @kind other */

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

  /* ---------- Radii ---------- */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;    /* standard control radius — quiet, institutional */
  --r-lg: 10px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* ---------- Elevation — quiet, paper-grade ---------- */
  --shadow-xs: 0 1px 0 rgba(19, 41, 61, 0.06);
  --shadow-sm: 0 1px 2px rgba(19, 41, 61, 0.06), 0 1px 3px rgba(19, 41, 61, 0.04);
  --shadow-md: 0 4px 10px rgba(19, 41, 61, 0.07), 0 2px 4px rgba(19, 41, 61, 0.05);
  --shadow-lg: 0 14px 30px rgba(19, 41, 61, 0.09), 0 6px 12px rgba(19, 41, 61, 0.06);

  /* Accent ring for focus + key controls */
  --ring-accent: 0 0 0 3px var(--focus-ring);

  /* ---------- Motion ---------- */
  --ease-standard: cubic-bezier(0.22, 0.61, 0.36, 1); /* @kind other */
  --ease-entrance: cubic-bezier(0.16, 1, 0.3, 1); /* @kind other */
  --dur-fast: 120ms; /* @kind other */
  --dur-med:  220ms; /* @kind other */
  --dur-slow: 420ms; /* @kind other */

  /* ---------- Layout ---------- */
  --content-max: 1120px;
  --prose-max:   68ch;
}

/* ===== Base ===== */
html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ===== Display & headings =====
   Headings use Lora (serif) for warmth + intellectual register.
   Instrument Sans takes over at H5/H6 and eyebrows for UI precision.
*/
.ca-display,
h1.ca-display {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(var(--fs-48), 6vw, var(--fs-80));
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  color: var(--ca-ink-900);
  text-wrap: balance;
}

h1, .ca-h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-48);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  color: var(--ca-ink-900);
  text-wrap: balance;
  margin: 0 0 var(--sp-5);
}
h2, .ca-h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-32);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  color: var(--ca-ink-900);
  text-wrap: balance;
  margin: 0 0 var(--sp-4);
}
h3, .ca-h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: var(--fs-24);
  line-height: var(--lh-snug);
  color: var(--ca-ink-800);
  margin: 0 0 var(--sp-3);
}
h4, .ca-h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-20);
  line-height: var(--lh-snug);
  color: var(--ca-ink-800);
  margin: 0 0 var(--sp-3);
}
h5, .ca-h5 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-16);
  line-height: var(--lh-snug);
  color: var(--ca-ink-800);
  margin: 0 0 var(--sp-2);
}

/* Eyebrow — small caps, wide-tracked. Used above titles and as section labels. */
.ca-eyebrow {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-12);
  line-height: 1.2;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--ca-tide-700);
}

/* Lede / intro paragraph */
.ca-lede {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: var(--fs-24);
  line-height: var(--lh-prose);
  color: var(--ca-ink-800);
  max-width: var(--prose-max);
  text-wrap: pretty;
}

/* Body */
p, .ca-body {
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-prose);
  color: var(--fg);
  max-width: var(--prose-max);
  text-wrap: pretty;
}
.ca-body-lg {
  font-size: var(--fs-18);
  line-height: var(--lh-prose);
}
.ca-body-sm {
  font-size: var(--fs-14);
  line-height: var(--lh-normal);
  color: var(--fg-muted);
}

/* Pull quote — serif italic, lead-line accent */
.ca-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-28);
  line-height: var(--lh-snug);
  color: var(--ca-ink-800);
  border-left: 2px solid var(--ca-tide-600);
  padding-left: var(--sp-6);
  max-width: var(--prose-max);
  text-wrap: pretty;
}

/* Caption / metadata */
.ca-caption {
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
}

/* Links */
a, .ca-link {
  color: var(--ca-tide-700);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in oklab, var(--ca-tide-700) 40%, transparent);
  transition: color var(--dur-fast) var(--ease-standard),
              text-decoration-color var(--dur-fast) var(--ease-standard);
}
a:hover, .ca-link:hover {
  color: var(--ca-ink-900);
  text-decoration-color: var(--ca-ink-900);
}

/* Tabular numerals for data */
.ca-tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Mono */
code, .ca-mono {
  font-family: var(--font-mono);
  font-size: 0.95em;
  background: var(--ca-cream);
  padding: 0.08em 0.35em;
  border-radius: var(--r-xs);
  color: var(--ca-ink-800);
}

/* Horizontal rule — low-contrast, institutional */
hr, .ca-rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--sp-8) 0;
}

/* Selection */
::selection {
  background: color-mix(in oklab, var(--ca-tide-500) 35%, transparent);
  color: var(--ca-ink-900);
}

/* Focus */
:focus-visible {
  outline: none;
  box-shadow: var(--ring-accent);
  border-radius: var(--r-sm);
}
