/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  scroll-behavior: smooth;
  background-color: transparent;
}

:root {
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-accent: #252525;
  --text-primary: #f5f5f5;
  --text-secondary: #D9D9D9;
  --accent-color: #3291ff;
  --accent-hover: #7e9fc4;
  --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  --header-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

body {
  background-color: transparent;
  color: var(--text-primary);
  line-height: 1.6;
  width: 100%;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* --- NEW: Background Glow for Glass Effect --- */
.background-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(50, 145, 255, 0.15) 0%, rgba(50, 145, 255, 0) 60%);
  transform: translate(-50%, -50%);
  z-index: -1; /* Place it behind all content */
  animation: gentle-spin 20s linear infinite;
}

@keyframes gentle-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  /* background-color is now on .navbar */
  box-shadow: var(--header-shadow);
}

/* --- UPDATED: Navbar with Glass Effect --- */
.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
  
  /* UPDATED STYLES */
  background-color: transparent; /* Makes the navbar see-through */
  backdrop-filter: none; /* Removes the blur effect */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Keeps a faint line for separation */
}

.nav-links {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: white;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent-color);
}

.menu-toggle {
  display: none;
  cursor: pointer;
  color: white;
}

/* Hero section */
.hero {
  background-color: transparent;
  padding-top: 6rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  flex-wrap: nowrap;
  overflow-x: hidden;
}

.hero-text {
  flex: 1 1 50%;
}

.hero-text h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow-wrap: normal;
}

/* ... other hero styles ... */

#typewriter-name {
  display: inline-block;
  min-width: 15ch; /* Reserve space to avoid layout shift */
  border-right: 2px solid var(--accent-color);
  white-space: nowrap;
  overflow: hidden;
  animation: blink 0.75s step-end infinite;
  color: var(--accent-color);
  vertical-align: bottom; /* ADD THIS LINE */
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

/* ... more existing styles ... */
.hero-text h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--accent-color);
}

.hero-text p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  min-height: 2rem;
}

/* Main Content Wrapper */
.main-content {
    position: relative;
    z-index: 2;
    background-color: transparent;
}

/* Section Titles */
.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

