/* ==========================================================================
   NEXUS-V · Showcase
   Toolbar, grid / list / 3D gallery views, live preview, page transition
   ========================================================================== */

.work {
  border-top: 1px solid var(--line);
}

/* ── Toolbar ───────────────────────────────────────────────────────────── */
.toolbar {
  position: sticky;
  top: 14px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 14, 12, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  transition: top 0.7s var(--ease);
}
body.nav-shown .toolbar {
  top: calc(var(--nav-h) - 6px);
}
.filters {
  position: relative;
  display: flex;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters.is-clipped {
  -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent);
  mask-image: linear-gradient(90deg, #000 90%, transparent);
}
.filters::-webkit-scrollbar {
  display: none;
}
.filters__pill {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.6s var(--ease), width 0.6s var(--ease);
}
.filter {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.4s var(--ease);
}
.filter:hover {
  color: var(--ink);
}
.filter.is-active {
  color: #0b0a09;
}
.filter__n {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  transition: color 0.4s var(--ease);
}
.filter.is-active .filter__n {
  color: rgba(11, 10, 9, 0.68);
}
.toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  width: 220px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(236, 228, 214, 0.025);
  transition: width 0.6s var(--ease), border-color 0.3s var(--ease);
}
.search:focus-within {
  width: 270px;
  border-color: var(--line-3);
}
.search svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--ink-3);
}
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 14px;
}
/* iOS zooms into inputs under 16px; keep touch screens at 16px */
@media (hover: none) and (pointer: coarse) {
  .search input {
    font-size: 16px;
  }
}
.search input::placeholder {
  color: var(--ink-3);
}
.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search kbd {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  color: var(--ink-3);
}
.views {
  position: relative;
  display: flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(236, 228, 214, 0.025);
}
.views__pill {
  position: absolute;
  z-index: 0;
  top: 3px;
  left: 3px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.55s var(--ease);
}
.views button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--ink-2);
  transition: color 0.4s var(--ease);
}
.views button[aria-pressed="true"] {
  color: #0b0a09;
}
.views svg {
  width: 16px;
  height: 16px;
}
.work__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
  padding: 0 6px;
}
.work__meta b {
  color: var(--ink);
  font-weight: 500;
}
@media (max-width: 1100px) {
  .toolbar {
    flex-wrap: wrap;
    border-radius: 24px;
  }
  .filters {
    width: 100%;
    order: 2;
  }
  .toolbar__right {
    width: 100%;
    justify-content: space-between;
  }
  .search,
  .search:focus-within {
    width: auto;
    flex: 1;
  }
}

/* ── Stage + view switching ────────────────────────────────────────────── */
.work__stage {
  position: relative;
  min-height: 300px;
}
.view {
  display: none;
}
.view.is-active {
  display: block;
}
.view.grid.is-active {
  display: grid;
}
.empty {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 90px 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  text-align: center;
}
.empty h3 {
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: -0.035em;
}
.empty p {
  color: var(--ink-2);
}

