/* ============================================
   VISUALYNK 2.0 — Premium Freelance Portfolio
   Design System & Styles
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap");

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.15);

  --accent: #3366CC;
  --accent-light: #4ECDC4;
  --accent-glow: rgba(51, 102, 204, 0.3);
  --accent-gradient: linear-gradient(135deg, #3366CC, #4A9ECC, #4ECDC4);
  --accent-gradient-hover: linear-gradient(135deg, #2B57B0, #3D8AB5, #3FBDB5);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);

  /* Typography */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: "Space Grotesk", "Inter", sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.5rem;
  --fs-4xl: 3.5rem;
  --fs-5xl: 4.5rem;

  /* Spacing */
  --section-padding: 120px 0;
  --container-width: 1200px;
  --container-padding: 0 24px;

  /* Effects */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px var(--accent-glow);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: all 0.25s ease;
  --blur-glass: blur(12px);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  list-style: none;
}

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--container-padding);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 16px;
}

.section-label::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--fs-4xl);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.1s;
}
.reveal-delay-2 {
  transition-delay: 0.2s;
}
.reveal-delay-3 {
  transition-delay: 0.3s;
}
.reveal-delay-4 {
  transition-delay: 0.4s;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 20px 0;
  transition: var(--transition);
}

.navbar.scrolled {
  padding: 12px 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border-bottom: 1px solid var(--border-glass);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-logo span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-logo-img {
  height: 36px;
  width: auto;
  display: block;
  transition: var(--transition);
}

.navbar.scrolled .nav-logo-img {
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  padding: 10px 24px !important;
  background: var(--accent-gradient) !important;
  border-radius: var(--radius-full) !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  font-size: var(--fs-sm) !important;
  transition: var(--transition) !important;
  box-shadow: 0 2px 16px var(--accent-glow);
}

.nav-cta::after {
  display: none !important;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO SECTION — Centered Cinematic
   ============================================ */
.hero {
  min-height: 100vh;
  padding: 160px 0 80px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Subtle dot grid background */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(51, 102, 204, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  opacity: 0.5;
}

/* Animated glow orbs */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
}

.hero-glow-1 {
  top: 10%;
  left: 15%;
  width: 500px;
  height: 500px;
  background: rgba(51, 102, 204, 0.15);
  animation: heroGlow 8s ease-in-out infinite;
}

.hero-glow-2 {
  top: 30%;
  right: 10%;
  width: 400px;
  height: 400px;
  background: rgba(74, 158, 204, 0.12);
  animation: heroGlow 10s ease-in-out infinite reverse;
}

.hero-glow-3 {
  bottom: -10%;
  left: 40%;
  width: 350px;
  height: 350px;
  background: rgba(78, 205, 196, 0.1);
  animation: heroGlow 12s ease-in-out infinite 2s;
}

@keyframes heroGlow {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  33% { transform: translate(30px, -20px) scale(1.1); opacity: 1; }
  66% { transform: translate(-20px, 15px) scale(0.95); opacity: 0.7; }
}

.hero .container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Two-Column Grid --- */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
}

.hero-content {
  max-width: 580px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(18, 18, 30, 0.6);
  border: 1px solid rgba(51, 102, 204, 0.2);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: 36px;
  backdrop-filter: blur(20px);
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* Title */
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 4.5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
}

.hero-title-accent {
  position: relative;
  display: inline-block;
}

.hero-title-line {
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 12px;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawLine 1.5s ease-out 0.8s forwards;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* Subtitle */
.hero-subtitle {
  font-size: var(--fs-lg);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 480px;
}

/* CTAs */
.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Hero Visual (Right Side) --- */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 520px;
}

.hero-image-wrapper img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  position: relative;
  z-index: 1;
  animation: heroBounce 5s ease-in-out infinite;
}

@keyframes heroBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Glow behind image */
.hero-image-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle at center, rgba(51, 102, 204, 0.2), transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  animation: heroGlow 8s ease-in-out infinite;
}

/* Floating badges */
.hero-float-badge {
  position: absolute;
  padding: 12px 20px;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: float 4s ease-in-out infinite;
  white-space: nowrap;
  z-index: 2;
}

.hero-float-badge.top-right {
  top: 10%;
  right: -20px;
  animation-delay: 0s;
}

.hero-float-badge.bottom-left {
  bottom: 15%;
  left: -30px;
  animation-delay: 2s;
}

.hero-float-badge svg {
  color: var(--accent-light);
  flex-shrink: 0;
}

