/* Demo modal + mobile sticky CTA */

.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 6, 12, 0.82);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.demo-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.demo-modal__panel {
  width: min(920px, 100%);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(124, 151, 255, 0.35);
  background: var(--bg-elevated);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.55), var(--shadow-glow);
  overflow: hidden;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.demo-modal.is-open .demo-modal__panel {
  transform: scale(1) translateY(0);
}

.demo-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.demo-modal__header h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  margin: 0;
}

.demo-modal__close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.demo-modal__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.demo-modal__stage {
  position: relative;
  flex: 1;
  min-height: 280px;
  background: var(--bg-base);
}

.demo-modal__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.demo-modal__slide.is-active {
  opacity: 1;
  z-index: 1;
}

.demo-modal__slide img {
  max-width: 100%;
  max-height: 52vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.demo-modal__caption {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: rgba(7, 9, 15, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  white-space: nowrap;
}

.demo-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
}

.demo-modal__dots {
  display: flex;
  gap: 8px;
}

.demo-modal__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.demo-modal__dot.is-active {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transform: scale(1.15);
}

.demo-modal__nav {
  display: flex;
  gap: 8px;
}

.demo-modal__nav button {
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.demo-modal__nav button:hover {
  border-color: rgba(124, 151, 255, 0.4);
}

.demo-modal__video {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: var(--radius-sm);
}

/* Real product screenshots in device frames */
.device-shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  object-fit: cover;
  object-position: top center;
}

.device-frame--desktop .device-shot {
  max-height: 180px;
}

.device-frame--web .device-shot {
  max-height: 160px;
}

.device-frame--mobile .device-shot {
  max-height: 220px;
  width: 100%;
}

.hero-shot-frame .device-shot {
  max-height: none;
  width: 100%;
  border-radius: 0;
}

.hero-shot-frame {
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  /* Match capture aspect — avoid contain letterboxing that looks “half-shot”. */
  aspect-ratio: 16 / 9;
  max-height: min(520px, 52vw);
  background: #0a0c12;
}

.hero-shot-frame .device-shot--hero {
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  object-fit: cover;
  object-position: left top;
}

/* Mobile sticky CTA */
.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(7, 9, 15, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
  transform: translateY(100%);
  transition: transform 0.35s ease;
}

.mobile-cta-bar.is-visible {
  transform: translateY(0);
}

.mobile-cta-bar .container {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  padding: 0;
}

.mobile-cta-bar .btn {
  flex: 1;
  padding: 12px 16px;
}

@media (max-width: 960px) {
  .mobile-cta-bar {
    display: block;
  }

  body.has-mobile-cta {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-modal__slide {
    transition: none;
  }
}
