/* AlecOS — MOBILE (iPhone Springboard + full-screen apps).
   Active only under .aos-root.is-mobile. Loaded AFTER wm.css so these override the
   older mobile rules. Desktop is untouched.

   The mobile experience is a real iOS home screen: the aurora wallpaper, a greeting,
   and a grid of large rounded app icons. Tap an icon → the app opens full-screen with
   an iOS scale/spring from the icon; a slim top bar carries a back chevron + the app
   title; content scrolls with momentum. Back chevron or the home indicator (tap /
   swipe-up) returns to the Springboard. */

.aos-root.is-mobile{position:fixed;inset:0;overflow:hidden;background:var(--wall);
  font-family:-apple-system,"SF Pro Display","SF Pro Text","Inter",system-ui,sans-serif;
  -webkit-user-select:none;user-select:none;-webkit-text-size-adjust:100%;}
.aos-root.is-mobile .aos-wall{opacity:1;}

/* hide ALL desktop chrome + the empty desktop windows */
.aos-root.is-mobile .aos-menubar,
.aos-root.is-mobile .aos-dock,
.aos-root.is-mobile .aos-caption,
.aos-root.is-mobile .aos-hint,
.aos-root.is-mobile .aos-progress,
.aos-root.is-mobile .aos-boot,
.aos-root.is-mobile .aos-track,
.aos-root.is-mobile .aos-stage,
.aos-root.is-mobile .aos-win,
.aos-root.is-mobile .alt-view{ display:none !important; }

/* ============ STATUS BAR (always visible, above everything) ============ */
.mos-statusbar{position:fixed;top:0;left:0;right:0;z-index:90;pointer-events:none;
  height:calc(env(safe-area-inset-top,0px) + 22px);
  padding:0 24px 3px 26px;display:flex;align-items:flex-end;justify-content:space-between;
  color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.55);}
.mos-time{font-size:15px;font-weight:600;letter-spacing:.01em;font-variant-numeric:tabular-nums;}
.mos-sbr{display:flex;align-items:center;gap:6px;}
.mos-sbr svg{height:12px;width:auto;color:#fff;display:block;}

/* ============ SPRINGBOARD HOME ============ */
.mos-home{position:fixed;inset:0;z-index:20;display:flex;flex-direction:column;align-items:center;
  box-sizing:border-box;background:transparent;
  padding:calc(env(safe-area-inset-top,0px) + 12px) 16px calc(env(safe-area-inset-bottom,0px) + 30px);
  transition:opacity .42s ease,transform .42s cubic-bezier(.32,.72,0,1);}
.mos-inapp .mos-home{opacity:0;transform:scale(1.12);pointer-events:none;}

.mos-greet{text-align:center;margin:2px 0 2px;flex:none;}
.mos-greet-k{display:block;font-family:ui-monospace,"SF Mono",Menlo,monospace;font-size:10px;font-weight:600;
  letter-spacing:.26em;text-transform:uppercase;color:rgba(255,255,255,.55);text-shadow:0 1px 4px rgba(0,0,0,.6);}
.mos-greet h1{margin:4px 0 0;font-size:28px;font-weight:700;letter-spacing:-.03em;color:#fff;
  text-shadow:0 2px 22px rgba(0,0,0,.65);}

.mos-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:26px 22px;width:100%;max-width:320px;
  justify-items:center;}
.mos-icon{border:0;background:none;padding:0;cursor:pointer;display:flex;flex-direction:column;align-items:center;
  gap:8px;width:74px;-webkit-tap-highlight-color:transparent;transition:transform .14s ease;}
