/* Base styles */
body {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  background: #000; /* black background */
  color: white;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  padding: 20px 5%;
  background: #000;
}

.navbar a {
  color: white;
  text-decoration: none;
  font-family: 'Rio Sans', sans-serif;
  font-weight: 600;
}

@font-face {
  font-family: 'Kelsi';
  src: url('fonts/Kelsi-fill.otf') format('opentype'),
       url('fonts/Kelsi-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

.nav-left {
  font-family: 'Kelsi', sans-serif;
}

.navbar a:hover {
  color: #ff3b3b;
}

/* Portfolio section */
.portfolio-section {
  padding: 10vh 5%;
  text-align: center;
}

.portfolio-section h1 a {
  text-decoration: none;
  color: white;
  font-family: 'Kelsi', sans-serif;
  font-size: clamp(2.5rem, 5vw, 3rem);
  margin-bottom: 50px;
  display: inline-block;
}

/* Grid container */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* flexible grid */
  gap: 10vh;
  padding: 30px 5%;
  background: black;
  justify-items: center;
}

/* Each grid item */
.grid-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  width: 100%;
  max-width: 450vh; /* keeps consistent sizing */
  aspect-ratio: 1 / 1; /* ensures perfect square */
}

.grid-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: opacity 0.5s ease, transform 0.3s ease;
  border-radius: 2vh;
}

/* Overlay text (centered on photo) */
.grid-item .overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: clamp(1rem, 2vw, 1.5rem); /* scales with screen */
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

/* Hover effects */
.grid-item:hover img {
  opacity: 0.3;
  transform: scale(1.02);
}

.grid-item:hover .overlay {
  opacity: 1;
}

/* Footer */
footer {
  text-align: center;
  padding: 2vh;
  background: #111;
  color: white;
  font-size: 2vh;
}

/* =======================
   Large Screen Adjustments (e.g. 32" monitor)
======================= */
@media (min-width: 1600px) {
  .grid-container {
    max-width: 1400px;
    margin: 0 auto;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }

  .overlay {
    font-size: 1.5rem;
    letter-spacing: 2px;
  }

  .navbar {
    padding: 2rem 8%;
  }

  .navbar a {
    font-size: 1.3rem;
  }

  .grid-container img {
    border-radius: 12px;
  }

  .grid-container img:hover {
    transform: scale(1.05);
  }
}

/* =======================
   Tablet and Mobile Adjustments
======================= */
@media (max-width: 1024px) {
  .navbar {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .portfolio-section {
    padding: 40px 5%;
  }

  .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid-container {
    grid-template-columns: 1fr;
  }

  .portfolio-section h1 a {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
  }

  .overlay {
    font-size: clamp(1rem, 4vw, 1.2rem);
  }
}
