/* Live preview ===============================================================
   "Preview / Full Bleed" (1440 x 900): a bar with the pages and the device,
   the page in a browser window (or a phone), a minimap that follows the scroll
   and the keys. The window follows the size of the screen.
   ========================================================================== */
.p-preview { --ww: min(1104px, calc(100vw - 336px)); --wl: calc((100vw - var(--ww) - 120px) / 2 - 12px); height: 100vh; height: 100dvh; overflow: hidden; }

/* Bar */
.pv-bar { position: fixed; z-index: 20; left: 0; right: 0; top: 0; height: 73px; border-bottom: 1px solid rgb(255 255 255 / .071); background: rgb(4 6 11 / .6); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.pv-close { position: absolute; left: 24px; top: 16px; }
.pv-name { position: absolute; left: 80px; top: 18px; font: 500 15px/20px var(--f-text); letter-spacing: -0.1px; color: var(--c-white); white-space: nowrap; }
.pv-name a:hover { color: var(--c-arc); }
.pv-meta { position: absolute; left: 80px; top: 40px; font: 400 11px/14px var(--f-mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--c-haze); white-space: nowrap; }
.pv-tabs {
  --edge: linear-gradient(180deg, rgb(255 255 255 / .349), rgb(255 255 255 / .071) 50%, rgb(255 255 255 / .18));
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 4px;
  border-radius: 22px;
  background: linear-gradient(90deg, rgb(158 191 221 / .22), rgb(158 191 221 / .122));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .18);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  white-space: nowrap;
}
.pv-tab { position: relative; z-index: 1; height: 36px; padding: 0 16px; border-radius: 18px; font: 500 15px/20px var(--f-text); letter-spacing: -0.1px; color: #C3CCD5; transition: color .45s var(--ease-out); }
.pv-tab:hover { color: var(--c-white); }
.pv-tab[aria-selected="true"] { color: var(--c-ink); }
.pv-thumb {
  position: absolute; z-index: 0; left: 0; top: 4px; height: 36px; width: var(--tw, 74px);
  border-radius: 18px; background: var(--light-fill); box-shadow: inset 0 0 0 1px #fff;
  transform: translateX(var(--tx, 4px));
  transition: transform .55s var(--ease-out), width .55s var(--ease-out);
}
.pv-device {
  position: absolute; right: 176px; top: 18px; display: grid; grid-template-columns: 76px 70px; gap: 0; height: 36px; padding: 3px;
  border-radius: 18px; background: rgb(255 255 255 / .031); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .102);
}
.pv-device button { position: relative; z-index: 1; height: 30px; border-radius: 15px; font: 500 13px/16px var(--f-text); color: var(--c-mist); transition: color .45s var(--ease-out); }
.pv-device button:hover { color: var(--c-white); }
.pv-device button[aria-pressed="true"] { color: var(--c-ink); }
.pv-dthumb { position: absolute; left: 3px; top: 3px; width: 76px; height: 30px; border-radius: 15px; background: var(--light-fill); transition: transform .55s var(--ease-out), width .55s var(--ease-out); }
.pv-device[data-state="m"] .pv-dthumb { transform: translateX(76px); width: 70px; }
.pv-add { position: absolute; right: 24px; top: 16px; padding: 0 18px; }

/* Window */
.pv-main { position: fixed; left: 0; right: 0; top: 73px; bottom: 0; }
.pv-glow { --x: 220px; --y: 567px; --w: 1000px; --h: 320px; --c: rgb(29 79 120 / .502); --b: 150px; left: calc(var(--wl) + 124px); }
.pv-win {
  position: absolute; left: var(--wl); top: 23px; width: var(--ww); bottom: 88px;
  border-radius: 14px; background: #0B1220;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .141), 0 40px 90px -10px rgb(0 0 0 / .8);
  transition: width .6s var(--ease-out), left .6s var(--ease-out), border-radius .6s var(--ease-out);
}
.pv-win::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 3;
  background: linear-gradient(180deg, rgb(255 255 255 / .278), rgb(255 255 255 / .039) 40%, rgb(255 255 255 / .078));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.pv-win .sw-dots { position: absolute; left: 14px; top: 10px; display: flex; gap: 5px; }
