/* ============================================
   Abubakkar Sajid Portfolio - Modern 2025/26
   Dark default, glassmorphism, mobile-first
   ============================================ */

/* ---------- Variables: Dark (default) ---------- */
:root,
[data-theme="dark"] {
  --bg-base: #0b0f1a;
  --bg-elevated: #111827;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-glass: rgba(17, 24, 39, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dim: rgba(99, 102, 241, 0.25);
  --gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.25s ease;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-smooth: cubic-bezier(0.33, 1, 0.68, 1);
  --reveal-duration: 0.8s;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

/* ---------- Variables: Light ---------- */
[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.06);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #4f46e5;
  --accent-light: #6366f1;
  --accent-dim: rgba(79, 70, 229, 0.15);
  --gradient-accent: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  font-size: clamp(15px, 2vw, 16px);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  overflow-x: hidden;
  position: relative;
}

/* ---------- 3D / Live Animated Background ---------- */
.bg-3d {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Animated gradient mesh (live shifting colors) */
.bg-gradient-mesh {
  position: absolute;
  inset: -100%;
  background:
    radial-gradient(ellipse 80% 80% at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 60% at 80% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 50% 80%, rgba(14, 165, 233, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 70% 70% at 80% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
  animation: bg-mesh-shift 15s ease-in-out infinite;
}

@keyframes bg-mesh-shift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(2%, 2%) scale(1.02); }
  50% { transform: translate(-1%, 3%) scale(0.98); }
  75% { transform: translate(3%, -2%) scale(1.01); }
}

/* 3D perspective grid */
.bg-3d-grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  transform: perspective(500px) rotateX(55deg) translateY(15%);
  transform-origin: center top;
  animation: bg-grid-drift 25s linear infinite;
}

.bg-3d-grid-2 {
  background-size: 80px 80px;
  opacity: 0.6;
  animation: bg-grid-drift-2 35s linear infinite reverse;
}

[data-theme="light"] .bg-3d-grid {
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
}

@keyframes bg-grid-drift {
  0% { transform: perspective(500px) rotateX(55deg) translateY(15%) translateZ(0); }
  100% { transform: perspective(500px) rotateX(55deg) translateY(15%) translateZ(-80px); }
}

@keyframes bg-grid-drift-2 {
  0% { transform: perspective(500px) rotateX(55deg) translateY(15%) translateZ(0); }
  100% { transform: perspective(500px) rotateX(55deg) translateY(15%) translateZ(-100px); }
}

/* Floating gradient orbs (more lively) */
.bg-3d-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: bg-orb-float 12s ease-in-out infinite;
}

.bg-3d-orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 65%);
  top: -15%;
  left: -8%;
  animation-delay: 0s;
  animation-duration: 14s;
}

.bg-3d-orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35) 0%, transparent 65%);
  top: 35%;
  right: -10%;
  animation-delay: -2s;
  animation-duration: 16s;
}

.bg-3d-orb-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 65%);
  bottom: -8%;
  left: 25%;
  animation-delay: -4s;
  animation-duration: 13s;
}

.bg-3d-orb-4 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, transparent 65%);
  top: 55%;
  left: -5%;
  animation-delay: -6s;
  animation-duration: 15s;
}

.bg-3d-orb-5 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, transparent 65%);
  top: 20%;
  right: 30%;
  animation-delay: -8s;
  animation-duration: 11s;
}

@keyframes bg-orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  25% { transform: translate(40px, -30px) scale(1.08); opacity: 0.6; }
  50% { transform: translate(-35px, 40px) scale(0.95); opacity: 0.45; }
  75% { transform: translate(25px, 30px) scale(1.03); opacity: 0.55; }
}

/* 3D spheres */
.bg-3d-sphere {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.25), transparent);
  animation: bg-sphere-float 18s ease-in-out infinite;
}

.bg-3d-sphere-1 {
  width: 100px;
  height: 100px;
  top: 18%;
  right: 22%;
  animation-delay: 0s;
  animation-duration: 20s;
}

.bg-3d-sphere-2 {
  width: 70px;
  height: 70px;
  bottom: 28%;
  left: 18%;
  animation-delay: -5s;
  animation-duration: 22s;
}

.bg-3d-sphere-3 {
  width: 50px;
  height: 50px;
  top: 65%;
  right: 38%;
  animation-delay: -10s;
  animation-duration: 16s;
}

@keyframes bg-sphere-float {
  0%, 100% { transform: translate(0, 0) rotateY(0deg) scale(1); }
  33% { transform: translate(25px, -35px) rotateY(120deg) scale(1.05); }
  66% { transform: translate(-30px, 20px) rotateY(240deg) scale(0.98); }
}

