@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Palette - Premium Deep Dark */
  --bg-page: #0B0D17;
  --bg-surface: #0F1120;
  --bg-card: #141729;
  --border: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(99, 102, 241, 0.3);
  --text-primary: #FFFFFF;
  --text-secondary: #8B8FA3;
  --accent: #6366F1;
  --accent-cyan: #22D3EE;
  --accent-pink: #EC4899;
  --accent-soft: rgba(99, 102, 241, 0.1);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366F1, #22D3EE);
  --gradient-warm: linear-gradient(135deg, #EC4899, #6366F1, #22D3EE);
  --gradient-glow: linear-gradient(135deg, rgba(99,102,241,0.4), rgba(34,211,238,0.4));
  
  /* Spacing Scale */
  --s-8: 8px;
  --s-16: 16px;
  --s-24: 24px;
  --s-32: 32px;
  --s-48: 48px;
  --s-64: 64px;
  --s-96: 96px;
  --section-pad: 140px;
  
  /* Typography */
  --font-inter: 'Inter', sans-serif;
  
  /* Effects */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-lg: 24px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-page);
  font-size: 18px;
}

#canvas-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.7;
}

body {
  font-family: var(--font-inter);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s-32);
}

section {
  padding: var(--section-pad) 0;
  position: relative;
}

/* Section Gradient Dividers */
section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.2;
}

section:last-of-type::after {
  display: none;
}

/* Navbar - Glassmorphic */
nav {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  width: min(1200px, 90%);
  background: rgba(11, 13, 23, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 100px;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

nav.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.nav-logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: var(--s-32);
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-links a:hover {
  color: var(--text-primary);
}

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

/* Hero Section */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding-top: 160px;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--s-64);
  align-items: center;
}

.hero-content {
  max-width: 800px;
}

/* Gradient Hero Heading */
h1 {
  font-size: clamp(56px, 10vw, 96px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin-bottom: var(--s-32);
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 700px;
  margin-bottom: var(--s-48);
  line-height: 1.7;
}

/* Glowing Hero Visual */
.hero-visual {
  position: relative;
  animation: float 6s ease-in-out infinite;
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--radius-lg) + 3px);
  background: var(--gradient-primary);
  opacity: 0.5;
  z-index: -1;
  filter: blur(20px);
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.hero-visual img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glow);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 100px;
  font-size: 13px;
  color: var(--accent-cyan);
  margin-bottom: var(--s-32);
  font-family: 'Inter', monospace;
  gap: 8px;
  font-weight: 500;
}

.badge span {
  color: var(--accent);
}

.pulse {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Buttons - Gradient Primary */
.btn-group {
  display: flex;
  gap: var(--s-16);
}

.btn {
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  display: inline-block;
  position: relative;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

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

/* Infinite Tech Marquee */
.tech-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--s-24) 0;
  background: rgba(11, 13, 23, 0.5);
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.tech-strip::before,
.tech-strip::after {
  content: "";
  position: absolute;
  top: 0;
  width: 150px;
  height: 100%;
  z-index: 2;
}

.tech-strip::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-page), transparent);
}

.tech-strip::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-page), transparent);
}

.tech-scroll {
  display: inline-flex;
  animation: marquee 40s linear infinite;
}

.tech-item {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: var(--s-64);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
}

.tech-item::before {
  content: '◆';
  font-size: 8px;
  color: var(--accent);
}

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

/* Section Header */
.section-header {
  margin-bottom: var(--s-64);
  position: relative;
}

/* Custom CSS 3D Floating Object */
.css-3d-wrapper {
  position: absolute;
  right: 2%;
  top: -20px;
  width: 100px;
  height: 100px;
  perspective: 800px;
  pointer-events: none;
  z-index: 0;
}

.core-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: spin3d 12s linear infinite;
}

.core-ring {
  position: absolute;
  inset: 5px;
  border: 2px solid rgba(34, 211, 238, 0.3);
  border-radius: 50%;
  transform-style: preserve-3d;
}

