/* --- Global Styles --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  background: #fdfdfd;
  color: #333;
}
a { color: inherit; text-decoration: none; cursor: pointer; }

/* --- Header --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 { font-size: 1.5rem; font-weight: 600; }
nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}
nav ul li a {
  font-weight: 500;
  transition: color 0.3s;
  padding-bottom: 0.25rem;
}
nav ul li a:hover { color: #0077cc; }
nav ul li a.active {
  color: #4cd6dd;
  border-bottom: 1px solid #0077cc;
}

/* --- Hero Section --- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80vh;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(to bottom right, #e0f7fa, #fff);
}
.hero h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; margin-bottom: 2rem; }
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  border: none;
  background: purple;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}
.btn:hover { background: #005fa3; }

/* --- Portfolio Grid --- */
/* --- Mosaic Portfolio --- */
.portfolio {
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: 200px;
  gap: 1rem;
}

.portfolio-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-item h3 {
  padding: 0.5rem;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.8);
}

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

/* --- Watermark Overlay --- */
.portfolio-item {
  position: relative;
  overflow: hidden;
}

.portfolio-item::after {
  content: "© Alex Mogtaderi";
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.portfolio-item:hover::after {
  opacity: 1;
}

/* Greyscale other items on hover 
.portfolio:hover .portfolio-item {
  filter: grayscale(100%) brightness(0.7);
  transition: filter 0.3s ease;
}*/

.portfolio:hover .portfolio-item:hover {
  filter: none;
  transform: scale(1.05);
  z-index: 2;
}

/* Varying sizes */
.portfolio-item.wide {
  grid-column: span 2;
}
.portfolio-item.tall {
  grid-row: span 2;
}

/* --- Lightbox --- */
.lightbox {
  display: none; /* hidden until opened */
  justify-content: center;
  align-items: center;
  position: fixed;
  z-index: 3000;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lightbox.show {
  display: flex;
  opacity: 1;
}

.lightbox img {
  max-width: 80%;
  max-height: 80%;
  border-radius: 10px;
  transform: scale(0.95);
  transition: transform 0.4s ease;
}

.lightbox.show img {
  transform: scale(1);
}

.lightbox .close {
  position: absolute;
  top: 20px; right: 30px;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
}

.lightbox #lightbox-title {
  position: absolute;
  bottom: 40px;
  color: #fff;
  font-size: 1.2rem;
  text-align: center;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 30px;
  box-sizing: border-box;
}

.lightbox-nav span {
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s;
}

.lightbox-nav span:hover {
  color: #aaa;
}
/* --- Contact Form Overlay with Fade --- */
.contact-overlay {
  display: flex; /* use flex, hide via opacity instead */
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.contact-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.contact-content {
  background: #fff;
  color: #333;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.4s ease;
}

.contact-overlay.show .contact-content {
  transform: scale(1);
}

.contact-content h2 {
  margin-bottom: 1rem;
}

.contact-content label {
  display: block;
  margin-top: 1rem;
  font-weight: 500;
}

.contact-content input,
.contact-content textarea {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.contact-content .btn {
  margin-top: 1.5rem;
  width: 100%;
}

.contact-content .close {
  position: absolute;
  top: 15px; right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}
.contact-content .close:hover {
  color: #000;
}

#contact {
  padding: 0 2em 1em 2em;
}