/* ==========================================================================
   Base
   ========================================================================== */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #030305;
  color: white;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  overflow-y: hidden;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ==========================================================================
   Canvas background
   ========================================================================== */
canvas#bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* ==========================================================================
   Portfolio — horizontal scroll (desktop)
   ========================================================================== */
.portfolio {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  height: 100vh;
  padding: 0 6vw;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.portfolio::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  flex: 0 0 auto;
  width: 42vw;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: center;
  transition: border-color 0.5s ease, transform 0.4s ease;
  position: relative;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  transform: scale(1.01);
}

.card-thumb {
  width: 100%;
  border-radius: 11px 11px 0 0;
  position: relative;
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  display: block;
  image-rendering: high-quality;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover .play-icon {
  opacity: 1;
}

.card-title {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.9rem;
  font-weight: 200;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0);
  padding: 1.2rem 1.5rem;
  transition: color 0.4s ease;
  text-align: left;
}

.card:hover .card-title {
  color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 2.2rem;
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: 'Inter', sans-serif;
  font-weight: 200;
  line-height: 1;
  z-index: 101;
}

.lightbox-close:hover {
  color: rgba(255, 255, 255, 0.9);
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.lightbox-video {
  width: 80vw;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.lightbox-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.lightbox-title {
  font-family: 'Exo 2', sans-serif;
  font-size: 1rem;
  font-weight: 200;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 2;
  padding: 1rem 0;
  background: linear-gradient(to top, rgba(3, 3, 5, 0.8), transparent);
  pointer-events: none;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  pointer-events: auto;
}

.footer-content a {
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-content a:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ==========================================================================
   Mobile — vertical scroll
   ========================================================================== */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
  }

  .portfolio {
    flex-direction: column;
    align-items: center;
    height: auto;
    padding: 8vh 0 12vh;
    gap: 2rem;
    overflow-x: hidden;
    overflow-y: visible;
    scroll-snap-type: none;
  }

  .card {
    width: 85vw;
    scroll-snap-align: none;
  }

  .card-title {
    color: rgba(255, 255, 255, 0.5);
  }

  .lightbox-video {
    width: 95vw;
  }

  .play-icon {
    opacity: 0.7;
  }

  .footer {
    position: relative;
    background: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 2rem 0;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}
