/* --- Premium Cosmic Variables --- */
:root {
  --bg: #050816;
  --bg-secondary: rgba(11, 17, 32, 0.6); 
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --primary: #60A5FA;
  --secondary: #8B5CF6;
  --glow: rgba(96, 165, 250, 0.25); 
  --border-glass: rgba(255, 255, 255, 0.08);
  --max-width: 1280px; 
}

/* --- Layout Reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }

body {
  font-family: "Inter", -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  padding-top: 140px; 
  overflow-x: hidden;
  position: relative;
}

/* --- Cosmic Dust & Background --- */
#star-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1; pointer-events: none; opacity: 0.6; }
#cursor-glow { position: fixed; top: -50%; left: -50%; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 60%); z-index: 2; pointer-events: none; transform: translate(-50%, -50%); transition: opacity 0.3s; opacity: 0; }

.nebula-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
  animation: float-blob 20s infinite alternate ease-in-out;
}

@keyframes float-blob {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 30px) scale(1.1); }
}

.blob-1 { top: -10%; left: -10%; width: 600px; height: 600px; background: radial-gradient(circle, var(--primary), transparent 70%); }
.blob-2 { bottom: 20%; right: -10%; width: 700px; height: 700px; background: radial-gradient(circle, var(--secondary), transparent 70%); animation-delay: -10s; }

/* --- Antimatter Missiles & Impact Effects --- */
#meteors-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; overflow: hidden; }
#impact-container { position: fixed; inset: 0; pointer-events: none; z-index: 99; }

.meteor {
  position: absolute;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), var(--secondary));
  transform: rotate(-45deg);
  opacity: 0;
}

@keyframes meteor-rise {
  0% { transform: translate(0, 0) rotate(-45deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate(1500px, -1500px) rotate(-45deg); opacity: 0; }
}

.impact-flash {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.9) 0%, rgba(96, 165, 250, 0.5) 40%, transparent 75%);
  transform: translate(-50%, -50%) scale(0);
  animation: impactFlash 0.6s ease-out forwards;
}

@keyframes impactFlash {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; filter: brightness(1.5); }
  100% { transform: translate(-50%, -50%) scale(3); opacity: 0; filter: brightness(1); }
}

.nav-impact {
  position: absolute;
  width: 120px; 
  height: 120px; 
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
  transform: translate(-50%, -50%);
  animation: navGlow 0.8s ease-out forwards;
  pointer-events: none;
}

@keyframes navGlow {
  from { opacity: 1; transform: translate(-50%, -50%) scale(0.2); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(2.5); }
}

/* --- Floating Glass Navbar (CSS Grid Edition) --- */
.glass-nav {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, 95%); 
  border-radius: 20px;
  background: rgba(10, 15, 35, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35), 0 0 20px rgba(96, 165, 250, 0.08);
  z-index: 100;
  display: flex;
  justify-content: center;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-nav.nav-hit {
  animation: navEdgeGlow 0.8s ease-out forwards;
}

@keyframes navEdgeGlow {
  0% {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35), 0 0 20px rgba(96, 165, 250, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
  }
  20% {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35), 0 0 50px rgba(139, 92, 246, 0.6), inset 0 0 25px rgba(139, 92, 246, 0.4), 0 0 25px rgba(96, 165, 250, 0.8);
    border-color: rgba(139, 92, 246, 0.9);
  }
  100% {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35), 0 0 20px rgba(96, 165, 250, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
  }
}

.glass-nav::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(96, 165, 250, 0.15), transparent 70%);
  z-index: -1;
  filter: blur(30px);
}

header nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  height: 70px;
  padding: 0 32px;
  position: relative;
}

.logo { 
  font-weight: 800; 
  font-size: 1.4rem; 
  letter-spacing: 0.05em; 
  text-transform: uppercase; 
  color: var(--text); 
  position: static; 
  justify-self: start;
}
.logo span { color: var(--primary); }

.small-nav-btn { 
  padding: 8px 16px; 
  font-size: 0.85rem; 
  position: static; 
  justify-self: end;
}

header ul { display: flex; list-style: none; gap: 40px; margin: 0; justify-self: center; }

header a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.3s;
  position: relative;
}

header ul a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #60A5FA, #8B5CF6);
  transition: width 0.3s ease;
}

header a:hover { color: var(--text); }
header ul a:hover::after { width: 100%; }

