/*==================================================
  Base 
==================================================*/
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #000;
  color: #fff;
  font-family: 'Overpass', sans-serif;
  line-height: 1.6;
}

/*==================================================
  Fonts
==================================================*/
@font-face {
  font-family: 'Overpass';
  src: url('../fonts/Overpass-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Overpass';
  src: url('../fonts/Overpass-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Overpass';
  src: url('../fonts/Overpass-Black.ttf') format('truetype');
  font-weight: 900;
  font-display: swap;
}

/*==================================================
  Links
==================================================*/
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.7;
}

/*==================================================
  Header / Navigation
==================================================*/
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  flex-shrink: 0;
  z-index: 100; /* Increased z-index to stay above video */
  position: relative;
  background: #000;
}

.logo img {
  height: 56px;
  display: block;
}

.nav nav {
  display: flex;
  gap: 40px;
}

.nav a {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/*==================================================
  Hero / Homepage Vimeo
==================================================*/
html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  min-height: calc(100vh - 88px); /* Account for header height */
  position: relative;
}

.hero .vimeo-wrapper {
  width: 100%;
  max-width: 1200px;
  max-height: calc(100vh - 128px); /* Prevents overlap with nav - more buffer */
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 16 / 9; /* Maintain aspect ratio */
}

.hero .vimeo-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Mobile Hero */
@media (max-width: 768px) {
  .hero {
    padding: 16px;
    min-height: calc(100vh - 96px);
  }

  .hero .vimeo-wrapper {
    max-width: 100%;
    max-height: calc(100vh - 136px); /* Extra buffer for mobile */
  }
}

/*==================================================
  Top Project Player
==================================================*/
#project-player {
  max-width: 1400px;
  margin: 0 auto 48px;
  padding: 0 20px;
  text-align: center;
  display: none;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
  position: relative;
  scroll-margin-top: 0; /* Scroll to top showing nav */
}

#project-player.show {
  display: block;
  opacity: 1;
  transform: scale(1);
}

/* Reduced video size to 45vh (was 60vh) */
#project-player .vimeo-wrapper,
#project-player .multi-video-container {
  max-height: 45vh;
  width: 100%;
  margin-bottom: 16px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

#project-player .vimeo-wrapper iframe {
  width: 100%;
  height: 45vh;
  border: 0;
  border-radius: 4px;
}

/* Responsive tweak for smaller screens */
@media (max-width: 768px) {
  #project-player .vimeo-wrapper iframe,
  #project-player .multi-video-container {
    max-height: 35vh;
  }
  
  #project-player .vimeo-wrapper iframe {
    height: 35vh;
  }
}

/* Multi-video container layout */
#project-player .multi-video-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.project-credits {
  margin-top: 16px;
  font-size: 14px;
  opacity: 0.75;
  max-width: 800px;
  margin-inline: auto;
}

/* Close Button */
.close-player {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 28px;
  cursor: pointer;
  opacity: 0.8;
  z-index: 10;
}

.close-player:hover {
  opacity: 1;
}

/* Loading Spinner */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Lazy Load Images - Fade In Effect */
img.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img:not(.lazy-load) {
  opacity: 1;
}

/*==================================================
  Projects Grid
==================================================*/
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px;
}

@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.project-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hover Overlay */
.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.project-thumb:hover .project-overlay {
  opacity: 1;
}

.project-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
}

/*==================================================
  Multi / Vertical Video Groups
==================================================*/
.multi-video-container {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  min-height: 462px; /* Reserve space to prevent layout shift */
}

.multi-video-container > div {
  max-width: 260px;
  width: 100%;
  aspect-ratio: 9 / 16;
  min-height: 462px;
}

.multi-video-container video {
  max-width: 260px;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 4px;
}

/* Tablet */
@media (max-width: 1024px) {
  .multi-video-container video {
    max-width: 220px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .multi-video-container {
    flex-direction: column;
    align-items: center;
  }

  .multi-video-container video {
    max-width: 320px;
  }
}

/*==================================================
  Credits / External Links
==================================================*/
.project-credits a,
.credits-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.project-credits a:hover {
  opacity: 1;
  border-color: rgba(255,255,255,0.7);
}

.credits-link::after {
  content: " ↗";
  font-size: 0.9em;
  opacity: 0.7;
  margin-left: 4px;
}

.credits-link:hover::after {
  opacity: 1;
}

/*==================================================
  Contact Page
==================================================*/
.contact {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 24px;
  text-align: center;
  gap: 32px;
}

.contact h1 {
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.contact-details {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.contact-image img {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.contact-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.contact-email {
  font-size: 20px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .contact-details {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  .contact-text {
    align-items: center;
  }

  .contact-image img {
    width: 150px;
    height: 150px;
  }
}

/*==================================================
  Mobile Nav Spacing
==================================================*/
@media (max-width: 600px) {
  .nav {
    padding: 24px 20px;
  }

  .logo img {
    height: 48px;
  }

  .nav nav {
    gap: 24px;
  }

  .nav a {
    font-size: 13px;
    letter-spacing: 0.12em;
  }
}