/* The scene is deliberately self-contained: the landing owns type and colour. */
.device-story {
  --scene-accent: #147d74;
  --scene-ink: #242628;
  --scene-muted: #6d7278;
  position: relative;
  height: 220svh;
  min-height: 1240px;
  isolation: isolate;
}
.device-pin {
  position: sticky;
  top: 72px;
  width: 100%;
  padding: 20px 0 24px;
}
.device-heading { position: relative; z-index: 2; text-align: center; padding: 0 22px; }
.device-heading h2 { margin: 0; font-size: clamp(30px, 4.2vw, 57px); line-height: 1.07; letter-spacing: -.045em; font-weight: 600; }
.device-heading p { margin: 14px 0 0; color: var(--scene-muted); font-size: clamp(15px, 1.3vw, 18px); line-height: 1.5; }
.device-viewport {
  position: relative;
  height: clamp(400px, 65svh, 720px);
  width: min(100%, 1440px);
  margin: 8px auto 0;
}
.device-viewport::after {
  content: "";
  position: absolute;
  bottom: 1%;
  left: 50%;
  width: var(--scene-shadow-width, 66%);
  height: 20px;
  background: radial-gradient(ellipse, rgb(34 40 49 / .15), transparent 70%);
  filter: blur(7px);
  transform: translateX(-50%);
  pointer-events: none;
}
.device-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  touch-action: pan-y;
}
.device-fallback {
  position: absolute;
  inset: 3% 4%;
  width: 92%;
  height: 94%;
  object-fit: contain;
  border-radius: 22px;
}
.device-story.is-rendered .device-canvas { opacity: 1; }
.device-story.is-rendered .device-fallback { visibility: hidden; }
.device-story.is-fallback-phone .device-fallback {
  width: auto;
  max-width: 90%;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  border: 8px solid #191b20;
  border-radius: 35px;
  box-shadow: 0 20px 36px rgb(0 0 0 / .12);
}
.device-controls {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: fit-content;
  max-width: calc(100% - 28px);
  padding: 5px;
  margin: 10px auto 0;
  border: 1px solid rgb(30 35 40 / .08);
  border-radius: 99px;
  background: rgb(255 255 255 / .76);
  box-shadow: 0 4px 16px rgb(0 0 0 / .035), inset 0 1px 0 rgb(255 255 255 / .8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.device-controls button {
  appearance: none;
  min-height: 44px;
  padding: 10px 17px;
  border: 0;
  border-radius: 999px;
  color: #5b6168;
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 180ms cubic-bezier(.23,1,.32,1), color 180ms cubic-bezier(.23,1,.32,1), box-shadow 180ms cubic-bezier(.23,1,.32,1);
}
.device-controls button[aria-pressed="true"] { background: #fff; color: #17191d; box-shadow: 0 1px 5px rgb(0 0 0 / .1); }
.device-controls button[data-scene-play] { color: color-mix(in srgb, var(--scene-accent) 70%, #111); font-weight: 600; }
.device-controls button:focus-visible { outline: 3px solid var(--scene-accent); outline-offset: 3px; }
.device-caption { max-width: 620px; padding: 0 24px; margin: 15px auto 0; text-align: center; color: var(--scene-muted); font-size: 13px; line-height: 1.5; }
.device-story[data-theme="dark"] { --scene-ink: #f5f5f7; --scene-muted: #abaeb7; }
.device-story[data-theme="dark"] .device-controls { background: rgb(42 44 48 / .8); border-color: rgb(255 255 255 / .1); box-shadow: inset 0 1px 0 rgb(255 255 255 / .12); }
.device-story[data-theme="dark"] .device-controls button { color: #bfc2cb; }
.device-story[data-theme="dark"] .device-controls button[aria-pressed="true"] { color: #fff; background: #45484e; }
.device-story[data-theme="dark"] .device-controls button[data-scene-play] { color: #dfebeb; }
.device-story.is-reduced, .device-story.is-fallback { height: auto; min-height: 0; }
.device-story.is-reduced .device-pin, .device-story.is-fallback .device-pin { position: relative; top: auto; }
@media (hover: hover) and (pointer: fine) {
  .device-controls button:hover { background: rgb(0 0 0 / .045); color: var(--scene-ink); }
  .device-story[data-theme="dark"] .device-controls button:hover { background: rgb(255 255 255 / .09); color: #fff; }
}
@media (max-width: 600px) {
  .device-story { height: 200svh; min-height: 1080px; }
  .device-pin { top: 62px; padding-top: 18px; }
  .device-heading h2 { font-size: 33px; }
  .device-heading p { font-size: 14px; margin-top: 10px; }
  .device-viewport { height: clamp(360px, 55svh, 500px); margin-top: 0; }
  .device-controls { gap: 2px; padding: 4px; margin-top: 2px; }
  .device-controls button { padding: 10px 12px; font-size: 12px; min-height: 44px; }
  .device-caption { margin-top: 11px; font-size: 12px; }
}
@media (max-height: 760px) and (min-width: 601px) {
  .device-heading h2 { font-size: 34px; }
  .device-heading p { margin-top: 8px; font-size: 14px; }
  .device-viewport { height: 49svh; min-height: 300px; }
  .device-pin { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .device-story { height: auto; min-height: 0; }
  .device-pin { position: relative; top: auto; }
  .device-controls button { transition: none; }
}
