/* ============================================================
   ONYX — Light theme
   Token overrides only. Loaded on every page after tokens.css.
   Activated via html[data-theme="light"] (styles/theme.js).
   Warm paper surfaces · same amber authority · same hierarchy.
   ============================================================ */

html[data-theme="light"] {
  /* ---------- Surfaces (warm paper, layered) ---------- */
  --bg-000: #F6F5EF;
  --bg-100: #FBFAF5;
  --bg-200: #FFFFFF;
  --bg-300: #F1EFE7;
  --bg-400: #E8E5DA;
  --bg-500: #DEDACC;

  /* hairlines */
  --line-100: rgba(26, 24, 15, 0.08);
  --line-200: rgba(26, 24, 15, 0.12);
  --line-300: rgba(26, 24, 15, 0.18);
  --line-strong: rgba(26, 24, 15, 0.32);

  /* ---------- Text ---------- */
  --text-100: #191813;
  --text-200: #3B392F;
  --text-300: #6C695C;
  --text-400: #97937F;
  --text-500: #B9B5A6;

  /* ---------- Brand accent (deeper amber for contrast) ---------- */
  --accent: #C98A0B;
  --accent-hi: #A97305;
  --accent-lo: #F5B544;
  --accent-dim: rgba(201, 138, 11, 0.12);
  --accent-line: rgba(201, 138, 11, 0.38);

  /* ---------- Signal palette ---------- */
  --pos: #0E8A50;
  --pos-dim: rgba(14, 138, 80, 0.10);
  --pos-line: rgba(14, 138, 80, 0.30);

  --neg: #CE372F;
  --neg-dim: rgba(206, 55, 47, 0.08);
  --neg-line: rgba(206, 55, 47, 0.28);

  --warn: #B26205;
  --warn-dim: rgba(178, 98, 5, 0.09);
  --warn-line: rgba(178, 98, 5, 0.32);

  --info: #2563D9;
  --info-dim: rgba(37, 99, 217, 0.09);

  /* ---------- Shadows / glows ---------- */
  --glow-accent: 0 0 0 1px var(--accent-line), 0 10px 40px -16px rgba(201, 138, 11, 0.35);
  --glow-pos: 0 0 0 1px var(--pos-line), 0 8px 30px -14px rgba(14, 138, 80, 0.35);
  --shadow-card: 0 1px 2px rgba(26, 24, 15, 0.04), 0 24px 48px -30px rgba(26, 24, 15, 0.22);
  --shadow-pop: 0 30px 60px -24px rgba(26, 24, 15, 0.26), 0 0 0 1px var(--line-200);
}

/* body vignette — amber wash on paper */
html[data-theme="light"] body {
  background:
    radial-gradient(ellipse 1200px 700px at 50% -200px, rgba(201, 138, 11, 0.06), transparent 60%),
    var(--bg-000);
}

html[data-theme="light"] ::selection {
  background: rgba(201, 138, 11, 0.20);
  color: #6B4A03;
}

/* ---------- Glass bars (dark rgba hardcoded per page) ---------- */
html[data-theme="light"] .onyx-nav,
html[data-theme="light"] .ds-top {
  background: rgba(250, 249, 243, 0.82);
}
html[data-theme="light"] .toolbar,
html[data-theme="light"] .wl-toolbar,
html[data-theme="light"] .ed-tabs,
html[data-theme="light"] .ptab-wrap {
  background: rgba(250, 249, 243, 0.88);
}
html[data-theme="light"] .mobile-menu.open {
  background: rgba(250, 249, 243, 0.98);
}

/* footer amber wash */
html[data-theme="light"] .onyx-footer {
  background:
    linear-gradient(180deg, transparent, rgba(201, 138, 11, 0.03) 60%, rgba(201, 138, 11, 0.05)),
    var(--bg-000);
}

/* SVG chart hairlines drawn as white rgba strokes in the markup */
html[data-theme="light"] svg line[stroke^="rgba(255"] {
  stroke: rgba(26, 24, 15, 0.09);
}

/* card top-highlight insets read as dirt on paper — soften */
html[data-theme="light"] .cred-badge {
  background: linear-gradient(180deg, var(--bg-200), var(--bg-100));
  box-shadow: inset 0 0 0 1px var(--line-200);
}

/* primary button: keep dark ink label, tame the white inset */
html[data-theme="light"] .btn.primary {
  color: #FFFDF6;
  box-shadow: 0 0 0 1px rgba(26,24,15,0.10) inset, 0 10px 30px -16px rgba(201,138,11,0.5);
}
html[data-theme="light"] .btn.primary:hover { background: var(--accent-hi); }

/* ---------- Theme toggle button ---------- */
.theme-toggle { position: relative; }
.theme-toggle .ico-sun,
.theme-toggle .ico-moon { display: block; }
html:not([data-theme="light"]) .theme-toggle .ico-sun { display: none; }
html[data-theme="light"] .theme-toggle .ico-moon { display: none; }

.theme-toggle.floating {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 200;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  border: 0;
  cursor: pointer;
  background: var(--bg-300);
  color: var(--text-200);
  box-shadow: inset 0 0 0 1px var(--line-200), var(--shadow-pop);
  transition: 80ms;
}
.theme-toggle.floating:hover { background: var(--bg-400); color: var(--text-100); }
