/* ── UI Enhanced v2 — visual depth & micro-interactions ─────── */

@keyframes nameShine {
  to {
    background-position: 200% center;
  }
}

@keyframes meshDrift {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(48px, 48px);
  }
}

@keyframes avatarGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.35), 0 20px 50px rgba(0, 0, 0, 0.25);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(102, 126, 234, 0), 0 24px 56px rgba(102, 126, 234, 0.2);
  }
}

/* Hero — grid mesh + richer depth */
.hero {
  isolation: isolate;
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 40%, #000 15%, transparent 72%);
}

.hero-greeting {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.06em;
}

.hero-left .highlight {
  background: linear-gradient(105deg, #fff 0%, #e0e7ff 40%, #a5b4fc 70%, #fff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  font-size: 1.08rem !important;
  line-height: 1.5;
}

.hero .availability-badge {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(74, 222, 128, 0.35);
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.15);
}

.hero .tech-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #e0e7ff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.hero .tech-badge:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(167, 139, 250, 0.45);
  transform: translateY(-3px);
}

.hero-metrics {
  gap: 0.65rem !important;
}

.hero-metrics li {
  padding: 0.65rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  min-width: 5.5rem;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease;
}

.hero-metrics li:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, 0.4);
}

.hero .hero-metrics strong {
  color: #f8fafc !important;
  font-size: 1.5rem !important;
  background: linear-gradient(135deg, #fff, #c7d2fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .hero-metrics span {
  color: rgba(226, 232, 240, 0.72) !important;
}

.hero-actions .btn-main {
  box-shadow:
    0 8px 28px rgba(102, 126, 234, 0.45),
    0 0 40px rgba(102, 126, 234, 0.15);
}

.hero-actions .btn-main:hover {
  box-shadow:
    0 12px 36px rgba(102, 126, 234, 0.55),
    0 0 50px rgba(167, 139, 250, 0.25);
}

.hero-actions .btn-highlight {
  background: linear-gradient(135deg, rgba(110, 231, 183, 0.2), rgba(167, 139, 250, 0.15));
  color: #ecfdf5 !important;
  border: 1px solid rgba(110, 231, 183, 0.35) !important;
}

.hero-actions .btn-highlight:hover {
  background: linear-gradient(135deg, rgba(110, 231, 183, 0.35), rgba(167, 139, 250, 0.25));
}

.hero-social .social-icon {
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    background 0.25s ease;
}

.hero-social .social-icon:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}

.avatar-wrapper .avatar {
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.25);
}

.avatar-ring {
  filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.45));
}

.stat-card {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-card:hover {
  transform: scale(1.05);
}

/* Cards — hover glow (no backdrop-filter — scroll cost) */
.card {
  border-radius: var(--radius-lg, 22px) !important;
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    border-color 0.3s ease;
}

.card:hover {
  border-color: rgba(102, 126, 234, 0.18);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 20px 50px rgba(102, 126, 234, 0.1);
}

body.dark-mode .card:hover {
  border-color: rgba(167, 139, 250, 0.28);
  box-shadow: 0 20px 50px rgba(102, 126, 234, 0.15);
}

/* Timeline */
.timeline::before {
  background: linear-gradient(180deg, #667eea, #a78bfa, #34d399) !important;
  width: 3px !important;
  border-radius: 3px;
  opacity: 0.85;
}

.timeline-content {
  border-radius: 16px !important;
  border: 1px solid rgba(102, 126, 234, 0.1) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95)) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}

.timeline-item:hover .timeline-content {
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.1);
}

body.dark-mode .timeline-content {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95)) !important;
  border-color: rgba(102, 126, 234, 0.2) !important;
}

.timeline-dot {
  background: linear-gradient(135deg, #667eea, #a78bfa) !important;
  border: 3px solid #fff;
}

body.dark-mode .timeline-dot {
  border-color: #0f172a;
}

.role-badge {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(167, 139, 250, 0.08)) !important;
}

/* Skills */
.skill-box {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}

.skill-box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent, rgba(102, 126, 234, 0.35), transparent);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.skill-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(102, 126, 234, 0.12);
}

.skill-box:hover::before {
  opacity: 1;
}

.skill-tag {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-tag:hover {
  transform: translateY(-2px);
}

/* Cert cards */
.cert-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.cert-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #6ee7b7);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cert-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(102, 126, 234, 0.12);
}

.cert-card:hover::after {
  opacity: 1;
}

.cert-icon {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.cert-card:hover .cert-icon {
  transform: scale(1.08) rotate(-4deg);
}

/* Projects stage — subtle grain */
.projects-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

/* Testimonials accent stripe (premium uses ::before for quote mark) */
.testimonial-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #a78bfa);
  border-radius: 12px 12px 0 0;
  pointer-events: none;
}

/* Client cards icon ring */
.client-card > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(167, 139, 250, 0.08));
  margin-bottom: 0.5rem;
}

/* Contact glass form */
.glass-form {
  padding: 1.5rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(102, 126, 234, 0.12);
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.08);
  backdrop-filter: blur(12px);
}

body.dark-mode .glass-form {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(102, 126, 234, 0.2);
}

#contact-form input,
#contact-form textarea {
  border-radius: 12px !important;
  border: 1px solid rgba(102, 126, 234, 0.15) !important;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

#contact-form input:focus,
#contact-form textarea:focus {
  border-color: #667eea !important;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12) !important;
}

.contact-link {
  transition: transform 0.25s ease, background 0.25s ease;
}

.contact-link:hover {
  transform: translateX(4px);
}

.social-btn {
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease;
}

.social-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
}

/* Nav CTA */
.nav-cta {
  background: linear-gradient(135deg, #667eea, #764ba2) !important;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease !important;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45) !important;
}

/* Typewriter cursor */
#typewriter::after {
  content: "|";
  margin-left: 2px;
  color: #a5b4fc;
  animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
  50% {
    opacity: 0;
  }
}

/* ── Project detail page ───────────────────────────────────── */
.pd-hero-title {
  background: linear-gradient(105deg, #fff, #e0e7ff, #f0abfc);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: nameShine 8s linear infinite;
}

.pd-card {
  border-radius: 18px !important;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}

.pd-card:hover {
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
}

.pd-sidebar-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pd-sidebar-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.12);
}

.pd-carousel {
  box-shadow:
    0 20px 60px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(102, 126, 234, 0.15) !important;
}

.pd-features li,
.pd-bullets li {
  transition: transform 0.25s ease, background 0.25s ease;
}

@media (max-width: 768px) {
  .hero-metrics li {
    min-width: auto;
    flex: 1 1 calc(33% - 0.5rem);
  }

  .hero-grid {
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-grid,
  .hero-left .highlight,
  .pd-hero-title,
  .avatar-wrapper .avatar {
    animation: none;
  }

  #typewriter::after {
    animation: none;
  }
}
