html.pv-locked { overflow: hidden; }

.pv {
  --pv-accent: #4f8cff;
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: clamp(0.5rem, 2.4vw, 1.75rem);
  transition: padding 0.55s var(--ease);
}
.pv[hidden] { display: none; }
.pv.is-expanded { padding: 8px; }

.pv__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 12, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.pv__panel {
  position: relative;
  display: flex;
  width: min(1240px, 100%);
  height: min(100%, 800px);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(160deg, #0d1424, #080c18);
  border: 1px solid var(--color-border-strong);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 60px -26px var(--pv-accent);
  opacity: 0;
  transform: translate(var(--pv-dx, 0px), var(--pv-dy, 16px)) scale(var(--pv-s, 0.97));
  transform-origin: 50% 50%;
  transition: opacity 0.4s var(--ease), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), width 0.55s var(--ease), height 0.55s var(--ease), border-radius 0.55s var(--ease);
}
.pv.is-open .pv__backdrop { opacity: 1; }
.pv.is-open .pv__panel { opacity: 1; transform: none; }
.pv.is-expanded .pv__panel { width: 100%; height: 100%; border-radius: 16px; }

.pv__x {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: var(--color-text);
  background: rgba(6, 10, 20, 0.75);
  border: 1px solid rgba(120, 170, 255, 0.45);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.08);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.pv__x:hover,
.pv__x:focus-visible {
  border-color: #8fb4ff;
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.22), 0 0 22px -2px rgba(79, 140, 255, 0.8);
  transform: rotate(90deg);
}
.pv.is-expanded .pv__x { opacity: 0; pointer-events: none; }

/* ---------- Left: live preview ---------- */
.pv__media {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1.7 1 0;
  min-width: 0;
  gap: 14px;
  padding: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--pv-accent) 38%, #0a1020), #070b16 72%);
  border-right: 1px solid var(--color-border);
  transition: padding 0.55s var(--ease), gap 0.55s var(--ease);
}
.pv__media::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(90% 90% at 30% 20%, #000, transparent);
          mask-image: radial-gradient(90% 90% at 30% 20%, #000, transparent);
}
.pv.is-expanded .pv__media { padding: 0; gap: 0; border-right: 0; }

.pv__browser {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #0b0f1a;
  border: 1px solid rgba(130, 175, 255, 0.4);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.85), 0 0 50px -16px rgba(79, 140, 255, 0.55);
  transition: border-radius 0.55s var(--ease), border-color 0.55s var(--ease);
}
.pv.is-expanded .pv__browser { border-radius: 0; border-color: transparent; box-shadow: none; }

