:root {
  --purple: #6754d0;
  --royal: #275fe3;
  --mid-blue: #5d87ea;
  --sky: #4cb8ff;
  --light: #94d4ff;
  --orange: #fc851a;
  --dark: #1a1a1a;
  --white: #ffffff;
  --muted: #b3b3b3;
}

* {
  box-sizing: border-box;
  user-select: none;
}

body {
  margin: 0;
  background: var(--dark);
  color: var(--white);
  font-family: 'Source Sans 3', 'Source Sans Pro', system-ui, sans-serif;
  overflow: hidden;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 80% 16%,
      rgba(76, 184, 255, 0.15),
      transparent 28%
    ),
    radial-gradient(
      circle at 14% 88%,
      rgba(39, 95, 227, 0.18),
      transparent 35%
    ),
    linear-gradient(135deg, #111117 0%, #1a1a1a 52%, #10131e 100%);
}

#stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.28;
  transition: transform 700ms ease, opacity 700ms ease;
}

.ambient-a {
  width: 30vw;
  height: 30vw;
  right: -10vw;
  top: -9vw;
  border: 2px solid rgba(76, 184, 255, 0.68);
}

.ambient-b {
  width: 36vw;
  height: 36vw;
  left: -16vw;
  bottom: -18vw;
  background: radial-gradient(circle, rgba(39, 95, 227, 0.38), transparent 64%);
}

.line {
  position: absolute;
  height: 2px;
  width: 54vw;
  background: linear-gradient(90deg, var(--royal), var(--sky), var(--light));
  opacity: 0.68;
  transform-origin: left center;
  transition: opacity 700ms ease;
}

.line-top {
  top: clamp(92px, 12vh, 132px);
  left: 0;
}

.line-bottom {
  right: 0;
  bottom: 7.8vh;
}

.brand {
  position: absolute;
  left: clamp(8px, 2vw, 40px);
  top: clamp(8px, 2vh, 28px);
  z-index: 14;
  width: clamp(210px, 22vw, 430px);
  display: flex;
  justify-content: flex-start;
}

.brand-wordmark {
  width: clamp(280px, 30vw, 560px);
  height: auto;
  transition: opacity 600ms ease;
}

/* Slides */
.slide {
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
  display: flex;
  flex-direction: column;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-copy {
  position: absolute;
  left: 8vw;
  top: clamp(120px, 18vh, 190px);
  width: calc(40% - 8vw);
  z-index: 8;
}

/* Hero & CTA centered layout */
#slide-hero .slide-copy,
#slide-cta .slide-copy {
  left: 50%;
  top: 50%;
  width: min(82vw, 1160px);
  max-width: 1160px;
  transform: translate(-50%, -50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Phase/Interfaces copy position */
#slide-phase .slide-copy,
#slide-interfaces .slide-copy {
  top: clamp(110px, 15vh, 170px);
}

#slide-interfaces .slide-copy {
  display: flex;
  flex-direction: column;
  bottom: clamp(44px, 7vh, 86px);
}

#slide-interfaces .phase-panel {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#slide-interfaces .phase-image-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#slide-interfaces .phase-image-wrap img {
  width: 100%;
  max-height: 100%;
  height: auto;
  display: block;
}

/* Phase panel */
.phase-panel {
  margin-top: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 500ms ease, height 400ms ease, margin 400ms ease;
}

.phase-panel img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 8px;
}

#slide-interfaces .phase-panel img {
  width: auto;
  height: 100%;
  object-fit: contain;
}

/* Interfaces panel */
.interfaces-panel {
  position: absolute;
  left: clamp(24px, 4vw, 78px);
  bottom: clamp(44px, 7vh, 86px);
  width: min(38vw, 690px);
  color: #ffffff;
}

