/* ===================================
   CSS Custom Properties (Variables)
   =================================== */
:root {
  /* Color Scheme */
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #f093fb;
  --text-light: #ffffff;
  --text-dark: #2d3748;
  --bg-dark: #1a202c;
  --bg-light: #f7fafc;
  
  /* Gradient Colors */
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-animated: linear-gradient(270deg, #667eea, #764ba2, #f093fb, #667eea);
  
  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-size-xs: 0.875rem;
  --font-size-sm: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.5rem;
  --font-size-xl: 2rem;
  --font-size-2xl: 3rem;
  --font-size-3xl: 4rem;
  
  /* Animation Timings */
  --transition-fast: 0.2s;
  --transition-normal: 0.4s;
  --transition-slow: 0.8s;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  
  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.4);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast) ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===================================
   Utility Classes
   =================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section-title {
  font-size: var(--font-size-2xl);
  text-align: center;
  margin-bottom: var(--spacing-lg);
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===================================
   Hero Section
   =================================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: var(--spacing-md);
  text-align: center;
}

.hero-content {
  z-index: 2;
}

.hero-name {
  font-size: var(--font-size-3xl);
  color: var(--text-light);
  margin-bottom: var(--spacing-sm);
}

.hero-title {
  font-size: var(--font-size-lg);
  color: var(--text-light);
  opacity: 0.9;
}

.scroll-indicator {
  position: absolute;
  bottom: var(--spacing-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-arrow {
  font-size: var(--font-size-xl);
  color: var(--text-light);
  opacity: 0.7;
  display: block;
}

/* ===================================
   Skills Section
   =================================== */
.skills-section {
  padding: var(--spacing-xl) var(--spacing-md);
  background-color: var(--bg-light);
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  max-width: 1200px;
  margin: 0 auto;
}

.skill-card {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  text-align: center;
  transition: transform var(--transition-normal) ease;
}

.skill-card h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-sm);
  color: var(--text-dark);
}

.skill-card p {
  font-size: var(--font-size-sm);
  color: var(--text-dark);
  opacity: 0.8;
}

/* ===================================
   Contact Section
   =================================== */
.contact-section {
  padding: var(--spacing-xl) var(--spacing-md);
  background: var(--gradient-1);
  text-align: center;
}

.contact-section .section-title {
  color: var(--text-light);
  -webkit-text-fill-color: var(--text-light);
}

.contact-description {
  font-size: var(--font-size-md);
  color: var(--text-light);
  margin-bottom: var(--spacing-md);
  opacity: 0.9;
}

.email-link {
  display: inline-block;
  font-size: var(--font-size-lg);
  color: var(--text-light);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid var(--text-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal) ease;
  font-weight: 600;
}

/* ===================================
   Footer
   =================================== */
.footer {
  padding: var(--spacing-md);
  text-align: center;
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-size: var(--font-size-xs);
}

/* ===================================
   Responsive Design - Tablet (768px+)
   =================================== */
@media (min-width: 768px) {
  .hero-name {
    font-size: 5rem;
  }
  
  .hero-title {
    font-size: var(--font-size-xl);
  }
  
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }
  
  .section-title {
    font-size: var(--font-size-3xl);
  }
  
  .email-link {
    font-size: var(--font-size-xl);
  }
}

/* ===================================
   Responsive Design - Desktop (1024px+)
   =================================== */
@media (min-width: 1024px) {
  .hero-name {
    font-size: 6rem;
  }
  
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .skills-section {
    padding: var(--spacing-xl) var(--spacing-lg);
  }
  
  .contact-section {
    padding: var(--spacing-xl) var(--spacing-lg);
  }
}

/* ===================================
   Responsive Design - Large Desktop (1440px+)
   =================================== */
@media (min-width: 1440px) {
  .hero-name {
    font-size: 7rem;
  }
  
  .container {
    max-width: 1400px;
  }
}

/* ===================================
   Animated Gradient Background
   =================================== */
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(270deg, #667eea, #764ba2, #f093fb, #f5576c);
  background-size: 800% 800%;
  animation: gradientShift 15s ease infinite;
  z-index: 1;
}

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

/* ===================================
   Scroll Indicator Animation
   =================================== */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.scroll-arrow {
  animation: bounce 2s infinite;
}

/* ===================================
   Glassmorphism Effect for Skill Cards
   =================================== */
.skills-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  position: relative;
}

.skill-card {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  opacity: 0;
  transition: opacity var(--transition-normal) ease;
  z-index: 0;
}

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

.skill-card h3,
.skill-card p {
  position: relative;
  z-index: 1;
}

/* ===================================
   Hover Effects & Micro-interactions
   =================================== */
.skill-card:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.email-link:hover {
  background-color: var(--text-light);
  color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.email-link:active {
  transform: translateY(-1px);
}

/* Smooth color transitions */
.skill-card h3 {
  transition: color var(--transition-fast) ease;
}

.skill-card:hover h3 {
  color: var(--primary-color);
}

/* Interactive cursor feedback */
.skill-card,
.email-link,
.scroll-arrow {
  cursor: pointer;
}

/* ===================================
   Floating & Pulsing Animations
   =================================== */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

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

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

.hero-name {
  animation: float 4s ease-in-out infinite, fadeInUp 1s ease-out;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-title {
  animation: pulse 3s ease-in-out infinite, fadeInUp 1s ease-out 0.3s backwards;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ===================================
   Performance Optimizations
   =================================== */

/* GPU-accelerated animations */
.hero-name,
.hero-title,
.skill-card,
.email-link {
  will-change: transform;
}

/* Remove will-change after animation completes */
.hero-name,
.hero-title {
  animation-fill-mode: forwards;
}

/* Optimize repaints */
.hero-section::before {
  will-change: background-position;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .hero-section::before {
    animation: none;
  }
  
  .scroll-arrow {
    animation: none;
  }
}

/* Optimize font loading */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Prevent layout shift */
.hero-section,
.skills-section,
.contact-section {
  min-height: fit-content;
}

/* ===================================
   Browser Compatibility & Fallbacks
   =================================== */

/* Backdrop-filter fallback for older browsers */
@supports not (backdrop-filter: blur(10px)) {
  .skill-card {
    background: rgba(255, 255, 255, 0.9);
  }
}

/* Flexbox fallback for older browsers */
.hero-section {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}

/* Grid fallback */
@supports not (display: grid) {
  .skills-grid {
    display: flex;
    flex-wrap: wrap;
  }
  
  .skill-card {
    flex: 1 1 300px;
    margin: var(--spacing-sm);
  }
}

/* Gradient text fallback */
@supports not (background-clip: text) {
  .section-title {
    color: var(--primary-color);
    -webkit-text-fill-color: var(--primary-color);
  }
}

/* Transform fallback */
@supports not (transform: translateY(-8px)) {
  .skill-card:hover {
    margin-top: -8px;
  }
}
