/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  background: #000;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  padding-top: 110px; /* Adjusted for header height */
  overflow-x: hidden; /* prevent horizontal scroll on mobile */
}
a {
  color: inherit;
  text-decoration: none;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: #000;
}
.menu-toggle {
  display: none;
}
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}
.header-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 50px;
}
.logo {
  font-size: 1.5rem;
  font-weight: 600;
}
.menu-icon {
  display: none;
  font-size: 2rem;
  cursor: pointer;
}

/* Desktop navigation spacing update */
.main-nav {
  display: flex;
  gap: 40px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .menu-icon {
    display: block;
  }
  .main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    background: #111;
    width: 100%;
    padding: 30px 0 30px;
    margin: 0;
    z-index: 1000;
  }
  .menu-toggle:checked ~ .header-container .header-layout .main-nav {
    display: flex;
  }
  .main-nav a {
    margin: 0;
    padding: 4px 0;
    line-height: 1.1;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* Make portfolio section and containers full width */
  .portfolio,
  .portfolio-content,
  .portfolio-grid {
    max-width: 100vw !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  /* Single column grid, no gaps */
  .portfolio-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* Portfolio items full viewport width */
  .portfolio-item {
    width: 100vw !important;
    max-width: 100vw !important;
    aspect-ratio: 16 / 9;
  }

  /* Always show overlay text on mobile */
  .portfolio-item .overlay {
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    text-shadow: 0 0 5px rgba(0,0,0,0.7);
  }
}

/* Showreel */
.showreel {
  overflow: hidden;
  margin-top: 0; /* Removed margin so video is flush below header */
}
.video-crop-container {
  width: 100%;
  aspect-ratio: 2.35 / 1;
  position: relative;
  overflow: hidden;
}
.video-inner {
  position: absolute;
  inset: 0;
  transform: scale(1.35);
  transform-origin: center;
  pointer-events: none;
}
.video-inner iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Intro Section */
.intro {
  background: #000;
  padding: 40px 50px;
  text-align: center;
}
.intro-layout {
  max-width: 1200px;
  margin: 0 auto;
}
.intro-layout .headline h2 {
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

/* Portfolio Section */
.portfolio {
  background: #111;
  padding: 40px 0;
}
.portfolio-content {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 50px;
  text-align: center;
}
.portfolio-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 50px;
  gap: 0;
  box-sizing: border-box;
}
.portfolio-item {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: block;
}
.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay styling with fade transition */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  color: transparent;
  font-weight: 600;
  font-size: 1.3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  white-space: normal;
  user-select: none;
  opacity: 0;
}

/* Desktop hover overlay */
@media (min-width: 769px) {
  .portfolio-item:hover .overlay {
    background: rgba(0,0,0,0.5);
    color: #fff;
    pointer-events: auto;
    opacity: 1;
  }
}

/* About Section */
.about-content {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: center;
}
.about-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #fff;
}
.about-content p {
  font-size: 1.125rem;
  color: #ccc;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 700px;
}

/* Contact Section */
.contact {
  background: #111;
  padding: 40px 0;
}
.contact-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 50px;
  text-align: center;
}
.contact-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 20px;
}
form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}
input,
textarea {
  padding: 12px 16px;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  background: #000;
  color: #fff;
}
input::placeholder,
textarea::placeholder {
  color: #aaa;
}
button {
  padding: 14px;
  background: #fff;
  color: #000;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
}
button:hover {
  background: #ddd;
}

/* Footer */
footer {
  text-align: center;
  font-size: 0.9rem;
  color: #777;
  padding: 40px 0;
}

/* Video Modal */
.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(50, 50, 50, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 1rem;
}
.video-modal.visible {
  display: flex;
}
.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 1300px;
  margin: 0;
  background: #000;
  padding: 0;
  border: 16px solid #000;
  border-radius: 0;
  box-shadow: none;
}
.video-frame {
  position: relative;
  padding-top: 56.25%;
}
.video-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Clean Close Button */
.close-button {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  transition: background 0.3s ease;
}
.close-button span {
  display: block;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: background 0.3s ease;
}
.close-button span:first-child {
  transform: rotate(45deg);
  position: relative;
  top: 12px;
}
.close-button span:last-child {
  transform: rotate(-45deg);
  position: relative;
  bottom: 12px;
}
.close-button:hover {
  background: #000;
  border-radius: 4px;
}
.close-button:hover span {
  background: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .video-wrapper {
    max-width: calc(100vw - 40px);
    margin: 0 20px;
  }

  /* Make portfolio full width stacked on mobile */
  .portfolio,
  .portfolio-content,
  .portfolio-grid {
    max-width: 100vw !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
  }
  .portfolio-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .portfolio-item {
    width: 100vw !important;
    max-width: 100vw !important;
    aspect-ratio: 16 / 9;
  }
  .portfolio-item .overlay {
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    text-shadow: 0 0 5px rgba(0,0,0,0.7);
  }
}
