/* =====================================================================
   ASCEND CINEMA-MODE LIGHTBOX PLAYER
   Click any reel → fullscreen blackout cinema experience
   ===================================================================== */

/* The blackout overlay */
.cinema {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s cubic-bezier(0.7, 0, 0.3, 1),
              visibility 0.6s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: none;
}
.cinema.is-open {
  opacity: 1;
  visibility: visible;
}

/* Top + bottom letterbox bars — slide in like real cinema */
.cinema::before,
.cinema::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 12vh;
  background: #000;
  z-index: 10;
  transform: translateY(-100%);
  transition: transform 0.7s cubic-bezier(0.7, 0, 0.3, 1) 0.15s;
}
.cinema::before { top: 0; }
.cinema::after { bottom: 0; transform: translateY(100%); }
.cinema.is-open::before { transform: translateY(0); }
.cinema.is-open::after { transform: translateY(0); }

/* The video container — scales in dramatically */
.cinema-stage {
  position: relative;
  max-width: 92vw;
  max-height: 76vh;
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s,
              opacity 0.5s ease 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cinema.is-open .cinema-stage {
  transform: scale(1);
  opacity: 1;
}

.cinema video {
  display: block;
  max-width: 92vw;
  max-height: 76vh;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
  background: #000;
}

/* Cinema controls bar — minimal, custom */
.cinema-controls {
  position: absolute;
  bottom: -56px;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease 0.6s, transform 0.4s ease 0.6s;
}
.cinema.is-open .cinema-controls {
  opacity: 1;
  transform: translateY(0);
}

.cinema-btn {
  background: none;
  border: 0;
  color: var(--cream, #F2EAD9);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.2s;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
}
.cinema-btn:hover { opacity: 1; transform: scale(1.1); }
.cinema-btn svg { width: 18px; height: 18px; }

.cinema-progress {
  flex: 1;
  height: 2px;
  background: rgba(244, 237, 224, 0.15);
  position: relative;
  cursor: pointer;
  border-radius: 999px;
  overflow: hidden;
}
.cinema-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--cream, #F2EAD9);
  transition: width 0.1s linear;
}

.cinema-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--cream, #F2EAD9);
  opacity: 0.7;
  min-width: 88px;
  text-align: right;
}

/* Close button — top-right corner */
.cinema-close {
  position: absolute;
  top: calc(12vh + 24px);
  right: 32px;
  z-index: 20;
  background: none;
  border: 0;
  color: var(--cream, #F2EAD9);
  cursor: pointer;
  padding: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s ease 0.8s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cinema.is-open .cinema-close {
  opacity: 0.7;
}
.cinema-close:hover { opacity: 1 !important; }
.cinema-close svg { width: 16px; height: 16px; }

/* Meta strip at top: project name + category */
.cinema-meta {
  position: absolute;
  top: calc(12vh + 24px);
  left: 32px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease 0.8s, transform 0.4s ease 0.8s;
}
.cinema.is-open .cinema-meta {
  opacity: 0.9;
  transform: translateY(0);
}
.cinema-meta-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-deep, #D9CDB2);
  opacity: 0.7;
}
.cinema-meta-title {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--cream, #F2EAD9);
}

/* Reel cards — clickable thumbnails */
.reel-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 16px;
  background: var(--cream-soft, #E8DEC8);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.reel-card:hover {
  transform: translateY(-6px);
}
.reel-card video,
.reel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.5s ease;
  filter: grayscale(45%) contrast(1.05);
}
.reel-card:hover video,
.reel-card:hover img {
  transform: scale(1.04);
  filter: grayscale(0%) contrast(1);
}

/* Play indicator that pulses on the thumbnail */
.reel-card::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 2;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(20, 17, 12, 0.2);
}
.reel-card::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-40%, -50%) scale(0.8);
  width: 0; height: 0;
  border-left: 16px solid var(--cream, #F2EAD9);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  opacity: 0;
  transition: opacity 0.4s ease 0.05s, transform 0.4s ease 0.05s;
  z-index: 3;
}
.reel-card:hover::before {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.reel-card:hover::after {
  opacity: 1;
  transform: translate(-40%, -50%) scale(1);
}

/* Meta overlay on reel card */
.reel-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(20,17,12,0.85) 0%, transparent 100%);
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  color: var(--cream, #F2EAD9);
}
.reel-meta-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.reel-meta .brand {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.reel-meta .desc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.7;
}
.reel-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 1px solid rgba(244, 237, 224, 0.4);
  color: var(--cream, #F2EAD9);
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Mobile cinema */
@media (max-width: 768px) {
  .cinema::before, .cinema::after { height: 8vh; }
  .cinema-stage { max-width: 100vw; max-height: 70vh; }
  .cinema video { max-width: 100vw; max-height: 70vh; }
  .cinema-meta, .cinema-close {
    top: calc(8vh + 12px);
    left: 16px;
    right: 16px;
  }
  .cinema-meta-title { font-size: 20px; }
}
