
/* ─────────────────────────────────────────────────────────────
   SONARIS — dark theme
   One switch, one set of tokens. Nothing on the page hardcodes a
   colour, so the theme only restates the surface and ink ramps and
   every component follows.

   Set on <html> by theme.js:
     data-theme="dark"   — dark paper
     data-theme="light"  — light paper (the default)
   ───────────────────────────────────────────────────────────── */

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

  /* The dark page is the plugin window, scaled up: a green-black
     paper, panels one step lighter, mint as the only ink that
     carries emphasis. */

  /* ── surface ─────────────────────────────────────────────── */
  --paper: #0a1410;
  --wash: #0f1d16;
  --hair: #23392c;
  --hair-2: #1b2c22;

  /* ── ink ─────────────────────────────────────────────────── */
  --ink: #d7f2e2;
  --ink-2: #9ec4ae;
  --ink-3: #7fa890;
  --ink-4: #4d6b59;

  /* ── screen ──────────────────────────────────────────────── */
  --dark: #0e1b14;
  --dark-2: #12241a;
  --dark-3: #18301f;
  --mint: #a2ffc0;
  --mint-dim: #6d9f80;
  --mint-line: #35553f;

  /* ── state ───────────────────────────────────────────────── */
  --field-line: #3d5a48;
  --field-line-dark: #6d9f80;
  --focus: #a2ffc0;
  --focus-dark: #a2ffc0;
  --danger: #ff9a9a;
  --danger-dim: #ff9a9a;
  --ok: #a2ffc0;
  --warn: #e0b45c;
  --ok-dim: #a2ffc0;
}

/* The filled button inverts on dark: mint fill, ink lettering —
   the same treatment the plugin gives its active chip. */
html[data-theme="dark"] .hbtn:not(.hbtn--ghost) {
  background: var(--mint);
  border-color: var(--mint);
  color: #0a1410;
}

html[data-theme="dark"] .hbtn:not(.hbtn--ghost):hover {
  background: transparent;
  color: var(--mint);
}

html[data-theme="dark"] .hbtn--ghost {
  background: transparent;
  border-color: var(--field-line);
  color: var(--ink);
}

html[data-theme="dark"] .hbtn--ghost:hover {
  border-color: var(--mint);
  color: var(--mint);
}

/* The header sits on a translucent paper; in dark it needs its own
   value because the colour is mixed in rgba, not a token. */
html[data-theme="dark"] .hd {
  background: rgba(10, 20, 16, 0.86);
}

/* The lockup is a mask filled with currentColor. On dark paper it
   takes the light version of the mark — the mint one. */
html[data-theme="dark"] .hd__logo {
  color: var(--mint);
}

/* Selection inverts the other way round. */
html[data-theme="dark"] ::selection {
  background: var(--ink);
  color: var(--paper);
}

/* ── the switch ────────────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--field-line);
  background: transparent;
  color: var(--ink-2);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--wash);
}

.theme-toggle__dot {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  flex: none;
  background: transparent;
}

html[data-theme="dark"] .theme-toggle__dot {
  background: currentColor;
}

/* On a phone the label goes, the dot stays. */
@media (max-width: 720px) {
  .theme-toggle__label {
    display: none;
  }
}