/* Rotating cube */
.bg-3d-cube {
  position: absolute;
  width: 90px;
  height: 90px;
  top: 22%;
  left: 12%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.15);
  transform: perspective(800px) rotateX(12deg) rotateY(20deg);
  animation: bg-cube-spin 30s linear infinite;
}

@keyframes bg-cube-spin {
  0% { transform: perspective(800px) rotateX(12deg) rotateY(0deg); }
  100% { transform: perspective(800px) rotateX(12deg) rotateY(360deg); }
}

/* 2D floating particles */
.bg-particles {
  position: absolute;
  inset: 0;
}

.bg-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(99, 102, 241, 0.5);
  border-radius: 50%;
  animation: bg-particle-float 8s ease-in-out infinite;
}

.bg-particle:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; animation-duration: 10s; }
.bg-particle:nth-child(2) { top: 25%; left: 85%; animation-delay: -1s; animation-duration: 12s; }
.bg-particle:nth-child(3) { top: 45%; left: 10%; animation-delay: -2s; animation-duration: 9s; }
.bg-particle:nth-child(4) { top: 60%; left: 75%; animation-delay: -3s; animation-duration: 11s; }
.bg-particle:nth-child(5) { top: 80%; left: 25%; animation-delay: -4s; animation-duration: 8s; }
.bg-particle:nth-child(6) { top: 15%; left: 55%; animation-delay: -5s; animation-duration: 13s; }
.bg-particle:nth-child(7) { top: 70%; left: 50%; animation-delay: -6s; animation-duration: 7s; }
.bg-particle:nth-child(8) { top: 35%; left: 40%; animation-delay: -7s; animation-duration: 10s; }
.bg-particle:nth-child(9) { top: 55%; left: 90%; animation-delay: -8s; animation-duration: 9s; }
.bg-particle:nth-child(10) { top: 5%; left: 70%; animation-delay: -9s; animation-duration: 14s; }
.bg-particle:nth-child(11) { top: 90%; left: 60%; animation-delay: -10s; animation-duration: 8s; }
.bg-particle:nth-child(12) { top: 40%; left: 5%; animation-delay: -11s; animation-duration: 11s; }

@keyframes bg-particle-float {
  0%, 100% { transform: translate(0, 0); opacity: 0.5; }
  25% { transform: translate(15px, -20px); opacity: 0.8; }
  50% { transform: translate(-10px, 15px); opacity: 0.6; }
  75% { transform: translate(20px, 10px); opacity: 0.9; }
}

/* Animated connecting lines (2D network feel) */
.bg-lines {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 80px,
      rgba(99, 102, 241, 0.03) 80px,
      rgba(99, 102, 241, 0.03) 81px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 80px,
      rgba(99, 102, 241, 0.03) 80px,
      rgba(99, 102, 241, 0.03) 81px
    );
  animation: bg-lines-move 20s linear infinite;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 70%);
}

@keyframes bg-lines-move {
  0% { transform: translate(0, 0); }
  100% { transform: translate(80px, 80px); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-gradient-mesh,
  .bg-3d-grid,
  .bg-3d-orb,
  .bg-3d-sphere,
  .bg-3d-cube,
  .bg-particle,
  .bg-lines { animation: none; }
  .hero-badge { animation: none; }
  .section-title span { animation: none; }
  .whatsapp-float { animation: none; }
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

/* Scroll progress bar (smooth fill on scroll) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-accent);
  z-index: 1001;
  transition: width 0.12s var(--ease-out-smooth);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 768px) {
  .container { padding: 0 2rem; }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover { opacity: 0.85; }

img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-dim);
}
.btn-primary:hover {
  box-shadow: 0 6px 24px var(--accent-dim), 0 0 50px rgba(99, 102, 241, 0.25);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
}
.btn-secondary:hover { border-color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--accent-light); }

.btn-nav {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: var(--gradient-accent);
  color: #fff;
  border-radius: var(--radius);
}
.btn-block { width: 100%; }

.btn.loading .btn-text { display: none; }
.btn.loading .btn-loading { display: inline; }
.btn .btn-loading { display: none; }

/* ---------- Header / Nav ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.75rem 0;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  transition: padding var(--transition), box-shadow var(--transition);
}

.header.scrolled { box-shadow: var(--shadow-md); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-links {
  display: none;
  list-style: none;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
    align-items: center;
  }
}

.nav-link {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius);
}
.nav-link:hover,
.nav-link.active { color: var(--accent-light); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme toggle */
.theme-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); }

