/* Theme support for index2.html only. */
html[data-theme="dark"] {
  color-scheme: dark;
  --background: 228 12% 7%;
  --foreground: 220 13% 91%;
  --card: 228 11% 10%;
  --card-foreground: 220 13% 91%;
  --muted: 225 10% 13%;
  --muted-foreground: 215 16% 70%;
  --accent: 225 10% 15%;
  --accent-foreground: 220 13% 91%;
  --border: 225 9% 22%;
  --input: 225 9% 22%;
}

body,
header,
footer,
.service-card,
.glass-card,
.service-choice,
#theme-toggle {
  transition:
    background-color 0.25s ease,
    background-image 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

html[data-theme="dark"] body {
  background: radial-gradient(circle at top, #1b1c1f 0%, #0f1013 100%) fixed;
  color: #e5e7eb;
}

html[data-theme="dark"] header {
  background: rgba(0, 0, 0, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] header nav,
html[data-theme="dark"] #mobile-menu {
  color: #e5e7eb;
}

html[data-theme="dark"] header .text-slate-600,
html[data-theme="dark"] header .text-slate-700,
html[data-theme="dark"] #mobile-menu .text-slate-700 {
  color: #d1d5db !important;
}

html[data-theme="dark"] header .hover\:bg-slate-100:hover,
html[data-theme="dark"] #mobile-menu a:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] #mobile-menu-btn {
  background: rgba(20, 20, 25, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e5e7eb !important;
}

html[data-theme="dark"] .glass-card {
  background: rgba(20, 20, 25, 0.9);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .glass-card .text-slate-900,
html[data-theme="dark"] .service-choice .text-slate-900 {
  color: #f3f4f6 !important;
}

html[data-theme="dark"] .text-slate-600 {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .text-slate-500 {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .text-slate-300 {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .bg-blue-50 {
  background-color: rgba(59, 130, 246, 0.14) !important;
}

html[data-theme="dark"] .bg-orange-50 {
  background-color: rgba(249, 115, 22, 0.14) !important;
}

html[data-theme="dark"] .bg-violet-50 {
  background-color: rgba(139, 92, 246, 0.14) !important;
}

html[data-theme="dark"] .bg-emerald-50 {
  background-color: rgba(16, 185, 129, 0.14) !important;
}

html[data-theme="dark"] section[aria-label="Platform principles"] {
  background: rgba(15, 16, 19, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] #services {
  background-color: #0f1013;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

html[data-theme="dark"] #services .service-card {
  background: rgba(20, 20, 25, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .service-choice {
  background: rgba(20, 20, 25, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="dark"] .service-choice.border-primary {
  border-color: hsl(var(--primary)) !important;
  box-shadow: 0 0 0 1px hsl(var(--primary) / 0.28);
}

html[data-theme="dark"] #safety > .container > .relative {
  background: linear-gradient(135deg, #18191d 0%, #101114 55%, #1b1512 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] #safety .bg-white\/90 {
  background: rgba(20, 20, 25, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] section.bg-slate-100 {
  background: #111217 !important;
}

html[data-theme="dark"] footer {
  background: #0f1013 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] footer .text-slate-600,
html[data-theme="dark"] footer .text-slate-500 {
  color: #aeb5c0 !important;
}

html[data-theme="dark"] body > .safe-area-bottom {
  background: rgba(15, 16, 19, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] body > a[href="#main-content"] {
  background: #18191d !important;
  color: #f3f4f6 !important;
}

#theme-toggle {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 90;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  padding: 0.55rem 0.8rem 0.55rem 0.6rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(14px);
  cursor: grab;
  user-select: none;
  touch-action: none;
  -webkit-user-select: none;
}

#theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
}

#theme-toggle:focus-visible {
  outline: 3px solid hsl(var(--secondary) / 0.5);
  outline-offset: 3px;
}

#theme-toggle.is-dragging {
  cursor: grabbing;
  transform: none;
  transition: none;
  opacity: 0.96;
}

#theme-toggle .theme-toggle__grip {
  display: grid;
  grid-template-columns: repeat(2, 3px);
  gap: 3px;
  padding: 2px;
  opacity: 0.45;
}

#theme-toggle .theme-toggle__grip i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

#theme-toggle .theme-toggle__icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  align-items: center;
  justify-content: center;
}

#theme-toggle .theme-toggle__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

#theme-toggle .theme-toggle__label {
  min-width: 2.6rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

html[data-theme="dark"] #theme-toggle {
  background: rgba(20, 20, 25, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
}

@media (max-width: 767px) {
  #theme-toggle {
    top: auto !important;
    right: 0.75rem !important;
    bottom: 0.75rem !important;
    left: auto !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    justify-content: center;
    gap: 0 !important;
    overflow: hidden;
    padding: 0 !important;
    border-radius: 999px;
    touch-action: manipulation;
  }

  #theme-toggle .theme-toggle__grip,
  #theme-toggle .theme-toggle__label {
    display: none !important;
  }

  #theme-toggle .theme-toggle__icon,
  #theme-toggle .theme-toggle__icon svg {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  header,
  footer,
  .service-card,
  .glass-card,
  .service-choice,
  #theme-toggle {
    transition: none !important;
  }
}
