:root {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --light-page: #f8fafc;
  --light-surface: #ffffff;
  --light-surface-soft: #f1f5f9;
  --light-surface-raised: #ffffff;
  --light-heading: #0f172a;
  --light-body: #334155;
  --light-muted: #526176;
  --light-subtle: #64748b;
  --light-border: #d7e0ec;
  --light-border-strong: #c3cfdf;
  --light-indigo: #4338ca;
  --light-indigo-hover: #3730a3;
  --light-indigo-soft: #eef2ff;
  --light-green: #166534;
  --light-sky: #075985;
  --light-amber: #92400e;
  --light-shadow: 0 14px 36px rgba(51, 65, 85, 0.09);
  --light-shadow-hover: 0 18px 44px rgba(51, 65, 85, 0.14);
}

html[data-theme="light"] body,
html[data-theme="light"] [class~="bg-dark-200"] {
  background-color: var(--light-page) !important;
  color: var(--light-body) !important;
}

html[data-theme="light"] [class~="bg-dark-100"] {
  background-color: var(--light-surface) !important;
}

html[data-theme="light"] [class~="bg-dark-50"] {
  background-color: var(--light-surface-soft) !important;
}

html[data-theme="light"] [class*="bg-dark-100/"] {
  background-color: rgba(255, 255, 255, 0.96) !important;
}

html[data-theme="light"] [class*="bg-dark-200/"] {
  background-color: rgba(248, 250, 252, 0.96) !important;
}

html[data-theme="light"] [class*="bg-dark-50/"] {
  background-color: rgba(241, 245, 249, 0.96) !important;
}

html[data-theme="light"] #menu {
  color: var(--light-body) !important;
}

html[data-theme="light"] [class~="text-white"] {
  color: var(--light-heading) !important;
}

html[data-theme="light"] [class~="text-gray-300"] {
  color: var(--light-body) !important;
}

html[data-theme="light"] [class~="text-gray-400"] {
  color: var(--light-muted) !important;
}

html[data-theme="light"] [class~="text-gray-500"] {
  color: var(--light-subtle) !important;
}

html[data-theme="light"] [class~="text-indigo-300"],
html[data-theme="light"] [class~="text-indigo-400"],
html[data-theme="light"] [class~="text-indigo-500"] {
  color: var(--light-indigo) !important;
}

html[data-theme="light"] [class~="text-green-300"],
html[data-theme="light"] [class~="text-green-400"] {
  color: var(--light-green) !important;
}

html[data-theme="light"] [class~="text-sky-300"],
html[data-theme="light"] [class~="text-sky-400"] {
  color: var(--light-sky) !important;
}

html[data-theme="light"] [class~="text-amber-300"],
html[data-theme="light"] [class~="text-amber-400"] {
  color: var(--light-amber) !important;
}

html[data-theme="light"] [class~="border-dark-50"],
html[data-theme="light"] [class*="border-dark-50/"] {
  border-color: var(--light-border) !important;
}

html[data-theme="light"] [class*="border-indigo-"] {
  border-color: #a5b4fc !important;
}

html[data-theme="light"] [class*="border-green-"] {
  border-color: #86efac !important;
}

html[data-theme="light"] [class*="border-sky-"] {
  border-color: #7dd3fc !important;
}

html[data-theme="light"] [class*="border-amber-"] {
  border-color: #fcd34d !important;
}

html[data-theme="light"] [class*="bg-indigo-950/"] {
  background-color: #eef2ff !important;
}

html[data-theme="light"] [class*="bg-sky-950/"] {
  background-color: #e0f2fe !important;
}

html[data-theme="light"] [class*="bg-green-950/"] {
  background-color: #ecfdf5 !important;
}

html[data-theme="light"] [class*="bg-amber-950/"] {
  background-color: #fffbeb !important;
}

html[data-theme="light"] [class*="bg-indigo-600"],
html[data-theme="light"] [class*="bg-indigo-700"] {
  background-color: #4f46e5 !important;
}

html[data-theme="light"] [class*="bg-indigo-600"]:hover,
html[data-theme="light"] [class*="bg-indigo-700"]:hover {
  background-color: #4338ca !important;
}

