:root {
  --bg: #f4f4f5;
  --ink: #111113;
  --ink-2: #3f3f46;
  --ink-3: #71717a;
  --line: rgba(17, 17, 19, 0.08);
  --cyan: #4fc3e0;
  --violet: #8a5cd0;
  --top: 60px; /* top bar height */
  --p: 0; /* scroll progress 0..1, set by the script */
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  color: var(--ink);
  background: var(--bg);
}
@supports (font-variation-settings: normal) {
  :root { font-family: "InterVariable", "Inter", system-ui, sans-serif; }
}

* { box-sizing: border-box; }
html { scroll-snap-type: y mandatory; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: inherit; text-decoration: none; }

/* Looping motion graphic behind everything */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.backdrop video { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }

/* Top bar */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  height: var(--top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.cx-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.04em;
}
.from { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-3); opacity: 0.8; transition: opacity 0.2s; }
.from:hover { opacity: 1; }
.from img { width: 62px; }

/* Pinned scroll stage */
.scenes { position: relative; height: calc(var(--n) * 100svh); }
.snap { position: absolute; top: calc(var(--i) * 100svh); height: 100svh; width: 1px; scroll-snap-align: start; }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }

.scene {
  position: absolute;
  inset: var(--top) 0 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4svh, 40px);
  padding: 0 20px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(28px) scale(0.98);
  /* Leaving: fade out quickly so it never overlaps the incoming scene */
  transition: opacity 0.22s ease, transform 0.3s ease, visibility 0s 0.22s;
}
.scene.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  /* Entering: start after the old scene is gone */
  transition: opacity 0.5s ease 0.22s, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.22s, visibility 0s;
}

/* Text: small, so the product leads */
.copy { position: relative; max-width: 600px; }
/* Soft light glow behind text so it reads over the video */
.copy::before {
  content: "";
  position: absolute;
  inset: -40px -80px;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(244, 244, 245, 0.92) 55%, rgba(244, 244, 245, 0));
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan), var(--violet)); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(138, 92, 208, 0.45); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(138, 92, 208, 0); }
}
h1, h2 { margin: 0; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -0.035em; font-weight: 700; }
.lede { margin: 10px auto 0; max-width: 32em; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.launch { margin: 16px 0 0; font-size: 13px; color: var(--ink-3); }
.launch strong { color: var(--ink); font-weight: 600; }

/* Product frames */
.window {
  overflow: hidden;
  background: #1b1b1d;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 30px 80px -20px rgba(17, 17, 19, 0.5), 0 8px 24px -8px rgba(17, 17, 19, 0.3);
}

/* Scene 1: wide shot centered, phones tucked behind its sides, cube on top */
.composite {
  --w: min(820px, 64vw, calc((100svh - var(--top) - 44px - 230px) * 1.6));
  position: relative;
  width: var(--w);
  margin-bottom: calc(var(--w) * 0.05);
}
.composite .wide { position: relative; z-index: 1; border-radius: calc(var(--w) * 0.018); }
.composite .phone { position: absolute; bottom: calc(var(--w) * -0.05); width: calc(var(--w) * 0.21); border-radius: calc(var(--w) * 0.02); }
.composite .left { left: calc(var(--w) * -0.2); transform: rotate(-4deg); }
.composite .right { right: calc(var(--w) * -0.2); transform: rotate(4deg); }
.composite .phone { z-index: 2; }
.glass.small {
  position: absolute;
  z-index: 3;
  top: calc(var(--w) * -0.12);
  right: calc(var(--w) * -0.08);
  width: calc(var(--w) * 0.18);
  filter: drop-shadow(0 20px 30px rgba(98, 70, 190, 0.3));
  animation: float 9s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(-3deg); }
}

/* Scene 2: two phones side by side */
.pair {
  --h: min(560px, calc(100svh - var(--top) - 44px - 200px));
  display: flex;
  gap: clamp(14px, 3vw, 32px);
}
.pair .phone { width: min(calc(var(--h) * 0.593), 42vw); border-radius: 20px; }
.pair .phone:first-child { transform: translateY(-14px); }

/* Scene 3: mini bar large */
.mini img { width: min(720px, 90vw); border-radius: 999px; box-shadow: 0 30px 60px -16px rgba(17, 17, 19, 0.55); }

/* Scene 4: glass cube turns as you scroll */
.glass.big {
  width: min(300px, 34svh, 60vw);
  filter: drop-shadow(0 30px 50px rgba(98, 70, 190, 0.35));
  transform: rotate(calc(var(--p) * 40deg - 20deg)) scale(calc(0.9 + var(--p) * 0.1));
}
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.pills li {
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)) padding-box,
    linear-gradient(90deg, var(--cyan), var(--violet)) border-box;
  font-size: 13px;
  font-weight: 600;
}

/* Scene dots, scroll hint, footer */
.dots {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  top: 50%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(-50%);
}
.dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 17, 19, 0.22);
  cursor: pointer;
  transition: height 0.3s, background 0.3s;
}
.dots button[aria-current] { height: 22px; background: var(--ink); }
.hint {
  position: absolute;
  left: max(20px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 1;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: opacity 0.4s;
  animation: nudge 2s ease-in-out infinite;
}
.hint::after { content: " ↓"; }
.scenes:not([data-scene="0"]) .hint { opacity: 0; }
@keyframes nudge { 50% { transform: translateY(3px); } }
.footer {
  position: absolute;
  inset: auto 0 0;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
}

/* Phones */
@media (max-width: 700px) {
  .topbar { --top: 54px; }
  .composite { --w: min(calc(100vw - 40px), calc((100svh - var(--top) - 44px - 250px) * 1.6)); margin-bottom: 0; }
  .composite .phone { display: none; }
  .glass.small { top: auto; bottom: calc(var(--w) * -0.2); right: -6px; width: calc(var(--w) * 0.26); }
  .pair .phone { border-radius: 14px; }
  .dots { right: 8px; gap: 8px; }
  .dots button { width: 6px; height: 6px; }
  .dots button[aria-current] { height: 18px; }
  .lede { font-size: 14px; }
  .from span { display: none; }
}
