/* =============================================================
   METHOD CREEK — Colors & Type
   The single source of truth for color and typography tokens.
   Import this file at the root of any product to inherit the system.
   ============================================================= */

/* ---------- Webfonts ----------
   Method Creek uses Roboto Flex (variable-axis, the modern successor to
   Roboto) for everything — display, headlines, UI, body — and Roboto Mono
   for code. Both are Apache 2.0, fully free for commercial use, with no
   future paywall. We lean on weight and tracking, not family pairing, to
   create hierarchy. */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,400;8..144,500;8..144,600;8..144,700;8..144,800&family=Roboto+Mono:wght@400;500;600&display=swap');

:root {
  /* ===== Brand palette =====
     Pulled from the supplied palette image. "Creek" is the deep teal-blue
     that anchors the wordmark; "Stone" is the warm gray washes; "Mist" is
     the muted desaturated blue-gray used in supporting UI. */
  --mc-creek-900: #062B3D;   /* deepest, hover/pressed on creek-700 */
  --mc-creek-800: #0D445F;   /* darker accent (from palette) */
  --mc-creek-700: #0F5D82;   /* primary brand blue (from palette) */
  --mc-creek-600: #1E7AA3;   /* hover/active for primary */
  --mc-creek-500: #4A95B8;   /* desaturated highlight */
  --mc-creek-400: #87A8B7;   /* slate-blue accent (from palette) */
  --mc-creek-300: #B6BABF;   /* cool light gray (from palette) */
  --mc-creek-200: #D6DCE1;   /* surface tint */
  --mc-creek-100: #EAEEF2;   /* near-white tint */
  --mc-creek-050: #F5F7F9;   /* faintest wash */

  --mc-stone-900: #1A1C1E;
  --mc-stone-800: #2A2D31;
  --mc-stone-700: #3F4348;
  --mc-stone-600: #5A5F66;
  --mc-stone-500: #8E9298;   /* neutral gray (from palette) */
  --mc-stone-400: #B6BABF;
  --mc-stone-300: #D2D5D9;
  --mc-stone-200: #E5E7EA;
  --mc-stone-100: #F1F2F4;
  --mc-stone-050: #F8F9FA;
  --mc-stone-000: #FFFFFF;

  /* Semantic accents — kept restrained, washed toward the cool palette */
  --mc-success: #2F7D5B;
  --mc-success-bg: #E6F1EB;
  --mc-warning: #B8791F;
  --mc-warning-bg: #FAF1DF;
  --mc-danger: #B23A3A;
  --mc-danger-bg: #F7E5E5;
  --mc-info: var(--mc-creek-700);
  --mc-info-bg: var(--mc-creek-100);

  /* ===== Light theme (default) ===== */
  --mc-bg:        var(--mc-stone-000);
  --mc-bg-subtle: var(--mc-stone-050);
  --mc-bg-muted:  var(--mc-stone-100);
  --mc-surface:   var(--mc-stone-000);
  --mc-surface-raised: var(--mc-stone-000);
  --mc-overlay:   rgba(6, 43, 61, 0.55);

  --mc-fg-1: var(--mc-creek-900);   /* primary text — deep creek */
  --mc-fg-2: var(--mc-stone-700);   /* body text */
  --mc-fg-3: var(--mc-stone-600);   /* secondary / meta */
  --mc-fg-4: var(--mc-stone-500);   /* placeholder / disabled */
  --mc-fg-on-brand: var(--mc-stone-000);

  --mc-border-1: var(--mc-stone-200);
  --mc-border-2: var(--mc-stone-300);
  --mc-border-strong: var(--mc-creek-800);

  --mc-accent: var(--mc-creek-700);
  --mc-accent-hover: var(--mc-creek-600);
  --mc-accent-pressed: var(--mc-creek-800);
  --mc-accent-soft: var(--mc-creek-100);

  /* ===== Type =====
     Single-family system. --mc-font-display and --mc-font-sans both resolve
     to Roboto Flex; the alias is preserved so existing display call-sites
     keep working if the family is ever split again. */
  --mc-font-display: 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mc-font-sans:    'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mc-font-serif:   var(--mc-font-display); /* kept for back-compat — no serif in the active system */
  --mc-font-mono:    'Roboto Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Scale — modular, 1.200 minor third */
  --mc-text-xs:   12px;
  --mc-text-sm:   14px;
  --mc-text-base: 16px;
  --mc-text-md:   18px;
  --mc-text-lg:   20px;
  --mc-text-xl:   24px;
  --mc-text-2xl:  30px;
  --mc-text-3xl:  36px;
  --mc-text-4xl:  44px;
  --mc-text-5xl:  56px;
  --mc-text-6xl:  72px;

  --mc-leading-tight: 1.15;
  --mc-leading-snug:  1.3;
  --mc-leading-normal: 1.55;
  --mc-leading-relaxed: 1.7;

  --mc-tracking-tight: -0.02em;
  --mc-tracking-normal: 0;
  --mc-tracking-wide: 0.04em;
  --mc-tracking-caps: 0.12em;

  /* ===== Spacing — 4px base ===== */
  --mc-space-0:  0;
  --mc-space-1:  4px;
  --mc-space-2:  8px;
  --mc-space-3:  12px;
  --mc-space-4:  16px;
  --mc-space-5:  20px;
  --mc-space-6:  24px;
  --mc-space-8:  32px;
  --mc-space-10: 40px;
  --mc-space-12: 48px;
  --mc-space-16: 64px;
  --mc-space-20: 80px;
  --mc-space-24: 96px;

  /* ===== Radii ===== */
  --mc-radius-sm: 4px;
  --mc-radius-md: 8px;
  --mc-radius-lg: 12px;
  --mc-radius-xl: 16px;
  --mc-radius-2xl: 24px;
  --mc-radius-pill: 999px;

  /* ===== Shadows — cool tinted, never neutral black ===== */
  --mc-shadow-xs: 0 1px 2px rgba(6, 43, 61, 0.06);
  --mc-shadow-sm: 0 2px 4px rgba(6, 43, 61, 0.06), 0 1px 2px rgba(6, 43, 61, 0.04);
  --mc-shadow-md: 0 6px 16px -4px rgba(6, 43, 61, 0.10), 0 2px 4px rgba(6, 43, 61, 0.05);
  --mc-shadow-lg: 0 16px 32px -8px rgba(6, 43, 61, 0.14), 0 4px 8px rgba(6, 43, 61, 0.06);
  --mc-shadow-xl: 0 28px 56px -12px rgba(6, 43, 61, 0.20), 0 8px 16px rgba(6, 43, 61, 0.08);
  --mc-shadow-inset: inset 0 1px 2px rgba(6, 43, 61, 0.06);
  --mc-ring-focus: 0 0 0 3px rgba(15, 93, 130, 0.25);

  /* ===== Motion ===== */
  --mc-ease-standard: cubic-bezier(0.2, 0.0, 0.0, 1.0);
  --mc-ease-emphasized: cubic-bezier(0.2, 0.0, 0.0, 1.2);
  --mc-ease-decel: cubic-bezier(0.0, 0.0, 0.2, 1.0);
  --mc-dur-fast: 120ms;
  --mc-dur-base: 200ms;
  --mc-dur-slow: 320ms;

  color-scheme: light;
}

