@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Poppins:wght@500;700;900&display=swap");

:root {
  /* Fluid Light Theme */
  --bg-main: #f0f4f8;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.8);
  --blob-1: rgba(79, 70, 229, 0.3);
  --blob-2: rgba(236, 72, 153, 0.3);
  --shadow-soft: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.dark-mode {
  /* Fluid Dark Theme */
  --bg-main: #090e17;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
  --blob-1: rgba(99, 102, 241, 0.2);
  --blob-2: rgba(168, 85, 247, 0.2);
  --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none !important; /* Hide default cursor */
}

/* Optimize rendering */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  transition: background-color 0.5s ease;
  overflow-x: hidden;
  line-height: 1.6;
}

/* --- Preloader --- */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
.loader-circle {
  width: 50px;
  height: 50px;
  border: 3px solid var(--text-muted);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loader-text {
  margin-top: 1rem;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  letter-spacing: 2px;
}
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}
body.loading {
  overflow: hidden;
}

/* --- Custom Cursor --- */
.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
}
.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
}
.cursor-outline {
  width: 40px;
  height: 40px;
  border: 2px solid var(--primary);
  transition:
    width 0.2s,
    height 0.2s,
    background-color 0.2s;
}
.cursor-outline.hovering {
  width: 60px;
  height: 60px;
  background-color: rgba(99, 102, 241, 0.1);
  border-color: transparent;
}

/* --- Animated Blobs --- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  filter: blur(60px);
}
.blob {
  position: absolute;
  border-radius: 50%;
  animation: float 20s infinite alternate ease-in-out;
}
.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: var(--blob-1);
  animation-delay: 0s;
}
.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 40vw;
  height: 40vw;
  background: var(--blob-2);
  animation-delay: -5s;
}
@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(10vw, 10vh) scale(1.2);
  }
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

/* --- Typography & Headings --- */
h1,
h2,
h3,
.logo {
  font-family: "Poppins", sans-serif;
}
.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  margin-bottom: 4rem;
  font-weight: 800;
}
.highlight {
  color: var(--primary);
}

/* --- Navbar (ScrollSpy ready) --- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition:
    padding 0.3s ease,
    background 0.3s ease;
  padding: 1.5rem 0;
}
.navbar.scrolled {
  padding: 0.8rem 0;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 2rem;
  font-weight: 900;
}
.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
.nav-link {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  position: relative;
  transition: color 0.3s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 3px;
  bottom: -6px;
  left: 0;
  background: var(--primary);
  transition: width 0.3s ease;
  border-radius: 2px;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}
.nav-link.active {
  color: var(--primary);
}

/* --- Buttons --- */
.btn {
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  transition: var(--transition);
}
.primary-btn {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px var(--blob-1);
}
.primary-btn:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 25px var(--blob-1);
  background: var(--primary-hover);
}
.secondary-btn {
  background: transparent;
  border: 2px solid var(--text-main);
  color: var(--text-main);
}
.secondary-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-5px);
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}
.hero-avatar {
  width: 160px;
  height: 160px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--primary), #ec4899);
  box-shadow: 0 15px 35px var(--blob-1);
  animation: float-avatar 6s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg-main);
  transition: var(--transition);
}
.hero-avatar:hover img {
  transform: scale(1.05);
}
@keyframes float-avatar {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}
.hero .greeting {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--text-muted);
}
.hero .name {
  font-size: clamp(4rem, 8vw, 7rem);
  line-height: 1.1;
  margin: 1rem 0;
  background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .subtitle {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--primary);
  height: 40px;
  margin-bottom: 3rem;
}
.type-cursor {
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 5px;
  background: linear-gradient(90deg, #6d28d9, #4f46e5, #ec4899);
  z-index: 1001;
  transition: width 0.2s ease;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
  font-weight: 700;
  margin: 0 auto 2rem;
}
.hero-buttons,
.social-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.social-links a {
  font-size: 1.8rem;
  color: var(--text-main);
  transition: var(--transition);
}
.social-links a:hover {
  color: var(--primary);
  transform: translateY(-5px) rotate(10deg);
}
.scroll-down {
  position: absolute;
  bottom: 30px;
  font-size: 1.5rem;
  color: var(--text-muted);
  animation: bounce 2s infinite;
}

/* --- Layout & Sections --- */
.section {
  padding: 100px 2rem;
}
.section-container {
  max-width: 1200px;
  margin: 0 auto;
}
.mt-4 {
  margin-top: 2rem;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: stretch;
}
.about-text {
  padding: 3rem;
  font-size: 1.1rem;
  line-height: 1.8;
}
.skills-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.skill-tag {
  background: rgba(128, 128, 128, 0.1);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}
.skills-meter {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}
.skill-meter-item {
  display: grid;
  gap: 0.8rem;
}
.skill-meter-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}
.skill-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  overflow: hidden;
}
.skill-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  transition: width 1.3s ease;
}
.about-stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.stat-box {
  padding: 3rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: var(--transition);
}
.stat-box:hover {
  transform: scale(1.05);
}
.stat-box h3 {
  font-size: 4rem;
  line-height: 1;
}

