/* CSS Variables */
:root {
  --bg: #fafbfc;
  --text: #0a0e1a;
  --muted: #5f6a7f;
  --card: rgba(255, 255, 255, 0.7);
  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #ec4899;
  --border: rgba(99, 102, 241, 0.1);
  --glass: rgba(255, 255, 255, 0.4);
  --shadow: rgba(99, 102, 241, 0.15);
  
  /* Dynamic section colors */
  --section-color-1: 99, 102, 241;    /* Indigo - Hero */
  --section-color-2: 139, 92, 246;    /* Purple - About */
  --section-color-3: 236, 72, 153;    /* Pink - Projects */
  --section-color-4: 59, 130, 246;    /* Blue - Contact */
}

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

html {
  scroll-behavior: smooth;
}

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

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

/* Animated Background */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  opacity: 0;
  transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.bg-gradient.active {
  opacity: 1;
}

/* Hero gradient (default) */
.bg-hero {
  background: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(236, 72, 153, 0.06) 0%, transparent 50%);
  opacity: 1; /* Start visible */
}

/* About gradient - Red */
.bg-about {
  background: 
    radial-gradient(circle at 20% 50%, rgba(239, 68, 68, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(220, 38, 38, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(248, 113, 113, 0.06) 0%, transparent 50%);
}

/* Projects gradient - Yellow/Amber */
.bg-projects {
  background: 
    radial-gradient(circle at 20% 50%, rgba(251, 191, 36, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(249, 115, 22, 0.06) 0%, transparent 50%);
}

/* Contact gradient - Blue */
.bg-contact {
  background: 
    radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
}

/* Floating Shapes */
.floating-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

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

.shape-1 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  top: -200px;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  top: 50%;
  right: 5%;
  animation-delay: 5s;
}

.shape-3 {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-1));
  bottom: -100px;
  left: 30%;
  animation-delay: 10s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-30px) rotate(5deg); }
  50% { transform: translateY(0) rotate(10deg); }
  75% { transform: translateY(30px) rotate(5deg); }
}

/* Header */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}

.brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.3s ease;
}

.brand-bracket {
  color: var(--accent-1);
  font-family: 'JetBrains Mono', monospace;
}

.brand-name {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand:hover {
  transform: translateY(-2px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link:hover::after {
  width: 100%;
}

.icon-link {
  color: var(--muted);
  transition: all 0.3s ease;
  display: inline-flex;
}

.icon-link:hover {
  color: var(--accent-1);
  transform: translateY(-2px);
}

/* Main Content */
main {
  padding: 4rem 0;
}

/* Hero Section */
.hero {
  display: grid;
  gap: 4rem;
  align-items: center;
  padding: 4rem 0;
  min-height: 80vh;
}

@media (min-width: 968px) {
  .hero {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-label {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease 0.1s backwards;
}

.hero-greeting {
  display: block;
  font-size: 0.6em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.hero-name {
  display: block;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease 0.2s backwards;
}

.highlight {
  color: var(--accent-1);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.3s backwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  border: none;
  box-shadow: 0 8px 24px var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--shadow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-ghost:hover {
  background: var(--card);
  border-color: var(--accent-1);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  animation: fadeInUp 0.6s ease 0.4s backwards;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Code Window */
.hero-visual {
  animation: fadeInUp 0.6s ease 0.5s backwards;
}

.code-window {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px var(--shadow);
}

.window-header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
}

.window-dots {
  display: flex;
  gap: 0.5rem;
}

.window-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.5;
}

.window-dots span:nth-child(1) { background: #ff5f56; }
.window-dots span:nth-child(2) { background: #ffbd2e; }
.window-dots span:nth-child(3) { background: #27c93f; }

.window-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: var(--muted);
}

.window-content {
  padding: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.8;
  overflow-x: auto;
}

.code-keyword { color: #c678dd; }
.code-var { color: #e06c75; }
.code-property { color: #61afef; }
.code-string { color: #98c379; }
.code-boolean { color: #d19a66; }

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-1);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
}

/* About Section */
.about-section {
  padding: 6rem 0;
}

.about-content {
  max-width: 800px;
  margin: 0 auto 4rem;
  text-align: center;
}

.about-text {
  font-size: 1.125rem;
  color: var(--muted);
  line-height: 1.8;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.skill-card {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: all 0.4s ease;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease var(--delay) forwards;
}

.skill-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px var(--shadow);
  border-color: var(--accent-1);
}

.skill-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.skill-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.skill-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Projects Section */
.projects-section {
  padding: 6rem 0;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.project-card {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s ease;
  opacity: 0;
  transform: translateY(30px);
}

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

.project-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 70px var(--shadow);
}

.project-card.featured {
  grid-column: span 2;
}

@media (max-width: 768px) {
  .project-card.featured {
    grid-column: span 1;
  }
}

.project-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

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

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

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(139, 92, 246, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

.project-link {
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  border: 2px solid white;
  transition: all 0.3s ease;
}

.project-link:hover {
  background: white;
  color: var(--accent-1);
  transform: scale(1.05);
}

.project-content {
  padding: 1.5rem;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tag {
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  color: var(--accent-1);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.project-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.project-content p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Contact Section */
.contact-section {
  padding: 6rem 0;
}

.contact-wrapper {
  display: grid;
  gap: 3rem;
  margin-top: 3rem;
}

@media (min-width: 968px) {
  .contact-wrapper {
    grid-template-columns: 1fr 1.5fr;
  }
}

.contact-info-box {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
}

.contact-info-box h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.contact-info-box p {
  color: var(--muted);
  margin-bottom: 2rem;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateX(-20px);
}

.contact-method.reveal {
  opacity: 1;
  transform: translateX(0);
}

.contact-method:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  transform: translateX(4px);
}

.method-icon {
  font-size: 2rem;
}

.method-label {
  font-size: 0.875rem;
  color: var(--muted);
}

.method-value {
  font-weight: 600;
  color: var(--text);
}

.contact-form {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(99, 102, 241, 0.03);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  margin-top: 4rem;
  background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.02));
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
  font-size: 1.25rem;
}

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

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent-1);
}

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

.reveal {
  animation: fadeInUp 0.6s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  .nav {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.9rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }
}

/* Extra small screens - code window adjustments */
@media (max-width: 450px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .code-window {
    font-size: 0.75rem;
  }

  .window-content {
    padding: 1rem;
    font-size: 0.75rem;
    line-height: 1.6;
  }

  .window-header {
    padding: 0.5rem 0.75rem;
  }

  .window-title {
    font-size: 0.75rem;
  }

  .window-dots span {
    width: 10px;
    height: 10px;
  }

  .container {
    padding: 0 1rem;
  }

  .hero-label {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }

  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }
}

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