/* --- Floating Stats Bar --- */
.hero-stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 60px;
  padding: 28px 56px;
  background: rgba(18, 18, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  width: fit-content;
}

.hero-stat {
  text-align: center;
  padding: 0 40px;
}

.hero-stat h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-3xl);
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 4px;
}

.hero-stat-divider {
  width: 1px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

/* ============================================
   BUTTONS (shared)
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: var(--accent-gradient);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-gradient-hover);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary span,
.btn-primary svg {
  position: relative;
  z-index: 1;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: rgba(18, 18, 30, 0.6);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(20px);
}

.btn-secondary:hover {
  background: rgba(51, 102, 204, 0.15);
  border-color: rgba(51, 102, 204, 0.3);
  transform: translateY(-3px);
}

/* ============================================
   SERVICES SECTION — Apple-Style Sticky Scroll
   ============================================ */
.services {
  position: relative;
  padding: 0;
  overflow: clip;
}

.services .container {
  position: relative;
}

.services-header {
  text-align: center;
  padding: 100px 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, var(--bg-primary) 50%, transparent 100%);
}

.services-header .section-subtitle {
  margin: 0 auto;
}

/* --- Sticky Scroll Layout --- */
.services-grid {
  display: block;
  position: relative;
}

/* Each wrapper creates scroll-space — taller = longer pin */
.service-card-wrap {
  height: 130vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}

/* Last wrapper shorter since no next card to reveal */
.service-card-wrap:last-child {
  height: 80vh;
}

.service-card {
  position: sticky;
  top: 22vh;
  width: 100%;
  max-width: 910px;
  margin: 0 auto;
  background: rgba(18, 18, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 88px 80px;
  overflow: hidden;
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.06),
    inset 0 0 40px rgba(51, 102, 204, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.5s ease, border-color 0.5s ease,
              transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.4s ease;
  transform-origin: top center;
}

/* Card number badge */
.service-card::after {
  content: attr(data-index);
  position: absolute;
  top: 16px;
  right: 24px;
  font-family: var(--font-heading);
  font-size: var(--fs-5xl);
  font-weight: 800;
  color: rgba(51, 102, 204, 0.06);
  line-height: 1;
  pointer-events: none;
}

/* Accent top line */
.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* REVERSED Z-INDEX — first card on top, slides up to reveal next */
.service-card-wrap:nth-child(1) .service-card { z-index: 4; }
.service-card-wrap:nth-child(2) .service-card { z-index: 3; }
.service-card-wrap:nth-child(3) .service-card { z-index: 2; }
.service-card-wrap:nth-child(4) .service-card { z-index: 1; }

/* All cards pin at the same top position */
.service-card-wrap .service-card { top: 22vh; }

/* Active card state — toggled by IntersectionObserver */
.service-card.card-active {
  border-color: var(--border-glass-hover);
  box-shadow:
    0 16px 60px rgba(0, 0, 0, 0.5),
    0 0 40px var(--accent-glow);
}

.service-card.card-active::before {
  transform: scaleX(1);
}

/* Entrance state — card below viewport, waiting to enter */
.service-card.card-below {
  transform: scale(0.92) translateY(60px);
  opacity: 0.3;
  box-shadow: none;
}

.service-card.card-below::before {
  transform: scaleX(0);
}

/* Exit animation — card scales down + fades as it slides up */
.service-card.card-exiting {
  transform: scale(0.92) translateY(-60px);
  opacity: 0.3;
  box-shadow: none;
}

.service-card.card-exiting::before {
  transform: scaleX(0);
}

/* --- Card Content --- */
.service-icon {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: var(--radius-md);
  background: rgba(51, 102, 204, 0.1);
  border: 1px solid rgba(51, 102, 204, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: var(--transition);
}

.service-card.card-active .service-icon {
  background: rgba(51, 102, 204, 0.2);
  box-shadow: 0 0 24px var(--accent-glow);
}

.service-icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent-light);
}

.service-card h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: 12px;
}

.service-card p {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 520px;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.service-tags span {
  padding: 6px 16px;
  background: rgba(51, 102, 204, 0.08);
  border: 1px solid rgba(51, 102, 204, 0.12);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  color: var(--accent-light);
  font-weight: 500;
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */
.portfolio {
  padding: var(--section-padding);
  position: relative;
}

.portfolio-header {
  text-align: center;
  margin-bottom: 48px;
}

.portfolio-header .section-subtitle {
  margin: 0 auto;
}

/* Filter Tabs */
.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

.filter-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: var(--text-primary);
  box-shadow: 0 2px 16px var(--accent-glow);
}

/* Portfolio Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.portfolio-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 50%, var(--bg-secondary) 100%);
  background-size: 200% 200%;
}

/* Shimmer loading animation */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.portfolio-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%, 
    rgba(255,255,255,0.03) 40%, 
    rgba(255,255,255,0.06) 50%, 
    rgba(255,255,255,0.03) 60%, 
    rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
}

