/* ════════════════════════════════════════════════
   MOCNApracownia — przeglądarka realizacji (MPViewer)
   czarne tło · miękkie formy · płynne przejścia
   ════════════════════════════════════════════════ */

.mpv {
  position: fixed; inset: 0; z-index: 1600;
  display: flex; flex-direction: column;
  background: var(--dark, #1b1f1f);   /* pełne krycie; var(--dark) zawsze zdefiniowane
                                         (--dark-rgb bywa puste na produkcji → było przezroczyste) */
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s;
}
.mpv.open { opacity: 1; pointer-events: all; }

/* ambient — rozmyta poświata aktualnego zdjęcia */
.mpv-ambient { position: absolute; inset: 0; overflow: hidden; }
.mpv-ambient img {
  position: absolute; inset: -8%;
  width: 116%; height: 116%;
  object-fit: cover;
  filter: blur(80px) saturate(1.15) brightness(0.45);
  opacity: 0;
  transition: opacity 1s;
}
.mpv-ambient img.show { opacity: 0.4; }

/* dwa animowane bloby jak na stronie głównej (blobMorph z styles.css), pod treścią
   (z-index:1, content ma 2-4), nad solidnym ciemnym tłem + ambientem. Miękki glow. */
.mpv-blobs { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.mpv-blob {
  position: absolute;
  width: 50vw; height: 50vw; max-width: 720px; max-height: 720px;
  border-radius: 58% 42% 38% 62% / 53% 51% 49% 47%;
  /* BEZ blur — jak na głównej (sekcja kontakt): duży morfujący kształt,
     niskie krycie, troszkę jaśniejszy od ciemnego tła. */
  animation: blobMorph 14s ease-in-out infinite alternate;
  will-change: transform, border-radius;
}
.mpv-blob.b1 {
  left: -12vw; top: -12vh;
  background: rgba(var(--blob-primary-rgb, 173, 100, 27), 0.20);
}
.mpv-blob.b2 {
  right: -14vw; bottom: -14vh;
  width: 42vw; height: 42vw;
  background: rgba(var(--blob-primary-rgb, 173, 100, 27), 0.13);
  animation-duration: 18s;
}

.mpv-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── top bar ── */
.mpv-top {
  position: relative; z-index: 3;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 2.4rem 0.6rem;
}
.mpv-cat {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--ff-body);
  font-size: 0.6rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent);
}
.mpv-cat::before { content: ''; width: 1.6rem; height: 1px; background: var(--accent); }
.mpv-title {
  font-family: var(--ff-head);
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-weight: 300; color: var(--on-dark); line-height: 1.2;
  margin-top: 0.25rem;
}
.mpv-actions { display: flex; align-items: center; gap: 0.7rem; flex-shrink: 0; }
.mpv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 46px; min-width: 46px;
  padding: 0 1rem;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--on-dark);
  font-family: var(--ff-body); font-size: 0.66rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  backdrop-filter: blur(8px);
  transition: background-color 0.3s, border-color 0.3s, transform 0.25s var(--ease-out);
}
.mpv-btn:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.mpv-btn.icon { padding: 0; width: 46px; font-size: 0.95rem; }
.mpv-btn.playing { background: var(--accent); border-color: var(--accent); }

/* ── stage ── */
.mpv-stage {
  position: relative; z-index: 2;
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0.6rem 6vw;
  touch-action: pan-y;
}
.mpv-frame {
  position: relative;
  width: 100%; height: 100%;
  max-width: 1320px;
}
.mpv-img {
  position: absolute; inset: 0; margin: auto;   /* centrowanie BEZ transformu —
     niezależne od rozmiaru/ładowania obrazu (koniec skoku z rogu); transform
     zostaje wolny na animację przejścia i zoom */
  max-width: 100%; max-height: 100%;
  border-radius: 22px;
  opacity: 0;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8);
  user-select: none;
  -webkit-user-drag: none;
}
.mpv-img.active { opacity: 1; cursor: zoom-in; }
.mpv-img.active.zoomed { cursor: zoom-out; }

/* ── slajd z filmem YouTube ── */
.mpv-video { position: absolute; inset: 0; display: none; }
.mpv-video.show { display: block; }
.mpv-video iframe {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 100%; max-width: 1180px;
  aspect-ratio: 16 / 9;
  max-height: 100%;
  border: 0; border-radius: 22px;
  background: #000;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8);
}

.mpv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 4;
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--on-dark); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  transition: background-color 0.3s, border-color 0.3s, transform 0.25s var(--ease-out);
}
.mpv-nav:hover { background: var(--accent); border-color: var(--accent); }
.mpv-nav.prev { left: 1.8rem; }
.mpv-nav.prev:hover { transform: translateY(-50%) translateX(-3px); }
.mpv-nav.next { right: 1.8rem; }
.mpv-nav.next:hover { transform: translateY(-50%) translateX(3px); }

/* ── bottom: counter + filmstrip ── */
.mpv-bottom {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
  padding: 0.8rem 2.4rem 1.5rem;
}
.mpv-count {
  display: flex; align-items: center; gap: 0.9rem;
  font-family: var(--ff-head); font-style: italic;
  font-size: 0.95rem;
  color: var(--on-dark-faint);
}
.mpv-count b { font-style: italic; font-weight: 400; color: var(--accent); font-size: 1.2rem; }
.mpv-count .bar {
  width: 84px; height: 2px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.mpv-count .bar i {
  display: block; height: 100%;
  background: var(--accent);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}

.mpv-strip {
  display: flex; gap: 0.55rem;
  max-width: min(86vw, 920px);
  overflow-x: auto;
  padding: 0.3rem 0.3rem 0.45rem;
  scrollbar-width: none;
}
.mpv-strip::-webkit-scrollbar { display: none; }
.mpv-thumb {
  flex: 0 0 auto;
  width: 68px; height: 46px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid transparent;
  padding: 0; background: none; cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.3s, transform 0.35s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
}
.mpv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mpv-thumb:hover { opacity: 0.85; transform: translateY(-3px); }
.mpv-thumb.video { position: relative; }
.mpv-thumb.video::after {
  content: '▶'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.mpv-thumb.active {
  opacity: 1;
  transform: scale(1.12);
  border-color: var(--accent);
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.8);
}

/* fly clone (animacja otwarcia z kafelka) */
.mpv-fly {
  position: fixed; z-index: 1700;
  object-fit: cover;
  pointer-events: none;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8);
}

@media (max-width: 860px) {
  .mpv-top { padding: 1.1rem 1.2rem 0.4rem; }
  .mpv-stage { padding: 0.5rem 4vw; }
  .mpv-nav { display: none; }
  .mpv-bottom { padding: 0.6rem 1rem 1rem; }
  .mpv-thumb { width: 54px; height: 38px; border-radius: 9px; }
  .mpv-btn.lbl span { display: none; }
  .mpv-btn.lbl { width: 46px; padding: 0; }
}
