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

:root {
  --bg-void: #020617;
  --bg-card: rgba(15, 23, 42, 0.6);
  --accent-primary: #6366f1;
  --accent-secondary: #10b981;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-shine: rgba(255, 255, 255, 0.1);
}

/* Base resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-void);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 0% 0%, var(--accent-glow) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
  background-attachment: fixed;
}

/* High-End Glassmorphism */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: var(--glass-shine);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
              0 0 20px var(--accent-glow);
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  transition: 0.5s;
}

.glass-card:hover::before {
  left: 100%;
}

/* Next-Gen Hero */
.hero-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 1rem;
}

.hero-image-container {
  position: relative;
  margin-bottom: 2rem;
  width: 180px;
  height: 180px;
}

.hero-profile-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent-primary);
  position: relative;
  z-index: 2;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: var(--accent-glow);
  filter: blur(30px);
  border-radius: 50%;
  z-index: 1;
  animation: pulse 4s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

.hero-badge {
  background: var(--accent-glow);
  color: var(--accent-primary);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2rem;
  border: 1px solid var(--accent-primary);
}

.hero-title {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(to right, #fff, var(--text-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 1.5rem;
  padding: 4rem 10%;
  max-width: 1600px;
  margin: 0 auto;
}

.bento-item {
  grid-column: span 1;
  grid-row: span 1;
  display: flex;
  flex-direction: column;
}

.bento-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  transition: 0.5s ease;
  z-index: 1;
}

.glass-card:hover .bento-img {
  opacity: 0.6;
  transform: scale(1.1);
}

.bento-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.95) 0%, transparent 60%);
  pointer-events: none;
}

.bento-overlay h3, .bento-overlay h4 {
  color: #ffffff !important;
  margin: 0 0 5px 0;
}

.bento-overlay p {
  color: var(--text-dim) !important;
  margin: 0;
  font-size: 0.9rem;
}

.bento-overlay.small {
  justify-content: center;
}

.tech-tag {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-dim);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.3);
}

.project-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--accent-secondary);
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-size: 1.2rem;
  transition: 0.3s;
  pointer-events: auto;
}

.project-link:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 0 15px var(--accent-secondary);
}

.project-link.small {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.bento-item.large {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-item.wide {
  grid-column: span 2;
  grid-row: span 1;
}

/* Custom Nav */
.floating-nav {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
  display: flex;
  gap: 2rem;
  z-index: 1000;
}

.floating-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: 0.3s;
}

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

/* Responsive Overrides */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 2rem 5%;
  }
}

@media (max-width: 768px) {
  .hero-container {
    height: auto;
    padding: 100px 1.5rem;
  }
  
  .hero-image-container {
    width: 140px;
    height: 140px;
  }

  .floating-nav {
    width: 90%;
    justify-content: space-around;
    gap: 0.5rem;
    bottom: 1rem;
    padding: 10px;
  }
}

@media (max-width: 640px) {
  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 2rem;
    padding: 1.5rem;
  }
  
  .bento-grid .glass-card {
    padding: 0;
    height: 380px; /* Default high-impact height for featured projects */
    border-radius: 32px;
  }

  /* Surgical fix: Only the utility apps become small pills */
  .utility-card.glass-card {
    height: 180px !important;
  }

  #about .glass-card {
    height: auto !important;
    padding: 3rem 1.5rem !important;
  }

  .bento-item.large, .bento-item.wide {
    grid-column: span 1;
    grid-row: span 1;
  }

  /* Featured Overlays: Force bottom alignment and safe area */
  .bento-item.large .bento-overlay, .bento-item.wide .bento-overlay, .bento-overlay {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    text-align: left !important;
    padding: 2rem !important;
    padding-bottom: 80px !important;
  }

  /* Utility Overlays: Center text for the smaller cards */
  .utility-card .bento-overlay {
    justify-content: center !important;
    padding-bottom: 2rem !important;
  }

  .bento-item.large h3, .bento-item.wide h3 {
    font-size: 1.3rem !important;
    margin-bottom: 5px !important;
  }

  .floating-nav {
    width: 85%;
    justify-content: space-around;
    gap: 0.5rem;
    bottom: 1.5rem;
    padding: 12px;
    z-index: 100;
  }
}

/* Interactive Background Elements */
.bg-interactive {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg-void);
}

.aura {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  will-change: transform;
  transform: translate3d(var(--mouse-x, 0), calc(var(--mouse-y, 0) + var(--scroll-y, 0)), 0);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.aura-1 {
  width: 60vw;
  height: 60vw;
  background: var(--accent-primary);
  top: -20%;
  left: -10%;
}

.aura-2 {
  width: 40vw;
  height: 40vw;
  background: var(--accent-secondary);
  bottom: -10%;
  right: -5%;
}

.aura-3 {
  width: 80vw;
  height: 80vw;
  background: #1e1b4b;
  top: 30%;
  left: 20%;
  opacity: 0.15;
}

.mouse-glow {
  position: fixed;
  top: -150px;
  left: -150px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: -5;
  will-change: transform;
  transition: transform 0.1s ease-out;
}
