/* Casewire design tokens: the Signal and Newsprint colour schemes, each in a
   light and a dark theme. Generated from the two design systems' tokens.json;
   change values there, not here.

   <html data-scheme="signal|newsprint"> picks the scheme (Signal by default).
   <html data-theme="dark|light"> forces a theme; without it the device's
   setting decides. */

:root {
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --control-sm: 28px;
  --control-md: 36px;
  --control-lg: 44px;
  --icon-sm: 16px;
  --icon-md: 20px;
  --sidebar-width: 248px;
  --reading-width: 680px;
  --email-width: 600px;
}

/* ───── Signal: dark first ───── */
:root {
  color-scheme: dark;
  --bg: #0a0d16;
  --surface: #121722;
  --surface-sunken: #070a11;
  --surface-hover: #182030;
  --line: #222938;
  --line-strong: #646c82;
  --ink: #f4f6fb;
  --ink-muted: #9198aa;
  --ink-faint: #5d6476;
  --accent: #00e8c0;
  --accent-ink: #00e8c0;
  --accent-soft: #082c27;
  --primary: #00e8c0;
  --primary-hover: #5cf2d6;
  --on-primary: #0a0d16;
  --focus: #00e8c0;
  --danger: #ff7a7a;
  --danger-soft: #3a1517;
  --warning: #f5b14c;
  --warning-soft: #33240b;
  --success: #7db8ff;
  --success-soft: #0f2236;
  --starred: var(--warning);
  --shadow-pop: 0 12px 32px rgba(0,0,0,0.55), 0 1px 0 rgba(255,255,255,0.04);
  --shadow-none: none;
  --logo-lockup: url(logos/signal/casewire-lockup-on-dark.svg);
  --logo-stacked: url(logos/signal/casewire-stacked-on-dark.svg);
  --logo-mark: url(logos/signal/casewire-mark-on-dark.svg);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-sunken: #ebeef5;
  --surface-hover: #eef1f7;
  --line: #e1e5ee;
  --line-strong: #858da0;
  --ink: #0b1020;
  --ink-muted: #535b6e;
  --ink-faint: #8a90a2;
  --accent: #009b7c;
  --accent-ink: #00785a;
  --accent-soft: #ddf6ef;
  --primary: #0b1020;
  --primary-hover: #232a3d;
  --on-primary: #ffffff;
  --focus: #00785a;
  --danger: #c0262d;
  --danger-soft: #fce8e8;
  --warning: #8f5400;
  --warning-soft: #fdf1dc;
  --success: #1d6fb8;
  --success-soft: #e3f0fc;
  --starred: var(--warning);
  --shadow-pop: 0 12px 32px rgba(11,16,32,0.12), 0 1px 2px rgba(11,16,32,0.08);
  --shadow-none: none;
  --logo-lockup: url(logos/signal/casewire-lockup-on-light.svg);
  --logo-stacked: url(logos/signal/casewire-stacked-on-light.svg);
  --logo-mark: url(logos/signal/casewire-mark-on-light.svg);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-sunken: #ebeef5;
    --surface-hover: #eef1f7;
    --line: #e1e5ee;
    --line-strong: #858da0;
    --ink: #0b1020;
    --ink-muted: #535b6e;
    --ink-faint: #8a90a2;
    --accent: #009b7c;
    --accent-ink: #00785a;
    --accent-soft: #ddf6ef;
    --primary: #0b1020;
    --primary-hover: #232a3d;
    --on-primary: #ffffff;
    --focus: #00785a;
    --danger: #c0262d;
    --danger-soft: #fce8e8;
    --warning: #8f5400;
    --warning-soft: #fdf1dc;
    --success: #1d6fb8;
    --success-soft: #e3f0fc;
    --starred: var(--warning);
    --shadow-pop: 0 12px 32px rgba(11,16,32,0.12), 0 1px 2px rgba(11,16,32,0.08);
    --shadow-none: none;
    --logo-lockup: url(logos/signal/casewire-lockup-on-light.svg);
    --logo-stacked: url(logos/signal/casewire-stacked-on-light.svg);
    --logo-mark: url(logos/signal/casewire-mark-on-light.svg);
  }
}