.theme-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: transform var(--transition), opacity var(--transition);
}
.theme-icon.sun { opacity: 0; }
.theme-icon.moon { opacity: 1; }

[data-theme="light"] .theme-icon.sun { opacity: 1; }
[data-theme="light"] .theme-icon.moon { opacity: 0; }

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition);
}
@media (min-width: 768px) { .hamburger { display: none; } }

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
@media (max-width: 767px) {
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    padding: 1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open .nav-link { padding: 0.75rem 1rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 0 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-dim), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(139, 92, 246, 0.1), transparent),
    radial-gradient(ellipse 40% 30% at 0% 80%, rgba(99, 102, 241, 0.08), transparent);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  transition: transform 0.2s var(--ease-out-smooth);
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-light);
  background: var(--accent-dim);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  margin-bottom: 0.5rem;
  backdrop-filter: blur(8px);
  animation: hero-badge-glow 3s ease-in-out infinite;
}

.hero-focus {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
  font-weight: 500;
}
@keyframes hero-badge-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.25); }
}

.hero-title {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.hero-greeting {
  display: block;
  color: var(--text-secondary);
  font-weight: 500;
}

.typing-wrap {
  display: inline-block;
  color: var(--text-primary);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.caret {
  -webkit-text-fill-color: initial;
  color: var(--accent-light);
  animation: blink 0.8s step-end infinite;
}

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

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 2rem;
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 40px;
  border: 2px solid var(--text-muted);
  border-radius: 12px;
  animation: scrollHint 2s ease-in-out infinite;
}
.scroll-hint::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
}

@keyframes scrollHint {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(8px); }
}

/* ---------- Sections ---------- */
.section {
  padding: 4.5rem 0;
}

@media (min-width: 768px) {
  .section { padding: 6rem 0; }
}

.section-head {
  text-align: center;
  margin-bottom: 2.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.section-title span {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: section-title-shimmer 5s ease-in-out infinite;
}
@keyframes section-title-shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Reveal (smooth scroll-triggered animations) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--reveal-duration) var(--ease-out-expo), transform var(--reveal-duration) var(--ease-out-expo);
  transition-delay: 0ms;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays applied via JS from data-delay; fallback for no-JS */
.reveal[data-delay="0"].visible { transition-delay: 0ms; }
.reveal[data-delay="50"].visible { transition-delay: 50ms; }
.reveal[data-delay="100"].visible { transition-delay: 100ms; }
.reveal[data-delay="150"].visible { transition-delay: 150ms; }
.reveal[data-delay="200"].visible { transition-delay: 200ms; }
.reveal[data-delay="250"].visible { transition-delay: 250ms; }
.reveal[data-delay="300"].visible { transition-delay: 300ms; }
.reveal[data-delay="350"].visible { transition-delay: 350ms; }
.reveal[data-delay="400"].visible { transition-delay: 400ms; }
.reveal[data-delay="600"].visible { transition-delay: 600ms; }

/* Article pages: show body immediately (no scroll-reveal dependency) */
.article-page .article-body.reveal,
.article-page .article-header.reveal,
.article-page .article-footer.reveal {
  opacity: 1;
  transform: none;
}

/* Reveal from left */
.reveal.reveal-left {
  transform: translateX(-48px);
  transition: opacity var(--reveal-duration) var(--ease-out-expo), transform var(--reveal-duration) var(--ease-out-expo);
}
.reveal.reveal-left.visible {
  transform: translateX(0);
  opacity: 1;
}

/* Reveal from right */
.reveal.reveal-right {
  transform: translateX(48px);
  transition: opacity var(--reveal-duration) var(--ease-out-expo), transform var(--reveal-duration) var(--ease-out-expo);
}
.reveal.reveal-right.visible {
  transform: translateX(0);
  opacity: 1;
}

/* Reveal scale-up */
.reveal.reveal-scale {
  transform: scale(0.96);
  transition: opacity var(--reveal-duration) var(--ease-out-expo), transform var(--reveal-duration) var(--ease-out-expo);
}
.reveal.reveal-scale.visible {
  transform: scale(1);
  opacity: 1;
}

/* Section scroll-in: subtle fade + slide for section content (not heads, to avoid double animation) */
.section.scroll-in .about-grid,
.section.scroll-in .skills-grid,
.section.scroll-in .projects-grid,
.section.scroll-in .services-wrap,
.section.scroll-in .timeline,
.section.scroll-in .reviews-wrap,
.section.scroll-in .contact-grid {
  animation: section-in 0.6s var(--ease-out-expo) forwards;
}

