/* Keyframes for animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Combined intro animation - combines fadeIn and hover in one smooth motion */
@keyframes smoothIntro {
  0% { opacity: 0; transform: scale(0.95); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); }
  40% { opacity: 1; transform: scale(1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); }
  60% { opacity: 1; transform: scale(1.05) rotateY(5deg); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); }
  100% { opacity: 1; transform: scale(1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); }
}

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

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

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

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

body {
  font-family: 'Arial', sans-serif;
  color: #333;
  background-color: #f5f5f5;
  background-image:
    linear-gradient(rgba(200, 200, 200, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 200, 200, 0.7) 1px, transparent 1px);
  background-size: 25px 25px;
  background-position: center center;
  background-attachment: fixed;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
  perspective: 1000px; /* For 3D effects */
}

.card {
  background-color: white;
  color: black;
  padding: clamp(1rem, 2vw, 2rem);
  border-radius: 5px;
  text-align: center;
  width: clamp(300px, 40vw, 500px);
  height: auto;
  min-height: 45vh;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              box-shadow 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* Animation is now handled by auto-hover class */
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.hover-enabled:hover {
  transform: scale(1.05) rotateY(5deg);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Apply the combined intro animation to the auto-hover class */
.auto-hover {
  animation: smoothIntro 3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Logo style - increase size proportionally */
.logo img {
  width: clamp(180px, 26vw, 260px);
  height: clamp(180px, 26vw, 260px);
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10%;
  transition: all 0.5s ease;
  animation: pulse 3s ease-in-out infinite;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  position: relative;
}

.logo img:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
  transform: translateY(-8px) scale(1.05);
  animation-play-state: paused;
}

.logo img::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  background: linear-gradient(45deg, #ff3366, #ff6633, #ffcc33, #33cc33, #3366ff, #cc33ff);
  background-size: 400% 400%;
  z-index: -1;
  filter: blur(10px);
  animation: shimmer 3s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.logo img:hover::after {
  opacity: 0.7;
}

h1 {
  font-size: clamp(1.5rem, 3vw, 1.7rem);
  margin: 5px 2px;
  animation: fadeIn 1s ease-out 0.3s both;
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -3px;
  left: 50%;
  background-color: #333;
  transition: all 0.5s ease;
  transform: translateX(-50%);
}

h1:hover::after {
  width: 50%;
}

p1, p2 {
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  color: grey;
  display: block;
  animation: fadeIn 1s ease-out 0.5s both;
}

p1 {
  margin-bottom: 5px;
}

p2 {
  margin-bottom: 20px;
  font-weight: bold;
  color: #555;
  animation: fadeIn 1s ease-out 0.7s both;
}

/* Social icons styles */
.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  animation: fadeIn 1s ease-out 0.9s both;
}

.social-icon {
  width: 25px;
  height: 25px;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
  animation: float 6s ease-in-out infinite;
}

.social-icon:hover {
  transform: scale(1.3) rotate(10deg);
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.2));
  animation-play-state: paused;
}

/* Stagger the floating animation for each icon */
.social-icons a:nth-child(2) .social-icon {
  animation-delay: 1s;
}

/* Adjusted link styles */
.links {
  margin-top: clamp(30px, 5vh, 50px);
  display: flex;
  justify-content: center;
  gap: clamp(30px, 8vw, 120px);
  padding: 1vh 0;
  animation: fadeIn 1s ease-out 1.1s both;
}

.links a {
  font-weight: 600;
  color: black;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(110px, 13vh, 150px);
  height: clamp(60px, 8vh, 70px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-size: clamp(1.1rem, 1.4em, 1.6rem);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.links a::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.05);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: -1;
}

.links a:hover::before {
  transform: translateX(0);
}

.links a:hover {
  border: 1px solid black;
  border-radius: 5px;
  box-shadow: 12px 12px #000;
  transform: scale(1.1) translateY(-5px);
  color: #000;
}

/* Adjust drop shadow for mobile devices */
@media (max-width: 480px) {
  .links a:hover {
    box-shadow: 5px 5px #000;
    transform: scale(1.05);
  }
}

.scroll-indicator {
  margin-top: clamp(20px, 4vh, 40px);
  animation: fadeIn 1s ease-out 1.3s both;
}

