/* ==========================================================================
   Mewlabs Design System & Stylesheet
   Domain Target: mewlabs.in
   Aesthetics: Deep Space Dark Mode, Glassmorphism, Micro-Animations, Neon Gradients
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #07090e;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.3);

  /* Primary Accent Gradients */
  --primary-cyan: #00f2fe;
  --primary-blue: #4facfe;
  --primary-purple: #7f00ff;
  --primary-pink: #e100ff;
  --gradient-main: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #00c6ff 100%);
  --gradient-accent: linear-gradient(135deg, #7f00ff 0%, #e100ff 100%);
  --gradient-dark-glass: linear-gradient(180deg, rgba(15, 23, 42, 0.7) 0%, rgba(7, 9, 14, 0.9) 100%);

  /* Typography */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', monospace;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Shadows & Glows */
  --glow-cyan: 0 0 35px rgba(0, 242, 254, 0.25);
  --glow-purple: 0 0 35px rgba(127, 0, 255, 0.25);
  --shadow-glass: 0 20px 40px -15px rgba(0, 0, 0, 0.5);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-cyan);
}

/* Background Canvas & Ambient Orbs */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

.ambient-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.18;
  z-index: -1;
  pointer-events: none;
  animation: pulseGlow 12s infinite alternate ease-in-out;
}

.glow-1 {
  top: -100px;
  left: -100px;
  background: var(--gradient-main);
}

.glow-2 {
  bottom: 10%;
  right: -100px;
  background: var(--gradient-accent);
}

@keyframes pulseGlow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.15; }
  100% { transform: scale(1.2) translate(40px, 30px); opacity: 0.25; }
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 9, 14, 0.6);
  border-bottom: 1px solid var(--border-glass);
  transition: padding var(--transition-fast), background var(--transition-fast);
  transform: translateZ(0);
  will-change: padding, background;
}

.navbar.scrolled {
  padding: 0.85rem 2rem;
  background: rgba(7, 9, 14, 0.85);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.brand-logo img {
  width: 36px;
  height: 36px;
  transition: transform var(--transition-fast);
}

.brand-logo:hover img {
  transform: rotate(10deg) scale(1.08);
}

.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
  will-change: color;
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-main);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-fast);
  border-radius: 2px;
  will-change: transform;
}

.nav-links a:hover::after, .nav-links a.active::after {
  transform: scaleX(1);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  background: var(--gradient-main);
  color: #07090e;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 242, 254, 0.3);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  background: var(--bg-glass);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  border: 1px solid var(--border-glass);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: var(--transition-normal);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

/* Container Structure */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Section Rendering Optimizations */
#projects, #capabilities, #contact {
  content-visibility: auto;
  contain-intrinsic-size: 600px;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 0 4rem;
  text-align: center;
  position: relative;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid var(--border-glow);
  color: var(--primary-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.8s ease-out;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-cyan);
  box-shadow: 0 0 10px var(--primary-cyan);
  animation: blink 1.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

/* Stats Ribbon */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-glass);
}

.stat-item h3 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-tag {
  color: var(--primary-cyan);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  display: block;
}

.section-title {
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* Filter Controls */
.filter-wrapper {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--border-glow);
  color: var(--primary-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

/* Project Cards Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  margin-bottom: 6rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-glow);
  box-shadow: var(--glow-cyan), var(--shadow-glass);
}

.project-thumb {
  position: relative;
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: #000;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-thumb img {
  transform: scale(1.06);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 14, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity var(--transition-normal);
  backdrop-filter: blur(4px);
}

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

.project-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Feature Grid / About Section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 6rem;
}

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

.feature-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-cyan);
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.feature-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Project Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 9, 0.85);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #0f172a;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  padding: 2.5rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), var(--glow-cyan);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-backdrop.active .modal-box {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: #fff;
  border-color: var(--primary-cyan);
}

/* Contact CTA Section */
.cta-box {
  padding: 4rem 2rem;
  background: var(--gradient-dark-glass);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 6rem;
  box-shadow: var(--shadow-glass);
}

.cta-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-glass);
  padding: 3rem 0;
  background: rgba(5, 7, 11, 0.95);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-socials {
  display: flex;
  gap: 1.2rem;
}

.footer-socials a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.1rem;
  transition: color var(--transition-fast);
}

.footer-socials a:hover {
  color: var(--primary-cyan);
}

/* Animations & Utilities */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
