:root { color-scheme: dark light; }

body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; }

/* ==================== DARK MODE (default) ==================== */
html.dark body,
html:not(.light) body {
  background-color: rgb(2, 6, 23); /* slate-950 */
  color: rgb(248, 250, 252); /* slate-50 */
}

html.dark .glass,
html:not(.light) .glass {
  backdrop-filter: blur(14px);
  background: rgba(2, 6, 23, 0.55);
}

html.dark .hero-overlay,
html:not(.light) .hero-overlay {
  background: linear-gradient(180deg,
    rgba(2, 6, 23, 0.55) 0%,
    rgba(2, 6, 23, 0.78) 45%,
    rgba(2, 6, 23, 1) 100%
  );
}

/* ==================== LIGHT MODE ==================== */
html.light body {
  background-color: rgb(248, 250, 252); /* slate-50 */
  color: rgb(15, 23, 42); /* slate-900 */
}

html.light .glass {
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.75);
}

html.light .hero-overlay {
  background: linear-gradient(180deg,
    rgba(248, 250, 252, 0.55) 0%,
    rgba(248, 250, 252, 0.78) 45%,
    rgba(248, 250, 252, 1) 100%
  );
}

/* Light mode overrides for common elements */
html.light .bg-slate-950 { background-color: rgb(248, 250, 252) !important; }
html.light .bg-slate-900 { background-color: rgb(241, 245, 249) !important; }
html.light .text-slate-50 { color: rgb(15, 23, 42) !important; }
html.light .text-slate-100 { color: rgb(30, 41, 59) !important; }
html.light .text-slate-200 { color: rgb(51, 65, 85) !important; }
html.light .text-slate-300 { color: rgb(71, 85, 105) !important; }
html.light .text-slate-400 { color: rgb(100, 116, 139) !important; }
html.light .text-white { color: rgb(15, 23, 42) !important; }

/* Light mode borders and backgrounds */
html.light .border-white\/10 { border-color: rgba(15, 23, 42, 0.1) !important; }
html.light .border-white\/15 { border-color: rgba(15, 23, 42, 0.15) !important; }
html.light .border-white\/20 { border-color: rgba(15, 23, 42, 0.2) !important; }
html.light .bg-white\/5 { background-color: rgba(15, 23, 42, 0.03) !important; }
html.light .bg-white\/10 { background-color: rgba(15, 23, 42, 0.06) !important; }
html.light .bg-white\/15 { background-color: rgba(15, 23, 42, 0.1) !important; }
html.light .hover\:bg-white\/10:hover { background-color: rgba(15, 23, 42, 0.08) !important; }
html.light .hover\:bg-white\/15:hover { background-color: rgba(15, 23, 42, 0.12) !important; }

/* Light mode cards and panels */
html.light .bg-slate-900\/95 { background-color: rgba(255, 255, 255, 0.98) !important; }
html.light .bg-slate-950\/40 { background-color: rgba(241, 245, 249, 0.9) !important; }

/* Light mode inputs */
html.light input,
html.light select,
html.light textarea {
  background-color: rgb(255, 255, 255) !important;
  border-color: rgba(15, 23, 42, 0.2) !important;
  color: rgb(15, 23, 42) !important;
}

/* Light mode special colored elements */
html.light .bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1) !important; }
html.light .bg-amber-500\/10 { background-color: rgba(245, 158, 11, 0.1) !important; }
html.light .border-emerald-400\/20 { border-color: rgba(52, 211, 153, 0.25) !important; }
html.light .border-amber-400\/25 { border-color: rgba(251, 191, 36, 0.3) !important; }

/* Light mode hero text - keep white/light text over images for visibility */
html.light .hero-slide,
html.light .hero-slider {
  color: rgb(255, 255, 255) !important;
}

html.light .hero-slide h1,
html.light .hero-slide h2,
html.light .hero-slide p,
html.light .hero-slide .text-slate-100,
html.light .hero-slide .text-slate-200,
html.light .hero-slide .text-white,
html.light [class*="hero"] h1,
html.light [class*="hero"] h2,
html.light [class*="hero"] p {
  color: rgb(255, 255, 255) !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.5);
}

html.light .hero-slide .text-slate-300 {
  color: rgb(226, 232, 240) !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Ensure hero overlay provides enough contrast in light mode */
html.light .hero-overlay {
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.5) 45%,
    rgba(248, 250, 252, 1) 100%
  );
}

/* Light mode footer */
html.light footer {
  border-color: rgba(15, 23, 42, 0.1) !important;
}

/* ==================== SHARED STYLES ==================== */
/* Hero overlay must actually cover the image */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(2, 6, 23, 0.90) 0%,
    rgba(2, 6, 23, 0.62) 48%,
    rgba(2, 6, 23, 0.35) 100%
  ) !important;
}

/* Home hero slider sizing (scope to homepage slider only) */
.hero-slider { min-height: 72vh; }
.hero-slider .hero-slide {
  min-height: 72vh;
  display: flex;
  align-items: center;
}
@media (min-width: 768px) {
  .hero-slider { min-height: 78vh; }
  .hero-slider .hero-slide { min-height: 78vh; }
}

/* ====================
   HERO TEXT READABILITY (ALL PAGES / ALL THEMES)
   ==================== */
