.story {
  --device-width-parts: 9;
  --device-height-parts: 18.5;
  position: relative;
  background: radial-gradient(ellipse at 80% 24%, #dce6f2, transparent 58%), #f3f5f8;
}
.story-pin {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  width: min(100% - 36px, 680px);
  margin-inline: auto;
  padding-block: 32px 44px;
}
.story-track { display: contents; }
.story-stage {
  --device-radius: 35px;
  --device-bezel: 5px;
  position: relative;
  isolation: isolate;
  width: min(100%, 294px, max(216px, 37svh));
  min-width: 0;
  aspect-ratio: var(--device-width-parts) / var(--device-height-parts);
  margin-inline: auto;
  margin-bottom: 16px;
}
.scene-window, .story-device {
  position: absolute;
  inset: 0;
  border-radius: var(--device-radius);
}
.scene-window { background: #253238; overflow: clip; }
.scene-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 46%;
}
.story-device {
  isolation: isolate;
  color: #fff;
  pointer-events: none;
  box-shadow: 0 25px 48px -21px #10253d68, 0 6px 15px #13233822, 0 1px 3px #0b16223b;
}
.story-device::before {
  content: "";
  position: absolute;
  inset: var(--device-bezel);
  border-radius: calc(var(--device-radius) - var(--device-bezel));
  box-shadow: 0 0 0 1.5px #111923, inset 0 0 0 1px #a8b8cf32;
  background: linear-gradient(180deg, #080e177a, transparent 23%, transparent 49%, #080e17b8 76%, #080e17f4);
}
/* A metal rail surrounds the screen rather than tinting the live image. */
.story-device::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  border: var(--device-bezel) solid #788c9e;
  border-color: #a4b9c9 #657b8e #586b7c #91a6b7;
  box-shadow: inset 0 0 0 1px #161f29b0, inset 0 0 0 2px #d1e5fa4d;
}
@supports (mask-composite: exclude) {
  .story-device::after {
    padding: var(--device-bezel);
    border: 1px solid #dbe5f48c;
    background: linear-gradient(145deg, #c2d3e4 0%, #6c8194 12%, #3f4c58 33%, #abc0d2 55%, #53616e 73%, #bdcbd7 91%, #6b7d8b 100%);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
  }
}
.phone-hardware {
  position: absolute;
  z-index: 2;
  inset: 0;
}
.phone-hardware::before, .phone-hardware::after {
  content: "";
  position: absolute;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #a4b6c8 0%, #647a8c 18%, #435360 90%, #24313d 100%);
  box-shadow: 0 1px 2px #222d3a2e;
}
.phone-hardware::before {
  left: -2px;
  top: 24%;
  height: 28px;
  box-shadow: 0 34px 0 #627688, 0 35px 2px #222d3a35;
}
.phone-hardware::after { right: -2px; top: 30%; height: 41px; }
.phone-camera {
  position: absolute;
  top: 12px;
  left: 50%;
  width: clamp(45px, 21%, 62px);
  height: 17px;
  transform: translateX(-50%);
  border: 1px solid #142233;
  border-radius: 12px;
  background: #070b11;
  box-shadow: inset 0 -1px 1px #a1bde222, 0 1px 3px #0c172b29;
}
.phone-camera::before, .phone-camera::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.phone-camera::before {
  left: 21%;
  width: 28%;
  height: 2px;
  border-radius: 2px;
  background: #202b38;
}
.phone-camera::after {
  right: 13%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 34%, #688ebc 0%, #263a68 29%, #131d31 53%, #070a13 75%);
  box-shadow: 0 0 0 1px #172231;
}
.phone-home-indicator {
  position: absolute;
  bottom: 13px;
  left: 50%;
  width: 29%;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 5px;
  background: #e6edf6c2;
}
.film-label, .demo-caption {
  position: absolute;
  z-index: 2;
  color: #fff;
  background: #131c2ac7;
  border: 1px solid #fff3;
  border-radius: 24px;
  padding: 4px 10px;
  font-size: 12px;
}
.film-label { top: 41px; left: 14px; }
.story-pin[data-story-active]:not([data-story-active="0"]) .film-label { visibility: hidden; }
.demo-caption {
  bottom: -23px;
  inset-inline: 0;
  padding: 0;
  font-size: 11px;
  text-align: center;
  color: #526277;
  border: 0;
  background: transparent;
  white-space: nowrap;
}
.narration-enable {
  margin: -7px 0 -7px 4px;
  padding: 7px 6px;
  color: #254974;
  text-underline-offset: 3px;
  text-decoration: underline;
  font-weight: 600;
}
.device-ui { position: absolute; z-index: 1; inset: 0; }
.live-top {
  position: absolute;
  top: 38px;
  left: 14px;
  right: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.live-tag {
  margin-inline-start: auto;
  padding: 2px 7px;
  border-radius: 20px;
  background: #1b2534bc;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}
.story:not(.story-cinematic) .live-top { gap: 5px; font-size: 12px; }
.story:not(.story-cinematic) .live-tag { padding-inline: 5px; font-size: 10px; }
.live-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 119px;
  font-size: 14px;
  line-height: 1.62;
}
.live-caption p { margin-top: 5px; text-shadow: 0 1px 8px #000; }
.ai-speaking { display: flex; align-items: center; gap: 9px; color: #d5e6ff; font-size: 12px; }
.wave-bars { display: flex; flex-shrink: 0; gap: 2px; align-items: center; height: 16px; color: #caf2ff; }
.wave-bars i {
  --rest: .42;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ebfcff, currentColor 65%, #78cbed);
  transform: scaleY(var(--rest));
  transform-origin: center;
  opacity: .78;
}
.wave-bars i:nth-child(1), .wave-bars i:nth-child(7) { --rest: .23; opacity: .57; }
.wave-bars i:nth-child(3), .wave-bars i:nth-child(5) { --rest: .54; }
.wave-bars i:nth-child(4) { --rest: .72; opacity: .93; }
#live-transcript { min-height: 3.24em; text-wrap: balance; }
.live-chat {
  position: absolute;
  bottom: 23px;
  left: 14px;
  right: 14px;
  display: grid;
  justify-items: start;
  gap: 1px;
}
.live-chat-line,
.live-comment {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding-inline: 3px;
  color: #f5f8fd;
  text-shadow: 0 1px 5px #000;
  font-size: 13px;
  line-height: 1.5;
}
.live-chat-line { opacity: .78; }
.live-chat-name {
  color: #b9d5ff;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}
.live-comment {
  pointer-events: auto;
  align-items: center;
  min-height: 44px;
  text-align: left;
  border-radius: 6px;
  transition: color .16s ease-out;
}
.live-comment:hover span:last-child,
.live-comment:focus-visible span:last-child {
  color: #d7e8ff;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.live-comment[aria-expanded="true"] .live-chat-name { color: #d5e6ff; }
.live-comment:focus-visible { outline-offset: 2px; }

.story-controls {
  --glass-edge: #fff9;
  --glass-tint: #d2dff0a8;
  --glass-light: #f8fbffe0;
  --glass-highlight: linear-gradient(165deg, #fffefcfc, #e9f2ffb8);
  --glass-hover: #fff8;
  --glass-selected-ink: #182b45;
  grid-row: 1;
  display: flex;
  gap: 4px;
  width: 100%;
  padding: 5px;
  border: 1px solid var(--glass-edge);
  border-radius: 17px;
  background: linear-gradient(152deg, var(--glass-light), transparent 68%), var(--glass-tint);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  backdrop-filter: blur(14px) saturate(145%);
  color: #344b65;
  box-shadow: inset 0 1px 0 #ffffff52, 0 8px 22px #15294323;
}
.story-controls button {
  position: relative;
  isolation: isolate;
  flex: 1 0 0;
  min-height: 44px;
  padding: 8px 6px;
  white-space: nowrap;
  font-size: 14px;
  border-radius: 11px;
}
.story-controls button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: var(--glass-hover);
  opacity: 0;
  transition: opacity .18s ease-out;
}
.story-controls button:focus-visible { outline-offset: 1px; }
.story-controls button:focus-visible::before { opacity: 1; }
.story-controls button.active { color: var(--glass-selected-ink); font-weight: 600; }
.story-controls button.active::before {
  opacity: 1;
  background: var(--glass-highlight);
  box-shadow: inset 0 0 0 1px #fffc, 0 2px 7px #142d4922;
}
@media(hover: hover) and (pointer: fine) {
  .story-controls button:hover::before { opacity: 1; }
}

.story-content { display: grid; gap: 18px; min-width: 0; padding-inline: 3px; }
/* Size the shared text row to its longest step so scroll targets below it stay put. */
.story:not(.story-cinematic) .story-copy { grid-area: 1 / 1; }
.story:not(.story-cinematic) [data-story-active="2"] .story-copy { grid-row: 2; }
.story:not(.story-cinematic) .story-copy[hidden] {
  display: block !important;
  visibility: hidden;
}
.story-copy h2 { font-size: clamp(30px, 5.2vw, 52px); line-height: 1.18; }
.story-copy h2 span { color: #485e7d; }
.story-copy > p {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.75;
  color: #435467;
}
.answer-float {
  scroll-margin-top: 18px;
  grid-row: 1;
  border: 1px solid #fafffff0;
  border-radius: 16px;
  background: linear-gradient(148deg, #ffffffdf 4%, #e7f1fdaf 83%);
  -webkit-backdrop-filter: blur(12px) saturate(128%);
  backdrop-filter: blur(12px) saturate(128%);
  color: #233e5a;
  box-shadow: inset 0 1px 0 #fff9, 0 10px 28px #263a5520;
}
.story:not(.story-cinematic) .answer-float { margin-top: 10px; }
.answer-question { padding: 11px 16px; border-bottom: 1px solid #58779931; }
.answer-question > span { font-size: 12px; color: #465f7c; }
.answer-question p { font-size: 14px; }
.answer-response { padding: 12px 16px; }
.answer-label { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; }
.answer-label img { width: 21px; height: 21px; }
.answer-response > p { margin-top: 8px; font-size: 14px; line-height: 1.65; }
.answer-source {
  margin-top: 8px;
  border-top: 1px solid #58779931;
  color: #405b78;
  font-size: 13px;
}
.answer-source summary { cursor: pointer; padding-block: 9px 0; }
.answer-source strong { margin-inline-start: 5px; font-weight: 600; color: #233e5a; }
.answer-source p { padding-top: 5px; }
.story[data-interacted] .story-copy:not([hidden]),
.story[data-interacted] .answer-float:not([hidden]) {
  animation: story-content-in .18s ease-out both;
}
@keyframes story-content-in {
  from { opacity: .65; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* The same video remains mounted while the viewport crops it to the final frame. */
.story-cinematic { height: calc(160svh - var(--nav)); }
.story-cinematic .story-pin {
  --frame-height: min(604px, calc(100svh - var(--nav) - 102px));
  --frame-width: calc(var(--frame-height) * var(--device-width-parts) / var(--device-height-parts));
  --frame-top: calc((100% - var(--frame-height) - 38px) / 2);
  --frame-right: calc(26% - var(--frame-width) / 2);
  --frame-bottom: calc(100% - var(--frame-top) - var(--frame-height));
  --frame-left: calc(74% - var(--frame-width) / 2);
  position: sticky;
  top: var(--nav);
  display: block;
  width: 100%;
  height: calc(100svh - var(--nav));
  padding: 0;
  overflow: clip;
  isolation: isolate;
}
.story-cinematic .story-stage {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  width: 100%;
  margin: 0;
  overflow: visible;
}
.story-cinematic .scene-window {
  overflow: visible;
  border-radius: 0;
  clip-path: inset(
    calc(var(--frame-top) * var(--shot, 0))
    calc(var(--frame-right) * var(--shot, 0))
    calc(var(--frame-bottom) * var(--shot, 0))
    calc(var(--frame-left) * var(--shot, 0))
    round calc(var(--device-radius) * var(--shot, 0))
  );
}
.story-cinematic .scene-video { object-position: 50% 48%; }
.story-cinematic .story-device {
  inset: var(--frame-top) var(--frame-right) var(--frame-bottom) var(--frame-left);
  opacity: var(--framing, 0);
}
.story-cinematic .story-pin.story-manual .scene-window { transition: clip-path .34s var(--ease); }
.story-cinematic .story-pin.story-manual .story-device { transition: opacity .22s ease-out; }
.story-cinematic .film-label { top: 25px; left: max(5%, 24px); opacity: var(--scene-label, 1); }
.story-cinematic .demo-caption {
  bottom: calc(var(--frame-bottom) - 25px);
  right: calc(var(--frame-right) + var(--frame-width) / 2);
  left: auto;
  transform: translateX(50%);
  opacity: var(--framing, 0);
}
.story-cinematic .live-top { right: 17px; left: 17px; }
.story-cinematic .live-caption { left: 17px; right: 17px; }
.story-cinematic .live-chat { left: 17px; right: 17px; }
.story-cinematic .story-controls {
  position: absolute;
  z-index: 2;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(405px, 52%);
}
.story-cinematic .story-pin:not(.story-framed) .story-controls {
  --glass-edge: #d5e8ff55;
  --glass-light: #b3cce43b;
  --glass-tint: #142439c7;
  --glass-hover: #c1d9fc29;
  color: #eef5ff;
}
.story-cinematic .story-content {
  position: absolute;
  z-index: 1;
  left: max(6%, calc(50% - 595px));
  top: calc(50% - 24px);
  width: min(42%, 480px);
  padding: 0;
  transform: translateY(-50%);
  opacity: var(--story-copy-opacity, 1);
}
.story-cinematic .story-pin[data-story-active="2"] .story-content {
  --response-gap: clamp(26px, 4.3svh, 40px);
  gap: var(--response-gap);
  top: calc(50% - 24px + (var(--response-gap) - 18px) / 2);
}
.story-cinematic .story-pin:not(.story-framed) .story-content { color: #fff; text-shadow: 0 1px 20px #061220; }
.story-cinematic .story-pin:not(.story-framed) .story-copy > p { color: #f0f5fb; }
.story-cinematic .story-stage::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  opacity: var(--story-shade, 1);
  background: linear-gradient(90deg, #0a172abd, #0a172a27 59%, transparent 80%);
}
.story-cinematic .story-device { z-index: 2; }
.story-cinematic .story-copy > p { font-size: 16px; }
.story-cinematic .answer-float { grid-row: auto; width: min(100%, 396px); }
.story-cinematic .story-pin:not(.story-device-visible) .story-device { visibility: hidden; }

/* Keep the image, controls and response in document flow on narrow screens. */
.story-compact .story-pin {
  --compact-height: min(clamp(320px, 66svh, 560px), calc((100vw - 62px) * var(--device-height-parts) / var(--device-width-parts)));
  --compact-hold: clamp(118px, 24svh, 196px);
}
.story-compact .story-track {
  display: flow-root;
  height: calc(var(--compact-height) + var(--compact-hold) + 28px);
}
.story-compact .story-stage {
  --frame-width: calc(var(--compact-height) * var(--device-width-parts) / var(--device-height-parts));
  --frame-side: max(0px, calc((100% - var(--frame-width)) / 2));
  position: sticky;
  z-index: 1;
  top: calc(var(--nav) + 10px);
  align-self: start;
  width: 100%;
  height: var(--compact-height);
  margin-bottom: 28px;
  aspect-ratio: auto;
}
.story-compact .scene-window {
  clip-path: inset(
    0 calc(var(--frame-side) * var(--shot, 0))
    0 calc(var(--frame-side) * var(--shot, 0))
    round calc(19px + 16px * var(--shot, 0))
  );
  border-radius: 0;
}
.story-compact .story-device {
  inset-inline: var(--frame-side);
  opacity: var(--framing, 0);
}
.story-compact .story-pin:not(.story-device-visible) .story-device { visibility: hidden; }
.story-compact .story-manual .scene-window { transition: clip-path .28s var(--ease); }
.story-compact .story-manual .story-device { transition: opacity .2s ease-out; }
.story-compact .film-label { top: 14px; opacity: var(--scene-label, 1); }
.story-compact .demo-caption { opacity: var(--framing, 0); }
.story-compact .live-caption { left: 13px; right: 13px; bottom: 115px; font-size: 13px; }
.story-compact .live-chat { left: 11px; right: 11px; }

@media(min-width:761px) and (max-height:730px) {
  .story-cinematic .story-copy h2 { font-size: clamp(32px, 4vw, 46px); }
  .story-cinematic .story-copy > p { font-size: 14px; }
}
.motion-paused .story-copy, .motion-paused .answer-float { animation: none !important; }
.motion-paused .story-controls button::before { transition: none; }
