/* ==========================================
   CSS Variables & Base Styles
   ========================================== */
:root {
  --bg-dark: rgb(22, 33, 62);
  --bg-darker: rgb(15, 23, 45);
  --bg-card: rgba(22, 33, 62, 0.95);
  --accent-primary: #4facfe;
  --accent-secondary: #00f2fe;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.6);
  --border-glow: rgba(79, 172, 254, 0.3);
  --shadow-glow: rgba(79, 172, 254, 0.2);
  --particle-color: rgb(47, 98, 194);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: transparent;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--accent-secondary);
}

/* ==========================================
   Navigation
   ========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  background: rgba(15, 23, 45, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translateY(-20px);
  animation: fadeSlideDown 0.8s ease 0.5s forwards;
}

@keyframes fadeSlideDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 30px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  color: var(--text-primary);
  background: rgba(79, 172, 254, 0.2);
  box-shadow: 0 0 20px var(--shadow-glow);
}

/* ==========================================
   Hero Section
   ========================================== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 100px 20px 60px;
  overflow: hidden;
  background: transparent;
}

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

#particleCanvas canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: -1 !important;
  pointer-events: none !important;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeSlideUp 1s ease 0.3s forwards;
}

@keyframes fadeSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-size: clamp(36px, 8vw, 72px);
  font-weight: 700;
  margin-bottom: 20px;
  text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.5);
  letter-spacing: -1px;
}

.gradient-text {
  background: linear-gradient(
    270deg,
    #4facfe,
    #00f2fe,
    #4facfe,
    #00f2fe,
    #4facfe
  );
  background-size: 400% 400%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: gradientFlow 8s ease infinite;
}

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

#cursor {
  display: inline-block;
  width: 4px;
  height: 0.9em;
  background-color: rgba(255, 255, 255, 0.9);
  margin-left: 2px;
  animation: blink 1s steps(2, start) infinite;
  vertical-align: middle;
}

@keyframes blink {
  to { visibility: hidden; }
}

.hero-bio {
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.4);
  line-height: 1.7;
}

.hero-tagline {
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.5);
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.projects-btn,
.resume-btn {
  display: inline-block;
  padding: 18px 50px;
  font-size: 20px;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2),
              0 0 20px rgba(255, 255, 255, 0.1);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  text-decoration: none;
}

.projects-btn:hover,
.resume-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3),
              0 0 30px rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
  color: var(--text-primary);
}

.projects-btn:active,
.resume-btn:active {
  transform: translateY(0);
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
  opacity: 0;
  animation: fadeIn 1s ease 1.5s forwards, bounce 2s ease-in-out 2s infinite;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

.scroll-indicator svg {
  width: 24px;
  height: 24px;
}

/* ==========================================
   Section Styles (Shared)
   ========================================== */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 15px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 40px;
}

/* ==========================================
   Skills Section
   ========================================== */
.skills-section {
  padding: 80px 0;
  background: transparent;
  position: relative;
}

.skills-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(to bottom, transparent 0%, transparent 30%, var(--bg-dark) 100%);
  pointer-events: none;
  z-index: 0;
}

.skills-section .section-container {
  position: relative;
  z-index: 1;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

.skill-category {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
}

.skill-category::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(79, 172, 254, 0.15) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.skill-category:hover::before {
  opacity: 1;
}

.skill-category:hover {
  transform: translateY(-5px);
  border-color: var(--border-glow);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3),
              0 0 30px var(--shadow-glow);
}

.skill-category.animate-in {
  animation: skillSlideIn 0.6s ease forwards;
}

@keyframes skillSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 15px;
}

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

.skill-tag {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  transition: all 0.3s ease;
  cursor: default;
}

.skill-tag:hover {
  color: var(--text-primary);
  background: rgba(79, 172, 254, 0.2);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px var(--shadow-glow);
  transform: scale(1.05);
}

/* ==========================================
   Projects Section
   ========================================== */
.projects-section {
  padding: 80px 0;
  background: var(--bg-dark);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

/* Upside-down L layout */
.project-gcr {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

.project-jarvis {
  grid-column: 2;
  grid-row: 1;
  grid-row-end: span 3;
  align-self: start;
}

.project-cvcg {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
}

.project-sttt {
  grid-column: 1;
  grid-row: 3;
  align-self: start;
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .project-gcr,
  .project-jarvis,
  .project-cvcg,
  .project-sttt {
    grid-column: 1;
  }
}

.project-card {
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  transform: translateY(50px);
}

.project-card.animate-in {
  animation: projectSlideIn 0.7s ease forwards;
}

@keyframes projectSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: var(--border-glow);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5),
              0 0 50px var(--shadow-glow);
}