/*
  Heroes sit on busy imagery. Keep the hero text consistently readable
  regardless of light/dark theme.
*/
.hero,
.hero * {
  color: rgb(255, 255, 255) !important;
}

.hero h1,
.hero h2,
.hero p {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.55);
}

.hero .text-slate-300 { color: rgb(226, 232, 240) !important; }
.hero .text-slate-200 { color: rgb(226, 232, 240) !important; }

/* Swiper tweaks */
.swiper-pagination { bottom: 18px !important; }
.swiper-pagination-bullet { background: rgba(255,255,255,0.7); opacity: 0.55; }
.swiper-pagination-bullet-active { opacity: 1; }
.swiper-button-prev, .swiper-button-next { color: rgba(255,255,255,0.9); }
.swiper-button-prev:after, .swiper-button-next:after { font-size: 22px; }

html.light .swiper-pagination-bullet { background: rgba(0,0,0,0.5); }
html.light .swiper-button-prev, html.light .swiper-button-next { color: rgba(0,0,0,0.7); }

/* =============================
   FLOATING ISLAND NAVIGATION (CLEAN)
   Fixes: duplicate username, dropdown panel, pill height
   ============================= */

   .floating-nav-wrap {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    pointer-events: none;
  }
  
  .floating-nav {
    pointer-events: auto;
    margin: 0 auto;
    width: min(1120px, calc(100% - 28px));
    border-radius: 999px;
  
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  
    padding: 6px 12px;           /* reduced height */
    line-height: 1;              /* stop tall initial render */
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
  }
  
  /* Themes */
  html.light .floating-nav {
    background: rgba(255, 255, 255, 0.86);
    color: #020617;
  }
  
  html.dark .floating-nav,
  html:not(.light) .floating-nav {
    background: rgba(2, 6, 23, 0.72);
    color: #f8fafc;
  }
  
  /* Logo */
  .floating-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 999px;
  }
  
  /* Desktop links */
  .floating-links {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  /* Actions */
  .floating-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  /* Mobile menu trigger container */
  .floating-mobile {
    display: none; /* show only on small screens */
    align-items: center;
  }
  
  /* Shared link/button look inside island */
  .floating-link,
  .floating-pill,
  .floating-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  
    padding: 6px 10px;           /* consistent pill height */
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  
    transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  }
  
  /* Link colors */
  html.light .floating-link { color: #0f172a; }
  html.dark .floating-link,
  html:not(.light) .floating-link { color: #f8fafc; }
  
  /* Hover states */
  html.light .floating-link:hover,
  html.light .floating-pill:hover {
    background: rgba(2, 6, 23, 0.06);
  }
  
  html.dark .floating-link:hover,
  html.dark .floating-pill:hover,
  html:not(.light) .floating-link:hover,
  html:not(.light) .floating-pill:hover {
    background: rgba(255, 255, 255, 0.10);
  }
  
  /* Primary CTA */
  .floating-cta {
    background: rgba(52, 211, 153, 1);
    color: #052e16;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.20);
  }
  .floating-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(16, 185, 129, 0.26);
  }
  
  /* Details reset */
  .floating-nav details > summary {
    list-style: none;
  }
  .floating-nav details > summary::-webkit-details-marker {
    display: none;
  }
  
  /* Dropdown panel */
  .floating-menu {
    border-radius: 16px;
    overflow: hidden;
  
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    transform-origin: top right;
    animation: floatingMenuIn 120ms ease-out;
  }
  
  @keyframes floatingMenuIn {
    from { transform: translateY(-4px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
  }
  
  html.light .floating-menu {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(2, 6, 23, 0.10);
    color: #0f172a;
  }
  
  html.dark .floating-menu,
  html:not(.light) .floating-menu {
    background: rgba(2, 6, 23, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #f8fafc;
  }
  
  /* Dropdown items */
  .floating-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
  
    padding: 10px 12px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 10px;
  }
  
  html.light .floating-menu-item { color: #0f172a; }
  html.dark .floating-menu-item,
  html:not(.light) .floating-menu-item { color: #f8fafc; }
  
  html.light .floating-menu-item:hover {
    background: rgba(2, 6, 23, 0.06);
  }
  
  html.dark .floating-menu-item:hover,
  html:not(.light) .floating-menu-item:hover {
    background: rgba(255, 255, 255, 0.10);
  }
  
  .floating-divider {
    height: 1px;
    margin: 6px 10px;
  }
  
  html.light .floating-divider { background: rgba(2, 6, 23, 0.10); }
  html.dark .floating-divider,
  html:not(.light) .floating-divider { background: rgba(255, 255, 255, 0.10); }
  
  /* Shrink on scroll */
  .floating-nav.is-scrolled {
    transform: translateY(-3px) scale(0.97);
  }
  
  /* Spacer so content isn't hidden */
  .floating-nav-spacer {
    height: 25px; /* reduced to match smaller island */
  }
  
  /* RESPONSIVE:
     - Desktop: show links + actions, hide mobile
     - Mobile: hide links + actions, show mobile
  */
  @media (max-width: 768px) {
    .floating-links { display: none; }
    .floating-actions { display: none; }
    .floating-mobile { display: flex; }
  }
  
  /* Make sure dropdown overlays hero and doesn't get clipped */
  .floating-nav details {
    position: relative;
  }
  
  /* Theme toggle icons inside dropdown/buttons */
  .hidden { display: none !important; }
  