/* CSS Reset and Modern Variables */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gold-gradient: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  --bg-primary: #0a0a0f;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --text-primary: #ffffff;
  --text-secondary: #b8bcc8;
  --text-accent: #667eea;
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 20px 60px rgba(102, 126, 234, 0.15);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  transition: var(--transition);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: rgba(102, 126, 234, 0.1);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: var(--transition);
}

/* Full-screen sections */
.section-fullscreen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6rem 2rem 4rem;
  position: relative;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero__photo {
  width: 400px;
  height: 400px;
  border-radius: var(--border-radius); /* Using the standard border radius (16px) instead of 50% */
  object-fit: cover;
  margin: 0 auto 2rem;
  border: 4px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.hero__photo:hover {
  transform: scale(1.05);
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 20px 60px rgba(102, 126, 234, 0.2);
}

.hero__name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__title {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero__description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 3rem;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary-gradient);
  box-shadow: var(--shadow-soft);
}

.btn-secondary {
  background: transparent;
  border: 2px solid rgba(102, 126, 234, 0.5);
  color: var(--text-accent);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary:hover {
  box-shadow: var(--shadow-hover);
}

.btn-secondary:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: var(--text-accent);
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--text-accent);
  border-bottom: 2px solid var(--text-accent);
  transform: rotate(45deg);
  margin: 0.5rem auto;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0) rotate(45deg); }
  40% { transform: translateY(-10px) rotate(45deg); }
  60% { transform: translateY(-5px) rotate(45deg); }
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
  max-width: 600px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
}

/* Projects Section */
.projects {
  background: var(--bg-secondary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  width: 100%;
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  height: 400px; /* Fixed height for all cards */
  display: flex;
  flex-direction: column;
}

.project-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Remove the featured card special styling */
.project-card.featured {
  grid-row: span 1; /* Changed from span 2 */
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.project-image {
  position: relative;
  overflow: hidden;
  height: 100%; /* Take full height of the card */
  flex: 1; /* Fill available space */
}

/* Remove the special height for featured cards */
.project-card.featured .project-image {
  height: 100%; /* Same as regular cards */
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 2rem;
  opacity: 0;
  transition: var(--transition);
}

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

.project-info h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-info p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.project-tags span {
  background: rgba(102, 126, 234, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  border: 1px solid rgba(102, 126, 234, 0.3);
}

.project-link {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary-gradient);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-10px);
  transition: var(--transition);
}

.project-card:hover .project-link {
  opacity: 1;
  transform: translateY(0);
}

/* Expertise Section */
.expertise {
  background: var(--bg-primary);
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  width: 100%;
}

.expertise-category {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.expertise-category.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.expertise-category:hover {
  transform: translateY(-5px);
  border-color: rgba(102, 126, 234, 0.3);
}

.expertise-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.expertise-category h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-accent);
}

.expertise-category ul {
  list-style: none;
}

.expertise-category li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.expertise-category li:last-child {
  border-bottom: none;
}

/* Education Section */
.education {
  background: var(--bg-secondary);
}

.education-timeline {
  max-width: 800px;
  width: 100%;
  position: relative;
}

.education-timeline::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary-gradient);
}

.timeline-item {
  position: relative;
  padding-left: 80px;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateX(-30px);
  transition: var(--transition);
}

.timeline-item.animate-in {
  opacity: 1;
  transform: translateX(0);
}

.timeline-marker {
  position: absolute;
  left: 20px;
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--primary-gradient);
  border-radius: 50%;
  border: 3px solid var(--bg-secondary);
}

.timeline-content {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline-content h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-accent);
  margin-bottom: 0.5rem;
}

.timeline-content h4 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.timeline-period {
  color: var(--text-accent);
  font-weight: 500;
  margin-bottom: 1rem;
}

/* About Section */
.about {
  background: var(--bg-primary);
}

.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  max-width: 1200px;
  width: 100%;
  align-items: center;
}

.about-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.contact-info {
  margin-top: 3rem;
}

.contact-info h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-accent);
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.contact-link:hover {
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateX(5px);
}

