@keyframes lightboxFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
.banner-item iframe[src*="728x90"] {
  width: 728px !important;
  min-width: 728px !important;
  max-width: none !important;
  height: 90px !important;
  min-height: 90px !important;
  max-height: none !important;
  display: block !important;
}
/* Force correct banner iframe dimensions for each size */
.banner-item iframe[src*="300x600"] {
  width: 300px !important;
  min-width: 300px !important;
  max-width: none !important;
  height: 600px !important;
  min-height: 600px !important;
  max-height: none !important;
  display: block !important;
}
.banner-item iframe[src*="160x600"] {
  width: 160px !important;
  min-width: 160px !important;
  max-width: none !important;
  height: 600px !important;
  min-height: 600px !important;
  max-height: none !important;
  display: block !important;
}
.banner-item iframe[src*="300x250"] {
  width: 300px !important;
  min-width: 300px !important;
  max-width: none !important;
  height: 250px !important;
  min-height: 250px !important;
  max-height: none !important;
  display: block !important;
}
/* Ensure banners and iframes are flush with the top and have no extra spacing */
#banners-container {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  top: 0 !important;
  position: static !important;
  box-sizing: content-box !important;
  display: block !important;
}
.banner-item,
.banner-item iframe {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  top: 0 !important;
  position: static !important;
  box-sizing: content-box !important;
}
/* Portfolio Page Styles */

#portfolio-grid {
  margin-bottom: 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  grid-auto-rows: 320px;
  gap: 20px 20px;
  padding: 0px;
}

@media (min-width: 768px) {
  #portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 300px;
  }
}

@media (min-width: 1024px) {
  #portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 320px;
  }
}

.portfolio-item {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  box-shadow: none;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.portfolio-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.portfolio-item img,
.portfolio-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.portfolio-item:hover img,
.portfolio-item:hover video {
  transform: scale(1.03);
}

.portfolio-item.large {
  grid-column: span 1;
  grid-row: span 2;
  min-height: 600px;
}

@media (min-width: 768px) {
  .portfolio-item.large {
    grid-column: span 2;
    min-height: auto;
  }
}

@media (min-width: 1024px) {
  .portfolio-item.large {
    grid-column: span 1;
    grid-row: span 2;
    min-height: auto;
  }
}

/* Lightbox Styles */
.portfolio-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.portfolio-lightbox.active {
  opacity: 1;
  visibility: visible;
  cursor: pointer;
}

.portfolio-lightbox.active .lightbox-backdrop {
  background: rgba(0, 0, 0, 0.8);
  opacity: 1;
  animation: lightboxFadeIn 0.4s ease;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.3s ease;
  cursor: pointer;
  opacity: 1;
  animation: none;
}
@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  position: relative;
  z-index: 10;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 300px;
  justify-content: center;
  align-items: center;
  max-height: 90vh;
  overflow: auto;
}

.portfolio-lightbox.active .lightbox-content {
  animation: lightboxSlideIn 0.4s ease;
}

@keyframes lightboxSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#portfolio-lightbox-body img,
#portfolio-lightbox-body video {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 0.75rem;
}

/* Video controls */
.video-wrapper { width: 100%; }
.video-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.vc-btn { appearance: none; -webkit-appearance: none; border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.02); color: var(--accent2); padding: 6px 10px; font-size: 13px; border-radius: 6px; cursor: pointer; }
.vc-btn:focus-visible { outline: 2px solid rgba(255,255,255,0.08); }
.vc-range {  height: 6px; background: rgba(255,255,255,0.06); border-radius: 6px; }
.vc-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--accent); border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.4); cursor: pointer; }
.vc-range::-moz-range-thumb { width: 14px; height: 14px; background: var(--accent); border-radius: 50%; cursor: pointer; }

.vc-time { font-size: 12px; color: var(--accent2); min-width: 72px; text-align: center; }

/* Animation for reveal effect */
.reveal {
  animation: fadeSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

/* Footer styles */
footer {
  flex-shrink: 0;
  background: var(--surface);
}

/* Banner replay button styles */
.banner-item {
  display: inline-block !important;
  vertical-align: top !important;
  margin-top: 24px !important;
  margin-bottom: 24px !important;
  margin-right: 16px !important;
  padding-top: 0 !important;
}

.banner-replay-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: var(--accent2);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease, box-shadow 0.12s ease;
}

.banner-replay-btn:hover:not(:disabled) {
  opacity: 1;
  background: #d6d6d6;
  color: #4a4a4a;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

.banner-replay-btn:active:not(:disabled) {
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.banner-replay-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.12);
  outline-offset: 2px;
}

.banner-replay-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.meta-label {
  color: var(--accent);
}

.meta-value {
  color: #d6d6d6;
}

.project-loader {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent2);
}

.project-loader.hidden {
  display: none;
}

.project-loader-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  animation: projectLoaderSpin 0.8s linear infinite;
}

.project-loader-text {
  font-size: 13px;
  letter-spacing: 0.04em;
}

@keyframes projectLoaderSpin {
  to {
    transform: rotate(360deg);
  }
}
