/* Mobile layout of the 3D pages, /camper and /aravyn (Yeeyo, November 17-18, 2026).
   Two layouts only, mobile and desktop. Mobile is any window under 780 CSS px wide, or under 500 tall, or both
   under 1150 wide and under 750 tall (Yeeyo, November 18): phones, foldables folded and open, and small tablets
   like the iPad mini, either way up. 11-inch and larger tablets, laptops and desktops keep the desktop layout,
   and a desktop window squeezed under those sizes turns mobile.
   Touch controls follow the device's main input, not the window size (viewer.css, TOUCH_INPUT in the page scripts).
   The 3D view takes the whole window: the header becomes one menu button floating at the top right, the
   footer's copyright line moves into that menu, and the controls and their text size themselves to the
   screen. Loaded after viewer.css and the page's own stylesheet, so these rules win in the mobile layout. */

@media (max-width:779.98px),(max-height:499.98px),(max-width:1149.98px) and (max-height:749.98px){

/* The whole window for the view */
body:is(.camper-page,.aravyn-page){overflow:hidden}
body:is(.camper-page,.aravyn-page) site-footer{display:none}
body:is(.camper-page,.aravyn-page) :is(#camper-viewer,#aravyn-viewer){min-height:0}

/* The header: one menu button floating at the top right; the menu opens under it */
body:is(.camper-page,.aravyn-page) site-header{position:fixed;top:0;right:0;left:auto;z-index:1000;background:none}
body:is(.camper-page,.aravyn-page) site-header header{display:block;max-width:none;margin:0;padding:calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 10px) 0 0}
body:is(.camper-page,.aravyn-page) site-header .logo{display:none}
body:is(.camper-page,.aravyn-page) .nav-toggle{display:flex;width:44px;height:44px;padding:14px 12px;border-radius:50%;background:#13212ccd;border:1px solid #ffffff38;backdrop-filter:blur(16px);box-shadow:0 3px 24px #0001;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
body:is(.camper-page,.aravyn-page) .nav-toggle span{background:#fff}
body:is(.camper-page,.aravyn-page) site-header nav{display:none;position:absolute;top:calc(100% + 8px);right:calc(env(safe-area-inset-right) + 10px);left:auto;flex-direction:column;align-items:stretch;gap:0;min-width:210px;max-width:calc(100vw - 20px);max-height:calc(100dvh - 80px);overflow:auto;padding:8px 0;background:#14232cf5;border:1px solid #ffffff29;border-radius:8px;box-shadow:0 20px 60px #0008}
body:is(.camper-page,.aravyn-page) site-header nav.open{display:flex}
body:is(.camper-page,.aravyn-page) site-header nav a{width:auto;padding:12px 20px;color:#fff;font-size:15px}
body:is(.camper-page,.aravyn-page) site-header nav a[aria-current="page"]{color:#f1d3a1}
/* The menu's first row: Home on the left, the site's logo (in white) on the right, so the menu carries the
   branding, navigation and copyright of the hidden header and footer (Yeeyo, November 18, 2026) */
body:is(.camper-page,.aravyn-page) site-header nav a.nav-home{display:flex;align-items:center;justify-content:space-between;gap:24px}
body:is(.camper-page,.aravyn-page) site-header .nav-logo{display:block;width:auto;height:20px;filter:brightness(0) invert(1);transform:translateY(-.13em)}
/* translateY: centred on the capitals of HOME, not on the text's line box, which also holds room for descenders (2 px at 15 px) */
body:is(.camper-page,.aravyn-page) .nav-copyright{display:block;margin:6px 20px 4px;padding-top:10px;border-top:1px solid #ffffff1f;font-family:var(--font-heading);font-size:11px;line-height:1.5;color:#9aa9b2}

/* Controls (?) just left of the menu button */
body .model-viewer .viewer-topbar{padding:calc(env(safe-area-inset-top) + 14px) calc(env(safe-area-inset-right) + 62px) 0 12px}

/* Buttons and text sized to the screen; no keyboard keys on a touch screen (the main input, as in viewer.css) */
body .model-viewer .glass{font-size:clamp(12px,3.4vmin,14px)}
body .model-viewer .small{padding:.72em 1em}
@media (pointer:coarse),(hover:none){body .model-viewer kbd{display:none}}
body .model-viewer .toolbar{bottom:max(12px,env(safe-area-inset-bottom));display:flex;flex-wrap:wrap;justify-content:center;gap:6px;width:max-content;max-width:calc(100% - 24px);white-space:normal}
body .model-viewer .toolbar .glass,body.aravyn-page .model-viewer #places summary{padding:.78em 1.05em}
body .model-viewer .interact{max-width:calc(100% - 24px);white-space:normal;text-align:center}
body .model-viewer #journey{bottom:max(16px,env(safe-area-inset-bottom))}

/* The hint at the top, where nothing else can sit on it */
body .model-viewer #hint{top:calc(env(safe-area-inset-top) + 64px);bottom:auto;width:max-content;max-width:calc(100% - 24px);padding:.6em 1.3em;font-size:clamp(11px,3.2vmin,13px);line-height:1.45;white-space:normal;text-wrap:balance;border-radius:18px}
/* One hint part per line, no dots */
body .model-viewer #hint .seg{display:block}
body .model-viewer #hint .dot{display:none}
/* While the menu is open the hint steps aside, so the menu never sits over it (MT-014) */
body:has(site-header nav.open) .model-viewer #hint{visibility:hidden}

/* The joystick at the bottom left, above the buttons (both pages); it shows only on touch screens (viewer.css) */
body .model-viewer #joystick{position:absolute;pointer-events:auto;touch-action:none;left:calc(env(safe-area-inset-left) + 16px);bottom:calc(max(12px,env(safe-area-inset-bottom)) + 62px);width:clamp(88px,26vmin,112px);height:clamp(88px,26vmin,112px);border:1px solid #ffffff68;background:#15232b65;border-radius:50%}
body .model-viewer #joystick span{position:absolute;top:30%;left:30%;width:40%;height:40%;background:#fff8;border:1px solid #fffc;border-radius:50%;pointer-events:none}
/* While the Dome's Views list is open the joystick and the hint step aside, so a tap on the list picks a place (MT-002) */
body.aravyn-page .model-viewer #hud.views-open #joystick,body.aravyn-page .model-viewer #hud.views-open #hint{visibility:hidden}
body.aravyn-page .model-viewer #places[open] nav{max-height:calc(100dvh - 150px);overflow-y:auto;min-width:min(190px,calc(100vw - 24px))}
body.aravyn-page .model-viewer #places nav button{padding:.72em 1.1em}

/* Welcome panel: compact, so the camper or the hall shows above it */
body:is(.camper-page,.aravyn-page) .model-viewer #welcome{left:12px;right:12px;width:auto;max-width:420px;margin:0 auto;bottom:max(14px,env(safe-area-inset-bottom));padding:clamp(14px,4.5vmin,22px);max-height:calc(100dvh - 76px);overflow:auto}
body:is(.camper-page,.aravyn-page) .model-viewer #welcome .eyebrow{font-size:clamp(9px,2.6vmin,11px);margin-bottom:.8em}
body:is(.camper-page,.aravyn-page) .model-viewer #welcome h1{font-size:clamp(24px,8vmin,34px);margin-bottom:.35em}
body:is(.camper-page,.aravyn-page) .model-viewer #welcome .load-row{font-size:clamp(11px,3vmin,12px)}
body:is(.camper-page,.aravyn-page) .model-viewer #welcome .primary{margin-top:clamp(10px,3vmin,18px);padding:.85em 1.2em;font-size:clamp(13px,3.6vmin,15px)}
body:is(.camper-page,.aravyn-page) .model-viewer #welcome .text-help{margin-top:4px;padding:8px 10px;font-size:clamp(12px,3.3vmin,13px)}

/* Controls, How to explore and A closer look fit the screen and scroll inside */
body .model-viewer dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:clamp(18px,5vmin,28px) clamp(16px,5vmin,24px)}
body .model-viewer dialog h2{font-size:clamp(22px,7vmin,30px);margin-bottom:.6em;padding-right:36px}
body .model-viewer dialog .eyebrow{padding-right:40px}
body .model-viewer dialog p,body .model-viewer dl{font-size:clamp(12px,3.5vmin,14px)}
body .model-viewer dl{grid-template-columns:minmax(70px,26%) 1fr;gap:clamp(8px,2.6vmin,14px)}
body .model-viewer #object-view{height:min(300px,42dvh)}

/* Very narrow pages (large text or browser zoom: 200 to 300 CSS px, MT-011): the camper's three buttons take two
   rows, so its joystick goes higher; the door or object button sits just above the center dot, clear of the joystick */
@media (max-width:300px){
  body.camper-page .model-viewer #joystick{bottom:calc(max(12px,env(safe-area-inset-bottom)) + 106px)}
  body .model-viewer .interact{top:auto;bottom:calc(50% + 16px)}
  body .model-viewer .interact.second{bottom:calc(50% + 84px)}
  /* and the hint steps aside while that button shows */
  body .model-viewer #hud:has(#interact:not([hidden])) #hint{visibility:hidden}
}

/* Any sideways mobile screen (phones, foldables, the iPad mini): the welcome panel at the right, clear of the camper
   and the hall, which sit left of centre */
@media (orientation:landscape){
  /* its narrower width wraps the eyebrow line: two even lines, no word left alone */
  body:is(.camper-page,.aravyn-page) .model-viewer #welcome .eyebrow{text-wrap:balance}
  body:is(.camper-page,.aravyn-page) .model-viewer #welcome{left:auto;right:calc(env(safe-area-inset-right) + 14px);bottom:max(12px,env(safe-area-inset-bottom));width:min(320px,46vw);margin:0;max-height:calc(100dvh - 70px)}
}

/* Very short upright pages (large text): the welcome panel drops its eyebrow line */
@media (max-height:560px) and (orientation:portrait){
  body:is(.camper-page,.aravyn-page) .model-viewer #welcome .eyebrow{display:none}
}

/* Phones on their side: little height, plenty of width. Orientation too, since very large text can make an
   upright page shorter than 500 CSS px (Firefox, Android's largest text: 216 x 410). */
@media (max-height:500px) and (orientation:landscape){
  body .model-viewer #hint{top:calc(env(safe-area-inset-top) + 14px);max-width:max(200px,calc(100% - 380px))}
  body .model-viewer #joystick{bottom:max(12px,env(safe-area-inset-bottom))}
  body.aravyn-page .model-viewer #places[open] nav{display:grid;grid-template-columns:repeat(2,minmax(150px,auto));max-height:calc(100dvh - 80px)}
  body:is(.camper-page,.aravyn-page) .model-viewer #welcome .eyebrow{display:none}
  body .model-viewer dialog .eyebrow{display:none}
  body:is(.camper-page,.aravyn-page) site-header nav a{padding:8px 18px;font-size:14px}
  body:is(.camper-page,.aravyn-page) .nav-copyright{margin-top:4px;padding-top:8px}
}
}
