/* -------------------------------------------------------------------------- */
/* File: css/theme.css
   Purpose: Theme switcher (dark/light) + light mode overrides
*/
/* -------------------------------------------------------------------------- */

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background: var(--bg);
}

html[data-theme="dark"] .section-alt {
  background: var(--bg-2);
}

html[data-theme="dark"] .hero .grid {
  display: none;
}

html[data-theme="dark"] .hero .orb {
  opacity: 0.22;
}

html[data-theme="dark"] .mobile-nav-backdrop {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F7FF;
  --bg-2: #E7EEFF;
  --card: rgba(255, 255, 255, 0.86);
  --card-2: rgba(255, 255, 255, 0.72);
  --border: rgba(15, 23, 42, 0.14);
  --text: rgba(15, 23, 42, 0.92);
  --muted: rgba(15, 23, 42, 0.74);
  --muted-2: rgba(15, 23, 42, 0.58);
  --shadow: 0 18px 60px rgba(15, 23, 42, 0.16);
  --shadow-soft: 0 10px 34px rgba(15, 23, 42, 0.12);
}

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

html[data-theme="light"] .brand-logo-dark {
  display: block;
}

html[data-theme="light"] .brand-logo-light {
  display: none;
}

html[data-theme="light"] .section-alt {
  background: var(--bg-2);
}

html[data-theme="light"] .card {
  backdrop-filter: none;
}

html[data-theme="light"] .hero .grid {
  display: none;
}

html[data-theme="light"] .hero .orb {
  opacity: 0.22;
}

html[data-theme="light"] .site-header {
  background: rgba(244, 247, 255, 0.72);
  border-bottom-color: rgba(15, 23, 42, 0.10);
}

html[data-theme="light"] body.header-elevated .site-header {
  background: rgba(244, 247, 255, 0.92);
  border-bottom-color: rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .badge {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .btn-ghost {
  background: rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .menu-toggle {
  background: rgba(255, 255, 255, 0.90);
  border-color: rgba(15, 23, 42, 0.20);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(10px) saturate(1.12);
  -webkit-backdrop-filter: blur(10px) saturate(1.12);
}

html[data-theme="light"] .menu-toggle:hover {
  background: rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] .menu-toggle:active {
  background: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .mobile-nav-backdrop {
  background: rgba(8, 14, 30, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Header toggles aligned with .btn visual language */
.lang-toggle,
.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background:
    radial-gradient(120% 130% at 10% 0%, rgba(91, 141, 239, 0.55), rgba(91, 141, 239, 0.08)),
    radial-gradient(130% 130% at 90% 100%, rgba(168, 85, 247, 0.45), rgba(168, 85, 247, 0.08)),
    rgba(255, 255, 255, 0.06);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.25);
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease, border-color 140ms ease;
}

.lang-toggle:hover,
.theme-toggle:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.lang-toggle:active,
.theme-toggle:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.lang-toggle {
  width: 92px;
  height: 40px;
  position: relative;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
}

.lang-toggle .pill {
  width: 46px;
  text-align: center;
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
  z-index: 1;
  user-select: none;
}

.lang-toggle .thumb {
  position: absolute;
  left: 4px;
  top: 50%;
  width: 42px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 180ms ease;
  transform: translate(0, -50%);
}

html[data-lang="fr"] .lang-toggle .thumb {
  transform: translate(42px, -50%);
}

html[data-theme="light"] .lang-toggle .thumb {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(15, 23, 42, 0.18);
}

html[data-theme="light"] .lang-toggle .pill {
  color: rgba(15, 23, 42, 0.74);
}

html[data-theme="light"] .lang-toggle,
html[data-theme="light"] .theme-toggle {
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

/* Theme toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.theme-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 19px;
  height: 19px;
  margin: auto;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 180ms ease, transform 180ms ease;
}

.theme-icon-sun {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

.theme-icon-moon {
  fill: currentColor;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

html[data-theme="dark"] .theme-icon-sun {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

html[data-theme="dark"] .theme-icon-moon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

html[data-theme="dark"] .brand-logo-dark {
  display: none;
}

html[data-theme="dark"] .brand-logo-light {
  display: block;
}

html[data-theme="light"] .theme-icon-sun {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

html[data-theme="light"] .theme-icon-moon {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: 84px 1fr auto;
  }
}
