:root {
  --font-sans: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Code", Consolas, Menlo, monospace;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --header-height: 68px;
  --page-width: 1180px;
  --content-width: 960px;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --font-scale: 1;
}

/* Theme ids are stored in users' browsers, so they stay stable even when
   the display names change. */

/* ---------- Ink (default) ---------- */
:root,
[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #0d0d0f;
  --bg-glow: rgba(255, 106, 61, 0.10);
  --dot: rgba(255, 255, 255, 0.035);
  --surface: #141416;
  --surface-hover: #1b1b1e;
  --elevated: #19191c;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eeede9;
  --text-muted: #a09f99;
  --text-faint: #5f5e5a;
  --accent: #ff6a3d;
  --accent-hover: #ff7f59;
  --accent-2: #ffb08f;
  --accent-soft: rgba(255, 106, 61, 0.13);
  --accent-contrast: #160905;
  --success: #7fd6a0;
  --success-soft: rgba(127, 214, 160, 0.14);
  --error: #ff5f6d;
  --error-soft: rgba(255, 95, 109, 0.14);
  --caret: #ff6a3d;
  --glow: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, 0.75);
}

/* ---------- Violet ---------- */
[data-theme="aurora"] {
  color-scheme: dark;
  --bg: #0e0c14;
  --bg-glow: rgba(160, 130, 255, 0.12);
  --dot: rgba(255, 255, 255, 0.035);
  --surface: #15131d;
  --surface-hover: #1d1a28;
  --elevated: #1a1724;
  --border: rgba(200, 185, 255, 0.08);
  --border-strong: rgba(200, 185, 255, 0.16);
  --text: #efedf7;
  --text-muted: #a49fba;
  --text-faint: #625d78;
  --accent: #a58bff;
  --accent-hover: #b6a0ff;
  --accent-2: #d3c6ff;
  --accent-soft: rgba(165, 139, 255, 0.15);
  --accent-contrast: #0e0a1c;
  --success: #7fd6b8;
  --success-soft: rgba(127, 214, 184, 0.14);
  --error: #ff6f91;
  --error-soft: rgba(255, 111, 145, 0.14);
  --caret: #a58bff;
  --glow: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, 0.75);
}

/* ---------- Paper (light) ---------- */
[data-theme="paper"] {
  color-scheme: light;
  --bg: #f5f3ee;
  --bg-glow: rgba(224, 88, 42, 0.07);
  --dot: rgba(40, 30, 20, 0.05);
  --surface: #fdfcf9;
  --surface-hover: #efece5;
  --elevated: #ffffff;
  --border: rgba(40, 30, 20, 0.09);
  --border-strong: rgba(40, 30, 20, 0.18);
  --text: #1c1a17;
  --text-muted: #67625a;
  --text-faint: #aaa49a;
  --accent: #e0582a;
  --accent-hover: #c94b20;
  --accent-2: #f09a78;
  --accent-soft: rgba(224, 88, 42, 0.1);
  --accent-contrast: #ffffff;
  --success: #3f8a5a;
  --success-soft: rgba(63, 138, 90, 0.12);
  --error: #cc3344;
  --error-soft: rgba(204, 51, 68, 0.1);
  --caret: #e0582a;
  --glow: none;
  --shadow: 0 1px 2px rgba(40, 30, 20, 0.04), 0 18px 40px -24px rgba(40, 30, 20, 0.22);
  --shadow-pop: 0 18px 50px -12px rgba(40, 30, 20, 0.25);
}