.pv__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  flex: none;
  background: linear-gradient(180deg, rgba(190, 210, 255, 0.15), rgba(190, 210, 255, 0.06));
  border-bottom: 1px solid rgba(130, 175, 255, 0.22);
}
.pv__dots { display: inline-flex; gap: 7px; flex: none; }
.pv__dots i { width: 11px; height: 11px; border-radius: 50%; background: #2a3550; }
.pv__dots i:nth-child(1) { background: #ff5f57; }
.pv__dots i:nth-child(2) { background: #febc2e; }
.pv__dots i:nth-child(3) { background: #28c840; }
.pv__address {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  max-width: 420px;
  margin-inline: auto;
  padding: 0.26rem 0.9rem;
  font-size: 0.72rem;
  color: #9fb0d6;
  background: rgba(7, 11, 24, 0.7);
  border: 1px solid rgba(120, 170, 255, 0.18);
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pv__bar-title {
  display: none;
  flex: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--color-text);
}

.pv__viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #0b0f1a; }
.pv__frame {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  background: #fff;
  transform-origin: 0 0;
}
.pv__loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8fa6d6;
  background: radial-gradient(60% 60% at 50% 40%, #0e1730, #070b16);
  transition: opacity 0.35s var(--ease);
}
.pv__loading.is-done { opacity: 0; pointer-events: none; }
.pv__spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(120, 170, 255, 0.2);
  border-top-color: #8fb4ff;
  animation: pvSpin 0.9s linear infinite;
}

.pv__mediabar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  max-height: 60px;
  overflow: hidden;
  transition: max-height 0.45s var(--ease), opacity 0.3s var(--ease);
}
.pv.is-expanded .pv__mediabar { max-height: 0; opacity: 0; pointer-events: none; }
.pv__hint { font-size: 0.74rem; letter-spacing: 0.04em; color: #8ea3d4; }

/* ---------- Buttons ---------- */
.pv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 44px;
  padding: 0 1.4rem;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #eaf1ff;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(120, 170, 255, 0.6);
  background: linear-gradient(180deg, rgba(79, 140, 255, 0.28), rgba(13, 27, 51, 0.55));
  box-shadow: 0 0 26px -6px rgba(79, 140, 255, 0.7), inset 0 0 16px rgba(79, 140, 255, 0.1);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.pv-btn svg { transition: transform 0.3s var(--ease); }
.pv-btn:hover { transform: translateY(-2px); border-color: #b4ceff; box-shadow: 0 0 38px -4px rgba(110, 163, 255, 0.95), inset 0 0 20px rgba(79, 140, 255, 0.22); }
.pv-btn:hover svg { transform: scale(1.12); }
.pv-btn--ghost { background: rgba(8, 13, 28, 0.55); box-shadow: none; border-color: rgba(120, 170, 255, 0.4); }
.pv-btn--ghost:hover { background: rgba(79, 140, 255, 0.16); box-shadow: 0 0 24px -6px rgba(79, 140, 255, 0.7); }

/* ---------- Right: project information ---------- */
.pv__content {
  flex: 1 1 0;
  min-width: 340px;
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 2.6vw, 2.2rem);
  padding-top: 3.6rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 170, 255, 0.4) transparent;
  transition: flex-grow 0.55s var(--ease), min-width 0.55s var(--ease), padding 0.55s var(--ease), opacity 0.3s var(--ease);
}
.pv__content::-webkit-scrollbar { width: 8px; }
.pv__content::-webkit-scrollbar-thumb { background: rgba(120, 170, 255, 0.35); border-radius: 8px; }
.pv__content::-webkit-scrollbar-track { background: transparent; }
.pv.is-expanded .pv__content { flex-grow: 0; min-width: 0; padding-inline: 0; opacity: 0; overflow: hidden; pointer-events: none; }

.pv__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 1rem; }
.pv__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  color: #6ea3ff;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.pv__chip .pip { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: pvPulse 2s ease-in-out infinite; }
.pv__meta-text { font-size: var(--fs-xs); color: var(--color-text-faint); }

.pv__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 2.6vw, 2.15rem); line-height: 1.12; letter-spacing: -0.02em; margin-bottom: 1rem; color: var(--color-text); }
.pv__desc { font-size: var(--fs-sm); line-height: 1.7; color: var(--color-text-muted); margin-bottom: 1.5rem; }

.pv__label { display: block; font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-faint); margin-bottom: 0.7rem; }
.pv__block { margin-bottom: 1.5rem; }
.pv__block p { font-size: var(--fs-sm); line-height: 1.65; color: #c3cee8; }
.pv__kv { display: flex; align-items: baseline; gap: 0.7rem; font-size: var(--fs-sm); color: #c3cee8; }
.pv__kv b { font-weight: 600; color: var(--color-text); }

.pv__tech-group { margin-bottom: 1rem; }
.pv__tech-group h5 { font-family: var(--font-body); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: #7f95c6; margin-bottom: 0.55rem; display: flex; align-items: center; gap: 0.6rem; }
.pv__tech-group h5::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--color-border-strong), transparent); }
.pv__badges { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.55rem; }
.pv__badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(79, 140, 255, 0.09), rgba(14, 20, 36, 0.8));
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.pv__badge:hover { border-color: rgba(120, 170, 255, 0.6); box-shadow: 0 0 22px -8px rgba(79, 140, 255, 0.8); transform: translateY(-2px); }
.pv__badge-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #8fb4ff; background: rgba(79, 140, 255, 0.14); border: 1px solid rgba(120, 170, 255, 0.28); }
.pv__badge-icon svg { width: 16px; height: 16px; }
.pv__badge strong { display: block; font-size: 0.82rem; font-weight: 600; color: var(--color-text); line-height: 1.2; }
.pv__badge small { display: block; font-size: 0.68rem; color: var(--color-text-faint); line-height: 1.25; }
.pv__tech-note { font-size: 0.72rem; line-height: 1.5; color: #7083ad; margin-top: 0.4rem; }

.pv__cta { margin-top: auto; padding-top: 1.2rem; display: flex; }

/* ---------- Floating controls (expanded mode) ---------- */
.pv__dock {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: rgba(7, 12, 26, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(120, 170, 255, 0.45);
  border-radius: 999px;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.85), 0 0 34px -10px rgba(79, 140, 255, 0.7);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 14px);
  transition: opacity 0.3s var(--ease), transform 0.45s var(--ease), visibility 0s linear 0.3s;
}
.pv.is-expanded .pv__dock { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 0.4s var(--ease) 0.3s, transform 0.5s var(--ease) 0.3s, visibility 0s; }
.pv__dock .pv-btn { height: 40px; padding: 0 1.1rem; font-size: 0.84rem; }
.pv__dock-sep { width: 1px; height: 22px; background: rgba(120, 170, 255, 0.3); }

