/* ==========================================================================
   AquaSensei (أكوا سينسي) — Ultra-Luxury Dual-Theme Design System
   • Deep Ocean Moonlight Mode (default): #061018 -> #0A1926
   • Crystal Daylight Mode (html.theme-light): #F4F9FC -> #FFFFFF
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg-deep: #061018;
  --bg-mid: #081420;
  --bg-surface: #0a1926;
  --bg-card: rgba(10, 25, 38, 0.72);
  --bg-card-strong: rgba(10, 25, 38, 0.88);
  --bg-subcard: rgba(6, 16, 24, 0.56);
  --bg-input: rgba(6, 16, 24, 0.78);
  --bg-nav: rgba(6, 16, 24, 0.76);
  --bg-dock: rgba(6, 16, 24, 0.86);

  --border-subtle: rgba(45, 212, 191, 0.14);
  --border-glass: rgba(148, 163, 184, 0.14);
  --border-hover: rgba(45, 212, 191, 0.44);
  --specular-top: rgba(255, 255, 255, 0.08);

  --text-primary: #e2e8f0;
  --text-heading: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-teal: #2dd4bf;
  --accent-sky: #38bdf8;
  --accent-gold: #f59e0b;
  --accent-gold-soft: rgba(245, 158, 11, 0.16);

  --shadow-glass: 0 20px 54px -20px rgba(2, 8, 14, 0.72), inset 0 1px 0 var(--specular-top);
  --shadow-hover: 0 26px 64px -20px rgba(45, 212, 191, 0.18), 0 0 0 1px rgba(45, 212, 191, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --spotlight-color: rgba(45, 212, 191, 0.12);
  --caustic-a: rgba(45, 212, 191, 0.14);
  --caustic-b: rgba(56, 189, 248, 0.11);
  --caustic-c: rgba(245, 158, 11, 0.05);
}

html.theme-light {
  color-scheme: light;
  --bg-deep: #f4f9fc;
  --bg-mid: #edf5fa;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.84);
  --bg-card-strong: rgba(255, 255, 255, 0.96);
  --bg-subcard: rgba(241, 247, 252, 0.92);
  --bg-input: rgba(255, 255, 255, 0.98);
  --bg-nav: rgba(248, 252, 255, 0.84);
  --bg-dock: rgba(255, 255, 255, 0.90);

  --border-subtle: rgba(13, 148, 136, 0.18);
  --border-glass: rgba(2, 132, 199, 0.14);
  --border-hover: rgba(2, 132, 199, 0.42);
  --specular-top: rgba(255, 255, 255, 0.95);

  --text-primary: #1e293b;
  --text-heading: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;

  --accent-teal: #0d9488;
  --accent-sky: #0284c7;
  --accent-gold: #d97706;
  --accent-gold-soft: rgba(245, 158, 11, 0.14);

  --shadow-glass: 0 18px 46px -18px rgba(15, 23, 42, 0.09), 0 2px 8px -2px rgba(2, 132, 199, 0.06), inset 0 1px 0 var(--specular-top);
  --shadow-hover: 0 24px 56px -18px rgba(2, 132, 199, 0.18), 0 0 0 1px rgba(13, 148, 136, 0.25), inset 0 1px 0 #ffffff;
  --spotlight-color: rgba(2, 132, 199, 0.09);
  --caustic-a: rgba(2, 132, 199, 0.11);
  --caustic-b: rgba(13, 148, 136, 0.09);
  --caustic-c: rgba(125, 211, 252, 0.18);
}

/* Smooth cross-theme morph triggered momentarily on toggle */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition:
    background-color 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    fill 0.35s ease,
    stroke 0.35s ease !important;
}

/* Lenis smooth scroll base */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Cairo", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Deep Abyssal & Crystal Daylight Gradient Canvas */
.aquatic-glow {
  position: relative;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 85% 55% at 50% -10%, rgba(45, 212, 191, 0.16), transparent 62%),
    radial-gradient(ellipse 60% 45% at 88% 12%, rgba(56, 189, 248, 0.11), transparent 58%),
    linear-gradient(180deg, #061018 0%, #081521 48%, #0a1926 100%);
  background-attachment: fixed;
}