/* ---------- Harbor ---------- */
[data-theme="ocean"] {
  color-scheme: dark;
  --bg: #0a1116;
  --bg-glow: rgba(64, 196, 214, 0.10);
  --dot: rgba(255, 255, 255, 0.035);
  --surface: #10191f;
  --surface-hover: #162229;
  --elevated: #141e25;
  --border: rgba(160, 220, 235, 0.08);
  --border-strong: rgba(160, 220, 235, 0.16);
  --text: #e8f1f4;
  --text-muted: #93aab3;
  --text-faint: #52666e;
  --accent: #40c4d6;
  --accent-hover: #5fd1e0;
  --accent-2: #a6e6ee;
  --accent-soft: rgba(64, 196, 214, 0.14);
  --accent-contrast: #041318;
  --success: #6fd6a8;
  --success-soft: rgba(111, 214, 168, 0.14);
  --error: #ff7a6b;
  --error-soft: rgba(255, 122, 107, 0.14);
  --caret: #40c4d6;
  --glow: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, 0.75);
}

/* ---------- Rose ---------- */
[data-theme="sunset"] {
  color-scheme: dark;
  --bg: #120d0f;
  --bg-glow: rgba(255, 120, 150, 0.10);
  --dot: rgba(255, 255, 255, 0.035);
  --surface: #1a1316;
  --surface-hover: #22191d;
  --elevated: #1f171a;
  --border: rgba(255, 200, 210, 0.08);
  --border-strong: rgba(255, 200, 210, 0.16);
  --text: #f6ecee;
  --text-muted: #b69ea4;
  --text-faint: #6f5a60;
  --accent: #ff7896;
  --accent-hover: #ff8fa8;
  --accent-2: #ffc2cf;
  --accent-soft: rgba(255, 120, 150, 0.14);
  --accent-contrast: #1a0509;
  --success: #8fd8a0;
  --success-soft: rgba(143, 216, 160, 0.14);
  --error: #ff5c5c;
  --error-soft: rgba(255, 92, 92, 0.15);
  --caret: #ff7896;
  --glow: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, 0.75);
}

/* ---------- Moss ---------- */
[data-theme="forest"] {
  color-scheme: dark;
  --bg: #0c100d;
  --bg-glow: rgba(150, 214, 110, 0.09);
  --dot: rgba(255, 255, 255, 0.035);
  --surface: #121814;
  --surface-hover: #19211b;
  --elevated: #161d18;
  --border: rgba(190, 230, 190, 0.08);
  --border-strong: rgba(190, 230, 190, 0.16);
  --text: #eaf1ea;
  --text-muted: #9aad9c;
  --text-faint: #56665a;
  --accent: #9ed66e;
  --accent-hover: #b0e085;
  --accent-2: #d2efb8;
  --accent-soft: rgba(158, 214, 110, 0.14);
  --accent-contrast: #0b1405;
  --success: #9ed66e;
  --success-soft: rgba(158, 214, 110, 0.14);
  --error: #ff7f66;
  --error-soft: rgba(255, 127, 102, 0.15);
  --caret: #9ed66e;
  --glow: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, 0.75);
}

/* ---------- Carbon (charcoal grey, yellow accent) ---------- */
[data-theme="carbon"] {
  color-scheme: dark;
  --bg: #323437;
  --bg-glow: rgba(226, 183, 20, 0.06);
  --dot: rgba(255, 255, 255, 0.03);
  --surface: #2c2e31;
  --surface-hover: #37393d;
  --elevated: #2f3134;
  --border: rgba(209, 208, 197, 0.08);
  --border-strong: rgba(209, 208, 197, 0.16);
  --text: #d1d0c5;
  --text-muted: #9a9b95;
  --text-faint: #646669;
  --accent: #e2b714;
  --accent-hover: #edc434;
  --accent-2: #f0d56a;
  --accent-soft: rgba(226, 183, 20, 0.13);
  --accent-contrast: #1f1f1f;
  --success: #8fbf6a;
  --success-soft: rgba(143, 191, 106, 0.14);
  --error: #ca4754;
  --error-soft: rgba(202, 71, 84, 0.16);
  --caret: #e2b714;
  --glow: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 24px 48px -24px rgba(0, 0, 0, 0.55);
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, 0.6);
}

/* ---------- Font size scale ---------- */
[data-font-size="small"] { --font-scale: 0.88; }
[data-font-size="medium"] { --font-scale: 1; }
[data-font-size="large"] { --font-scale: 1.16; }
