/* ============================================
   DESIGN SYSTEM — CSS Variables & Tokens
   ============================================ */
:root {
  /* — Color Palette (Light) — */
  --primary: #0f172a;
  --primary-soft: #1e293b;
  --secondary: #6366f1;
  --secondary-glow: rgba(99, 102, 241, 0.35);
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.25);
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-raised: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --bg: #f1f5f9;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 40px var(--secondary-glow);
  --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  --section-gradient-1: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  --section-gradient-2: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --contact-bg: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);

  /* — Typography — */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* — Spacing — */
  --section-padding: 100px 0;
  --container-width: 1200px;

  /* — Radius — */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* — Transitions — */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.35s;
  --duration-slow: 0.6s;

  /* — Navbar — */
  --nav-height: 72px;
}

/* — Dark Theme — */
[data-theme="dark"] {
  --primary: #e2e8f0;
  --primary-soft: #cbd5e1;
  --surface: #0f172a;
  --surface-alt: #1e293b;
  --surface-raised: #1e293b;
  --surface-glass: rgba(15, 23, 42, 0.78);
  --bg: #0b1120;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35);
  --section-gradient-1: linear-gradient(180deg, #0f172a 0%, #0b1120 100%);
  --section-gradient-2: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --contact-bg: linear-gradient(135deg, #020617 0%, #0f172a 100%);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--duration) var(--ease);
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--secondary);
  border-radius: var(--radius-full);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  line-height: 1.2;
  transition: color var(--duration) var(--ease);
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 48px;
  transition: color var(--duration) var(--ease);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.delay-1 {
  transition-delay: 0.1s;
}

.delay-2 {
  transition-delay: 0.2s;
}

.delay-3 {
  transition-delay: 0.3s;
}

.delay-4 {
  transition-delay: 0.4s;
}

.delay-5 {
  transition-delay: 0.5s;
}

.delay-6 {
  transition-delay: 0.6s;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 32px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 4px 20px var(--secondary-glow);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.btn-ghost {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--border-strong);
}

@media (hover: hover) {
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--secondary-glow);
    filter: brightness(1.1);
  }

  .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
  }

  .btn-ghost:hover {
    border-color: var(--secondary);
    background: rgba(99, 102, 241, 0.06);
    transform: translateY(-2px);
  }
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  transition: all var(--duration) var(--ease);
}

.header.scrolled {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  z-index: 1001;
  transition: all var(--duration) var(--ease);
  line-height: 1;
}

.header.scrolled .logo {
  color: var(--primary);
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 2px 12px var(--secondary-glow);
  transition: transform var(--duration) var(--ease);
}

.logo:hover .logo-icon {
  transform: rotate(-8deg) scale(1.05);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-full);
  transition: all var(--duration) var(--ease);
  position: relative;
}

.header.scrolled .nav-link {
  color: var(--text-secondary);
}

.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.header.scrolled .nav-link.active {
  color: var(--secondary);
  background: rgba(99, 102, 241, 0.08);
}

@media (hover: hover) {
  .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
  }

  .header.scrolled .nav-link:hover {
    color: var(--secondary);
    background: rgba(99, 102, 241, 0.08);
  }
}

/* Theme Toggle */
.theme-toggle-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  transition: all var(--duration) var(--ease);
  margin-left: 8px;
}

.header.scrolled .theme-toggle-btn {
  color: var(--text-secondary);
}

@media (hover: hover) {
  .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .header.scrolled .theme-toggle-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--secondary);
  }
}

.theme-toggle-btn .fa-sun {
  display: none;
}

.theme-toggle-btn .fa-moon {
  display: inline;
}

[data-theme="dark"] .theme-toggle-btn .fa-sun {
  display: inline;
}

[data-theme="dark"] .theme-toggle-btn .fa-moon {
  display: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  color: #fff;
  z-index: 1001;
  transition: color var(--duration) var(--ease);
}

.header.scrolled .menu-toggle {
  color: var(--primary);
}

