/* Keep mobile content and controls in document flow, including async widgets. */
@media(max-width:760px){
body.mobile-hero-layout #home.hero{display:flex!important;flex-direction:column;gap:20px;height:auto!important;min-height:0!important;max-height:none!important;padding:110px 20px 28px!important;overflow:hidden;perspective:none;background:#e8f1ff}
body.mobile-hero-layout[data-design="neon"] #home.hero{background:#081436}
body.mobile-hero-layout #home.hero:before,body.mobile-hero-layout #home.hero:after{display:none!important}
body.mobile-hero-layout #home.hero .hero-top{order:0;position:relative!important;inset:auto!important;padding:0!important;margin:0!important;transform:none!important;translate:none!important;opacity:1!important;width:100%!important}
body.mobile-hero-layout #home.hero h1{font-size:clamp(32px,10.5vw,76px)!important;line-height:1.06!important;letter-spacing:-.025em!important;margin:0!important}
body.mobile-hero-layout #home.hero h1 span{font-size:1em!important}
body.mobile-hero-layout #home.hero .kinetic-word{transform:none!important;translate:none!important;opacity:1!important;filter:none!important}
body.mobile-hero-layout #home.hero .eyebrow{font-size:12px!important;letter-spacing:.08em!important;line-height:1.5;margin:0 0 16px!important;white-space:normal}
body.mobile-hero-layout #home.hero .experience{order:1;position:relative!important;inset:auto!important;margin:0!important;padding:12px 16px!important;display:flex!important;align-items:center;gap:16px;transform:none!important;translate:none!important;align-self:flex-start}
body.mobile-hero-layout #home.hero .experience b{font-size:36px!important}body.mobile-hero-layout #home.hero .experience span{font-size:12px!important}
body.mobile-hero-layout #home.hero .hero-art{order:2;position:relative!important;inset:auto!important;width:calc(100% + 40px)!important;max-width:none!important;margin:0 -20px!important;height:auto!important;aspect-ratio:4/5;object-fit:cover!important;object-position:50% 35%!important;transform:none!important;scale:1!important;translate:none!important;animation:none!important;mask-image:none!important;filter:none!important}
body.mobile-hero-layout #home.hero .hero-bottom{order:3;position:relative!important;inset:auto!important;margin:0!important;padding:0!important;width:100%!important;transform:none!important;translate:none!important;animation:none!important}
body.mobile-hero-layout #home.hero .hero-bottom p{font-size:18px!important;line-height:1.5!important;margin:0 0 20px!important}
body.mobile-hero-layout #home.hero .button{width:100%;box-sizing:border-box;font-size:16px!important;padding:18px 20px!important;animation:none!important;transform:none!important}
body.mobile-hero-layout #home.hero .hero-tags{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;font-size:12px!important;margin-top:20px}
body.mobile-hero-layout #home.hero .avatar-orbit{display:none!important}
body.mobile-hero-layout #home.hero .hero-game{order:4;position:relative!important;inset:auto!important;transform:none!important;margin:0!important;width:100%!important;max-width:100%!important;box-sizing:border-box}
body.mobile-hero-layout .mobile-hero-tools{order:5;display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px;width:100%}
body.mobile-hero-layout .mobile-hero-tools>.engagement-badge,body.mobile-hero-layout .mobile-hero-tools>.visitor-counter,body.mobile-hero-layout .mobile-hero-tools>.sound-dock,body.mobile-hero-layout .mobile-hero-tools>.sound-dock-launcher,body.mobile-hero-layout .mobile-hero-tools>.pn-trigger,body.mobile-hero-layout .mobile-hero-tools>.game-nav{position:relative!important;inset:auto!important;transform:none!important;translate:none!important;margin:0!important;max-width:100%!important;min-width:0!important;box-sizing:border-box;z-index:5!important}
body.mobile-hero-layout .mobile-hero-tools>.engagement-badge,body.mobile-hero-layout .mobile-hero-tools>.visitor-counter{flex:1 1 155px;box-shadow:none!important}
body.mobile-hero-layout .mobile-hero-tools .sound-toggle{position:relative!important;inset:auto!important;max-width:100%;font-size:14px!important}
body.mobile-hero-layout .mobile-hero-tools>.sound-dock{flex:1 1 100%;width:100%!important}
body.mobile-hero-layout .mobile-hero-tools>.game-nav{flex:1 1 100%;width:100%!important;display:flex!important;flex-wrap:wrap;gap:12px;padding:12px!important}
body.mobile-hero-layout .mobile-hero-tools .game-nav__links,body.mobile-hero-layout .mobile-hero-tools .game-nav__worlds{display:flex!important;flex-direction:row!important;flex-wrap:wrap;gap:8px;width:100%}
body.mobile-hero-layout .mobile-hero-tools .game-nav a,body.mobile-hero-layout .mobile-hero-tools .game-nav button{min-height:44px!important;width:auto!important;position:relative!important;inset:auto!important;transform:none!important}
body.mobile-hero-layout .mobile-hero-tools .game-nav:before,body.mobile-hero-layout .mobile-hero-tools .game-nav__hint{display:none!important}
}