/* Stagger delay for project cards */
.projects-grid .project-card:nth-child(1) { transition-delay: 0s; }
.projects-grid .project-card:nth-child(2) { transition-delay: 0.08s; }
.projects-grid .project-card:nth-child(3) { transition-delay: 0.16s; }
.projects-grid .project-card:nth-child(4) { transition-delay: 0.24s; }
.projects-grid .project-card:nth-child(5) { transition-delay: 0.32s; }
.projects-grid .project-card:nth-child(6) { transition-delay: 0.4s; }
.projects-grid .project-card:nth-child(7) { transition-delay: 0.48s; }
.projects-grid .project-card:nth-child(8) { transition-delay: 0.56s; }
.projects-grid .project-card:nth-child(9) { transition-delay: 0.64s; }

/* Review marquee stagger removed - using track animation */

/* ---------- About ---------- */
.about-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .about-grid { grid-template-columns: 1fr 1.2fr; gap: 3rem; }
}

.about-image-wrap {
  position: relative;
  max-width: 320px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.about-image-wrap:hover {
  transform: perspective(800px) rotateY(-5deg) rotateX(3deg) scale(1.02);
  box-shadow: var(--shadow-lg), 0 25px 50px -15px rgba(99, 102, 241, 0.25);
}
.about-image-wrap::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-accent);
  border-radius: inherit;
  z-index: -1;
  opacity: 0.5;
}

.about-content h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.about-meta {
  list-style: none;
  margin: 1.5rem 0;
  display: grid;
  gap: 0.5rem;
}

.about-meta li {
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.about-meta a { color: var(--accent-light); }

.about-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.about-terminal {
  margin-top: 1.75rem;
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.35), transparent 55%) var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.about-terminal-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.about-terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4b5563;
}
.about-terminal-dot.dot-red { background: #ef4444; }
.about-terminal-dot.dot-yellow { background: #facc15; }
.about-terminal-dot.dot-green { background: #22c55e; }

.about-terminal-title {
  margin-left: auto;
  font-size: 0.7rem;
  color: #94a3b8;
}

.about-terminal-body {
  padding: 0.85rem 1rem 1rem;
  font-size: 0.8rem;
  color: #e5e7eb;
}

.about-terminal-line {
  display: block;
  margin-bottom: 0.25rem;
  white-space: normal;
  word-break: break-word;
}

.about-terminal-prompt {
  color: #22c55e;
}

.about-terminal-command {
  color: #e5e7eb;
}

.about-terminal-output {
  padding-left: 1.35rem;
  color: #a5b4fc;
}

.about-terminal-meta {
  padding-left: 1.35rem;
  color: #64748b;
  margin-top: 0.35rem;
  font-style: italic;
}

.about-terminal-line:last-child {
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .about-terminal-body {
    font-size: 0.78rem;
    padding: 0.75rem 0.8rem 0.9rem;
  }
}

.about-page .section-head { margin-bottom: 2.5rem; }

.about-extra {
  margin-top: 4rem;
  display: grid;
  gap: 2rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.about-block {
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.about-block h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.about-block p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.about-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.about-tags li {
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
  background: var(--accent-dim);
  color: var(--accent-light);
  border-radius: 999px;
  border: 1px solid var(--glass-border);
}

.about-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.about-list li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

/* Standalone pages: clear fixed header */
.about-page.section,
.contact-page.section,
.skills-page.section,
.projects-page.section,
.services-page.section,
.experience-page.section,
.blog-page.section {
  padding-top: 6rem;
}

/* ---------- Blog ---------- */
.blog-page .section-head {
  margin-bottom: 2.75rem;
}

.blog-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}

@media (min-width: 992px) {
  .blog-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color var(--transition), box-shadow var(--transition);
}

.blog-card-link {
  display: block;
  padding: 2rem 1.75rem;
  color: inherit;
  text-decoration: none;
  position: relative;
}

.blog-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-dim);
  box-shadow: var(--shadow-md), 0 12px 32px -8px rgba(99, 102, 241, 0.15);
}

.blog-card-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.5rem;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 4px;
}

.blog-card-read-time {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  margin-bottom: 0.5rem;
}

.blog-card h2 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  line-height: 1.4;
  color: var(--text-primary);
  font-weight: 600;
}

.blog-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.blog-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--accent-light);
  font-weight: 500;
}

.blog-card-meta-icon {
  font-size: 0.95em;
  opacity: 0.9;
}

.blog-card-link:hover .blog-card-meta { text-decoration: underline; }

.blog-card-coming {
  opacity: 0.85;
}

.blog-card-coming .blog-card-label { opacity: 0.8; }