/* ============================================
   HERO SECTION — Mixed Design
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 120px 0 80px;
  background: #0a0a1a;
}

[data-theme="light"] .hero {
  background: #0e0e2c;
}

/* ---------- Background Layers ---------- */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Animated mesh gradient */
.hero-mesh {
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(ellipse at 20% 40%, rgba(99, 102, 241, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 25%, rgba(6, 182, 212, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(168, 85, 247, 0.20) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 70%, rgba(59, 130, 246, 0.15) 0%, transparent 50%);
  animation: meshRotate 25s linear infinite;
}

@keyframes meshRotate {
  0% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(180deg) scale(1.15);
  }

  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* Aurora flowing effect */
.hero-aurora {
  position: absolute;
  top: -30%;
  left: -10%;
  width: 120%;
  height: 80%;
  background: linear-gradient(120deg,
      transparent 20%,
      rgba(99, 102, 241, 0.12) 30%,
      rgba(6, 182, 212, 0.10) 40%,
      rgba(168, 85, 247, 0.08) 50%,
      transparent 60%);
  filter: blur(60px);
  animation: auroraFlow 12s ease-in-out infinite alternate;
}

@keyframes auroraFlow {
  0% {
    transform: translateX(-15%) skewX(-5deg);
    opacity: 0.6;
  }

  50% {
    transform: translateX(10%) skewX(3deg);
    opacity: 1;
  }

  100% {
    transform: translateX(-5%) skewX(-2deg);
    opacity: 0.7;
  }
}

/* Subtle grid pattern overlay */
.hero-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Floating geometric glass shapes */
.hero-shapes {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-shape {
  position: absolute;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: shapeFloat var(--float-duration, 18s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
}

@keyframes shapeFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-30px) rotate(5deg);
  }

  50% {
    transform: translateY(-15px) rotate(-3deg);
  }

  75% {
    transform: translateY(-25px) rotate(4deg);
  }
}

/* ---------- Hero Grid Layout ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  position: relative;
  z-index: 2;
}

/* ---------- Hero Text (Left) ---------- */
.hero-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 28px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  width: fit-content;
  animation: heroFadeSlideIn 0.8s var(--ease) both;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {

  0%,
  100% {
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  }

  50% {
    box-shadow: 0 0 18px rgba(52, 211, 153, 0.9), 0 0 30px rgba(52, 211, 153, 0.3);
  }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.15;
  margin-bottom: 8px;
  animation: heroFadeSlideIn 0.8s var(--ease) 0.15s both;
}

.hero-name {
  display: block;
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 25%, #06b6d4 60%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: heroFadeSlideIn 0.8s var(--ease) 0.15s both, gradientShift 6s ease-in-out infinite;
  line-height: 1.1;
  margin-top: 4px;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* Typewriter Role */
.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  color: rgba(99, 102, 241, 0.9);
  margin-top: 12px;
  margin-bottom: 4px;
  min-height: 1.6em;
  animation: heroFadeSlideIn 0.8s var(--ease) 0.3s both;
}

.hero-role::after {
  content: '|';
  animation: blink 0.8s step-end infinite;
  color: var(--accent);
  margin-left: 2px;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.hero-subtitle {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: rgba(255, 255, 255, 0.55);
  max-width: 520px;
  line-height: 1.7;
  margin: 12px 0 28px;
  animation: heroFadeSlideIn 0.8s var(--ease) 0.4s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  animation: heroFadeSlideIn 0.8s var(--ease) 0.5s both;
}

/* ---------- Bento Stat Cards ---------- */
.hero-stats {
  display: flex;
  gap: 16px;
  animation: heroFadeSlideIn 0.8s var(--ease) 0.65s both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: all 0.3s var(--ease);
  cursor: default;
}

.hero-stat:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
}

.hero-stat-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #818cf8, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ---------- Hero Visual (Right) ---------- */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: heroFadeSlideIn 1s var(--ease) 0.3s both;
}

/* Photo Wrapper */
.hero-photo-wrapper {
  position: relative;
  width: clamp(380px, 34vw, 500px);
  height: clamp(380px, 34vw, 500px);
}

/* Glow behind the photo */
.hero-photo-glow {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.30) 0%, rgba(6, 182, 212, 0.15) 40%, transparent 70%);
  filter: blur(40px);
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {

  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

/* Animated ring around photo */
.hero-photo-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
      #6366f1,
      #06b6d4,
      #34d399,
      #a855f7,
      #6366f1);
  animation: ringRotate 6s linear infinite;
  z-index: 1;
}

