/* SPOT prototype showcase (Jen, Nov 23): the prototypes play as videos inside a drawn iPhone,
   on a SPOT-yellow stage, like raynalai.com/glint. Two pieces:
   .spot-show  an angled close-up of the phone; the SPOT icon is tapped and the app opens
   .proto      a straight-on phone that plays each flow, with a tab pill to switch flows */

.spot-show, .proto-stage {
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ios: cubic-bezier(.32, .72, 0, 1);
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 12px;
  background:
    radial-gradient(70% 60% at 18% 8%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 70%),
    radial-gradient(60% 70% at 92% 100%, rgba(240, 186, 0, .55), rgba(240, 186, 0, 0) 70%),
    linear-gradient(165deg, #fff5a1 0%, #ffe800 46%, #ffd400 100%);
}
/* a whisper of grain so the yellow reads as printed, not flat */
.spot-show::after, .proto-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5; opacity: .16; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .42 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- the drawn iPhone (black titanium) ---------- */
.ip {
  --w: 300px;
  position: relative; width: var(--w); flex: none;
  padding: calc(var(--w) * .013);
  border-radius: calc(var(--w) * .168);
  background:
    linear-gradient(90deg, #1b1b1d 0%, #56565b 2.2%, #2b2b2e 5%, #2b2b2e 95%, #56565b 97.8%, #1b1b1d 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .14),
    inset 0 calc(var(--w) * .004) calc(var(--w) * .006) rgba(255, 255, 255, .22),
    0 calc(var(--w) * .1) calc(var(--w) * .2) rgba(92, 70, 0, .32),
    0 calc(var(--w) * .02) calc(var(--w) * .04) rgba(60, 46, 0, .25);
}
.ip-bezel {
  position: relative; padding: calc(var(--w) * .026); border-radius: calc(var(--w) * .155); background: #050505;
}
.ip-screen {
  position: relative; overflow: hidden; container-type: inline-size;
  aspect-ratio: 393 / 852; border-radius: calc(var(--w) * .128); background: #fff;
  transform: translateZ(0);
}
.ip-island {
  position: absolute; z-index: 4; left: 50%; top: 1.35%; width: 32%; height: 4.35%;
  transform: translateX(-50%); border-radius: 99px; background: #000;
  box-shadow: inset calc(var(--w) * .062) 0 0 calc(var(--w) * -.05) #000;
}
.ip-island::after { /* the lens */
  content: ""; position: absolute; right: 9%; top: 50%; width: 15%; aspect-ratio: 1; transform: translateY(-50%); border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2a3550 0%, #0b0e16 55%, #000 100%);
}
/* side buttons: action + two volume on the left, power on the right */
.ip-btn { position: absolute; width: calc(var(--w) * .011); border-radius: 2px; background: linear-gradient(90deg, #3a3a3e, #1d1d1f); }
.ip-btn.l1 { left: calc(var(--w) * -.009); top: 17%; height: 4%; }
.ip-btn.l2 { left: calc(var(--w) * -.009); top: 25%; height: 7.5%; }
.ip-btn.l3 { left: calc(var(--w) * -.009); top: 34%; height: 7.5%; }
.ip-btn.r1 { right: calc(var(--w) * -.009); top: 27%; height: 11%; background: linear-gradient(270deg, #3a3a3e, #1d1d1f); }

/* status bar drawn over the screen, so every clip reads like a real phone */
.ip-status {
  position: absolute; z-index: 3; inset: 0 0 auto; height: 6.4%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 7.5% 0 10.5%; font: 600 4.35cqw/1 -apple-system, "SF Pro Text", "DM Sans", sans-serif;
  letter-spacing: -.01em; color: #000; pointer-events: none; transition: color .45s var(--ease);
}
.ip-status svg { display: block; height: 3.2cqw; width: auto; }
.ip-status .si { display: flex; align-items: center; gap: 1.6cqw; }
.ip-screen.dark .ip-status { color: #fff; }

/* ---------- 1. the angled close-up: tap the icon, the app opens ---------- */
.spot-show {
  margin: 40px 0 0; height: clamp(360px, 46vw, 620px);
  perspective: 1900px;
}
.ss-rig {
  position: absolute; left: 50%; top: 13%;
  --rx: 0deg; --ry: 0deg;
  transform-style: preserve-3d;
  transform: translateX(-50%) rotateX(calc(8deg + var(--rx))) rotateY(calc(26deg + var(--ry))) rotateZ(-3deg);
  transition: transform 1.6s var(--ease), opacity 1.1s var(--ease), top 1.6s var(--ease);
}
.spot-show:not(.in) .ss-rig { top: 34%; opacity: 0; transform: translateX(-50%) rotateX(18deg) rotateY(44deg) rotateZ(-6deg); }
/* Fade on its own layer (Jen, Nov 28): opacity below 1 on the 3D rig makes the
   browser flatten it, so the phone's side edge collapsed for the whole fade and
   popped in at the end. spot-proto.js wraps the rig in .ss-stage, which carries
   the perspective and the fade, so the rig stays fully 3D from the first frame. */
.ss-stage { position: absolute; inset: 0; perspective: 1900px; transition: opacity 1.1s var(--ease); }
.spot-show.has-stage .ss-rig { opacity: 1 !important; transition: transform 1.6s var(--ease), top 1.6s var(--ease); }
.spot-show:not(.in) .ss-stage { opacity: 0; }
/* restart like a video (Jen, Nov 28): quick fade out with the app still open,
   then .snap jumps everything back to the start with no transitions */
.spot-show.out .ss-stage { opacity: 0; transition: opacity .45s var(--ease); }
.spot-show.snap .ss-stage, .spot-show.snap .ss-stage * { transition: none !important; }
.spot-show .ip { --w: clamp(250px, 30vw, 400px); transform-style: preserve-3d; }
/* The phone's thickness (Jen, Nov 28): the old .ss-edge was one flat strip
   turned 90deg, square at both ends, so it read as a loose line beside the
   rounded body. Now spot-proto.js stacks thin copies of the body outline
   behind the front (.ss-slab), so the side follows the rounded corners and
   is solid all the way round. The drop shadow moves to the back-most copy. */
.spot-show .ss-edge { display: none; }
.spot-show .ip {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 calc(var(--w) * .004) calc(var(--w) * .006) rgba(255, 255, 255, .22);
}
.ss-slab {
  position: absolute; inset: 0; pointer-events: none;
  border-radius: calc(var(--w) * .168);
  background: var(--c, #2a2a2d);
  transform: translateZ(calc(var(--w) * -.05 * var(--t)));
}
.ss-slab.back {
  box-shadow:
    0 calc(var(--w) * .1) calc(var(--w) * .2) rgba(92, 70, 0, .32),
    0 calc(var(--w) * .02) calc(var(--w) * .04) rgba(60, 46, 0, .25);
}
/* side buttons, standing a hair proud of the edge, half way back */
.ss-key {
  position: absolute; left: calc(var(--w) * -.008); width: calc(var(--w) * .02);
  border-radius: 2px; background: linear-gradient(90deg, #232326, #55555a 55%, #2a2a2d);
  transform: translateZ(calc(var(--w) * -.025));
}
.ss-key.k1 { top: 17%; height: 4%; }
.ss-key.k2 { top: 25%; height: 7.5%; }
.ss-key.k3 { top: 34%; height: 7.5%; }
.ss-edge-old {
  position: absolute; left: 0; top: 4.6%; bottom: 4.6%; width: calc(var(--w) * .05);
  transform-origin: left center; transform: rotateY(90deg);
  background: linear-gradient(90deg, #121214, #4a4a4f 45%, #1a1a1c);
  border-radius: 3px;
}
.ss-edge i { position: absolute; left: 22%; right: 22%; border-radius: 3px; background: linear-gradient(90deg, #26262a, #5a5a60 50%, #26262a); box-shadow: 0 1px 0 rgba(255,255,255,.12); }
.ss-edge i:nth-child(1) { top: 13%; height: 4%; }
.ss-edge i:nth-child(2) { top: 21%; height: 8%; }
.ss-edge i:nth-child(3) { top: 31%; height: 8%; }
.spot-show .ip-btn { display: none; }
/* glare that slides across the glass as it turns */
.ss-glare {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.16) 42%, rgba(255,255,255,0) 54%);
  transform: translateX(-30%); transition: transform 2.2s var(--ease);
}
.spot-show.in .ss-glare { transform: translateX(30%); }

/* home screen */
.ss-home {
  position: absolute; inset: 0; color: #fff;
  background:
    radial-gradient(90% 55% at 50% 108%, rgba(255, 214, 0, .85) 0%, rgba(255, 190, 0, .35) 38%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, #0c0c0d 0%, #111 55%, #2a2205 100%);
}
.ss-home .ip-status { color: #fff; }
.ss-icon {
  position: absolute; left: 7.4%; top: 10.2%; width: 17.2%; margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: 1.6cqw;
  transition: transform .28s var(--ease);
}
.ss-icon b {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 23%;
  /* Jen, Nov 28: the icon is the app's own header logo (black SPOT block, yellow letters, viewfinder corner)
     on SPOT yellow, so the letters knock out to yellow exactly like the app's top bar. */
  background: #ffe800; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.4);
}
.ss-icon b img { width: 74%; height: auto; display: block; transform: translate(3%, 2%); }
.ss-icon span { font: 500 2.9cqw/1 -apple-system, "SF Pro Text", "DM Sans", sans-serif; color: #fff; letter-spacing: 0; }
.spot-show.tap .ss-icon { transform: scale(.88); }
.spot-show.tap .ss-icon b { filter: brightness(.75); }

/* the app, zooming open out of the icon */
.ss-app {
  position: absolute; inset: 0; z-index: 2; overflow: hidden; background: #ffe800;
  transform-origin: 16% 13.6%; transform: scale(.172); border-radius: 30%; opacity: 0;
  /* closing back into the icon: shrink first, fade only at the very end (Jen, Nov 28: the tap loops) */
  transition: transform .72s var(--ios), border-radius .72s var(--ios), opacity .2s linear .5s;
}
.ss-app img, .ss-app video { display: block; width: 100%; height: 100%; object-fit: cover; }
.spot-show.open .ss-app { transform: none; border-radius: 0; opacity: 1; transition: transform .72s var(--ios), border-radius .72s var(--ios), opacity .22s linear; }
.spot-show.open .ip-status { color: #000; }

/* ---------- 2. the prototype player ---------- */
.proto { margin-top: 64px; }
.proto-stage {
  display: grid; place-items: center;
  padding: clamp(28px, 5.5vw, 72px) 20px;
}
.proto .ip {
  --w: clamp(220px, 25vw, 320px);
  opacity: 0; transform: translateY(48px) scale(.96);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
}
.proto.in .ip { opacity: 1; transform: none; }
.pr-vids video {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover;
  opacity: 0; transform: scale(1.015); transition: opacity .55s var(--ease), transform .8s var(--ease);
}
.pr-vids video.on { opacity: 1; transform: none; z-index: 1; }

.pr-pause {
  position: absolute; right: clamp(14px, 2vw, 26px); bottom: clamp(14px, 2vw, 26px); z-index: 6;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #111;
  background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 4px 14px rgba(80, 60, 0, .16);
  transition: transform .25s var(--ease), background .25s;
}
.pr-pause:hover { transform: scale(1.06); background: rgba(255, 255, 255, .75); }
.pr-pause:active { transform: scale(.94); }
.pr-pause svg { width: 16px; height: 16px; }
.pr-pause .i-play { display: none; }
.proto.paused .pr-pause .i-play { display: block; }
.proto.paused .pr-pause .i-pause { display: none; }

/* tab pill with a sliding highlight and a fill that runs with the clip */
.pr-tabs-wrap { display: flex; justify-content: center; margin-top: 28px; }
.pr-tabs {
  position: relative; display: flex; gap: 2px; padding: 5px; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  border-radius: 999px; border: 1px solid var(--rule); background: var(--bg, #fff);
}
.pr-tabs::-webkit-scrollbar { display: none; }
.pr-hl {
  position: absolute; z-index: 0; top: 5px; bottom: 5px; left: 0; width: 0; border-radius: 999px; overflow: hidden;
  background: rgb(240, 240, 242);
  transition: transform .5s var(--ios), width .5s var(--ios);
}
:root[data-theme="dark"] .pr-hl { background: rgb(38, 38, 41); }
.pr-hl i { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: #ffd400; border-radius: 2px; }
.pr-tab {
  position: relative; z-index: 1; flex: none; border: 0; background: none; cursor: pointer;
  padding: 11px clamp(14px, 1.8vw, 24px); border-radius: 999px;
  font: 400 16px/1 "DM Sans", sans-serif; letter-spacing: -.01em; color: var(--caption);
  transition: color .3s var(--ease);
}
.pr-tab:hover { color: var(--head); }
.pr-tab[aria-selected="true"] { color: var(--head); }

.pr-caps { position: relative; max-width: 640px; margin: 22px auto 0; text-align: center; }
.pr-cap {
  margin: 0; font-size: 17px; line-height: 1.55; color: var(--body);
  opacity: 0; transform: translateY(8px); transition: opacity .45s var(--ease), transform .55s var(--ease);
  position: absolute; inset: 0 0 auto; pointer-events: none;
}
.pr-cap.on { position: relative; opacity: 1; transform: none; pointer-events: auto; transition-delay: .08s; }
.pr-cap b { font-weight: 500; color: var(--head); }

@media (max-width: 760px) {
  .spot-show { height: 400px; }
  .spot-show .ip { --w: 240px; }
  .pr-tabs-wrap { justify-content: flex-start; }
  .pr-tab { font-size: 15px; padding: 10px 14px; }
  .pr-cap { font-size: 15px; }
  .pr-pause { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .ss-rig, .ss-stage, .ss-app, .proto .ip, .pr-vids video, .pr-cap, .pr-hl { transition: none !important; }
}