/* Article page (read view) – ready/read-form styling */
.container-narrow {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.article-page {
  padding-top: 6rem;
  padding-bottom: 4rem;
}

/* Article pages: clean background (no 3D) – reading-optimized */
body.page-article-read .bg-3d {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
body.page-article-read {
  background: linear-gradient(180deg, #0f1320 0%, #0b0f1a 100%);
}
[data-theme="light"] body.page-article-read {
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
}

.article-read-form .article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--glass-border);
}

.article-body-read,
.article-page .article-body {
  font-size: 1.0625rem;
  line-height: 1.85;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.article-body-read p,
.article-page .article-body p {
  margin-bottom: 1.25rem;
}

.article-body-read h2,
.article-page .article-body h2 {
  font-size: 1.35rem;
  margin: 2.25rem 0 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
  padding-bottom: 0.25rem;
}

.article-body-read h3,
.article-page .article-body h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.6rem;
  color: var(--text-primary);
  font-weight: 600;
}

.article-page .article-body {
  padding: 0.5rem 0;
}

.article-read-form .article-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
}

.article-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.article-breadcrumb a { color: var(--accent-light); }
.article-breadcrumb a:hover { text-decoration: underline; }
.article-breadcrumb span:not([aria-hidden]) { color: var(--text-muted); }

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--glass-border);
}

.article-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
}

.article-meta {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent-light);
  font-weight: 500;
}

.article-read-time {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-read-time::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
}

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 1rem;
  line-height: 1.25;
  color: var(--text-primary);
}

.article-excerpt {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.article-author {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.article-author a { color: var(--accent-light); }

.article-body {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.article-body h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  color: var(--text-primary);
}

.article-body h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.article-body p { margin-bottom: 1rem; }

.article-body ul,
.article-body ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }

.article-body li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.article-body code {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
  padding: 0.15rem 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
}

.article-body a { color: var(--accent-light); }
.article-body a:hover { text-decoration: underline; }

.article-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article-table th,
.article-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.article-table th {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
}

.article-table tbody tr:last-child td { border-bottom: none; }

.article-table tbody tr:hover td { background: var(--bg-elevated); }

.article-table tbody tr.highlight td { color: var(--accent-light); font-weight: 600; }

/* Article pull-quote / highlight box */
.article-pull-quote {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-dim);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.6;
}

/* Article card grid */
.article-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.article-card {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.article-card-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.article-card h4 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--text-primary); }
.article-card p { font-size: 0.9rem; color: var(--text-muted); margin: 0; line-height: 1.55; }