.portfolio-item.img-loaded::before {
  display: none;
}

.portfolio-item.img-loaded img {
  opacity: 1;
}

/* Hide items beyond 9 (3x3 grid) by default */
.portfolio-grid .portfolio-item:nth-child(n+10) {
  display: none;
}

.portfolio-grid.show-all .portfolio-item:nth-child(n+10) {
  display: block;
}

/* Show More button */
.portfolio-show-more {
  display: block;
  width: fit-content;
  margin: 32px auto 0;
  padding: 14px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.portfolio-show-more:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  box-shadow: 0 2px 16px var(--accent-glow);
  transform: translateY(-2px);
}

.portfolio-grid.show-all ~ .portfolio-show-more {
  display: none;
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 30%,
    rgba(10, 10, 15, 0.95) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.portfolio-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.portfolio-item:hover img {
  transform: scale(1.08);
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay .tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  margin-bottom: 12px;
  width: fit-content;
}

.portfolio-overlay h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: 6px;
  transform: translateY(10px);
  transition: transform 0.4s ease 0.05s;
}

.portfolio-overlay p {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transform: translateY(10px);
  transition: transform 0.4s ease 0.1s;
}

.portfolio-item:hover .portfolio-overlay h3,
.portfolio-item:hover .portfolio-overlay p {
  transform: translateY(0);
}

/* Hidden items for filter */
.portfolio-item.hidden {
  display: none;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about {
  padding: var(--section-padding);
  position: relative;
}

.about .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-content .section-subtitle {
  margin-bottom: 32px;
}

.about-text {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 36px;
}

/* Skills */
.skills-section h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: 24px;
}

.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skill-bar {
  width: 100%;
}

.skill-bar .skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.skill-bar .skill-info span:first-child {
  font-size: var(--fs-sm);
  font-weight: 500;
}

.skill-bar .skill-info span:last-child {
  font-size: var(--fs-sm);
  color: var(--accent-light);
  font-weight: 600;
}

.skill-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  width: 0;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Tools Grid */
.tools-section {
  margin-top: 48px;
}

.tools-section h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: 24px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.tool-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-3px);
}

.tool-item svg {
  width: 24px;
  height: 24px;
  color: var(--accent-light);
  flex-shrink: 0;
}

.tool-item span {
  font-size: var(--fs-sm);
  font-weight: 500;
}

/* About visual side */
.about-visual {
  position: relative;
}

/* ---- 3D LAPTOP HINGE ---- */
.laptop-scene {
  perspective: 1200px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  will-change: transform;
  contain: layout style;
}

.laptop {
  position: relative;
  transform-style: preserve-3d;
  width: 100%;
  will-change: transform;
}

/* -- LAPTOP LID -- */
.laptop-lid {
  position: relative;
  transform-origin: bottom center;
  transform-style: preserve-3d;
  /* Start closed — will animate open */
  transform: rotateX(-85deg);
  transition: transform 1.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 2;
  will-change: transform;
  backface-visibility: hidden;
}

/* When JS triggers the open */
.laptop.lid-open .laptop-lid {
  transform: rotateX(-15deg);
}

.laptop-screen {
  background: #0d0d14;
  border: 3px solid #2a2a3a;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 8px 8px 0;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 -4px 30px rgba(51, 102, 204, 0.15),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.laptop-screen-bezel {
  display: flex;
  justify-content: center;
  padding: 6px 0 8px;
}

.laptop-camera {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a1a2e;
  border: 1px solid #333;
  position: relative;
}

.laptop-camera::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(51, 102, 204, 0.4), transparent);
}

.laptop-screen img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

