:root,
[data-theme="dark"] {
  --bg: #020617;
  --bg-elevated: #0f172a;
  --bg-card: #0b1220;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --nav-glass: rgba(0, 0, 0, 0.35);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --mbn-bg: rgba(2, 6, 23, 0.92);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: rgba(15, 23, 42, 0.1);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --nav-glass: rgba(255, 255, 255, 0.75);
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --mbn-bg: rgba(255, 255, 255, 0.94);
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  background: #020617;
}

html,
body {
  background-color: #020617;
}

body {
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Avoid white flash during navigations before theme CSS applies */
@media (prefers-color-scheme: light) {
  html:not([data-theme="light"]) {
    background: #020617;
  }
}

/* —— Hero Instagram-story slideshow —— */
.hero-story__progress {
  pointer-events: none;
  opacity: 0.45;
}

.hero-story__bar {
  flex: 1;
  height: 1.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.hero-story__bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.75);
  border-radius: inherit;
  transform-origin: left center;
}

.hero-story__bar.is-done .hero-story__bar-fill {
  width: 100%;
  transition: none;
}

.hero-story__bar.is-active .hero-story__bar-fill {
  animation: heroStoryFill var(--hero-story-duration, 5s) linear forwards;
}

.hero-story__bar.is-paused .hero-story__bar-fill {
  animation-play-state: paused;
}

@keyframes heroStoryFill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.hero-story__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.55s ease;
  pointer-events: none;
}

.hero-story__slide.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-story__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 5.2s ease-out;
}

.hero-story__slide.is-active img {
  transform: scale(1);
}

.hero-story__hit {
  position: absolute;
  top: 0;
  height: 55%;
  width: 28%;
  z-index: 15;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.hero-story__hit--prev {
  left: 0;
}

.hero-story__hit--next {
  right: 0;
}

@media (min-width: 768px) {
  .hero-story__hit {
    width: 18%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-story__bar.is-active .hero-story__bar-fill {
    animation: none;
    width: 100%;
  }
  .hero-story__slide,
  .hero-story__slide img {
    transition: none;
  }
}

/* Light theme remaps for Tailwind utility-heavy pages */
[data-theme="light"] body,
[data-theme="light"] .bg-slate-950,
[data-theme="light"] .bg-black {
  background-color: var(--bg) !important;
  color: var(--text);
}

[data-theme="light"] .bg-slate-900,
[data-theme="light"] .bg-slate-900\/50,
[data-theme="light"] .bg-\[\#0A0A0A\],
[data-theme="light"] .bg-\[\#050505\],
[data-theme="light"] .bg-\[\#050510\]\/80,
[data-theme="light"] .bg-\[\#050510\]\/90 {
  background-color: var(--bg-card) !important;
}

[data-theme="light"] .text-white,
[data-theme="light"] .text-white\/90 {
  color: #0f172a !important;
}

[data-theme="light"] .text-slate-400,
[data-theme="light"] .text-slate-500,
[data-theme="light"] .text-white\/70 {
  color: var(--text-muted) !important;
}

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

[data-theme="light"] .bg-white\/5,
[data-theme="light"] .bg-black\/20,
[data-theme="light"] .bg-black\/40,
[data-theme="light"] .hover\:bg-white\/5:hover,
[data-theme="light"] .hover\:bg-white\/10:hover {
  background-color: rgba(15, 23, 42, 0.04) !important;
}

[data-theme="light"] .bg-gradient-to-t.from-slate-950,
[data-theme="light"] .bg-gradient-to-t.from-black {
  --tw-gradient-from: #f4f7fb var(--tw-gradient-from-position);
}

/* Stable header chrome — no mount/scroll border flash */
.mt-nav-chip {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  transition: none;
}

.mt-nav-chip:hover {
  background: rgba(0, 0, 0, 0.62);
}

#nav-trigger-btn.is-open {
  background: #fff;
  color: #000;
  border-color: #fff;
}

[data-theme="light"] .mt-nav-chip {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.1);
  color: #0f172a;
}

[data-theme="light"] .mt-nav-chip:hover {
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] #nav-trigger-btn.is-open {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

[data-theme="light"] #smart-nav-root .mt-nav-chip a,
[data-theme="light"] #smart-nav-root .mt-nav-chip button {
  color: inherit;
}

[data-theme="light"] #nav-dropdown-card {
  background: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="light"] footer {
  background: #eef2f7 !important;
}

/* Hide scrollbar for carousels */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#nav-drawer-menu {
  transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Prevent hamburger menu flash on page load / JS inject */
#nav-dropdown-card {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translate3d(0, 8px, 0) scale(0.96) !important;
  transition: none !important;
}

