:root {
  --primary: #2c3e50;
  --accent: #3498db;
  --bg: #f4f4f4;
  --card-bg: #fff;
  --text: #333;
}

/* Offset sections so header doesn't cover content */
[id] {
  scroll-margin-top: 80px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Helvetica Neue', sans-serif;
  background-color: var(--bg);
  color: var(--text);
}

header {
  background-color: var(--primary);
  color: white;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  color: white;
  margin-left: 1rem;
  text-decoration: none;
  font-weight: 500;
}

nav a:hover {
  text-decoration: underline;
}

.container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.card {
  background-color: var(--card-bg);
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card h2 {
  margin-top: 0;
  color: var(--primary);
}

.card h3 {
  margin-top: 1.4rem;
  margin-bottom: -0.7rem;
  color: var(--accent);
}

#profile-pic {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background-color: #ccc;
  margin-bottom: 1rem;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  color: #666;
}

.links a {
  margin: 0 0.5rem;
  color: var(--accent);
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.project-item {
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.project-text h3 {
  margin-top: 0;
  color: var(--accent);
}

.project-text p {
  margin-bottom: 1rem;
}

/* Images inside projects */
.project-image {
  margin-bottom: 1rem;
}

.project-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Optional: place image to right on larger screens */
@media (min-width: 900px) {
  .project-item {
    flex-direction: row;
    align-items: flex-start;
  }

  .project-text {
    flex: 1 1 60%;
  }

  .project-image {
    flex: 0 0 35%;
    margin-left: 1.5rem;
    margin-bottom: 0;
  }
}

/* ─── Carousel ─────────────────────────────────────────────── */

.carousel {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 2rem auto;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  perspective: 1000px;   /* enables 3D depth for tilt effect */
  overflow: visible;     /* lets the image pop out on hover */
}

.carousel-images {
  position: relative;
  width: 100%;
}

.carousel-images img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.15s ease, opacity 0.3s ease;

  /* Stack all images on top of each other */
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

.carousel-images img.active {
  position: relative;   /* active image holds the container height */
  opacity: 1;
  pointer-events: auto;
}

.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0,0,0,0.5);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
}

.prev { left: 10px; }
.next { right: 10px; }

.prev:hover, .next:hover {
  background-color: rgba(0,0,0,0.8);
}

.carousel-dots {
  position: absolute;
  bottom: 10px;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 10;
}

.carousel-dots span {
  width: 12px;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  display: inline-block;
  transition: all 0.3s ease;
  cursor: pointer;
}

.carousel-dots span.active {
  width: 20px;
  background-color: var(--accent);
  border-radius: 6px;
}

/* ─── Responsive ────────────────────────────────────────────── */

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    margin-top: 0.5rem;
  }

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

  .project-item {
    flex-direction: column;
  }

  .project-image {
    margin-left: 0;
    margin-bottom: 1rem;
  }
}
