/* Chloe design tokens (0.8 ORBIT). Every colour, size and motion value the app uses.
   Source: docs/design/v0.8-orbit/ (blueprint section 03 + the approved mockups).
   Brand: Void #070B1B, Midnight panel #10172B, Raised glass #17213B, Ice #F4F6FC, Paper #FFFFFF,
   Orbit violet #875BFF, Photon blue #268CFF, Ion cyan #54E5F2, Lavender #C4B6FF,
   Success #25B981, Attention #F2B84B, Critical #F16B7A.
   Theme: follows the system; <html data-theme="light|dark"> overrides it (Settings > Appearance).
   Contrast (WCAG AA, checked by test/tokens.test.mjs): body and muted text 4.5:1 or more on
   bg / surface / surface-2, white on the primary gradient stops 4.5:1 or more, focus 3:1. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/ds/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/ds/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;

  /* Brand constants (same in both themes). */
  --void: #070b1b;
  --midnight: #10172b;
  --glass: #17213b;
  --ice: #f4f6fc;
  --paper: #ffffff;
  --violet: #875bff;
  --photon: #268cff;
  --ion: #54e5f2;
  --lavender: #c4b6ff;
  /* Primary action: violet to photon. Every stop keeps white text at 4.5:1 or more. */
  --grad-primary: linear-gradient(95deg, #7a4df0 0%, #5b4bf0 45%, #2b6be6 100%);
  --grad-primary-hover: linear-gradient(95deg, #6c40e0 0%, #4f40e0 45%, #225fd6 100%);

  /* Type: Inter, tabular numbers; scale 12 / 13 / 15 / 16 / 18 / 20 / 26 / 28. Weights 400 / 500 / 600. */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --fs-2xs: 0.75rem; /* 12, metadata */
  --fs-xs: 0.8125rem; /* 13, metadata */
  --fs-sm: 0.9375rem; /* 15 */
  --fs-md: 1rem; /* 16, body */
  --fs-lg: 1.125rem; /* 18, section title */
  --fs-xl: 1.25rem; /* 20 */
  --fs-2xl: 1.625rem; /* 26, page title */
  --fs-3xl: 1.75rem; /* 28, hero */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 600;
  --lh-tight: 1.25;
  --lh: 1.5;

  /* Spacing: 8 px rhythm (4 for fine steps). Gutters 20 px on phones. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --gutter: 20px;

  /* Shape: cards 20, inputs and buttons 14, sheets 24. */
  --r-input: 14px;
  --r-card: 20px;
  --r-sheet: 24px;
  --r-pill: 999px;
  --tap: 44px; /* never below */
  --tap-lg: 48px; /* primary targets */
  --rail-w: 232px;
  --sidebar-w: var(--rail-w);
  --bar-h: 72px;
  --content-max: 760px;

  /* Motion: 150-250 ms ease-out; none with reduced motion (below). */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 150ms;
  --t: 200ms;
  --t-slow: 250ms;

  /* Safe areas (phones with notches). */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Light theme (default): Ice background, Paper surfaces. */
  --bg: #f4f6fc;
  --surface: #ffffff;
  --surface-2: #eceff8; /* inputs, quiet buttons, skeletons */
  --surface-3: #dfe3f0;
  --text: #0e1330;
  --text-muted: #4f5675;
  --border: #dde1ee;
  --border-strong: #b4bad0;
  --accent: #6a3fe8;
  --accent-hover: #5a31d6;
  --accent-text: #5b33d6; /* violet used as text on light surfaces */
  --on-accent: #ffffff;
  --accent-soft: #ece6ff;
  --focus: #1f6fe0;
  --success: #12704a;
  --success-soft: #dcf3e9;
  --warning: #8a5100;
  --warning-soft: #fcefd6;
  --danger: #c0283e;
  --danger-hover: #a51f33;
  --danger-soft: #fde4e7;
  --on-danger: #ffffff;
  --danger-fill: #c0283e; /* filled destructive button, white text */
  --info: #1d5fc4;
  --info-soft: #e1edff;
  --scrim: rgba(7, 11, 27, 0.45);
  --shadow: 0 1px 2px rgba(14, 19, 48, 0.05), 0 6px 20px rgba(14, 19, 48, 0.06);
  --card-border: #e4e7f2;
  --bubble-me: #ece6ff;
  --bubble-them: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.94);
  --hero-glow: rgba(135, 91, 255, 0.16);
  --sim-border: #6b7290;
}

/* Dark theme (ORBIT): Void background, Midnight panels, Raised glass for selected cards and sheets. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b1b;
    --surface: #10172b;
    --surface-2: #17213b;
    --surface-3: #222d4d;
    --text: #f3f5ff;
    --text-muted: #9aa3c4;
    --border: #1d2747;
    --border-strong: #2e3a66;
    --accent: #7a4df0;
    --accent-hover: #8b62ff;
    --accent-text: #c4b6ff;
    --on-accent: #ffffff;
    --accent-soft: rgba(135, 91, 255, 0.16);
    --focus: #54a2ff;
    --success: #4fd6a3;
    --success-soft: rgba(37, 185, 129, 0.15);
    --warning: #f2b84b;
    --warning-soft: rgba(242, 184, 75, 0.14);
    --danger: #f48a96;
    --danger-hover: #f7a3ad;
    --danger-soft: rgba(241, 107, 122, 0.14);
    --on-danger: #ffffff;
    --danger-fill: #d63c50;
    --info: #7dbbff;
    --info-soft: rgba(59, 156, 255, 0.16);
    --scrim: rgba(3, 5, 14, 0.6);
    --shadow: none;
    --card-border: #1d2747;
    --bubble-me: rgba(135, 91, 255, 0.2);
    --bubble-them: #17213b;
    --nav-bg: rgba(10, 14, 32, 0.94);
    --hero-glow: rgba(58, 39, 168, 0.75);
    --sim-border: #6e78a0;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b1b;
  --surface: #10172b;
  --surface-2: #17213b;
  --surface-3: #222d4d;
  --text: #f3f5ff;
  --text-muted: #9aa3c4;
  --border: #1d2747;
  --border-strong: #2e3a66;
  --accent: #7a4df0;
  --accent-hover: #8b62ff;
  --accent-text: #c4b6ff;
  --on-accent: #ffffff;
  --accent-soft: rgba(135, 91, 255, 0.16);
  --focus: #54a2ff;
  --success: #4fd6a3;
  --success-soft: rgba(37, 185, 129, 0.15);
  --warning: #f2b84b;
  --warning-soft: rgba(242, 184, 75, 0.14);
  --danger: #f48a96;
  --danger-hover: #f7a3ad;
  --danger-soft: rgba(241, 107, 122, 0.14);
  --on-danger: #ffffff;
  --danger-fill: #d63c50;
  --info: #7dbbff;
  --info-soft: rgba(59, 156, 255, 0.16);
  --scrim: rgba(3, 5, 14, 0.6);
  --shadow: none;
  --card-border: #1d2747;
  --bubble-me: rgba(135, 91, 255, 0.2);
  --bubble-them: #17213b;
  --nav-bg: rgba(10, 14, 32, 0.94);
  --hero-glow: rgba(58, 39, 168, 0.75);
  --sim-border: #6e78a0;
}
:root[data-theme="light"] {
  color-scheme: light;
}

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