html.theme-light .aquatic-glow {
  background-color: #f4f9fc;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -8%, rgba(2, 132, 199, 0.10), transparent 60%),
    radial-gradient(ellipse 55% 45% at 14% 18%, rgba(13, 148, 136, 0.08), transparent 58%),
    linear-gradient(180deg, #f4f9fc 0%, #f8fcfe 45%, #ffffff 100%);
}

/* ==========================================================================
   Subtle Ambient Water Caustics (GPU-only, zero distraction)
   ========================================================================== */
.aqua-caustics {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.caustic-layer {
  position: absolute;
  border-radius: 9999px;
  filter: blur(72px);
  will-change: transform, opacity;
}

.caustic-1 {
  width: 62vw;
  height: 44vw;
  max-width: 860px;
  max-height: 600px;
  top: -16%;
  left: 18%;
  background: radial-gradient(circle at 40% 45%, var(--caustic-a), transparent 68%);
  animation: causticDriftA 22s ease-in-out infinite alternate;
}

.caustic-2 {
  width: 52vw;
  height: 40vw;
  max-width: 720px;
  max-height: 540px;
  top: 22%;
  right: -12%;
  background: radial-gradient(circle at 50% 50%, var(--caustic-b), transparent 68%);
  animation: causticDriftB 28s ease-in-out infinite alternate;
}

.caustic-3 {
  width: 48vw;
  height: 36vw;
  max-width: 680px;
  max-height: 480px;
  bottom: -14%;
  left: -8%;
  background: radial-gradient(circle at 50% 50%, var(--caustic-c), transparent 70%);
  animation: causticDriftC 32s ease-in-out infinite alternate;
}

/* Soft diagonal underwater light shafts */
.caustic-rays {
  position: absolute;
  inset: -10% -15%;
  background-image:
    repeating-linear-gradient(
      114deg,
      transparent 0%,
      transparent 8%,
      rgba(56, 189, 248, 0.032) 10%,
      transparent 13%
    ),
    repeating-linear-gradient(
      68deg,
      transparent 0%,
      transparent 11%,
      rgba(45, 212, 191, 0.025) 13%,
      transparent 16%
    );
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.25) 48%, transparent 80%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.25) 48%, transparent 80%);
  animation: raysSway 18s ease-in-out infinite alternate;
}

html.theme-light .caustic-rays {
  background-image:
    repeating-linear-gradient(
      114deg,
      transparent 0%,
      transparent 8%,
      rgba(2, 132, 199, 0.042) 10%,
      transparent 13%
    ),
    repeating-linear-gradient(
      68deg,
      transparent 0%,
      transparent 11%,
      rgba(13, 148, 136, 0.032) 13%,
      transparent 16%
    );
}

@keyframes causticDriftA {
  0% { transform: translate3d(-3%, 0%, 0) scale(1) rotate(0deg); opacity: 0.72; }
  50% { transform: translate3d(4%, 6%, 0) scale(1.08) rotate(6deg); opacity: 0.95; }
  100% { transform: translate3d(-2%, 3%, 0) scale(0.96) rotate(-4deg); opacity: 0.78; }
}
@keyframes causticDriftB {
  0% { transform: translate3d(0%, -4%, 0) scale(0.95); opacity: 0.65; }
  50% { transform: translate3d(-6%, 5%, 0) scale(1.1); opacity: 0.88; }
  100% { transform: translate3d(2%, 9%, 0) scale(1); opacity: 0.68; }
}
@keyframes causticDriftC {
  0% { transform: translate3d(0%, 2%, 0) scale(1); opacity: 0.55; }
  100% { transform: translate3d(7%, -5%, 0) scale(1.12); opacity: 0.8; }
}
@keyframes raysSway {
  0% { transform: translate3d(-1.5%, 0, 0) skewX(-1deg); }
  100% { transform: translate3d(1.5%, 1%, 0) skewX(1.5deg); }
}

