:root {
  color-scheme: light;
  --ink: #17233f;
  --muted: #596a88;
  --purple: #642ab1;
  --blue: #bdeaff;
  --paper: rgba(255, 255, 255, 0.80);
  --edge: rgba(255, 255, 255, 0.82);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html {
  background:
    radial-gradient(ellipse at 16% 12%, rgba(190, 232, 255, 0.95), transparent 38%),
    radial-gradient(ellipse at 86% 82%, rgba(226, 213, 255, 0.64), transparent 36%),
    linear-gradient(145deg, #f6fcff, #eaf7ff 56%, #f8f5ff);
}

body {
  margin: 0;
  min-width: 320px;
  position: fixed;
  inset: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 16% 12%, rgba(190, 232, 255, 0.95), transparent 38%),
    radial-gradient(ellipse at 86% 82%, rgba(226, 213, 255, 0.64), transparent 36%),
    linear-gradient(145deg, #f6fcff, #eaf7ff 56%, #f8f5ff);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  background: rgba(23, 35, 63, 0.035);
  pointer-events: none;
}

.stage {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  isolation: isolate;
}

.transition-card {
  width: min(100%, 560px);
  min-width: 0;
  max-height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  align-items: center;
  justify-items: center;
  column-gap: 0;
  row-gap: clamp(8px, 1.8svh, 14px);
  padding: clamp(16px, 4vw, 38px);
  border: 1px solid var(--edge);
  border-radius: 32px;
  background: var(--paper);
  box-shadow: 0 22px 70px rgba(77, 107, 154, 0.12), inset 0 1px 0 #fff;
}

h1 {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  max-width: 590px;
  min-width: 0;
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 760;
  line-height: 1.18;
  letter-spacing: -0.045em;
  text-align: center;
  text-wrap: balance;
}

.brand-logo {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: center;
  width: 74px;
  height: 74px;
  display: block;
  object-fit: contain;
  border-radius: 19px;
  filter: drop-shadow(0 7px 12px rgba(49, 104, 157, 0.14));
}

.primary-action {
  grid-column: 1;
  grid-row: 4;
  justify-self: center;
  min-height: 44px;
  width: min(100%, 230px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px;
  color: #fff;
  background: linear-gradient(105deg, #6126ad, #8241c8);
  border: 1px solid rgba(78, 30, 146, 0.22);
  border-radius: 17px;
  box-shadow: 0 9px 22px rgba(97, 38, 173, 0.2);
  font: inherit;
  font-size: 15px;
  font-weight: 720;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.primary-action svg { width: 20px; height: 20px; flex: 0 0 auto; }

.primary-action:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 0 13px 26px rgba(97, 38, 173, 0.26);
}

.primary-action:active { transform: translateY(0) scale(0.985); }

.primary-action:focus-visible,
.qr-link:focus-visible {
  outline: 3px solid #1f5d92;
  outline-offset: 4px;
}

.qr-link {
  grid-column: 1;
  grid-row: 3;
  width: min(clamp(220px, 34vw, 292px), 38svh);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 9px;
  overflow: hidden;
  border: 1px solid #dce9f1;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(75, 105, 143, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.qr-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(75, 105, 143, 0.13);
}

.qr-image { display: block; width: 100%; height: 100%; object-fit: contain; }

.scene {
  position: fixed;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.device {
  position: absolute;
  display: block;
  width: var(--size, 150px);
  height: auto;
  opacity: 1;
  filter: drop-shadow(0 16px 18px rgba(18, 32, 55, 0.24)) saturate(1.02) contrast(1.04);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  animation: float-around var(--duration, 42s) ease-in-out var(--delay, 0s) infinite;
  will-change: transform, opacity, filter;
}

.device--1 { --size: 184px; --duration: 39s; --delay: -14s; --tilt: -9deg; --rx: -5deg; --ry: 7deg; --x1: 17px; --y1: -18px; --x2: -11px; --y2: 12px; --x3: 36px; --y3: 31px; top: 6%; left: 4%; }
.device--2 { --size: 150px; --duration: 46s; --delay: -7s; --tilt: 8deg; --rx: 6deg; --ry: -5deg; --x1: -12px; --y1: -15px; --x2: 16px; --y2: 13px; --x3: -34px; --y3: 28px; top: 5%; right: 14%; }
.device--3 { --size: 124px; --duration: 52s; --delay: -29s; --tilt: 11deg; --rx: -4deg; --ry: 8deg; --x1: 15px; --y1: 14px; --x2: -13px; --y2: -17px; --x3: 29px; --y3: -35px; top: 17%; right: 3%; }
.device--4 { --size: 166px; --duration: 43s; --delay: -11s; --tilt: -7deg; --rx: 7deg; --ry: 5deg; --x1: -18px; --y1: 15px; --x2: 12px; --y2: -14px; --x3: -38px; --y3: -26px; top: 37%; left: 4%; }
.device--5 { --size: 180px; --duration: 48s; --delay: -34s; --tilt: -12deg; --rx: -6deg; --ry: -7deg; --x1: 12px; --y1: -17px; --x2: -15px; --y2: 14px; --x3: 41px; --y3: 24px; top: 39%; right: 7%; }
.device--6 { --size: 130px; --duration: 36s; --delay: -19s; --tilt: 7deg; --rx: 5deg; --ry: 6deg; --x1: -15px; --y1: -13px; --x2: 11px; --y2: 17px; --x3: -26px; --y3: -39px; top: 53%; right: 31%; }
.device--7 { --size: 150px; --duration: 54s; --delay: -23s; --tilt: 12deg; --rx: -7deg; --ry: 4deg; --x1: 14px; --y1: 18px; --x2: -13px; --y2: -13px; --x3: 31px; --y3: -34px; top: 62%; left: 5%; }
.device--8 { --size: 164px; --duration: 41s; --delay: -3s; --tilt: -6deg; --rx: 6deg; --ry: -6deg; --x1: -12px; --y1: -16px; --x2: 17px; --y2: 12px; --x3: -37px; --y3: 23px; bottom: 5%; right: 27%; }
.device--9 { --size: 184px; --duration: 50s; --delay: -37s; --tilt: 10deg; --rx: -5deg; --ry: 7deg; --x1: 16px; --y1: 13px; --x2: -14px; --y2: -18px; --x3: 34px; --y3: 36px; top: 59%; right: 4%; }
.device--10 { --size: 126px; --duration: 44s; --delay: -26s; --tilt: -10deg; --rx: 7deg; --ry: -5deg; --x1: -13px; --y1: 16px; --x2: 12px; --y2: -14px; --x3: -27px; --y3: -32px; bottom: 5%; left: 20%; }

.scene.is-paused .device,
.scene.is-paused .logo-float { animation-play-state: paused; }

.logo-float {
  position: absolute;
  display: block;
  width: var(--logo-size, 48px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 23%;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.72),
    inset 0 -4px 0 rgba(37, 39, 86, 0.18),
    0 7px 0 rgba(37, 39, 86, 0.1),
    0 18px 24px rgba(49, 83, 131, 0.2);
  transform-style: preserve-3d;
  opacity: var(--logo-opacity, 0.34);
  animation: logo-drift var(--logo-duration, 18s) ease-in-out var(--logo-delay, 0s) infinite;
  will-change: transform, filter, opacity;
}

.logo-float--1 { --logo-size: 90px; --logo-duration: 22s; --logo-delay: -11s; --logo-opacity: .42; --rx: 20deg; --ry: -27deg; --rz: -8deg; --lx: 24px; --ly: -20px; top: 3%; left: 48%; }
.logo-float--2 { --logo-size: 70px; --logo-duration: 17s; --logo-delay: -5s; --logo-opacity: .46; --rx: -19deg; --ry: 24deg; --rz: 11deg; --lx: -22px; --ly: 24px; top: 22%; left: 11%; }
.logo-float--3 { --logo-size: 62px; --logo-duration: 25s; --logo-delay: -16s; --logo-opacity: .4; --rx: 24deg; --ry: 19deg; --rz: -12deg; --lx: 19px; --ly: 22px; top: 14%; right: 35%; }
.logo-float--4 { --logo-size: 84px; --logo-duration: 19s; --logo-delay: -8s; --logo-opacity: .44; --rx: -23deg; --ry: -19deg; --rz: 7deg; --lx: -25px; --ly: -22px; top: 36%; right: 25%; }
.logo-float--5 { --logo-size: 75px; --logo-duration: 26s; --logo-delay: -19s; --logo-opacity: .4; --rx: 22deg; --ry: 26deg; --rz: -9deg; --lx: 23px; --ly: -23px; top: 46%; left: 3%; }
.logo-float--6 { --logo-size: 66px; --logo-duration: 16s; --logo-delay: -4s; --logo-opacity: .44; --rx: -25deg; --ry: 18deg; --rz: 13deg; --lx: -22px; --ly: 21px; top: 63%; left: 31%; }
.logo-float--7 { --logo-size: 86px; --logo-duration: 24s; --logo-delay: -13s; --logo-opacity: .4; --rx: 19deg; --ry: -24deg; --rz: 6deg; --lx: 25px; --ly: 22px; top: 57%; right: 5%; }
.logo-float--8 { --logo-size: 72px; --logo-duration: 18s; --logo-delay: -7s; --logo-opacity: .43; --rx: 24deg; --ry: 22deg; --rz: -11deg; --lx: -23px; --ly: -21px; bottom: 17%; left: 53%; }
.logo-float--9 { --logo-size: 92px; --logo-duration: 27s; --logo-delay: -21s; --logo-opacity: .4; --rx: -21deg; --ry: -26deg; --rz: 8deg; --lx: 22px; --ly: -24px; bottom: 6%; right: 42%; }
.logo-float--10 { --logo-size: 66px; --logo-duration: 20s; --logo-delay: -10s; --logo-opacity: .45; --rx: 23deg; --ry: 24deg; --rz: 10deg; --lx: -20px; --ly: 23px; bottom: 3%; left: 15%; }

@keyframes float-around {
  0%, 100% {
    transform: perspective(850px) translate3d(0, 0, 0) rotateX(var(--rx, 4deg)) rotateY(var(--ry, -5deg)) rotateZ(var(--tilt)) scale(0.96);
    filter: drop-shadow(0 16px 18px rgba(18, 32, 55, 0.24)) saturate(1.02) contrast(1.04);
  }
  27% {
    transform: perspective(850px) translate3d(var(--x1), var(--y1), 12px) rotateX(calc(var(--rx, 4deg) + 4deg)) rotateY(calc(var(--ry, -5deg) - 4deg)) rotateZ(calc(var(--tilt) + 3deg)) scale(1.06);
    filter: drop-shadow(0 20px 22px rgba(18, 32, 55, 0.28)) saturate(1.06) contrast(1.07);
  }
  61% {
    transform: perspective(850px) translate3d(var(--x2), var(--y2), -8px) rotateX(calc(var(--rx, 4deg) - 3deg)) rotateY(calc(var(--ry, -5deg) + 4deg)) rotateZ(calc(var(--tilt) - 2deg)) scale(0.98);
    filter: drop-shadow(0 13px 16px rgba(18, 32, 55, 0.22)) saturate(0.98) contrast(1.04);
  }
  82% {
    transform: perspective(850px) translate3d(var(--x1), var(--y2), 9px) rotateX(calc(var(--rx, 4deg) + 2deg)) rotateY(calc(var(--ry, -5deg) - 3deg)) rotateZ(calc(var(--tilt) + 1deg)) scale(1.07);
    filter: drop-shadow(0 21px 24px rgba(18, 32, 55, 0.28)) saturate(1.06) contrast(1.07);
  }
}

@keyframes logo-drift {
  0%, 100% {
    transform: perspective(700px) translate3d(0, 0, 0) rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz)) scale(0.88);
    opacity: var(--logo-opacity, 0.42);
    filter: saturate(0.94) contrast(1.04);
  }
  30% {
    transform: perspective(700px) translate3d(var(--lx), var(--ly), 10px) rotateX(calc(var(--rx) + 7deg)) rotateY(calc(var(--ry) - 8deg)) rotateZ(calc(var(--rz) + 4deg)) scale(1.08);
    opacity: calc(var(--logo-opacity, 0.42) + 0.16);
    filter: saturate(1) contrast(1.06);
  }
  67% {
    transform: perspective(700px) translate3d(var(--lx), var(--ly), -8px) rotateX(calc(var(--rx) - 6deg)) rotateY(calc(var(--ry) + 9deg)) rotateZ(calc(var(--rz) - 3deg)) scale(0.93);
    opacity: calc(var(--logo-opacity, 0.42) + 0.08);
    filter: saturate(0.94) contrast(1.04);
  }
}

@media (max-width: 620px) {
  .stage {
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  }

  .transition-card {
    width: calc(100vw - 32px);
    max-width: 430px;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    justify-items: center;
    gap: 12px;
    padding: 22px 18px;
    border-radius: 28px;
  }

  h1 {
    grid-column: 1;
    grid-row: 2;
    max-width: 380px;
    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: clamp(19px, 5.4vw, 24px);
    line-height: 1.2;
  }

  .desktop-break { display: none; }

  .brand-logo {
    grid-column: 1;
    grid-row: 1;
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .primary-action {
    grid-column: 1;
    grid-row: 4;
    width: min(100%, 230px);
    min-height: 48px;
    border-radius: 15px;
    font-size: 15px;
  }

  .qr-link {
    grid-column: 1;
    grid-row: 3;
    width: clamp(200px, 54vw, 238px);
    padding: 7px;
    border-radius: 20px;
  }

  .device {
    width: min(var(--size, 130px), 33vw);
    filter: drop-shadow(0 12px 14px rgba(18, 32, 55, 0.24)) saturate(1.02) contrast(1.04);
  }

  .device--1 { --size: 134px; top: 3%; left: -30px; }
  .device--2 { --size: 116px; top: 4%; right: -24px; }
  .device--3 { --size: 104px; top: 21%; left: -28px; }
  .device--4 { --size: 126px; top: 31%; right: -32px; }
  .device--5 { --size: 134px; top: 47%; right: -31px; }
  .device--6 { --size: 110px; top: 48%; left: -26px; }
  .device--7 { --size: 116px; bottom: 28%; right: -28px; }
  .device--8 { --size: 128px; bottom: 17%; left: -28px; }
  .device--9 { --size: 136px; top: 62%; right: -30px; }
  .device--10 { --size: 106px; bottom: 5%; right: -25px; }

  .logo-float { --logo-opacity: 0.42; width: min(var(--logo-size, 54px), 17vw); }
  .logo-float--1 { --logo-size: 58px; top: 3%; left: 54%; }
  .logo-float--2 { --logo-size: 54px; top: 10%; left: 5%; }
  .logo-float--3 { --logo-size: 56px; top: 9%; right: 5%; }
  .logo-float--4 { --logo-size: 56px; top: 37%; right: 1%; }
  .logo-float--5 { --logo-size: 52px; top: 45%; left: 1%; }
  .logo-float--6 { --logo-size: 52px; top: 60%; left: 1%; }
  .logo-float--7 { --logo-size: 56px; top: 58%; right: 1%; }
  .logo-float--8 { --logo-size: 54px; bottom: 16%; left: 48%; }
  .logo-float--9 { --logo-size: 58px; bottom: 5%; right: 38%; }
  .logo-float--10 { --logo-size: 52px; bottom: 6%; left: 7%; }
}

@media (max-width: 360px) {
  .transition-card { padding: 16px 15px; }
  h1 { font-size: 19px; }
  .qr-link { width: min(200px, 29svh); }
}

@media (max-height: 680px) and (min-width: 621px) {
  .stage { padding-top: 12px; padding-bottom: 12px; }
  .transition-card { padding: 22px 30px; row-gap: 10px; }
  .qr-link { width: 250px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .device { transform: rotate(var(--tilt)); opacity: 1; filter: drop-shadow(0 14px 16px rgba(18, 32, 55, 0.24)) saturate(1.02) contrast(1.04); }
  .logo-float { transform: none; opacity: 0.8; filter: drop-shadow(0 4px 0 rgba(25, 29, 56, 0.16)) drop-shadow(0 12px 15px rgba(40, 55, 100, 0.24)); }
}

/* Keep the landing page fixed to the visible viewport, including installed PWAs. */
html, body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body { position: fixed; inset: 0; }

.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: max(10px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom));
}

.transition-card {
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  row-gap: clamp(7px, 1.6svh, 12px);
  padding: clamp(14px, 3.4svh, 34px);
}

.qr-link { width: min(clamp(208px, 34vw, 286px), 34svh); }
.primary-action { min-height: 44px; }
.device {
  --z1: 28px;
  --rx1: 10deg;
  --ry1: -8deg;
  --rz1: 7deg;
  --scale1: 1.08;
  --z2: -18px;
  --rx2: -8deg;
  --ry2: 9deg;
  --rz2: -6deg;
  --scale2: 0.94;
  --x3: 12px;
  --y3: 38px;
  --z3: 22px;
  --rx3: 7deg;
  --ry3: -11deg;
  --rz3: 5deg;
  --scale3: 1.1;
}

@keyframes float-around {
  0%, 100% {
    transform: perspective(850px) translate3d(0, 0, -48px) rotateX(var(--rx, 4deg)) rotateY(var(--ry, -5deg)) rotateZ(var(--tilt)) scale(0.78);
    filter: drop-shadow(0 16px 18px rgba(18, 32, 55, 0.24)) saturate(1.02) contrast(1.04);
  }
  23% {
    transform: perspective(850px) translate3d(var(--x1), var(--y1), var(--z1)) rotateX(calc(var(--rx, 4deg) + var(--rx1))) rotateY(calc(var(--ry, -5deg) + var(--ry1))) rotateZ(calc(var(--tilt) + var(--rz1))) scale(var(--scale1));
    filter: drop-shadow(0 22px 24px rgba(18, 32, 55, 0.28)) saturate(1.06) contrast(1.07);
  }
  49% {
    transform: perspective(850px) translate3d(var(--x2), var(--y2), var(--z2)) rotateX(calc(var(--rx, 4deg) + var(--rx2))) rotateY(calc(var(--ry, -5deg) + var(--ry2))) rotateZ(calc(var(--tilt) + var(--rz2))) scale(var(--scale2));
    filter: drop-shadow(0 13px 16px rgba(18, 32, 55, 0.22)) saturate(0.98) contrast(1.04);
  }
  76% {
    transform: perspective(850px) translate3d(var(--x3), var(--y3), var(--z3)) rotateX(calc(var(--rx, 4deg) + var(--rx3))) rotateY(calc(var(--ry, -5deg) + var(--ry3))) rotateZ(calc(var(--tilt) + var(--rz3))) scale(var(--scale3));
    filter: drop-shadow(0 22px 24px rgba(18, 32, 55, 0.28)) saturate(1.06) contrast(1.07);
  }
}

/* Distribute the floating objects evenly around the full mobile viewport. */
@media (max-width: 620px) {
  .transition-card { width: min(86vw, 430px); }
  .device { width: min(var(--size, 150px), 42vw); }

  .device--1 { --size: 156px; top: 5%; left: 1%; right: auto; bottom: auto; }
  .device--2 { --size: 132px; top: 8%; left: 33%; right: auto; bottom: auto; }
  .device--3 { --size: 156px; top: 5%; right: 1%; left: auto; bottom: auto; }
  .device--4 { --size: 158px; top: 31%; right: -18px; left: auto; bottom: auto; }
  .device--5 { --size: 156px; bottom: 31%; right: -18px; top: auto; left: auto; }
  .device--6 { --size: 155px; bottom: 3%; right: 2%; top: auto; left: auto; }
  .device--7 { --size: 140px; bottom: 2%; right: 31%; top: auto; left: auto; }
  .device--8 { --size: 158px; bottom: 3%; left: 2%; top: auto; right: auto; }
  .device--9 { --size: 156px; bottom: 31%; left: -16px; top: auto; right: auto; }
  .device--10 { --size: 150px; top: 31%; left: -18px; right: auto; bottom: auto; }

  .logo-float--1 { top: 10%; left: 49%; right: auto; bottom: auto; }
  .logo-float--2 { top: 19%; left: 12%; right: auto; bottom: auto; }
  .logo-float--3 { top: 19%; right: 12%; left: auto; bottom: auto; }
  .logo-float--4 { top: 37%; right: 1%; left: auto; bottom: auto; }
  .logo-float--5 { top: 58%; right: 1%; left: auto; bottom: auto; }
  .logo-float--6 { bottom: 18%; right: 11%; top: auto; left: auto; }
  .logo-float--7 { bottom: 5%; left: 47%; right: auto; top: auto; }
  .logo-float--8 { bottom: 18%; left: 11%; right: auto; top: auto; }
  .logo-float--9 { top: 58%; left: 1%; right: auto; bottom: auto; }
  .logo-float--10 { top: 37%; left: 1%; right: auto; bottom: auto; }
}

/* The background marks are transparent 3D balloon artwork, not square tiles. */
.logo-float {
  --lx: 30px;
  --ly: -26px;
  --lx2: -20px;
  --ly2: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  opacity: 0.86;
  filter:
    drop-shadow(0 2px 0 rgba(25, 29, 56, 0.2))
    drop-shadow(0 7px 0 rgba(25, 29, 56, 0.14))
    drop-shadow(0 16px 16px rgba(40, 55, 100, 0.26));
  animation-name: logo-balloon;
  animation-timing-function: ease-in-out;
  animation-duration: var(--logo-duration, 18s);
  animation-delay: var(--logo-delay, 0s);
}

@keyframes logo-balloon {
  0%, 100% {
    transform: perspective(700px) translate3d(0, 0, -24px) rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz)) scale(0.82);
    opacity: 0.68;
    filter: drop-shadow(0 2px 0 rgba(25, 29, 56, 0.2)) drop-shadow(0 7px 0 rgba(25, 29, 56, 0.14)) drop-shadow(0 16px 16px rgba(40, 55, 100, 0.26));
  }
  32% {
    transform: perspective(700px) translate3d(var(--lx), var(--ly), 28px) rotateX(calc(var(--rx) + 9deg)) rotateY(calc(var(--ry) - 10deg)) rotateZ(calc(var(--rz) + 5deg)) scale(1.2);
    opacity: 0.98;
    filter: drop-shadow(0 3px 0 rgba(25, 29, 56, 0.22)) drop-shadow(0 9px 0 rgba(25, 29, 56, 0.15)) drop-shadow(0 22px 20px rgba(40, 55, 100, 0.3));
  }
  68% {
    transform: perspective(700px) translate3d(var(--lx2), var(--ly2), -28px) rotateX(calc(var(--rx) - 7deg)) rotateY(calc(var(--ry) + 9deg)) rotateZ(calc(var(--rz) - 4deg)) scale(0.78);
    opacity: 0.74;
    filter: drop-shadow(0 2px 0 rgba(25, 29, 56, 0.18)) drop-shadow(0 7px 0 rgba(25, 29, 56, 0.12)) drop-shadow(0 14px 15px rgba(40, 55, 100, 0.24));
  }
}

@media (max-width: 620px) {
  .stage { padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom)); }
  .transition-card {
    width: calc(100vw - 24px);
    max-height: 100%;
    gap: clamp(6px, 1.3svh, 10px);
    padding: clamp(12px, 2.5svh, 20px) 16px;
    border-radius: 24px;
  }
  .brand-logo { width: 50px; height: 50px; }
  h1 { font-size: clamp(18px, 5.2vw, 23px); line-height: 1.15; }
  .qr-link { width: min(clamp(168px, 54vw, 226px), 28svh); padding: 6px; }
  .primary-action { width: min(100%, 210px); min-height: 42px; border-radius: 14px; }
  .logo-float { width: min(var(--logo-size, 56px), 18vw); }
}

