/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(-45deg, #e0f7fa, #f0f0f0, #e0f7fa, #f3f4f6, #e0f7fa);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  color: #4b5563;
  scroll-behavior: smooth;
}
a {
  color: inherit;
  text-decoration: none;
}
h1, h2, h3 {
  color: #111827;
  font-weight: 700;
}
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.25rem;
}

/* Header */
header {
  position: sticky;
  top: 0;
  background: #fff;
  box-shadow: 0 1px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111827;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
}
.nav-links a {
  font-weight: 600;
  position: relative;
}
.nav-links a::after {
  content: '';
  width: 0%;
  height: 2px;
  background: #111827;
  position: absolute;
  bottom: -4px;
  left: 0;
  transition: width 0.3s;
}
.nav-links a:hover::after {
  width: 100%;
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 10vw, 7rem) 1rem;
  animation: fadeIn 1.5s ease-in-out;
}
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(99,102,241,0.25), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(236,72,153,0.25), transparent 40%);
  filter: blur(40px);
  animation: glowPulse 12s ease-in-out infinite;
  pointer-events: none;
}
.hero-content {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  align-items: center;
}
.hero-text {
  text-align: left;
}
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3rem;
  font-size: 0.9rem;
  color: #6366f1;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.3rem);
  margin: 0;
  color: #0f172a;
  overflow: hidden;
  border-right: 3px solid #2563eb;
  white-space: nowrap;
  animation: typewriter 3s steps(30, end), blink-caret 0.75s step-end infinite;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: #4c566a;
  line-height: 1.7;
  margin: 1.25rem 0 1.5rem;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.badge-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(99,102,241,0.12);
  color: #4338ca;
  font-size: 0.9rem;
  font-weight: 600;
  animation: chipFloat 6s ease-in-out infinite;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2rem;
}
.btn-ghost {
  border: 2px solid rgba(15,23,42,0.15);
  padding: 0.75rem 1.5rem;
  border-radius: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(6px);
  transition: 0.3s ease;
}
.btn-ghost:hover {
  border-color: #6366f1;
  color: #4338ca;
  transform: translateY(-2px);
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}
.stat-card {
  background: rgba(255,255,255,0.9);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 15px 40px rgba(15,23,42,0.08);
  border: 1px solid rgba(99,102,241,0.1);
  transition: transform 0.4s;
}
.stat-card:hover {
  transform: translateY(-6px);
}
.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1d4ed8;
  display: block;
}
.stat-number::after {
  content: '+';
  margin-left: 2px;
  font-size: 1.5rem;
  color: #4b5563;
}
.stat-label {
  font-size: 0.95rem;
  color: #6b7280;
}
.hero-visual {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-photo {
  width: 220px;
  height: 220px;
  border-radius: 32px;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.7);
  box-shadow: 0 35px 60px rgba(15,23,42,0.25);
  animation: floatPhoto 4s ease-in-out infinite;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.floating-card {
  position: absolute;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: rgba(15,23,42,0.85);
  color: #fff;
  box-shadow: 0 20px 35px rgba(15,23,42,0.35);
  min-width: 170px;
  animation: cardFloat 7s ease-in-out infinite;
}
.floating-card small {
  color: rgba(255,255,255,0.65);
}
.floating-card.primary { top: 5%; left: 5%; background: rgba(99,102,241,0.9); }
.floating-card.secondary { bottom: 10%; right: 10%; background: rgba(236,72,153,0.9); animation-delay: 1.2s; }
.floating-card.tertiary { top: 70%; left: -5%; background: rgba(14,165,233,0.9); animation-delay: 2s; }
.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.25);
  animation: orbPulse 12s linear infinite;
}
.orbit-one {
  width: 320px;
  height: 320px;
}
.orbit-two {
  width: 380px;
  height: 380px;
  animation-duration: 15s;
}
.btn-primary {
  background-color: #111827;
  color: #fff;
  padding: 0.8rem 2rem;
  margin-top: 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: 0.3s ease;
  border: none;
}
.btn-primary:hover {
  background: #374151;
  transform: scale(1.05);
}

/* Sections */
section {
  padding: 5rem 1rem;
}
.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.section-title::after {
  display: none !important;
}
.grid {
  display: grid;
  gap: 2rem;
}

.section-highlight {
  animation: sectionGlow 1.2s ease forwards;
}

