/* ==========================================================================
   StudyLoop — tokens, themes and gradients
   Four solid themes and four gradients. A gradient is a theme of its own: it
   sits on the black base, so the content area still stays true black.
   ========================================================================== */

:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --accent-h: 162;
  --accent-s: 52%;
  --accent-l: 46%;
  --accent-text-l: 62%;

  --accent: hsl(var(--accent-h) var(--accent-s) var(--accent-l));
  --accent-ink: #ffffff;
  --accent-text: hsl(var(--accent-h) var(--accent-s) var(--accent-text-l));
  --accent-soft: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / .16);
  --accent-ring: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / .45);

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;

  --ease: cubic-bezier(.2, .8, .25, 1);
  --dur: 110ms;

  --rail-w: 72px;
  --side-w: 240px;
  --panel-w: 240px;

  --grad: none;
}

/* ── black (default) ─────────────────────────────────────────────────── */
[data-theme="black"] {
  color-scheme: dark;
  --bg: #000000;
  --page: #000000;
  --rail: #040405;
  --chrome: #0a0a0c;
  --sunken: #111113;
  --raise: #191a1d;
  --rule: #1b1b1f;
  --rule-strong: #2b2b31;
  --text: #f2f2f4;
  --text-2: #a2a2aa;
  --text-3: #6b6b74;
  --code: #141416;
  --veil: rgba(0, 0, 0, .30);
  --bar: rgba(0, 0, 0, .55);
  --ok: #34c98a;
  --warn: #e5b045;
  --danger: #f0575f;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .8);
  --shadow-2: 0 14px 34px rgba(0, 0, 0, .9);
  --scroll: rgba(255, 255, 255, .1);
  --mark: rgba(162, 240, 200, .25);
}

/* ── slate ───────────────────────────────────────────────────────────── */
[data-theme="slate"] {
  color-scheme: dark;
  --bg: #121418;
  --page: #121418;
  --rail: #0d0f12;
  --chrome: #171a1f;
  --sunken: #1e2127;
  --raise: #262a31;
  --rule: #282c33;
  --rule-strong: #3a4048;
  --text: #e9ecf1;
  --text-2: #9fa6b1;
  --text-3: #6c737e;
  --code: #1d2026;
  --veil: rgba(0, 0, 0, .22);
  --bar: rgba(18, 20, 24, .72);
  --ok: #3cc98d;
  --warn: #e2ae4c;
  --danger: #ef5f66;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-2: 0 14px 30px rgba(0, 0, 0, .5);
  --scroll: rgba(255, 255, 255, .12);
  --mark: rgba(162, 240, 200, .26);
}

/* ── paper ───────────────────────────────────────────────────────────── */
[data-theme="paper"] {
  color-scheme: light;
  --bg: #ffffff;
  --page: #ffffff;
  --rail: #eceee9;
  --chrome: #f4f5f2;
  --sunken: #eef0eb;
  --raise: #e4e7e0;
  --rule: #e2e5de;
  --rule-strong: #c9cec4;
  --text: #14170f;
  --text-2: #4d5347;
  --text-3: #7b8276;
  --code: #eef0ea;
  --veil: rgba(255, 255, 255, .62);
  --bar: rgba(255, 255, 255, .78);
  --ok: #1f7a53;
  --warn: #8f6512;
  --danger: #bf3b3b;
  --shadow-1: 0 1px 2px rgba(30, 40, 20, .08);
  --shadow-2: 0 14px 30px rgba(30, 40, 20, .14);
  --scroll: rgba(30, 40, 20, .18);
  --mark: rgba(255, 214, 102, .5);
}

/* ── sand ────────────────────────────────────────────────────────────── */
[data-theme="sand"] {
  color-scheme: light;
  --bg: #fbf7ef;
  --page: #fbf7ef;
  --rail: #efe9da;
  --chrome: #f4eede;
  --sunken: #f0e9d9;
  --raise: #e6dcc6;
  --rule: #e2d8c3;
  --rule-strong: #c9bda3;
  --text: #241f16;
  --text-2: #5c5343;
  --text-3: #8b8170;
  --code: #eee7d8;
  --veil: rgba(255, 255, 255, .60);
  --bar: rgba(251, 247, 239, .78);
  --ok: #2a7455;
  --warn: #8a6415;
  --danger: #b23f2e;
  --shadow-1: 0 1px 2px rgba(70, 55, 25, .09);
  --shadow-2: 0 14px 30px rgba(70, 55, 25, .16);
  --scroll: rgba(70, 55, 25, .18);
  --mark: rgba(214, 168, 74, .45);
}

/* ── gradients: each one sits on the black base ──────────────────────── */
[data-gradient="dusk"] {
  --grad: linear-gradient(158deg, #1e1136 0%, #3c1e4e 30%, #6b2a4b 56%, #a2452f 80%, #c9722f 100%);
}

[data-gradient="reef"] {
  --grad: linear-gradient(158deg, #04141a 0%, #083235 30%, #0b4f4e 58%, #137a67 82%, #1c9a70 100%);
}

[data-gradient="ember"] {
  --grad: linear-gradient(158deg, #1a0908 0%, #3a1411 32%, #68231a 60%, #a1431f 84%, #cf7326 100%);
}

[data-gradient="aurora"] {
  --grad: linear-gradient(158deg, #071127 0%, #0e2847 32%, #1a4862 60%, #27755f 84%, #3aa077 100%);
}

/* ── base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

h1, h2, h3, p, ul, li, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: var(--code);
  border-radius: 3px;
  padding: .1em .3em;
}

kbd {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--sunken);
  color: var(--text-3);
}

mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 .1em; }

::selection { background: var(--accent-soft); color: var(--text); }

:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-ring); border-radius: var(--r-xs); }

* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--rule-strong); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i--xs { width: 15px; height: 15px; stroke-width: 1.9; }
.i--sm { width: 17px; height: 17px; stroke-width: 1.8; }

.rail, .side, .bar, .composer, .pop__head { user-select: none; -webkit-user-select: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