/* ── Grid view ─────────────────────────────────────────────────────────── */
.grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(36px, 3.4vw, 56px) clamp(16px, 1.5vw, 24px);
}
@media (max-width: 1180px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
.card {
  --accent-rgb: 165, 147, 255;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.card__link {
  position: absolute;
  inset: -8px;
  z-index: 2;
  border-radius: calc(var(--radius) + 6px);
}
.card__media {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
  isolation: isolate;
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.9s var(--ease), border-color 0.5s var(--ease), box-shadow 0.7s var(--ease);
  will-change: transform;
}
.card.is-tilting .card__media {
  transition: transform 0.18s linear, border-color 0.5s var(--ease), box-shadow 0.7s var(--ease);
}
.card:hover .card__media,
.card.is-current .card__media {
  border-color: var(--line-2);
  box-shadow: 0 46px 90px -42px rgba(var(--accent-rgb), 0.55);
}
.card__frames img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.8s var(--ease), transform 2.2s var(--ease);
}
.card__frames img.is-on {
  opacity: 1;
  transform: scale(1.001);
}
.card:hover .card__frames img.is-on,
.card.is-current .card__frames img.is-on {
  transform: scale(1.04);
}
.card__shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, transparent 26%, transparent 60%, rgba(0, 0, 0, 0.55) 100%);
}
.card__glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(236, 228, 214, 0.16), transparent 42%);
  transition: opacity 0.5s var(--ease);
  mix-blend-mode: soft-light;
}
.card:hover .card__glare {
  opacity: 1;
}
.card__bars {
  position: absolute;
  z-index: 4;
  left: 14px;
  right: 14px;
  top: 12px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.card:hover .card__bars,
.card.is-current .card__bars {
  opacity: 1;
}
.card__bars i {
  position: relative;
  flex: 1;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(236, 228, 214, 0.26);
}
.card__bars i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.card__bars i.is-done::after {
  transform: scaleX(1);
}
.card__bars i.is-run::after {
  animation: bar var(--dur, 1800ms) linear forwards;
}
@keyframes bar {
  to { transform: scaleX(1); }
}
.card__no {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(236, 228, 214, 0.78);
  transition: opacity 0.35s var(--ease);
}
.card:hover .card__no,
.card.is-current .card__no {
  opacity: 0;
}
.card__badge {
  position: absolute;
  z-index: 4;
  left: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(236, 228, 214, 0.12);
  background: rgba(13, 12, 10, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.card__badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(201, 173, 132, 0.7);
}
.card__badge.is-live i {
  background: var(--ink);
  box-shadow: 0 0 8px rgba(236, 230, 220, 0.6);
}
.card__phone {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 14px;
  width: 21%;
  aspect-ratio: 390 / 844;
  border-radius: 12px;
  border: 3px solid #100f0c;
  outline: 1px solid rgba(236, 228, 214, 0.16);
  background: #000;
  overflow: hidden;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translate3d(0, 60%, 0) rotate(8deg);
  transition: transform 0.9s var(--ease), opacity 0.6s var(--ease);
}
.card__phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.card:hover .card__phone,
.card.is-current .card__phone {
  opacity: 1;
  transform: none;
  transition-delay: 0.12s;
}
.card__body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  padding: 0 4px;
}
.card__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: clamp(20px, 1.6vw, 25px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.card__title small {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.card__tagline {
  font-size: 14.5px;
  color: var(--ink-2);
}
.card__btns {
  grid-row: span 2;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card__btn {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--ink);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.6s var(--ease);
}
.card__btn svg {
  width: 16px;
  height: 16px;
}
.card__btn:hover {
  background: rgba(236, 228, 214, 0.08);
  border-color: var(--line-3);
}
.card__btn--go {
  background: var(--ink);
  border-color: var(--ink);
  color: #0b0a09;
}
.card__btn--go:hover {
  background: var(--ink);
  transform: rotate(45deg);
}
.card:hover .card__btn--go {
  transform: rotate(45deg);
}
.card__meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.card__meta span {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.card__meta span:first-child {
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--ink);
}

/* Generated cover for projects without screenshots */
.cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(110% 90% at 18% 0%, rgba(var(--accent-rgb), 0.38), transparent 58%),
    radial-gradient(80% 80% at 100% 100%, rgba(var(--accent-rgb), 0.22), transparent 60%),
    #0e0c0a;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(236, 228, 214, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 228, 214, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent);
  mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent);
}
.cover__title {
  position: relative;
  font-size: clamp(30px, 3.4vw, 54px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}
.cover__host {
  position: relative;
}

/* ── List view ─────────────────────────────────────────────────────────── */
.list__head,
.row {
  display: grid;
  grid-template-columns: 64px minmax(0, 2.6fr) minmax(0, 1fr) minmax(0, 1fr) 70px 104px;
  align-items: center;
  gap: 16px;
}
.list__head {
  padding: 0 6px 14px;
  border-bottom: 1px solid var(--line);
}
.row {
  position: relative;
  padding: clamp(20px, 2vw, 30px) 6px;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-rgb), 0.02) 60%, transparent);
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform 0.7s var(--ease);
}
.row:hover::before {
  transform: scaleY(1);
}
.row__link {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.row__no,
.row__year {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.row__title {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  font-size: clamp(28px, 3.5vw, 58px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.048em;
  transition: transform 0.7s var(--ease);
}
.row:hover .row__title {
  transform: translateX(14px);
}
.row__title > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row__title > .row__name {
  min-width: 0;
}
.row__title em {
  flex: none;
  font-family: var(--serif);
  font-size: 0.42em;
  letter-spacing: -0.01em;
  color: var(--ink-3);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.5s var(--ease), transform 0.7s var(--ease);
}
.row:hover .row__title em {
  opacity: 1;
  transform: none;
}
.row__thumb {
  display: none;
  flex: none;
  width: 84px;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-3);
}
.row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.row__cat,
.row__build {
  font-size: 15px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row__actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
@media (hover: none) {
  .row__thumb {
    display: block;
  }
}
@media (max-width: 900px) {
  .list__head {
    display: none;
  }
  .row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .row__no,
  .row__cat,
  .row__build,
  .row__year {
    display: none;
  }
  .row__thumb {
    display: block;
  }
  .row__title {
    font-size: clamp(24px, 7vw, 40px);
    gap: 14px;
  }
  .row__title em {
    display: none;
  }
}

/* floating preview that follows the cursor in list view */
.fp {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: clamp(280px, 25vw, 420px);
  aspect-ratio: 16 / 10;
  pointer-events: none;
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  background: var(--bg-2);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  will-change: transform, opacity;
}
.fp__strip {
  position: absolute;
  inset: 0;
  transition: transform 0.8s var(--ease);
}
.fp__item {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.fp__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fp__item .cover {
  position: absolute;
}

/* ── 3D gallery view ───────────────────────────────────────────────────── */
.cinema {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: clamp(620px, 84vh, 900px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 36%, rgba(var(--accent-rgb), 0.16), transparent 70%),
    linear-gradient(180deg, var(--bg-1), var(--bg));
  user-select: none;
  transition: background 0.8s var(--ease);
}
.cinema:focus-visible {
  outline-offset: -2px;
  border-radius: var(--radius-lg);
}
.cinema__stage {
  position: relative;
  overflow: hidden;
  perspective: 1700px;
  perspective-origin: 50% 45%;
  touch-action: pan-y;
  cursor: grab;
}
.cinema.is-dragging .cinema__stage {
  cursor: grabbing;
}
.cinema__floor {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -14%;
  height: 50%;
  background-image:
    linear-gradient(rgba(236, 228, 214, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 228, 214, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: rotateX(76deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(0deg, #000, transparent 85%);
  mask-image: linear-gradient(0deg, #000, transparent 85%);
  pointer-events: none;
}
.cinema__track {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.slide {
  --w: min(50vw, 760px);
  position: absolute;
  left: 50%;
  top: 46%;
  width: var(--w);
  aspect-ratio: 16 / 10;
  margin-left: calc(var(--w) / -2);
  margin-top: calc(var(--w) * -0.3125);
  border-radius: 20px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  overflow: hidden;
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.9);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-box-reflect: below 14px linear-gradient(transparent 76%, rgba(236, 228, 214, 0.1));
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.slide__dim {
  position: absolute;
  inset: 0;
  background: #0b0a09;
  opacity: var(--dim, 0);
  pointer-events: none;
}
.cinema__ui {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding: clamp(20px, 2.4vw, 32px) clamp(20px, 2.6vw, 36px);
  border-top: 1px solid var(--line);
  background: rgba(11, 10, 9, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.cinema__info h3 {
  margin-top: 8px;
  font-size: clamp(30px, 3.4vw, 56px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;
}
.cinema__info p {
  margin-top: 10px;
  color: var(--ink-2);
  max-width: 60ch;
}
.cinema__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.cinema__nav {
  display: grid;
  justify-items: end;
  gap: 16px;
}
.cinema__arrows {
  display: flex;
  gap: 8px;
}
.cinema__arrows .icon-btn {
  width: 52px;
  height: 52px;
}
.cinema__progress {
  width: 200px;
  height: 2px;
  border-radius: 2px;
  background: var(--line-2);
  overflow: hidden;
}
.cinema__progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 0.6s var(--ease);
}
@media (max-width: 760px) {
  .cinema {
    height: auto;
    grid-template-rows: 62vw auto;
    min-height: 0;
  }
  .slide {
    --w: 74vw;
    top: 50%;
    -webkit-box-reflect: unset;
  }
  .cinema__info p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .cinema__ui {
    grid-template-columns: 1fr;
  }
  .cinema__nav {
    justify-items: start;
  }
  .cinema__progress {
    width: 140px;
  }
}

/* ── Live preview dialog ───────────────────────────────────────────────── */
.pv {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  overscroll-behavior: contain;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.pv__backdrop,
.pv__bar,
.pv__foot {
  touch-action: none;
}
.pv__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 5, 4, 0.84);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.pv.is-open .pv__backdrop {
  opacity: 1;
}
.pv__panel {
  --accent-rgb: 165, 147, 255;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  margin: 12px;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: #0e0d0b;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, 40px, 0) scale(0.97);
  transition: opacity 0.5s var(--ease), transform 0.9s var(--ease);
}
.pv.is-open .pv__panel {
  opacity: 1;
  transform: none;
}
.pv__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
}
.pv__id {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.pv__id .brand__mark {
  width: 26px;
  height: 26px;
}
.pv__id > div {
  min-width: 0;
}
.pv__id h3 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pv__id p {
  font-size: 10px;
  margin-top: 1px;
}
.pv__devices {
  position: relative;
  display: flex;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(236, 228, 214, 0.03);
}
.pv__devices .views__pill {
  top: 4px;
  left: 4px;
  height: 34px;
  border-radius: 999px;
  transition: transform 0.55s var(--ease), width 0.55s var(--ease);
}
.pv__devices button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  transition: color 0.4s var(--ease);
}
.pv__devices button[aria-pressed="true"] {
  color: #0b0a09;
}
.pv__devices svg {
  width: 15px;
  height: 15px;
}
.pv__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.pv__actions .icon-btn {
  width: 40px;
  height: 40px;
}
.pv__stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(var(--accent-rgb), 0.12), transparent 70%),
    #090807;
}
.pv__device {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 50%;
  transition: opacity 0.35s var(--ease);
}
.pv__device.is-swapping {
  opacity: 0;
}
.pv__device[data-kind="desktop"] {
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #12110e;
  overflow: hidden;
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.6);
}
.pv__chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #100f0d;
}
.pv__device:not([data-kind="desktop"]) .pv__chrome {
  display: none;
}
.pv__lights {
  display: flex;
  gap: 7px;
}
.pv__lights i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(236, 228, 214, 0.14);
}
.pv__url {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 520px;
  height: 26px;
  margin-inline: auto;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(236, 228, 214, 0.05);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pv__url svg {
  width: 11px;
  height: 11px;
  flex: none;
}
.pv__reload {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--ink-3);
  transition: color 0.3s, background-color 0.3s;
}
.pv__reload:hover {
  color: var(--ink);
  background: rgba(236, 228, 214, 0.06);
}
.pv__reload svg {
  width: 14px;
  height: 14px;
}
.pv__device[data-kind="tablet"],
.pv__device[data-kind="mobile"] {
  padding: 14px;
  border-radius: 46px;
  background: linear-gradient(145deg, #26231f, #100f0c 40%, #1a1815);
  box-shadow:
    inset 0 0 0 1px rgba(236, 228, 214, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.8),
    0 60px 120px rgba(0, 0, 0, 0.7);
}
.pv__device[data-kind="mobile"] {
  padding: 12px;
  border-radius: 58px;
}
.pv__device[data-kind="mobile"]::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 22px;
  width: 112px;
  height: 32px;
  margin-left: -56px;
  border-radius: 20px;
  background: #000;
}
.pv__screen {
  position: relative;
  overflow: hidden;
  background: #000;
}
.pv__device[data-kind="tablet"] .pv__screen {
  border-radius: 32px;
}
.pv__device[data-kind="mobile"] .pv__screen {
  border-radius: 46px;
}
.pv__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
.pv__load {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: #0b0a09;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.pv__load.is-done {
  opacity: 0;
  visibility: hidden;
}
.pv__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: 0.35;
  filter: blur(6px) saturate(0.9);
  transform: scale(1.05);
}
.pv__spinner {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(236, 228, 214, 0.14);
  border-top-color: var(--ink);
  animation: spin 0.9s linear infinite;
}
.pv__load p {
  position: relative;
}
.pv__blocked {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 30px;
  text-align: center;
  background: rgba(11, 10, 9, 0.86);
}
.pv__blocked h4 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.pv__blocked p {
  max-width: 40ch;
  color: var(--ink-2);
}
.pv__foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 12px 14px 12px 18px;
  border-top: 1px solid var(--line);
}
.pv__desc {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.pv__desc p {
  font-size: 14px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pv__tags {
  display: flex;
  gap: 6px;
  flex: none;
}
.pv__tags span {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.pv__end {
  display: flex;
  align-items: center;
  gap: 22px;
}
.pv__keys {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pv__keys kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  color: var(--ink-3);
  margin-right: 4px;
}
@media (max-width: 1000px) {
  .pv__bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .pv__devices {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }
  .pv__devices button span {
    display: none;
  }
  .pv__keys,
  .pv__tags {
    display: none;
  }
}
@media (max-width: 640px) {
  .pv__panel {
    margin: 0;
    border-radius: 0;
    border: 0;
  }
  .pv__actions .btn .roll {
    display: none;
  }
  .pv__actions .btn {
    padding: 0 14px;
  }
  .pv__nav-prev,
  .pv__nav-next {
    display: none !important;
  }
  .pv__foot {
    grid-template-columns: 1fr;
  }
  .pv__desc {
    display: none;
  }
  .pv__foot .btn {
    width: 100%;
  }
  .pv__end {
    display: block;
  }
}

/* ── Outbound page transition ──────────────────────────────────────────── */
.xfer {
  --cx: 50%;
  --cy: 50%;
  position: fixed;
  inset: 0;
  z-index: 450;
  display: grid;
  place-items: center;
  pointer-events: none;
  visibility: hidden;
  background:
    radial-gradient(70% 70% at 50% 50%, rgba(var(--accent-rgb, 165, 147, 255), 0.28), transparent 70%),
    #0b0a09;
  clip-path: circle(0% at var(--cx) var(--cy));
}
.xfer.is-on {
  visibility: visible;
  pointer-events: auto;
}
.xfer__inner {
  display: grid;
  justify-items: center;
  gap: 22px;
  padding: 24px;
  text-align: center;
}
.xfer__title {
  font-size: clamp(56px, 11vw, 200px);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.06em;
  overflow: hidden;
  padding-bottom: 0.06em;
}
.xfer__title span {
  display: inline-block;
}
.xfer__bar {
  width: 200px;
  height: 1px;
  background: rgba(236, 228, 214, 0.2);
  overflow: hidden;
}
.xfer__bar i {
  display: block;
  height: 100%;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* phones: the toolbar scrolls with the page and the hover tip is hidden */
@media (max-width: 700px) {
  .toolbar,
  body.nav-shown .toolbar {
    position: relative;
    top: auto;
  }
  .work__tip {
    display: none;
  }
}
@media (hover: none) {
  .work__tip {
    display: none;
  }
}

/* ── Live previews ─────────────────────────────────────────────────────── */
.live {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  background: #000;
  transition: opacity 0.9s var(--ease);
}
.is-live > .live {
  opacity: 1;
}
.live__frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 1440px;
  max-width: none;
  height: 900px;
  border: 0;
  background: #000;
  transform-origin: 0 0;
  pointer-events: none;
}
.card__media.is-live .card__bars,
.card__media.is-live .card__phone {
  opacity: 0 !important;
  transform: translate3d(0, 20%, 0) !important;
}
.card__media.is-live .card__shade {
  opacity: 0.55;
}
.card__badge b {
  font-weight: inherit;
}
.card__badge.is-connecting i {
  animation: blinkDot 0.9s steps(2) infinite;
}
.card__badge.is-streaming {
  border-color: rgba(201, 173, 132, 0.45);
  color: var(--ink);
}
.card__badge.is-streaming i {
  position: relative;
}
.card__badge.is-streaming i::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ping 1.8s var(--ease) infinite;
}
@keyframes blinkDot {
  50% { opacity: 0.25; }
}
.slide .live {
  z-index: 1;
}
.slide.is-live .slide__dim {
  z-index: 2;
}

/* toggle */
.work__tools {
  display: flex;
  align-items: center;
  gap: 18px;
}
.live-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.live-toggle:hover {
  border-color: var(--line-3);
  color: var(--ink);
}
.live-toggle i {
  position: relative;
  width: 26px;
  height: 16px;
  border-radius: 999px;
  background: rgba(236, 228, 214, 0.14);
  transition: background-color 0.3s var(--ease);
}
.live-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.45s var(--ease), background-color 0.3s var(--ease);
}
.live-toggle[aria-pressed="true"] {
  color: var(--ink);
}
.live-toggle[aria-pressed="true"] i {
  background: var(--accent);
}
.live-toggle[aria-pressed="true"] i::after {
  transform: translateX(10px);
  background: var(--bg);
}
@media (hover: none) {
  .live-toggle {
    display: none;
  }
}
