/* Slim black preview: a uniform 5px rim around the 402 × 874 live display. */
.phone{aspect-ratio:412/884;padding:0;--radius:52px;border:0;border-radius:13% / 6.059%;background:linear-gradient(115deg,#272b2d,#080a0b 18%,#111416 76%,#25292b)}
.hero-stage .phone,.hero-stage:hover .phone,.demo-dialog .demo-phone{box-shadow:inset 0 0 0 1px #42494b,0 22px 50px #0005}
.phone>.phone-bezel{position:absolute;inset:.56561% 1.21359%;padding:0;border:0;border-radius:12.08% / 5.556%;background:#050607;box-shadow:0 0 0 1px #0009;transform:none}
.phone .phone-display{position:absolute;inset:0;width:auto;height:auto;aspect-ratio:auto;border-radius:inherit;clip-path:none;overflow:hidden}
.phone .phone-display::after{box-shadow:inset 0 0 0 1px #ffffff0d;background:none}
.phone .phone-depth{inset:1px -2px 1px 2px;border-radius:inherit;background:linear-gradient(90deg,#15191b,#040506 65%,#262b2d);box-shadow:6px 18px 30px #0005;transform:translateZ(-5px)}
.phone .phone-depth::after{box-shadow:inset -1px 0 #353b3d,inset 1px 0 #1c2022}
.phone .phone-button{width:2px;background:linear-gradient(90deg,#080a0b,#33393b,#111416);box-shadow:0 0 0 1px #090b0c}
.phone .phone-button:is(.action,.volume-up,.volume-down){left:-2px}
.phone .phone-button.power{right:-2px}
.phone .antenna{width:2px;background:#2c3234}
.phone :is(.phone-status,.dynamic-island,.phone-home){display:none}
.phone .live-canvas{width:402px;height:874px;top:0;left:0}
.phone .live-app{inset:0;width:402px;height:874px;background:#17221c}
.demo-dialog .demo-phone{width:min(434px,calc((100dvh - 72px)*.466063));padding:0}
.demo-phone #demo-frame{position:absolute;inset:0;width:402px;height:874px;transform-origin:0 0;border-radius:0;background:#17221c}
/* The invitation is a blurred image on a dimensional shell. The live app loads
   only in the flat dialog, avoiding Safari's filtered-iframe painting issue. */
#hero-phone{transform:translateY(var(--phone-lift,0px)) rotateX(calc(3deg + var(--phone-x,0deg))) rotateY(calc(-10deg + var(--phone-y,0deg))) rotateZ(calc(-3deg + var(--phone-roll,0deg)));transform-style:preserve-3d;isolation:auto}
#hero-phone .phone-depth{transform:translateZ(-5px);z-index:0}
#hero-phone .phone-bezel{z-index:1;transform-style:flat}
/* Preserve the full header beneath the camera. Continue the captured app's
   green-to-charcoal background into the safe area, without a black top strip. */
#hero-phone .phone-preview{position:absolute;inset:40px 0 auto;width:402px;height:824px;object-fit:fill;backface-visibility:visible;filter:blur(4px);transform:none;opacity:1;mask-image:linear-gradient(transparent,#000 12px,#000 calc(100% - 10px),transparent)}
#hero-phone .live-canvas{background:linear-gradient(90deg,#19241c,#18221b 25%,#171d18 50%,#151914 75%,#131512)}
#hero-phone .live-canvas::before{content:none}
#hero-phone .dynamic-island{display:block;top:9px;width:100px;height:26px;pointer-events:none}
#hero-phone .phone-home{display:block;bottom:6px;height:4px;pointer-events:none}
#hero-phone .live-app{display:none}
#hero-phone .phone-demo-start{z-index:4}
/* The stage never scrolls. Only the app inside its iframe owns a scroll area. */
html:has(#demo-dialog[open]){overflow:hidden;overscroll-behavior:none}
#demo-dialog,#demo-dialog[data-motion]{overflow:clip;overscroll-behavior:none}
#demo-dialog .demo-close,#demo-dialog .demo-close:hover,#demo-dialog .demo-close:active{transform:none}
#demo-dialog .demo-close:focus-visible{outline-offset:-4px}
@media(min-width:651px) and (max-width:820px){
 #demo-dialog .demo-phone{width:min(360px,calc((100dvh - 210px)*.466063))}
}
@media(min-width:821px) and (max-height:520px){
 #demo-dialog .demo-dialog-copy{padding-top:0}
 #demo-dialog[open]{align-items:center}
 #demo-dialog h2{font-size:28px;margin-block:10px}
 #demo-dialog .dialog-note{margin-bottom:8px}
 #demo-dialog .demo-dialog-actions{margin-top:12px}
}
/* On a real phone there is no second simulated phone or unused status strip. */
@media(max-width:650px),(max-height:500px) and (pointer:coarse){
 #demo-dialog .demo-mobile-bar{flex:0 0 44px;height:44px;min-height:44px;background:var(--bg);border-bottom:1px solid var(--line)}
 #demo-dialog .demo-close{width:40px;height:40px;min-height:40px;top:calc(env(safe-area-inset-top) + 2px)}
 #demo-dialog .demo-phone{aspect-ratio:auto;max-width:none;width:100%!important;height:auto;min-height:0}
 #demo-dialog .phone-bezel{position:absolute;inset:0;border-radius:0}
 #demo-dialog .phone-display{position:absolute;inset:0;width:100%;height:100%;border-radius:0;clip-path:none}
 #demo-dialog #demo-frame{inset:0;width:100%;height:100%;border-radius:0}
}