/* ===== Dark theme ===== */
[data-theme="dark"], .mc-dark {
  --mc-bg:        #0A1A24;
  --mc-bg-subtle: #0E2230;
  --mc-bg-muted:  #122A3A;
  --mc-surface:   #102836;
  --mc-surface-raised: #163245;
  --mc-overlay:   rgba(0, 0, 0, 0.65);

  --mc-fg-1: #EAF1F6;
  --mc-fg-2: #C5D2DB;
  --mc-fg-3: #8FA3B0;
  --mc-fg-4: #6B7E8B;
  --mc-fg-on-brand: #FFFFFF;

  --mc-border-1: #1E3849;
  --mc-border-2: #294B60;
  --mc-border-strong: var(--mc-creek-400);

  --mc-accent: #4FA3CC;          /* lifted for dark contrast */
  --mc-accent-hover: #6BB8DC;
  --mc-accent-pressed: #2F87B0;
  --mc-accent-soft: rgba(79, 163, 204, 0.15);

  --mc-success-bg: rgba(47, 125, 91, 0.18);
  --mc-warning-bg: rgba(184, 121, 31, 0.18);
  --mc-danger-bg:  rgba(178, 58, 58, 0.18);
  --mc-info-bg:    rgba(79, 163, 204, 0.15);

  --mc-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --mc-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --mc-shadow-md: 0 6px 16px -4px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.25);
  --mc-shadow-lg: 0 16px 32px -8px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
  --mc-shadow-xl: 0 28px 56px -12px rgba(0, 0, 0, 0.6), 0 8px 16px rgba(0, 0, 0, 0.35);
  --mc-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  --mc-ring-focus: 0 0 0 3px rgba(79, 163, 204, 0.35);

  color-scheme: dark;
}