.mos-icon:active{transform:scale(.9);}
.mos-icon-tile{width:60px;height:60px;border-radius:15px;overflow:hidden;display:grid;place-items:center;flex:none;
  background:linear-gradient(155deg,color-mix(in srgb,var(--tone) 42%,#22222c),#131318);
  box-shadow:inset 0 1.5px 0 rgba(255,255,255,.28),inset 0 -9px 16px rgba(0,0,0,.45),
             0 8px 18px -8px rgba(0,0,0,.7);}
.mos-icon-tile svg{width:100%;height:100%;display:block;}
.mos-icon-lbl{font-size:12px;font-weight:500;color:#fff;text-shadow:0 1px 4px rgba(0,0,0,.7);
  max-width:74px;text-align:center;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.mos-icon:focus-visible{outline:none;}
.mos-icon:focus-visible .mos-icon-tile{outline:2px solid #fff;outline-offset:3px;}

/* ============ FULL-SCREEN APP VIEW ============ */
.mos-appview{position:fixed;inset:0;z-index:40;display:flex;flex-direction:column;
  background:#0d0c10;opacity:0;visibility:hidden;transform:scale(.32);transform-origin:50% 50%;
  will-change:transform,opacity;
  transition:transform .5s cubic-bezier(.32,.72,0,1),opacity .34s ease,visibility .5s;
  overflow:hidden;}
.mos-appview.is-open{opacity:1;visibility:visible;transform:none;}

.mos-appbar{flex:none;position:relative;z-index:2;display:flex;align-items:center;gap:4px;
  padding:calc(env(safe-area-inset-top,0px) + 10px) 8px 9px;
  background:rgba(18,17,22,.82);-webkit-backdrop-filter:blur(18px) saturate(1.4);backdrop-filter:blur(18px) saturate(1.4);
  border-bottom:1px solid rgba(255,255,255,.07);}
.mos-back{border:0;background:none;padding:10px 6px;cursor:pointer;display:inline-flex;align-items:center;
  color:var(--m-accent,#4C8DFF);min-width:44px;min-height:44px;-webkit-tap-highlight-color:transparent;}
.mos-back:active{opacity:.6;}
.mos-apptitle{font-size:17px;font-weight:600;letter-spacing:-.01em;color:#f3f1f6;
  position:absolute;left:50%;transform:translateX(-50%);pointer-events:none;
  max-width:60%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;}

.mos-appscroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;display:flex;flex-direction:column;}
.mos-appscroll.is-fill{overflow:hidden;}
.mos-appscroll.is-fill .mos-page{flex:1 1 auto;min-height:0;}
.mos-appscroll::-webkit-scrollbar{display:none;}

/* ============ HOME CAROUSEL SLOT + APP DOCK (home screen only) ============ */
/* the Photos coverflow sits between the greeting and the dock, filling the space */
.mos-home-cf{flex:1 1 auto;min-height:0;width:100%;position:relative;display:flex;margin-top:2px;}
.mos-home-cf .moscf{flex:1 1 auto;min-height:0;width:100%;background:transparent;}
/* app dock: a centered frosted pill of the (non-Photos) apps, with labels */
.mos-dock{flex:none;display:flex;justify-content:center;align-items:flex-start;gap:8px;margin-top:14px;
  padding:12px 12px 10px;border-radius:26px;
  background:rgba(30,30,36,.52);-webkit-backdrop-filter:blur(20px) saturate(1.6);backdrop-filter:blur(20px) saturate(1.6);
  box-shadow:0 1px 0 rgba(255,255,255,.13) inset,0 0 0 .5px rgba(255,255,255,.09),0 16px 34px -14px rgba(0,0,0,.6);}
.mos-dock-i{border:0;background:none;padding:0;cursor:pointer;-webkit-tap-highlight-color:transparent;
  display:flex;flex-direction:column;align-items:center;gap:5px;transition:transform .18s cubic-bezier(.34,1.56,.64,1);}
.mos-dock-i:active{transform:scale(.9);}
.mos-dock-tile{display:grid;place-items:center;width:52px;height:52px;border-radius:14px;overflow:hidden;
  background:linear-gradient(155deg,color-mix(in srgb,var(--tone) 44%,#26262e),#141419);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.24),0 5px 12px -4px rgba(0,0,0,.6);}
.mos-dock-tile svg{width:100%;height:100%;display:block;}
/* F3/F4: 11px (>=legibility floor) and room to wrap to 2 lines so "Freak-Quencies" /
   "Aminal House" read in full. max-width 74px keeps the four-up dock inside 360px. */
.mos-dock-lbl{font-size:11px;font-weight:500;color:rgba(255,255,255,.8);max-width:74px;text-align:center;
  line-height:1.18;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  text-shadow:0 1px 3px rgba(0,0,0,.7);}

.mos-page{width:100%;box-sizing:border-box;}

/* ============ PHOTOS — touch 3D coverflow ============ */
.moscf{position:relative;display:flex;flex-direction:column;justify-content:flex-start;
  background:radial-gradient(120% 90% at 50% 0%,#170f14,#0b0a0b 64%);}
/* caption sits in normal flow at the top; the stage below fills the rest and centers the
   photo in THAT space — so the caption and photo read together, no cavernous gap. */
/* FIXED height (not min-height) so a caption swapping between 1 and 2 lines never reflows
   the head → the stage → the whole carousel. That reflow was the "glitch around". */
.moscf-head{flex:none;text-align:center;pointer-events:none;height:74px;box-sizing:border-box;
  padding:6px 20px 4px;display:flex;flex-direction:column;justify-content:flex-end;gap:5px;overflow:hidden;}
.moscf-sec{font-family:ui-monospace,Menlo,monospace;font-size:11px;font-weight:600;letter-spacing:.22em;
  text-transform:uppercase;color:#ff5c86;text-shadow:0 1px 3px rgba(0,0,0,.7);
  transition:opacity .3s ease;}
.moscf-cap{font-size:19px;font-weight:600;letter-spacing:-.02em;line-height:1.2;color:#f0eef4;margin:0;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  text-wrap:balance;text-shadow:0 2px 18px rgba(0,0,0,.8);transition:opacity .3s ease;}
/* touch-action:none — the JS fully owns the swipe; the browser never scrolls/bounces the
   page vertically during a horizontal photo swipe (that was the up/down jitter).
   flex:1 1 auto so the stage CONSUMES the free column height — the photo + dots sit just
   above the dock instead of leaving a ~170px cavern below the dots (F1). The head stays a
   FIXED height (flex:none; height:74px) so a caption 1↔2-line swap never reflows the stage. */
.moscf-stage{flex:1 1 auto;min-height:0;position:relative;perspective:1200px;overflow:hidden;cursor:grab;
  touch-action:none;}
.moscf-stage:active{cursor:grabbing;}
.moscf-card{position:absolute;left:50%;top:50%;height:100%;display:flex;align-items:center;justify-content:center;
  transform-style:preserve-3d;backface-visibility:hidden;
  transition:transform .5s cubic-bezier(.25,1,.3,1),opacity .4s ease;}
/* only the cards near the center are GPU-promoted — far ones don't composite (perf on phones).
   far cards are opacity:0 (not visibility:hidden) so they fade rather than pop = no glitch. */
.moscf-card.near{will-change:transform,opacity;}
.moscf-card.far{opacity:0 !important;pointer-events:none;}
.moscf-stage.is-dragging .moscf-card{transition:none;}
.moscf-card img,.moscf-card video{max-width:84vw;max-height:94%;width:auto;height:auto;object-fit:contain;
  border-radius:18px;background:#141416;display:block;
  box-shadow:0 30px 66px -22px #000,0 0 0 1px rgba(255,255,255,.1);}
.moscf-card.is-side img,.moscf-card.is-side video{filter:brightness(.55) saturate(.88);}
.moscf-dots{flex:none;display:flex;gap:0;justify-content:center;flex-wrap:nowrap;
  padding:10px 8px calc(env(safe-area-inset-bottom,0px) + 16px);}
/* F5: the visible dot stays 8px, but the button is a 22×34 transparent tap target (the dot
   is drawn by ::before, centered). 14 targets × 22px + 16px pad = 324px → fits 360 with no
   overflow, and every dot is comfortably tappable. */
.moscf-dot{width:22px;height:34px;border:0;padding:0;cursor:pointer;background:none;
  display:flex;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent;}
.moscf-dot::before{content:"";width:8px;height:8px;border-radius:50%;
  background:rgba(255,255,255,.28);transition:background .2s,transform .2s;}
.moscf-dot.on::before{background:#E1306C;transform:scale(1.35);}

/* ============ DEMO SCREEN (Freak-Quencies / Backline — real iframe inline) ============ */
.mos-demo{display:flex;flex-direction:column;background:linear-gradient(180deg,#161310,#0d0b08);}
.mos-demo-hd{flex:none;padding:14px 20px 12px;}
.mos-demo-h{margin:0;font-size:28px;font-weight:700;letter-spacing:-.03em;color:#fff;}
.mos-demo-d{margin:6px 0 0;font-size:13.5px;line-height:1.45;color:#a7a3af;}
.mos-demo-frame{flex:1 1 auto;min-height:0;position:relative;background:#09090b;
  border-top:2px solid var(--m-accent,rgba(255,255,255,.14));}
.mos-demo-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0;display:block;}

/* ============ PANE SCREEN (Aminal House / Contact — single-column scroll) ============ */
.mos-pane{background:#0d0c10;}
.mos-pane.m-aminal{background:radial-gradient(125% 80% at 50% -6%,#200c12,#0c0a0b 60%);}
.mos-inner{width:100%;max-width:560px;margin:0 auto;box-sizing:border-box;color:#f3f1f6;
  padding:20px 20px calc(env(safe-area-inset-bottom,0px) + 48px);}

/* ============ HOME INDICATOR (interactive in-app) ============ */
.mos-homebar{position:fixed;left:50%;transform:translateX(-50%);z-index:70;
  bottom:calc(env(safe-area-inset-bottom,0px) + 2px);
  width:170px;height:24px;display:flex;align-items:flex-end;justify-content:center;padding-bottom:6px;
  pointer-events:none;}
.mos-inapp .mos-homebar{pointer-events:auto;cursor:pointer;}
.mos-homebar i{display:block;width:135px;height:5px;border-radius:3px;background:rgba(255,255,255,.6);}

/* the desktop-only "Signal Path" pill lives outside .aos-root (a <body> sibling), so it
   can't be hidden by a descendant selector — suppress it on phones here. */
@media (max-width:860px){ .alt-view{display:none !important;} }

@media (prefers-reduced-motion: reduce){
  .mos-home,.mos-appview{transition:opacity .2s ease;transform:none !important;}
  .mos-appview.is-open{transform:none;}
  .moscf-card{will-change:auto;}
}