/* Ensure real page surfaces sit above ambient caustics */
.aqua-content-layer {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Luxury Frosted Water-Glass Surfaces & Bento Interactive Spotlight
   ========================================================================== */
.water-nav {
  background: var(--bg-nav);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px -18px rgba(2, 8, 14, 0.45);
}

html.theme-light .water-nav {
  box-shadow: 0 8px 28px -16px rgba(15, 23, 42, 0.08);
}

.water-glass {
  background: var(--bg-card);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-glass);
  transition: border-color 0.28s ease, box-shadow 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.water-glass-strong {
  background: var(--bg-card-strong);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-glass);
}

.water-glass-hover {
  position: relative;
}

.water-glass-hover:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

/* Interactive cursor radial spotlight for Bento & Store cards */
.bento-spotlight {
  position: relative;
  overflow: hidden;
}
.bento-spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    var(--spotlight-color),
    transparent 65%
  );
  transition: opacity 0.3s ease;
}
.bento-spotlight:hover::after {
  opacity: 1;
}

.water-sub {
  background: var(--bg-subcard);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.water-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.water-input:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}
html.theme-light .water-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.16);
}
.water-input::placeholder {
  color: var(--text-muted);
}

/* ==========================================================================
   AI Specialist Centerpiece — Luminous Breathing Border Pulse
   ========================================================================== */
.ai-studio-shell {
  position: relative;
  border-radius: 1.75rem;
  padding: 1.5px;
  background: linear-gradient(
    135deg,
    rgba(45, 212, 191, 0.34),
    rgba(56, 189, 248, 0.16) 45%,
    rgba(245, 158, 11, 0.14) 75%,
    rgba(45, 212, 191, 0.32)
  );
  box-shadow:
    0 28px 80px -28px rgba(2, 12, 22, 0.82),
    0 0 42px -12px rgba(45, 212, 191, 0.18);
  transition: box-shadow 0.4s ease, transform 0.35s ease;
}

html.theme-light .ai-studio-shell {
  background: linear-gradient(
    135deg,
    rgba(2, 132, 199, 0.28),
    rgba(13, 148, 136, 0.20) 50%,
    rgba(125, 211, 252, 0.36)
  );
  box-shadow:
    0 28px 72px -28px rgba(2, 132, 199, 0.22),
    0 6px 20px -6px rgba(15, 23, 42, 0.06);
}

.ai-studio-shell.is-typing {
  box-shadow:
    0 28px 80px -24px rgba(2, 12, 22, 0.8),
    0 0 0 1px rgba(45, 212, 191, 0.35),
    0 0 48px -4px rgba(45, 212, 191, 0.32);
  animation: studioBreathe 2.8s ease-in-out infinite;
}

html.theme-light .ai-studio-shell.is-typing {
  box-shadow:
    0 26px 70px -24px rgba(2, 132, 199, 0.28),
    0 0 0 2px rgba(2, 132, 199, 0.22),
    0 0 40px -6px rgba(13, 148, 136, 0.24);
}

.ai-studio-shell.is-thinking {
  background-size: 260% 260%;
  background-image: linear-gradient(
    120deg,
    #2dd4bf,
    #38bdf8,
    #f59e0b,
    #2dd4bf
  );
  box-shadow:
    0 30px 90px -22px rgba(2, 12, 22, 0.85),
    0 0 60px -4px rgba(56, 189, 248, 0.42);
  animation: studioShimmer 2.2s linear infinite;
}

html.theme-light .ai-studio-shell.is-thinking {
  background-image: linear-gradient(
    120deg,
    #0284c7,
    #0d9488,
    #38bdf8,
    #0284c7
  );
  box-shadow:
    0 26px 72px -22px rgba(2, 132, 199, 0.34),
    0 0 44px -4px rgba(13, 148, 136, 0.30);
}

.ai-studio-inner {
  border-radius: calc(1.75rem - 1.5px);
  background: var(--bg-card-strong);
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
  overflow: hidden;
}

