:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --light-color: #f8f9fa;
  --dark-color: #2c3e50;
  --text-color: #333;
  --text-light: #6c757d;
  --border-color: #dee2e6;
  --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--light-color);
  color: var(--text-color);
  line-height: 1.7;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
  width: 100%;
}

/* Header Styles */
header {
  background: var(--primary-color);
  color: white;
  padding: 15px 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-speed) ease;
}

header.scrolled {
  padding: 10px 0;
  background: rgba(44, 62, 80, 0.95);
  backdrop-filter: blur(10px);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  position: relative;
  transition: all var(--transition-speed) ease;
}

.logo span {
  color: var(--secondary-color);
  position: relative;
}

.logo span::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.logo:hover span::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 40px;
  position: relative;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  transition: all var(--transition-speed) ease;
  position: relative;
  padding: 5px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

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

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu-toggle {
  display: none;
  cursor: pointer;
  font-size: 24px;
  transition: all var(--transition-speed) ease;
}

.sponsor-frame {
  height: 32px;
  width: 114px;
  border: 0;
  border-radius: 8px;
  margin-left: 18px;
  vertical-align: middle;
  border: 0.4px solid rgb(121, 121, 121);
}


@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--primary-color);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 50px;
    transition: all 0.4s ease;
    z-index: 999;
  }

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

  .nav-links li {
    margin: 20px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .nav-links a {
    font-size: 18px;
  }

  /* Hide navbar iframe on mobile, show in drawer */
  .sponsor-iframe.navbar {
    display: none !important;
  }
  .nav-links .sponsor-iframe.drawer {
    display: block !important;
    margin: 0 auto !important;
    width: 114px !important;
    min-width: 114px !important;
    max-width: 90vw;
    height: 32px !important;
    min-height: 32px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    background: transparent !important;
  }
}

/* By default, drawer iframe is hidden on desktop */
.sponsor-iframe.drawer {
  display: none;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, #1a2a3a 100%);
  color: white;
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><polygon fill="rgba(255,255,255,0.05)" points="0,100 100,0 100,100"/></svg>');
  background-size: cover;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-text {
  flex: 1;
  min-width: 300px;
  padding-right: 40px;
  animation: fadeInLeft 1s ease-out;
}

.hero-text h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.hero-text h1 span {
  color: var(--secondary-color);
  position: relative;
  display: inline-block;
}

.hero-text h1 span::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--secondary-color);
  opacity: 0.5;
}

.hero-text p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
  line-height: 1.6;
}

.hero-image {
  flex: 1;
  min-width: 300px;
  text-align: center;
  animation: fadeInRight 1s ease-out;
}

.hero-image img {
  max-width: 350px;
  border-radius: 50%;
  border: 5px solid var(--secondary-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: all 0.5s ease;
}

.hero-image img:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Button Styles */
.hero-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  background-color: var(--secondary-color);
  color: white;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid var(--secondary-color);
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  z-index: -1;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

.btn:hover::before {
  width: 100%;
}

.btn-outline {
  background-color: transparent;
  color: var(--secondary-color);
}

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

/* Sponsor Button */
.btn-sponsor {
  background: #272c35;
  color: #fff;
  border: none;
  border-radius: 30px; /* match .btn and .btn-outline */
  padding: 12px 28px;  /* match .btn and .btn-outline */
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  box-shadow: 0 4px 15px rgba(234, 74, 170, 0.15);
  transition: background 0.3s, box-shadow 0.2s, transform 0.1s;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-sponsor::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
  z-index: -1;
}

.btn-sponsor:hover,
.btn-sponsor:focus {
  background: linear-gradient(90deg, #ff7b72 0%, #ea4aaa 100%);
  box-shadow: 0 8px 20px rgba(234, 74, 170, 0.22);
  transform: translateY(-3px);
  color: #fff;
}

.btn-sponsor:hover::before {
  width: 100%;
}

.btn-sponsor i {
  font-size: 1.1em;
  margin-right: 8px;
}

/* Heart Icon */
#heart {
  color: #cc689f;
  transition: color 0.3s ease;
}

/* Change heart color on hover of either the heart or the whole button */
#heart:hover,
#heart:focus,
.btn-sponsor:hover #heart,
.btn-sponsor:focus #heart {
  color: white !important;
}

