/* Night Room — Theme System */
/* Same color story: warm parchment tones, aged library aesthetic */

:root {
  /* ── Dark (default) ── */
  --nr-bg-rgb: 12,20,30;
  --nr-void-rgb: 7,15,25;
  --nr-surface-rgb: 26,32,48;
  --nr-text-rgb: 234,221,206;
  --nr-accent-rgb: 212,184,149;
  --nr-accent-muted-rgb: 201,168,124;
  --nr-ink-rgb: 44,36,27;
  --nr-rust-rgb: 140,58,36;
  --nr-muted-rgb: 107,92,75;
  /* Overlay: parchment glow on dark backgrounds */
  --nr-overlay-rgb: 212,184,149;
  /* Meta / PWA */
  --nr-theme-color: #0c141e;
}

html.light {
  /* ── Light ── */
  --nr-bg-rgb: 244,237,229;
  --nr-void-rgb: 235,226,215;
  --nr-surface-rgb: 228,217,204;
  --nr-text-rgb: 92,72,50;
  --nr-accent-rgb: 126,105,74;
  --nr-accent-muted-rgb: 110,92,64;
  --nr-ink-rgb: 244,237,229;
  --nr-rust-rgb: 156,52,28;
  --nr-muted-rgb: 140,126,110;
  /* Overlay: warm shadow on light backgrounds */
  --nr-overlay-rgb: 80,66,48;
  /* Meta / PWA */
  --nr-theme-color: #F4EDE5;
}

/* Body background — driven by variable */
body {
  background-color: rgb(var(--nr-bg-rgb)) !important;
}

/* Focus visible — driven by variable */
:focus-visible {
  outline-color: rgba(var(--nr-accent-rgb), 0.6) !important;
}

/* Light mode — select/option readability */
html.light select option {
  background-color: rgb(var(--nr-bg-rgb));
  color: rgb(var(--nr-text-rgb));
}

/* Light mode — nav bar: opaque, not transparent */
html.light nav.nr-nav {
  background-color: rgb(var(--nr-bg-rgb)) !important;
  backdrop-filter: none !important;
  border-top-color: rgba(var(--nr-overlay-rgb), 0.12);
}

/* Light mode — parchment-card: warm sandy parchment on cream */
html.light .parchment-card {
  background-color: #E2D5C4 !important;
  color: #3E3226;
  box-shadow: 0 2px 12px -2px rgba(var(--nr-overlay-rgb), 0.12) !important;
}

/* Light mode — parchment-card text: force dark tones for readability */
html.light .parchment-card .text-ink { color: #3E3226 !important; }
html.light .parchment-card .text-muted { color: rgba(62,50,38,0.6) !important; }
html.light .parchment-card .font-serif { color: #3E3226; }
html.light .parchment-card [style*="color:rgba(44,36,27"] { color: rgba(62,50,38,0.5) !important; }

/* Light mode — supplement buttons: boost opacity for visibility on cream */
html.light [id^="supp-"] {
  filter: saturate(1.4) contrast(1.3);
}

/* Light mode — symptom modal keeps dark bg */
html.light #symptom-modal form {
  background-color: #1a2030 !important;
}

/* Light mode — Records glow: hide entirely, cream bg doesn't need it */
html.light #glow-wrapper {
  display: none !important;
}