@keyframes pvPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes pvSpin { to { transform: rotate(360deg); } }

/* ---------- Tablet / mobile: stacked ---------- */
@media (max-width: 900px) {
  .pv, .pv.is-expanded { padding: 0; }
  .pv__panel { flex-direction: column; width: 100%; height: 100%; border-radius: 0; border-width: 0; overflow-y: auto; overscroll-behavior: contain; }
  .pv.is-expanded .pv__panel { overflow: hidden; border-radius: 0; }
  .pv__media { flex: none; height: clamp(380px, 64vh, 620px); padding: 14px; padding-top: 62px; border-right: 0; border-bottom: 1px solid var(--color-border); }
  .pv.is-expanded .pv__media { height: 100%; padding: 0; }
  .pv__content { flex: none; min-width: 0; overflow: visible; padding: 1.5rem 1.25rem 2.2rem; max-height: 2400px; transition: max-height 0.55s var(--ease), padding 0.55s var(--ease), opacity 0.3s var(--ease); }
  .pv.is-expanded .pv__content { max-height: 0; padding-block: 0; padding-inline: 1.25rem; }
  .pv__x { position: fixed; top: 10px; right: 12px; width: 44px; height: 44px; }
  .pv__address, .pv__dots { display: none; }
  .pv__bar-title { display: block; }
  .pv__hint { display: none; }
  .pv__mediabar { justify-content: stretch; }
  .pv__mediabar .pv-btn { flex: 1; }
  .pv__cta { display: none; }
  .pv__dock { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .pv, .pv__backdrop, .pv__panel, .pv__media, .pv__browser, .pv__content, .pv__mediabar, .pv__dock, .pv__x, .pv-btn, .pv__badge, .pv__loading { transition: none; }
  .pv__spinner, .pv__chip .pip { animation: none; }
  .pv__panel { transform: none; }
}

.pv__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin-bottom: 1.5rem; }
.pv__fact[hidden] { display: none; }
.pv__fact .pv__label { margin-bottom: 0.45rem; }
.pv__price { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; color: #9fc4ff; text-shadow: 0 0 22px rgba(79, 140, 255, 0.45); }

.pv__fact--wide { grid-column: 1 / -1; }
.pv__fact .pv__kv { margin: 0; }

.pv__block[hidden] { display: none; }
.pv__feats { display: grid; gap: 0.5rem; }
.pv__feat { border: 1px solid var(--color-border); border-radius: 12px; background: rgba(14, 22, 44, 0.55); overflow: hidden; transition: border-color 0.3s; }
.pv__feat[open] { border-color: rgba(110, 163, 255, 0.4); }
.pv__feat summary { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 1rem; cursor: pointer; list-style: none; font-size: var(--fs-sm); font-weight: 600; color: var(--color-text); }
.pv__feat summary::-webkit-details-marker { display: none; }
.pv__feat summary:hover { background: rgba(79, 140, 255, 0.08); }
.pv__feat-count { margin-left: auto; min-width: 1.5rem; padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; text-align: center; color: #9fc4ff; background: rgba(79, 140, 255, 0.14); }
.pv__feat-plus { position: relative; flex: none; width: 14px; height: 14px; transition: transform 0.4s cubic-bezier(0.22, 0.7, 0.2, 1); }
.pv__feat-plus::before, .pv__feat-plus::after { content: ""; position: absolute; top: 50%; left: 50%; width: 12px; height: 2px; background: #8fb4ff; transform: translate(-50%, -50%); }
.pv__feat-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.pv__feat[open] .pv__feat-plus { transform: rotate(135deg); }
.pv__feat ul { list-style: none; margin: 0; padding: 0 1rem 0.9rem; display: grid; gap: 0.5rem; }
.pv__feat li { position: relative; padding-left: 1.15rem; font-size: var(--fs-sm); line-height: 1.55; color: #c3cee8; }
.pv__feat li::before { content: ""; position: absolute; left: 0.1rem; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: #5b92ff; box-shadow: 0 0 8px rgba(79, 140, 255, 0.7); }

.pv__feat-tag { display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.55rem; border-radius: 999px; font-style: normal; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #ffd9a0; background: rgba(255, 190, 90, 0.14); border: 1px solid rgba(255, 190, 90, 0.4); vertical-align: 1px; }