/* --- Base Containers --- */
main {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

section { padding: 80px 0; }

.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

.text-gradient { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h3.section-title { font-size: 2.2rem; margin-bottom: 60px; font-weight: 700; text-align: center; width: 100%; }

/* --- Glass Cards --- */
.glass-card {
  background: var(--bg-secondary);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.glass-card:hover { border-color: rgba(96, 165, 250, 0.6); box-shadow: 0 15px 50px var(--glow); transform: translateY(-4px); }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 28px; font-size: 1rem; font-weight: 600; border-radius: 8px; text-decoration: none; transition: all 0.2s ease; cursor: pointer; border: 1px solid transparent;}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary:hover { background: #e2e8f0; }
.btn.primary.outline { background: transparent; color: var(--text); border-color: var(--text); }
.btn.primary.outline:hover { background: rgba(255,255,255,0.1); }
.btn.secondary { background: rgba(255,255,255,0.05); color: var(--text); border-color: var(--border-glass); }
.btn.secondary:hover { background: rgba(255,255,255,0.1); }
.btn.full-width { width: 100%; margin-top: 16px; padding: 16px; font-size: 1.1rem; }

/* New WhatsApp Button */
.btn.whatsapp { background: transparent; color: #10b981; border-color: #10b981; }
.btn.whatsapp:hover { background: rgba(16, 185, 129, 0.1); box-shadow: 0 0 15px rgba(16, 185, 129, 0.2); }

/* --- Centered Hero Section --- */
.hero-centered { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 60px 0 60px 0; max-width: 1000px; margin: 0 auto; }
.hero-content { width: 100%; transform: translateY(0); }

.hero-eyebrow { display: inline-block; padding: 6px 16px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass); border-radius: 100px; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; letter-spacing: 0.05em; }

.hero-title { font-size: 3.5rem; line-height: 1.2; max-width: 850px; margin: 0 auto 24px auto; font-weight: 800; letter-spacing: -0.02em; }
.hero-subtitle { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 40px; max-width: 700px; margin-left: auto; margin-right: auto; }

.centered-btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-bottom: 40px; }
.centered-btns .btn { min-width: 200px; } 

.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 32px; margin-top: 20px; padding-top: 40px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.stat-item { color: var(--text-muted); font-size: 1.05rem; font-weight: 500; }

/* --- 60/40 Projects Showcase --- */
.project-showcase { display: flex; align-items: center; gap: 60px; margin-bottom: 100px; }
.project-showcase.reverse { flex-direction: row-reverse; }
.project-visual { flex: 6; perspective: 1000px; } 
.project-details { flex: 4; display: flex; flex-direction: column; justify-content: center; } 
.project-details h3 { font-size: 2.2rem; margin-bottom: 12px; }
.feature-list { list-style: none; margin-bottom: 32px; }
.feature-list li { margin-bottom: 12px; padding-left: 28px; position: relative; color: var(--text); font-weight: 500; font-size: 0.95rem; }
.feature-list.small li { font-weight: 400; color: var(--text-muted); }
.feature-list li::before { content: '✓'; position: absolute; left: 0; color: var(--primary); }
.project-actions { display: flex; gap: 16px; flex-direction: column; }

/* --- Case Studies & Tech Stack --- */
.mini-case-study { background: rgba(96, 165, 250, 0.05); border-left: 3px solid var(--primary); padding: 16px; margin-bottom: 24px; border-radius: 0 8px 8px 0; }
.mini-case-study p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 8px; }
.mini-case-study p:last-child { margin-bottom: 0; }
.mini-case-study strong { color: var(--text); font-weight: 600; }

.tech-stack { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 24px; padding: 8px 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-glass); border-radius: 6px; display: inline-block; }
.tech-stack strong { color: var(--text); font-weight: 600; }

.browser-mockup { overflow: hidden; padding-top: 0; transition: transform 0.1s ease-out; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.browser-header { background: rgba(0,0,0,0.4); padding: 12px 16px; display: flex; align-items: center; border-bottom: 1px solid var(--border-glass); }
.mac-dots { display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background-color: #ef4444; } .dot.yellow { background-color: #f59e0b; } .dot.green { background-color: #10b981; }
.url-bar { flex-grow: 1; text-align: center; font-family: monospace; color: var(--text-muted); font-size: 0.8rem; opacity: 0.5; }
.mockup-img { width: 100%; height: auto; display: block; filter: brightness(0.95); }

/* --- About & Contact Layout --- */
.about-content { padding: 60px; max-width: 800px; margin: 0 auto; display: flex; justify-content: center; }
.about-text h3 { font-size: 2.2rem; margin-bottom: 16px; }
.about-text p { color: var(--text-muted); margin-bottom: 16px; font-size: 1.1rem; }
.about-text strong { color: var(--text); }

.about-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.stat-badge { background: rgba(139, 92, 246, 0.1); color: var(--secondary); border: 1px solid rgba(139, 92, 246, 0.3); padding: 6px 14px; border-radius: 100px; font-size: 0.85rem; font-weight: 600; }

.glass-footer { padding: 80px 24px; margin-top: 60px; }
.contact-container { max-width: 800px; margin: 0 auto; padding: 60px; text-align: center; border-color: rgba(96, 165, 250, 0.4); box-shadow: 0 10px 50px rgba(96, 165, 250, 0.1); }
.contact-container h3 { margin-bottom: 16px; font-size: 2.5rem; }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; }
.contact-links .btn { min-width: 180px; }

/* --- Responsive Layout --- */
@media (max-width: 968px) {
  .hero-title { font-size: 2.8rem; max-width: 100%; }
  .centered-btns { flex-direction: column; justify-content: center; gap: 16px; }
  .btn { width: 100%; margin-bottom: 10px; }
  .hero-stats { gap: 16px; flex-direction: column; }
  
  header nav { display: flex; justify-content: space-between; }
  .logo, .small-nav-btn { position: static; }
  
  .glass-nav { top: 0; width: 100%; border-radius: 0; border-left: none; border-right: none; border-top: none; }
  .small-nav-btn { width: auto; margin-bottom: 0; }
  header nav ul { display: none; } 

  .project-showcase, .project-showcase.reverse { flex-direction: column; gap: 40px; }
  .project-actions { flex-direction: row; justify-content: center; }
  
  .about-content, .contact-container { padding: 40px 24px; text-align: center; }
  .contact-links { flex-direction: column; }
}