.studio-topbar {
  background: rgba(6, 16, 24, 0.54);
  border-bottom: 1px solid var(--border-subtle);
}
.studio-preview {
  background: rgba(6, 16, 24, 0.62);
  border-top: 1px solid var(--border-subtle);
}
.studio-chips {
  background: rgba(6, 16, 24, 0.36);
  border-top: 1px solid var(--border-subtle);
}
.studio-composer {
  background: rgba(10, 25, 38, 0.62);
  border-top: 1px solid var(--border-subtle);
}
html.theme-light .studio-topbar {
  background: #f2f8fc;
  border-bottom-color: rgba(2, 132, 199, 0.14);
}
html.theme-light .studio-preview {
  background: #edf5fb;
  border-top-color: rgba(2, 132, 199, 0.14);
}
html.theme-light .studio-chips {
  background: #f5fafd;
  border-top-color: rgba(2, 132, 199, 0.13);
}
html.theme-light .studio-composer {
  background: #eef6fb;
  border-top-color: rgba(2, 132, 199, 0.14);
}

/* Soft skeleton backdrop while lazy HD images decode */
.img-stage {
  background: linear-gradient(135deg, #0a1926 0%, #102a3d 50%, #0a1926 100%);
}
html.theme-light .img-stage {
  background: linear-gradient(135deg, #e2eef6 0%, #f1f7fb 50%, #e2eef6 100%);
}

@keyframes studioBreathe {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(45, 212, 191, 0)); }
  50% { filter: drop-shadow(0 0 18px rgba(45, 212, 191, 0.25)); }
}

@keyframes studioShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==========================================================================
   Luxury Animated Dual-Theme Toggle Pill
   ========================================================================== */
.theme-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 64px;
  height: 34px;
  padding: 3px;
  border-radius: 9999px;
  background: rgba(10, 25, 38, 0.85);
  border: 1px solid rgba(45, 212, 191, 0.28);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.theme-pill:hover {
  border-color: rgba(45, 212, 191, 0.6);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 14px rgba(45, 212, 191, 0.25);
}
html.theme-light .theme-pill {
  background: #e0f2fe;
  border-color: rgba(2, 132, 199, 0.34);
  box-shadow: inset 0 2px 6px rgba(2, 132, 199, 0.14);
}
html.theme-light .theme-pill:hover {
  border-color: rgba(2, 132, 199, 0.62);
  box-shadow: inset 0 2px 6px rgba(2, 132, 199, 0.12), 0 0 14px rgba(2, 132, 199, 0.2);
}

.theme-pill-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2dd4bf, #38bdf8);
  box-shadow: 0 2px 10px rgba(45, 212, 191, 0.5);
  transition: transform 0.38s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.35s ease, box-shadow 0.35s ease;
  pointer-events: none;
}
html.theme-light .theme-pill-thumb {
  transform: translateX(30px);
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.45);
}

.theme-pill-icon {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: color 0.3s ease, transform 0.35s ease;
}

/* ==========================================================================
   Luxury Buttons & Warm Golden Highlights (#F59E0B)
   ========================================================================== */
.btn-luxury-aqua {
  background: linear-gradient(135deg, #2dd4bf 0%, #0ea5e9 100%);
  color: #041019 !important;
  font-weight: 800;
  box-shadow: 0 10px 26px -10px rgba(45, 212, 191, 0.55);
  transition: transform 0.22s ease, box-shadow 0.25s ease, filter 0.22s ease;
}
.btn-luxury-aqua:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 14px 32px -10px rgba(56, 189, 248, 0.62);
}
html.theme-light .btn-luxury-aqua {
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  color: #ffffff !important;
  box-shadow: 0 10px 24px -10px rgba(2, 132, 199, 0.48);
}

.btn-luxury-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #061018 !important;
  font-weight: 800;
  box-shadow: 0 10px 26px -10px rgba(245, 158, 11, 0.48);
  transition: transform 0.22s ease, box-shadow 0.25s ease, filter 0.22s ease;
}
.btn-luxury-gold:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 32px -10px rgba(245, 158, 11, 0.6);
}