.core-ring:nth-child(1) { transform: rotateX(0deg) rotateY(0deg); border-color: rgba(99, 102, 241, 0.5); }
.core-ring:nth-child(2) { transform: rotateX(60deg) rotateY(30deg); border-color: rgba(34, 211, 238, 0.5); }
.core-ring:nth-child(3) { transform: rotateX(120deg) rotateY(60deg); border-color: rgba(236, 72, 153, 0.5); }

.core-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: var(--gradient-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.6);
}

@keyframes spin3d {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}

.section-label {
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--s-16);
  display: block;
}

h2 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* Project Cards - Glassmorphic */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-32);
}

.project-card {
  background: rgba(15, 17, 32, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
}

/* Gradient border glow on hover */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: var(--gradient-primary);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

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

.project-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 25px 70px rgba(99, 102, 241, 0.2), 0 0 45px rgba(99, 102, 241, 0.12);
  z-index: 10;
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.project-info {
  padding: var(--s-48);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  transform: translateZ(30px);
  overflow: visible;
}

.project-card h3 {
  font-size: 24px;
  margin-bottom: var(--s-16);
  display: flex;
  align-items: center;
  gap: var(--s-16);
}

.project-card p {
  color: var(--text-secondary);
  margin-bottom: var(--s-32);
  flex-grow: 1;
  line-height: 1.7;
}

/* Tags - Enhanced */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-8);
  margin-top: auto;
}

.tag {
  font-size: 12px;
  background: rgba(99, 102, 241, 0.08);
  padding: 5px 12px;
  border-radius: 100px;
  color: var(--accent-cyan);
  border: 1px solid rgba(99, 102, 241, 0.15);
  font-weight: 500;
  transition: var(--transition);
}

.tag:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
}

/* Expandable Flex Grid Gallery */
.expandable-grid {
  display: flex;
  gap: var(--s-24);
  height: 520px;
  width: 100%;
}

.expandable-card {
  flex: 1;
  background: rgba(15, 17, 32, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: flex 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
}

.expandable-card:hover {
  flex: 3.5;
  border-color: var(--accent);
  box-shadow: 0 25px 70px rgba(99, 102, 241, 0.25), 0 0 45px rgba(99, 102, 241, 0.12);
  transform: scale(1.01);
  z-index: 10;
}

.expandable-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: var(--gradient-primary);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 1;
  pointer-events: none;
}

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

/* Collapsed state view inside the card */
.ec-collapsed {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: opacity 0.3s ease;
  transition-delay: 0.2s; /* remain visible when unhovered */
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.expandable-card:hover .ec-collapsed {
  opacity: 0;
  pointer-events: none;
  transition-delay: 0s;
}

.ec-collapsed .ec-thumb {
  width: 100%;
  height: 220px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-16);
}

.ec-collapsed .ec-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ec-collapsed .ec-preview-info {
  padding: var(--s-24);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.ec-collapsed .ec-preview-info h4 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--s-8);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ec-collapsed .ec-preview-info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--s-16);
}

/* Expanded state detailed view */
.ec-expanded {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  transition-delay: 0s;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.expandable-card:hover .ec-expanded {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.3s; /* beautifully reveal detailed contents */
}

.ec-expanded .ec-image {
  height: 100%;
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-16);
}

.ec-expanded .ec-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.expandable-card:hover .ec-expanded .ec-image img {
  transform: scale(1.05);
}

.ec-expanded .ec-info {
  padding: var(--s-32) var(--s-48);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  transform: translateZ(30px);
}

.ec-expanded .ec-info h3 {
  font-size: 28px;
  margin-bottom: var(--s-8);
  display: flex;
  align-items: center;
  gap: var(--s-16);
}

.ec-expanded .ec-info p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: var(--s-24);
}

/* Skill Progress Bars */
.skill-bars {
  display: flex;
  flex-direction: column;
  gap: var(--s-24);
  margin-top: var(--s-32);
}

.skill-bar-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.skill-bar-label span:last-child {
  color: var(--accent-cyan);
  font-size: 12px;
}

.skill-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 100px;
  width: 0%;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.skill-bar-fill.active {
  /* Width set via inline style */
}

/* Expertise Lists - Enhanced */
.expertise-list {
  list-style: none;
  margin-top: var(--s-24);
}

.expertise-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition);
}

