/**
 * Mobile selected work and app springboard, Windows-98 skin
 *
 * Active ONLY in desktop mode (__DESKTOP_MODE) on phones (<=768px).
 * Renders INSTEAD of the XP desktop chrome (taskbar/icons/windows).
 * The opt-in /accordion launcher is never affected by this file.
 * Shares the desktop's flat green background (--os-band) and Win98 grey
 * bevel chrome (--win98-*) — status bar, tiles, dock, app-view title bar.
 *
 * Visibility is driven by the `mobile-springboard-active` class on <body>
 * (added by js/os/mobile-springboard.js). Without that class nothing here
 * paints, so desktop widths and the launcher are untouched.
 */

/* ─── Shell visibility gate ─────────────────────────────────────────────
   When the springboard is active, hide the entire XP desktop chrome so only
   the springboard shows. Scoped to the body class so it can never leak into
   desktop-width or launcher contexts. */
body.mobile-springboard-active #seo-content,
body.mobile-springboard-active #taskbar,
body.mobile-springboard-active #desktop-icons,
body.mobile-springboard-active #window-container,
body.mobile-springboard-active #menu-bar,
body.mobile-springboard-active #dock,
body.mobile-springboard-active #start-menu,
body.mobile-springboard-active #greta,
body.mobile-springboard-active .crt-glare,
body.mobile-springboard-active #launcher-trigger {
  display: none !important;
}

/* Lock the page — springboard owns the full viewport, no scroll/overflow. */
body.mobile-springboard-active {
  overflow: hidden;
}
body.mobile-springboard-active #wallpaper {
  display: none !important;
}

/* ─── Springboard root ──────────────────────────────────────────────────
   Full viewport, fixed. Same flat desktop green as the desktop OS. */
.mob-springboard {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--os-band, #1C4030);
  font-family: 'Tahoma', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  /* iOS safe-area padding so the status bar clears the notch */
  padding-top: env(safe-area-inset-top, 0);
}
.mob-springboard[hidden] { display: none; }

/* The home has one scroll surface; opening an app preserves its position. */
.mob-home-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-padding-top: 16px;
  -webkit-overflow-scrolling: touch;
  color: #F2E7D0;
  -webkit-user-select: text;
  user-select: text;
}
.mob-home-intro,
.mob-selected-work {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 18px;
}
.mob-home-intro { padding-top: 25px; }
.mob-home-role {
  margin: 0 0 8px;
  font: 500 10px/1.4 var(--font-mono, monospace);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.mob-home-intro h1 {
  margin: 0;
  font: 500 22px/1.2 var(--font-sans);
  letter-spacing: -0.03em;
}
.mob-home-positioning {
  margin: 12px 0 18px;
  max-width: 440px;
  font: 400 clamp(25px, 6.7vw, 34px)/1.1 var(--font-serif);
  letter-spacing: -0.02em;
  text-wrap: pretty;
}
.mob-home-nav {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  font: 500 11px/1.4 var(--font-sans);
}
.mob-home-nav a,
.mob-home-explore {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: inherit;
  text-underline-offset: 4px;
}
.mob-home-explore {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-decoration: underline;
  cursor: var(--cur-hand); --crt-cursor: hand;
}
.mob-selected-work h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 12px;
  font: 500 12px/1.4 var(--font-sans);
  letter-spacing: 0.02em;
}
.mob-selected-work h2 span {
  font: 400 10px/1.4 var(--font-mono, monospace);
}
.mob-work-list { display: grid; gap: 16px; }
.mob-work-card {
  overflow: hidden;
  min-height: 250px;
  text-decoration: none;
  outline: 1px solid #F2E7D035;
  outline-offset: -1px;
}
.mob-work-card > .study-cover {
  flex: none;
  aspect-ratio: 1.8;
}
.mob-work-card .case-study-folder-body { padding: 14px 16px 16px; }
.mob-work-card .case-study-folder-name { font-size: 10px; letter-spacing: 0.06em; }
.mob-work-card .case-study-folder-headline {
  min-height: 0;
  margin: 6px 0 12px;
  max-width: 340px;
  font-size: 24px;
  line-height: 1.06;
}
.mob-work-card .case-study-folder-action { font-size: 10px; }
.mob-selected-work { padding-bottom: 32px; }

