/* ===== CSS Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== Root Variables ===== */
:root {
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --secondary-color: #1e293b;
  --accent-color: #8b5cf6;
  --bg-color: #f8fafc;
  --text-color: #334155;
  --white: #ffffff;
  --card-bg: #ffffff;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --shadow-hover: 0 20px 40px rgba(59, 130, 246, 0.15);
  --gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-reverse: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  --gradient-radial: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
                     radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
  --transition: all 0.3s ease;
}

/* ===== Global Styles ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

section {
  padding: 100px 20px;
  max-width: 1200px;
  margin: auto;
}

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

.section-title h2 {
  font-size: 2.5rem;
  color: var(--secondary-color);
  display: inline-block;
  font-weight: 700;
}

.section-title h2::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 4px;
  background: var(--gradient);
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

p {
  margin-top: 10px;
  color: #64748b;
}

/* ===== Navbar ===== */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
  z-index: 1000;
  transition: var(--transition);
}

header.scrolled {
  padding: 5px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

nav {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
}

nav .logo {
  font-weight: 700;
  font-size: 1.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

nav .logo:hover {
  transform: scale(1.05);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
}

nav ul li a {
  text-decoration: none;
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 0;
  position: relative;
  transition: var(--transition);
}

nav ul li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background: var(--gradient);
  bottom: 0;
  left: 0;
  transition: width 0.3s ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* ===== Hero Section ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: 100px;
  text-align: center;
  background: linear-gradient(135deg, #f6f9ff 0%, #f0f4ff 100%);
}

.hero::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--gradient-radial);
  z-index: -1;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 40% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 30%),
    radial-gradient(circle at 60% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 30%);
  z-index: -1;
  animation: pulse 8s ease-in-out infinite alternate;
}

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

.hero-content {
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  animation: fadeInUp 1s ease;
  position: relative;
  z-index: 1;
}

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

.profile-container {
  width: 280px;
  height: 280px;
  margin: 0 auto 40px;
  border-radius: 50%;
  background: var(--gradient);
  padding: 8px;
  box-shadow: 
    0 20px 40px rgba(59, 130, 246, 0.3),
    0 0 0 15px rgba(255, 255, 255, 0.1),
    inset 0 0 20px rgba(255, 255, 255, 0.5);
  animation: float 6s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.profile-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

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

.profile-pic {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid white;
  position: relative;
  z-index: 2;
}

.hero-text {
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 10px;
  line-height: 1.2;
  position: relative;
}

.hero .name {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.hero .name::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.hero h1:hover .name::after {
  transform: scaleX(1);
}

.hero h3 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--secondary-color);
  position: relative;
  display: inline-block;
}

.hero h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--gradient);
}

.hero p {
  max-width: 600px;
  margin: 0 auto 30px;
  font-size: 1.2rem;
  line-height: 1.8;
  color: #64748b;
  position: relative;
  padding: 0 20px;
}

.hero-btns {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 14px 36px;
  background: var(--gradient);
  color: var(--white);
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-reverse);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(59, 130, 246, 0.4);
}

.btn:hover::before {
  opacity: 1;
}

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

.btn-outline:hover {
  background: var(--gradient);
  color: white;
  border-color: transparent;
}

/* ===== Skills Section ===== */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.skill-card {
  background: var(--card-bg);
  padding: 40px 30px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
  border: 1px solid rgba(59, 130, 246, 0.1);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.skill-card:hover::before {
  transform: scaleX(1);
}

.skill-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(59, 130, 246, 0.3);
}

.skill-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  display: block;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: var(--transition);
}

.skill-card:hover .skill-icon {
  transform: scale(1.1) rotate(5deg);
}

.skill-card h3 {
  margin-bottom: 15px;
  color: var(--secondary-color);
  transition: var(--transition);
}

.skill-card:hover h3 {
  color: var(--primary-color);
}

.skill-list {
  list-style: none;
  margin-top: 20px;
}

.skill-list li {
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  position: relative;
  padding-left: 25px;
  transition: var(--transition);
}

.skill-list li:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

.skill-list li:last-child {
  border-bottom: none;
}

.skill-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
  transition: var(--transition);
}

.skill-list li:hover::before {
  transform: scale(1.3);
}

/* ===== Projects Section ===== */
.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.project-card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid rgba(59, 130, 246, 0.1);
  position: relative;
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.project-card:hover::after {
  opacity: 0.05;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.project-img {
  height: 220px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.project-img::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.1));
  z-index: 1;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-img img {
  transform: scale(1.1);
}