/* --- NEW: Glassmorphism Card Base Styles --- */
/* This rule applies the glass effect to all card types */
.project-card,
.snapshot-card,
.coursework-card {
  border-radius: 10px;
  overflow: hidden;
  /* Glass Effect */
  background-color: rgba(37, 37, 37, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  /* Shiny Mouse-Follow Effect */
  background-image: radial-gradient(
    circle at var(--mouse-x) var(--mouse-y),
    rgba(255, 255, 255, 0.08),
    transparent 250px
  );
  /* Smooth Transitions */
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- NEW: Card Hover Glow Effect --- */
.project-card:hover,
.snapshot-card:hover,
.coursework-card:hover {
  transform: translateY(-10px);
  border-color: rgba(50, 145, 255, 0.5); /* Use border-color for transition */
  box-shadow: 0 0 20px rgba(50, 145, 255, 0.2);
}


/* Skills Section */
.skills-section {
  padding: 5rem 5rem;
  background-color: transparent;
  text-align: center;
}

.skills-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

/* --- UPDATED: Skill Tags with Shiny Effect --- */
.skill {
  background-color: var(--bg-accent);
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  font-size: 1rem;
  color: var(--accent-color);
  font-weight: 500;
  border: 1px solid rgba(50, 145, 255, 0.3);
  transition: box-shadow 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.skill:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(50, 145, 255, 0.5); /* Add a glow on hover */
}


/* Projects */
.projects {
  padding: 5rem 5rem;
  /* background-color is now handled by .main-content */
}

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

.project-card {
  width: 100%;
  /* Base styles moved to the combined rule */
}

/* All other existing styles from your file continue below... */
/* For example: */
.project-image {
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-info {
  padding: 1.5rem;
}

/* ... and so on, keeping the rest of your file as it was. The code below is the rest of your original file */
.project-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

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

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

.project-tag {
  background-color: var(--bg-accent);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--accent-color);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.project-links a {
  flex: 1 1 120px;
  max-width: 48%;
  text-align: center;
}

.btn {
  padding: 0.8rem 2rem;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
  border: none;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
}

.btn-outline:hover {
  background-color: var(--accent-color);
  color: white;
}

/* Footer */
footer {
  background-color: transparent;
  padding: 2rem 2rem;
  text-align: center;
  position: relative; /* Needed for z-index */
  z-index: 5; /* Ensure footer is above the background glow */
}

/* Profile Snapshot Section */
.profile-snapshot {
  padding: 5rem 5rem;
}

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

.snapshot-card {
  padding: 2rem;
  text-align: center;
}

.snapshot-icon {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

/* Experience Section */
.experience-section {
  padding: 5rem 5rem;
  text-align: center;
}

/* Coursework Section */
.coursework-section {
  padding: 5rem 2rem;
}

.coursework-card {
  max-width: 1000px;
  margin: 2rem auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
}


/* All other specific and responsive styles remain below... */
/* ... a large portion of your original CSS file is unchanged ... */
.experience-section .projects-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.experience-list {
  list-style-type: disc;
  padding-left: 1.5rem;
  text-align: left;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  width: 100%;
}

.experience-list li {
  margin-bottom: 0.75rem;
}
.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
}

.company-logo {
  width: 125px;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.project-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5em;
  max-height: 4.5em; /* 3 lines × 1.5em */
  -webkit-line-clamp: 3;
  line-clamp: 3;
  transition: max-height 0.3s ease;
}

.project-description.expanded {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  -webkit-box-orient: unset;
  max-height: none;
  overflow: visible;
}

.read-more-btn {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  margin-top: 5px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.social-link {
  background-color: var(--bg-accent);
  color: var(--accent-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.social-link:hover {
  background-color: var(--accent-color);
  color: white;
}
.hero-buttons.social-links .social-link {
  width: 60px;
  height: 60px;
  font-size: 1.4rem;
}
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  transform: scale(0.95);
  will-change: transform, opacity;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: scale(1);
}
.nav-links a.active {
  color: var(--accent-color);
  font-weight: bold;
}
.back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: var(--accent-color);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  z-index: 1000;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background-color: var(--accent-hover);
}
.coursework-column-group:first-child {
  border-right: 1px solid var(--bg-accent);
}
.coursework-title {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid var(--bg-accent);
}
.coursework-title h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-primary);
}
.coursework-title p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.coursework-body-content {
  padding: 1.5rem;
}
.semester-title {
  background-color: var(--bg-accent);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  text-align: center;
  margin-bottom: 1rem;
}
.coursework-card ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}
.semester-block:not(:last-child) {
    margin-bottom: 1.5rem;
}
.coursework-card li {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  padding-left: 1.2rem;
  position: relative;
}
.coursework-card li::before {
  content: '▶';
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--accent-color);
  font-size: 0.7rem;
}
.photographs-section {
  padding: 5rem 2rem;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 2rem auto 0;
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.photo-item img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}
.lightbox.active {
  display: flex;
}
.lightbox-content {
  margin: auto;
  display: block;
  max-width: 85%;
  max-height: 85%;
  border-radius: 5px;
  animation: zoom-in 0.25s ease-out;
  animation-fill-mode: forwards;
}
@keyframes zoom-in {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}
.lightbox-close:hover,
.lightbox-close:focus {
  color: #bbb;
  text-decoration: none;
}
.lightbox-prev,
.lightbox-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  -webkit-user-select: none;
}
.lightbox-next {
  right: 0;
  border-radius: 3px 0 0 3px;
}
.lightbox-prev {
  left: 0;
}
.lightbox-prev:hover,
.lightbox-next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .coursework-card {
    grid-template-columns: 1fr;
  }
  .coursework-column-group:first-child {
    border-right: none;
    border-bottom: 1px solid var(--bg-accent);
  }
  .photo-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .photographs-section {
    padding: 5rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 8rem;
    text-align: center;
  }
  .hero-content {
    flex-direction: column;
    align-items: center;
  }
  .hero-text, .hero-image {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .hero-text h1 {
    font-size: 2.2rem;
    white-space: normal;
  }
  .hero-text h2 {
    font-size: 1.5rem;
  }
  .section-title {
    font-size: 1.8rem;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    flex-direction: column;
    background-color: rgba(30, 30, 30, 0.8); /* Darker glass for mobile menu */
    backdrop-filter: blur(10px);
    width: 100%;
    position: absolute;
    top: 60px;
    left: 0;
    display: none;
    padding: 1rem 0;
    align-items: center;
  }
  .nav-links.active {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
  #typewriter-name {
    white-space: normal;
    overflow: visible;
    width: auto;
    min-width: 0;
    display: inline;
    animation: blink 0.75s step-end infinite;
  }
}

#tsparticles {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -2; /* Places it behind all content and the glow effect */
}

/* --- NEW: Universal Project Detail Page Styles --- */

/* Main glass container for the entire page content */
.project-detail {
  max-width: 900px;
  margin: 8rem auto 5rem; /* Centers the card and adds space from header/footer */
  padding: 2.5rem 3.5rem; /* Internal spacing for content */

  /* Glassmorphism Effect */
  background-color: rgba(30, 30, 30, 0.45);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* General styling for sections within the project detail card */
.project-detail section {
  max-width: 800px;
  margin: 2.5rem auto; /* Consistent spacing between sections */
}

/* Styling for headings and lists inside the card */
.project-detail h2 {
  color: var(--accent-color);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-detail ul {
  list-style-position: inside;
  padding-left: 0;
}

/* Styles for the video demonstration section */
.video-grid-section {
  text-align: center; /* Center the 'Video Demonstrations' title */
}

/* Creates a responsive grid for the videos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Style for the video element itself */
.project-detail-video {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Style for the video captions */
.video-caption {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.25rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* --- NEW: Hover effect for project detail card --- */
.project-detail:hover {
  transform: translateY(-5px); /* Optional: lifts the card slightly */
  border-color: rgba(50, 145, 255, 0.5);
  box-shadow: 0 0 25px rgba(50, 145, 255, 0.2);
}

/* 1. Restore the dark background color to the body */
body {
    background-color: #121212 !important; /* Sets the base color */
}

/* 2. Layer the particle canvas on top of the body, but behind the content */
#tsparticles {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0; /* Changed from -2 to 0 */
}