/* Section Styles */
.section {
  padding: 100px 0;
  position: relative;
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
}

.section-title h2 {
  font-size: 2.5rem;
  color: var(--primary-color);
  display: inline-block;
  position: relative;
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--secondary-color);
}

/* Experience Section */
.experience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.experience-card {
  background-color: white;
  border-radius: 10px;
  padding: 30px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  border-top: 4px solid var(--secondary-color);
}

.experience-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.experience-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.experience-header img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-right: 15px;
  border-radius: 8px;
}

.experience-header h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.experience-header p {
  color: var(--text-light);
  font-size: 0.9rem;
}

.experience-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.experience-tech span {
  background-color: rgba(52, 152, 219, 0.1);
  color: var(--secondary-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* About Section */
.about-content {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.about-text {
  flex: 2;
  min-width: 300px;
}

/* Make inline projects under about use the remaining width */
.about-projects {
  display: grid;
  grid-template-columns: 1fr; /* single column full width */
  gap: 24px;
  margin-top: 24px;
}

.about-projects .project-card {
  width: 100%;
}

.about-text h3 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  position: relative;
  padding-left: 15px;
}

.about-text h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background-color: var(--secondary-color);
  border-radius: 2px;
}

.about-text p {
  margin-bottom: 20px;
  line-height: 1.8;
}

/* Skills Section */
.skills-section { 
  margin-top: 10px; 
}
.skills-heading { 
  font-size: 1.1rem; 
  color: var(--text-light); 
  margin: 10px 0 16px; 
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px 20px;
  align-items: stretch;
}

.skill {
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.skill:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.skill i {
  font-size: 2rem;
  color: var(--secondary-color);
}

.skill p {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.95rem;
}

#projects {
  scroll-margin-top: 1000px;
}


/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.project-card {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--secondary-color);
  display: grid;
  grid-template-columns: 160px 1fr; /* image left, content right */
  align-items: center;
  justify-content: center;
  gap: 16px; /* space between image and content */
  padding: 10px;
}

/* Compact variant for inline projects under about */
.about-projects .project-card {
  grid-template-columns: 140px 1fr;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
}

.project-image {
  aspect-ratio: 1 / 1; /* square preview for left column */
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #fff;
  display: block;
  margin-left: 10px;

  @media (max-width: 768px) {
    margin-left: 0;
  }
}

/* Inline projects image should not stretch vertically */
.about-projects .project-image {
  aspect-ratio: 1 / 1;
}

/* Prevent overlap and ensure proper sizing */
.project-image, .project-info {
  min-width: 0; /* allow grid items to shrink and text to wrap */
}

.project-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* keep logos natural */
  transition: none;
}

.project-card:hover .project-image img {
  transform: none;
}

.project-info {
  padding: 25px;
}

.project-info h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.project-info p {
  color: var(--text-color);
  margin-bottom: 20px;
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

/* Style project tech chips */
.project-tech span, .tech-tag {
  background-color: rgba(52, 152, 219, 0.1);
  color: var(--secondary-color);
  padding: 6px 12px;
  border-radius: 18px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
}

.project-links-wrapper {
  display: flex;
  flex-direction: row;
  gap: 10px;
  /* justify-content: center; */
  align-items: center;
}

.project-links {
  display: flex;
  gap: 15px;
}

.project-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.project-links a i {
  margin-right: 5px;
}

.project-links a:hover {
  color: var(--secondary-color);
}

/* Contact Section */
.contact-section {
  background-color: #f8f9fa;
}

.contact-content {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.contact-info {
  flex: 1;
  min-width: 300px;
}

.contact-info h3 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 30px;
  position: relative;
  padding-left: 15px;
}

.contact-info h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background-color: var(--secondary-color);
  border-radius: 2px;
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--secondary-color);
  margin-right: 15px;
}

