/* Light theme — Starexo */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background-color: #f9fafb;
  transition: opacity 0.45s ease;
}

body:not(.theme-loaded) {
  opacity: 0;
}

body.theme-loaded {
  opacity: 1;
}

/* Scroll-triggered fades */
.motion-reveal {
  opacity: 0;
  transform: translate3d(0, 1.15rem, 0);
  transition:
    opacity 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.motion-reveal.is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.motion-stagger-1 {
  transition-delay: 0.06s;
}

.motion-stagger-2 {
  transition-delay: 0.13s;
}

.motion-stagger-3 {
  transition-delay: 0.2s;
}

.motion-reveal.motion-soft-scale {
  transform: translate3d(0, 1.15rem, 0) scale(0.97);
}

.motion-reveal.motion-soft-scale.is-inview {
  transform: translate3d(0, 0, 0) scale(1);
}

/* Header */
.header-light {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (prefers-reduced-motion: no-preference) {
  .header-motion {
    opacity: 0;
    animation: motion-header-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.04s;
  }
}

@keyframes motion-header-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.nav-rail-scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.nav-rail-scroll::-webkit-scrollbar {
  display: none;
}

.nav-mobile-panel {
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .nav-mobile-panel {
    transition: none !important;
  }

  .motion-reveal {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .header-motion {
    opacity: 1 !important;
    animation: none !important;
  }
}

/* Cards & buttons — smoother hovers/focus */
.content-card {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.25s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .content-card:hover {
    transform: translateY(-2px);
    box-shadow:
      0 12px 28px rgba(15, 23, 42, 0.07),
      0 4px 8px rgba(15, 23, 42, 0.04);
  }
}

/* Hero soft radial depth */
.hero-light-radial {
  background-image:
    radial-gradient(ellipse 90% 70% at 50% -20%, rgba(37, 99, 235, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 20%, rgba(16, 185, 129, 0.1), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 60%, rgba(37, 99, 235, 0.08), transparent 45%);
}

/* Primary CTA — deep emerald */
.btn-primary {
  background-color: #10b981;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.25);
  transition:
    background-color 0.22s ease,
    box-shadow 0.28s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-primary:hover {
  background-color: #059669;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

@media (prefers-reduced-motion: no-preference) {
  .btn-primary:hover {
    transform: translateY(-1px);
  }

  .btn-primary:active {
    transform: translateY(0);
  }
}

/* Lucide inherits slate-600 from utility; fallback */
.icon-muted {
  color: #475569;
}

/* Nested live preview: hide phone mockup so iframe cannot recurse */
html.embed-preview .phone-demo-only {
  display: none !important;
}

html.embed-preview {
  overflow-x: hidden;
}

html.embed-preview body {
  overflow-x: hidden;
}

/* Hero phone mockup + scaled iframe (390×844 logical viewport) */
.phone-shell {
  position: relative;
  box-sizing: border-box;
  width: fit-content;
  max-width: none;
  border-radius: 2.75rem;
  padding: 0.55rem;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 45%, #020617 100%);
  box-shadow:
    0 25px 50px -12px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

@media (prefers-reduced-motion: no-preference) {
  .phone-shell {
    transition: box-shadow 0.65s ease;
  }

  .motion-reveal.is-inview .phone-shell {
    box-shadow:
      0 28px 55px -14px rgba(15, 23, 42, 0.5),
      0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  }
}

.phone-status {
  position: absolute;
  left: 50%;
  top: 0.55rem;
  z-index: 2;
  height: 1.6rem;
  width: 5.5rem;
  transform: translateX(-50%);
  border-radius: 0 0 1rem 1rem;
  background: #020617;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.phone-iframe-viewport {
  --phone-w: 272px;
  --doc-w: 390px;
  --doc-h: 844px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: var(--phone-w);
  height: calc(var(--doc-h) * var(--phone-w) / var(--doc-w));
  overflow: hidden;
  border-radius: 2.25rem;
  background: #f9fafb;
}

.phone-iframe {
  flex-shrink: 0;
  position: relative;
  width: var(--doc-w);
  height: var(--doc-h);
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  transform: scale(calc(var(--phone-w) / var(--doc-w)));
  transform-origin: top center;
}

/* Binance dashboard */
.dashboard-table-embed-static {
  display: none;
}

.dashboard-desc-embed {
  display: none;
}

.dashboard-demo-pill {
  display: none;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #eef2ff;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #3730a3;
}

html.embed-preview .dashboard-table-live {
  display: none !important;
}

html.embed-preview .dashboard-table-embed-static {
  display: block !important;
}

html.embed-preview .dashboard-desc-live {
  display: none !important;
}

html.embed-preview .dashboard-desc-embed {
  display: block !important;
}

html.embed-preview #dashboard-connection {
  display: none !important;
}

html.embed-preview .dashboard-demo-pill {
  display: inline-flex !important;
}

.dashboard-strip {
  background-image: linear-gradient(90deg, rgba(16, 185, 129, 0.06), rgba(37, 99, 235, 0.06));
}

.dashboard-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.dashboard-status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #94a3b8;
}

.dashboard-status--live::before {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.dashboard-status--live {
  color: #047857;
}

.dashboard-status--off::before {
  background: #f59e0b;
  animation: dashboard-pulse 1.25s ease-in-out infinite;
}

.dashboard-status--off {
  color: #475569;
}

@keyframes dashboard-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.dashboard-scroll {
  -webkit-overflow-scrolling: touch;
}
