/* ==========================================================================
   MoCo Monitor — Colors & Type
   Civic engagement design system • County government • WCAG AA baseline
   ========================================================================== */

/* ---------- Fonts ---------- */
/* Primary: Inter (body + display). Already in Stitch output. */
/* Numerals: Inter tabular figures for data/timestamps. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
/* Material Symbols Rounded — matches the Round icon family used in Stitch */
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,300..700,0..1,-50..200&display=swap');

:root {
  /* ======================================================================
     COLOR — Neutrals (Slate scale)
     ====================================================================== */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Page background — cool off-white, lifts cards without washing out */
  --bg:          #f3f4f6;
  --bg-elevated: #ffffff;  /* Cards / sheets */
  --bg-subtle:   #f8fafc;  /* Nested tiles (Status/Source) */

  /* Foreground */
  --fg-1: #0f172a;  /* Titles, primary text (AA on --bg, AAA on white) */
  --fg-2: #475569;  /* Body text */
  --fg-3: #64748b;  /* Secondary / captions */
  --fg-4: #94a3b8;  /* Meta / timestamps / disabled-ish */

  /* Borders */
  --border-subtle: #f1f5f9;   /* Card hairlines */
  --border:        #e2e8f0;   /* Default */
  --border-strong: #cbd5e1;   /* Form inputs */

  /* ======================================================================
     COLOR — Primary (Indigo)
     The civic action color. Used for CTAs, links, active tab, focus ring.
     Chosen over the Stitch "#5c62f2" to hit AA (4.5:1) on white for text links.
     ====================================================================== */
  --primary-50:  #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5; /* ← default */
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  --primary:        var(--primary-600);
  --primary-hover:  var(--primary-700);
  --primary-active: var(--primary-800);
  --primary-fg:     #ffffff;     /* Text on primary */
  --primary-soft:   var(--primary-50);
  --primary-soft-fg: var(--primary-700);
  --focus-ring:     var(--primary-500);

  /* ======================================================================
     COLOR — Semantic (AA contrast on their soft backgrounds)
     ====================================================================== */
  /* Success / Environment — emerald */
  --success-soft:    #d1fae5;
  --success-soft-fg: #065f46;
  --success:         #059669;
  --success-strong:  #047857;

  /* Warning / Service — amber (used sparingly: status dot, caution) */
  --warning-soft:    #fef3c7;
  --warning-soft-fg: #92400e;
  --warning:         #d97706;
  --warning-strong:  #b45309;

  /* Danger / Public Safety — rose */
  --danger-soft:    #ffe4e6;
  --danger-soft-fg: #9f1239;
  --danger:         #e11d48;
  --danger-strong:  #be123c;

  /* Info / "Why It Matters" callouts — blue-tinted indigo */
  --info-soft:    #eef2ff;
  --info-soft-fg: #3730a3;
  --info:         #4f46e5;

  /* ======================================================================
     COLOR — Category tokens
     MoCo Monitor's alerts are classified; each category gets a chip + icon tint.
     Category names map 1:1 to semantic tokens where possible.
     ====================================================================== */
  --cat-environment-soft:    var(--success-soft);
  --cat-environment-soft-fg: var(--success-soft-fg);
  --cat-environment-icon:    #10b981;

  --cat-public-safety-soft:    var(--danger-soft);
  --cat-public-safety-soft-fg: var(--danger-soft-fg);
  --cat-public-safety-icon:    #e11d48;

  --cat-service-soft:    var(--slate-100);
  --cat-service-soft-fg: var(--slate-700);
  --cat-service-icon:    var(--slate-600);

  --cat-health-soft:    #fce7f3;
  --cat-health-soft-fg: #9d174d;
  --cat-health-icon:    #db2777;

  --cat-transit-soft:    #dbeafe;
  --cat-transit-soft-fg: #1e40af;
  --cat-transit-icon:    #2563eb;

  --cat-civic-soft:    var(--primary-100);
  --cat-civic-soft-fg: var(--primary-800);
  --cat-civic-icon:    var(--primary);

  /* ======================================================================
     SHADOWS — "Soft" elevation. Civic, not fancy. One-way lights from above.
     ====================================================================== */
  --shadow-xs:   0 1px 2px 0 rgb(15 23 42 / 0.04);
  --shadow-sm:   0 1px 3px 0 rgb(15 23 42 / 0.06), 0 1px 2px -1px rgb(15 23 42 / 0.04);
  --shadow:      0 4px 20px -2px rgb(15 23 42 / 0.05);                     /* cards */
  --shadow-md:   0 10px 25px -8px rgb(15 23 42 / 0.10);                    /* sheets */
  --shadow-lg:   0 20px 40px -12px rgb(15 23 42 / 0.18);                   /* modals */
  --shadow-primary-glow: 0 8px 24px -6px rgb(79 70 229 / 0.35);            /* primary CTA lift */

  /* ======================================================================
     RADII — Generous roundness. Part of the "approachable civic" feel.
     ====================================================================== */
  --radius-xs:   4px;    /* checkbox, small chips */
  --radius-sm:   6px;    /* category chip */
  --radius:      12px;   /* default: buttons, inputs, tiles */
  --radius-lg:   16px;   /* internal modules */
  --radius-xl:   24px;   /* cards, bottom-sheet top */
  --radius-2xl:  32px;
  --radius-full: 9999px; /* pills, avatars */

  /* ======================================================================
     SPACING — 4px scale
     ====================================================================== */
  --space-0:  0;
  --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;

  /* Screen paddings */
  --screen-pad:   16px;
  --content-pad:  24px;

  /* ======================================================================
     LAYOUT
     ====================================================================== */
  --screen-max:    448px;   /* mobile frame */
  --content-max:   1200px;  /* web */
  --tab-bar-h:     72px;
  --topbar-h:      56px;
  --tap-target:    44px;    /* WCAG minimum */

  /* ======================================================================
     TYPE — System
     ====================================================================== */
  --font-sans:  'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono:  ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-icon:  'Material Symbols Rounded';

  /* Type scale — mobile-first, sane at 448px */
  --text-xs:    12px;
  --text-sm:    14px;
  --text-base:  16px;
  --text-md:    18px;
  --text-lg:    20px;
  --text-xl:    24px;
  --text-2xl:   30px;
  --text-3xl:   36px;
  --text-4xl:   48px;

  /* Line heights */
  --lh-tight:  1.15;
  --lh-snug:   1.3;
  --lh-normal: 1.5;
  --lh-relaxed: 1.65;

  /* Tracking */
  --track-tight:    -0.02em;
  --track-normal:   0;
  --track-wide:     0.04em;
  --track-caps:     0.08em;

  /* Weights */
  --w-regular:  400;
  --w-medium:   500;
  --w-semibold: 600;
  --w-bold:     700;
  --w-heavy:    800;

  /* ======================================================================
     MOTION
     ====================================================================== */
  --ease:          cubic-bezier(.4, 0, .2, 1);
  --ease-out:      cubic-bezier(0, 0, .2, 1);
  --ease-emphatic: cubic-bezier(.2, .8, .2, 1);
  --dur-fast:   120ms;
  --dur-base:   200ms;
  --dur-slow:   320ms;
}

