/* assets/css/grid.css */

.portfolio-page {
  padding-top: 160px;
  padding-bottom: 80px;
}

.page-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 0 48px 24px;
  border-bottom: var(--border);
  margin-bottom: 0;
}

.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: 0.06em;
  color: #0a0a0a;
}

.page-count {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-label);
}

/* Grid */
.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-top: 3px;
}

/* Grid item */
.grid-item {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
  cursor: none;
}

/* All children transparent to pointer events — grid-item itself handles everything */
.grid-item > * { pointer-events: none; }

/* Thumbnail */
.grid-item .thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #111;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}
.grid-item:hover .thumb { transform: scale(1.04); }

/* Hover video iframe — injected by grid.js */
.grid-item .hover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.grid-item .hover-video.loaded { opacity: 1; }

/* Scrim */
.grid-item .scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.75) 0%,
    rgba(0,0,0,0.1) 50%,
    transparent 100%
  );
  transition: opacity 0.35s;
}
.grid-item:hover .scrim { opacity: 0.65; }

/* Play ring */
.grid-item .play-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  opacity: 0;
  transition:
    opacity 0.3s,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.grid-item .play-ring::after {
  content: '';
  width: 0; height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent rgba(255,255,255,0.9);
  margin-left: 3px;
}
.grid-item:hover .play-ring {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Info overlay */
.grid-item .info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 18px 20px;
  z-index: 4;
  transform: translateY(4px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.grid-item:hover .info { transform: translateY(0); }

.info .client {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(20px, 2.6vw, 34px);
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.95);
  line-height: 1.1;
  margin-bottom: 3px;
}

.info .title {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-family: 'Montserrat', sans-serif;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background 0.4s;
}

.modal-overlay.open {
  background: rgba(0,0,0,0.92);
  pointer-events: all;
}

.modal-box {
  width: min(880px, 90vw);
  transform: scale(0.94) translateY(12px);
  opacity: 0;
  transition:
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s;
}

.modal-overlay.open .modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.modal-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.modal-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 14px 0 0;
}

.modal-client {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 4px;
}

.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 0.05em;
  color: var(--white);
}

.modal-close {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.5);
  padding: 8px 18px;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: none;
  transition: border-color 0.25s, color 0.25s;
  flex-shrink: 0;
}
.modal-close:hover {
  border-color: rgba(255,255,255,0.6);
  color: var(--white);
}