.scroll-indicator .square {
  width: clamp(12px, 2vh, 16px);
  height: clamp(12px, 2vh, 16px);
  background-color: black;
  border-radius: 3px;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  animation: pulse 2s ease-in-out infinite;
  position: relative;
}

.scroll-indicator .square:hover {
  transform: scale(1.6) rotate(45deg);
  background-color: #333;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.scroll-indicator .square::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  z-index: -1;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.scroll-indicator .square:hover::before {
  opacity: 1;
  transform: scale(1.2);
}

/* About Section Styles */
.about {
  display: none;
  width: clamp(320px, 60vw, 900px);
  height: auto;
  min-height: fit-content;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  padding: clamp(25px, 3.5vw, 40px);
  padding-bottom: 70px;
  position: relative;
  border: 1px solid #f0f0f0;
  background-image:
    radial-gradient(circle, #00000005 1px, transparent 1px),
    linear-gradient(to bottom, #ffffff, #f9f9f9);
  background-size: 20px 20px, 100% 100%;
  transform-style: preserve-3d;
  perspective: 1000px;
  overflow: hidden;
}

/* Add a subtle border effect */
.about::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, rgba(0,0,0,0.05), rgba(0,0,0,0), rgba(0,0,0,0.05));
  z-index: -1;
  border-radius: 14px;
}

.about-header {
  margin-bottom: 2.5rem;
  position: relative;
}

.about-header::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: #333;
  border-radius: 2px;
}

.about-title h2 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.about-title .subtitle {
  color: #555;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.about-content p {
  color: #555;
  line-height: 1.8;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

/* Desktop layout for about header */
@media (min-width: 768px) {
  .about-header {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
  }
  
  .about-title {
    width: 30%;
  }
  
  .about-content {
    width: calc(70% - 30px);
  }
  
  /* Remove the decorative line from the header in desktop view */
  .about-header::after {
    display: none;
  }
  
  /* Add a decorative line specifically for the subtitle */
  .about-title .subtitle {
    position: relative;
    padding-bottom: 15px;
  }
  
  .about-title .subtitle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
  }
}

.experience-section h2 {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #222;
}

.experience-section .subtitle {
  color: #555;
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  font-weight: 500;
}

.experience-section h3 {
  font-size: 1.5rem;
  margin: 2.2rem 0 1.2rem 0;
  color: #333;
  font-weight: 600;
}

/* Desktop layout for experience section */
@media (min-width: 768px) {
  .experience-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
  }
  
  .experience-section h2,
  .experience-section .subtitle {
    width: 100%;
  }
  
  .experience-section .programming-experience,
  .experience-section .software-experience {
    width: calc(50% - 20px);
  }
}

.experience-list {
  list-style: none;
  padding: 0;
}

.experience-list li {
  color: #555;
  margin-bottom: 0.8rem;
  padding: 8px 12px;
  border-left: 3px solid #ddd;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background-color: rgba(245, 245, 245, 0.5);
  border-radius: 0 4px 4px 0;
  transform: translateX(0);
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards, slideUp 0.5s ease-out forwards;
  animation-delay: calc(0.1s * var(--item-index, 0));
}

/* Set animation delays for each list item */
.experience-list li:nth-child(1) { --item-index: 1; }
.experience-list li:nth-child(2) { --item-index: 2; }
.experience-list li:nth-child(3) { --item-index: 3; }
.experience-list li:nth-child(4) { --item-index: 4; }
.experience-list li:nth-child(5) { --item-index: 5; }

