/* launcherZ B07 — pen folder mechanism (index.html.b0.bak / the codepen, verbatim)
 * + pen pagination metrics + radios offscreen + the iOS10 SVG icon tiles
 * (icons.js, data-URL embedded, B077 pattern). Deltas from the pen are forced by
 * the B02 full-bleed shell and are marked DELTA inline. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #0b0b10;
  font-family: -apple-system, 'Segoe UI', system-ui, Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
}

/* pen: paging radios must never render — the "second pair of dots" was these */
input[type=radio] {
  position: fixed;
  top: -1.5em;
  left: -1.5em;
}

/* the launcher IS the page — fills the container at every width */
.screen {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, #171722 0%, #2a2440 34%, #4a3f6b 68%, #6b5a96 100%);
  color: #fff;
}

/* status */
.status {
  display: none; /* B11 (/L): the fake clock/battery row is gone - the content moves up */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  z-index: 30;
}
.clock { font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.battery { width: 24px; height: 12px; border: 1px solid rgba(255,255,255,.75); border-radius: 3px; padding: 1.5px; }
.battery-meter { height: 100%; width: 82%; background: #fff; border-radius: 1.5px; }

/* pages — the ONLY thing that slides */
.pages-wrap {
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0; /* B11: the status row is gone - the pages fill from the top */
  overflow: hidden;
}
.pages {
  display: flex;
  width: calc(var(--pages, 2) * 100%);
  height: 100%;
  transition: transform .4s cubic-bezier(0.42, 0, 0.58, 1);
}
.page {
  width: calc(100% / var(--pages, 2));
  height: 100%;
  padding: 22px 18px 120px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  grid-auto-rows: min-content;
  gap: 18px 10px;
  align-content: start;
  justify-items: center;
}

/* apps */
.app {
  text-decoration: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 84px;
  cursor: pointer;
}
.app-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .3px;
  color: rgba(255,255,255,.94);
  background: linear-gradient(160deg,
    hsl(var(--h1), var(--s), calc(var(--l) + 14%)),
    hsl(var(--h1), var(--s), var(--l)));
  box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.25);
}
/* B07: iOS10 SVG tiles (data-URL imgs) — the SVG IS the tile art, so the hue
 * gradient steps aside; sizing stays the launcher's exact box at every surface
 * (grid 58 / dock 48 / folder member 40) and the art reads on any theme
 * (opaque baked-in gradients, both the standalone shell and the DreamTeam
 * light/dark themes). */
.app-icon img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: block;
  -webkit-user-drag: none;
  user-drag: none;
}
.app.svg-tile .app-icon,
.app.dt-rail-tile.svg-tile .app-icon,
.dock-app.svg-tile .app-icon {
  background: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.app-name {
  font-size: 11px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  line-height: 1.2;
}

/* folder — PEN MECHANISM VERBATIM: the closed folder IS the .folder-apps sheet
 * (304px of real tiles scaled to 58px, glassy blur); :focus scales it open and
 * lights .bg-blur behind. Only touches: scale 58/304 = .1907894737 (launcherZ
 * icon standard) and the sheet is position:absolute so the grid flow keeps the
 * pen's tile footprint (DELTA: grid vs pen flex). */
.folder { position: relative; width: 58px; }
.folder-apps {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 45px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 0.8);
  padding: 44px 36px;
  width: 304px;
  height: 304px;
  transform: scale(0.1907894737, 0.1907894737);
  transform-origin: 0 0;
  overflow: hidden;
}
.folder-apps:focus {
  z-index: 50;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  outline: 0;
  padding: 26px 8px 26px 8px;
}
/* folder name — pen hides it closed; /L's contract keeps labels under icons
   (DELTA), so it sits under the tile and rises above the open panel via JS */
.folder-name {
  display: block;
  margin-top: 64px;
  width: 100%;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 0.8);
}
.folder-apps:focus ~ .folder-name {
  animation: folderNameFadeIn 0.2s 0.2s forwards;
  font-size: 3em;
  opacity: 0;
  width: 300px;
  text-shadow: none;
}
.folder-apps:focus ~ .bg-blur {
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  visibility: visible;
}
.folder-apps:focus .app {
  margin: 0 18px 7px 18px;
}
.folder-apps:focus .app-icon {
  border-radius: 9px;
}
.folder-apps:focus .app-name {
  display: inherit;
}
.folder-apps .app {
  margin: 0 8px 16px 8px;
  width: 60px; /* pen sheet math: 3 x (60 + 2x18 margin) = 288 = exact content width */
}
.folder-apps .app-icon {
  border-radius: 18px;
}
.folder-apps .app-name {
  display: none;
  font-size: 9px;
}

/* pen positions the dim via its positioned ancestor; .folder is the sheet's
   anchor here, so the dim goes position:fixed — same full-screen result */
.bg-blur {
  position: fixed;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
  pointer-events: none;
  transition: backdrop-filter 0.25s cubic-bezier(0.2, 0.7, 0.3, 0.8), visibility 0.25s cubic-bezier(0.2, 0.7, 0.3, 0.8);
  z-index: 45;
}
.folder-apps:focus ~ .bg-blur { pointer-events: auto; }

@keyframes folderNameFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.app-icon:active, .folder-apps:not(:focus):active {
  filter: brightness(0.7);
}

/* pagination — pen dot metrics verbatim: 8px dots, 8px visual gap
   (span margin 8px 4px), inactive opacity .3 / active 1 */
.pagination {
  position: absolute;
  bottom: 108px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  z-index: 30;
}
.pagination label { cursor: pointer; }
.pagination span {
  display: inline-block;
  margin: 8px 4px;
  opacity: 0.3;
  background-color: #fff;
  border-radius: 50%;
  height: 8px;
  width: 8px;
}

/* loader.js failure note — visible when apps.md can't be fetched */
.load-note {
  grid-column: 1 / -1;
  justify-self: start;
  align-self: start;
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px dashed rgba(255,255,255,.5);
  border-radius: 12px;
  font-size: 13px;
  color: rgba(255,255,255,.9);
  background: rgba(0,0,0,.25);
}

/* dock — PINNED: sibling of .pages, never slides */
.dock {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 26px;
  display: flex;
  gap: 14px;
  padding: 10px 16px;
  border-radius: 22px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  z-index: 30;
}
.dock-app { cursor: pointer; }
.dock-app .app-icon { width: 58px; height: 58px; border-radius: 14px; font-size: 17px; } /* B11: same size as the rows */

.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.8);
  z-index: 30;
}

/* /L 23:33 — compact screens: padding shrinks, tiles go fluid, ALL 4 columns
   always fully visible (never cropped, never overlapping) */
@media (max-width: 480px) {
  .page {
    padding: 16px 8px 120px;
    gap: 16px 6px;
  }
  .app {
    width: 100%;
    max-width: 84px;
  }
}
