/* ==========================================================================
   tokens.css — Kai-Signals design system: all CSS custom properties
   Source of truth: docs/07-design-system.md
   ========================================================================== */

/* ── Self-hosted fonts ─────────────────────────────────────────────────────
   GDPR compliance: fonts served from /fonts/ — no Google CDN requests.
   WOFF2 files must be placed in wwwroot/fonts/ before deploy.
   ─────────────────────────────────────────────────────────────────────────*/
@font-face {
  font-family: 'Sora';
  src: url('/fonts/Sora-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Sora';
  src: url('/fonts/Sora-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Sora';
  src: url('/fonts/Sora-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── Colour — brand ──────────────────────────────────────────────────── */
  --color-brand-teal:        #37ABA8;
  --color-brand-teal-strong: #2D8B89;
  --color-brand-teal-muted:  #E0F2F1; /* light-mode subtle bg */
  --color-brand-teal-dim:    #1B3A40; /* dark-mode subtle bg  */

  /* ── Colour — navy ───────────────────────────────────────────────────── */
  --color-navy-base:     #0B1426;
  --color-navy-surface:  #142336;
  --color-navy-elevated: #1B2D45;
  --color-navy-accent:   #1B3A5F;
  --color-navy-soft:     #2A3F5A;

  /* ── Colour — semantic (never used for buy/sell direction) ───────────── */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger:  #EF4444;
  --color-info:    #3B82F6;

  /* ── Colour — semantic dark variants ────────────────────────────────── */
  --color-success-dark: #34D399;
  --color-warning-dark: #FBBF24;
  --color-danger-dark:  #F87171;
  --color-info-dark:    #60A5FA;

  /* ── Gradient — brand signature (hero areas + favicon only) ─────────── */
  --gradient-brand-radial: radial-gradient(circle at top-left, #1B3A5F 0%, #37ABA8 100%);
  --gradient-brand-linear: linear-gradient(135deg, #1B3A5F 0%, #2D8B89 100%);

  /* ── Typography — font families ─────────────────────────────────────── */
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  /* ── Typography — scale (size / line-height) ────────────────────────── */
  --text-display-xl-size:   64px;
  --text-display-xl-line:   72px;
  --text-display-xl-weight: 700;

  --text-display-lg-size:   48px;
  --text-display-lg-line:   56px;
  --text-display-lg-weight: 700;

  --text-display-md-size:   36px;
  --text-display-md-line:   44px;
  --text-display-md-weight: 700;

  --text-display-sm-size:   28px;
  --text-display-sm-line:   36px;
  --text-display-sm-weight: 600;

  --text-heading-lg-size:   22px;
  --text-heading-lg-line:   30px;
  --text-heading-lg-weight: 600;

  --text-heading-md-size:   18px;
  --text-heading-md-line:   26px;
  --text-heading-md-weight: 600;

  --text-body-lg-size:   17px;
  --text-body-lg-line:   26px;
  --text-body-lg-weight: 400;

  --text-body-md-size:   15px;
  --text-body-md-line:   24px;
  --text-body-md-weight: 400;

  --text-body-sm-size:   13px;
  --text-body-sm-line:   20px;
  --text-body-sm-weight: 400;

  --text-label-size:   13px;
  --text-label-line:   18px;
  --text-label-weight: 500;

  --text-mono-md-size:   15px;
  --text-mono-md-line:   24px;
  --text-mono-md-weight: 500;

  --text-mono-sm-size:   13px;
  --text-mono-sm-line:   20px;
  --text-mono-sm-weight: 500;

  /* ── Spacing — 4px base 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;

  /* ── Layout ─────────────────────────────────────────────────────────── */
  --container-max:      1200px;
  --container-narrow:    720px;
  --container-wide:     1400px;
  --grid-columns:       12;
  --grid-gutter-desktop: 24px;
  --grid-gutter-tablet:  16px;
  --grid-gutter-mobile:  12px;
  --side-padding-desktop: 24px;
  --side-padding-mobile:  16px;

  /* ── Breakpoints (reference — use in @media queries) ────────────────── */
  --breakpoint-sm:  480px;
  --breakpoint-md:  640px;
  --breakpoint-lg:  1024px;
  --breakpoint-xl:  1280px;
  --breakpoint-2xl: 1536px;

  /* ── Border radius ───────────────────────────────────────────────────── */
  --radius-sm:     4px;
  --radius-btn:    8px;
  --radius-input:  8px;
  --radius-card:   12px;
  --radius-modal:  16px;
  --radius-avatar: 9999px;

  /* ── Shadow scale ────────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.08);

  /* ── Status chip semantic colours (light) ────────────────────────────── */
  --chip-warning-bg:   #FFF7ED;  --chip-warning-fg:   #C2410C;
  --chip-danger-bg:    #FEF2F2;  --chip-danger-fg:    #B91C1C;
  --chip-suspended-bg: #FEFCE8;  --chip-suspended-fg: #854D0E;
  --chip-pending-bg:   #EFF6FF;  --chip-pending-fg:   #1D4ED8;

  /* ── Motion ──────────────────────────────────────────────────────────── */
  --duration-fast:    150ms;
  --duration-default: 250ms;
  --duration-slow:    400ms;
  --easing-default:   cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Status chip semantic colours (dark overrides) ─────────────────────── */
[data-theme="dark"] {
  --chip-warning-bg:   #431407;  --chip-warning-fg:   #FB923C;
  --chip-danger-bg:    #450A0A;  --chip-danger-fg:    #F87171;
  --chip-suspended-bg: #422006;  --chip-suspended-fg: #FDE047;
  --chip-pending-bg:   #1E3A5F;  --chip-pending-fg:   #93C5FD;
}

/* ── Utility typography classes ─────────────────────────────────────────── */
.text-display-xl { font-family: var(--font-display); font-size: var(--text-display-xl-size); line-height: var(--text-display-xl-line); font-weight: var(--text-display-xl-weight); }
.text-display-lg { font-family: var(--font-display); font-size: var(--text-display-lg-size); line-height: var(--text-display-lg-line); font-weight: var(--text-display-lg-weight); }
.text-display-md { font-family: var(--font-display); font-size: var(--text-display-md-size); line-height: var(--text-display-md-line); font-weight: var(--text-display-md-weight); }
.text-display-sm { font-family: var(--font-display); font-size: var(--text-display-sm-size); line-height: var(--text-display-sm-line); font-weight: var(--text-display-sm-weight); }
.text-heading-lg { font-family: var(--font-body);    font-size: var(--text-heading-lg-size); line-height: var(--text-heading-lg-line); font-weight: var(--text-heading-lg-weight); }
.text-heading-md { font-family: var(--font-body);    font-size: var(--text-heading-md-size); line-height: var(--text-heading-md-line); font-weight: var(--text-heading-md-weight); }
.text-body-lg    { font-family: var(--font-body);    font-size: var(--text-body-lg-size);    line-height: var(--text-body-lg-line);    font-weight: var(--text-body-lg-weight); }
.text-body-md    { font-family: var(--font-body);    font-size: var(--text-body-md-size);    line-height: var(--text-body-md-line);    font-weight: var(--text-body-md-weight); }
.text-body-sm    { font-family: var(--font-body);    font-size: var(--text-body-sm-size);    line-height: var(--text-body-sm-line);    font-weight: var(--text-body-sm-weight); }
.text-label      { font-family: var(--font-body);    font-size: var(--text-label-size);      line-height: var(--text-label-line);      font-weight: var(--text-label-weight); }
.text-mono-md    { font-family: var(--font-mono);    font-size: var(--text-mono-md-size);    line-height: var(--text-mono-md-line);    font-weight: var(--text-mono-md-weight); }
.text-mono-sm    { font-family: var(--font-mono);    font-size: var(--text-mono-sm-size);    line-height: var(--text-mono-sm-line);    font-weight: var(--text-mono-sm-weight); }

/* ── Container helpers ───────────────────────────────────────────────────── */
.container-kai        { max-width: var(--container-max);    width: 100%; margin-inline: auto; padding-inline: var(--side-padding-desktop); }
.container-kai-narrow { max-width: var(--container-narrow); width: 100%; margin-inline: auto; padding-inline: var(--side-padding-desktop); }
.container-kai-wide   { max-width: var(--container-wide);   width: 100%; margin-inline: auto; padding-inline: var(--side-padding-desktop); }

@media (max-width: 1023px) {
  .container-kai, .container-kai-narrow, .container-kai-wide {
    padding-inline: var(--side-padding-mobile);
  }
}