.project-content {
  padding: 30px;
  position: relative;
  z-index: 2;
}

.project-content h3 {
  margin-bottom: 15px;
  color: var(--secondary-color);
  transition: var(--transition);
}

.project-card:hover .project-content h3 {
  color: var(--primary-color);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}

.project-tags span {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.project-tags span:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

/* ===== Contact Section - Tilt Effect ===== */
.tilt-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 40px;
}

.contact-link.tilt {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 25px;
  text-align: left;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid rgba(59, 130, 246, 0.1);
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  perspective: 1000px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-color);
}

.contact-link.tilt::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.contact-link.tilt:hover {
  transform: rotateY(10deg) rotateX(5deg) translateY(-10px);
  box-shadow: 
    20px 20px 40px rgba(0,0,0,0.1),
    -10px -10px 30px rgba(255,255,255,0.7);
  color: white;
}

.contact-link.tilt:hover::before {
  opacity: 1;
}

.tilt-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.tilt-icon svg {
  width: 28px;
  height: 28px;
  transition: all 0.3s ease;
}

.contact-link.tilt:hover .tilt-icon {
  transform: scale(1.1) rotate(-5deg);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
}

.contact-link.tilt:hover .tilt-icon svg {
  color: white;
}

.email-icon {
  background: linear-gradient(135deg, #EA4335 0%, #FBBC05 100%);
}

.email-icon svg {
  color: white;
}

.github-icon {
  background: linear-gradient(135deg, #333 0%, #666 100%);
}

.github-icon svg {
  color: white;
}

.linkedin-icon {
  background: linear-gradient(135deg, #0077B5 0%, #00A0DC 100%);
}

.linkedin-icon svg {
  color: white;
}

.facebook-icon {
  background: linear-gradient(135deg, #1877F2 0%, #4267B2 100%);
}

.facebook-icon svg {
  color: white;
}

.tilt-content {
  flex: 1;
  position: relative;
  z-index: 1;
}

.tilt-title {
  font-weight: 700;
  font-size: 1.2rem;
  display: block;
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

.tilt-sub {
  font-size: 0.9rem;
  color: #64748b;
  display: block;
  transition: all 0.3s ease;
}

.contact-link.tilt:hover .tilt-title,
.contact-link.tilt:hover .tilt-sub {
  color: white;
}

.tilt-arrow {
  font-size: 1.5rem;
  font-weight: 300;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.contact-link.tilt:hover .tilt-arrow {
  opacity: 1;
  transform: translateX(0);
  color: white;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 20px 20px;
  background: var(--secondary-color);
  color: #cbd5e1;
  margin-top: 60px;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
}

footer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.footer-content p {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: #e2e8f0;
}

.copyright {
  margin-top: 30px;
  font-size: 0.9rem;
  color: #94a3b8;
  position: relative;
  padding-top: 20px;
}

.copyright::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: var(--gradient);
  opacity: 0.5;
}

/* ===== Scroll Progress Indicator ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: var(--gradient);
  z-index: 9999;
  transition: width 0.1s ease;
}

/* ===== Back to Top Button ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.5rem;
  box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3);
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .profile-container {
    width: 250px;
    height: 250px;
  }
  
  .hero h1 {
    font-size: 2.8rem;
  }
  
  .section-title h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  section {
    padding: 80px 20px;
  }
  
  .hero h1 {
    font-size: 2.4rem;
  }
  
  .hero h3 {
    font-size: 1.5rem;
  }
  
  .hero-btns {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  .btn {
    width: 100%;
    max-width: 250px;
  }
  
  nav ul {
    gap: 15px;
  }
  
  .projects-container {
    grid-template-columns: 1fr;
  }
  
  .tilt-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .contact-link.tilt {
    padding: 20px;
  }
  
  .tilt-icon {
    width: 50px;
    height: 50px;
    margin-right: 15px;
  }
  
  .tilt-icon svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 576px) {
  nav {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
  
  nav ul li a {
    font-size: 0.9rem;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  .profile-container {
    width: 220px;
    height: 220px;
  }
  
  .skill-card {
    padding: 30px 20px;
  }
  
  .section-title h2 {
    font-size: 1.8rem;
  }
  
  .tilt-title {
    font-size: 1.1rem;
  }
  
  .tilt-sub {
    font-size: 0.85rem;
  }
  
  .contact-link.tilt {
    padding: 18px;
  }
  
  .tilt-icon {
    width: 45px;
    height: 45px;
    margin-right: 12px;
  }
  
  .hero p {
    font-size: 1.1rem;
    padding: 0 15px;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
}
