/* Geometry from the mobile Figma frames. 1 unit = 1px at 402px wide.
   The desktop grid is untouched; the document owns all phone scrolling. */
@media (max-width:720px), (width < 992px) and (hover:none) and (pointer:coarse) {
 :root {--mobile-unit:min(calc((100vw - 40px) / 362),calc((100svh - 112px) / 557));--home-gap-unit:clamp(0px,calc((100svh - 80px - 557 * var(--mobile-unit)) / 237),var(--mobile-unit));--folder-gap-unit:clamp(0px,calc((100svh - 100px - 554 * var(--mobile-unit)) / 220),var(--mobile-unit));--mobile-bar-top:calc(60px + 30 * var(--folder-gap-unit));--spatial-strip-height:20px;}
 html:has(.spatial-ui) {scroll-padding-top:calc(var(--mobile-bar-top) + 60px);}
 body.spatial-ui {min-width:320px;overflow-x:clip;}
 .spatial-ui .spatial-shell {display:flex;flex-direction:column;gap:20px;height:auto;min-height:100svh;padding:20px;}
 .spatial-shell::before {content:'';position:fixed;inset:0 0 auto;height:60px;background:var(--spatial-background);z-index:29;pointer-events:none;}
 .spatial-ui .spatial-workspace {height:auto;min-height:0;flex:1;isolation:auto;}
 .portfolio-space {height:auto;container-type:inline-size;}
 .spatial-ui .system-panel {position:sticky;top:20px;flex:none;height:20px;min-height:20px;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);font-size:var(--system-text-size);line-height:20px;}
 .spatial-ui .system-panel button {height:20px;min-height:20px;padding:0 2px;}
 .spatial-ui .system-controls {font-size:16px;line-height:20px;gap:0;}
 .spatial-ui [data-system-control=sound] {display:none;}
 .spatial-ui [data-system-control=language] {font-size:16px;}
 .spatial-ui [data-system-control=language]::after {content:none;}
 .system-name {position:relative;max-width:100%;overflow:visible;}
 .spatial-ui :is(.system-name,.system-clock)::after,.folder-bar button::after,.case-bar button::after {content:'';position:absolute;inset:-12px 0;}
 .home-space,.home-objects {height:calc(557 * var(--mobile-unit) + 237 * var(--home-gap-unit));}
 .home-objects {width:calc(362 * var(--mobile-unit));margin-inline:auto;}
 .home-folder--concepts {--object-x:50% !important;--object-y:calc(30 * var(--mobile-unit)) !important;--object-width:calc(182 * var(--mobile-unit)) !important;--object-height:calc(140 * var(--mobile-unit)) !important;}
 .home-folder--real-work {--object-x:calc(2 * var(--mobile-unit)) !important;--object-y:calc(238 * var(--mobile-unit)) !important;--object-width:calc(360 * var(--mobile-unit)) !important;--object-height:calc(208 * var(--mobile-unit)) !important;}
 .home-folder--vibecoding {--object-x:calc(2 * var(--mobile-unit)) !important;--object-y:calc(516 * var(--mobile-unit)) !important;--object-width:calc(270 * var(--mobile-unit)) !important;--object-height:calc(70 * var(--mobile-unit)) !important;}
 .home-external--telegram {--object-x:0% !important;--object-y:calc(655 * var(--mobile-unit)) !important;--object-width:calc(91 * var(--mobile-unit)) !important;--object-height:calc(139 * var(--mobile-unit)) !important;}
 .home-external--resume {--object-x:calc(272 * var(--mobile-unit)) !important;--object-y:calc(655 * var(--mobile-unit)) !important;--object-width:calc(90 * var(--mobile-unit)) !important;--object-height:calc(139 * var(--mobile-unit)) !important;}
 /* Match the two tight lines of the mobile title. The wider line box keeps
    the font's side bearings from reducing the visible 360px first word. */
 .home-folder--real-work .home-object-label {flex:none;font-size:calc(120.8 * var(--mobile-unit));line-height:calc(91 * var(--mobile-unit));width:calc(370 * var(--mobile-unit));}
 .home-folder--real-work .home-object-label > span {height:calc(93 * var(--mobile-unit));margin-bottom:calc(-2 * var(--mobile-unit));overflow:hidden;}
 .home-folder .authored-home-label {position:absolute;left:0;top:auto;bottom:0;width:100%;height:auto;max-height:none;aspect-ratio:var(--label-ratio);font-size:0;line-height:0;background:currentColor;mask:var(--label-mask) left bottom / contain no-repeat;}
 .home-folder .authored-home-label > span {font-size:0;line-height:0;}
 .spatial-ui .folder-space {position:relative;inset:auto;display:block;padding:0;margin-top:calc(30 * var(--folder-gap-unit));background:var(--spatial-background);height:auto;min-height:0;}
 .spatial-ui .folder-bar {position:sticky;top:var(--mobile-bar-top);z-index:22;margin:0;height:20px;min-height:20px;background:var(--folder-color);font-size:16px;line-height:20px;grid-template-columns:1fr 2fr 1fr;}
 .folder-bar::before {content:'';position:absolute;left:0;right:0;bottom:100%;height:calc(20px + 30 * var(--folder-gap-unit));background:var(--spatial-background);pointer-events:none;}
 .spatial-ui .folder-bar :is(button,h1) {padding:0 2px;font-size:16px;line-height:20px;}
 .folder-bar button,.case-bar button {position:relative;}
 .portfolio-space .folder-scroll {display:block;overflow:visible;overscroll-behavior:auto;padding:0;height:auto;min-height:0;}
 .project-canvas {display:block;height:auto;min-height:0;width:calc(362 * var(--mobile-unit));margin-inline:auto;}
 .project-canvas::before {content:'';display:block;height:calc(554 * var(--mobile-unit) + 190 * var(--folder-gap-unit));pointer-events:none;}
 .project-canvas > .project-card[data-mobile-geometry] {position:absolute!important;left:calc(var(--mobile-card-x) * var(--mobile-unit))!important;top:calc(var(--mobile-card-y) * var(--mobile-unit))!important;width:calc(var(--mobile-card-w) * var(--mobile-unit))!important;height:calc(var(--mobile-card-h) * var(--mobile-unit))!important;grid-area:auto!important;}
 .project-canvas > .project-card:not([data-mobile-geometry]) {position:relative!important;inset:auto!important;width:100%!important;height:280px!important;margin-top:24px;grid-area:auto!important;}
 .portfolio-space .case-panel {position:relative;display:block;height:auto;min-height:0;padding:0;background:var(--spatial-background);overflow:visible;}
 .portfolio-space .case-bar {position:sticky;top:calc(var(--mobile-bar-top) + 20px);z-index:21;height:20px;min-height:20px;margin:0;background:var(--case-frame);font:400 16px/20px var(--spatial-font);grid-template-columns:1fr 2fr 1fr;}
 .portfolio-space .case-bar h2 {grid-column:2;line-height:20px;font-size:16px;padding:0 2px;}
 .portfolio-space .case-bar button {height:20px;min-height:20px;padding:0 2px;}
 .portfolio-space .case-detail {height:auto;overflow:visible;container-type:normal;padding:0;}
 .presentation-host {height:auto;min-height:0;}
 .portfolio-space .case-copy {width:100%;padding:32px 0;}
 .author-window {width:calc(100vw - 40px);}
 .image-lightbox {z-index:100;}
 .portfolio-space:focus-visible,.case-panel:focus-visible {outline-offset:-2px;}
 :root[data-input-modality=pointer] :is(.portfolio-space,#case-panel,#folder-title,.home-folder,.project-card):focus-visible {outline:none!important;}
 /* Preserve the authored card sizes first; spend less height on empty gaps. */
 .home-folder--concepts {--object-y:calc(30 * var(--home-gap-unit))!important;}
 .home-folder--real-work {--object-y:calc(140 * var(--mobile-unit) + 98 * var(--home-gap-unit))!important;}
 .home-folder--vibecoding {--object-y:calc(348 * var(--mobile-unit) + 168 * var(--home-gap-unit))!important;}
 .home-external--telegram,.home-external--resume {--object-y:calc(418 * var(--mobile-unit) + 237 * var(--home-gap-unit))!important;}
 .project-canvas > .project-card[data-mobile-geometry=requests] {top:calc(50 * var(--folder-gap-unit))!important;}
 .project-canvas > .project-card[data-mobile-geometry=uploads] {top:calc(49 * var(--folder-gap-unit))!important;}
 .project-canvas > .project-card[data-mobile-geometry=multivcs] {top:calc(138 * var(--mobile-unit) + 120 * var(--folder-gap-unit))!important;}
 .project-canvas > .project-card:is([data-mobile-geometry=desktop],[data-mobile-geometry=documents]) {top:calc(346 * var(--mobile-unit) + 190 * var(--folder-gap-unit))!important;}
 .project-canvas > .project-card:is([data-mobile-geometry=fitness],[data-mobile-geometry=clo-ai]) {top:calc(188 * var(--folder-gap-unit))!important;}
}
