/* home.css - Fixed Homepage with Centered Grid and Animations */

/* Hero Section */
.hero {
  padding: 0;
  margin-bottom: var(--space-3xl);
}

.hero-main {
  padding: var(--space-3xl) var(--space-2xl);
  margin: 0;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  /* Add animation */
  animation: fadeInUp 0.8s ease-out;
}

.hero-main::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
  opacity: 0.2;
  border-radius: 50%;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Pill Row */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.6s ease 0.2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pill {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  background: var(--primary-lighter);
  color: var(--primary-dark);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--primary-light);
  transition: all var(--transition-fast);
}

.pill:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Hero Text */
.hero-text {
  animation: fadeInUp 0.8s ease both;
}

.hero-text h1 {
  margin-bottom: var(--space-xl);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.lead {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-2xl);
  max-width: 90%;
}

/* CTA Section */
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  animation: fadeInUp 1s ease 0.4s both;
}

.icon-link {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.icon-link:hover svg {
  stroke: white;
}

.icon-link svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-secondary);
  transition: stroke var(--transition-fast);
}

/* Mini Contact Section */
.mini {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: fadeInUp 1.2s ease 0.6s both;
}

.mini-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  position: relative;
  font-size: var(--text-sm);
}

.mini-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  opacity: 0.3;
  transition: opacity var(--transition-fast);
}

.mini-link:hover::after {
  opacity: 1;
}

/* Profile Card */
.hero-profile {
  background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  animation: fadeInRight 1s ease both;
  position: relative;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-profile::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  border-radius: var(--radius-2xl);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.hero-profile:hover::before {
  opacity: 0.5;
}

.avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-xl);
  object-fit: cover;
  border: 4px solid var(--bg-primary);
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-xl);
  transition: transform var(--transition-base);
}

.avatar:hover {
  transform: scale(1.02);
}

.profile-meta h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
  font-family: var(--font-display);
}

.profile-meta p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  font-size: var(--text-sm);
}

/* Badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.badge {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--text-xs);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  letter-spacing: 0.02em;
}

.badge:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* What I Build Section */
.section {
  animation: fadeInUp 1s ease 0.3s both;
  width: 100%;
}

.section-head {
  margin-bottom: var(--space-3xl);
  text-align: center;
  width: 100%;
}

.section-head h2 {
  margin-top: 45px;
  font-size: var(--text-4xl);
  margin-bottom: var(--space-md);
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
}

.section-head h2::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
}

.section-head .muted {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  max-width: 600px;
  margin: 0 auto;
}

/* FIXED: Properly Centered Grid */
.tri-grid {
  display: grid;
  /* Fixed: Use exact column count with consistent widths */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
  /* Fixed: Center the grid container */
  width: 100%;
  /* Fixed: Ensure all cards have same width */
  align-items: stretch;
}

.box {
  padding: var(--space-2xl) var(--space-xl);
  text-align: left;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  transition: all var(--transition-base);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease both;
  /* Fixed: Ensure consistent width */
  width: 100%;
  margin: 0;
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  width: 100%;
}
.box:nth-child(1) { animation-delay: 0.1s; }
.box:nth-child(2) { animation-delay: 0.2s; }
.box:nth-child(3) { animation-delay: 0.3s; }
.box:nth-child(4) { animation-delay: 0.4s; }

.box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.box:hover::before {
  transform: scaleX(1);
}

.box:hover {
  transform: translateY(-8px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-2xl);
  background: linear-gradient(135deg, var(--card-bg), var(--bg-primary));
}

.box h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  font-weight: 700;
  font-family: var(--font-display);
}

.box p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.8;
  flex-grow: 1;
  font-size: var(--text-sm);
}

.box .btn.link {
  color: var(--primary);
  font-weight: 600;
  font-size: var(--text-sm);
  align-self: flex-start;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  background: var(--primary-lighter);
  border: 1px solid var(--primary-light);
  text-transform: none;
  letter-spacing: normal;
}

.box .btn.link:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
  .tri-grid {
    /* On medium screens, show 2 columns */
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}


@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .hero-profile {
    order: -1;
    max-width: 500px;
    margin: 0 auto;
  }

  .lead {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .hero-main {
    padding: var(--space-2xl) var(--space-lg);
  }

  .pill-row {
    justify-content: center;
  }

  .hero-text h1,
  .lead,
  .cta {
    text-align: center;
  }

  .cta {
    justify-content: center;
  }

  .mini {
    justify-content: center;
  }

  .tri-grid {
    /* On mobile, show 1 column */
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .section-head h2 {
    font-size: var(--text-3xl);
  }
}

@media (max-width: 480px) {
  .hero-main::before {
    width: 300px;
    height: 300px;
  }

  .pill-row {
    gap: var(--space-xs);
  }

  .pill {
    font-size: 0.7rem;
    padding: 6px 12px;
  }
}