@media(max-width:760px){
body.mobile-hero-layout #home.hero{isolation:isolate;background:#c3dafa!important}
body.mobile-hero-layout #home.hero:before{content:'';display:block!important;position:absolute!important;inset:0 0 auto!important;width:100%;height:calc(var(--mobile-portrait-top,440px) + 160px);background:linear-gradient(90deg,#eaf3ff45,transparent 80%),url('/assets/mobile-cloud-continuation.webp') center top/cover no-repeat;pointer-events:none;z-index:-1;mask-image:linear-gradient(#000 0%,#000 calc(100% - 100px),transparent)}
body.mobile-hero-layout #home.hero .hero-art{mask-image:linear-gradient(to bottom,transparent 0,#000 48px,#000 72%,rgba(0,0,0,.95) 78%,rgba(0,0,0,.72) 85%,rgba(0,0,0,.32) 93%,transparent 100%)!important;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 48px,#000 72%,rgba(0,0,0,.95) 78%,rgba(0,0,0,.72) 85%,rgba(0,0,0,.32) 93%,transparent 100%)!important}
body.mobile-hero-layout #home.hero .hero-top{background:transparent!important}
body.mobile-hero-layout[data-design="neon"] #home.hero{background:#081436!important}
body.mobile-hero-layout[data-design="neon"] #home.hero:before{background:linear-gradient(90deg,#060d3026,transparent 80%),url('/assets/mobile-neon-continuation.webp') center top/cover no-repeat,#081436}
body.mobile-hero-layout .mobile-hero-tools>.pn-dock{position:relative!important;inset:auto!important;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:12px;max-width:100%;width:100%;z-index:5;pointer-events:auto}
}

/* Keep secondary tools desktop-only; theme voting stays in the mobile flow. */
@media(max-width:760px){
body.mobile-hero-layout .mobile-hero-tools{display:none!important}
body.mobile-hero-layout #home.hero .hero-game{display:block!important;flex:none;min-width:0;padding:16px}
body.mobile-hero-layout #home.hero .hero-game__top{flex-wrap:wrap;gap:8px}
body.mobile-hero-layout #home.hero .hero-game__top p,
body.mobile-hero-layout #home.hero .hero-game__total,
body.mobile-hero-layout #home.hero .hero-game__ballot>p,
body.mobile-hero-layout #home.hero .hero-game__status{font-size:14px;line-height:1.4;letter-spacing:normal}
body.mobile-hero-layout #home.hero .hero-game__choices{grid-template-columns:repeat(2,minmax(0,1fr))}
body.mobile-hero-layout #home.hero .hero-game__choice{min-width:0;min-height:116px;padding:12px}
body.mobile-hero-layout #home.hero .hero-game__choice small{left:12px;right:12px;font-size:12px;line-height:1.4;white-space:normal}
body.mobile-hero-layout #home.hero .hero-game__vote{min-height:48px;font-size:16px;gap:12px}
body.mobile-hero-layout #home.hero .hero-game__status{overflow-wrap:anywhere}
}