/* =============================================================
   Semantic typographic styles — apply to plain HTML, no class needed
   ============================================================= */
.mc-root, .mc-root * { box-sizing: border-box; }

.mc-root {
  font-family: var(--mc-font-sans);
  font-size: var(--mc-text-base);
  line-height: var(--mc-leading-normal);
  color: var(--mc-fg-2);
  background: var(--mc-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.mc-display {
  font-family: var(--mc-font-display);
  font-weight: 700;
  font-size: var(--mc-text-6xl);
  line-height: var(--mc-leading-tight);
  letter-spacing: -0.03em;
  color: var(--mc-fg-1);
}

.mc-h1 {
  font-family: var(--mc-font-display);
  font-weight: 700;
  font-size: var(--mc-text-4xl);
  line-height: var(--mc-leading-tight);
  letter-spacing: -0.025em;
  color: var(--mc-fg-1);
  text-wrap: balance;
}

.mc-h2 {
  font-family: var(--mc-font-display);
  font-weight: 600;
  font-size: var(--mc-text-3xl);
  line-height: var(--mc-leading-snug);
  letter-spacing: -0.02em;
  color: var(--mc-fg-1);
}

.mc-h3 {
  font-family: var(--mc-font-sans);
  font-weight: 600;
  font-size: var(--mc-text-2xl);
  line-height: var(--mc-leading-snug);
  letter-spacing: -0.01em;
  color: var(--mc-fg-1);
}

.mc-h4 {
  font-family: var(--mc-font-sans);
  font-weight: 600;
  font-size: var(--mc-text-xl);
  line-height: var(--mc-leading-snug);
  color: var(--mc-fg-1);
}

.mc-h5 {
  font-family: var(--mc-font-sans);
  font-weight: 600;
  font-size: var(--mc-text-md);
  line-height: var(--mc-leading-snug);
  color: var(--mc-fg-1);
}

.mc-eyebrow {
  font-family: var(--mc-font-sans);
  font-weight: 600;
  font-size: var(--mc-text-xs);
  text-transform: uppercase;
  letter-spacing: var(--mc-tracking-caps);
  color: var(--mc-creek-700);
}

.mc-p, .mc-body {
  font-family: var(--mc-font-sans);
  font-weight: 400;
  font-size: var(--mc-text-base);
  line-height: var(--mc-leading-normal);
  color: var(--mc-fg-2);
  text-wrap: pretty;
}

.mc-lead {
  font-family: var(--mc-font-sans);
  font-weight: 400;
  font-size: var(--mc-text-xl);
  line-height: var(--mc-leading-relaxed);
  color: var(--mc-fg-2);
  text-wrap: pretty;
}

.mc-small, .mc-meta {
  font-family: var(--mc-font-sans);
  font-size: var(--mc-text-sm);
  color: var(--mc-fg-3);
  line-height: var(--mc-leading-normal);
}

.mc-micro {
  font-family: var(--mc-font-sans);
  font-size: var(--mc-text-xs);
  color: var(--mc-fg-3);
  line-height: var(--mc-leading-snug);
}

.mc-code, code, kbd, samp {
  font-family: var(--mc-font-mono);
  font-size: 0.92em;
  background: var(--mc-bg-muted);
  color: var(--mc-fg-1);
  padding: 0.15em 0.4em;
  border-radius: var(--mc-radius-sm);
  border: 1px solid var(--mc-border-1);
}

.mc-quote {
  font-family: var(--mc-font-sans);
  font-style: italic;
  font-weight: 500;
  font-size: var(--mc-text-xl);
  line-height: var(--mc-leading-relaxed);
  color: var(--mc-fg-1);
  border-left: 2px solid var(--mc-creek-700);
  padding-left: var(--mc-space-5);
}

a.mc-link, .mc-link {
  color: var(--mc-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--mc-dur-fast) var(--mc-ease-standard);
}
a.mc-link:hover, .mc-link:hover { color: var(--mc-accent-hover); }