.contact-icon {
  font-size: 1.5rem;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.stat {
  text-align: center;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: scale(0.9);
  transition: var(--transition);
}

.stat.animate-in {
  opacity: 1;
  transform: scale(1);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

/* Media Carousel for Project Pages */
.media-carousel {
  position: relative;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto 2rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 500px; /* Increased height for better presentation */
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}

.carousel-item {
  min-width: 100%;
  height: 100%;
  position: relative;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center; /* Ensure images are centered */
  display: block;
}

.carousel-item .video-container {
  position: relative;
  width: 100%;
  height: 100%;
  padding-top: 0; /* Override the default padding */
}

.carousel-item .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Carousel Navigation */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  font-size: 1.5rem;
  padding: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-nav:hover {
  background: rgba(102, 126, 234, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
  left: 1rem;
}

.carousel-nav.next {
  right: 1rem;
}

/* Carousel Indicators */
.carousel-indicators {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.carousel-indicator.active {
  background: white;
}

.carousel-indicator:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Hide navigation on single item */
.media-carousel[data-items="1"] .carousel-nav,
.media-carousel[data-items="1"] .carousel-indicators {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .media-carousel {
    margin: 0 auto 1.5rem;
  }

  .carousel-container {
    height: 350px; /* Adjusted to match the updated mobile styles */
  }
  
  .carousel-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    padding: 0.5rem;
  }
  
  .carousel-nav.prev {
    left: 0.5rem;
  }
  
  .carousel-nav.next {
    right: 0.5rem;
  }

  .carousel-indicators {
    bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .carousel-container {
    height: 250px; /* Consistent with the mobile adjustments above */
  }

  .carousel-nav {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .carousel-indicators {
    bottom: 0.5rem;
  }

  .carousel-indicator {
    width: 8px;
    height: 8px;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background: var(--bg-secondary);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: var(--shadow-soft);
    padding: 2rem 0;
  }

  .nav-menu.active {
    left: 0;
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  .section-fullscreen {
    padding: 4rem 1rem 2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card.featured {
    grid-row: span 1;
  }

  .expertise-grid {
    grid-template-columns: 1fr;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

  .timeline-item {
    padding-left: 60px;
  }

  /* Responsive hero photo sizing */
  .hero__photo {
    width: 300px;
    height: 300px;
  }

  /* Improve hero section tablet spacing */
  .hero {
    padding: 4rem 1rem 2rem;
  }

  /* Improve carousel mobile spacing */
  .project-hero {
    padding: 6rem 1rem 3rem;
  }

  .carousel-container {
    height: 350px; /* Smaller on tablets */
  }
}

@media (max-width: 480px) {
  .hero__photo {
    width: 250px;
    height: 250px;
  }

  /* Mobile carousel adjustments */
  .project-hero {
    padding: 5rem 1rem 2rem;
  }

  .carousel-container {
    height: 250px; /* More compact on mobile */
  }

  /* Improve hero section mobile spacing */
  .hero {
    padding: 5rem 1rem 2rem; /* Increased top padding to prevent navbar overlap */
  }

  .hero-content {
    padding: 3rem 0; /* Increased top padding for better spacing */
  }

  /* Better mobile navigation */
  .navbar {
    padding: 0.5rem 1rem;
  }
}

/* Legacy styles for project pages */
nav {
  padding: 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

nav a {
  color: var(--text-accent);
  font-weight: 500;
  transition: var(--transition);
}

nav a:hover {
  color: var(--text-primary);
}

.project-hero {
  text-align: center;
  padding: 8rem 2rem 4rem; /* Increased top padding for navbar separation */
  background: var(--bg-secondary);
}

.project-hero img {
  max-width: 900px;
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  margin-bottom: 2rem;
}

.project-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.project-meta {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.project-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.project-body h2 {
  font-size: 1.8rem;
  margin: 3rem 0 1rem;
  color: var(--text-accent);
}

.project-body p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.project-body ul {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.project-body li {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.video-container {
  position: relative;
  padding-top: 56.25%;
  margin: 3rem 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Project hero video container - optimized size with 16:9 aspect ratio */
.project-hero .video-container {
  position: relative;
  max-width: 1080px;
  max-height: 720px;
  width: 100%;
  margin: 0 auto 2rem;
  padding-top: 56.25%; /* 16:9 aspect ratio (720/1080 * 100 = 66.67%, but 56.25% is standard 16:9) */
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.project-hero .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Responsive scaling for smaller screens */
@media (max-width: 1200px) {
  .project-hero .video-container {
    max-width: 90%;
  }
}

@media (max-width: 768px) {
  .project-hero .video-container {
    max-width: 100%;
    padding-top: 56.25%; /* Maintain 16:9 on mobile */
  }
}

/* Keep the original larger size for videos in the project body */