/* ─── Bottom taskbar + Start drawer (mirrors the desktop taskbar) ───────*/
.mob-taskbar-wrap {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
}
.mob-taskbar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  background: var(--win98-face);
  color: var(--win98-text);
  border-top: 1px solid var(--win98-light);
  box-shadow: inset 0 1px 0 var(--win98-hilight);
}
.mob-start-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 8px;
  border: 0;
  border-radius: 0;
  background: var(--win98-face);
  color: var(--win98-text);
  font: 700 14px/1 'Tahoma', 'Segoe UI', system-ui, sans-serif;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  cursor: var(--cur-hand); --crt-cursor: hand;
  box-shadow:
    inset -1px -1px 0 var(--win98-dark),
    inset 1px 1px 0 var(--win98-light),
    inset -2px -2px 0 var(--win98-shadow),
    inset 2px 2px 0 var(--win98-hilight);
}
.mob-start-btn img { width: 18px; height: 18px; pointer-events: none; }
.mob-start-btn:active,
.mob-start-btn.active {
  box-shadow:
    inset 1px 1px 0 var(--win98-dark),
    inset -1px -1px 0 var(--win98-light),
    inset 2px 2px 0 var(--win98-shadow),
    inset -2px -2px 0 var(--win98-hilight);
  background-image: repeating-conic-gradient(var(--win98-light) 0 25%, var(--win98-face) 0 50%);
  background-size: 2px 2px;
}
.mob-taskbar-sep {
  width: 2px;
  height: 32px;
  margin: 0 2px;
  flex-shrink: 0;
  background: linear-gradient(to right, var(--win98-shadow) 50%, var(--win98-light) 50%);
}
.mob-quick-launch { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.mob-ql-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  -webkit-tap-highlight-color: transparent;
  cursor: var(--cur-hand); --crt-cursor: hand;
}
.mob-ql-btn img { width: 24px; height: 24px; pointer-events: none; }
.mob-ql-btn:active {
  box-shadow: inset 1px 1px 0 var(--win98-shadow), inset -1px -1px 0 var(--win98-light);
}
.mob-tray {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 2px;
  flex-shrink: 0;
  box-shadow: inset 1px 1px 0 var(--win98-shadow), inset -1px -1px 0 var(--win98-light);
}
.mob-tray a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  color: var(--win98-text);
}
.mob-start-btn:focus-visible,
.mob-ql-btn:focus-visible,
.mob-tray a:focus-visible,
.mob-home-explore:focus-visible {
  outline: 1px dotted var(--win98-text);
  outline-offset: -4px;
}
.mob-home-explore:focus-visible { outline: 2px solid #F2E7D0; outline-offset: 4px; }

/* Start drawer — the desktop Start menu, sized for a phone. */
.mob-drawer {
  position: absolute;
  left: 0;
  bottom: 100%;
  display: flex;
  width: min(280px, calc(100vw - 16px));
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  padding: 3px;
  background: var(--win98-face);
  color: var(--win98-text);
  box-shadow:
    inset -1px -1px 0 var(--win98-dark),
    inset 1px 1px 0 var(--win98-light),
    inset -2px -2px 0 var(--win98-shadow),
    inset 2px 2px 0 var(--win98-hilight),
    4px 4px 0 rgba(0, 0, 0, 0.35);
}
.mob-drawer[hidden] { display: none; }
.mob-drawer-sidebar {
  flex: none;
  width: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  background: linear-gradient(to top, #0B1F17, var(--os-band, #1C4030));
}
.mob-drawer-sidebar span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #F2E7D0;
  font: 700 17px/1 'Tahoma', 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 2px;
  opacity: 0.9;
}
.mob-explore-list {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 2px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mob-explore-item--lead {
  margin-bottom: 3px;
  padding-bottom: 3px;
  /* Etched Win98 separator under Messenger. */
  border-bottom: 1px solid var(--win98-light);
  box-shadow: 0 -1px 0 var(--win98-shadow) inset;
}
.mob-app.mob-explore-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  color: inherit;
  text-align: left;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.mob-explore-icon {
  flex: none;
  width: 32px;
  height: 32px;
  pointer-events: none;
}
.mob-explore-name { flex: 1; min-width: 0; font: 400 15px/1.25 var(--font-sans); }
.mob-explore-arrow { flex: none; font-size: 13px; }
.mob-explore-row:active,
.mob-explore-row:focus-visible {
  background: var(--win98-select);
  color: var(--win98-select-text);
}
@media (hover: hover) {
  .mob-explore-row:hover {
    background: var(--win98-select);
    color: var(--win98-select-text);
  }
}
.mob-home-nav a:focus-visible,
.mob-work-card:focus-visible,
.mob-app:not(.mob-explore-row):focus-visible {
  outline: 2px solid #F2E7D0;
  outline-offset: 4px;
}

/* ─── Win98-grey status bar ──────────────────────────────────────────────*/
.mob-statusbar {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 0 16px;
  background: var(--win98-face);
  color: var(--win98-text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-shadow: none;
  box-shadow:
    inset 0 -1px 0 var(--win98-shadow),
    inset 0 -2px 0 var(--win98-dark);
}
.mob-statusbar-time {
  font-variant-numeric: tabular-nums;
}
.mob-statusbar-brand {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.92;
}
/* Tiny signal/battery cluster — pure CSS, evokes iOS chrome */
.mob-statusbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mob-statusbar-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}
.mob-statusbar-bars i {
  display: block;
  width: 3px;
  background: var(--win98-dark);
  border-radius: 0;
}
.mob-statusbar-bars i:nth-child(1) { height: 4px; }
.mob-statusbar-bars i:nth-child(2) { height: 6px; }
.mob-statusbar-bars i:nth-child(3) { height: 8px; }
.mob-statusbar-bars i:nth-child(4) { height: 11px; }
.mob-statusbar-batt {
  width: 22px;
  height: 11px;
  border: 1.5px solid var(--win98-dark);
  border-radius: 0;
  position: relative;
  padding: 1.5px;
}
.mob-statusbar-batt::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 3px;
  width: 2px;
  height: 4px;
  background: var(--win98-dark);
  border-radius: 0;
}
.mob-statusbar-batt i {
  display: block;
  height: 100%;
  width: 80%;
  background: var(--win98-dark);
  border-radius: 0;
}

/* ─── App icons (Games/Tools folder sheet) ──────────────────────────────*/
.mob-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  cursor: var(--cur-hand); --crt-cursor: hand;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.mob-app-tile {
  width: 60px;
  height: 60px;
  border-radius: 0;
  background: var(--win98-face);
  box-shadow:
    inset -1px -1px 0 var(--win98-dark),
    inset 1px 1px 0 var(--win98-light),
    inset -2px -2px 0 var(--win98-shadow),
    inset 2px 2px 0 var(--win98-hilight);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.mob-app-tile img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  pointer-events: none;
}
.mob-app-label {
  max-width: 74px;
  font-size: 11px;
  line-height: 1.1;
  color: #F2E7D0;
  text-align: center;
  text-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mob-app:active .mob-app-tile {
  box-shadow:
    inset 1px 1px 0 var(--win98-dark),
    inset -1px -1px 0 var(--win98-light),
    inset 2px 2px 0 var(--win98-shadow),
    inset -2px -2px 0 var(--win98-hilight);
  background-image: repeating-conic-gradient(var(--win98-light) 0 25%, var(--win98-face) 0 50%);
  background-size: 2px 2px;
}

/* ─── Folder sheet (Games folder) — Win98 window over a dim scrim ───────*/
.mob-folder {
  position: fixed;
  inset: 0;
  z-index: 9050;
  font-family: 'Tahoma', 'Segoe UI', system-ui, -apple-system, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
}
.mob-folder-sheet {
  width: min(360px, 100%);
  padding: 3px;
  background: var(--win98-face);
  box-shadow:
    inset -1px -1px 0 var(--win98-dark),
    inset 1px 1px 0 var(--win98-hilight),
    inset -2px -2px 0 var(--win98-shadow),
    inset 2px 2px 0 var(--win98-light),
    4px 4px 0 rgba(0, 0, 0, 0.35);
}
.mob-folder-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 3px 0 8px;
  background: var(--win98-select);
  color: var(--win98-select-text);
  font-family: 'Tahoma', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
}
.mob-folder-close {
  width: 26px;
  height: 22px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: var(--win98-face);
  color: var(--win98-dark);
  font-size: 13px;
  box-shadow:
    inset -1px -1px 0 var(--win98-dark),
    inset 1px 1px 0 var(--win98-light),
    inset -2px -2px 0 var(--win98-shadow),
    inset 2px 2px 0 var(--win98-hilight);
  cursor: var(--cur-hand); --crt-cursor: hand;
}
.mob-folder-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 6px;
  margin-top: 3px;
  padding: 16px 8px;
  background: var(--win98-light);
  box-shadow:
    inset 1px 1px 0 var(--win98-shadow),
    inset -1px -1px 0 var(--win98-hilight),
    inset 2px 2px 0 var(--win98-dark);
}
.mob-folder-grid .mob-app-label {
  color: var(--win98-text);
}

