/* AIST.tech Design System — Foundations
 * Source of truth: DESIGN.md
 * Two surfaces share these tokens:
 *   - Marketing (aist.tech) and ЛК Shell (app.aist.tech) — light theme
 *   - MI Analyst — dark theme (uses --dark-* tokens below)
 */

@import url("https://fonts.googleapis.com/css2?family=Commissioner:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* ── Colors: light theme (marketing + ЛК) ─────────────────── */
  --background: #FAFAFA;
  --foreground: #111111;
  --card: #FFFFFF;
  --card-foreground: #111111;
  --popover: #FFFFFF;
  --popover-foreground: #111111;
  --primary: #0048B2;
  --primary-foreground: #FFFFFF;
  --secondary: #F5F5F7;
  --secondary-foreground: #111111;
  --muted: #F5F5F7;
  --muted-foreground: #595959;
  --accent: #0048B2;
  --accent-foreground: #FFFFFF;
  --destructive: #DC2626;
  --destructive-foreground: #FFFFFF;
  --success: #16A34A;
  --success-foreground: #FFFFFF;
  --warning: #EAB308;
  --border: #E0E0E0;
  --input: #E0E0E0;
  --ring: #0048B2;

  /* ── Colors: dark theme (MI Analyst — zinc ladder) ────────── */
  --dark-bg: #09090B;       /* zinc-950 */
  --dark-surface: #18181B;  /* zinc-900 */
  --dark-card: #27272A;     /* zinc-800 */
  --dark-border: #3F3F46;   /* zinc-700 */
  --dark-foreground: #E4E4E7; /* zinc-200 */
  --dark-muted: #A1A1AA;    /* zinc-400 */

  /* ── Semantic foreground ladder (utility) ─────────────────── */
  --fg-1: #111111;   /* primary text */
  --fg-2: #595959;   /* body / muted text */
  --fg-3: #999999;   /* captions, hints */
  --fg-on-dark-1: #E4E4E7;
  --fg-on-dark-2: #A1A1AA;
  --fg-on-dark-3: #71717A;

  /* ── Type families ────────────────────────────────────────── */
  --font-heading: "Commissioner", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* ── Type scale (semantic) ────────────────────────────────── */
  --h1-family: var(--font-heading);
  --h1-size: 3rem;
  --h1-weight: 800;
  --h1-leading: 1.08;
  --h1-tracking: -0.01em;

  --h2-family: var(--font-heading);
  --h2-size: 1.875rem;
  --h2-weight: 700;
  --h2-leading: 1.15;
  --h2-tracking: -0.005em;

  --h3-family: var(--font-heading);
  --h3-size: 1.125rem;
  --h3-weight: 600;
  --h3-leading: 1.4;

  --body-lg-size: 1.125rem;
  --body-lg-leading: 1.7;
  --body-md-size: 1rem;
  --body-md-leading: 1.6;
  --body-sm-size: 0.875rem;
  --body-sm-leading: 1.55;

  --label-caps-size: 0.75rem;
  --label-caps-weight: 500;
  --label-caps-tracking: 0.125em;
  --label-caps-leading: 1;

  /* ── Radii ────────────────────────────────────────────────── */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --radius: var(--radius-lg);

  /* ── Spacing scale ────────────────────────────────────────── */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-section-y: 80px;

  /* ── Layout ───────────────────────────────────────────────── */
  --container-max: 1152px;
  --sidebar-width: 240px;
  --topbar-height: 56px;

  /* ── Shadows (used only on hover, not at rest) ────────────── */
  --shadow-hover: 0 4px 12px rgba(17, 17, 17, 0.06), 0 1px 2px rgba(17, 17, 17, 0.04);
  --shadow-card: 0 1px 2px rgba(17, 17, 17, 0.04);

  /* ── Motion ───────────────────────────────────────────────── */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;
}

/* ── Element defaults ─────────────────────────────────────── */
html, body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: var(--body-md-size);
  line-height: var(--body-md-leading);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--foreground);
  margin: 0;
}

h1 {
  font-size: var(--h1-size);
  font-weight: var(--h1-weight);
  line-height: var(--h1-leading);
  letter-spacing: var(--h1-tracking);
}

h2 {
  font-size: var(--h2-size);
  font-weight: var(--h2-weight);
  line-height: var(--h2-leading);
  letter-spacing: var(--h2-tracking);
}

h3 {
  font-size: var(--h3-size);
  font-weight: var(--h3-weight);
  line-height: var(--h3-leading);
}

p {
  margin: 0;
  font-size: var(--body-md-size);
  line-height: var(--body-md-leading);
  color: var(--foreground);
}

.body-lg { font-size: var(--body-lg-size); line-height: var(--body-lg-leading); }
.body-md { font-size: var(--body-md-size); line-height: var(--body-md-leading); }
.body-sm { font-size: var(--body-sm-size); line-height: var(--body-sm-leading); color: var(--muted-foreground); }

.label-caps {
  font-family: var(--font-heading);
  font-size: var(--label-caps-size);
  font-weight: var(--label-caps-weight);
  letter-spacing: var(--label-caps-tracking);
  line-height: var(--label-caps-leading);
  text-transform: uppercase;
  color: var(--primary);
}

code, pre, kbd, samp { font-family: var(--font-mono); }

* { box-sizing: border-box; }
