/* GothamDev — Appearance (dark / light) · orbe → menu */

html[data-theme="light"] {
  --bg-0: #f4f5f7;
  --bg-1: #ffffff;
  --bg-2: #eef0f3;
  --bg-3: #e4e7ec;
  --bg-card: rgba(15, 23, 42, 0.03);
  --border: rgba(15, 23, 42, 0.1);
  --border-md: rgba(15, 23, 42, 0.14);
  --border-lg: rgba(15, 23, 42, 0.2);
  --text-0: #0f172a;
  --text-1: #475569;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --accent: #16a34a;
  --accent-2: #15803d;
  --accent-dim: rgba(22, 163, 74, 0.12);
  --accent-glow: rgba(22, 163, 74, 0.22);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 28px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, 0.14);
  --shadow-xl: 0 32px 80px rgba(15, 23, 42, 0.18);
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html {
  transition: background-color 0.45s ease, color 0.45s ease;
}

/* ── Nav orb (1 icône) → popover Appearance ── */
.appearance-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-orb {
  appearance: none;
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(125, 255, 154, 0.55);
  background: #0a0a0b;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 0 0 0 rgba(125, 255, 154, 0);
}
.theme-orb:hover,
.appearance-nav.is-open .theme-orb {
  transform: scale(1.06);
  border-color: rgba(125, 255, 154, 0.9);
  box-shadow: 0 0 18px rgba(125, 255, 154, 0.35);
}
.theme-orb:focus-visible {
  outline: 2px solid #7dff9a;
  outline-offset: 3px;
}
.theme-orb__core {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8ffe4 0%, #7dff9a 38%, #16a34a 78%, #052e16 100%);
  box-shadow:
    0 0 10px rgba(125, 255, 154, 0.75),
    inset 0 1px 2px rgba(255, 255, 255, 0.35);
  transition: background 0.45s ease, box-shadow 0.45s ease;
}
html[data-theme="light"] .theme-orb {
  border-color: rgba(245, 158, 11, 0.55);
  background: #fff;
}
html[data-theme="light"] .theme-orb:hover,
html[data-theme="light"] .appearance-nav.is-open .theme-orb {
  border-color: rgba(245, 158, 11, 0.9);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.35);
}
html[data-theme="light"] .theme-orb__core {
  background: radial-gradient(circle at 35% 30%, #fff7c2 0%, #fbbf24 42%, #f59e0b 78%, #92400e 100%);
  box-shadow:
    0 0 10px rgba(251, 191, 36, 0.65),
    inset 0 1px 2px rgba(255, 255, 255, 0.45);
}

.appearance-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 80;
  width: min(280px, calc(100vw - 32px));
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: #14161c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  color: #f4f4f5;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.appearance-popover.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
html[data-theme="light"] .appearance-popover {
  background: #f7f8fa;
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
  color: #0f172a;
}

.appearance-popover__eyebrow {
  margin: 0 0 2px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #71717a;
}
html[data-theme="light"] .appearance-popover__eyebrow {
  color: #94a3b8;
}
.appearance-popover__title {
  margin: 0 0 14px;
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.appearance-popover__ghost {
  display: none;
}

.appearance-popover__previews {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  min-height: 72px;
}

.appearance-popover__pill {
  appearance: none;
  position: relative;
  width: 44px;
  height: 72px;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  flex: 0 0 auto;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease,
    max-width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.35s ease;
}

/* Solo : seule la pastille active est visible */
.appearance-popover__previews:not(.is-choosing) .appearance-popover__pill:not(.is-active) {
  max-width: 0;
  width: 0;
  margin: 0;
  opacity: 0;
  border-width: 0;
  pointer-events: none;
  transform: scale(0.7) translateX(-8px);
}
.appearance-popover__previews.is-choosing .appearance-popover__pill:not(.is-active) {
  max-width: 44px;
  width: 44px;
  opacity: 1;
  transform: none;
  animation: appearance-pill-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes appearance-pill-in {
  from {
    opacity: 0;
    transform: scale(0.75) translateX(-12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.appearance-popover__pill:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.32);
}
.appearance-popover__previews:not(.is-choosing) .appearance-popover__pill.is-active:hover {
  transform: translateY(-1px);
}
.appearance-popover__pill.is-active {
  border-color: #7dff9a;
  box-shadow:
    0 0 0 1px rgba(125, 255, 154, 0.35),
    0 0 16px rgba(125, 255, 154, 0.35);
}
.appearance-popover__pill:focus-visible {
  outline: 2px solid #7dff9a;
  outline-offset: 3px;
}
html[data-theme="light"] .appearance-popover__pill {
  border-color: rgba(15, 23, 42, 0.16);
}
html[data-theme="light"] .appearance-popover__pill:hover {
  border-color: rgba(15, 23, 42, 0.28);
}
html[data-theme="light"] .appearance-popover__pill.is-active {
  border-color: #16a34a;
  box-shadow:
    0 0 0 1px rgba(22, 163, 74, 0.25),
    0 0 14px rgba(22, 163, 74, 0.22);
}

.appearance-preview {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: inherit;
}
.appearance-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}
.appearance-preview__art {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}
.appearance-preview--light .appearance-preview__sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #e8f4ff 0%, #f7fbff 45%, #d6e8c8 100%);
}
.appearance-preview--light .appearance-preview__sun {
  position: absolute;
  top: 18%;
  right: 18%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7cc 0%, #fbbf24 55%, #f59e0b 100%);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.65);
}
.appearance-preview--light .appearance-preview__land {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background: linear-gradient(180deg, #a8c48a 0%, #8fb56e 100%);
  clip-path: ellipse(80% 70% at 50% 100%);
}
.appearance-preview--dark .appearance-preview__sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #070a10 0%, #0b1220 55%, #06140c 100%);
}
.appearance-preview--dark .appearance-preview__star {
  position: absolute;
  top: 34%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 10px 3px rgba(255, 255, 255, 0.85),
    0 0 22px 8px rgba(125, 255, 154, 0.45);
}
.appearance-preview--dark .appearance-preview__land {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background: linear-gradient(180deg, #0a1f14 0%, #07150e 100%);
  clip-path: ellipse(85% 75% at 50% 100%);
}

.appearance-popover__row {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: 10px;
  transition: background 0.2s ease;
}
.appearance-popover__row:hover {
  background: rgba(255, 255, 255, 0.04);
}
html[data-theme="light"] .appearance-popover__row:hover {
  background: rgba(15, 23, 42, 0.04);
}
.appearance-popover__dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8ffe4 0%, #7dff9a 40%, #16a34a 100%);
  box-shadow: 0 0 8px rgba(125, 255, 154, 0.45);
}
html[data-theme="light"] .appearance-popover__dot {
  background: radial-gradient(circle at 35% 30%, #fff7c2 0%, #fbbf24 45%, #f59e0b 100%);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}
.appearance-popover__mode {
  font-size: 0.92rem;
  font-weight: 650;
}
.appearance-popover__hint {
  font-size: 0.72rem;
  color: #71717a;
  white-space: nowrap;
}
html[data-theme="light"] .appearance-popover__hint {
  color: #94a3b8;
}

.theme-nav-toggle,
.appearance-section {
  display: none !important;
}

/* ── Light theme site surfaces (Mosa home) ── */
html[data-theme="light"] body.home-mosa,
html[data-theme="light"] body.site-mosa {
  background: var(--bg-0);
  color: var(--text-0);
}
html[data-theme="light"] :is(.home-mosa, .site-mosa) .mosa-nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] :is(.home-mosa, .site-mosa) .mosa-nav-pill {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.03);
}
html[data-theme="light"] :is(.home-mosa, .site-mosa) .mosa-nav-pill > a:not(.btn),
html[data-theme="light"] :is(.home-mosa, .site-mosa) .mosa-nav-pill .nav-dropdown-trigger {
  color: #475569;
}
html[data-theme="light"] :is(.home-mosa, .site-mosa) .mosa-nav-pill > a:not(.btn):hover,
html[data-theme="light"] :is(.home-mosa, .site-mosa) .mosa-nav-pill .nav-dropdown-trigger:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.05);
}
html[data-theme="light"] .mosa-section {
  background: var(--bg-0);
}
html[data-theme="light"] .mosa-section-head h2,
html[data-theme="light"] .mosa-bento-body h3,
html[data-theme="light"] .mosa-usecase-copy h3,
html[data-theme="light"] .mosa-step h3 {
  color: var(--text-0);
}
html[data-theme="light"] .mosa-section-head h2 em {
  color: #64748b;
  -webkit-text-fill-color: #64748b;
}
html[data-theme="light"] .mosa-label {
  color: #64748b;
}
html[data-theme="light"] .mosa-bento-card,
html[data-theme="light"] .mosa-usecase,
html[data-theme="light"] .mosa-step,
html[data-theme="light"] .mosa-benefit {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: var(--shadow-md);
}
html[data-theme="light"] .mosa-logos-strip,
html[data-theme="light"] .home-kpi-bar {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .mosa-logos-list a,
html[data-theme="light"] .home-kpi-label {
  color: #475569;
}
html[data-theme="light"] .home-kpi-val {
  color: #0f172a;
}
html[data-theme="light"] .mosa-hero-scrim--timed {
  background:
    linear-gradient(105deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 48%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 38%, rgba(0, 0, 0, 0.78) 100%);
}
html[data-theme="light"] .footer,
html[data-theme="light"] .site-footer,
html[data-theme="light"] footer.footer {
  background: #0f172a;
  color: #e2e8f0;
}

@media (prefers-reduced-motion: reduce) {
  .theme-orb,
  .appearance-popover,
  .appearance-popover__pill,
  html {
    transition: none !important;
    animation: none !important;
  }
}