/* Services Section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.8rem;
}
.service-card {
  padding: 2rem;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease;
}
.service-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 60px rgba(79, 70, 229, 0.15);
}
.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
}
.service-card h3 {
  margin-top: 0.5rem;
}
.service-card p {
  color: var(--text-muted);
  line-height: 1.8;
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.8rem;
}
.testimonial-card {
  padding: 2rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease;
}
.testimonial-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 50px rgba(79, 70, 229, 0.12);
}
.testimonial-card p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}
.testimonial-card span {
  font-weight: 700;
  color: var(--text-main);
}

/* Experience Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 3rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--glass-border);
}
.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding: 2.5rem;
}
.timeline-dot {
  position: absolute;
  left: -3.4rem;
  top: 2.5rem;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--primary);
  border: 4px solid var(--bg-main);
}
.timeline-date {
  display: inline-block;
  padding: 0.3rem 1rem;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem;
}

/* 3D Tilt Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 3rem;
  perspective: 1000px;
}
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.1s ease;
  height: 450px;
}
.card-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateZ(30px); /* Pushes content out for 3D effect */
}
.card-img {
  height: 250px;
  background-size: cover;
  background-position: center;
  border-radius: 24px 24px 0 0;
}
.card-info {
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.project-link {
  align-self: flex-end;
  width: 45px;
  height: 45px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.2rem;
  transition: var(--transition);
}
.project-link:hover {
  transform: scale(1.1) rotate(45deg);
}

/* Contact Form */
.contact-wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: 4rem;
}
.input-group {
  margin-bottom: 2rem;
  position: relative;
}
.input-group label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 600;
}
.input-group input,
.input-group textarea {
  width: 100%;
  padding: 1.2rem;
  background: rgba(128, 128, 128, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}
.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(128, 128, 128, 0.1);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
.contact-form button {
  width: 100%;
  justify-content: center;
}

/* Footer & Back to Top */
footer {
  padding: 2rem;
  text-align: center;
  margin-top: 5rem;
}
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 99;
  box-shadow: var(--shadow-soft);
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
#back-to-top:hover {
  transform: translateY(-5px);
  background: var(--primary-hover);
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 1s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Tools */
.tools {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.custom-select {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px);
  transition: var(--transition);
}
.custom-select:hover,
.custom-select:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 16px 35px rgba(79, 70, 229, 0.12);
}
.custom-select i {
  color: var(--primary);
  font-size: 0.95rem;
}
.select-wrapper {
  position: relative;
  min-width: 120px;
}
.select-selected {
  padding: 0.35rem 1.4rem 0.35rem 0;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.select-selected::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--text-main);
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}
.custom-select.open .select-selected::after {
  transform: rotate(180deg);
}
.select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
  opacity: 0;
  z-index: 1000;
  margin-top: 0.5rem;
}
.custom-select.open .select-options {
  max-height: 260px;
  opacity: 1;
  overflow-y: auto;
}
.select-options::-webkit-scrollbar {
  width: 8px;
}
.select-options::-webkit-scrollbar-thumb {
  background: rgba(79, 70, 229, 0.35);
  border-radius: 999px;
}
.select-options::-webkit-scrollbar-track {
  background: transparent;
}
.select-options li {
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.select-options li:last-child {
  border-bottom: none;
}
.select-options li:hover {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
}
#theme-toggle {
  background: transparent;
  border: none;
  padding: 0;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: var(--transition);
  cursor: pointer;
}
.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.08);
}
.theme-toggle-track {
  position: relative;
  width: 48px;
  height: 24px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  border: 1px solid rgba(79, 70, 229, 0.2);
}
.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 5px 15px rgba(15, 23, 42, 0.12);
  transition:
    transform 0.3s ease,
    background 0.3s ease;
}
body.dark-mode .theme-toggle-thumb {
  transform: translateX(24px);
  background: #111827;
}
.theme-toggle-label {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  color: var(--text-main);
}
.theme-toggle-label i {
  font-size: 1rem;
}

@media (max-width: 968px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  } /* Kept hidden for brevity, usually a hamburger menu goes here */
  .timeline {
    padding-left: 2rem;
  }
  .timeline::before {
    left: 0;
  }
  .timeline-dot {
    left: -2.4rem;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
  }
  .hero-content {
    text-align: center;
  }
  .social-links {
    justify-content: center;
  }
  .tools {
    gap: 0.5rem;
  }
  .custom-select {
    padding: 0.25rem 0.5rem;
  }
  .select-wrapper {
    min-width: 100px;
  }
  .theme-toggle {
    padding: 0.3rem 0.5rem;
  }
  .theme-toggle-track {
    width: 40px;
    height: 20px;
  }
  .theme-toggle-thumb {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
  }
  body.dark-mode .theme-toggle-thumb {
    transform: translateX(20px);
  }
}

@media (max-width: 768px) {
  .hero-avatar {
    width: 130px;
    height: 130px;
    margin-bottom: 1rem;
  }
  .section-title {
    font-size: clamp(2rem, 6vw, 3rem);
  }
  .hero-badge {
    font-size: 0.9rem;
  }
  .name {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }
  .subtitle {
    font-size: 1.1rem;
  }
  .about-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .stat-box {
    text-align: center;
  }
  .contact-wrapper {
    padding: 2rem;
  }
  .footer-content {
    text-align: center;
  }
  .navbar {
    padding: 1rem 0;
  }
  .nav-container {
    padding: 0 1rem;
  }
  .section-container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .hero-content {
    padding: 2rem 1rem;
  }
  .hero-badge {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
  .social-links {
    gap: 1.5rem;
  }
  .tools {
    flex-direction: column;
    gap: 0.5rem;
  }
  .custom-select {
    width: 100%;
    justify-content: center;
  }
  .select-options li {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
  .service-card {
    text-align: center;
  }
  .timeline-item {
    padding-left: 1rem;
  }
  .timeline::before {
    left: 0.5rem;
  }
  .timeline-dot {
    left: -1.9rem;
  }
}
