/* Video canvas + device frame + touch indicator + captions (kit.js). */
body.kit-device, body.kit-bare { overflow: hidden; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; }
.stage { position: relative; flex: none; transform-origin: center center; overflow: hidden; }
.stage.bare { width: 390px; height: 844px; }
.viewport { position: absolute; inset: 0; overflow: hidden; background: var(--page); }
.viewport > .screen, .viewport > .page-frame {
  position: absolute; inset: 0; width: 390px; height: 100%; border: 0;
  transition: transform 400ms cubic-bezier(.2,.8,.2,1), filter 400ms;
}
.page-frame { background: transparent; box-shadow: -8px 0 24px rgba(0,0,0,.35); }
.page-frame.from-right { transform: translateX(100%); }
.covered { transform: translateX(-30%); filter: brightness(.7); }
.covered-instant { transform: translateX(-30%); transition: none !important; }
.tap-layer { position: absolute; inset: 0; pointer-events: none; z-index: 100; }

/* stage backgrounds */
.stage.device { background: var(--forest); }
.stage.bg-dark { background: var(--forest); }
.stage.bg-lime { background: var(--primary); }
.stage.bg-lime .copy { color: var(--forest); }
.stage.bg-court { background: var(--forest); }

/* iPhone-ish frame: 390x844 screen + 12px bezel */
.phone {
  position: absolute; width: 414px; height: 868px; left: 50%; top: 50%;
  border-radius: 62px; background: #050505;
  box-shadow: 0 0 0 2px #2a2a2a, 0 0 0 3px #111, 0 40px 80px rgba(0,0,0,.6);
  transform: translate(-50%, -50%) scale(var(--ps, 1));
  transition: transform 700ms cubic-bezier(.2,.8,.2,1);
}
.phone-screen { position: absolute; inset: 12px; border-radius: 50px; overflow: hidden; }
.island { position: absolute; top: 23px; left: 50%; width: 122px; height: 36px; margin-left: -61px; border-radius: 20px; background: #000; z-index: 200; }

/* canvas layouts */
/* preview = App Store app preview (886x1920): a narrower 9:16, so the phone is smaller to leave room for the floating caption */
.c-preview .phone { --ps: .86; top: 52%; }
/* ?caption=0: the headline is animated above the phone afterwards (tools/store-previews.mjs), so leave the top free */
.c-preview.no-caption .phone { --ps: .74; top: 59.5%; }
.c-preview .copy { display: none; }
.c-preview .caption { left: -12px; right: -12px; font-size: 25px; }
.c-9x16 .phone { --ps: .98; }
.c-9x16.has-copy .phone { --ps: .78; top: 55.5%; }
.c-9x16 .copy { position: absolute; top: 34px; left: 28px; right: 28px; text-align: center; }
.c-4x5 .phone { --ps: .92; }
.c-4x5.has-copy .phone { --ps: .78; top: 58%; }
.c-4x5 .copy { position: absolute; top: 30px; left: 28px; right: 28px; text-align: center; }
.c-1x1 .phone { --ps: .74; }
.c-1x1.has-copy .phone { --ps: .74; left: 72%; }
.c-1x1 .copy { position: absolute; top: 0; bottom: 0; left: 36px; width: 300px; display: flex; flex-direction: column; justify-content: center; }
.c-16x9 .phone { --ps: .56; }
.c-16x9.has-copy .phone { left: 72%; }
.c-16x9 .copy { position: absolute; top: 0; bottom: 0; left: 60px; width: 440px; display: flex; flex-direction: column; justify-content: center; }
.copy h1 { font-size: 40px; line-height: 1.08; font-weight: 600; letter-spacing: -1px; }
.copy h1 em { font-style: normal; color: var(--primary); }
.bg-lime .copy h1 em { color: #fff; }
.copy p { font-size: 18px; line-height: 1.35; font-weight: 500; color: var(--white-80); margin-top: 10px; }
.bg-lime .copy p { color: rgba(20,68,37,.8); }
.copy h1, .copy p { transition: opacity 400ms, transform 400ms cubic-bezier(.2,.8,.2,1); }
.stage:not(.has-copy) .copy { display: none; }

/* touch indicator */
.touch {
  position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: rgba(255,255,255,.45); border: 0;
  box-shadow: 0 4px 16px rgba(20,68,37,.35);
  opacity: 0; transform: scale(1.4); transition: transform 180ms cubic-bezier(.2,.8,.2,1), opacity 180ms;
  animation: touch-in 180ms forwards;
}
@keyframes touch-in { to { opacity: 1; transform: scale(1); } }
.touch.down { transform: scale(.82); background: rgba(255,255,255,.55); }
.touch.up { opacity: 0 !important; transform: scale(1.5); transition: transform 400ms, opacity 400ms; }

/* captions (guides): a card floating IN FRONT of the phone, over its top edge /
   status bar, wider than the phone, with a drop shadow and a gentle bob.
   In device frames the caption lives inside .phone, so it follows zoom/pan. */
.caption {
  position: absolute; z-index: 300; left: -34px; right: -34px; top: 4px; text-align: center;
  font-size: 27px; line-height: 1.25; font-weight: 600; color: #fff;
  opacity: 0; transform: translateY(14px) scale(.96); transition: opacity 350ms, transform 450ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.caption.show { opacity: 1; transform: none; animation: cap-float 3.2s ease-in-out 450ms infinite; }
@keyframes cap-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.caption::before {
  content: ""; position: absolute; inset: -16px -18px; z-index: -1; border-radius: 26px;
  background: var(--forest);
  box-shadow: 0 24px 50px rgba(20,68,37,.35);
}
/* bare: no phone frame, so overlay the top of the screen above the status bar */
.stage.bare .caption { bottom: auto; top: 6px; font-size: 16px; left: 18px; right: 18px; transform: translateY(-6px); }
.stage.bare .caption.show { transform: none; }
.stage.bare .caption::before { inset: -8px -12px; border-radius: 16px; }
.kit-play { position: fixed; z-index: 1000; right: 16px; bottom: 16px; background: var(--primary); color: var(--bg); font-weight: 700; padding: 10px 18px; border-radius: 20px; }
.copy.swap h1, .copy.swap p { opacity: 0; transform: translateY(-8px); }
.end-card { position: absolute; inset: 0; z-index: 400; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 40px;
  background: var(--forest); opacity: 0; transition: opacity 600ms; }
.end-card.show { opacity: 1; }
.end-card img { height: 96px; }
.end-card img.wm { height: 56px; margin-top: -4px; }
.end-card h2 { font-size: 34px; line-height: 1.1; letter-spacing: -.8px; font-weight: 700; margin-top: 18px; }
.end-card h2 em { font-style: normal; color: var(--primary); }
.end-card p { font-size: 17px; color: var(--white-80); font-weight: 500; }
.end-card .cta { margin-top: 18px; padding: 16px 30px; border-radius: 40px; background: var(--primary); color: var(--bg); font-size: 18px; font-weight: 700; }
.end-card > * { transform: translateY(10px); transition: transform 700ms cubic-bezier(.2,.8,.2,1); }
.end-card.show > * { transform: none; }
.end-card .store-badges { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 18px; }
.end-card .store-badges img.as { height: 54px; }
.end-card .store-badges .gp { display: block; overflow: hidden; }
.end-card .store-badges .gp img { display: block; height: auto; max-width: none; }
/* spread end-card lines evenly so no word ends up alone on the last line */
.end-card h2, .end-card p, .copy h1, .copy p, .caption { text-wrap: balance; }
.end-card .site { margin-top: 4px; font-size: 20px; font-weight: 600; letter-spacing: .3px; color: var(--white-80); }
