/* Orpheus design tokens. Source of truth: design/DESIGN.md.
   Dark is the home theme (the cockpit grew up dark). Light is a full second theme.
   Theme resolution: system by default; <html data-theme="dark|light"> overrides either way. */

:root {
  color-scheme: dark;

  /* surfaces, warm neutrals biased toward the accent hue */
  --bg: #1a1917;        /* page ground */
  --panel: #211f1d;     /* sidebar, cards, panes */
  --panel2: #262523;    /* raised: pane heads, inputs, hover rows */
  --panel3: #2d2b28;    /* pressed, selected, code blocks */
  --line: #35322f;      /* hairlines */
  --line2: #423e3a;     /* control borders */

  /* text */
  --ink: #eceae7;       /* primary text, 13.6:1 on --bg */
  --mut: #a49f98;       /* secondary text, 6.6:1 */
  --dim: #938d86;       /* labels and meta, 5.2:1 (never below this for text) */

  /* accent: the one orange. Not a status color. */
  --accent: #d97757;
  --accent2: #e08a6d;   /* hover, links on dark */
  --accent-ink: #e08a6d;/* accent used as text */
  --on-accent: #191817; /* text on an accent fill */
  --accent-soft: rgba(217, 119, 87, .14);
  --accent-line: rgba(217, 119, 87, .45);

  /* status: separate from the accent */
  --good: #7fb682;  --good-soft: rgba(127, 182, 130, .13);  --good-line: rgba(127, 182, 130, .40);
  --warn: #d9a441;  --warn-soft: rgba(217, 164, 65, .13);   --warn-line: rgba(217, 164, 65, .45);
  --bad:  #e5736b;  --bad-soft:  rgba(229, 115, 107, .13);  --bad-line:  rgba(229, 115, 107, .45);
  --info: #8ab4f0;  --info-soft: rgba(138, 180, 240, .13);  --info-line: rgba(138, 180, 240, .32);

  /* terminal panes keep their own ground in both themes */
  --term-bg: #161514;
  --term-ink: #e6e3df;
  --term-dim: #8f8982;

  --scrim: rgba(0, 0, 0, .62);
  --shadow-pop: 0 14px 40px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  --glow-good: 0 0 6px var(--good);

  /* type */
  --mono: ui-monospace, 'SF Mono', 'Menlo', 'Cascadia Code', 'Roboto Mono', monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-micro: 10.5px;  /* mono caps labels, letter-spacing .14em */
  --fs-xs: 12px;       /* meta, badges */
  --fs-sm: 13px;       /* sidebar rows, table cells */
  --fs-base: 15px;     /* body */
  --fs-md: 17px;       /* page titles in the app, lead text */
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-2xl: 32px;
  --fs-read: 19px;     /* Read view on desktop; 17.5px on phones */
  --lh-tight: 1.2;
  --lh-base: 1.5;

  /* space: 4px base */
  --s1: 4px;  --s2: 8px;  --s3: 12px;  --s4: 16px;  --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s24: 96px;

  /* radius */
  --r-xs: 5px;    /* badges, kbd */
  --r-sm: 8px;    /* sidebar rows, segmented controls, small inputs */
  --r-md: 10px;   /* buttons, fields */
  --r-lg: 12px;   /* panes, cards */
  --r-xl: 16px;   /* sheets, dialogs */
  --r-pill: 999px;

  /* sizes */
  --tap: 44px;          /* minimum touch target */
  --side-w: 300px;      /* app sidebar */
  --page-w: 920px;      /* settings-type pages */

  /* layers */
  --z-side: 40; --z-pop: 60; --z-scrim: 70; --z-sheet: 80; --z-toast: 90;

  /* motion */
  --t-fast: 80ms; --t: 160ms; --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Light values. Same token names; components never branch on theme. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f5f3f0; --panel: #fbfaf8; --panel2: #efece8; --panel3: #e6e2dd;
    --line: #dcd7d0; --line2: #c6c0b8;
    --ink: #1f1d1a; --mut: #5c5750; --dim: #746e66;
    --accent: #c2552f; --accent2: #a8431f; --accent-ink: #a8431f; --on-accent: #ffffff;
    --accent-soft: rgba(194, 85, 47, .10); --accent-line: rgba(194, 85, 47, .42);
    --good: #3b7a42; --good-soft: rgba(59, 122, 66, .10); --good-line: rgba(59, 122, 66, .38);
    --warn: #8f6410; --warn-soft: rgba(176, 124, 20, .12); --warn-line: rgba(176, 124, 20, .45);
    --bad: #b8382f;  --bad-soft: rgba(184, 56, 47, .09);  --bad-line: rgba(184, 56, 47, .40);
    --info: #2c66b3; --info-soft: rgba(44, 102, 179, .09); --info-line: rgba(44, 102, 179, .32);
    --scrim: rgba(31, 29, 26, .42);
    --shadow-pop: 0 14px 40px rgba(31, 29, 26, .16), 0 2px 6px rgba(31, 29, 26, .10);
    --glow-good: none;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f3f0; --panel: #fbfaf8; --panel2: #efece8; --panel3: #e6e2dd;
  --line: #dcd7d0; --line2: #c6c0b8;
  --ink: #1f1d1a; --mut: #5c5750; --dim: #746e66;
  --accent: #c2552f; --accent2: #a8431f; --accent-ink: #a8431f; --on-accent: #ffffff;
  --accent-soft: rgba(194, 85, 47, .10); --accent-line: rgba(194, 85, 47, .42);
  --good: #3b7a42; --good-soft: rgba(59, 122, 66, .10); --good-line: rgba(59, 122, 66, .38);
  --warn: #8f6410; --warn-soft: rgba(176, 124, 20, .12); --warn-line: rgba(176, 124, 20, .45);
  --bad: #b8382f;  --bad-soft: rgba(184, 56, 47, .09);  --bad-line: rgba(184, 56, 47, .40);
  --info: #2c66b3; --info-soft: rgba(44, 102, 179, .09); --info-line: rgba(44, 102, 179, .32);
  --scrim: rgba(31, 29, 26, .42);
  --shadow-pop: 0 14px 40px rgba(31, 29, 26, .16), 0 2px 6px rgba(31, 29, 26, .10);
  --glow-good: none;
}

@media (max-width: 699px) {
  :root { --fs-read: 17.5px; }
}