.experience-list li:hover {
  border-left-color: #333;
  background-color: rgba(240, 240, 240, 0.8);
  transform: translateX(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.experience-list:last-of-type {
  margin-bottom: 50px;
}

/* Portfolio Container */
.portfolio {
  display: none;
  width: clamp(320px, 70vw, 900px);
  height: auto;
  min-height: fit-content;
  overflow-y: auto;
  margin: 30px auto;
  padding: clamp(28px, 4.5vw, 45px);
  padding-bottom: 70px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  position: relative;
  border: 1px solid #f0f0f0;
  background-image:
    radial-gradient(circle, #00000005 1px, transparent 1px),
    linear-gradient(to bottom, #ffffff, #f9f9f9);
  background-size: 20px 20px, 100% 100%;
  transform-style: preserve-3d;
  perspective: 1000px;
  overflow: hidden;
}

/* Add a subtle border effect */
.portfolio::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, rgba(0,0,0,0.05), rgba(0,0,0,0), rgba(0,0,0,0.05));
  z-index: -1;
  border-radius: 14px;
}

/* Year Headings */
.year {
  font-size: clamp(26px, 4.2vw, 34px);
  font-weight: 700;
  margin-bottom: 28px;
  border-bottom: 2px solid #eee;
  padding-bottom: 15px;
  color: #222;
  letter-spacing: -0.5px;
  position: relative;
}

.year::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background-color: #333;
  border-radius: 1px;
}

/* Project Cards */
.project {
  background-color: #f9f9f9;
  padding: clamp(22px, 3.5vw, 32px);
  margin-bottom: 30px;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-left: 4px solid #ddd;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.5s ease-out forwards, slideUp 0.5s ease-out forwards;
  animation-delay: calc(0.15s * var(--project-index, 0));
}

/* Featured Project styling */
.featured-project {
  background: linear-gradient(135deg, #f9f9f9, #f0f0f0);
  border-left: 4px solid #ddd; /* Changed from blue to gray */
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  z-index: 2;
  transform-style: preserve-3d;
}

.featured-project:hover {
  border-left: 4px solid #3182ce; /* Change to blue on hover */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 30px rgba(49, 130, 206, 0.15); /* Added glow effect */
}

.featured-project::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.03), transparent); /* More subtle gradient by default */
  z-index: 1;
  opacity: 0.9;
  transition: background 0.3s ease;
}

.featured-project:hover::before {
  background: linear-gradient(135deg, rgba(49, 130, 206, 0.08), transparent); /* Blue tint only on hover */
}

/* Spotlight effect */
.spotlight {
  position: absolute;
  top: -150%;
  left: -150%;
  width: 400%;
  height: 400%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 65%);
  transform: rotate(0deg);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.6s ease;
  animation: rotate 20s linear infinite;
}

@keyframes spotlight {
  0% { transform: translate(-30%, -30%) scale(1.2); }
  25% { transform: translate(30%, -30%) scale(1); }
  50% { transform: translate(30%, 30%) scale(1.2); }
  75% { transform: translate(-30%, 30%) scale(1); }
  100% { transform: translate(-30%, -30%) scale(1.2); }
}

.featured-project:hover .spotlight {
  opacity: 0.8;
  animation: spotlight 10s ease-in-out infinite;
}

/* Additional hover effect - adds highlight pulse */
.featured-project::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(49, 130, 206, 0), rgba(49, 130, 206, 0));
  z-index: 1;
  transition: all 1s ease;
  pointer-events: none;
}

.featured-project:hover::after {
  background: radial-gradient(circle at center, rgba(49, 130, 206, 0.05), rgba(49, 130, 206, 0));
  animation: pulse 4s ease-in-out infinite;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px; /* Increased spacing */
  position: relative;
  z-index: 3;
  padding-bottom: 12px; /* Added padding to separate from content */
  border-bottom: 1px solid rgba(0, 0, 0, 0.06); /* Subtle divider line */
}

.project-content {
  position: relative;
  z-index: 3;
  padding-top: 5px; /* Added padding */
}

.project-content p {
  font-size: 1rem;
  line-height: 1.6;
  color: #444;
  margin-bottom: 28px; /* Increased bottom margin for badge space */
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8); /* Subtle text shadow for better readability */
}

