/* Touch-friendly controls. Pinch remains available; double-tap zoom is disabled. */
html,body,button,a,input,svg{touch-action:manipulation}
button,input,select,textarea{font-size:16px}
.device-preview{display:block;width:100%;border:0;padding:0;background:none;color:inherit;touch-action:manipulation}
.phone-shell{position:relative;display:block;width:100%;aspect-ratio:868/1812;filter:drop-shadow(0 12px 12px #51473524)}
.phone-display{position:absolute;inset:3.7% 7.4% 3.8%;overflow:hidden;border-radius:13% / 6%;background:#faf7f0}
.device .phone-screen{display:block;width:100%;height:100%;aspect-ratio:auto;object-fit:contain;border-radius:0;background:#faf7f0}
.device .phone-hardware{position:absolute;inset:0;display:block;width:100%;height:100%;aspect-ratio:auto;object-fit:fill;background:none;border-radius:0;pointer-events:none}
.phone-lineup{touch-action:pan-y pinch-zoom;user-select:none;-webkit-user-select:none}
.phone-controls{display:flex;justify-content:center;align-items:center;gap:18px;margin:8px 0 18px}
.phone-controls button{width:44px;height:44px;background:transparent;border:1px solid #b8ac8d;border-radius:50%;color:#59503d}
.phone-controls output{font:400 13px/1.5 var(--sans);color:#6c6659;min-width:120px;text-align:center}
.phone-loading{width:100%;text-align:center;padding:40px 0;color:#6c6659}
.mobile-nav,.mobile-work-links{display:none}
@media(max-width:700px){
 body.is-mobile-profile{overflow:hidden;overscroll-behavior:none}
 body.is-mobile-profile .resume-scene{position:fixed;inset:0;z-index:60;width:100%;height:100dvh}
 html,body{width:100%;max-width:100%;overflow-x:clip}
 #story{height:440svh}
 .pin-stage{position:sticky;top:0;height:100svh;min-height:0;background:#91aef1;transform:translateZ(0);backface-visibility:hidden}
 body.is-dark .pin-stage{background:#30283d}
 .pin-stage::before{content:'';position:absolute;inset:0;background:#91aef1 url(assets/musicbox-layers/mobile-starfield.webp) center top/100% auto repeat-y;pointer-events:none}
 body.is-dark .pin-stage::before{background-image:url(assets/credits-room.webp);background-size:cover;background-repeat:no-repeat;filter:blur(36px);opacity:.2}
 .camera-world .browser{background:transparent}
 .mobile-screen-contained .camera-world .browser{background:#92aef0 url(assets/musicbox-layers/mobile-starfield.webp) center/cover}
 .layers-ready.world-panel{background:transparent}
 .layers-ready>.world-wash{display:none}
 .mobile-nav{position:absolute;z-index:20;top:max(14px,env(safe-area-inset-top));left:16px;right:16px;display:flex;justify-content:center;gap:7px;pointer-events:auto}
 .mobile-nav button{min-height:44px;padding:9px 15px;border:1px solid #fff4e86b;border-radius:22px;background:#f6eee8df;color:#343c60;font:500 14px/1.4 var(--sans)}
 .mobile-nav button[aria-pressed=true]{background:#f2c7d5;color:#453448}
 .mobile-work-links{position:absolute;z-index:20;left:16px;right:16px;bottom:max(52px,calc(env(safe-area-inset-bottom) + 30px));display:flex;gap:8px;justify-content:center;pointer-events:auto}
 .mobile-work-links button{min-height:44px;padding:10px 12px;border:1px solid #fff2e76e;border-radius:6px;background:#efe5e2e8;color:#45405c;font:400 13px/1.4 var(--sans)}
 .mobile-work-links[hidden]{display:none}
 .mobile-tap-note{position:absolute;bottom:100%;left:0;right:0;margin:0 0 14px;text-align:center;color:#fff9edcc;font:400 11px/1.5 var(--sans);letter-spacing:.08em;pointer-events:none}
 .world-note{display:none}
 #detail,#detail:has(.douding-case){width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100svh - 24px);border-radius:16px;overscroll-behavior:contain}
 .detail-body{padding:22px 16px 24px;overflow-x:clip}
 .dialog-close{top:8px;width:44px;height:44px;margin:8px 8px 0 0;z-index:10}
 .detail-body h2{font-size:28px;line-height:1.35}
 .douding-case{padding:12px 0 4px}
 .douding-context{margin:0 38px 20px 0}
 .douding-context h3{font-size:19px;margin:0 0 9px}
 .douding-context p{font-size:14px;line-height:1.75}
 .douding-select{justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;gap:18px;padding:8px 0 12px;margin-bottom:12px;scrollbar-width:none}
 .douding-select button{flex:none;min-height:44px;font-size:14px;white-space:nowrap}
 .phone-lineup{position:relative;display:block;overflow:hidden;padding:0;height:calc(min(72vw,290px)*1812/868 + 35px);margin:0 -8px}
 .device{position:absolute;top:0;left:50%;width:min(72vw,290px);max-width:none;transform:translateX(-50%);margin:0;transition:opacity .2s ease}
 .device-1{width:min(56vw,220px);top:9%;opacity:.55;transform:translateX(-50%)}
 .device-1[data-offset='-1']{left:-31%}
 .device-1[data-offset='1']{left:131%}
 .device-2{display:none}
 .device figcaption{font-size:13px;margin-top:9px}
 .phone-controls{margin-top:0}
 .book-frame{height:min(66svh,620px);margin:14px auto}
 .work-nav{gap:10px}.work-nav button{min-height:44px;padding:8px 12px;font-size:14px}
 .work-nav input{width:100%;order:4;min-height:36px}
 .work-board img{height:auto;max-height:68svh}
 #detail .panel{position:relative;inset:auto;width:100%;height:auto;min-height:0;opacity:1!important;visibility:visible;pointer-events:auto;transform:none!important}
 #detail .screening{position:relative;inset:auto;width:100%;height:auto;min-height:0;padding:12px 0 0;display:flex;container-type:normal}
 #detail .theatre-frame{width:100%;aspect-ratio:auto;background:none}
 #detail .theatre-frame .film-stage{position:relative;inset:auto;container-type:normal;border-radius:8px;background:#b8c9f2}
 #detail .film-stage video{display:block;width:100%;height:auto;aspect-ratio:16/9;background:#191725}
 #detail .film-stage article{position:relative;inset:auto;display:block;padding:24px 17px;background:#bdcef0;color:#343955;text-align:center}
 #detail .film-stage article[hidden]{display:none}
 #detail .film-titles{position:static;inset:auto;transform:none;width:100%;text-shadow:none}
 #detail .film-titles i{font-size:14px;line-height:1.5;letter-spacing:.03em}
 #detail .film-stage .film-titles h2{font-size:36px;margin:8px 0 15px;line-height:1.3}
 #detail .film-stage .film-titles h3{font-size:15px;line-height:1.6;letter-spacing:.04em}
 #detail .film-titles p{font-size:14px;line-height:1.8;color:#343955}
 #detail .film-stage article>button{position:static;min-height:44px;margin-top:20px;font-size:15px}
 #detail .screening footer{height:auto;min-height:64px;flex-wrap:wrap;padding:10px 0;gap:10px}
 #detail .screening nav{gap:2px}#detail .screening nav button{min-height:44px;font-size:14px;padding:9px 12px}
 #detail .screening footer::before,#detail .screening footer::after{display:none}
 #detail .screening .film-info{position:static;min-height:44px;font-size:14px}
 #detail .code-work{display:flex;flex-direction:column;gap:22px;padding:12px 0 24px;height:auto;color:#403a4a;background:#f1e6e5}
 #detail .code-work>div{padding:0 22px}#detail .code-work img{width:100%;height:auto}
 #detail .code-work h2{font-size:28px}#detail .code-work p{font-size:15px;margin:12px 0}
 #detail .code-work a{display:inline-block;min-height:44px;padding:10px 0;font-size:15px}
 .resume-scene{height:100dvh;--figure-height:min(148svh,300vw);--foot-gap:2.4svh}
 .resume-scene .orbit-video{top:7svh;bottom:auto;height:var(--figure-height);max-width:none}
 .resume-scene::after{display:none}
 .resume-scene .resume-scroll{inset:44svh 0 0;padding:22px 22px calc(20px + env(safe-area-inset-bottom));scroll-padding-top:20px;-webkit-overflow-scrolling:touch;border-radius:24px 24px 0 0;border-top:1px solid #bba8bd54;background:rgba(52,43,67,.94)}
 .resume-scene .resume-scroll::before{content:'';display:block;width:30px;height:3px;margin:-10px auto 18px;border-radius:3px;background:#b8aabd66}
 .resume-scroll .resume-beat,.resume-scroll .resume-beat.resume-paper{width:100%;max-width:none;min-height:0;padding:0;margin:0 0 18px}
 .resume-copy,.resume-paper .resume-copy{padding:0;background:none;border:0;text-shadow:none;opacity:1;transform:none}
 .resume-copy h2,.resume-beat:nth-child(odd) .resume-copy h2{font-size:19px;line-height:1.35;margin:8px 0 10px;letter-spacing:0}
 .resume-copy p{max-width:12em;font-size:13px;line-height:1.65;letter-spacing:0;margin:.5em 0}
 .resume-copy{width:max-content;max-width:100%;margin-inline:auto}
 .resume-copy small{font-size:11px;letter-spacing:.05em;padding:2px 7px}
 .resume-actions{top:max(10px,env(safe-area-inset-top));left:12px;right:12px;gap:8px;justify-content:center}
 .resume-actions>*{min-height:44px;font-size:12px;padding:10px 12px;white-space:nowrap}
 .software-icon{width:40px;height:40px}
 .resume-scroll .resume-ending{min-height:46dvh;margin:16px -22px calc(-20px - env(safe-area-inset-bottom));width:calc(100% + 44px);padding:0}
 .resume-ending .ending-copy{padding:30px 18px}.resume-ending h2{font-size:30px;margin-bottom:24px}.resume-ending nav{gap:8px;margin-top:23px}.resume-ending nav>*{min-height:44px;font-size:13px;padding:10px 15px}
 .resume-scene .packed-video{position:absolute;width:1px;height:1px;top:0;left:0;opacity:0;filter:none;transform:none;pointer-events:none}
 .resume-scene.is-ending .ending-copy{position:fixed;inset:0;z-index:8;box-sizing:border-box;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#30283e;opacity:1;transform:none;transition:none;padding:28px 20px max(28px,env(safe-area-inset-bottom))}
 .resume-scene.is-ending .resume-actions{visibility:hidden;pointer-events:none}
}