/* Media upload pills in AI composer */
.composer-media-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subcard);
  color: var(--text-primary);
  transition: transform 0.2s ease, border-color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
}
.composer-media-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent-teal);
  box-shadow: 0 8px 20px -10px rgba(45, 212, 191, 0.35);
}
.composer-media-btn.is-video:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 8px 20px -10px rgba(245, 158, 11, 0.35);
}

/* Interactive species card telemetry glide */
.species-card .species-telemetry {
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}
.species-card:hover .species-telemetry {
  transform: translateY(-2px);
}
.species-card .species-hover-cta {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.species-card:hover .species-hover-cta {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Glassmorphic Mobile Bottom Navigation Dock
   ========================================================================== */
.mobile-dock {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 45;
  padding: 0.5rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.mobile-dock-bar {
  pointer-events: auto;
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.2rem;
  padding: 0.38rem;
  border-radius: 1.35rem;
  background: var(--bg-dock);
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid var(--border-subtle);
  box-shadow:
    0 18px 46px -12px rgba(2, 8, 14, 0.72),
    inset 0 1px 0 var(--specular-top);
}

html.theme-light .mobile-dock-bar {
  box-shadow:
    0 16px 40px -12px rgba(15, 23, 42, 0.16),
    0 2px 10px rgba(2, 132, 199, 0.08),
    inset 0 1px 0 #ffffff;
}

.mobile-dock-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.45rem 0.2rem;
  border-radius: 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: color 0.22s ease, background-color 0.22s ease, border-color 0.22s ease, transform 0.2s ease;
}
.mobile-dock-item:active {
  transform: scale(0.95);
}
.mobile-dock-item.is-active {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.14);
  border-color: rgba(45, 212, 191, 0.28);
}
html.theme-light .mobile-dock-item.is-active {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.11);
  border-color: rgba(2, 132, 199, 0.26);
}

/* ==========================================================================
   Crystal Daylight High-Contrast Safety Overrides (Covers / and /admin)
   ========================================================================== */