/* ─── Full-screen app view (Win98 grey title-bar chrome) ─────────────────*/
.mob-appview {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  flex-direction: column;
  background: var(--win98-face);
}
.mob-appview[hidden] { display: none; }

.mob-appview-titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  padding: 0 6px 0 12px;
  background: var(--win98-face);
  border-bottom: 0;
  box-shadow:
    inset 0 1px 0 var(--win98-light),
    inset 0 -1px 0 var(--win98-shadow);
  /* clear the iOS status notch / safe area */
  padding-top: env(safe-area-inset-top, 0);
  height: calc(38px + env(safe-area-inset-top, 0));
}
.mob-appview-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--win98-text);
  font-family: 'Tahoma', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-shadow: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mob-appview-title img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}
.mob-appview-title span {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Win98 raised close box */
.mob-appview-close {
  flex: 0 0 auto;
  width: 30px;
  height: 26px;
  border: 0;
  border-radius: 0;
  background: var(--win98-face);
  box-shadow:
    inset -1px -1px 0 var(--win98-dark),
    inset 1px 1px 0 var(--win98-light),
    inset -2px -2px 0 var(--win98-shadow),
    inset 2px 2px 0 var(--win98-hilight);
  color: var(--win98-dark);
  font-family: 'Tahoma', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: var(--cur-hand); --crt-cursor: hand;
  -webkit-tap-highlight-color: transparent;
}
/* Optional "‹ Back to …" control (mobileShell.navigate(appId, { returnTo })) */
.mob-appview-back {
  flex: 0 0 auto;
  height: 26px;
  margin-right: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: var(--win98-face);
  color: var(--win98-dark);
  font-family: 'Tahoma', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  box-shadow:
    inset -1px -1px 0 var(--win98-dark),
    inset 1px 1px 0 var(--win98-light),
    inset -2px -2px 0 var(--win98-shadow),
    inset 2px 2px 0 var(--win98-hilight);
  cursor: var(--cur-hand); --crt-cursor: hand;
}
.mob-appview-back:active {
  box-shadow:
    inset 1px 1px 0 var(--win98-dark),
    inset -1px -1px 0 var(--win98-light),
    inset 2px 2px 0 var(--win98-shadow),
    inset -2px -2px 0 var(--win98-hilight);
}
.mob-appview-share {
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 30px;
  margin: 0 8px;
  padding: 0 5px;
  border: 0;
  border-radius: 0;
  background: var(--win98-face);
  color: var(--win98-text);
  font: 700 11px/1.4 'Tahoma', system-ui, sans-serif;
  box-shadow: inset -1px -1px 0 var(--win98-dark), inset 1px 1px 0 var(--win98-hilight), inset -2px -2px 0 var(--win98-shadow);
  cursor: var(--cur-hand); --crt-cursor: hand;
}
.mob-appview-back + .mob-appview-title { flex: 1 1 auto; min-width: 0; }

.mob-appview-close:active {
  box-shadow:
    inset 1px 1px 0 var(--win98-dark),
    inset -1px -1px 0 var(--win98-light),
    inset 2px 2px 0 var(--win98-shadow),
    inset -2px -2px 0 var(--win98-hilight);
}

.mob-appview-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--win98-face);
  position: relative;
  /* Flex column so short app content centers vertically and long content
     still scrolls from the top. */
  display: flex;
  flex-direction: column;
}
/* The app renders into this inner element (NOT a launcher panel, so apps
   take their window branch).

   `margin: auto` is the centering trick: in a flex column an item with
   auto block margins is pushed to vertical center when there is spare room,
   but collapses those margins (and the parent scrolls) once the content is
   taller than the viewport. So short fixed-height posters (Calculator,
   Typing) sit centered with no awkward beige gap below, while naturally tall
   apps (Portfolio) keep filling/scrolling from the top. */
.mob-appview-content {
  width: 100%;
  margin: auto 0;
  flex-shrink: 0;
}