.pv-win .sw-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgb(255 255 255 / .18); }
.pv-addr {
  position: absolute; left: calc(50% - 172px); top: 6px; width: 344px; height: 14px; border-radius: 7px;
  background: rgb(255 255 255 / .071);
  font: 500 13px/14px var(--f-text); text-align: center; color: var(--c-haze);
}
.pv-island { display: none; }
.pv-screen {
  position: absolute; left: 0; right: 0; top: 26px; bottom: 0; overflow-x: hidden; overflow-y: auto;
  border-radius: 0 0 14px 14px; background: #0B1626;
  scrollbar-width: none; overscroll-behavior: contain;
}
.pv-screen::-webkit-scrollbar { display: none; }
.pv-screen:focus-visible { outline: 2px solid var(--c-arc); outline-offset: -2px; }
.pv-stack img { display: block; width: 100%; height: auto; background: #0B1626; }
.pv-stack.is-in { animation: pv-in .5s var(--ease-out); }
@keyframes pv-in { from { opacity: 0; } }

/* The phone, when the device is Mobile */
.pv-win[data-dev="m"] {
  --ph: calc(100vh - 73px - 23px - 88px);
  left: calc(var(--wl) + var(--ww) / 2 - (var(--ph) - 16px) * 390 / 844 / 2 - 8px);
  width: calc((var(--ph) - 16px) * 390 / 844 + 16px);
  border-radius: 44px; background: #0A0E14;
  box-shadow: inset 0 0 0 1px rgb(220 235 247 / .4), 0 40px 90px -10px rgb(0 0 0 / .8);
}
.pv-win[data-dev="m"]::after { display: none; }
.pv-win[data-dev="m"] .sw-dots, .pv-win[data-dev="m"] .pv-addr { display: none; }
.pv-win[data-dev="m"] .pv-screen { left: 8px; right: 8px; top: 8px; bottom: 8px; border-radius: 36px; }
.pv-win[data-dev="m"] .pv-island { display: block; position: absolute; z-index: 4; left: calc(50% - 40px); top: 18px; width: 80px; height: 22px; border-radius: 11px; background: #000; }

/* Minimap */
.pv-map { position: absolute; left: calc(var(--wl) + var(--ww) + 48px); top: 23px; width: 72px; }
.pv-map-label, .pv-len { font: 400 11px/14px var(--f-mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--c-haze); white-space: nowrap; }
.pv-strip { position: relative; margin-top: 10px; width: var(--sw, 72px); height: var(--sh, 588px); border-radius: 6px; cursor: pointer; touch-action: none; }
.pv-strip img { width: 100%; height: 100%; border-radius: 6px; object-fit: fill; box-shadow: 0 0 0 1px rgb(255 255 255 / .122); }
.pv-dim { position: absolute; left: 0; right: 0; background: rgb(4 6 11 / .451); pointer-events: none; }
.pv-dim--a { top: 0; height: var(--vt, 0px); border-radius: 6px 6px 0 0; }
.pv-dim--b { top: calc(var(--vt, 0px) + var(--vh, 45px)); bottom: 0; border-radius: 0 0 6px 6px; }
.pv-view {
  position: absolute; left: -4px; right: -4px; top: calc(var(--vt, 0px) - 2px); height: calc(var(--vh, 45px) + 4px);
  border-radius: 6px; background: rgb(143 195 234 / .078);
  box-shadow: inset 0 0 0 1.5px var(--c-arc), 0 0 12px rgb(143 195 234 / .302);
  pointer-events: none;
}
.pv-len { margin-top: 10px; }

/* Keys */
.pv-info { position: absolute; left: var(--wl); width: var(--ww); bottom: 42px; height: 22px; }
.pv-where { position: absolute; left: 0; top: 4px; font: 400 11px/14px var(--f-mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--c-mist); white-space: nowrap; }
.pv-hints { position: absolute; left: 42%; top: 0; display: flex; align-items: center; gap: 8px; font: 500 13px/16px var(--f-text); color: var(--c-mist); white-space: nowrap; }
.pv-hints .kbd { font-family: var(--f-mono); letter-spacing: 1.2px; color: var(--c-silver); }
.pv-hints span:not(.kbd) { margin-right: 14px; }
.pv-hints span:last-child { margin-right: 0; }
.pv-promise { position: absolute; right: 0; top: 0; font: 400 14px/21px var(--f-text); color: var(--c-haze); white-space: nowrap; }
@media (max-width: 1320px) { .pv-promise { display: none; } .pv-hints { left: auto; right: 0; } }
@media (max-height: 700px) and (min-width: 1024px) { .pv-win { bottom: 64px; } .pv-info { bottom: 22px; } }

/* =========================================================================
   Phones and small tablets (< 1024): the page fills the screen
   ========================================================================= */
@media (max-width: 1023.98px) {
  .pv-bar { height: 113px; }
  .pv-close { left: 16px; top: 14px; }
  .pv-name { left: 68px; top: 16px; }
  .pv-meta { left: 68px; top: 38px; }
  .pv-add { right: 16px; top: 14px; }
  .pv-tabs { left: 0; right: 0; top: 64px; transform: none; height: 40px; padding: 0 16px; border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .pv-tabs::-webkit-scrollbar { display: none; }
  .pv-tabs::before { display: none; }
  .pv-tab { flex: none; height: 32px; padding: 0 14px; font-size: 14px; background: rgb(255 255 255 / .051); }
  .pv-tab[aria-selected="true"] { background: var(--light-fill); }
  .pv-thumb { display: none; }
  .pv-device { right: 16px; top: 66px; display: none; }
  .pv-main { top: 113px; }
  .pv-win, .pv-win[data-dev="m"] { left: 0; right: 0; top: 0; bottom: 0; width: auto; border-radius: 0; box-shadow: none; background: #0B1626; }
  .pv-win::after, .pv-win .sw-dots, .pv-addr, .pv-island, .pv-win[data-dev="m"] .pv-island { display: none; }
  .pv-screen, .pv-win[data-dev="m"] .pv-screen { left: 0; right: 0; top: 0; bottom: 0; border-radius: 0; }
  .pv-map, .pv-info, .pv-glow { display: none; }
}
