/**
 * TMIarticles — design tokens (v2 editorial)
 */
:root,
[data-tmi-scheme="light"] {
  --tmi-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tmi-font-display: "Inter", var(--tmi-font-sans);
  --tmi-font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;

  --tmi-bg: #f6f7f9;
  --tmi-bg-elevated: #ffffff;
  --tmi-bg-muted: #eef0f4;
  --tmi-bg-subtle: rgba(255, 255, 255, 0.72);
  --tmi-text: #0f172a;
  --tmi-text-muted: #64748b;
  --tmi-text-subtle: #94a3b8;
  --tmi-text-inverse: #ffffff;
  --tmi-border: #e2e8f0;
  --tmi-border-strong: #cbd5e1;

  --tmi-accent: #4f46e5;
  --tmi-accent-hover: #4338ca;
  --tmi-accent-soft: rgba(79, 70, 229, 0.1);
  --tmi-accent-contrast: #ffffff;

  --tmi-success: #059669;
  --tmi-danger: #dc2626;
  --tmi-warning: #d97706;

  --tmi-radius-xs: 4px;
  --tmi-radius-sm: 8px;
  --tmi-radius: 12px;
  --tmi-radius-lg: 16px;
  --tmi-radius-xl: 24px;
  --tmi-radius-pill: 999px;

  --tmi-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --tmi-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --tmi-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --tmi-shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);

  --tmi-space-xs: 0.25rem;
  --tmi-space-sm: 0.5rem;
  --tmi-space: 1rem;
  --tmi-space-lg: 1.5rem;
  --tmi-space-xl: 2rem;
  --tmi-space-2xl: 3rem;

  --tmi-header-h: 4rem;
  --tmi-nav-h: 2.75rem;
  --tmi-sidebar-w: min(340px, 30vw);
  --tmi-container-pad: clamp(1rem, 2.5vw, 2rem);
  --tmi-content-max: none;
  --tmi-prose-width: 72ch;

  --tmi-z-header: 200;
  --tmi-z-drawer: 190;
  --tmi-z-overlay: 1000;
  --tmi-z-toast: 1100;

  --tmi-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --tmi-duration: 180ms;
  --tmi-duration-slow: 280ms;

  --tmi-focus: 0 0 0 3px var(--tmi-accent-soft);
  --tmi-header-blur: saturate(180%) blur(12px);
}

[data-tmi-scheme="dark"] {
  --tmi-bg: #0b0f17;
  --tmi-bg-elevated: #121826;
  --tmi-bg-muted: #1a2233;
  --tmi-bg-subtle: rgba(18, 24, 38, 0.82);
  --tmi-text: #f1f5f9;
  --tmi-text-muted: #94a3b8;
  --tmi-text-subtle: #64748b;
  --tmi-border: #243044;
  --tmi-border-strong: #334155;
  --tmi-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --tmi-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --tmi-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --tmi-shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
}

[data-tmi-preset="green"] {
  --tmi-accent: #059669;
  --tmi-accent-hover: #047857;
  --tmi-accent-soft: rgba(5, 150, 105, 0.14);
}

[data-tmi-preset="red"] {
  --tmi-accent: #e11d48;
  --tmi-accent-hover: #be123c;
  --tmi-accent-soft: rgba(225, 29, 72, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --tmi-duration: 0ms;
    --tmi-duration-slow: 0ms;
  }
}
