/* ── Shared dark mode theme ── */

:root {
  --texture-line: rgba(180,160,130,0.08);
  --hover-tint: rgba(184,76,43,0.05);
  --surface-30: rgba(255,255,255,0.3);
  --surface-40: rgba(255,255,255,0.4);
  --surface-50: rgba(255,255,255,0.5);
  --surface-60: rgba(255,255,255,0.6);
}

html[data-theme="dark"] {
  --cream: #1b1714;
  --ink: #f1e8de;
  --rust: #e0784a;
  --slate: #b7c4da;
  --muted: #ad9d8c;
  --rule: #3c332b;
  --green: #6fbf73;
  --green-bg: #1e2a1f;
  --red: #e2685a;
  --blue: #7badec;
  --purple: #c79be0;
  --texture-line: rgba(255,255,255,0.035);
  --hover-tint: rgba(224,120,74,0.10);
  --surface-30: rgba(255,255,255,0.04);
  --surface-40: rgba(255,255,255,0.05);
  --surface-50: rgba(255,255,255,0.06);
  --surface-60: rgba(255,255,255,0.08);
}

html, body {
  transition: background-color 0.25s ease, color 0.25s ease;
}
* {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* ── Theme toggle button ── */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  box-shadow: 2px 2px 0 var(--ink);
}

.theme-toggle:hover {
  background: var(--rust);
  border-color: var(--rust);
  color: #fff;
}

.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

@media (max-width: 600px) {
  .theme-toggle {
    top: 0.7rem;
    right: 0.7rem;
    width: 2rem;
    height: 2rem;
    font-size: 0.95rem;
  }
}