.hero-photo-ring::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #0a0a1a;
}

[data-theme="light"] .hero-photo-ring::after {
  background: #0e0e2c;
}

@keyframes ringRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Photo image */
.hero-photo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.6s var(--ease);
}

.hero-photo:hover img {
  transform: scale(1.08);
}

/* ---------- Floating Tech Badges ---------- */
.hero-tech-badges {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tech-badge {
  position: absolute;
  left: var(--badge-x, 0);
  top: var(--badge-y, 0);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  animation: badgeFloat 5s ease-in-out infinite;
  animation-delay: var(--badge-delay, 0s);
  opacity: 0;
  animation: heroFadeSlideIn 0.6s var(--ease) calc(0.8s + var(--badge-delay, 0s)) both,
    badgeFloat 5s ease-in-out calc(1.4s + var(--badge-delay, 0s)) infinite;
  pointer-events: auto;
  cursor: default;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}

.tech-badge:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  transform: scale(1.15);
  color: #818cf8;
}

@keyframes badgeFloat {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-12px);
  }
}

/* ---------- Hero Social Links ---------- */
.hero-social {
  position: absolute;
  right: -70px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: heroFadeSlideIn 0.8s var(--ease) 1s both;
}

.hero-social a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.05rem;
  transition: all 0.3s var(--ease);
}

.hero-social a:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #818cf8;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.2);
}

/* ---------- Animations ---------- */
@keyframes heroFadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

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

/* ============================================
   ABOUT SECTION
   ============================================ */
.about {
  background: var(--section-gradient-1);
  padding: var(--section-padding);
  transition: background var(--duration) var(--ease);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: center;
}

/* ---------- About Animation Container ---------- */
.about-anim-wrapper {
  position: relative;
}

.about-anim-wrapper::before {
  content: '';
  position: absolute;
  inset: -6px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
  border-radius: var(--radius-lg);
  opacity: 0.4;
  filter: blur(20px);
  z-index: 0;
}

.about-anim-container {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--border);
  background: #0a0a1e;
}

[data-theme="light"] .about-anim-container {
  background: var(--surface-alt);
}

/* =========================================
   ABOUT SECTION — Opening Sequence Animation
   ========================================= */

/* =========================================
   ABOUT SECTION — 3D Particle Text Container
   ========================================= */
.about-3d-animation {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  /* Add a subtle gradient background to help particles pop if needed, 
     but keeping it transparent to blend with section bg for now */
  cursor: crosshair;
  /* Hint at interactivity */
}

/* Ensure no lingering elements interfere */
.about-3d-animation canvas {
  outline: none;
  border-radius: var(--radius-lg);
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 1.02rem;
  transition: color var(--duration) var(--ease);
}

/* About Tabs */
.about-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--surface-alt);
  border-radius: var(--radius-full);
  padding: 4px;
  width: fit-content;
  border: 1px solid var(--border);
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.tab-btn {
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all var(--duration) var(--ease);
}

.tab-btn.active {
  color: #fff;
  background: var(--secondary);
  box-shadow: 0 2px 12px var(--secondary-glow);
}

.tab-btn:not(.active):hover {
  color: var(--text);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.4s var(--ease);
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

.timeline-item {
  position: relative;
  padding-left: 28px;
  margin-bottom: 22px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-strong);
  border-radius: var(--radius-full);
  transition: background var(--duration) var(--ease);
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: -5px;
  top: 8px;
  width: 12px;
  height: 12px;
  background: var(--secondary);
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--secondary);
  transition: border-color var(--duration) var(--ease);
}

.timeline-item h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
  transition: color var(--duration) var(--ease);
}

.timeline-item span {
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease);
}

/* ============================================
   SKILLS SECTION
   ============================================ */
.skills {
  background: var(--section-gradient-2);
  padding: var(--section-padding);
  transition: background var(--duration) var(--ease);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.skill-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--duration) var(--ease);
}

.skill-card:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.skill-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  transition: color var(--duration) var(--ease);
}

.skill-card-title i {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.1);
  color: var(--secondary);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.skill-item {
  margin-bottom: 18px;
}

.skill-item:last-child {
  margin-bottom: 0;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.skill-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: color var(--duration) var(--ease);
}