@media (max-height: 520px) and (orientation: landscape) {
  .stage { padding: max(6px, env(safe-area-inset-top)) 12px max(6px, env(safe-area-inset-bottom)); }
  .transition-card {
    width: min(100%, 680px);
    grid-template-columns: minmax(0, 1fr) min(30svh, 156px);
    grid-template-rows: auto auto auto;
    column-gap: 14px;
    row-gap: 6px;
    padding: 10px 16px;
    border-radius: 22px;
  }
  .brand-logo { grid-column: 1; grid-row: 1; width: 42px; height: 42px; }
  h1 { grid-column: 1; grid-row: 2; font-size: clamp(16px, 3.6vh, 20px); }
  .qr-link { grid-column: 2; grid-row: 1 / 4; width: min(30svh, 156px); padding: 5px; border-radius: 16px; }
  .primary-action { grid-column: 1; grid-row: 3; width: min(100%, 190px); min-height: 38px; }
}

@media (max-height: 520px) and (orientation: landscape) and (max-width: 620px) {
  .transition-card { width: calc(100vw - 24px); column-gap: 10px; padding: 8px 12px; }
  .qr-link { width: min(29svh, 132px); }
  .brand-logo { width: 36px; height: 36px; }
  h1 { font-size: clamp(15px, 3.4vh, 18px); }
  .primary-action { min-height: 36px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-float {
    animation: none !important;
    transform: none;
    opacity: 0.8;
    filter: drop-shadow(0 4px 0 rgba(25, 29, 56, 0.18)) drop-shadow(0 12px 15px rgba(40, 55, 100, 0.24));
  }
}
