:root {
  color-scheme: light dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15,23,42,.12);
  --card: #ffffff;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: rgba(148,163,184,.25);
  --card: rgba(2,6,23,.6);
}

html[data-theme="light"] body {
  background: #f8fafc;
  color: #0f172a;
}

html[data-theme="dark"] body {
  background: #0b1220;
  color: #e5e7eb;
}

html {
  transition: background-color .3s ease, color .3s ease;
}

body, header, .site-footer, .rounded-2xl, .dps-card {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.main-header-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
  background: linear-gradient(to bottom,#ffffff,#f8fafc);
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .main-header-container {
  background: linear-gradient(to bottom,#0b1220,#0f172a);
  border-bottom: 1px solid var(--border);
}

body {
  padding-top: 70px; /* adjust to your header height */
}

body.scrolled .main-header-container {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#mobile-menu {
  position: absolute;
  top: 70px; /* same as header height */
  left: 0;
  width: 100%;
  z-index: 9998;
}

html[data-theme="light"] .primary-menu a {
  color: #0f172a;
}

html[data-theme="dark"] .primary-menu a {
  color: #e5e7eb;
}

html[data-theme="light"] .primary-menu .current-menu-item>a {
  color: #4f46e5;
}

#themeToggle {
  position: fixed;
  top: .75rem;
  right: .75rem;
  z-index: 9999;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@media (min-width:1024px){
  #themeToggle { right: 1.5rem; }
}

body.admin-bar #themeToggle { top: calc(32px + .75rem); }

@media (min-width:782px){
  body.admin-bar #themeToggle { top: calc(46px + .75rem); }
}

@media (max-width:360px){ #themeLabel { display: none; } }

#themeToggleBtn {
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}

html[data-theme="light"] #themeToggleBtn {
  background: #fff;
  border: 1px solid var(--border);
  color: #0f172a;
}

html[data-theme="dark"] #themeToggleBtn {
  background: var(--card);
  border: 1px solid var(--border);
  color: #e5e7eb;
}

.site-footer {
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

html[data-theme="light"] .site-footer { background: #f8fafc; }
html[data-theme="dark"] .site-footer { background: #0b1220; }
.site-footer .border-t { border-color: var(--border) !important; }

html[data-theme="light"] .site-footer .brand-title,
html[data-theme="light"] .site-footer .footer-heading,
html[data-theme="light"] .site-footer .footer-link,
html[data-theme="light"] .site-footer .footer-social-link {
  color: var(--text) !important;
}

html[data-theme="light"] .site-footer .footer-text,
html[data-theme="light"] .site-footer .footer-msg {
  color: var(--muted) !important;
}

html[data-theme="light"] .footer-input {
  background: #fff !important;
  color: #0f172a !important;
  border: 1px solid var(--border) !important;
}

html[data-theme="dark"] .footer-input {
  background: var(--card) !important;
  color: #e5e7eb !important;
  border: 1px solid var(--border) !important;
}

html[data-theme="light"] .footer-btn {
  background: #4f46e5 !important;
  color: #fff !important;
}

html[data-theme="light"] .bg-slate-950,
html[data-theme="light"] .bg-slate-900\/90,
html[data-theme="light"] .bg-slate-900\/60,
html[data-theme="light"] .bg-slate-900\/50,
html[data-theme="light"] .bg-slate-900\/40,
html[data-theme="light"] .bg-black {
  background: #ffffff !important;
}

html[data-theme="light"] .from-slate-900.via-slate-900.to-slate-950 {
  background-image: linear-gradient(to bottom,#ffffff,#f8fafc,#eef2f7) !important;
}

html[data-theme="light"] .text-white,
html[data-theme="light"] .text-slate-100,
html[data-theme="light"] .text-slate-200 { color: #0f172a !important; }

html[data-theme="light"] .text-slate-300 { color: #475569 !important; }
html[data-theme="light"] .text-slate-400 { color: #334155 !important; }
html[data-theme="light"] .text-slate-200\/80 { color: rgba(31,41,55,.8) !important; }
html[data-theme="light"] .text-white\/80 { color: rgba(15,23,42,.8) !important; }
html[data-theme="light"] .text-center.text-slate-400 { color: #334155 !important; }
html[data-theme="light"] .text-slate-300\/90 { color: rgba(71,85,105,.9) !important; }

html[data-theme="light"] .border-slate-800\/60 { border-color: var(--border) !important; }
html[data-theme="light"] .stroke-slate-800\/60,
html[data-theme="light"] .fill-none.stroke-slate-800\/60 { stroke: var(--border) !important; }

html[data-theme="light"] .shadow-[0_12px_40px_rgba(79,70,229,0.45)] { box-shadow: 0 12px 40px rgba(79,70,229,.25) !important; }
html[data-theme="light"] .ring-cyan-400 { --tw-ring-color: #06b6d4 !important; }
html[data-theme="light"] .bg-indigo-600 { background-color: #4f46e5 !important; }

html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="url"],
html[data-theme="light"] textarea {
  background: #fff !important;
  color: #0f172a !important;
  border-color: var(--border) !important;
}

html[data-theme="light"] .placeholder-slate-500::placeholder { color: #94a3b8 !important; }
html[data-theme="light"] .hover\:bg-slate-800\/60:hover { background: rgba(15,23,42,.06) !important; }
html[data-theme="light"] .focus-visible\:outline-sky-500:focus-visible { outline-color: #0ea5e9 !important; }

html[data-theme="light"] .dps-card,
html[data-theme="light"] .rounded-2xl.border.border-slate-800\/60.bg-slate-900\/40 {
  background: #ffffff !important;
  border-color: var(--border) !important;
}

html[data-theme="light"] .bg-slate-900\/40,
html[data-theme="light"] .bg-slate-900\/50,
html[data-theme="light"] .bg-slate-900\/60 {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

html[data-theme="dark"] .rounded-2xl.bg-slate-900\/40 {
  box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 8px 32px rgba(0,0,0,.6);
}

html[data-theme="light"] .blog-card,
html[data-theme="light"] .rounded-2xl.border.border-slate-800\/60.bg-slate-900\/40 {
  border-color: rgba(15,23,42,.08) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,.05) !important;
}

html[data-theme="light"] #messageBox { background: #111827e6; color: #ffffff; }
html[data-theme="light"] .prose :where(a) { color: #1d4ed8; }
html[data-theme="dark"] .prose :where(a) { color: #93c5fd; }

@media (max-width: 767px) {
  #mobile-menu-button { position: relative; z-index: 70; }
  #mobile-menu-button .h-6, #mobile-menu-button .w-6 { width: 1.5rem; height: 1.5rem; }
  #mobile-menu-button.is-open #close-icon { color: #ef4444; }
  html[data-theme="dark"] #mobile-menu-button.is-open #close-icon { color: #f87171; }
  #mobile-menu-button.is-open #close-icon { transform: rotate(90deg); }
  #mobile-menu-button.is-open #hamburger-icon { transform: rotate(90deg); opacity: 0; }

  #mobile-menu[data-open] {
    backdrop-filter: blur(45px) saturate(220%);
    -webkit-backdrop-filter: blur(45px) saturate(220%);
    background: rgba(255,255,255,.65);
  }
  html[data-theme="dark"] #mobile-menu[data-open] {
    backdrop-filter: blur(45px) saturate(220%);
    -webkit-backdrop-filter: blur(45px) saturate(220%);
    background: rgba(15,23,42,.65);
  }

  html[data-theme="light"] #mobile-menu .menu a,
  html[data-theme="light"] #mobile-menu .menu a:link,
  html[data-theme="light"] #mobile-menu .menu a:visited {
    color: #0f172a !important;
    font-weight: 500;
    letter-spacing: .2px;
  }

  html[data-theme="light"] #mobile-menu .menu a:hover {
    background: rgba(0,0,0,.06);
    color: #2563eb !important;
  }

  html[data-theme="dark"] #mobile-menu .menu a {
    color: #f1f5f9 !important;
    font-weight: 500;
  }

  html[data-theme="dark"] #mobile-menu .menu a:hover {
    background: rgba(255,255,255,.08);
    color: #93c5fd !important;
  }

  #mobile-menu .menu > li + li { margin-top: .25rem; }
  #mobile-menu hr { border: none; height: 1px; margin: .5rem 0; background: rgba(0,0,0,.08); }
  html[data-theme="dark"] #mobile-menu hr { background: rgba(255,255,255,.08); }
}

#mobile-menu {
  position: absolute;
  top: var(--header-height, 60px);
  left: 0;
  width: 100%;
  background-color: var(--card);
  display: none;
  z-index: 9998;
}

#mobile-menu.open {
  display: block;
}

.theme-btn svg { pointer-events: none; }