.skill-percent {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary);
}

.skill-bar {
  height: 6px;
  background: var(--surface-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: background var(--duration) var(--ease);
}

.skill-progress {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  border-radius: var(--radius-full);
  transition: width 1.6s var(--ease);
  position: relative;
}

.skill-progress::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmerBar 2.5s infinite;
}

@keyframes shimmerBar {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Skill Badges */
.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-badge {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: all var(--duration) var(--ease);
}

.skill-badge:hover {
  color: #fff;
  background: var(--secondary);
  border-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--secondary-glow);
}

/* ============================================
   TECHNOLOGIES SECTION
   ============================================ */
.technologies {
  background: var(--section-gradient-1);
  padding: var(--section-padding);
  transition: background var(--duration) var(--ease);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 16px;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--duration) var(--ease);
  text-align: center;
}

.tech-item:hover {
  border-color: var(--secondary);
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
}

.tech-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  transition: transform 0.4s var(--ease);
}

.tech-item:hover img {
  transform: scale(1.15) rotate(5deg);
}

.tech-item span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--duration) var(--ease);
}

.tech-item:hover span {
  color: var(--secondary);
}

/* ============================================
   METRICS SECTION
   ============================================ */
.metrics {
  background: var(--section-gradient-2);
  padding: var(--section-padding);
  transition: background var(--duration) var(--ease);
}

.metrics-header {
  text-align: center;
  margin-bottom: 48px;
}

.metrics-header .section-title {
  text-align: center;
}

.metrics-header .section-subtitle {
  margin: 0 auto;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.metric-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--secondary), transparent);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.metric-card:hover {
  transform: translateY(-6px);
  border-color: var(--secondary);
  box-shadow: var(--shadow-glow);
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1;
  margin-bottom: 12px;
}

.metric-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--duration) var(--ease);
}

/* ============================================
   PROJECTS SECTION
   ============================================ */
.projects {
  background: var(--section-gradient-1);
  padding: var(--section-padding);
  transition: background var(--duration) var(--ease);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 28px;
}

.project-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration) var(--ease);
}

@media (hover: hover) {
  .project-card:hover {
    transform: translateY(-8px);
    border-color: var(--secondary);
    box-shadow: var(--shadow-lg);
  }
}

.project-image {
  position: relative;
  height: 210px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

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

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.7) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-overlay a {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  color: #fff;
  border-radius: 50%;
  font-size: 1rem;
  transition: all var(--duration) var(--ease);
  box-shadow: 0 4px 14px var(--secondary-glow);
}

.project-overlay a:hover {
  transform: scale(1.1);
  background: var(--accent);
}

.project-body {
  padding: 24px;
}

.project-body h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  transition: color var(--duration) var(--ease);
}

.project-card:hover .project-body h3 {
  color: var(--secondary);
}

.project-body p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
  transition: color var(--duration) var(--ease);
}

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

.project-tag {
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary);
  background: rgba(99, 102, 241, 0.08);
  border-radius: var(--radius-full);
  border: 1px solid rgba(99, 102, 241, 0.15);
  transition: all var(--duration) var(--ease);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--secondary);
  transition: all var(--duration) var(--ease);
}

.project-link i {
  font-size: 0.8rem;
  transition: transform var(--duration) var(--ease);
}

.project-link:hover {
  color: var(--accent);
}

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

/* ============================================
   CERTIFICATES SECTION
   ============================================ */
.certificates {
  background: var(--section-gradient-2);
  padding: var(--section-padding);
  transition: background var(--duration) var(--ease);
}

.certificate-carousel {
  position: relative;
  padding: 0 52px;
}

.certificate-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 40px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.certificate-track::-webkit-scrollbar {
  display: none;
}

.certificate-card {
  scroll-snap-align: center;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--duration) var(--ease);
}

@media (hover: hover) {
  .certificate-card:hover {
    transform: translateY(-6px);
    border-color: var(--secondary);
    box-shadow: var(--shadow-glow);
  }
}

.certificate-card.active {
  border-color: var(--secondary);
  box-shadow: 0 12px 36px var(--secondary-glow);
  transform: translateY(-8px) scale(1.02);
}

.certificate-card figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.certificate-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  cursor: zoom-in;
}