/* ==========================================================================
   SEMANTIC TYPE ROLES
   Use these instead of raw tokens in product code.
   ========================================================================== */

.t-display {
  font-family: var(--font-display);
  font-weight: var(--w-heavy);
  font-size: var(--text-3xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  color: var(--fg-1);
}

.t-h1 {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-size: var(--text-2xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  color: var(--fg-1);
}

.t-h2 {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-size: var(--text-xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  color: var(--fg-1);
}

.t-h3 {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-size: var(--text-md);
  line-height: var(--lh-snug);
  color: var(--fg-1);
}

.t-h4 {
  font-family: var(--font-sans);
  font-weight: var(--w-semibold);
  font-size: var(--text-base);
  line-height: var(--lh-snug);
  color: var(--fg-1);
}

.t-body {
  font-family: var(--font-sans);
  font-weight: var(--w-regular);
  font-size: var(--text-sm);
  line-height: var(--lh-relaxed);
  color: var(--fg-2);
}

.t-body-lg {
  font-family: var(--font-sans);
  font-weight: var(--w-regular);
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--fg-2);
}

.t-caption {
  font-family: var(--font-sans);
  font-weight: var(--w-medium);
  font-size: var(--text-xs);
  line-height: var(--lh-normal);
  color: var(--fg-3);
}

/* Uppercase eyebrow / section label — "YOUR CHECKLIST", "MAKE YOUR VOICE HEARD" */
.t-eyebrow {
  font-family: var(--font-sans);
  font-weight: var(--w-bold);
  font-size: var(--text-xs);
  line-height: 1;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--fg-3);
}

.t-label {
  font-family: var(--font-sans);
  font-weight: var(--w-semibold);
  font-size: var(--text-sm);
  line-height: var(--lh-snug);
  color: var(--fg-1);
}

.t-meta {
  font-family: var(--font-sans);
  font-weight: var(--w-medium);
  font-size: var(--text-xs);
  line-height: 1;
  color: var(--fg-4);
  font-variant-numeric: tabular-nums;
}

/* Category chip uppercase pill */
.t-chip {
  font-family: var(--font-sans);
  font-weight: var(--w-bold);
  font-size: 10px;
  line-height: 1;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
}

/* Button label */
.t-button {
  font-family: var(--font-sans);
  font-weight: var(--w-semibold);
  font-size: var(--text-sm);
  line-height: 1;
  letter-spacing: 0;
}

/* ==========================================================================
   BASE
   ========================================================================== */
body {
  font-family: var(--font-sans);
  color: var(--fg-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11'; /* Inter: straight-sided digits + stylistic refinements */
}

/* Material Symbols Rounded — matches Stitch icon set */
.mi {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.mi.filled { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

/* Accessible focus ring — always visible */
*:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
