/*
 * Sauri design tokens for the landing. Same names and values as frontend/src/design/tokens.css (the
 * DESIGN.md contract), but written as plain values for the light theme plus a prefers-color-scheme
 * block for the dark one. The portal uses light-dark(); a public page cannot, because browsers older
 * than Safari 17.5 / Chrome 123 drop every light-dark() declaration and the page would lose its colors.
 * If the portal palette changes, update both blocks here.
 */
:root {
  color-scheme: light dark;
  /* Surfaces */
  --ds-bg: #faf9fe;
  --ds-surface: #ffffff;
  --ds-surface-raised: #ffffff;
  --ds-sidebar: #f3f0fb;
  --ds-fill: #efebfa;
  --ds-fill-hover: #e6e0f7;
  --ds-fill-strong: #dcd4f2;

  /* Text and lines */
  --ds-fg: #161223;
  --ds-fg-muted: #4a4466;
  --ds-fg-subtle: #5e5880;
  --ds-border: #ddd7ee;
  --ds-border-strong: #7468a8;

  /* Primary action and accent (lavender); spark is volt, only over nav-bg and dark surfaces */
  --ds-accent: #5b4bae;
  --ds-accent-hover: #4b3c99;
  --ds-accent-fg: #ffffff;
  --ds-accent-text: #4b3c99;
  --ds-accent-soft: #efebfb;
  --ds-accent-soft-fg: #3f3480;
  --ds-accent-muted: #9a8ce0;
  --ds-accent-line: #5b4bae;
  --ds-focus: #5b4bae;
  --ds-spark: #c6ff24;
  --ds-on-spark: #161223;

  /* Navigation panel: indigo in both themes */
  --ds-nav-bg: #161223;
  --ds-nav-fg: #b9b2d6;
  --ds-nav-fg-strong: #ffffff;
  --ds-nav-active-bg: #2a2342;

  /* Status */
  --ds-warning: #705c30;
  --ds-warning-soft: #f4e7c7;
  --ds-warning-soft-fg: #4d3f1c;
  --ds-danger: #b83230;
  --ds-danger-hover: #9d2a28;
  --ds-danger-fg: #ffffff;
  --ds-danger-text: #b83230;
  --ds-danger-soft: #fce8e6;
  --ds-danger-soft-fg: #690005;
  --ds-recording: #b83230;
  --ds-highlight: #eae4fb;
  --ds-success: #3b6a49;
  --ds-success-soft: #c8e8d0;
  --ds-success-soft-fg: #1f4a2d;

  /* Speakers: fills and text colors share one value per theme */
  --ds-on-speaker: #ffffff;
  --ds-speaker-1: #4a7c59;
  --ds-speaker-2: #9a5b2e;
  --ds-speaker-3: #3f6a8a;
  --ds-speaker-4: #7a4f7f;
  --ds-speaker-5: #8a6d1f;
  --ds-speaker-6: #2f7a74;
  --ds-speaker-unresolved: #74796e;

  /* Scrims and elevation: only controls, menus and dialogs lift off the page */
  --ds-scrim: rgb(46 50 48 / 0.45);
  --ds-scrim-strong: rgb(32 36 33 / 0.78);
  --ds-on-scrim: #ffffff;
  --ds-shadow-sm: 0 1px 2px rgb(46 50 48 / 0.12);
  --ds-shadow-md: 0 1px 3px rgb(46 50 48 / 0.12), 0 8px 24px rgb(46 50 48 / 0.12);

  /* Typography */
  --ds-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ds-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ds-text-2xs: 11px;
  --ds-text-xs: 12px;
  --ds-text-sm: 13px;
  --ds-text-md: 14px;
  --ds-text-base: 14px;
  --ds-text-lg: 15px;
  --ds-text-xl: 16px;
  --ds-text-2xl: 20px;
  --ds-leading: 1.45;
  --ds-leading-relaxed: 1.55;
  --ds-weight-regular: 400;
  --ds-weight-medium: 500;
  --ds-weight-semibold: 600;

  /* Spacing, geometry and sizing */
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-6: 24px;
  --ds-space-8: 32px;
  --ds-radius-xs: 4px;
  --ds-radius-thumb: 6px;
  --ds-radius-sm: 8px;
  --ds-radius-card: 10px;
  --ds-radius-md: 12px;
  --ds-radius-lg: 16px;
  --ds-radius-xl: 20px;
  --ds-radius-pill: 9999px;
  --ds-control-h-sm: 28px;
  --ds-control-h-md: 32px;
  --ds-control-h-lg: 36px;
  --ds-icon-button-sm: 30px;
  --ds-icon-button-md: 32px;
  --ds-target: 32px;
  --ds-icon-xs: 12px;
  --ds-icon-sm: 14px;
  --ds-icon-md: 16px;
  --ds-icon-lg: 18px;

  /* Focus and motion */
  --ds-focus-width: 2px;
  --ds-focus-offset: 2px;
  --ds-duration: 150ms;
  --ds-ease: cubic-bezier(0.2, 0, 0, 1);

  /* Layout: desktop application panes (DESIGN.md 5 and 6) */
  --ds-header-h: 48px;
  --ds-sidebar-w: 220px;
  --ds-rail-w: 60px;
  --ds-nav-row-h: 32px;
  --ds-list-w: 340px;
  --ds-side-w: 380px;
  --ds-z-sticky: 10;
  --ds-z-menu: 20;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ds-bg: #161223;
    --ds-surface: #1f1a33;
    --ds-surface-raised: #2a2342;
    --ds-sidebar: #1b162b;
    --ds-fill: #262040;
    --ds-fill-hover: #30294f;
    --ds-fill-strong: #3a325c;
    --ds-fg: #eeeaf8;
    --ds-fg-muted: #b9b2d6;
    --ds-fg-subtle: #a9a1cc;
    --ds-border: #3a3158;
    --ds-border-strong: #8a7fc0;
    --ds-accent: #6a5acd;
    --ds-accent-hover: #5b4bae;
    --ds-accent-text: #b3a8f2;
    --ds-accent-soft: #2a2342;
    --ds-accent-soft-fg: #dcd6f7;
    --ds-accent-muted: #6a5acd;
    --ds-accent-line: #9a8ce0;
    --ds-focus: #c6ff24;
    --ds-nav-bg: #100d1c;
    --ds-nav-active-bg: #1f1a33;
    --ds-warning: #d9bd7a;
    --ds-warning-soft: #3a3220;
    --ds-warning-soft-fg: #f0e0b4;
    --ds-danger: #c9433f;
    --ds-danger-hover: #b23a37;
    --ds-danger-text: #ff9d97;
    --ds-danger-soft: #43211f;
    --ds-danger-soft-fg: #ffc9c4;
    --ds-recording: #f2736d;
    --ds-highlight: #3a2f6b;
    --ds-success: #8fc29d;
    --ds-success-soft: #243d2c;
    --ds-success-soft-fg: #bfe6cb;
    --ds-on-speaker: #10201a;
    --ds-speaker-1: #7fb58f;
    --ds-speaker-2: #d4955f;
    --ds-speaker-3: #7fb0d4;
    --ds-speaker-4: #c395c8;
    --ds-speaker-5: #cfae55;
    --ds-speaker-6: #63bdb5;
    --ds-speaker-unresolved: #a3a89b;
    --ds-scrim: rgb(0 0 0 / 0.62);
    --ds-scrim-strong: rgb(0 0 0 / 0.8);
    --ds-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.5);
    --ds-shadow-md: 0 1px 3px rgb(0 0 0 / 0.5), 0 8px 24px rgb(0 0 0 / 0.5);
  }
}

@media (pointer: coarse) {
  :root {
    --ds-target: 44px;
  }
}

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