.project-badge {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: linear-gradient(135deg, #555, #333); /* Changed to gray by default */
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 12px; /* Slightly wider */
  border-radius: 20px;
  opacity: 0.8;
  transform: translateY(15px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.featured-project:hover .project-badge {
  transform: translateY(0);
  opacity: 1;
  background: linear-gradient(135deg, #3182ce, #2c5282); /* Blue gradient on hover */
  box-shadow: 0 5px 15px rgba(49, 130, 206, 0.4), 0 0 10px rgba(49, 130, 206, 0.2); /* Added glow */
}

.tech-stack {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Tech stack container */
.tech-stack {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 5px;
  border-radius: 30px;
  background-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.featured-project:hover .tech-stack {
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Tech icons styling */
.tech-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.5s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.tech-icon-wrapper::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tech-icon-wrapper:hover {
  transform: translateY(-5px) scale(1.15);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.tech-icon-wrapper:hover::after {
  opacity: 0.8;
}

.tech-icon {
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

/* Tech icon animation */
.react-icon {
  animation: rotate 8s linear infinite;
  filter: drop-shadow(0 0 1px rgba(97, 218, 251, 0.3));
}

.tech-icon-wrapper:hover .react-icon {
  animation-duration: 3s;
  filter: drop-shadow(0 0 3px rgba(97, 218, 251, 0.7));
}

/* Tailwind icon animation */
.tailwind-icon {
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 1px rgba(6, 182, 212, 0.3));
}

.tech-icon-wrapper:hover .tailwind-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 3px rgba(6, 182, 212, 0.7));
}

/* React icon wrapper - uses transitions instead of animations */
.tech-icon-wrapper:nth-child(1) {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              background-color 0.3s ease, 
              box-shadow 0.5s ease;
}

.tech-icon-wrapper:nth-child(1):hover {
  background-color: rgba(240, 249, 255, 0.95);
  box-shadow: 0 0 5px rgba(97, 218, 251, 0.3),
              0 0 15px rgba(97, 218, 251, 0.8),
              0 0 25px rgba(97, 218, 251, 0.4);
}

/* Tailwind icon wrapper - uses transitions instead of animations */
.tech-icon-wrapper:nth-child(2) {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              background-color 0.3s ease, 
              box-shadow 0.5s ease;
}

.tech-icon-wrapper:nth-child(2):hover {
  background-color: rgba(240, 253, 255, 0.95);
  box-shadow: 0 0 5px rgba(6, 182, 212, 0.3),
              0 0 15px rgba(6, 182, 212, 0.8),
              0 0 25px rgba(6, 182, 212, 0.4);
}

/* Set animation delays for each project */
.project:nth-of-type(1) { --project-index: 1; }
.project:nth-of-type(2) { --project-index: 2; }
.project:nth-of-type(3) { --project-index: 3; }

.project::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0), rgba(255,255,255,0.1));
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.project:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #333;
}

.project:hover::before {
  transform: translateX(100%);
}

.project h3 {
  font-size: clamp(17px, 2.2vw, 20px);
  margin-bottom: 10px;
  font-weight: 600;
  color: #222;
  position: relative;
  display: inline-block;
}

.project h3::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #333;
  transition: width 0.3s ease;
}

.project:hover h3::after {
  width: 100%;
}

.project p {
  font-size: clamp(13px, 1.6vw, 15px);
  color: #555;
  line-height: 1.5;
  transition: color 0.3s ease;
}

.project:hover p {
  color: #333;
}

/* Scroll Back Button */
.scroll-back {
  margin-bottom: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  position: absolute;
  bottom: 20px;
  left: 20px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #f5f5f5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  animation: pulse 2s ease-in-out infinite;
  z-index: 10;
}

.scroll-back::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.05);
  transform: scale(0);
  transition: transform 0.3s ease;
  z-index: -1;
}

.scroll-back:hover {
  transform: scale(1.2) translateY(-3px);
  background-color: #eaeaea;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  animation-play-state: paused;
  color: #000;
}

.scroll-back:hover::before {
  transform: scale(1.5);
}

/* Make sure all sections have smooth transitions */
.card, .about, .portfolio {
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

/* Improved mobile responsiveness */
@media (max-width: 768px) {
  .card {
    width: 90%;
    min-height: auto;
    padding: 1.5rem;
  }
  
  .logo img {
    width: 170px;
    height: 170px;
    margin-bottom: 6%;
  }
  
  h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
  }
  
  p1, p2 {
    font-size: 0.95rem;
  }
  
  .links {
    margin-top: 25px;
    gap: 30px;
  }
  
  .links a {
    width: 110px;
    height: 50px;
    font-size: 1.1rem;
  }
  
  .links a:hover {
    box-shadow: 6px 6px #000;
  }
  
  .social-icons {
    gap: 30px;
  }
  
  .social-icon {
    width: 28px;
    height: 28px;
  }
  
  /* About and Portfolio mobile styles */
  .about, .portfolio {
    width: 90%;
    padding: 20px;
    padding-bottom: 70px;
  }
  
  .about-title h2,
  .experience-section h2,
  .year {
    font-size: 1.7rem;
  }
  
  .about-title .subtitle,
  .experience-section .subtitle {
    font-size: 1rem;
  }
  
  .about-content p {
    font-size: 0.95rem;
    line-height: 1.6;
  }
  
  .experience-section h3 {
    font-size: 1.3rem;
    margin: 1.8rem 0 1rem 0;
  }
  
  .experience-list li {
    padding: 6px 10px;
    font-size: 0.9rem;
  }
  
  .project {
    padding: 20px;
  }
  
  .project h3 {
    font-size: 1.2rem;
  }
  
  .project p {
    font-size: 0.9rem;
  }
  
  .tech-icon-wrapper {
    width: 35px;
    height: 35px;
  }
}

