:root {
  --primary: #3b82f6;
  --primary-light: #eff6ff;
  --secondary: #e5e7eb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border: #d1d5db;
  --background: #ffffff;
  --background-alt: #f9fafb;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--background);
  line-height: 1.6;
}

.container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(to bottom, rgba(59, 130, 246, 0.1), transparent);
  position: relative;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.profile-image-wrapper {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(59, 130, 246, 0.2);
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 3.5rem;
  }
}

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

@media (min-width: 768px) {
  .hero .subtitle {
    font-size: 1.5rem;
  }
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text-primary);
  transition: all 0.3s ease;
  background-color: var(--background);
}

.social-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.social-btn svg {
  width: 20px;
  height: 20px;
}

.chevron-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  color: var(--text-secondary);
}

.chevron-down svg {
  width: 32px;
  height: 32px;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

/* About Section */
.about {
  padding: 5rem 0;
  background-color: var(--background-alt);
}

.about h2,
.skills h2,
.projects h2,
.certifications h2,
.contact h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.about-content p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* Skills Section */
.skills {
  padding: 5rem 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.skill-tag {
  padding: 0.75rem 1.25rem;
  background-color: var(--background-alt);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  text-align: center;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: default;
}

.skill-tag:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Projects Section */
.projects {
  padding: 5rem 0;
  background-color: var(--background-alt);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  padding: 1.5rem;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
  border-color: var(--primary);
}

.project-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.project-logo {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 0.6rem;
  overflow: hidden;
  background-color: var(--primary-light);
  border: 1px solid var(--border);
}

.project-logo::before {
  content: attr(data-initial);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
}

.project-logo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: var(--background);
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.project-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex-grow: 1;
  font-size: 0.9rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background-color: var(--secondary);
  border-radius: 0.25rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.github-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.github-link:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Certifications Section */
.certifications {
  padding: 5rem 0;
}

.certification-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.certification-container {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.5rem 0 1.5rem;
  /* Hide scrollbar across browsers */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.certification-container::-webkit-scrollbar {
  display: none;
}

.certification-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: min(85vw, 640px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background-color: var(--background-alt);
}

.carousel-arrow {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
}

.carousel-arrow svg {
  width: 20px;
  height: 20px;
}

.carousel-arrow:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.carousel-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background-color: var(--secondary);
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background-color: var(--primary);
  width: 20px;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .certification-card {
    grid-template-columns: 1fr;
    width: 90vw;
  }

  .carousel-arrow {
    width: 36px;
    height: 36px;
  }
}

.cert-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.cert-issuer {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.cert-date {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

.cert-image {
  overflow: hidden;
  border-radius: 0.5rem;
  max-height: 400px;
  cursor: zoom-in;
}

.cert-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.cert-image:hover img {
  transform: scale(1.03);
}

/* Certificate Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-inner {
  max-width: min(90vw, 900px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-inner {
  transform: scale(1);
}

.lightbox-inner img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.lightbox-caption {
  color: #f9fafb;
  font-size: 0.95rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.1);
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox-close svg {
  width: 20px;
  height: 20px;
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 640px) {
  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
  }
}

/* Contact Section */
.contact {
  padding: 5rem 0;
  background-color: var(--background-alt);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background-color: var(--background);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.contact-card:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

.contact-card svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

.contact-card span {
  font-size: 0.875rem;
  word-break: break-all;
}

/* Footer */
.footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.875rem;
  }

  .hero .subtitle {
    font-size: 1rem;
  }

  .about h2,
  .skills h2,
  .projects h2,
  .certifications h2,
  .contact h2 {
    font-size: 1.5rem;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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