.contact-item p {
  color: var(--text-color);
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background-color: white;
  color: var(--secondary-color);
  border-radius: 50%;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.social-links a:hover {
  background-color: var(--secondary-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(52, 152, 219, 0.3);
}

.contact-form {
  flex: 1;
  min-width: 300px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-color);
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.submit-btn {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.submit-btn:hover {
  background-color: #2980b9;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 20px 0;
}

/* Animations */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Styles */
@media (max-width: 992px) {
  .hero-text h1 {
    font-size: 2.8rem;
  }
  
  .hero-text p {
    font-size: 1.1rem;
  }
  
  .section {
    padding: 80px 0;
  }
  
  .section-title h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
  }
  
  .hero-text {
    padding-right: 0;
    margin-top: 40px;
  }
  
  .hero-buttons {
    justify-content: center;
    margin-bottom: 30px;
  }
  
  .hero-text h1 {
    font-size: 2.5rem;
  }
  
  .section {
    padding: 60px 0;
  }
  
  .section-title h2 {
    font-size: 2rem;
  }
  
  .about-content {
    flex-direction: column;
  }
  
  .about-projects .project-card,
  .project-card {
    grid-template-columns: 1fr; /* stack image above text on small screens */
  }
  
  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
  
  .contact-content {
    flex-direction: column;
  }

  /* Hide navbar iframe on mobile, show in drawer */
  .sponsor-iframe.navbar {
    display: none !important;
  }
  .nav-links .sponsor-iframe.drawer {
    display: block !important;
    margin: 0 auto !important;
    width: 114px !important;
    min-width: 114px !important;
    max-width: 90vw;
    height: 32px !important;
    min-height: 32px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    background: transparent !important;
  }
}

/* By default, drawer iframe is hidden on desktop */
.sponsor-iframe.drawer {
  display: none;
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 2.2rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .section-title h2 {
    font-size: 1.8rem;
  }

  .experience-card, .project-card {
    padding: 20px;
  }

  .tech-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .hero iframe {
    margin-left: 0;
    margin-top: 10px;
  }

  .contact-info iframe {
    height: 180px;
  }
}

/* GitHub Sponsor iframes */
.hero iframe {
  align-self: center;
  margin-left: 15px;
  height: 48px !important;
  border-radius: 30px !important;
  width: 114px;
}

.contact-info iframe {
  display: block;
  margin-top: 30px;
  max-width: 100%;
  height: 225px;
  border: none;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}

/* Responsive GitHub Sponsor iframe styles */
.sponsor-iframe {
  display: inline-block;
  width: 114px;
  min-width: 90px;
  max-width: 100%;
  height: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 30px;
  vertical-align: middle;
  margin-left: 18px;
  transition: all 0.3s;
}

@media (max-width: 992px) {
  .sponsor-iframe {
    width: 100px;
    height: 32px;
    margin-left: 10px;
  }
}

@media (max-width: 768px) {
  /* Hide navbar iframe on mobile, show in drawer */
  .sponsor-iframe.navbar {
    display: none !important;
  }
  .nav-links .sponsor-iframe.drawer {
    display: block !important;
    margin: 0 auto !important;
    width: 114px !important;
    min-width: 114px !important;
    max-width: 90vw;
    height: 32px !important;
    min-height: 32px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    background: transparent !important;
  }
}

/* By default, drawer iframe is hidden on desktop */
.sponsor-iframe.drawer {
  display: none;
}

/* Contact section sponsor card: increase height */
.contact-info iframe {
  display: block;
  margin-top: 30px;
  max-width: 100%;
  min-height: 320px; /* increased from 225px */
  height: 320px;
  border: none;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}