/* ───── Newsprint: light first, nearly square corners ───── */
:root[data-scheme="newsprint"] {
  color-scheme: light;
  --bg: #f3eee5;
  --surface: #fbf8f2;
  --surface-sunken: #eae3d7;
  --surface-hover: #f6f1e8;
  --line: #e1d9cb;
  --line-strong: #8f8574;
  --ink: #1a1918;
  --ink-muted: #615c55;
  --ink-faint: #958e83;
  --accent: #e1372a;
  --accent-ink: #b8281d;
  --accent-soft: #f9e1dc;
  --primary: #1a1918;
  --primary-hover: #34312e;
  --on-primary: #f3eee5;
  --focus: #b8281d;
  --danger: #b8281d;
  --danger-soft: #f9e1dc;
  --warning: #835300;
  --warning-soft: #f6ead2;
  --success: #1f5fa0;
  --success-soft: #e1ecf7;
  --starred: var(--warning);
  --shadow-pop: 0 1px 0 rgba(26,25,24,0.06), 0 10px 28px rgba(26,25,24,0.10);
  --shadow-none: none;
  --logo-lockup: url(logos/newsprint/casewire-lockup-on-light.svg);
  --logo-stacked: url(logos/newsprint/casewire-stacked-on-light.svg);
  --logo-mark: url(logos/newsprint/casewire-mark-on-light.svg);
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 8px;
  --radius-pill: 999px;
}
:root[data-scheme="newsprint"][data-theme="dark"] {
  color-scheme: dark;
  --bg: #151312;
  --surface: #1f1c1a;
  --surface-sunken: #0f0d0c;
  --surface-hover: #282421;
  --line: #302b28;
  --line-strong: #766e66;
  --ink: #efe9df;
  --ink-muted: #a8a196;
  --ink-faint: #655e57;
  --accent: #ff5244;
  --accent-ink: #ff7468;
  --accent-soft: #3a1714;
  --primary: #ff5244;
  --primary-hover: #ff7468;
  --on-primary: #151312;
  --focus: #ff7468;
  --danger: #ff7468;
  --danger-soft: #3a1714;
  --warning: #e8b04a;
  --warning-soft: #33250c;
  --success: #86b6f0;
  --success-soft: #13243a;
  --starred: var(--warning);
  --shadow-pop: 0 10px 28px rgba(0,0,0,0.5);
  --shadow-none: none;
  --logo-lockup: url(logos/newsprint/casewire-lockup-on-dark.svg);
  --logo-stacked: url(logos/newsprint/casewire-stacked-on-dark.svg);
  --logo-mark: url(logos/newsprint/casewire-mark-on-dark.svg);
}
@media (prefers-color-scheme: dark) {
  :root[data-scheme="newsprint"]:not([data-theme]) {
    color-scheme: dark;
    --bg: #151312;
    --surface: #1f1c1a;
    --surface-sunken: #0f0d0c;
    --surface-hover: #282421;
    --line: #302b28;
    --line-strong: #766e66;
    --ink: #efe9df;
    --ink-muted: #a8a196;
    --ink-faint: #655e57;
    --accent: #ff5244;
    --accent-ink: #ff7468;
    --accent-soft: #3a1714;
    --primary: #ff5244;
    --primary-hover: #ff7468;
    --on-primary: #151312;
    --focus: #ff7468;
    --danger: #ff7468;
    --danger-soft: #3a1714;
    --warning: #e8b04a;
    --warning-soft: #33250c;
    --success: #86b6f0;
    --success-soft: #13243a;
    --starred: var(--warning);
    --shadow-pop: 0 10px 28px rgba(0,0,0,0.5);
    --shadow-none: none;
    --logo-lockup: url(logos/newsprint/casewire-lockup-on-dark.svg);
    --logo-stacked: url(logos/newsprint/casewire-stacked-on-dark.svg);
    --logo-mark: url(logos/newsprint/casewire-mark-on-dark.svg);
  }
}