/* Smaller phones */
@media (max-width: 380px) {
  .card {
    width: 100%;
    padding: 1rem;
  }
  
  .logo img {
    width: 140px;
    height: 140px;
    margin-bottom: 5%;
  }
  
  .links {
    gap: 18px;
    margin-top: 20px;
  }
  
  .links a {
    width: 90px;
    height: 45px;
    font-size: 1rem;
  }
  
  .links a:hover {
    box-shadow: 4px 4px #000;
    transform: scale(1.05);
  }
  
  /* About and Portfolio for very small screens */
  .about, .portfolio {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
  }
  
  .about-title h2,
  .experience-section h2,
  .year {
    font-size: 1.5rem;
  }
  
  .project {
    padding: 15px;
    margin-bottom: 20px;
  }
  
  .tech-stack {
    gap: 10px;
  }
  
  .tech-icon-wrapper {
    width: 30px;
    height: 30px;
  }
  
  .scroll-back {
    width: 35px;
    height: 35px;
  }
}

/* Adjustments for short height screens */
@media (max-height: 600px) {
  .card {
    min-height: auto;
    padding: 1rem;
  }
  
  .logo img {
    margin-bottom: 5%;
    width: 130px;
    height: 130px;
  }
  
  .links {
    margin-top: 20px;
  }
  
  h1 {
    font-size: 1.4rem;
    margin: 3px 0;
  }
  
  p1, p2 {
    font-size: 0.9rem;
    margin-bottom: 3px;
  }
  
  .social-icons {
    margin-bottom: 15px;
  }
}

/* Added meta viewport tag for proper mobile scaling */
@media screen and (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
  
  body {
    position: relative;
    width: 100%;
  }
  
  .container {
    padding: 0.5rem;
  }
}

@media (min-width: 1400px) {
  .portfolio {
    width: 900px;
    padding: 50px;
    padding-bottom: 70px;
  }
  
  .project {
    padding: 35px;
  }
}

/* Clipboard icon styles and animations */
.clipboard-icon {
  cursor: pointer;
  vertical-align: middle;
  margin-left: 5px;
  transition: transform 0.3s ease, filter 0.3s ease;
  transform-origin: center;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.clipboard-icon:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.clipboard-icon.copied {
  animation: checkmarkTransform 0.5s forwards;
}

.clipboard-group, .checkmark-group {
  transition: opacity 0.3s ease;
}

.checkmark-group path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  transition: stroke-dashoffset 0.5s ease;
}

.checkmark-group[style*="opacity: 1"] path {
  stroke-dashoffset: 0;
  stroke: #4CAF50;
}

@keyframes checkmarkTransform {
  0% {
    transform: scale(1.15);
    opacity: 1;
  }
  20% {
    transform: scale(0.9) rotate(10deg);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2) rotate(-10deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.1);
    opacity: 1;
  }
}

.clipboard-icon.copied path,
.clipboard-icon.copied rect {
  animation: morphToCheckmark 0.5s forwards;
}

@keyframes morphToCheckmark {
  0% {
    fill: transparent;
    stroke: currentColor;
    stroke-dasharray: 0;
    stroke-dashoffset: 0;
  }
  50% {
    fill: rgba(76, 175, 80, 0.1);
    stroke: #4CAF50;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
  }
  100% {
    fill: rgba(76, 175, 80, 0.1);
    stroke: #4CAF50;
    stroke-dasharray: 40;
    stroke-dashoffset: 0;
  }
}

#main-card {
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#main-card:hover {
  transform: scale(1.02) translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}