/* Phone layout for the slide decks; see phone.js. Everything here applies only
   under html.phone, which DeckWelcome.astro sets on phones in portrait or
   landscape. --ps is the slide scale (screen width / 1540), set by the deck's
   fit(). Heavy effects are off on phones: iOS closes tabs that use too much
   memory, and large animated layers at 3x pixel density use a lot. */
html.phone,html.phone body{height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto;-webkit-text-size-adjust:100%}
html.phone #frame{position:relative;inset:auto;min-height:100vh;background:var(--bg)}
html.phone #stage{position:relative;left:auto;top:auto;width:100%!important;height:auto;transform:none!important;overflow:hidden;padding-bottom:calc(64px + env(safe-area-inset-bottom,0px))}

/* the slide, scaled to the screen width */
html.phone #viewport{position:relative;left:0;top:0;width:1540px;height:1080px;transform:scale(var(--ps,.25));transform-origin:0 0;margin-right:calc(1540px * (var(--ps,.25) - 1));margin-bottom:calc(1080px * (var(--ps,.25) - 1));touch-action:pan-y}
html.phone #scenes,html.phone #viewport.ctx #scenes,html.phone #viewport.notes #scenes,html.phone #stage.side #viewport.ctx #scenes{transform:none!important;border-radius:0;box-shadow:none;background-color:transparent}
html.phone #backdrop,html.phone .bg-grain,html.phone #nextHint,html.phone #toolbar,html.phone .deck-qr,html.phone #ctxBtn,html.phone .navrow{display:none!important}
html.phone .bg-glow{animation:none!important}
html.phone .tg,html.phone .dw-veil,html.phone .dw-qr-zoom{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}

/* context and detailed notes, as readable text under the slide */
html.phone #ctx{position:relative;inset:auto;left:auto!important;top:auto;bottom:auto;width:auto!important;max-width:720px;margin:0 auto;transform:none!important;padding:20px 18px 28px;border-left:0;border-top:1px solid var(--line2);background:var(--bg);overflow:visible;box-shadow:none}
html.phone #ctx::before{display:none}
html.phone .ctx-in{max-width:none}
html.phone .ctx-in.swap{opacity:1;transform:none}
html.phone .ctx-k{font-size:12px}
html.phone #ctx h2{margin:8px 0 12px;font-size:24px;line-height:1.15}
html.phone .ctx-b p,html.phone #stage.notes .ctx-b p{margin-bottom:12px;font-size:16px;line-height:1.55}
html.phone .ctx-notes{margin-top:22px;padding-top:16px}
html.phone .ctx-notes>b{font-size:12px}
html.phone .ctx-notes h3{margin:18px 0 8px;font-size:18px}
html.phone .ctx-notes p{margin-bottom:12px;font-size:15.5px;line-height:1.6}
html.phone .ctx-src{font-size:13.5px}

/* the outline becomes a slide-out menu */
html.phone #rail{position:fixed;left:0;top:0;bottom:0;width:min(86vw,340px);height:100%;z-index:60;padding:22px 0 16px;transform:translateX(-102%);transition:transform .35s var(--ez,ease);overflow:hidden}
html.phone #rail.ph-open{transform:none;box-shadow:20px 0 60px rgb(0 0 0 / .45)}
html.phone .topics{margin-top:22px;overflow-y:auto;-webkit-overflow-scrolling:touch}
html.phone .brand{padding:0 20px}
html.phone .brand-t b{font-size:22px}
html.phone .brand-t span{font-size:18px}
html.phone .t-row{height:52px;padding:0 14px 0 20px}
html.phone .t-name{font-size:17px}
html.phone .t-subs>ol{padding-left:52px}
html.phone .sub{height:38px;font-size:15.5px}
html.phone .rail-foot{padding:0 20px}
html.phone .cov{padding:12px 0 0}
.ph-scrim{position:fixed;inset:0;z-index:55;background:rgb(0 0 0 / .5);opacity:0;pointer-events:none;transition:opacity .3s}
.ph-scrim.on{opacity:1;pointer-events:auto}

/* the Begin screen covers the phone screen, not the old 1920 x 1080 stage */
html.phone #begin{position:fixed;inset:0}
html.phone .begin-slit{height:56vh;margin-top:-28vh}
html.phone #beginLink{font-size:18px;padding:16px 22px 16px 30px}

/* bottom bar */
.ph-bar{display:none}
html.phone .ph-bar{position:fixed;left:0;right:0;bottom:0;z-index:50;display:flex;align-items:center;gap:4px;height:calc(58px + env(safe-area-inset-bottom,0px));padding:0 8px env(safe-area-inset-bottom,0px);background:var(--s1,#0f1324);border-top:1px solid var(--line2,rgba(255,255,255,.15));font-family:var(--sans,system-ui,sans-serif);color:var(--text,#f2f3fb)}
.ph-bar button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:44px;height:44px;padding:0 10px;border:0;border-radius:12px;background:none;color:inherit;font:700 13px var(--mono,ui-monospace,monospace);letter-spacing:.06em;text-transform:uppercase;cursor:pointer}
.ph-bar button .i{width:22px;height:22px}
.ph-bar button:disabled{opacity:.3}
.ph-bar button:active{background:rgb(var(--fg-rgb,255 255 255) / .08)}
.ph-bar [data-ph=notes][aria-pressed=true]{background:var(--accent,#3ad8ff);color:var(--on-accent,#07080d)}
.ph-bar [data-ph=notes]{margin-left:auto}
@media (max-height:500px){
  html.phone .ph-bar{height:calc(44px + env(safe-area-inset-bottom,0px));padding-left:max(8px,env(safe-area-inset-left,0px));padding-right:max(8px,env(safe-area-inset-right,0px))}
  html.phone #stage{padding-bottom:calc(50px + env(safe-area-inset-bottom,0px))}
  .ph-bar button{height:38px}
}
.ph-pos{min-width:64px;text-align:center;font:700 14px var(--mono,ui-monospace,monospace);color:var(--muted,#8a90b0)}
