/* One upright policy, the same camera view, and the real phone screens. */
.digital-shot {

  --phone-close: min(59cqw,99cqh);
  --capture-width:min(65cqw,47cqh);
  --capture-x:65%;
  --capture-top:1%;

  --phone-close-x: 62%;
  --phone-top: 3%;
  --paper-wide: min(46cqw,68cqh);
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
}
#policy-story:is([data-step="2"],[data-step="5"]) .digital-shot { display:none; }
.digital-original, .digital-handset, .digital-frame, .digital-glass, .digital-camera,
.digital-viewfinder, .digital-on-camera, .digital-camera-bar,
.digital-app-screen, .digital-app-pages, .digital-page, .digital-flash { position: absolute; }
.digital-original {
  width: var(--paper-wide);
  top: 51%;
  left: 33%;
  transform: translate(-50%,-50%);
  background: white;
  line-height: 0;
  box-shadow: .25cqw .48cqw .75cqw -.2cqw #25344033, 1cqw 2cqw 3.8cqw -.48cqw #25344023;
}
.digital-original img, .digital-on-camera img, .digital-frame, .digital-page img {
  display:block; width:100%; height:auto;
}
.digital-handset {
  width:var(--phone-close);
  left:var(--phone-close-x);
  top:var(--phone-top);
  aspect-ratio:1736 / 3616;
  transform: translateX(-50%);
  filter:drop-shadow(.3cqw .55cqw .42cqw #17222c38) drop-shadow(.9cqw 1.7cqw 1.5cqw #17222c32);
}
.digital-frame { inset:0; z-index:3; width:100%; height:100%; }
.digital-glass { inset:1.77% 3.92% 1.88%; border-radius:13% / 6%; overflow:hidden; background:#102e51; }
.digital-camera, .digital-app-screen, .digital-flash { inset:0; }
.digital-camera { background:linear-gradient(180deg,#0c2d53 0 6.3%,#252d37 14%,#171c22 88%,#121519); }
.digital-viewfinder { inset:11.4% 0 17%; overflow:hidden; background:#b7b8b7 url("desk-grain.webp") center / cover; }
.digital-on-camera {
  width:72%;
  left:50%;
  top:50%;
  line-height:0;
  transform:translate(-50%,-50%);
  box-shadow:0 .15cqw .6cqw #1a232c24;
}
/* The shutter is a filled disk separated from its fine outer stroke by a dark gap. */
.digital-camera-bar { display:flex; align-items:center; justify-content:center; }
.digital-shutter {
  display:block; position:relative; width:15%; aspect-ratio:1;
  border-radius:50%; background:#fff;
}
.digital-shutter::after {
  content:""; position:absolute; inset:-8%; border:.65cqw solid white;
  border-radius:inherit;
}
.digital-flash { background:#fff; opacity:0; }
.digital-app-screen { opacity:0; background:#f2f2f6; }
.digital-status { position:absolute; inset:0 0 auto; z-index:2; display:block; width:100%; height:6.29%; pointer-events:none; }
.digital-app-pages { inset:6.29% 0 0; overflow:hidden; }
.digital-page { inset:0; overflow:hidden; opacity:0; background:#f2f2f6; }
.digital-page img { transform:translateY(var(--app-pan,0%)); }
#policy-story:is([data-step="1"],[data-step="3"],[data-step="4"]) .digital-app-screen {opacity:1;}
#policy-story[data-step="1"] .digital-review,
#policy-story[data-step="3"] .digital-link-picker,
#policy-story[data-step="4"] .digital-shared {opacity:1;}
@container (max-width:440px) {
  .digital-shot {
    --paper-wide:min(49cqw,68cqh);
    --phone-close:min(81cqw,121cqh);
    --phone-close-x:60%;

    --phone-top:2%;
  }
  .digital-original {left:32%; transform:translate(-69%,-50%);}
}

/* Frame the exposure with both metal rims visible before the review close-up. */
#policy-story[data-step="0"] .digital-handset {
  width:var(--capture-width); left:var(--capture-x); top:var(--capture-top);
}
.digital-camera {container-type:inline-size;}
.digital-viewfinder {
  inset:8.5% 0 auto; aspect-ratio:3/4;
  box-shadow:inset 0 1px 4px #26324729;
}
.digital-on-camera {width:84%; top:48%;}
.camera-flash-control, .camera-zoom {
  position:absolute; box-sizing:border-box; border-radius:50%;
  color:white; background:#161a20b8;
}
.camera-flash-control {
  left:2%; top:1.9%; width:8%; height:auto; aspect-ratio:1; padding:1.2%;
}
.camera-zoom {
  display:grid; place-items:center; left:50%; bottom:1.4%; transform:translateX(-50%);
  width:8.2%; aspect-ratio:1; font:600 3.7cqw/1 -apple-system,BlinkMacSystemFont,sans-serif;
}
.digital-camera-bar {inset:74% 0 7%;}
.camera-cancel {
  position:absolute; left:6%; color:white; font:400 4.5cqw/1 -apple-system,BlinkMacSystemFont,sans-serif;
}
.camera-switch {
  position:absolute; right:5.9%; width:11%; height:auto; padding:1.25%;
  border-radius:50%; background:#383c41;
}
.digital-camera::after {
  content:""; position:absolute; left:34%; bottom:1.8%; width:32%; height:.52%;
  background:#ebedef; border-radius:100px;
}
#policy-story[data-step="0"] .digital-on-camera {
  animation:frame-whole-sheet .42s cubic-bezier(.24,.67,.25,1) both;
}
#policy-story[data-step="0"] .digital-shutter { animation:sf-shutter-press .14s .78s ease-out both; }
#policy-story[data-step="0"] .digital-flash { animation:sf-shutter-flash .14s .85s ease-out both; }
@keyframes frame-whole-sheet { from { width:81%; } to { width:84%; } }
@keyframes sf-shutter-flash { 0%,100% {opacity:0;} 25% {opacity:.37;} }
@keyframes sf-shutter-press { 0%,100% {transform:scale(1);} 48% {transform:scale(.84);background:#dde0e2;} }

/* Keep a single piece of hardware on screen as the photo gives way to the record. */
#policy-story.review-entry[data-step="1"]:not(.story-static) .digital-handset {
  animation:approach-review .52s cubic-bezier(.37,0,.20,1) both;
  animation-play-state:var(--motion-state,running);
}
#policy-story.review-entry[data-step="1"]:not(.story-static) .digital-app-screen {
  animation:develop-review .27s .045s ease-in-out both;
  animation-play-state:var(--motion-state,running);
}
@keyframes approach-review {
  from { width:var(--capture-width); top:var(--capture-top); left:var(--capture-x); }
  to { width:var(--phone-close); top:var(--phone-top); left:var(--phone-close-x); }
}
@keyframes develop-review { from {opacity:0;} to {opacity:1;} }

/* Genuine app states; the reminder remains a separate, deliberate action. */
#policy-story[data-step="1"] .digital-app-screen { opacity:1; }
#policy-story[data-step="1"] .digital-accepted { animation:sf-arrive .23s ease-out 2.25s both; }
#policy-story[data-step="1"] .digital-offer { animation:sf-arrive .26s ease-out 3.18s both; }
#policy-story[data-step="1"] .digital-reminder-set { animation:sf-arrive .24s ease-out 4.76s both; }
#policy-story[data-step="3"] .digital-login { animation:sf-arrive .25s ease-out 1.24s both; }
#policy-story[data-step="4"] .digital-shared { animation:sf-arrive .25s ease-out both; }
/* These are actual scroll positions in the app, with its original header fixed. */
.digital-review { --app-pan:-3.3%; --header-image:url("digital30-review.webp"); --tap-x:24.9%; --tap-y:28.94%; }
.digital-accepted { --app-pan:-12%; --header-image:url("digital30-accepted.webp"); }
.digital-offer { --app-pan:-7.2%; --header-image:url("digital30-reminder-offer.webp"); --tap-x:25.9%; --tap-y:23.45%; }
.digital-reminder-set { --app-pan:-7.2%; --header-image:url("digital30-reminder-set.webp"); }
.digital-link-picker { --app-pan:-6.7%; --header-image:url("digital30-link-row.webp"); --tap-x:39%; --tap-y:23.8%; }
.digital-login { --app-pan:-5.1%; --header-image:url("digital30-link.webp"); }
.digital-page:has(img)::before {
  content:""; position:absolute; inset:0 0 auto; height:8.55%; z-index:1;
  pointer-events:none; background:var(--header-image,none) left top / 100% auto no-repeat;
}
.digital-review::after, .digital-offer::after, .digital-link-picker::after {
  content:""; position:absolute; left:var(--tap-x); top:var(--tap-y);
  z-index:2; width:6.2%; aspect-ratio:1; border-radius:50%; opacity:0;
  border:1.5px solid #fff; background:#a6c1d978; box-shadow:0 0 0 1px #17334750;
}
#policy-story[data-step="1"] .digital-review::after {animation:sf-input .4s ease-out 1.90s both;}
#policy-story[data-step="1"] .digital-offer::after {animation:sf-input .4s ease-out 4.36s both;}
#policy-story[data-step="3"] .digital-link-picker::after {animation:sf-input .38s ease-out .88s both;}
@keyframes sf-input {
  0% {opacity:0;transform:translate(-50%,-50%) scale(1.2);}
  50% {opacity:1;transform:translate(-50%,-50%) scale(.78);}
  100% {opacity:0;transform:translate(-50%,-50%) scale(1.1);}
}
@keyframes sf-arrive { from {opacity:0;} to {opacity:1;} }

#policy-story[data-step] .digital-shot *, #policy-story[data-step] .digital-shot *::after { animation-play-state:var(--motion-state,running); }
#policy-story.story-static .digital-shot *, #policy-story.story-static .digital-shot *::after {animation:none;}
#policy-story.story-static[data-step="3"] .digital-login {opacity:1;}