.expertise-list li:last-child {
  border-bottom: none;
}

.expertise-list li:hover {
  color: var(--text-primary);
  padding-left: 8px;
}

.expertise-list li::before {
  content: '→';
  color: var(--accent-cyan);
  font-weight: bold;
  flex-shrink: 0;
}

/* Architecture Showcase - Glassmorphic */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-32);
}

.arch-card {
  background: rgba(15, 17, 32, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-32);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  transform-style: preserve-3d;
}

.arch-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: var(--gradient-primary);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.arch-card:hover::before {
  opacity: 0.7;
}

.arch-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1);
}

.arch-visual {
  width: 100%;
  aspect-ratio: 16/9;
  border: 1px solid var(--border);
  margin-bottom: var(--s-24);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.arch-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.arch-card h4 {
  font-size: 20px;
  margin-bottom: var(--s-8);
  color: var(--text-primary);
}

.arch-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Capabilities */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-16);
}

/* --- Compact trigger pill --- */
.cap-item {
  background: rgba(15, 17, 32, 0.7);
  border: 1px solid var(--border);
  padding: 18px var(--s-24);
  border-radius: var(--radius-md);
  transition: all 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  cursor: pointer;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
}

.cap-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  padding: 1px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.cap-item:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
  transform: translateY(-3px);
}

.cap-item:hover::before {
  opacity: 1;
}

.cap-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cap-item h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.cap-item .cap-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* --- Floating big project popup card (fixed overlay, JS-driven) --- */
.cap-popup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9000;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cap-popup {
  position: fixed;
  width: 380px;
  background: rgba(9, 11, 22, 0.98);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.75), 0 0 60px rgba(99, 102, 241, 0.18);
  backdrop-filter: blur(24px);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.95);
  transition: opacity 0.38s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 9999;
}

.cap-popup.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.cap-popup-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  position: relative;
}

.cap-popup-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cap-popup.is-visible .cap-popup-image img {
  transform: scale(1.05);
}

.cap-popup-body {
  padding: 22px 24px 20px;
}

.cap-popup-body h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cap-popup-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.cap-popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cap-popup-tags .tag {
  padding: 3px 10px;
  font-size: 10px;
}

/* Contact CTA - Glassmorphic */
.cta-box {
  background: rgba(15, 17, 32, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--s-96) var(--s-32);
  text-align: center;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.cta-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
  pointer-events: none;
}

.cta-box h2 {
  margin-bottom: var(--s-32);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transform: translateZ(30px);
}

.cta-box .btn {
  transform: translateZ(40px);
}

/* Footer */
footer {
  padding: var(--s-64) 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: var(--s-24);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

/* Animations - Enhanced Staggered Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.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; }

/* Responsive Layouts */
@media (max-width: 992px) {
  .project-grid { grid-template-columns: 1fr; }
  .arch-grid { grid-template-columns: 1fr !important; }
  h1 { font-size: 56px; }
  
  .hero-layout,
  .project-card .hero-layout {
    grid-template-columns: 1fr !important;
    gap: var(--s-32);
  }
  
  .project-card .hero-layout .project-image {
    order: -1;
    border-right: none !important;
    border-left: none !important;
    border-bottom: 1px solid var(--border);
    height: 280px;
  }
  
  .project-card .project-info {
    padding: var(--s-32) !important;
  }

  .expandable-grid {
    flex-direction: column;
    height: 1050px;
  }

  .ec-expanded {
    grid-template-columns: 1fr !important;
  }

  .ec-expanded .ec-image {
    height: 200px;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }

  .ec-expanded .ec-info {
    padding: var(--s-24) !important;
  }
}

@media (max-width: 768px) {
  nav { 
    width: calc(100% - 32px);
    padding: 10px 16px;
    top: 16px;
  }
  .nav-links { display: none; }
  
  section { padding: 80px 0; }
  .cta-box { padding: 64px var(--s-16); }
  .hero { padding-top: 120px; min-height: auto; }
}

/* Scroll to Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 50px;
  height: 50px;
  background: rgba(15, 17, 32, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 50%;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.scroll-top-btn:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

.scroll-top-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.scroll-top-btn:hover svg {
  transform: translateY(-2px);
}