#nav-dropdown-card.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
}

#nav-dropdown-card.nav-anim {
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s ease !important;
}

#site-header:empty {
  display: block;
  min-height: 0;
}

.backdrop-enter {
  opacity: 1;
  pointer-events: auto;
}

/* Page shells */
.page-hero {
  position: relative;
  padding: 7.5rem 1.25rem 3.5rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .page-hero {
    padding: 9rem 1.5rem 5rem;
  }
}

.page-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(2, 6, 23, 0.55),
    rgba(2, 6, 23, 0.92)
  );
  z-index: 1;
}

[data-theme="light"] .page-hero__overlay {
  background: linear-gradient(
    to bottom,
    rgba(244, 247, 251, 0.55),
    rgba(244, 247, 251, 0.95)
  );
}

.page-hero__content {
  position: relative;
  z-index: 2;
  max-width: 80rem;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.surface-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.filter-bar input,
.filter-bar select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  color: var(--text);
  padding: 0.7rem 0.9rem;
  font-size: 0.875rem;
  min-height: 44px;
}

[data-theme="light"] .filter-bar input,
[data-theme="light"] .filter-bar select {
  background: #fff;
}

.filter-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: transparent;
  min-height: 40px;
}

.filter-chip.active {
  background: var(--accent-soft);
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--accent);
}

/* Mobile bottom nav — priority UX */
.mobile-bottom-nav {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.15rem;
  padding: 0.55rem 0.35rem;
  border-radius: 1.35rem;
  background: var(--mbn-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.mbn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 48px;
  border-radius: 1rem;
  color: var(--text-muted);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: 0.2s ease;
}

.mbn-item.active,
.mbn-item:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none;
  }
}

/* Toasts */
.mt-toast-host {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(92vw, 360px);
  pointer-events: none;
}

.mt-toast {
  opacity: 0;
  transform: translateY(-8px);
  transition: 0.25s ease;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.mt-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.mt-toast--ok {
  border-color: rgba(52, 211, 153, 0.35);
}

.mt-toast--err {
  border-color: rgba(248, 113, 113, 0.4);
}

/* Forms */
.mt-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  color: var(--text);
  min-height: 48px;
  font-size: 0.95rem;
}

.mt-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.mt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.2s ease;
}

.mt-btn-primary {
  background: var(--accent);
  color: #fff;
}

.mt-btn-primary:hover {
  filter: brightness(1.08);
}

.mt-btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

/* Tables */
.mt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
}

.mt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.mt-table th,
.mt-table td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.mt-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Accordion */
.faq-item {
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--bg-card);
}

.faq-item button {
  width: 100%;
  text-align: left;
  padding: 1.1rem 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text);
  font-weight: 500;
}

.faq-item .faq-body {
  display: none;
  padding: 0 1.2rem 1.1rem;
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.6;
}

.faq-item.open .faq-body {
  display: block;
}

/* Portal */
.portal-shell {
  display: grid;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .portal-shell {
    grid-template-columns: 240px 1fr;
  }
}

.portal-side {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1rem;
  background: var(--bg-card);
  height: fit-content;
}

.portal-side a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.portal-side a.active,
.portal-side a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Stock ticker strip */
.ticker-strip {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 0.85rem 0;
  font-size: 0.8rem;
  border-block: 1px solid var(--border);
}

.mask-fade-right {
  mask-image: linear-gradient(90deg, #000 85%, transparent);
}

/* Checkout / apply steps */
.steps {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.step-pill {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.step-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.step-pill.done {
  color: #34d399;
}

/* Utility */
.pb-mobile-nav {
  padding-bottom: 6.5rem;
}

@media (min-width: 768px) {
  .pb-mobile-nav {
    padding-bottom: 0;
  }
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
