/*
 * Aether — the palette.
 *
 * Every colour the landing uses is written here and nowhere else. A token is
 * defined once, as light-dark(<light>, <dark>): the browser picks the half
 * that matches `color-scheme`, which follows the system by default and is
 * pinned by the theme switch through <html data-theme="light|dark">.
 *
 * Three layers, top to bottom:
 *   1. the rainbow — seven pastel hues, each as a fill, a soft tint and an ink;
 *   2. the surfaces and the text;
 *   3. the brand — primary, the gradients and the shadows built from 1 and 2.
 */

:root {
  color-scheme: light dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

:root {
  /* ── 1. The rainbow ────────────────────────────────────────────────────
   * --c-<hue>       the pastel itself: fills, blobs, icons on a tint
   * --c-<hue>-soft  a whisper of it: card and badge backgrounds
   * --c-<hue>-ink   the same hue dark enough to read on its soft tint
   * --c-<hue>-on    text and icons on the pastel itself — deep in both themes,
   *                 because the pastel stays light in both
   */
  --c-rose:        light-dark(#ffb3c7, #ff9fba);
  --c-rose-soft:   light-dark(#ffeef3, #2a1820);
  --c-rose-ink:    light-dark(#b0325c, #ffc2d3);
  --c-rose-on:     #7d1f42;

  --c-peach:       light-dark(#ffc9a3, #ffb88a);
  --c-peach-soft:  light-dark(#fff2e8, #2a1d14);
  --c-peach-ink:   light-dark(#a8501a, #ffd3b5);
  --c-peach-on:    #7a3a10;

  --c-lemon:       light-dark(#ffe38a, #f5d77a);
  --c-lemon-soft:  light-dark(#fffadf, #262211);
  --c-lemon-ink:   light-dark(#836300, #fbe7a8);
  --c-lemon-on:    #5e4700;

  --c-mint:        light-dark(#9ee6c4, #86d9b3);
  --c-mint-soft:   light-dark(#e6f9ef, #13241c);
  --c-mint-ink:    light-dark(#1c7650, #b3efd2);
  --c-mint-on:     #115237;

  --c-sky:         light-dark(#a7d8ff, #8ccaff);
  --c-sky-soft:    light-dark(#e8f5ff, #121f2b);
  --c-sky-ink:     light-dark(#1d659f, #bfe2ff);
  --c-sky-on:      #134a75;

  --c-periwinkle:      light-dark(#b3bfff, #9dabff);
  --c-periwinkle-soft: light-dark(#eef0ff, #171a2e);
  --c-periwinkle-ink:  light-dark(#3a49bd, #c9d1ff);
  --c-periwinkle-on:    #26318a;

  --c-lavender:      light-dark(#cdb6ff, #baa0ff);
  --c-lavender-soft: light-dark(#f4eeff, #1f1830);
  --c-lavender-ink:  light-dark(#6538cf, #dccdff);
  --c-lavender-on:    #47219b;

  /* ── 2. Surfaces and text ─────────────────────────────────────────────── */
  --bg:           light-dark(#fbfaff, #0e0c15);
  --bg-alt:       light-dark(#f5f2fd, #13101c);
  --surface:      light-dark(#ffffff, #18151f);
  --surface-2:    light-dark(#f7f5fc, #201c2a);
  --surface-glass: light-dark(rgb(255 255 255 / 0.72), rgb(24 21 31 / 0.72));

  --text:         light-dark(#1d1a2b, #f3f0fa);
  --text-muted:   light-dark(#5f5976, #aaa3bd);
  --text-faint:   light-dark(#8e88a3, #6f6983);

  --border:        light-dark(rgb(29 26 43 / 0.08), rgb(255 255 255 / 0.08));
  --border-strong: light-dark(rgb(29 26 43 / 0.16), rgb(255 255 255 / 0.16));

  /* ── 3. The brand ─────────────────────────────────────────────────────── */
  --primary:       light-dark(#7b61ff, #b6a4ff);
  --primary-hover: light-dark(#6a4ff5, #c7b9ff);
  --primary-ink:   light-dark(#ffffff, #17122b);   /* text on a primary fill */
  --primary-soft:  light-dark(#efeaff, #221b3a);
  --primary-glow:  light-dark(rgb(123 97 255 / 0.28), rgb(182 164 255 / 0.22));

  --success: var(--c-mint-ink);
  --danger:  var(--c-rose-ink);

  /* The whole rainbow, left to right — headlines, the progress bar, rings. */
  --gradient-rainbow: linear-gradient(
    90deg,
    var(--c-rose), var(--c-peach), var(--c-lemon), var(--c-mint),
    var(--c-sky), var(--c-periwinkle), var(--c-lavender)
  );

  /* The same, deep enough to be text on --bg in either theme. */
  --gradient-text: linear-gradient(
    100deg,
    light-dark(#e0507f, #ffa6c0) 0%,
    light-dark(#e4833d, #ffc49b) 22%,
    light-dark(#2f9f73, #9be4c1) 48%,
    light-dark(#3a86d4, #9fd2ff) 68%,
    light-dark(#7b61ff, #c3b1ff) 100%
  );

  --gradient-primary: linear-gradient(135deg, var(--primary), light-dark(#a87bff, #d7a8ff));

  --shadow-sm: 0 1px 2px light-dark(rgb(40 30 90 / 0.06), rgb(0 0 0 / 0.4));
  --shadow-md: 0 8px 24px -8px light-dark(rgb(40 30 90 / 0.14), rgb(0 0 0 / 0.55));
  --shadow-lg: 0 24px 60px -18px light-dark(rgb(40 30 90 / 0.24), rgb(0 0 0 / 0.7));

  /* Chat mock-up bubbles. */
  --bubble-in:  light-dark(#ffffff, #262131);
  --bubble-out: light-dark(#e9e3ff, #3a2f66);
  --chat-bg:    light-dark(#f1eefb, #14111c);

  /* The hero's background blobs: the rainbow, thinned out for either theme. */
  --blob-rose:     light-dark(rgb(255 179 199 / 0.60), rgb(255 120 160 / 0.22));
  --blob-sky:      light-dark(rgb(167 216 255 / 0.60), rgb(100 170 255 / 0.22));
  --blob-mint:     light-dark(rgb(158 230 196 / 0.55), rgb(90 210 160 / 0.18));
  --blob-lavender: light-dark(rgb(205 182 255 / 0.65), rgb(150 120 255 / 0.26));
  --blob-lemon:    light-dark(rgb(255 227 138 / 0.55), rgb(245 210 100 / 0.14));

  /* The code terminal is dark in both themes. */
  --term-bg:   light-dark(#1b1728, #0a0810);
  --term-bar:  light-dark(#24203a, #15121e);
  --term-text: #ece8f8;
  --term-mute: #8b84a3;
  --term-key:  #b6a4ff;
  --term-str:  #9ee6c4;
  --term-num:  #ffc9a3;
}
