/* Amillati studio — dark mode. Linked AFTER each page's inline <style> so it overrides.
   Applies when the device is dark (and Rob hasn't forced light), OR when he's toggled dark.
   Warm near-black ground + cream ink + brighter gold — the parchment world at night, not a cold theme.
   Palette-preview swatches on /brand keep their own inline hexes (they show Rob's brand colours, not UI). */

/* shared dark token set (duplicated below under @media for auto-dark — the standard
   two-selector pattern; edit both blocks together) */
:root[data-theme="dark"] {
  --ink: #ece3d1;
  --parchment: #17130f;
  --parchment-2: #211b14;
  --panel: #221c15;
  --gold: #c2a15e;
  --gold-soft: #a98f57;
  --line: rgba(236, 227, 209, 0.14);
  --muted: rgba(236, 227, 209, 0.6);
  --ok: #7cc295;
  --you: #d79a78;
  --spot-color: rgba(236, 227, 209, 0.42);
}
:root[data-theme="dark"] textarea { background: #241d15; color: var(--ink); }
:root[data-theme="dark"] .draft { background: #1c1710; }
:root[data-theme="dark"] .draft .held { background: #241d15; }
:root[data-theme="dark"] .shell { background: rgba(23, 19, 15, 0.86); }
:root[data-theme="dark"] .facet { background: #201a13; }
:root[data-theme="dark"] .facet .go { background: linear-gradient(to top right, #241d15, #2c2318); }
:root[data-theme="dark"] .section-panel { background: #1b150e; border-color: rgba(236, 227, 209, 0.10); }
:root[data-theme="dark"] .preview-frame { border-color: var(--line); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ece3d1;
    --parchment: #17130f;
    --parchment-2: #211b14;
    --panel: #221c15;
    --gold: #c2a15e;
    --gold-soft: #a98f57;
    --line: rgba(236, 227, 209, 0.14);
    --muted: rgba(236, 227, 209, 0.6);
    --ok: #7cc295;
    --you: #d79a78;
    --spot-color: rgba(236, 227, 209, 0.42);
  }
  :root:not([data-theme="light"]) textarea { background: #241d15; color: var(--ink); }
  :root:not([data-theme="light"]) .draft { background: #1c1710; }
  :root:not([data-theme="light"]) .draft .held { background: #241d15; }
  :root:not([data-theme="light"]) .shell { background: rgba(23, 19, 15, 0.86); }
  :root:not([data-theme="light"]) .facet { background: #201a13; }
  :root:not([data-theme="light"]) .facet .go { background: linear-gradient(to top right, #241d15, #2c2318); }
  :root:not([data-theme="light"]) .section-panel { background: #1b150e; border-color: rgba(236, 227, 209, 0.10); }
}

/* the theme toggle button (lives in the studio bar / shell nav) */
[data-theme-toggle] {
  background: none; border: none; cursor: pointer; font-size: 13px; line-height: 1;
  padding: 2px 6px; border-radius: 6px; color: inherit; opacity: 0.85; transition: opacity .15s;
}
[data-theme-toggle]:hover { opacity: 1; }
