:root,
[data-theme="dark"] {
  --bg: #030303;
  --bg-elevated: #0a0a0a;
  --bg-panel: #0f110e;
  --bg-card: rgba(255, 255, 255, 0.02);
  --bg-muted: rgba(255, 255, 255, 0.05);
  --text: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  --border: rgba(255, 255, 255, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --brand: #38bdf8;
  --brand-soft: rgba(56, 189, 248, 0.15);
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --nav-bg: rgba(10, 10, 10, 0.85);
  --input-bg: rgba(255, 255, 255, 0.04);
  --overlay: rgba(0, 0, 0, 0.65);
  --bottom-nav-h: 68px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f6f8;
  --bg-elevated: #ffffff;
  --bg-panel: #ffffff;
  --bg-card: rgba(15, 23, 42, 0.03);
  --bg-muted: rgba(15, 23, 42, 0.06);
  --text: #0b1220;
  --text-secondary: rgba(11, 18, 32, 0.72);
  --text-muted: rgba(11, 18, 32, 0.45);
  --border: rgba(15, 23, 42, 0.12);
  --border-subtle: rgba(15, 23, 42, 0.06);
  --brand: #0284c7;
  --brand-soft: rgba(2, 132, 199, 0.12);
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.9);
  --input-bg: rgba(15, 23, 42, 0.04);
  --overlay: rgba(15, 23, 42, 0.45);
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--brand);
  color: #000;
}

.theme-surface {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.theme-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.theme-muted {
  color: var(--text-muted);
}

.theme-secondary {
  color: var(--text-secondary);
}

.theme-input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9999px;
  padding: 0.75rem 1rem;
  outline: none;
  width: 100%;
}

.theme-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Native <select>: closed field matches theme; open list stays readable on OS popup */
select.theme-input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 2.75rem;
  background-color: var(--input-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  color-scheme: dark;
}

/* Windows/Chrome paint the dropdown panel light — force dark text so options aren't invisible */
select.theme-input option,
select.theme-input optgroup {
  background-color: #ffffff;
  color: #0b1220;
}

[data-theme="light"] select.theme-input {
  color-scheme: light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.theme-btn-primary {
  background: var(--brand);
  color: #030303;
}

.theme-btn-primary:hover {
  filter: brightness(1.05);
}

.theme-btn-ghost {
  background: var(--bg-muted);
  color: var(--text);
  border-color: var(--border);
}

.theme-btn-ghost:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
}

/* ---- Light mode: readable surfaces & type ---- */
[data-theme="light"] .text-white {
  color: var(--text) !important;
}

[data-theme="light"] .text-white\/90,
[data-theme="light"] .opacity-90.text-white,
[data-theme="light"] span.text-white.opacity-90 {
  color: rgba(11, 18, 32, 0.92) !important;
}

[data-theme="light"] .text-white\/80,
[data-theme="light"] .text-white\/70,
[data-theme="light"] .text-slate-300 {
  color: rgba(11, 18, 32, 0.72) !important;
}

[data-theme="light"] .text-white\/60,
[data-theme="light"] .text-white\/50,
[data-theme="light"] .text-white\/40 {
  color: rgba(11, 18, 32, 0.55) !important;
}

[data-theme="light"] .text-white\/30,
[data-theme="light"] .text-white\/20 {
  color: rgba(11, 18, 32, 0.4) !important;
}

[data-theme="light"] .bg-\[\#030303\],
[data-theme="light"] .bg-\[\#050505\],
[data-theme="light"] .bg-\[\#0A0A0A\],
[data-theme="light"] .bg-\[\#080808\],
[data-theme="light"] .bg-\[\#0F110E\],
[data-theme="light"] .bg-\[\#0F0F0F\],
[data-theme="light"] .bg-black\/50,
[data-theme="light"] .bg-\[\#030303\]\/80,
[data-theme="light"] .bg-\[\#030303\]\/50 {
  background-color: var(--bg-elevated) !important;
}

[data-theme="light"] .border-white\/5,
[data-theme="light"] .border-white\/10 {
  border-color: var(--border) !important;
}

[data-theme="light"] .bg-white\/5,
[data-theme="light"] .bg-white\/10,
[data-theme="light"] .bg-white\/\[0\.02\],
[data-theme="light"] .bg-white\/\[0\.03\] {
  background-color: rgba(15, 23, 42, 0.06) !important;
}

[data-theme="light"] .text-brand-sky,
[data-theme="light"] .text-glow {
  color: var(--brand) !important;
}

/* Landing pill nav: keep contrast on light bg */
[data-theme="light"] nav.fixed.rounded-full {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] nav.fixed.rounded-full .text-white {
  color: #0b1220 !important;
}

[data-theme="light"] nav.fixed.rounded-full .text-white\/50,
[data-theme="light"] nav.fixed.rounded-full .text-white\/70 {
  color: rgba(11, 18, 32, 0.55) !important;
}

[data-theme="light"] nav.fixed.rounded-full a.bg-white {
  background: #0b1220 !important;
  color: #ffffff !important;
}

[data-theme="light"] nav.fixed.rounded-full a.bg-white:hover {
  background: var(--brand) !important;
  color: #030303 !important;
}

[data-theme="light"] nav.fixed.rounded-full [data-theme-toggle],
[data-theme="light"] nav.fixed.rounded-full [data-landing-menu] {
  background: rgba(15, 23, 42, 0.06) !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
  color: #0b1220 !important;
}

/* Hero secondary CTA */
[data-theme="light"] .hero-secondary-cta {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #0b1220 !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .hero-secondary-cta:hover {
  background: rgba(2, 132, 199, 0.1) !important;
  color: var(--brand) !important;
}

/* Shiny CTA readable on light backgrounds */
[data-theme="light"] .shiny-cta {
  color: #0b1220;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(
      from calc(var(--gradient-angle) - var(--gradient-angle-offset)),
      transparent 0%,
      #0ea5e9 5%,
      var(--gradient-shine) 15%,
      #0ea5e9 30%,
      transparent 40%,
      transparent 100%
    )
    border-box;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .shiny-cta::after {
  opacity: 0.35;
}

[data-theme="light"] .site-header {
  background: var(--nav-bg);
  border-color: var(--border);
}

[data-theme="light"] .site-header .logo,
[data-theme="light"] .site-header nav a {
  color: var(--text);
}

[data-theme="light"] .icon-btn {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0b1220;
}

[data-theme="light"] .theme-btn-primary {
  color: #ffffff;
}

[data-theme="light"] .grid-bg {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.06) 1px, transparent 1px);
}

/* Keep hero readable: mute dark Unicorn layer in light mode */
[data-theme="light"] .aura-background-component {
  opacity: 0.18;
  mix-blend-mode: multiply;
}

[data-theme="light"] main .text-white.opacity-90,
[data-theme="light"] h1 .text-white {
  color: #0b1220 !important;
  opacity: 1 !important;
}

[data-theme="light"] main p.text-white\/70,
[data-theme="light"] main .text-white\/70 {
  color: rgba(11, 18, 32, 0.72) !important;
}

[data-theme="light"] main .text-white\/40 {
  color: rgba(11, 18, 32, 0.5) !important;
}