/* Glass reflection over screen */
.laptop-screen-reflection {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 40%,
    transparent 60%,
    rgba(255, 255, 255, 0.03) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Screen glow when open */
.laptop.lid-open .laptop-screen {
  box-shadow:
    0 -4px 40px rgba(51, 102, 204, 0.25),
    0 -2px 20px rgba(74, 158, 204, 0.15),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* -- HINGE STRIP -- */
.laptop-hinge {
  width: 100%;
  height: 10px;
  background: linear-gradient(
    180deg,
    #1a1a2a 0%,
    #2a2a3a 30%,
    #3a3a4a 50%,
    #2a2a3a 70%,
    #1a1a2a 100%
  );
  border-radius: 0 0 2px 2px;
  position: relative;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.laptop-hinge::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

/* -- LAPTOP BASE -- */
.laptop-base {
  background: linear-gradient(180deg, #16161e, #1a1a26, #14141c);
  border: 2px solid #2a2a3a;
  border-top: 1px solid #333;
  border-radius: 0 0 12px 12px;
  padding: 16px 20px 14px;
  position: relative;
  z-index: 1;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.4),
    0 2px 10px rgba(0, 0, 0, 0.3);
}

/* -- KEYBOARD -- */
.laptop-keyboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.key-row {
  display: flex;
  gap: 3px;
  justify-content: center;
}

.key-row span {
  width: 22px;
  height: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.laptop.lid-open .key-row span {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Spacebar */
.spacebar-row {
  justify-content: center;
}

.spacebar {
  width: 100px !important;
  flex-grow: 0;
}

/* -- TRACKPAD -- */
.laptop-trackpad {
  width: 80px;
  height: 48px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

.laptop.lid-open .laptop-trackpad {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

/* -- LAPTOP SHADOW ON SURFACE -- */
.laptop::after {
  content: '';
  position: absolute;
  bottom: -24px;
  left: 2%;
  right: 2%;
  height: 28px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.1) 40%, transparent 70%);
  z-index: 0;
  transition: opacity 0.6s ease;
}

.laptop.lid-open::after {
  opacity: 1;
  background: radial-gradient(ellipse at center, rgba(51, 102, 204, 0.15) 0%, rgba(0,0,0,0.3) 30%, transparent 70%);
}

/* Laptop hinge open animation keyframe (used for bounce) */
@keyframes laptopLidOpen {
  0% {
    transform: rotateX(-85deg);
  }
  50% {
    transform: rotateX(-5deg);
  }
  65% {
    transform: rotateX(-20deg);
  }
  80% {
    transform: rotateX(-12deg);
  }
  100% {
    transform: rotateX(-15deg);
  }
}

.laptop.lid-animate .laptop-lid {
  animation: laptopLidOpen 1.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.experience-badge {
  position: absolute;
  bottom: -20px;
  right: -20px;
  padding: 20px 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  text-align: center;
  z-index: 10;
  will-change: transform;
}

.experience-badge h4 {
  font-family: var(--font-heading);
  font-size: var(--fs-3xl);
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.experience-badge p {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================
   TOOLS SECTION (Standalone)
   ============================================ */
.tools {
  padding: var(--section-padding);
  position: relative;
}

.tools-header {
  text-align: center;
  margin-bottom: 64px;
}

.tools-header .section-subtitle {
  margin: 0 auto;
}

.tools-showcase {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-8px);
  box-shadow: var(--shadow-card-hover);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(51, 102, 204, 0.1);
  border: 1px solid rgba(51, 102, 204, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: var(--transition);
}

.tool-card:hover .tool-icon {
  background: rgba(51, 102, 204, 0.2);
  box-shadow: 0 0 20px var(--accent-glow);
}

.tool-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent-light);
}

.tool-card h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: 6px;
}

.tool-card p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================
   TESTIMONIALS SECTION
   ============================================ */
.testimonials {
  padding: var(--section-padding);
  position: relative;
  background: var(--bg-secondary);
}

.testimonials-header {
  text-align: center;
  margin-bottom: 64px;
}

.testimonials-header .section-subtitle {
  margin: 0 auto;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 36px;
  transition: var(--transition);
  position: relative;
}

.testimonial-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-6px);
}

.testimonial-stars {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.testimonial-stars svg {
  width: 18px;
  height: 18px;
  color: #f59e0b;
  fill: #f59e0b;
}

.testimonial-card blockquote {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 28px;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 14px;
}

.testimonial-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-md);
  flex-shrink: 0;
}

.testimonial-author-info h4 {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.testimonial-author-info p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.testimonial-quote-icon {
  position: absolute;
  top: 24px;
  right: 28px;
  color: rgba(51, 102, 204, 0.15);
}

.testimonial-quote-icon svg {
  width: 32px;
  height: 32px;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
  padding: var(--section-padding);
  position: relative;
}

.contact-header {
  text-align: center;
  margin-bottom: 64px;
}

.contact-header .section-subtitle {
  margin: 0 auto;
}

/* Two-column grid: info left, form right */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  align-items: start;
}

/* --- Contact Info Card --- */
.contact-info-card {
  background: rgba(18, 18, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 20px;
}

.contact-info-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: var(--radius-md);
  background: rgba(51, 102, 204, 0.1);
  border: 1px solid rgba(51, 102, 204, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-info-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent-light);
}

.contact-info-item h4 {
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: 4px;
}

.contact-info-item a,
.contact-info-item p {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.contact-info-item a:hover {
  color: var(--accent-light);
}

/* WhatsApp / Instagram / LinkedIn buttons */
.contact-socials {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.contact-social-btn.whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
}

.contact-social-btn.instagram {
  background: linear-gradient(135deg, #F58529, #DD2A7B, #8134AF);
}

.contact-social-btn.linkedin {
  background: linear-gradient(135deg, #0077B5, #005582);
}

.contact-social-btn svg {
  width: 20px;
  height: 20px;
}

.contact-social-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3);
}

/* --- Contact Form --- */
.contact-form-wrap {
  background: rgba(18, 18, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text-primary);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-light);
  background: rgba(51, 102, 204, 0.05);
  box-shadow: 0 0 20px var(--accent-glow);
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

/* Submit button */
.form-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 40px;
  background: var(--accent-gradient);
  color: #fff;
  font-family: var(--font-heading);
  font-size: var(--fs-base);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  align-self: flex-start;
}

.form-submit-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.form-submit-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.form-submit-btn:hover::after {
  opacity: 1;
}

.form-submit-btn svg {
  position: relative;
  z-index: 1;
}

.form-submit-btn span {
  position: relative;
  z-index: 1;
}

.form-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-submit-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Form Status Messages */
.form-status {
  margin-top: 16px;
  padding: 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.form-status.success {
  padding: 14px 20px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.form-status.error {
  padding: 14px 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 60px 0 30px;
  border-top: 1px solid var(--border-glass);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 30px;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
}

.footer-logo span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-socials {
  display: flex;
  gap: 16px;
}

.footer-socials a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.footer-socials a:hover {
  background: var(--accent-gradient);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.footer-socials svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.footer-socials a:hover svg {
  color: #fff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--accent-light);
}

.footer-bottom a:hover {
  color: var(--text-primary);
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */
@keyframes pulseGlow {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.5);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes orbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   3D HINGE, CLAMSHELL, LID & PIVOT ANIMATIONS
   ============================================ */

/* ---------- 3D Keyframes ---------- */

/* Hinge Rotation — swings from left edge like a door */
@keyframes hingeOpen {
  0% {
    transform: perspective(800px) rotateY(-90deg);
    opacity: 0;
  }
  40% {
    transform: perspective(800px) rotateY(15deg);
    opacity: 1;
  }
  60% {
    transform: perspective(800px) rotateY(-8deg);
  }
  80% {
    transform: perspective(800px) rotateY(4deg);
  }
  100% {
    transform: perspective(800px) rotateY(0deg);
    opacity: 1;
  }
}

/* Clamshell Open — top half lifts up like a laptop lid */
@keyframes clamshellOpen {
  0% {
    transform: translateY(40px) scale(0.92);
    opacity: 0;
  }
  60% {
    transform: translateY(-6px) scale(1.01);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Lid Rotation — rotates down from top edge like opening a box lid */
@keyframes lidRotate {
  0% {
    transform: perspective(800px) rotateX(-80deg);
    transform-origin: top center;
    opacity: 0;
  }
  30% {
    transform: perspective(800px) rotateX(10deg);
    opacity: 1;
  }
  50% {
    transform: perspective(800px) rotateX(-5deg);
  }
  70% {
    transform: perspective(800px) rotateX(3deg);
  }
  100% {
    transform: perspective(800px) rotateX(0deg);
    opacity: 1;
  }
}

/* Pivot Rotation — rotates from bottom-left corner */
@keyframes pivotIn {
  0% {
    transform: perspective(800px) rotate3d(1, 1, 0, -45deg);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: perspective(800px) rotate3d(0, 0, 0, 0deg);
    opacity: 1;
  }
}

/* 3D Door Open — two halves swing open */
@keyframes doorSwingLeft {
  0% {
    transform: perspective(1200px) rotateY(0deg);
  }
  100% {
    transform: perspective(1200px) rotateY(-30deg);
  }
}

@keyframes doorSwingRight {
  0% {
    transform: perspective(1200px) rotateY(0deg);
  }
  100% {
    transform: perspective(1200px) rotateY(30deg);
  }
}

/* 3D Float with rotation */
@keyframes float3D {
  0%, 100% {
    transform: perspective(600px) translateY(0) rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: perspective(600px) translateY(-8px) rotateX(2deg) rotateY(-3deg);
  }
  50% {
    transform: perspective(600px) translateY(-14px) rotateX(-1deg) rotateY(2deg);
  }
  75% {
    transform: perspective(600px) translateY(-6px) rotateX(1.5deg) rotateY(-1.5deg);
  }
}

/* ---------- 1. SERVICE CARDS — 3D Hinge Rotation ---------- */

/* Perspective container */
.services-grid {
  perspective: 1200px;
}

.service-card {
  transform-style: preserve-3d;
  transform-origin: left center;
  backface-visibility: hidden;
}

/* Scroll-triggered hinge entrance */
.service-card.hinge-reveal {
  opacity: 0;
  transform: perspective(800px) rotateY(-90deg);
}

.service-card.hinge-active {
  animation: hingeOpen 1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* Enhanced 3D hover — tilts toward user */
.service-card:hover {
  transform: perspective(800px) rotateY(5deg) rotateX(-3deg) translateY(-8px) !important;
  box-shadow:
    -8px 8px 30px rgba(0, 0, 0, 0.3),
    0 0 20px var(--accent-glow);
}

/* Staggered delays for each card */
.service-card:nth-child(1).hinge-active { animation-delay: 0s; }
.service-card:nth-child(2).hinge-active { animation-delay: 0.15s; }
.service-card:nth-child(3).hinge-active { animation-delay: 0.3s; }
.service-card:nth-child(4).hinge-active { animation-delay: 0.45s; }

/* Accent glow line on top — 3D lift */
.service-card::before {
  transform: translateZ(2px);
}

/* ---------- 2. PORTFOLIO ITEMS — Clamshell Open Animation ---------- */

.portfolio-item {
  transform-origin: bottom center;
}

/* Scroll-triggered clamshell entrance */
.portfolio-item.clamshell-reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.92);
}

.portfolio-item.clamshell-active {
  animation: clamshellOpen 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  will-change: transform, opacity;
}

/* Enhanced hover — lid lift effect */
.portfolio-item:hover {
  transform: perspective(800px) rotateX(-6deg) translateY(-8px) !important;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px var(--accent-glow);
}

.portfolio-item:hover img {
  transform: scale(1.05) translateZ(10px);
}

/* Overlay slides up with 3D depth */
.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
  transform: translateZ(20px);
}

.portfolio-overlay {
  transform: translateZ(5px);
}

/* Staggered clamshell delays */
.portfolio-item:nth-child(1).clamshell-active { animation-delay: 0s; }
.portfolio-item:nth-child(2).clamshell-active { animation-delay: 0.12s; }
.portfolio-item:nth-child(3).clamshell-active { animation-delay: 0.24s; }
.portfolio-item:nth-child(4).clamshell-active { animation-delay: 0.36s; }
.portfolio-item:nth-child(5).clamshell-active { animation-delay: 0.48s; }
.portfolio-item:nth-child(6).clamshell-active { animation-delay: 0.6s; }

/* ---------- 3. TESTIMONIAL CARDS — Lid Rotation ---------- */

.testimonials-grid {
  perspective: 1000px;
}

.testimonial-card {
  transform-style: preserve-3d;
  transform-origin: top center;
}

/* Scroll-triggered lid entrance */
.testimonial-card.lid-reveal {
  opacity: 0;
  transform: perspective(800px) rotateX(-80deg);
}

.testimonial-card.lid-active {
  animation: lidRotate 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* 3D hover tilt */
.testimonial-card:hover {
  transform: perspective(600px) rotateX(4deg) rotateY(-3deg) translateY(-6px) !important;
  box-shadow:
    4px 12px 30px rgba(0, 0, 0, 0.3),
    0 0 15px var(--accent-glow);
}

/* Stars float above card */
.testimonial-card:hover .testimonial-stars {
  transform: translateZ(15px);
}

.testimonial-stars {
  transition: transform 0.4s ease;
}

/* Stagger delays */
.testimonial-card:nth-child(1).lid-active { animation-delay: 0s; }
.testimonial-card:nth-child(2).lid-active { animation-delay: 0.15s; }
.testimonial-card:nth-child(3).lid-active { animation-delay: 0.3s; }

/* ---------- 4. ABOUT IMAGE — Pivot Rotation ---------- */

.about-visual {
  perspective: 1000px;
  will-change: transform;
  contain: layout style;
}

.about-image-wrapper {
  transform-style: preserve-3d;
  transform-origin: bottom left;
  will-change: transform;
  backface-visibility: hidden;
}

.about-image-wrapper.pivot-reveal {
  opacity: 0;
  transform: perspective(800px) rotate3d(1, 1, 0, -45deg);
}

.about-image-wrapper.pivot-active {
  animation: pivotIn 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* Continuous subtle 3D float after entrance */
.about-image-wrapper.pivot-active.float-3d {
  animation: pivotIn 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards,
             float3D 6s ease-in-out 1.2s infinite;
}

/* Experience badge pops out in 3D */
.experience-badge {
  transform: translateZ(30px);
  transform-style: preserve-3d;
  transition: var(--transition);
}

.about-visual:hover .experience-badge {
  transform: translateZ(50px) scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* ---------- 5. CTA SECTION — 3D Hinge Door Open ---------- */

.cta-section {
  perspective: 1500px;
}

.cta-wrapper {
  transform-style: preserve-3d;
  position: relative;
}

.cta-wrapper.door-reveal {
  opacity: 0;
  transform: perspective(1200px) rotateY(-40deg) scale(0.85);
  transform-origin: left center;
}

.cta-wrapper.door-active {
  animation: ctaDoorOpen 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes ctaDoorOpen {
  0% {
    transform: perspective(1200px) rotateY(-40deg) scale(0.85);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  60% {
    transform: perspective(1200px) rotateY(5deg) scale(1.02);
  }
  80% {
    transform: perspective(1200px) rotateY(-2deg) scale(1);
  }
  100% {
    transform: perspective(1200px) rotateY(0deg) scale(1);
    opacity: 1;
  }
}

/* CTA buttons float above the card in 3D space */
.cta-content {
  transform: translateZ(30px);
  transform-style: preserve-3d;
}

.cta-buttons a {
  transition: var(--transition), transform 0.4s ease;
}

.cta-buttons a:hover {
  transform: translateZ(20px) translateY(-3px) !important;
}

/* ---------- 6. HERO — 3D Float for Visual ---------- */

.hero-visual {
  perspective: 800px;
}

.hero-image-wrapper {
  transform-style: preserve-3d;
  animation: float3D 8s ease-in-out infinite;
}

.hero-float-badge {
  transform: translateZ(40px);
  transform-style: preserve-3d;
}

/* ---------- GLOBAL: Interactive 3D Tilt on Mouse (JS-driven) ---------- */
.tilt-3d {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .service-card.hinge-reveal,
  .portfolio-item.clamshell-reveal,
  .testimonial-card.lid-reveal,
  .about-image-wrapper.pivot-reveal,
  .cta-wrapper.door-reveal {
    opacity: 1;
    transform: none;
  }

  .service-card.hinge-active,
  .portfolio-item.clamshell-active,
  .testimonial-card.lid-active,
  .about-image-wrapper.pivot-active,
  .cta-wrapper.door-active {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .hero-image-wrapper {
    animation: none;
  }
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 1024px) {
  :root {
    --fs-5xl: 3.5rem;
    --fs-4xl: 2.8rem;
    --fs-3xl: 2rem;
    --section-padding: 80px 0;
  }

  /* Hero */
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
  }

  .hero-content {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-subtitle {
    max-width: 100%;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
    max-width: 380px;
    margin: 0 auto;
  }

  .hero-stats-bar {
    padding: 24px 32px;
  }

  .hero-stat {
    padding: 0 24px;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about .container {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-visual {
    order: -1;
    max-width: 400px;
    margin: 0 auto;
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonials-grid .testimonial-card:last-child {
    grid-column: span 2;
    max-width: 50%;
    margin: 0 auto;
  }

  .tools-showcase {
    grid-template-columns: repeat(3, 1fr);
  }

  .laptop-scene {
    max-width: 380px;
  }
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 768px) {
  :root {
    --fs-5xl: 2.5rem;
    --fs-4xl: 2rem;
    --fs-3xl: 1.75rem;
    --section-padding: 64px 0;
  }

  /* Mobile Nav */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: var(--blur-glass);
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 40px;
    border-left: 1px solid var(--border-glass);
  }

  .nav-links.active {
    right: 0;
  }

  .nav-hamburger {
    display: flex;
  }

  /* Hero */
  .hero {
    padding: 120px 0 60px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 36px;
  }

  .hero-visual {
    order: -1;
    max-width: 280px;
    margin: 0 auto;
  }

  .hero-float-badge {
    display: none;
  }

  .hero-image-glow {
    display: none;
  }

  .hero-stats-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 24px;
    width: 100%;
  }

  .hero-stat-divider {
    display: none;
  }

  .hero-stat {
    padding: 12px 0;
  }

  .hero-glow-1,
  .hero-glow-2,
  .hero-glow-3 {
    width: 250px;
    height: 250px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  /* On mobile, hide items beyond the first 6 until user taps Show More */
  .portfolio-grid:not(.show-all) .portfolio-item:nth-child(n+7) {
    display: none;
  }

  .portfolio-show-more {
    display: block;
  }

  .portfolio-grid.show-all ~ .portfolio-show-more {
    display: none;
  }

  /* Tools */
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tools-showcase {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .testimonials-grid .testimonial-card:last-child {
    grid-column: span 1;
    max-width: 100%;
  }

  /* CTA */
  .cta-wrapper {
    padding: 48px 28px;
  }

  /* Footer */
  .footer-content {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --fs-5xl: 2rem;
    --fs-4xl: 1.75rem;
    --container-padding: 0 16px;
  }

  .hero {
    padding: 100px 0 48px;
  }

  .hero-title {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .hero-visual {
    max-width: 200px;
  }

  .hero-stats-bar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .hero-badge {
    font-size: 12px;
    padding: 6px 14px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tools-showcase {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   CHATBOT WIDGET
   ============================================ */

/* ---------- Floating Toggle Button ---------- */
.chatbot-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px var(--accent-glow), 0 0 0 0 rgba(51, 102, 204, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: chatPulse 2.5s ease-in-out infinite;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 32px var(--accent-glow);
  animation: none;
}

.chatbot-toggle.active {
  animation: none;
}

.chatbot-icon-close {
  display: none;
}

.chatbot-toggle.active .chatbot-icon-chat {
  display: none;
}

.chatbot-toggle.active .chatbot-icon-close {
  display: block;
}

@keyframes chatPulse {
  0%, 100% {
    box-shadow: 0 4px 24px var(--accent-glow), 0 0 0 0 rgba(51, 102, 204, 0.4);
  }
  50% {
    box-shadow: 0 4px 24px var(--accent-glow), 0 0 0 14px rgba(51, 102, 204, 0);
  }
}

/* ---------- Chat Window ---------- */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 380px;
  max-height: 520px;
  background: rgba(18, 18, 28, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.chatbot-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ---------- Header ---------- */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(51, 102, 204, 0.15), rgba(78, 205, 196, 0.08));
  border-bottom: 1px solid var(--border-glass);
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}

.chatbot-header h4 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.chatbot-status {
  font-size: 12px;
  color: #22c55e;
}

.chatbot-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: var(--transition-fast);
}

.chatbot-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* ---------- Messages Area ---------- */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 260px;
  max-height: 320px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* ---------- Message Bubbles ---------- */
.chatbot-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  animation: msgFadeIn 0.35s ease;
}

.chatbot-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-bottom-left-radius: 4px;
}

.chatbot-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #3366CC, #4ECDC4);
  color: #fff;
  border-bottom-right-radius: 4px;
}

@keyframes msgFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Typing Indicator ---------- */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.chatbot-typing span {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ---------- Service Chips ---------- */
.chatbot-services {
  padding: 8px 20px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chatbot-service-chip {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-body);
}

.chatbot-service-chip:hover {
  background: linear-gradient(135deg, rgba(51, 102, 204, 0.2), rgba(78, 205, 196, 0.15));
  border-color: rgba(51, 102, 204, 0.4);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* ---------- Input Area ---------- */
.chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-glass);
  background: rgba(10, 10, 15, 0.5);
}

.chatbot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.3s ease;
}

.chatbot-input::placeholder {
  color: var(--text-muted);
}

.chatbot-input:focus {
  border-color: rgba(51, 102, 204, 0.5);
}

.chatbot-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.chatbot-send:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* ---------- Reset Button ---------- */
.chatbot-reset-wrap {
  padding: 10px 16px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: center;
}

.chatbot-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition-fast);
  width: 100%;
  justify-content: center;
}

.chatbot-reset-btn:hover {
  background: linear-gradient(135deg, rgba(51, 102, 204, 0.12), rgba(78, 205, 196, 0.08));
  border-color: rgba(51, 102, 204, 0.4);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .chatbot-window {
    right: 12px;
    left: 12px;
    bottom: 96px;
    width: auto;
    max-height: 70vh;
  }

  .chatbot-toggle {
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
  }
}
