/* The CSS iPhone and Apple Watch: the fallback when hardware WebGL is unavailable (and the
   static composition without JavaScript). story.js poses them through their transforms and
   scales the 540×680 stage to the device layer with --device-scale (measured in script: Safari 26
   resolves container units inside tan(atan2()) to a negative scale). --device-fill is the share
   of the layer height the stage may use. */
.device-host { --device-fill: .82; --device-max: 1.3; }
.device-canvas {
  position: relative;
  flex: none;
  width: 540px;
  height: 680px;
  perspective: 1300px;
  transform: scale(var(--device-scale, .9));
}
/* The stage fades in once story.js has the devices ready (3D or CSS), in their entrance pose. */
.device-canvas { transition: opacity .7s cubic-bezier(.22, 1, .36, 1); }
.stage-pending .device-canvas { opacity: 0; animation: stage-failsafe 0s 5s forwards; }
@keyframes stage-failsafe { to { opacity: 1; } }
/* The WebGL canvas overhangs the stage by 170px on every side, so shadows and the band are not cut off. */
.device-gl { position: absolute; left: -170px; top: -170px; width: 880px; height: 1020px; pointer-events: none; }
.webgl-devices .device { visibility: hidden; }
/* Without JavaScript the stage keeps a conservative per-width scale. */
@media (max-width: 900px) { .device-host { --device-scale: .7; } }
@media (max-width: 480px) { .device-host { --device-scale: .55; } }
.device { position: absolute; transform-style: preserve-3d; }

/* iPhone: a 30px-deep titanium body built from stacked slices, so turning it reveals the
   brushed side, with the keys sitting on that side face. --spec turns the polished lip's
   highlight with the device; --dim darkens the screen when the phone steps back. */