/* Product shell */
.product-shell {
  position: absolute;
  z-index: 6;
  right: 4vw;
  top: clamp(118px, 15vh, 165px);
  width: calc(60% - 8vw);
  border-radius: 8px;
  background: rgba(248, 248, 248, 0.96);
  box-shadow:
    0 32px 100px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(148, 212, 255, 0.18);
  overflow: hidden;
  transform: perspective(1600px) rotateY(-1.5deg) rotateX(0.8deg);
  transition:
    opacity 600ms ease,
    transform 700ms ease,
    width 700ms ease,
    height 700ms ease;
}

#slide-interfaces .phase-panel {
  width: 100%;
  max-height: 100%;
  overflow: hidden;
}

#slide-interfaces .phase-image-wrap {
  overflow: hidden;
}

#slide-interfaces .phase-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  display: block;
  border-radious: 4px;
}

#slide-phase .product-shell,
#slide-interfaces .product-shell {
  width: calc(60% - 8vw);
}

.browser-bar {
  height: 38px;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid #e5e5e5;
}

.browser-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b3b3b3;
}

.asset-label {
  margin-left: 14px;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #666666;
}

.video-viewport {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  overflow: hidden;
  background: #ffffff;
}

.product-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: translate(var(--video-x, 0), var(--video-y, 0))
    scale(var(--video-scale, 1));
  transform-origin: center center;
  background: #ffffff;
  transition: transform 500ms ease, opacity 400ms ease;
}

/* Text elements */
.eyebrow {
  min-height: 1.4em;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: clamp(18px, 1.35vw, 26px);
  font-weight: 500;
  color: var(--sky);
  margin-bottom: 14px;
  opacity: 0;
}

h1 {
  font-family: Montserrat, system-ui, sans-serif;
  font-size: clamp(34px, 3.55vw, 68px);
  line-height: 1.06;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0;
  text-wrap: balance;
  opacity: 0;
}

#slide-hero h1,
#slide-cta h1 {
  font-size: clamp(54px, 6.2vw, 116px);
}

p {
  margin: 18px 0 0;
  font-size: clamp(18px, 1.35vw, 28px);
  line-height: 1.24;
  color: #e5e5e5;
  opacity: 0;
}

/* CTA lockup */
.cta-lockup {
  margin-top: 24px;
  text-align: center;
  font-family: Montserrat, system-ui, sans-serif;
  color: #ffffff;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, #4d24c6, #0099ff) 1;
}

.cta-lockup.animate {
  animation: fadeInUp 500ms ease 300ms forwards;
}

.cta-lockup div {
  font-size: clamp(22px, 2vw, 38px);
  font-weight: 400;
}

.cta-lockup strong {
  font-size: clamp(22px, 2vw, 38px);
  font-weight: 600;
  letter-spacing: 0;
}

/* Progress */
.progress {
  position: absolute;
  z-index: 20;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--royal), var(--sky), var(--light));
  transform-origin: left;
}

/* CTA slide background */
#slide-cta {
  background:
    radial-gradient(
      circle at 50% 45%,
      rgba(148, 212, 255, 0.2),
      transparent 32%
    ),
    linear-gradient(105deg, #4d24c6 0%, #275fe3 44%, #0099ff 100%);
}

/* Text animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Media queries */
@media (max-width: 1280px), (max-height: 760px) {
  .slide-copy {
    top: 15vh;
    width: calc(40% - 8vw);
  }

  .product-shell {
    min-width: 0;
    width: calc(60% - 8vw);
    right: 8vw;
    top: 15vh;
  }

  .phase-panel {
    width: 100%;
  }

  .interfaces-panel {
    width: 39vw;
    bottom: 5.5vh;
  }
}

@media (max-aspect-ratio: 4 / 3) {
  .product-shell {
    width: calc(60% - 14vw);
    right: 14vw;
    top: 20vh;
  }

  .slide-copy {
    top: 10vh;
    width: calc(40% - 14vw);
  }

  .phase-panel,
  .interfaces-panel {
    width: 100%;
  }
}