html.theme-light .text-white { color: #0f172a !important; }
html.theme-light .text-slate-100,
html.theme-light .text-slate-200 { color: #0f172a !important; }
html.theme-light .text-slate-300 { color: #1e293b !important; }
html.theme-light .text-slate-400 { color: #334155 !important; }
html.theme-light .text-slate-500 { color: #475569 !important; }

html.theme-light .bg-navy-800,
html.theme-light .bg-navy-900,
html.theme-light .bg-navy-950,
html.theme-light .bg-navy-800\/60,
html.theme-light .bg-navy-800\/80,
html.theme-light .bg-navy-800\/40,
html.theme-light .bg-navy-900\/40,
html.theme-light .bg-navy-900\/50,
html.theme-light .bg-navy-900\/60,
html.theme-light .bg-navy-900\/70,
html.theme-light .bg-navy-900\/80,
html.theme-light .bg-navy-950\/30,
html.theme-light .bg-navy-950\/40,
html.theme-light .bg-navy-950\/45,
html.theme-light .bg-navy-950\/60 {
  background-color: rgba(241, 247, 252, 0.92) !important;
}

html.theme-light .hover\:bg-white\/5:hover {
  background-color: rgba(2, 132, 199, 0.08) !important;
}

html.theme-light .text-teal-300,
html.theme-light .text-teal-400 { color: #0d9488 !important; }
html.theme-light .text-sky-300,
html.theme-light .text-sky-400 { color: #0284c7 !important; }
html.theme-light .text-emerald-300,
html.theme-light .text-emerald-400 { color: #047857 !important; }
html.theme-light .text-amber-300,
html.theme-light .text-amber-400 { color: #b45309 !important; }
html.theme-light .text-red-400,
html.theme-light .text-red-300 { color: #be123c !important; }
html.theme-light .text-pink-400,
html.theme-light .text-pink-300 { color: #be185d !important; }
html.theme-light .text-blue-400,
html.theme-light .text-blue-300 { color: #1d4ed8 !important; }
html.theme-light .text-indigo-400 { color: #4338ca !important; }

/* Explicit dark-overlay text that MUST stay crisp white in both themes */
.keep-white,
html.theme-light .keep-white {
  color: #ffffff !important;
}
html.theme-light .keep-dark-pill {
  background-color: rgba(6, 16, 24, 0.78) !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}
html.theme-light .keep-gold-text {
  color: #fcd34d !important;
}
html.theme-light .keep-teal-overlay {
  color: #5eead4 !important;
}
html.theme-light .hero-title-gradient {
  background-image: linear-gradient(120deg, #0f172a 0%, #0d9488 48%, #0284c7 100%) !important;
}

/* ==========================================================================
   Animations & Indicators
   ========================================================================== */
@keyframes wavePulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.wave-pulse {
  animation: wavePulse 4.5s ease-in-out infinite;
}

@keyframes sonarRing {
  0% { transform: scale(0.85); opacity: 0.85; }
  100% { transform: scale(2.4); opacity: 0; }
}
.sonar-dot {
  position: relative;
  display: inline-flex;
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background: #10b981;
}
.sonar-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: #10b981;
  animation: sonarRing 2.1s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
}

@keyframes aquaWave {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.aqua-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-teal);
  display: inline-block;
  animation: aquaWave 1.2s infinite ease-in-out;
}
.aqua-dot:nth-child(2) { animation-delay: 0.16s; }
.aqua-dot:nth-child(3) { animation-delay: 0.32s; }

/* Semantic Badges (WCAG AA+ in both themes) */
.badge-teal {
  background: rgba(45, 212, 191, 0.14);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.34);
}
html.theme-light .badge-teal {
  background: #ccfbf1;
  color: #0f766e;
  border-color: #5eead4;
}

.badge-sky {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.32);
}
html.theme-light .badge-sky {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

.badge-amber,
.badge-gold {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.38);
}
html.theme-light .badge-amber,
html.theme-light .badge-gold {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}

.badge-rose {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.36);
}
html.theme-light .badge-rose {
  background: #ffe4e6;
  color: #9f1239;
  border-color: #fda4af;
}

/* Editorial Magazine Science Typography */
.magazine-lead {
  background:
    radial-gradient(circle at 90% 10%, rgba(45, 212, 191, 0.14), transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(56, 189, 248, 0.10), transparent 55%),
    var(--bg-card);
}
html.theme-light .magazine-lead {
  background:
    radial-gradient(circle at 90% 10%, rgba(13, 148, 136, 0.08), transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(2, 132, 199, 0.07), transparent 55%),
    rgba(255, 255, 255, 0.92);
}

/* Markdown Rendering inside Aquabot bubbles */
.aqua-prose h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-teal);
  margin: 0.75rem 0 0.3rem;
}
.aqua-prose h3:first-child { margin-top: 0; }
.aqua-prose p { margin: 0.35rem 0; line-height: 1.8; }
.aqua-prose ul, .aqua-prose ol { margin: 0.35rem 0 0.55rem; padding-inline-start: 1.35rem; }
.aqua-prose li { margin: 0.25rem 0; line-height: 1.7; }
.aqua-prose code {
  background: rgba(45, 212, 191, 0.14);
  color: var(--accent-teal);
  padding: 0.08rem 0.38rem;
  border-radius: 0.38rem;
  font-size: 0.86em;
}
html.theme-light .aqua-prose code {
  background: #e0f2fe;
  color: #0369a1;
}
.aqua-prose strong { font-weight: 800; }

/* Inline Lucide SVG sizing helper */
svg.lucide {
  stroke-width: 1.85;
  flex-shrink: 0;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(45, 212, 191, 0.55); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-teal); }
html.theme-light ::-webkit-scrollbar-thumb { background: rgba(2, 132, 199, 0.42); }
html.theme-light ::-webkit-scrollbar-thumb:hover { background: #0284c7; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .caustic-layer,
  .caustic-rays,
  .wave-pulse,
  .sonar-dot::before,
  .ai-studio-shell.is-typing,
  .ai-studio-shell.is-thinking,
  .aqua-dot {
    animation: none !important;
  }
  .water-glass-hover:hover {
    transform: none !important;
  }
}

[x-cloak] { display: none !important; }
