/* ===== CSS Variables ===== */
:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --primary: #8b5cf6;
  --accent: #06b6d4;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: rgba(139, 92, 246, 0.2);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; }
input, textarea { font-family: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Particles ===== */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  opacity: 0;
  animation: floatParticle var(--dur, 8s) infinite both;
}

@keyframes floatParticle {
  0%   { opacity: 0; transform: translateY(100vh) scale(0); }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.4s, backdrop-filter 0.4s, border-bottom 0.4s;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.8);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-muted);
  transition: color 0.3s;
  position: relative;
  font-size: 0.95rem;
  padding: 4px 0;
}

.nav-links a:hover {
  color: #fff;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  transition: width 0.3s;
}

.nav-links a:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: transform 0.3s, opacity 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  animation: pulseGlow 4s ease-in-out infinite;
  pointer-events: none;
}

.hero-glow-1 {
  top: 20%;
  left: 60%;
  background: var(--primary);
}

.hero-glow-2 {
  top: 60%;
  left: 20%;
  background: var(--accent);
  animation-delay: 2s;
}

@keyframes pulseGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(20px, -20px) scale(1.1); }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 1100px;
  padding: 0 40px;
}

.hero-badge {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--primary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.hero h1 {
  font-size: clamp(3.5rem, 12vw, 8rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 36px;
  color: #fff;
}

.gradient-text {
  background: linear-gradient(to right, var(--primary), #ec4899, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

.text-purple { color: var(--primary); }
.text-cyan { color: var(--accent); }

.hero-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.3s;
  text-decoration: none;
}

.btn:hover {
  transform: scale(1.05);
}

.btn-primary {
  background: linear-gradient(to right, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

.btn-ghost {
  background: rgba(139, 92, 246, 0.1);
  color: #fff;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.btn-ghost:hover {
  border-color: rgba(139, 92, 246, 0.6);
}

.btn-sm {
  padding: 10px 24px;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
}

/* ===== Scroll Indicator ===== */
.scroll-indicator {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
}

.mouse {
  width: 24px;
  height: 40px;
  border: 2px solid rgba(139, 92, 246, 0.5);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.mouse-wheel {
  width: 4px;
  height: 8px;
  background: var(--primary);
  border-radius: 2px;
  animation: scrollWheel 1.5s infinite;
}

@keyframes scrollWheel {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}

/* ===== Sections ===== */
.section {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}

/* ===== Glass effect ===== */
.about-card,
.stat-card,
.skill-card,
.project-card,
.contact-card-h,
.contact-form,
.navbar.scrolled {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.section-title {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 64px;
  color: #fff;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 16px;
  margin-bottom: 48px;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 64px;
  align-items: center;
}

.about-card {
  background: rgba(18, 18, 26, 0.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}

.about-avatar {
  width: 180px;
  height: 180px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: linear-gradient(to right, var(--primary), var(--accent));
  padding: 4px;
}

.about-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.about-card h3 {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 8px;
}

.about-card p {
  color: var(--primary);
}

.about-bio h3 {
  font-size: 1.75rem;
  color: #fff;
  margin-bottom: 20px;
}

.about-bio p {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.7;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.stat-card {
  background: rgba(18, 18, 26, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stat-num {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto 48px;
}

.skill-card {
  background: rgba(18, 18, 26, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.3s, transform 0.3s;
}

.skill-card:hover {
  border-color: rgba(139, 92, 246, 0.6);
  transform: scale(1.02);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
  color: #fff;
}

.skill-bar {
  width: 100%;
  height: 10px;
  background: #1e1e2e;
  border-radius: 999px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 1.5s ease-out;
}

.skill-fill.animated {
  /* width is set via style attribute */
}

.skill-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  animation: pulseBar 2s infinite;
  border-radius: 999px;
}

@keyframes pulseBar {
  0%, 100% { opacity: 0.15; }
  50%       { opacity: 0.4; }
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.tech-tag {
  padding: 8px 20px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: border-color 0.3s, color 0.3s;
  cursor: default;
}

.tech-tag:hover {
  border-color: rgba(139, 92, 246, 0.6);
  color: #fff;
}

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

.project-card {
  position: relative;
  background: rgba(18, 18, 26, 0.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  transition: transform 0.3s, border-color 0.3s;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(139, 92, 246, 0.6);
}

.project-glow {
  position: absolute;
  inset: -1px;
  border-radius: 16px;
  filter: blur(20px);
  opacity: 0.15;
  transition: opacity 0.5s;
  pointer-events: none;
  z-index: 0;
}

.project-card:hover .project-glow {
  opacity: 0.4;
}

.project-glow-purple {
  background: linear-gradient(to right, var(--primary), #ec4899);
}

.project-glow-cyan {
  background: linear-gradient(to right, var(--accent), #3b82f6);
}

.project-glow-green {
  background: linear-gradient(to right, #22c55e, #10b981);
}

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

.project-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.project-card h3 {
  font-size: 1.35rem;
  color: #fff;
  margin-bottom: 12px;
}

.project-card p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag {
  padding: 4px 12px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--primary);
}

.project-btns {
  display: flex;
  gap: 12px;
}

/* ===== Contact ===== */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 48px;
}

.contact-card-h {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(18, 18, 26, 0.7);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  transition: border-color 0.3s, transform 0.3s;
  text-decoration: none;
  color: inherit;
  cursor: default;
}

.contact-card-h:hover {
  border-color: rgba(139, 92, 246, 0.6);
  transform: translateY(-2px);
}

.contact-icon-h {
  font-size: 1.75rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 12px;
}

.contact-card-h h4 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.contact-card-h p {
  color: var(--text-muted);
  font-size: 0.85rem;
  word-break: break-all;
}

.contact-form {
  background: rgba(18, 18, 26, 0.7);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color 0.3s;
}

.contact-form:hover {
  border-color: rgba(139, 92, 246, 0.4);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(15, 15, 25, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: none;
}

@media (max-width: 768px) {
  .contact-cards {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .contact-form {
    padding: 28px;
  }
}

/* ===== Footer ===== */
footer {
  position: relative;
  z-index: 1;
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #fff;
}

.footer-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 32px 0;
}

.footer-copy {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== Scroll Animations ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero entrance animations */
.animate-fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.animate-fade-in-delay {
  animation-delay: 2s;
}

.animate-slide-up {
  opacity: 0;
  transform: translateY(50px);
  animation: slideUp 1s ease forwards;
}

.animate-slide-up-delay {
  animation-delay: 0.6s;
}

.animate-slide-up-delay2 {
  animation-delay: 1s;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    flex-direction: column;
    text-align: center;
  }
}