.phone { width: 274px; height: 577px; left: 66px; top: 32px; transform: translate3d(0, 0, 0) rotateX(7deg) rotateY(-14deg) rotateZ(-8deg); }
.device-shadow { position: absolute; inset: 7% 9% 3%; border-radius: 48px; background: #000; opacity: .62; filter: blur(26px); transform: translate3d(28px, 36px, -120px); pointer-events: none; }
.device-slab { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.device-slab i { position: absolute; inset: var(--inset, 0px); border-radius: calc(46px - var(--inset, 0px)); transform: translateZ(calc(var(--z) * -2.5px)); background: linear-gradient(118deg, #e4e1da 0%, #9c9891 16%, #c4c0b8 34%, #6b6863 58%, #a29e97 78%, #d9d6cf 100%); }
.phone .device-slab i:first-child { background: linear-gradient(118deg, #fbfaf6, #b9b5ae 30%, #8a8781 62%, #ebe8e2); }
.phone .device-slab i:last-child { background: linear-gradient(118deg, #bdb9b2, #58554f 40%, #3b3936 70%, #8f8b84); }
.phone-key { position: absolute; width: 10px; border-radius: 5px; transform-origin: 0 50%; background: linear-gradient(90deg, #f1eee8, #a29e97 45%, #6e6b66 80%, #c9c5be); box-shadow: inset 0 0 0 .6px #57544f; }
.key-action, .key-volume-up, .key-volume-down { left: -1px; transform: translateZ(-20px) rotateY(-90deg); }
.key-side, .key-camera { left: calc(100% + 1px); transform: translateZ(-10px) rotateY(90deg); }
.key-action { top: 101px; height: 20px; }
.key-volume-up { top: 147px; height: 38px; }
.key-volume-down { top: 194px; height: 38px; }
.key-side { top: 156px; height: 58px; }
.key-camera { left: 100%; top: 338px; height: 36px; width: 12px; border-radius: 4px; background: linear-gradient(90deg, #2a2a2e, #4a4a50 50%, #1d1d21); box-shadow: inset 0 0 0 1px #8d8a84; }
.phone-face {
  position: absolute;
  inset: 0;
  padding: 2.6px;
  border-radius: 46px;
  background: conic-gradient(from var(--spec, 215deg), #f6f4ef, #8c8984 12%, #dad7d1 22%, #5f5d59 34%, #b9b5af 46%, #f2efe9 55%, #77746f 68%, #cbc8c2 80%, #6c6965 90%, #f6f4ef);
  box-shadow: inset 0 0 0 .6px #ffffffb3, inset 0 0 0 1.4px #0000004d;
}
.phone-bezel { height: 100%; padding: 4.2px; border-radius: 43.5px; background: #030304; box-shadow: inset 0 0 0 1px #1c1c21, inset 0 0 0 1.8px #000; }
.phone-screen { position: relative; height: 100%; overflow: hidden; border-radius: 39px; background: #0b0e17; isolation: isolate; }
.phone-screen > img:first-child { display: block; width: 100%; height: 100%; object-fit: cover; }
.phone-screen::before { content: ""; position: absolute; inset: 0; z-index: 4; background: #05060c; opacity: var(--dim, 0); pointer-events: none; }
/* Update the branding in the historical Library capture without repainting
   or replacing its actual library content. All branding uses the shared asset. */
.phone-brand { position: absolute; left: 3.8%; top: 7.05%; width: 33.8%; height: 5.2%; display: flex; align-items: center; gap: 3px; padding: 2px 4px; border: 1px solid #383b53; border-radius: 30px; background: #1b1e2c; color: #f2f3ff; font: 700 12px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; letter-spacing: -.5px; }
.phone-screen .phone-brand img { width: 24%; height: auto; aspect-ratio: 1; object-fit: contain; flex-shrink: 0; }
/* Cover glass: a faint diagonal reflection and the rolled edge catching light. */
.phone-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(118deg, #ffffff12, #ffffff05 22%, transparent 38%, transparent 74%, #ffffff06);
  box-shadow: inset 1px 1px 1.5px #ffffff2e, inset -1px -1px 1.5px #ffffff10;
}

/* Apple Watch: a 45px-deep aluminium case with rounded flanks (the slices are inset toward
   the front crystal and the back sensor), a knurled crown and a flush side button. */
.watch { width: 192px; height: 232px; right: 34px; top: 365px; transform: translate3d(0, 0, 70px) rotateX(8deg) rotateY(-17deg) rotateZ(13deg); }
.watch .device-shadow { inset: 4% 10%; border-radius: 56px; opacity: .55; filter: blur(22px); transform: translate3d(20px, 28px, -100px); }
.watch .device-slab i { border-radius: calc(52px - var(--inset, 0px)); transform: translateZ(calc(var(--z) * -3.2px)); background: linear-gradient(112deg, #f6f7f9 0%, #a6aab1 24%, #dcdee2 46%, #7c8088 70%, #c7cace 100%); }
.watch .device-slab i:nth-child(n + 13) { background: linear-gradient(112deg, #8d9097, #3a3b3f 45%, #232427 70%, #6b6e74); }
.watch-face {
  position: absolute;
  inset: 0;
  padding: 3px;
  border-radius: 52px;
  background: conic-gradient(from var(--spec, 215deg), #fdfdfe, #a9adb4 14%, #ebecef 25%, #7d8189 38%, #dbdde1 50%, #fff 58%, #8f939a 72%, #dee0e4 84%, #a0a4ab 92%, #fdfdfe);
  box-shadow: inset 0 0 0 .6px #fff, inset 0 0 0 1.5px #00000047;
}
.watch-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 13px 9px;
  border: 9px solid #020203;
  border-radius: 49px;
  background: radial-gradient(ellipse at 30% 0, #121118 0, #000 62%);
  box-shadow: 0 0 0 1px #0b0b0e;
  color: #f3f1ff;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.watch-screen::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: 40px; pointer-events: none; background: linear-gradient(125deg, #ffffff14, #ffffff04 26%, transparent 42%); box-shadow: inset 1px 1px 2px #ffffff26; }
.watch-crown { position: absolute; left: calc(100% - 2px); top: 50px; width: 13px; height: 38px; border-radius: 3px 6px 6px 3px; transform-style: preserve-3d; transform: translateZ(-20px); background: linear-gradient(90deg, #0007, transparent 30%, #ffffff40 62%, #0006), repeating-linear-gradient(0deg, #eceef0 0 1.2px, #80848b 1.2px 2.4px); box-shadow: 1px 2px 3px #0007; }
.watch-crown i { position: absolute; left: 100%; top: 0; width: 38px; height: 38px; border-radius: 50%; transform-origin: 0 50%; transform: translateZ(19px) rotateY(90deg); background: radial-gradient(circle at 42% 38%, #fdfdfe, #bcc0c5 40%, #7c8087 68%, #dadcdf 84%, #8d9097); }
.watch-button { position: absolute; left: calc(100% + .5px); top: 108px; width: 26px; height: 58px; border-radius: 13px; transform-origin: 0 50%; transform: translateZ(-9px) rotateY(90deg); background: linear-gradient(#eceef0, #9a9ea5 50%, #d4d6da); box-shadow: inset 0 0 0 1px #6f737a; }

/* Plum sport band. Each strap leaves the case at mid-depth and curls away in two
   segments, so it recedes in true perspective; the far segment falls into shadow. */
.watch-band { position: absolute; left: 38px; width: 116px; border-radius: 3px; transform-style: preserve-3d; --across: linear-gradient(90deg, #3a2c46, #5e4b71 6%, #6b5880 26%, #78658d 46%, #67537c 72%, #4d3d5d 94%, #33273d); box-shadow: inset 1px 0 #ffffff1c, inset -1px 0 #0000004d; }
.band-segment { position: absolute; left: 1.5px; right: 1.5px; box-shadow: inset 1px 0 #ffffff17, inset -1px 0 #00000040; }
.band-top { bottom: calc(100% - 8px); height: 62px; transform-origin: 50% 100%; transform: translateZ(-22px) rotateX(14deg); background: linear-gradient(0deg, #08050c 0 5px, #08050cb3 9px, #08050c00 24px, #ffffff0d 64%, #0000001a), var(--across); }
.band-top .band-segment { bottom: calc(100% - 1px); height: 84px; border-radius: 44px 44px 2px 2px / 18px 18px 2px 2px; transform-origin: 50% 100%; transform: rotateX(26deg); background: linear-gradient(0deg, #00000014, #00000059 62%, #0000008c), var(--across); }
.band-bottom { top: calc(100% - 8px); height: 66px; transform-origin: 50% 0; transform: translateZ(-22px) rotateX(-14deg); background: linear-gradient(180deg, #08050c 0 5px, #08050cb3 9px, #08050c00 24px, #ffffff0a 64%, #0000001a), var(--across); }
.band-bottom .band-segment { top: calc(100% - 1px); height: 84px; border-radius: 2px 2px 44px 44px / 2px 2px 18px 18px; transform-origin: 50% 0; transform: rotateX(-26deg); background: radial-gradient(circle at 50% 14px, #0e0913 0 3.4px, #a58fb85c 4px, transparent 5px), radial-gradient(circle at 50% 36px, #0e0913 0 3.4px, #a58fb84d 4px, transparent 5px), radial-gradient(circle at 50% 58px, #0e0913 0 3.4px, #a58fb83d 4px, transparent 5px), linear-gradient(180deg, #00000014, #00000059 62%, #0000008c), var(--across); }

/* Watch screen type is part of the illustration (aria-hidden) and drawn at hardware scale. */
.watch-status { display: flex; justify-content: space-between; align-items: center; margin: 0 14px 9px 10px; font-size: 9px; font-weight: 600; }
.watch-status > :first-child { color: var(--violet); }
.watch-brand { display: inline-flex; align-items: center; gap: 3px; }
.watch-brand img { display: block; width: 11px; height: 11px; object-fit: contain; }
.watch-now { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; font-size: 6px; font-weight: 600; letter-spacing: .1em; color: var(--mint); }
.watch-now .tiny-wave { height: 10px; transform: scale(.65); transform-origin: left; width: 11px; }
.watch-title { font-size: 19px; line-height: 1.05; letter-spacing: -.035em; font-weight: 650; }
.watch-author { margin: 4px 0 9px; font-size: 7px; color: #b6b0c6; white-space: nowrap; }
.watch-progress { height: 2.5px; border-radius: 4px; background: #33313b; }
.watch-progress > span { display: block; width: 100%; height: 100%; background: var(--mint); border-radius: inherit; transform: scaleX(.58); transform-origin: left; }
.watch-times { display: flex; justify-content: space-between; margin-top: 4px; font-size: 6px; color: #aaa6b7; font-variant-numeric: tabular-nums; }
.watch-controls { display: flex; align-items: center; justify-content: space-between; margin: auto 4px 0; }
.watch-play { display: flex; align-items: center; justify-content: center; gap: 4px; width: 34px; height: 34px; border-radius: 50%; background: #beb0f9; box-shadow: 0 0 14px #beb0f940; }
.watch-play i { display: block; width: 3px; height: 11px; background: #141221; border-radius: 1px; }
.skip-transport { position: relative; display: grid; place-items: center; width: 28px; height: 28px; font-size: 26px; line-height: 1; }
.skip-transport svg { display: block; width: 27px; height: 27px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.skip-transport small { position: absolute; top: 10px; left: 0; width: 28px; text-align: center; font: 600 7.5px/1 -apple-system, BlinkMacSystemFont, sans-serif; }

/* Reflections on the glass. story.js slides them as the devices turn. */
.device-glare { position: absolute; inset: -35%; z-index: 2; pointer-events: none; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #ffffff17, #ffffff06 22%, transparent 42%); }
.watch-screen .device-glare { inset: -45%; background: radial-gradient(circle at 32% 28%, #ffffff14, #ffffff05 20%, transparent 40%); }

/* A single light sweep across the glass once the devices have settled into place. */
.device-sheen { position: absolute; inset: -10% -70%; z-index: 3; pointer-events: none; background: linear-gradient(104deg, transparent 42%, #ffffff0d 47%, #ffffff24 50%, #ffffff0d 53%, transparent 58%); transform: translateX(-80%); opacity: 0; }
.devices-arrived .device-sheen { animation: device-sheen 1.5s cubic-bezier(.45, 0, .2, 1) .15s both; }
.devices-arrived .watch .device-sheen { animation-delay: .4s; }
@keyframes device-sheen { 0% { transform: translateX(-80%); opacity: 1; } 100% { transform: translateX(80%); opacity: 1; } }

/* A file on its way from the iPhone library to the watch, positioned by story.js. */
.transfer-chip { position: absolute; left: 0; top: 0; z-index: 5; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 10px; border-radius: 999px; font: 600 13px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #f4f3ff; white-space: nowrap; background: rgba(28, 22, 70, .6); border: 1px solid rgba(255, 255, 255, .24); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 0 30px rgba(166, 237, 214, .35); opacity: 0; pointer-events: none; will-change: transform, opacity; }
.transfer-chip b { font: 700 10px/1 -apple-system, BlinkMacSystemFont, sans-serif; padding: 5px 6px; border-radius: 6px; color: #120f2e; background: var(--mint); }

/* Ambient motion. Only after story.js has set up the pause control (.motion-ready). */
.motion-ready .device { will-change: transform; }
.motion-ready .phone { animation: device-float 6.5s ease-in-out infinite; }
.motion-ready .watch { animation: device-float 7.4s ease-in-out -2.6s infinite; --float: -6px; }
.motion-ready .tiny-wave i { animation: device-wave 1.15s ease-in-out infinite; }
.motion-ready .tiny-wave i:nth-child(2) { animation-delay: -.3s; }
.motion-ready .tiny-wave i:nth-child(3) { animation-delay: -.65s; }
.motion-ready .tiny-wave i:nth-child(4) { animation-delay: -.15s; }
.motion-ready .tiny-wave i:nth-child(5) { animation-delay: -.85s; }
/* 12:48 of 22:04 played: the bar fills over the remaining 556 seconds, in step with the clock. */
.motion-ready .watch-progress > span { animation: device-progress 556s linear forwards; }
[data-offscreen] .device-canvas *, .motion-off .device, .motion-off .device *, .motion-off .tiny-wave i { animation-play-state: paused !important; }
.motion-off .device-sheen { animation: none; }
@keyframes device-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 var(--float, -5px); } }
@keyframes device-wave { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
@keyframes device-progress { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .motion-ready .device, .motion-ready .tiny-wave i, .motion-ready .watch-progress > span { animation: none; }
  .transfer-chip, .device-sheen { display: none; }
  .device-canvas { transition: none; }
}