.certificate-card figcaption {
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  text-align: center;
  transition: color var(--duration) var(--ease);
}

.certificate-card figcaption span {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 4px;
  transition: color var(--duration) var(--ease);
}

.certificate-card.active figcaption {
  color: var(--secondary);
}

/* Carousel Buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.95rem;
  box-shadow: 0 4px 18px var(--secondary-glow);
  transition: all var(--duration) var(--ease);
  z-index: 3;
}

.carousel-btn:hover {
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 24px var(--secondary-glow);
}

.carousel-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.carousel-btn[data-cert-prev] {
  left: 0;
}

.carousel-btn[data-cert-next] {
  right: 0;
}

/* Carousel Dots */
.certificate-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.certificate-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.3;
  transition: all var(--duration) var(--ease);
}

.certificate-dot.active {
  opacity: 1;
  background: var(--secondary);
  transform: scale(1.3);
}

/* Certificate Modal */
.certificate-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 2000;
}

.certificate-modal.open {
  display: flex;
}

.certificate-modal__content {
  position: relative;
  max-width: min(900px, 92vw);
  width: 100%;
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.certificate-modal__content img {
  width: 100%;
  border-radius: var(--radius-md);
  object-fit: contain;
  max-height: min(70vh, 600px);
}

.certificate-modal__caption h3 {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--primary);
  transition: color var(--duration) var(--ease);
}

.certificate-modal__caption p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
  font-size: 1rem;
  transition: all var(--duration) var(--ease);
}

.modal-close:hover {
  background: var(--secondary);
  transform: scale(1.05);
}

body.modal-open {
  overflow: hidden;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact {
  background: var(--contact-bg);
  padding: var(--section-padding);
  overflow: hidden;
  position: relative;
}

.contact::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 100%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
  z-index: 0;
}

.contact .container {
  position: relative;
  z-index: 1;
}

.contact .section-label {
  color: var(--accent);
}

.contact .section-label::before {
  background: var(--accent);
}

.contact .section-title {
  color: #fff;
}

.contact .section-subtitle {
  color: rgba(255, 255, 255, 0.55);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 50px;
  align-items: start;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.contact-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 1.1rem;
  transition: all var(--duration) var(--ease);
}

@media (hover: hover) {
  .contact-item:hover .contact-icon {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
    transform: translateY(-2px);
  }
}

.contact-item h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.contact-item p,
.contact-item a {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
  transition: color var(--duration) var(--ease);
}

.contact-item a:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.social-link {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
  transition: all var(--duration) var(--ease);
}

@media (hover: hover) {
  .social-link:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--secondary-glow);
  }
}

/* Contact Form */
.contact-form {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 36px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all var(--duration) var(--ease);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px var(--secondary-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.form-message {
  padding: 14px;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  display: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.form-message.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  display: block;
}

.form-message.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  display: block;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: #020617;
  text-align: center;
  padding: 28px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer p {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.88rem;
  margin: 0;
}

/* ============================================
   CV FLOATING BUTTON
   ============================================ */
.cv-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  color: #fff;
  border-radius: 50%;
  font-size: 1.3rem;
  box-shadow: 0 6px 24px var(--secondary-glow);
  z-index: 999;
  transition: all var(--duration) var(--ease);
  animation: fabFloat 3.5s ease-in-out infinite;
}

@media (hover: hover) {
  .cv-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 32px var(--secondary-glow);
    animation-play-state: paused;
  }
}

.cv-fab .tooltip {
  position: absolute;
  bottom: 64px;
  right: 0;
  padding: 8px 16px;
  background: var(--primary-soft);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration) var(--ease);
}

.cv-fab:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

@keyframes fabFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 96px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1rem;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--duration) var(--ease);
}

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

