/* ===========================
   VARIABLES & RESET
   =========================== */
:root {
  --bg-dark: #0a0e1a;
  --bg-gradient-1: #0f1419;
  --bg-gradient-2: #1a1f2e;
  --card-bg: #151923;
  --card-hover: #1c2130;
  --text-primary: #ffffff;
  --text-secondary: #a8b2d1;
  --text-muted: #6b7694;
  --accent-primary: #64ffda;
  --accent-secondary: #4facfe;
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-orange: #ff6b6b;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* ===========================
   ANIMATED BACKGROUND
   =========================== */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #0a0e1a 0%, #0f1419 50%, #1a1f2e 100%);
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 20s infinite ease-in-out;
}

.shape-1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.shape-2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  bottom: -150px;
  right: -150px;
  animation-delay: 5s;
}

.shape-3 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #fa709a, #fee140);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, 50px) scale(1.1); }
  50% { transform: translate(-30px, 80px) scale(0.9); }
  75% { transform: translate(40px, -40px) scale(1.05); }
}

/* ===========================
   CONTAINER
   =========================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   HERO SECTION
   =========================== */
.hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
}

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

.hero-badge {
  display: inline-block;
  padding: 8px 20px;
  background: rgba(100, 255, 218, 0.1);
  border: 1px solid rgba(100, 255, 218, 0.3);
  border-radius: 50px;
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
  animation: fadeInDown 0.8s ease-out;
}

.hero-title {
  font-family: 'Space Grotesk', 'Poppins', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #4facfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: 48px;
  line-height: 1.8;
  animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===========================
   SEARCH SECTION
   =========================== */
.search-section {
  padding: 40px 0;
  animation: fadeIn 1s ease-out 0.8s backwards;
}

.search-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 16px 20px 16px 52px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#search:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(100, 255, 218, 0.1);
}

#search::placeholder {
  color: var(--text-muted);
}

/* ===========================
   PROJECTS GRID
   =========================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  padding: 40px 0 80px;
}

.project-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translateY(30px);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(100, 255, 218, 0.3);
  background: var(--card-hover);
}

.card-link {
  display: flex;
  flex-direction: column;
  padding: 28px;
  text-decoration: none;
  color: inherit;
  height: 100%;
  min-height: 260px;
}

.project-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.project-card:hover .project-icon {
  transform: scale(1.15) rotate(5deg);
}

.project-content {
  flex: 1;
}

.project-category {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(100, 255, 218, 0.1);
  border: 1px solid rgba(100, 255, 218, 0.2);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.project-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.3;
}

.project-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.view-project {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.3s ease;
}

.project-card:hover .view-project {
  gap: 12px;
}

.arrow {
  transition: transform 0.3s ease;
}

.project-card:hover .arrow {
  transform: translateX(4px);
}

.repo-link {
  color: var(--text-muted);
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
}

.repo-link:hover {
  color: var(--accent-primary);
}

.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.no-results p {
  font-size: 1.2rem;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 60px 0 32px;
  margin-top: 80px;
  backdrop-filter: blur(10px);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-section h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-section a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 12px;
  transition: color 0.3s ease;
  font-size: 0.95rem;
}

.footer-section a:hover {
  color: var(--accent-primary);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  padding: 6px 14px;
  background: rgba(100, 255, 218, 0.1);
  border: 1px solid rgba(100, 255, 218, 0.2);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--accent-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 768px) {
  .hero {
    padding: 80px 0 60px;
  }

  .hero-stats {
    gap: 32px;
  }

  .stat-number {
    font-size: 2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .search-section {
    padding: 32px 0;
  }
}

@media (max-width: 480px) {
  .hero-stats {
    flex-direction: column;
    gap: 24px;
  }

  .container {
    padding: 0 16px;
  }

  .card-link {
    padding: 20px;
    min-height: 240px;
  }

  .project-icon {
    font-size: 3rem;
  }
}

/* ===========================
   ACCESSIBILITY
   =========================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}