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

:root {
  --primary: #0f172a;
  --secondary: #1e293b;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --border: #334155;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--primary) 0%, #0a0e27 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* Page background animation */
.page-bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Floating card animation for Rummy Place */
@keyframes floatingCard {
  0%, 100% {
    transform: translateY(0) rotateZ(0deg);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-30px) rotateZ(10deg);
    opacity: 0.9;
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==================== NAVBAR ==================== */
.navbar {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
}

.logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.3rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.25);
}

.nav-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  justify-content: center;
}

.nav-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.nav-brand-label {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.nav-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.nav-motto {
  font-size: 0.7rem;
  color: rgba(203, 213, 225, 0.6);
  margin: 0.15rem 0 0 0;
  font-weight: 300;
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.contact-btn {
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
}

.contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.4);
  background: var(--accent-light);
}

/* ==================== PROJECTS SECTION ==================== */
.projects {
  padding: 60px 0 80px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}

/* Base Card Styles */
.project-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(51, 65, 85, 0.5);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(30, 41, 59, 0.8);
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2);
}

/* Doodle Party specific animations */
.project-card#project-doodleparty {
  animation: drawingEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes drawingEntrance {
  0% {
    opacity: 0;
    transform: scale(0.9) rotateZ(-5deg);
  }
  50% {
    transform: rotateZ(1deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateZ(0);
  }
}

/* Rummy Place specific animations */
.project-card#project-rummyplace {
  animation: cardFlipEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardFlipEntrance {
  0% {
    opacity: 0;
    transform: rotateY(-90deg) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: rotateY(0) scale(1);
  }
}

.project-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  transition: all 0.4s ease;
  position: relative;
  z-index: 2;
}

.project-card:hover .project-image {
  transform: scale(1.08);
  filter: brightness(1.1);
}

.project-content {
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.project-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.online-badge {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-light);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% {
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }
  50% {
    background: rgba(59, 130, 246, 0.25);
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.5);
  }
}

.online-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

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

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.tag {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-light);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.tag:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-light);
  transform: translateY(-2px);
}

.project-footer {
  display: flex;
  gap: 1rem;
}

.play-btn {
  flex: 1;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, #60a5fa 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

.play-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  z-index: 0;
}

.play-btn:hover::before {
  width: 400px;
  height: 400px;
}

.play-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
}

.play-btn span {
  position: relative;
  z-index: 1;
}

.share-btn {
  padding: 0.9rem 1.2rem;
  background: transparent;
  color: var(--accent-light);
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s ease;
}

.share-btn:hover {
  border-color: var(--accent-light);
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ==================== STATS SECTION ==================== */
.stats {
  padding: 60px 0;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.stat-card {
  text-align: center;
  padding: 2rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(30, 41, 59, 0.8);
  transform: translateY(-4px);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-number {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: countUp 1s ease-out;
}

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

.stat-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ==================== FOOTER ==================== */
.footer {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  color: var(--text-secondary);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

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

.footer-section h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 700;
}

.footer-section p {
  line-height: 1.8;
}

.footer-section a {
  color: var(--accent-light);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.footer-section a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-light);
  transition: width 0.3s ease;
}

.footer-section a:hover::after {
  width: 100%;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.75rem;
}

.footer-bottom {
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .nav-brand {
    gap: 0.75rem;
  }

  .nav-brand-label {
    font-size: 1.1rem;
  }

  .nav-title {
    font-size: 0.7rem;
  }

  .nav-motto {
    font-size: 0.7rem;
  }

  .project-name {
    font-size: 1.2rem;
  }

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

@media (max-width: 480px) {
  .projects-grid {
    gap: 1.5rem;
  }

  .project-content {
    padding: 1.5rem;
  }

  .project-footer {
    flex-direction: column;
  }

  .play-btn,
  .share-btn {
    width: 100%;
  }

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