* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-color: #2d3436;
  --accent-color: #0984e3;
  --text-color: #2d3436;
  --background-color: #f5f6fa;
  --card-background: #ffffff;
  --transition-speed: 0.3s;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.6;
}

nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 2rem;
  background-color: transparent;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all var(--transition-speed) ease;
}

nav.scrolled {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Default nav links for home page with hero background */
.hero ~ nav a {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Nav links for pages without hero (about, contact) */
nav a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

nav.scrolled a {
  color: var(--text-color);
  text-shadow: none;
}

nav a[aria-current='page'] {
  background-color: var(--accent-color);
  color: white;
}

/* Hover states for home page with hero */
.hero ~ nav a:not([aria-current='page']):hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Hover states for pages without hero */
nav a:not([aria-current='page']):hover {
  background-color: rgba(9, 132, 227, 0.1);
  color: var(--accent-color);
}

nav.scrolled a:not([aria-current='page']):hover {
  background-color: rgba(9, 132, 227, 0.1);
  color: var(--accent-color);
}

.hero {
  position: relative;
  height: 40vh;
  min-height: 300px;
  background: linear-gradient(135deg, #000428, #004e92);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  padding: 0 2rem;
}

.profile-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

.profile-image-container {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border: 4px solid rgba(255, 255, 255, 0.2);
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-text {
  color: white;
  text-align: left;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  background: linear-gradient(120deg, #ffffff, #88c8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
  max-width: 500px;
}

main {
  position: relative;
  background: var(--background-color);
  padding: 2rem;
  z-index: 1;
}

.portfolio-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  padding: 1rem;
}

.portfolio-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  background: var(--card-background);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  aspect-ratio: 4/3;
}

.portfolio-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 70%,
    rgba(0, 0, 0, 0.7) 100%
  );
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
  z-index: 1;
}

.portfolio-item:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.portfolio-item:hover::before {
  opacity: 1;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed) ease;
}

.portfolio-item:hover img {
  transform: scale(1.05);
}

.project-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  color: white;
  z-index: 2;
  transform: translateY(100%);
  transition: transform var(--transition-speed) ease;
}

.portfolio-item:hover .project-title {
  transform: translateY(0);
}

.project-title h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.project-title p {
  font-size: 1rem;
  opacity: 0.9;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-speed) ease;
}

.modal.active {
  background-color: rgba(0, 0, 0, 0.95);
}

.modal-content {
  position: relative;
  max-width: min(1200px, 90%);
  max-height: 90vh;
  margin: auto;
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--transition-speed) ease;
}

.modal.active .modal-content {
  opacity: 1;
  transform: scale(1);
}

.modal-content img {
  width: auto;
  height: auto;
  max-width: min(1200px, 90vw);
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  transition: opacity var(--transition-speed) ease;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10000;
  width: 50px;
  height: 50px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: blue;
  width: 60px;
  height: 60px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
  z-index: 10000;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.prev {
  left: 20px;
}

.next {
  right: 20px;
}

/* About page styles */
.about-container {
  max-width: 1000px;
  margin: 7rem auto 2rem;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  background: var(--card-background);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  padding: 0;
}

.about-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.5s ease;
}

.about-image:hover {
  transform: scale(1.03);
}

.about-content {
  padding: 3rem;
}

.about-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 0.5rem;
}

.about-content h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 2px;
}

.about-content p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: #555;
  line-height: 1.7;
}

.about-content h2 {
  font-size: 1.8rem;
  margin: 2rem 0 1rem;
  color: var(--primary-color);
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  list-style: none;
  margin-top: 1rem;
}

.skills-list li {
  background: rgba(9, 132, 227, 0.1);
  color: var(--accent-color);
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.skills-list li:hover {
  background: var(--accent-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(9, 132, 227, 0.3);
}

/* Contact page styles */
.contact-container {
  max-width: 800px;
  margin: 7rem auto 2rem;
  background: var(--card-background);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  padding: 3rem;
  position: relative;
}

.contact-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--accent-color), #74b9ff);
}

.contact-container h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.contact-container p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 2rem;
}

.contact-form {
  display: grid;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--primary-color);
}

.form-group input,
.form-group textarea {
  padding: 0.8rem 1rem;
  border: 2px solid #e1e5eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.2);
  outline: none;
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form button {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  justify-self: start;
}

.contact-form button:hover {
  background: #0876c6;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(9, 132, 227, 0.3);
}

.contact-form button:active {
  transform: translateY(-1px);
}

.contact-info {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.contact-info-item {
  text-align: center;
  padding: 1.5rem;
  background: rgba(9, 132, 227, 0.05);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.contact-info-item:hover {
  background: rgba(9, 132, 227, 0.1);
  transform: translateY(-5px);
}

.contact-info-item i {
  font-size: 1.8rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.contact-info-item h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.contact-info-item p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  nav {
    padding: 1rem;
    gap: 1rem;
  }

  nav a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .hero {
    height: auto;
    min-height: 300px;
    padding: 6rem 0 3rem;
  }

  .profile-container {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .profile-text {
    text-align: center;
  }

  .profile-image-container {
    width: 150px;
    height: 150px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }
  
  .hero p {
    font-size: 1rem;
    margin: 0 auto;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .portfolio-item {
    margin: 0 auto;
    max-width: 100%;
  }
  
  .nav-button {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .modal-close {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .modal-content img {
    max-width: 95vw;
    max-height: 80vh;
  }
  
  .about-container {
    grid-template-columns: 1fr;
    margin: 5rem 1rem 2rem;
    width: calc(100% - 2rem);
  }
  
  .about-content {
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .about-content h1 {
    font-size: 2rem;
  }
  
  .contact-container {
    padding: 2rem;
    margin: 5rem 1rem 2rem;
    width: calc(100% - 2rem);
  }
  
  .contact-info {
    grid-template-columns: 1fr;
  }
}