/* Timeline */
.timeline {
  position: relative;
  margin: 3rem auto;
  padding-left: 1.5rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(99,102,241,0.4), rgba(14,165,233,0.4));
}
.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 2.5rem;
}
.timeline-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: #6366f1;
  box-shadow: 0 0 0 6px rgba(99,102,241,0.15);
}
.timeline-content {
  background: #fff;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 14px 30px rgba(0,0,0,0.08);
  transition: transform 0.3s;
}
.timeline-content:hover {
  transform: translateY(-6px);
}
@media(min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Card Improvements */
.card {
  padding: 2rem;
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  animation: fadeInCard 0.6s ease-in-out both;
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), 
              box-shadow 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.card:hover {
  transform: translateY(-12px) rotateX(5deg) rotateY(5deg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(37,99,235,0.1);
}

/* Section Backgrounds */
#skills, #projects {
  background-color: #f3f4f6;
}
#contact {
  background: radial-gradient(circle, #ffffff 60%, #e0f2fe 100%);
}

/* Contact Form */
form {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  background: linear-gradient(145deg, #ffffff, #f3f4f6);
  border-radius: 1.25rem;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: transform 0.3s ease;
  animation: fadeIn 1s ease;
}
form:hover {
  transform: translateY(-4px);
}
input, textarea {
  padding: 1rem;
  font-size: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  background-color: #fff;
  transition: all 0.3s ease;
}
input:focus, textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
}
button[type="submit"] {
  padding: 1rem;
  background: linear-gradient(to right, #3b82f6, #1e3a8a);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}
button[type="submit"]:hover {
  transform: scale(1.05);
  background: linear-gradient(to right, #2563eb, #1e40af);
}

/* Form Status */
#form-status {
  text-align: center;
  font-weight: 600;
  color: #10b981;
  margin-top: 1rem;
}

/* Footer */
footer {
  text-align: center;
  font-size: 0.9rem;
  color: #6b7280;
  padding: 2rem 1rem;
  background: #f1f5f9;
}
footer a {
  margin: 0 0.5rem;
  color: #6b7280;
}
footer a:hover {
  color: #111827;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInCard {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes animatedBackground {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes floatPhoto {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #2563eb; }
}
@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes orbPulse {
  0% { transform: rotate(0deg) scale(1); opacity: 0.4; }
  50% { opacity: 0.7; }
  100% { transform: rotate(360deg) scale(1.05); opacity: 0.4; }
}
@keyframes sectionGlow {
  from { box-shadow: 0 0 0 rgba(99,102,241,0); }
  to { box-shadow: 0 0 35px rgba(99,102,241,0.25); }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    gap: 1rem;
    position: absolute;
    top: 60px;
    right: 0;
    background: #fff;
    width: 100%;
    padding: 1rem;
    display: none; /* Hidden by default */
  }
  .nav-links.active {
    display: flex; /* Show when active */
  }
  .hero-content {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero-stats {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}
@media (max-width: 576px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-photo {
    width: 180px;
    height: 180px;
  }
  .btn-primary {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }
}
@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }
  .section-title {
    font-size: 1.5rem;
  }
  .card {
    padding: 1.5rem;
  }
  form {
    padding: 1.5rem;
  }
}
html {
  scroll-padding-top: 80px; /* adjust if your header height is different */
}
/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}
.spinner {
  border: 6px solid #e0e7ef;
  border-top: 6px solid #2563eb;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
#loading-overlay.hide { opacity: 0; pointer-events: none; }

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  margin-left: 1rem;
}
.hamburger span {
  width: 28px;
  height: 3px;
  background: #111827;
  border-radius: 2px;
  transition: all 0.3s;
}
@media (max-width: 900px) {
  .nav-links {
    display: none;
    flex-direction: column;
    background: #fff;
    position: absolute;
    top: 60px;
    right: 0;
    width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-radius: 0 0 1rem 1rem;
    z-index: 1001;
  }
  .nav-links.active { display: flex; }
  .hamburger { display: flex; }
}

/* Testimonials */
.testimonials-grid {
  gap: 2rem;
}
.testimonial-card {
  background: #f9fafb;
  border-radius: 1.25rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  padding: 2rem 1.5rem;
  text-align: center;
  font-style: italic;
  animation: fadeInCard 0.8s ease-in-out both;
  transition: transform 0.3s, box-shadow 0.3s;
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), 
              box-shadow 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.testimonial-card:hover {
  transform: translateY(-12px) rotateX(5deg) rotateY(5deg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(37,99,235,0.1);
}
.testimonial-card span {
  display: block;
  margin-top: 1rem;
  font-style: normal;
  font-weight: 600;
  color: #2563eb;
}

/* Download Resume Button */
.btn-secondary {
  background: #fff;
  color: #2563eb;
  border: 2px solid #2563eb;
  padding: 0.5rem 1.2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  margin-left: 1rem;
  transition: 0.3s;
}
.btn-secondary:hover {
  background: #2563eb;
  color: #fff;
}

/* Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(.77,0,.18,1), transform 0.8s cubic-bezier(.77,0,.18,1);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Enhance section transitions */
section, .card, .testimonial-card {
  will-change: opacity, transform;
}

/* Skill Icons */
.skill-icon {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin-right: 0.5rem;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.6s, transform 0.6s;
}
.bar-fill.animated + .skill-icon,
.skill-bar .skill-icon.animated {
  opacity: 1;
  transform: scale(1.1);
  animation: iconBounce 0.8s;
}
@keyframes iconBounce {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1.0); }
}

/* Project Showcase as 2 in a row */
.project-showcase {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin: 2rem 0;
}
.project-card {
  width: 100%;
  max-width: 100%;
  margin: 0;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  isolation: isolate;
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(99,102,241,0.12), rgba(14,165,233,0.12));
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
}
.project-card:hover::before,
.project-card:focus-within::before {
  opacity: 1;
}
.project-card:hover, .project-card:focus-within {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  outline: 2px solid #667eea;
  outline-offset: 2px;
}
.project-preview {
  height: 200px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  position: relative;
}
.project-info {
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.project-tech .tech-tag {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.08);
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
@media (max-width: 900px) {
  .project-showcase {
    grid-template-columns: 1fr;
  }
}

/* Skills Icons Row */
.skills-icons-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 2.5rem 0 2rem 0;
}
.skill-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
}
.skill-icon-wrap:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 24px rgba(37,99,235,0.13);
}
.skill-icon {
  width: 32px;
  height: 32px;
  margin: 0;
  opacity: 1;
  transform: none;
  transition: none;
}
@media (max-width: 600px) {
  .skills-icons-row {
    gap: 0.7rem;
  }
  .skill-icon-wrap {
    padding: 0.5rem 0.7rem;
  }
  .skill-icon {
    width: 26px;
    height: 26px;
  }
}