.project-image {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.project-gcr .project-image {
  height: 220px;
}

.project-jarvis .project-image {
  height: 700px;
}

.project-image img,
.project-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-jarvis .project-image video {
  object-fit: contain;
  background: var(--bg-darker);
}

.project-card:hover .project-image img,
.project-card:hover .project-image video {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(15, 23, 45, 0.95) 0%,
    rgba(15, 23, 45, 0.5) 50%,
    transparent 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-btn {
  padding: 12px 30px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 30px;
  transform: translateY(20px);
  transition: all 0.4s ease;
  box-shadow: 0 4px 20px var(--shadow-glow);
}

.project-card:hover .project-btn {
  transform: translateY(0);
}

.project-btn:hover {
  box-shadow: 0 8px 30px var(--shadow-glow);
  color: var(--text-primary);
}

.project-info {
  padding: 30px;
}

.project-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.project-card:hover .project-title {
  color: var(--accent-primary);
}

.project-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tech-tag {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-primary);
  background: rgba(79, 172, 254, 0.1);
  border: 1px solid rgba(79, 172, 254, 0.3);
  border-radius: 15px;
}

.project-links {
  display: flex;
  gap: 15px;
}

.project-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.project-link svg {
  width: 16px;
  height: 16px;
}

.project-link:hover {
  color: var(--text-primary);
  background: rgba(79, 172, 254, 0.2);
  box-shadow: 0 0 20px var(--shadow-glow);
}

/* ==========================================
   Connect Section
   ========================================== */
.connect-section {
  padding: 80px 0;
  background: var(--bg-darker);
  position: relative;
}

.connect-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, var(--bg-dark), transparent);
  pointer-events: none;
}

.connect-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
  max-width: 1000px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .connect-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .connect-grid {
    grid-template-columns: 1fr;
  }
}

.connect-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 20px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
}

.connect-card.animate-in {
  animation: connectSlideIn 0.6s ease forwards;
}

@keyframes connectSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.connect-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent-primary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
              0 0 40px var(--shadow-glow);
  color: var(--text-primary);
}

.connect-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.2), rgba(0, 242, 254, 0.2));
  border-radius: 50%;
  transition: all 0.4s ease;
}

.connect-icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent-primary);
  transition: all 0.4s ease;
}

.connect-card:hover .connect-icon {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 0 30px var(--shadow-glow);
}

.connect-card:hover .connect-icon svg {
  color: white;
  transform: scale(1.1);
}

.connect-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.connect-handle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================
   Footer
   ========================================== */
.footer {
  padding: 40px 20px;
  text-align: center;
  background: var(--bg-darker);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 768px) {
  .navbar {
    padding: 15px 10px;
  }

  .nav-container {
    gap: 5px;
    padding: 6px 10px;
  }

  .nav-link {
    padding: 8px 16px;
    font-size: 12px;
  }

  .hero-section {
    padding: 80px 20px 40px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .projects-btn,
  .resume-btn {
    width: 100%;
    max-width: 250px;
  }

  .hero-links {
    flex-direction: column;
    align-items: center;
  }

  .hero-link {
    width: 100%;
    max-width: 250px;
    justify-content: center;
  }

  .section-title {
    font-size: 28px;
  }

  .section-subtitle {
    font-size: 16px;
    margin-bottom: 40px;
  }

  .skills-section,
  .projects-section,
  .connect-section {
    padding: 80px 0;
  }

  .project-image {
    height: 180px;
  }

  .project-info {
    padding: 20px;
  }

  .scroll-indicator {
    display: none;
  }
}

@media (max-width: 480px) {
  .nav-link {
    padding: 6px 12px;
    font-size: 11px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-bio {
    font-size: 14px;
  }

  .category-header h3 {
    font-size: 18px;
  }

  .project-title {
    font-size: 18px;
  }

  .connect-card {
    padding: 30px 20px;
  }
}

/* ==========================================
   Utility Classes
   ========================================== */
.hidden {
  opacity: 0;
  visibility: hidden;
}

.visible {
  opacity: 1;
  visibility: visible;
}