/* Keep decorative overflow inside the mobile viewport across every home section. */
@media(max-width:760px){
html{width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;overflow-x:hidden!important;scrollbar-gutter:auto!important;overscroll-behavior-x:none;background:#c3dafa}
body.mobile-hero-layout{width:100%!important;max-width:100%!important;min-width:0!important;margin-inline:0!important;padding-inline:0!important;overflow-x:hidden!important;position:relative;overscroll-behavior-x:none}
body.mobile-hero-layout>main{width:100%;max-width:100%;min-width:0;margin-inline:0}
body.mobile-hero-layout>main>section{max-width:100%;min-width:0;box-sizing:border-box}
}

/* Avoid scroll-driven 3D layers and continuous repainting in the phone portfolio. */
@media(max-width:760px){
body.mobile-hero-layout .projects{perspective:none!important}
body.mobile-hero-layout .project{transform:none!important;translate:none!important;rotate:none!important;scale:1!important;opacity:1!important;filter:none!important;transform-style:flat!important;box-shadow:0 10px 24px #173c781a!important}
body.mobile-hero-layout .project,body.mobile-hero-layout .project *,body.mobile-hero-layout .project::before,body.mobile-hero-layout .project::after,body.mobile-hero-layout .project *::before,body.mobile-hero-layout .project *::after{animation:none!important;transition:none!important;will-change:auto!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body.mobile-hero-layout .project::after{opacity:0!important}
body.mobile-hero-layout .project .award-aura,body.mobile-hero-layout .project .award-rays{filter:none!important}
}

@media(max-width:760px){
body.mobile-hero-layout #home.hero .hero-art{margin:-48px -20px 0!important}
}

/* Clip transformed decorations inside the document on mobile Safari. */
@media(max-width:760px){
body{width:100%;max-width:100%;min-width:0;margin:0;overflow-x:hidden!important;position:relative;overscroll-behavior-x:none}
body.mobile-hero-layout>main{overflow:hidden;position:relative}
body.mobile-hero-layout>header{max-width:100%;box-sizing:border-box}
body.mobile-hero-layout>main>section{width:100%;margin-inline:0}
body.mobile-hero-layout .ticker{max-width:100%;transform:none!important}
body.mobile-hero-layout .projects,body.mobile-hero-layout .inquiry-layout,body.mobile-hero-layout .about.section{min-width:0}
body.mobile-hero-layout .projects>*,body.mobile-hero-layout .inquiry-layout>*{min-width:0;max-width:100%;box-sizing:border-box}
}

.mobile-theme-switch{display:none}
@media(max-width:760px){
body.mobile-hero-layout>header{align-items:flex-start;gap:12px;padding:24px 20px}
body.mobile-hero-layout>header .wordmark{font-size:14px;letter-spacing:3px;flex:0 1 auto;min-width:0}
body.mobile-hero-layout>header .wordmark span{display:none}
body.mobile-hero-layout .mobile-theme-switch{display:flex;flex:0 0 auto;gap:2px;margin-left:auto;padding:4px;border:1px solid #ffffffa6;border-radius:28px;background:#edf4ffde;box-shadow:0 4px 18px #17396d16}
body.mobile-hero-layout .mobile-theme-switch button{appearance:none;min-height:44px;min-width:58px;padding:8px;border:0;border-radius:22px;background:transparent;color:#17366b;font:600 14px/1.2 Manrope,Arial,sans-serif;cursor:pointer;touch-action:manipulation}
body.mobile-hero-layout .mobile-theme-switch button[aria-pressed="true"]{background:#173fee;color:#fff;box-shadow:0 2px 8px #173fee30}
body.mobile-hero-layout .mobile-theme-switch button:focus-visible{outline:2px solid #173fee;outline-offset:2px}
body.mobile-hero-layout .mobile-theme-switch button:disabled{opacity:.5;cursor:wait}
body.mobile-hero-layout[data-design="neon"] .mobile-theme-switch{background:#121645ed;border-color:#797aff;border-radius:12px}
body.mobile-hero-layout[data-design="neon"] .mobile-theme-switch button{color:#e9edff;border-radius:8px}
body.mobile-hero-layout[data-design="neon"] .mobile-theme-switch button[aria-pressed="true"]{background:#d8ff63;color:#10153d}
}