/* Article skill/check list */
.article-skill-list { list-style: none; padding: 0; margin: 1rem 0; }
.article-skill-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.article-skill-list li::before {
  content: "✓";
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

/* Article numbered steps */
.article-steps { counter-reset: step; padding: 0; margin: 1.5rem 0; list-style: none; }
.article-steps li {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}
.article-steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: var(--bg-elevated);
  color: var(--accent-light);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.article-steps li div h4 { margin: 0 0 0.25rem; }
.article-steps li div p { margin: 0; font-size: 0.95rem; }

/* Article trend badge */
.article-trend-badge {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent-light);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.article-trend-badge.hot { background: rgba(220, 38, 38, 0.2); color: #f87171; }
.article-trend-badge.new { background: rgba(5, 150, 105, 0.2); color: #34d399; }

/* Article callout */
.article-callout {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.6;
  border: 1px solid var(--glass-border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.article-callout.blue { border-color: rgba(99, 102, 241, 0.3); background: var(--accent-dim); color: var(--text-primary); }
.article-callout.green { border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.08); color: var(--text-primary); }
.article-callout-icon { font-size: 1.35rem; flex-shrink: 0; }

/* Article FAQ (details/summary) */
.article-body details {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.article-body summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.article-body summary::after { content: "+"; font-size: 1.25rem; color: var(--accent-light); }
.article-body details[open] summary::after { content: "−"; }
.article-body details[open] summary { color: var(--accent-light); }
.article-body .faq-answer { padding: 0 1.25rem 1rem; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }

/* Article TOC */
.article-toc {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.article-toc h2 { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0; border: none; }
.article-toc ol { padding-left: 1.25rem; margin: 0; }
.article-toc li { margin-bottom: 0.4rem; }
.article-toc a { color: var(--accent-light); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.article-toc a:hover { text-decoration: underline; }

.article-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 480px) {
  .article-footer { flex-direction: column; }
  .article-card-grid { grid-template-columns: 1fr; }
}

/* ---------- Skills & Expertise (card blocks + icons) ---------- */
.skills .section-desc {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto 1.5rem;
}

@media (min-width: 640px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 992px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Skill card block */
.skill-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  min-width: 0;
  transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s ease, border-color 0.35s ease;
  transform-style: preserve-3d;
}

.skill-card:hover {
  border-color: var(--accent-dim);
  box-shadow: var(--shadow-md), 0 12px 32px -8px rgba(99, 102, 241, 0.2);
  transform: translateY(-6px) scale(1.02);
}

@media (prefers-reduced-motion: reduce) {
  .skill-card:hover {
    transform: none;
  }
  .skill-card:hover .skill-card-icon {
    transform: none;
  }
}

.skill-card.visible .skill-card-icon {
  transform: scale(1);
  opacity: 1;
}

.skill-card-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--accent-light);
  transform: scale(0.85);
  opacity: 0.9;
  transition: transform 0.4s var(--ease-out-expo), opacity 0.4s ease, background 0.3s ease, color 0.3s ease;
}

.skill-card:hover .skill-card-icon {
  background: var(--gradient-accent);
  color: #fff;
  transform: scale(1.08) rotate(-5deg);
}

.skill-card-icon svg {
  width: 26px;
  height: 26px;
}

.skill-card-body {
  flex: 1;
  min-width: 0;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.skill-card .skill-name {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
}

.skill-tags {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.skill-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  min-width: 0;
  flex: 1 1 auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.skill-pct {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-light);
  flex-shrink: 0;
  min-width: 2.5rem;
  text-align: right;
}

.skill-track {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.skill-fill {
  height: 100%;
  width: 0;
  max-width: 100%;
  background: var(--gradient-accent);
  border-radius: 999px;
  transition: width 1s var(--ease-out-expo);
  box-shadow: 0 0 12px var(--accent-dim);
}

.skill-item.visible .skill-fill,
.skill-card.visible .skill-fill {
  width: var(--fill-width, 0);
}

/* Legacy .skill-item (e.g. skills page) */
.skill-item {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-width: 0;
  width: 100%;
}

.skill-item:hover {
  border-color: var(--accent-dim);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.skills-grid-page {
  max-width: 720px;
  grid-template-columns: 1fr;
}

.skills-note {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---------- Projects ---------- */
.projects-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.filter-btn:hover,
.filter-btn.active {
  color: var(--accent-light);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.projects-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
  .projects-grid { grid-template-columns: repeat(3, 1fr); }
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.35s ease, border-color 0.35s ease;
}
.project-card:hover {
  transform: perspective(1000px) rotateX(-4deg) rotateY(4deg) translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 20px 40px -15px rgba(99, 102, 241, 0.2);
  border-color: var(--accent-dim);
}

.project-card.hide {
  display: none;
  opacity: 0;
  transform: scale(0.94) translateY(10px);
}

.project-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.project-card:hover .project-card-image img { transform: scale(1.08); }

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.85) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.project-card:hover .project-card-overlay { opacity: 1; }

.project-link {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius);
  transition: transform 0.25s ease, background 0.25s ease;
}
.project-link:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}

.project-card-body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.project-card-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Category badge on image */
.project-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.project-card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.85);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  transition: background 0.25s ease;
}

.project-card-badge--fullstack {
  background: rgba(139, 92, 246, 0.85);
}

.project-card-badge--mobile {
  background: rgba(14, 165, 233, 0.85);
}

.project-card-badge--frontend {
  background: rgba(16, 185, 129, 0.85);
}

/* Tech tags row */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.project-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-light);
  background: var(--accent-dim);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.project-card:hover .project-tag {
  background: rgba(99, 102, 241, 0.2);
}

/* Ghost (secondary) link in overlay */
.project-link-ghost {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

.project-link-ghost:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}

/* Make project card a flex column so body fills */
.project-card {
  display: flex;
  flex-direction: column;
}

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 7 services: one per row on mobile, 2 then 3 columns */
.services-grid-rows {
  grid-template-columns: 1fr;
  max-width: 900px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .services-grid-rows { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
  .services-grid-rows { grid-template-columns: repeat(3, 1fr); max-width: 1100px; }
}

/* Services marquee: one row, right-to-left scroll */
.services-wrap {
  overflow: hidden;
  margin: 0 -1.25rem;
  padding: 0.5rem 0;
  touch-action: pan-y;
}

@media (min-width: 768px) {
  .services-wrap { margin: 0 -2rem; }
}

.services-track {
  display: flex;
  width: max-content;
  animation: services-scroll-right-to-left 45s linear infinite;
}

.services-wrap:hover .services-track {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .services-track { animation: none; }
  .services-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@keyframes services-scroll-right-to-left {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.services-row {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  padding: 0 1.25rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .services-row { padding: 0 2rem; gap: 1.5rem; }
}

.services-wrap .service-card {
  flex-shrink: 0;
  width: 280px;
  min-width: 280px;
  max-width: 280px;
}

@media (max-width: 400px) {
  .services-wrap .service-card { width: 260px; min-width: 260px; max-width: 260px; padding: 1.5rem 1.25rem; }
}

.service-card {
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease, border-color 0.3s ease;
}
.service-card:hover {
  transform: perspective(800px) rotateX(-3deg) rotateY(3deg) translateY(-4px);
  border-color: var(--accent-dim);
  box-shadow: var(--shadow-md);
}

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-light);
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.service-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Experience / Timeline ---------- */
.timeline {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--glass-border);
  border-radius: 1px;
}

@media (min-width: 640px) {
  .timeline::before { left: 50%; transform: translateX(-1px); }
}

.timeline-item {
  position: relative;
  padding-left: 2.5rem;
  padding-bottom: 2rem;
}

.timeline-item:last-child { padding-bottom: 0; }

@media (min-width: 640px) {
  .timeline-item {
    padding-left: 0;
    padding-bottom: 2.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
  }
  .timeline-item:nth-child(odd) .timeline-content { grid-column: 2; text-align: left; }
  .timeline-item:nth-child(odd) .timeline-marker { left: calc(50% - 6px); }
  .timeline-item:nth-child(even) .timeline-content { grid-column: 1; grid-row: 1; text-align: right; }
  .timeline-item:nth-child(even) .timeline-marker { left: calc(50% - 6px); }
}

.timeline-marker {
  position: absolute;
  left: 4px;
  top: 0.25rem;
  width: 14px;
  height: 14px;
  background: var(--gradient-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg-base);
  z-index: 1;
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
}

.timeline-date {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 0.25rem;
}

.timeline-company {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.timeline-company-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 0.35rem;
  object-fit: contain;
}

.timeline-location {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.timeline-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-content a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.timeline-content a:hover { opacity: 0.9; }

.timeline-list {
  list-style: none;
  margin-top: 0.75rem;
  padding-left: 0;
}

.timeline-list li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  padding-left: 1.25rem;
  margin-bottom: 0.35rem;
  position: relative;
}

.timeline-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  background: var(--accent-light);
  border-radius: 50%;
}

/* ---------- Client Reviews (one row, left-to-right marquee) ---------- */
.reviews-wrap {
  overflow: hidden;
  margin: 0 -1.25rem;
  padding: 0.5rem 0;
  touch-action: pan-y;
}

@media (min-width: 768px) {
  .reviews-wrap { margin: 0 -2rem; }
}

.reviews-track {
  display: flex;
  width: max-content;
  animation: reviews-scroll-left-to-right 50s linear infinite;
}

.reviews-wrap:hover .reviews-track {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .reviews-track { animation: none; }
  .reviews-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@keyframes reviews-scroll-left-to-right {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.reviews-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1.5rem;
  padding: 0 1.25rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .reviews-row { padding: 0 2rem; gap: 1.75rem; }
}

.review-card {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  min-height: 260px;
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

@media (max-width: 400px) {
  .review-card { width: 280px; min-width: 280px; max-width: 280px; min-height: 240px; padding: 1.5rem 1.25rem; }
}

.review-card {
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease, border-color 0.3s ease;
}
.review-card:hover {
  transform: perspective(800px) rotateX(-3deg) rotateY(3deg) translateY(-4px);
  border-color: var(--accent-dim);
  box-shadow: var(--shadow-md);
}

.review-stars {
  display: flex;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  color: #fbbf24;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.review-quote {
  flex: 1;
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  border: none;
  padding: 0;
  min-height: 5.5em;
}

.review-quote p {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.review-author-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.review-author-info strong {
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-author-info span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-height: 1.2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .contact-grid { grid-template-columns: 1fr 1.2fr; align-items: start; }
}

.contact-info p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.contact-details {
  list-style: none;
  margin-bottom: 1.5rem;
}

.contact-details li {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.contact-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.contact-details a { color: var(--accent-light); }

.contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.contact-social a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: color var(--transition), border-color var(--transition);
}
.contact-social a:hover {
  color: var(--accent-light);
  border-color: var(--accent);
}

/* Contact form */
.contact-form {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input.invalid,
.form-group textarea.invalid { border-color: #ef4444; }

.form-error {
  display: block;
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 0.3rem;
}

.form-result {
  margin-top: 1rem;
  font-size: 0.95rem;
  min-height: 1.5rem;
}
.form-result.success { color: #22c55e; }
.form-result.error { color: #ef4444; }

.hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ---------- Footer ---------- */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--glass-border);
  background: var(--bg-elevated);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.footer-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}
.footer-nav a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-nav a:hover { color: var(--accent-light); }

.footer-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
}
.footer-social a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-social a:hover { color: var(--accent-light); }

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

/* ---------- WhatsApp float (icon button) ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  z-index: 999;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease, background 0.3s ease;
  animation: whatsapp-pulse 2.5s ease-in-out infinite;
}
.whatsapp-float svg {
  flex-shrink: 0;
}
.whatsapp-float:hover {
  transform: scale(1.12) translateY(-3px);
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5), 0 0 0 8px rgba(37, 211, 102, 0.15);
  background: linear-gradient(135deg, #34e077 0%, #25d366 100%);
}
.whatsapp-float:active {
  transform: scale(1.05) translateY(-1px);
}
@keyframes whatsapp-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 4px 24px rgba(37, 211, 102, 0.5); }
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 998;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  border-color: var(--accent);
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 6px 20px var(--accent-dim);
}

@media (max-width: 480px) {
  .whatsapp-float { bottom: 4.5rem; right: 1rem; }
  .back-to-top { bottom: 1rem; right: 1rem; }
}

/* ---------- Full responsive: all devices ---------- */
/* Extra small phones (320px - 400px) */
@media (max-width: 400px) {
  .container { padding: 0 1rem; }
  .section { padding: 3rem 0; }
  .skill-item { padding: 0.85rem 1rem; }
  .skill-name { font-size: 0.875rem; }
  .skill-card .skill-name { font-size: 0.95rem; }
  .skill-card { padding: 1.25rem; gap: 1rem; }
  .skill-card-icon { width: 44px; height: 44px; }
  .skill-card-icon svg { width: 22px; height: 22px; }
  .skill-pct { font-size: 0.85rem; }
  .hero-title { font-size: 1.85rem; }
  .hero-focus { font-size: 0.8rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; min-height: 44px; }
  .btn { padding: 0.65rem 1.25rem; font-size: 0.9rem; }
  .section-title { font-size: 1.5rem; }
  .footer-nav { gap: 0.4rem 0.75rem; }
  .footer-nav a { font-size: 0.85rem; }
  .contact-form { padding: 1.25rem; }
  .about-tags { gap: 0.4rem; }
  .about-tags li { font-size: 0.8rem; padding: 0.35rem 0.7rem; }
}

/* Small phones & portrait (up to 480px) */
@media (max-width: 480px) {
  html { scroll-padding-top: 70px; }
  .section { padding: 3.5rem 0; }
  .section-head { margin-bottom: 1.75rem; }
  .review-card { padding: 1.25rem 1rem; width: 280px; min-width: 280px; max-width: 280px; min-height: 220px; }
  .review-quote { font-size: 0.9rem; min-height: 4.5em; }
  .review-quote p { -webkit-line-clamp: 5; }
  .review-avatar { width: 40px; height: 40px; }
  .review-author-info strong { font-size: 0.9rem; }
  .project-card:hover { transform: translateY(-4px); }
  .project-card-body { padding: 1rem 1rem 1.25rem; gap: 0.4rem; }
  .project-card-body h3 { font-size: 1rem; }
  .project-desc { font-size: 0.82rem; -webkit-line-clamp: 2; line-clamp: 2; }
  .project-tag { font-size: 0.68rem; }
  .project-card-badge { font-size: 0.65rem; padding: 0.2rem 0.5rem; }
  .service-card { padding: 1.5rem 1rem; }
  .timeline-content { padding: 1rem; }
  .about-block { padding: 1.5rem 1rem; }
  .about-cta { flex-direction: column; }
  .about-cta .btn { width: 100%; }
  .filter-btn { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
}

/* Tablet portrait & large phones (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .skills-grid { max-width: 100%; }
  .about-grid { gap: 2rem; }
}

/* Landscape phones & very small tablets - prevent overflow */
@media (max-width: 640px) {
  body { overflow-x: hidden; }
  .nav-links.open { max-height: 85vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .filter-btn { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
  .projects-grid { gap: 1.25rem; }
}

/* Tablet: ensure projects grid looks good */
@media (min-width: 641px) and (max-width: 991px) {
  .projects-grid { gap: 1.5rem; }
}

/* Touch targets: minimum 44px for interactive elements */
@media (pointer: coarse) {
  .nav-link { min-height: 44px; display: inline-flex; align-items: center; }
  .filter-btn { min-height: 44px; min-width: 44px; }
  .btn { min-height: 44px; }
  .theme-toggle { min-width: 44px; min-height: 44px; }
  .hamburger { min-width: 44px; min-height: 44px; }
}