@media (hover: hover) {
  .scroll-top:hover {
    color: var(--secondary);
    border-color: var(--secondary);
    transform: translateY(-3px);
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
  :root {
    --section-padding: 80px 0;
    --nav-height: 64px;
  }

  /* Hide floating badges on mobile to prevent horizontal overflow and clutter */
  .hero-tech-badges {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    padding: 100px 24px 24px;
    gap: 8px;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25);
    transition: right 0.4s var(--ease);
    z-index: 1000;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-link {
    color: var(--text);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }

  .theme-toggle-btn {
    color: var(--text-secondary);
    align-self: flex-start;
    margin-left: 20px;
    margin-top: 12px;
  }

  .header.scrolled {
    background: var(--surface);
    /* More opaque on mobile for better readability */
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
    padding-top: 40px;
  }

  .hero-text {
    align-items: center;
    width: 100%;
  }

  .hero-role {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    width: 100%;
    display: block;
  }

  /* Ensure typewriter cursor doesn't cause layout shift or misalignment */
  .hero-role::after {
    display: inline-block;
  }

  .hero-title {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    width: 100%;
  }

  .hero-name {
    font-size: clamp(2.5rem, 10vw, 4.5rem);
    width: 100%;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 30px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  .hero-visual {
    order: -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Explicitly center children horizontally */
    /* Ensure no overflow from children */
    overflow: hidden;
    padding: 20px 0;
  }

  .hero-photo-wrapper {
    width: clamp(240px, 50vw, 320px);
    height: clamp(240px, 50vw, 320px);
    margin: 0 auto;
  }

  .hero-social {
    position: static;
    transform: none;
    flex-direction: row;
    justify-content: center;
    margin-top: 30px;
    gap: 20px;
    width: 100%;
  }

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

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

  .about-text p {
    margin-left: auto;
    margin-right: auto;
  }

  .about-tabs {
    margin: 0 auto 24px;
    justify-content: center;
  }

  .about-anim-wrapper {
    max-width: 400px;
    margin: 0 auto;
    /* Ensure visibility if JS fails */
    min-height: 300px;
  }

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

  .contact-item {
    justify-content: center;
  }

  .contact-item div:last-child {
    text-align: left;
  }

  .social-links {
    justify-content: center;
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
  }

  .hero-name {
    font-size: clamp(2rem, 7vw, 3rem);
  }

  .hero-photo-wrapper {
    width: 220px;
    height: 220px;
  }

  .hero-stat {
    padding: 10px 18px;
  }

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

  .tech-grid {
    grid-auto-rows: auto;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
  }

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

  .certificate-carousel {
    padding: 0 40px;
  }

  .certificate-track {
    grid-auto-columns: minmax(85%, 1fr);
  }

  .carousel-btn {
    width: 38px;
    height: 38px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 100px 0 50px;
  }

  .hero-photo-wrapper {
    width: 200px;
    height: 200px;
  }

  .hero-stat-value {
    font-size: 1.2rem;
  }

  .about-tabs {
    width: 100%;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .certificate-carousel {
    padding: 0 32px;
  }

  .certificate-track {
    grid-auto-columns: minmax(90%, 1fr);
  }

  .cv-fab {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
    bottom: 20px;
    right: 20px;
  }

  .scroll-top {
    bottom: 20px;
    right: 84px;
    width: 38px;
    height: 38px;
  }

  .metric-value {
    font-size: 2.4rem;
  }
}

/* — Mobile nav overlay — */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease);
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Animated Dev Symbol Styles */
.dev-anim-symbol {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -2px;
  padding-left: 1px;
  /* Optical centering */
  display: flex;
  justify-content: center;
  align-items: center;
}

.dev-anim-symbol .bracket {
  display: inline-block;
  color: #fff;
  transition: transform 0.3s var(--ease);
}

.dev-anim-symbol .slash {
  display: inline-block;
  color: var(--primary);
  margin: 0 1px;
  /* 60s / 72bpm = ~0.833s */
  animation: slashPulse 0.83s infinite ease-in-out;
}

@keyframes slashPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Hover Effects */
.logo:hover .dev-anim-symbol .bracket:first-child {
  transform: translateX(-2px);
}

.logo:hover .dev-anim-symbol .bracket:last-child {
  transform: translateX(2px);
}

.logo:hover .dev-anim-symbol .slash {
  animation: slashGlitch 0.4s ease forwards;
}

@keyframes slashGlitch {
  0% {
    transform: rotate(0deg);
  }

  20% {
    transform: skewX(-20deg);
  }

  40% {
    transform: skewX(20deg);
  }

  60% {
    transform: rotate(180deg);
  }

  100% {
    transform: rotate(360deg);
  }
}