html[data-theme="light"] [class*="bg-indigo-"][class~="text-white"],
html[data-theme="light"] [class*="bg-sky-"][class~="text-white"],
html[data-theme="light"] [class*="bg-green-"][class~="text-white"],
html[data-theme="light"] [class*="bg-brand-"][class~="text-white"],
html[data-theme="light"] button[class~="text-white"] {
  color: #ffffff !important;
}

html[data-theme="light"] a[class*="border-indigo-"][class~="text-white"] {
  color: var(--light-indigo) !important;
  background-color: #ffffff !important;
}

html[data-theme="light"] a[class*="border-indigo-"][class~="text-white"]:hover {
  color: #ffffff !important;
  background-color: #4f46e5 !important;
  border-color: #4f46e5 !important;
}

html[data-theme="light"] a[class*="hover:text-white"]:not([class*="hover:bg-"]):hover {
  color: var(--light-indigo-hover) !important;
  background-color: var(--light-indigo-soft) !important;
  border-color: #818cf8 !important;
}

html[data-theme="light"] a:not([class*="bg-"]):hover,
html[data-theme="light"] button:not([class*="bg-"]):hover {
  color: var(--light-indigo-hover);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  color: var(--light-heading) !important;
  background-color: #ffffff !important;
  border-color: #b8c4d4 !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #718096 !important;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16) !important;
  outline: none !important;
}

html[data-theme="light"] article,
html[data-theme="light"] details,
html[data-theme="light"] .shadow-xl,
html[data-theme="light"] .shadow-2xl {
  box-shadow: var(--light-shadow) !important;
}

html[data-theme="light"] article {
  color: var(--light-body);
}

html[data-theme="light"] details {
  color: var(--light-body) !important;
  background-color: #ffffff !important;
  border-color: var(--light-border) !important;
}

html[data-theme="light"] details[open] {
  border-color: #a5b4fc !important;
}

html[data-theme="light"] code {
  color: #6d28d9 !important;
  background-color: #f3e8ff;
}

html[data-theme="light"] header {
  box-shadow: 0 8px 28px rgba(51, 65, 85, 0.07);
}

html[data-theme="light"] #theme-toggle,
html[data-theme="light"] #mobile-menu-toggle {
  color: #334155 !important;
  background-color: #ffffff !important;
  border-color: var(--light-border-strong) !important;
}

html[data-theme="light"] #mobile-menu-panel {
  background-color: #ffffff !important;
  border-color: var(--light-border-strong) !important;
}

html[data-theme="light"] #mobile-menu-panel a {
  color: var(--light-body) !important;
}

html[data-theme="light"] #mobile-menu-panel a:hover {
  color: var(--light-indigo-hover) !important;
  background-color: var(--light-indigo-soft) !important;
}

html[data-theme="light"] footer {
  color: var(--light-muted) !important;
}

html[data-theme="light"] footer a {
  color: var(--light-indigo) !important;
}

html[data-theme="light"] ::selection {
  color: var(--light-heading);
  background: #c7d2fe;
}

html[data-theme="light"] :focus-visible {
  outline-color: #4f46e5;
}

/* Keep raised dark-themed surfaces separated without flattening semantic borders. */
html[data-theme="light"] main form,
html[data-theme="light"] main details {
  border-color: var(--light-border) !important;
}

html[data-theme="light"] main form[class*="bg-dark-"],
html[data-theme="light"] main article[class*="bg-dark-"] {
  background-color: var(--light-surface-raised) !important;
}

html[data-theme="dark"] .text-gray-500 {
  color: #9ca3af !important;
}

html[data-theme="dark"] a.bg-emerald-600 {
  background-color: #047857 !important;
}

html[data-theme="dark"] a.bg-orange-600 {
  background-color: #c2410c !important;
}

html[data-theme="dark"] a.bg-sky-600 {
  background-color: #0369a1 !important;
}

html[data-theme="dark"] button.bg-green-600 {
  background-color: #15803d !important;
}

a[href^="mailto:"] {
  text-decoration: underline;
  text-underline-offset: .18em;
}
