:root {
  /* Fluid spacing that breathes with the viewport */
  --gap: clamp(1rem, 2.5vw, 2.5rem);
  --gap-xs: clamp(0.5rem, 1vw, 1rem);
  --gap-lg: clamp(2rem, 5vw, 4rem);
  --max-width: 1200px;
  
  /* Quantum color palette - each shade carefully calibrated for maximum impact */
  --gold-1: #FFD166; --gold-2: #FFB703; --gold-3: #FFCB08; --gold-4: #F9C23C;
  --blue-1: #00B4FF; --blue-2: #0057FF; --blue-3: #0099E6; --blue-4: #2196F3;
  --purple-1: #8A2BE2; --purple-2: #A855F7; --purple-3: #C084FC; --purple-4: #9C27B0;
  --black-1: #07060a; --black-2: #0a0712; --black-3: #1a1625; --black-4: #2a2435;
  
  /* Glass morphism layers */
  --glass-1: rgba(255, 255, 255, 0.08); 
  --glass-2: rgba(255, 255, 255, 0.04);
  --glass-3: rgba(255, 255, 255, 0.12);
  --glass-dark: rgba(0, 0, 0, 0.2);
  
  /* Advanced easing curves for organic motion */
  --easing-smooth: cubic-bezier(0.22, 0.95, 0.25, 1.05);
  --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --easing-slow: cubic-bezier(0.23, 1, 0.32, 1);
  --easing-fast: cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Typography hierarchy */
  --text: #e7eefc; 
  --text-secondary: #b8c5e6;
  --text-muted: #8897b8aa;
  --text-accent: #ffffff;
  
  /* 3D perspective system */
  --perspective: 1000px;
  --perspective-deep: 2000px;
  
  /* Shadow system - from subtle to dramatic */
  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-strong: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-intense: 0 35px 80px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(138, 43, 226, 0.3);
  
  /* Animation durations */
  --duration-quick: 0.2s;
  --duration-normal: 0.4s;
  --duration-slow: 0.8s;
  --duration-slower: 1.2s;
}

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

::selection {
  background: var(--purple-2);
  color: var(--text-accent);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--black-2);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--purple-2), var(--blue-2));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--purple-1), var(--blue-1));
}

html { 
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

html, body { 
  height: 100%; 
}

body {
  font-family: "Inter", "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--black-1);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.55;
  --scroll: 0;
  perspective: var(--perspective);
  perspective-origin: center center;
  position: relative;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

#bg-canvas {
  position: fixed; 
  inset: 0;
  width: 100vw; 
  height: 100vh;
  z-index: -2; 
  pointer-events: none;
  opacity: 0.6;
}

#bg-gradient {
  position: fixed; 
  inset: 0;
  z-index: -1; 
  pointer-events: none;
  background: 
    radial-gradient(circle at 20% 20%, rgba(255, 209, 102, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(0, 180, 255, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(138, 43, 226, 0.06) 0%, transparent 60%),
    radial-gradient(circle at 30% 70%, rgba(168, 85, 247, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, 
      rgba(10, 6, 18, 0.3) 0%, 
      rgba(6, 2, 20, 0.5) 25%, 
      rgba(12, 7, 30, 0.7) 60%, 
      rgba(26, 22, 37, 0.85) 85%, 
      rgba(2, 1, 6, 0.95) 100%);
  mix-blend-mode: screen;
  animation: cosmic-pulse 20s ease-in-out infinite alternate;
  will-change: opacity, filter;
}

@keyframes cosmic-pulse {
  0% { 
    opacity: 0.8; 
    filter: hue-rotate(0deg) saturate(1) brightness(1); 
  }
  33% { 
    opacity: 0.9; 
    filter: hue-rotate(30deg) saturate(1.1) brightness(1.05); 
  }
  66% { 
    opacity: 0.85; 
    filter: hue-rotate(-20deg) saturate(0.95) brightness(0.98); 
  }
  100% { 
    opacity: 1; 
    filter: hue-rotate(45deg) saturate(1.15) brightness(1.08); 
  }
}

/* Floating particles overlay */
.cosmic-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(138, 43, 226, 0.4), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(0, 180, 255, 0.4), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 209, 102, 0.3), transparent);
  background-repeat: repeat;
  background-size: 150px 100px;
  animation: particle-float 10s linear infinite;
}

@keyframes particle-float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100px); }
}

.container { 
  max-width: var(--max-width); 
  margin: 0 auto; 
  padding: calc(var(--gap) * 1.2);
  position: relative;
}

.perspective-container { 
  perspective: var(--perspective-deep);
  perspective-origin: center center;
}

/* Improved grid system */
.cosmic-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.cosmic-flex {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: center;
  justify-content: center;
}

header#hero {
  min-height: 100vh;
  display: flex; 
  flex-direction: column;
  align-items: center; 
  justify-content: center;
  gap: 1.2rem;
  text-align: center;
  padding: clamp(3rem, 12vh, 10rem) 5vw;
  position: relative; 
  isolation: isolate;
  background: 
    radial-gradient(ellipse at center top, rgba(138, 43, 226, 0.03) 0%, transparent 70%),
    radial-gradient(ellipse at center bottom, rgba(0, 180, 255, 0.02) 0%, transparent 70%);
}

.hero-card {
  background: 
    linear-gradient(145deg, var(--glass-3), var(--glass-1)),
    linear-gradient(135deg, rgba(138, 43, 226, 0.05), rgba(0, 180, 255, 0.03));
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: 
    var(--shadow-strong),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.2) contrast(1.1);
  backdrop-filter: blur(12px) saturate(1.2) contrast(1.1);
  transform-style: preserve-3d;
  width: min(980px, 96%);
  transition: all var(--duration-slow) var(--easing-smooth);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.1), 
    transparent);
  transition: left var(--duration-slower) var(--easing-smooth);
}

.hero-card:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg) translateZ(20px) scale(1.02);
  box-shadow: 
    var(--shadow-intense),
    var(--shadow-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-card:hover::before {
  left: 100%;
}

.gradient-text {
  background-image: linear-gradient(135deg, 
    var(--gold-1) 0%, 
    var(--blue-1) 25%, 
    var(--purple-1) 50%, 
    var(--gold-3) 75%,
    var(--purple-2) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text; 
  background-clip: text;
  color: transparent;
  animation: gradient-shift 6s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(138, 43, 226, 0.3));
  position: relative;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 50%; }
  50% { background-position: 50% 100%; }
  75% { background-position: 100% 0%; }
}

.gradient-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, var(--gold-1), var(--purple-1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.3;
  z-index: -1;
  filter: blur(2px);
}

#hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em; 
  margin-bottom: var(--gap-xs);
  line-height: 0.92; 
  transform-style: preserve-3d;
  text-shadow: 0 0 50px rgba(138, 43, 226, 0.5);
}

#hero h2 {
  font-size: clamp(1.2rem, 2.8vw, 2rem);
  color: var(--text-secondary); 
  margin-bottom: var(--gap);
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

#hero p {
  max-width: 900px; 
  margin: 0 auto 1.5rem;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-secondary); 
  letter-spacing: 0.02em;
  opacity: 0.95;
  line-height: 1.7;
}

/* ==============================================================================
   QUANTUM BUTTON SYSTEM
   ==============================================================================
   Interactive portals that respond to the user's intent.
   ============================================================================== */

.btn-group { 
  display: flex; 
  gap: 1rem; 
  justify-content: center; 
  flex-wrap: wrap; 
  margin-top: var(--gap);
}

.btn {
  display: inline-flex; 
  gap: 0.8rem; 
  align-items: center; 
  justify-content: center;
  padding: 0.82rem 2rem; 
  border-radius: 100px;
  font-weight: 700; 
  font-size: 1.1rem;
  text-decoration: none; 
  border: none; 
  cursor: pointer;
  transform-style: preserve-3d; 
  transform: translateZ(0);
  will-change: transform, box-shadow, filter;
  transition: all var(--duration-normal) var(--easing-smooth);
  position: relative; 
  overflow: hidden;
  isolation: isolate;
  letter-spacing: 0.02em;
}

.btn::before {
  content: ''; 
  position: absolute; 
  inset: -2px;
  background: inherit;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--easing-smooth);
  z-index: -1;
  border-radius: inherit;
  filter: blur(8px);
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transition: all var(--duration-normal) var(--easing-bounce);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2), var(--gold-4));
  color: var(--black-1);
  box-shadow: 
    0 15px 50px rgba(255, 183, 3, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.btn.secondary {
  color: var(--text-accent); 
  background: linear-gradient(135deg, var(--blue-1), var(--purple-1), var(--blue-4));
  box-shadow: 
    0 15px 50px rgba(0, 90, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn:hover {
  transform: translateY(-12px) translateZ(30px) rotateX(15deg) scale(1.05);
}

.btn.primary:hover {
  box-shadow: 
    0 25px 80px rgba(255, 183, 3, 0.4),
    var(--shadow-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  filter: saturate(1.2) brightness(1.1);
}

.btn.secondary:hover {
  box-shadow: 
    0 25px 80px rgba(0, 90, 255, 0.35),
    0 0 60px rgba(168, 85, 247, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  filter: saturate(1.15) brightness(1.08);
}

.btn:hover::before {
  opacity: 0.3;
}

.btn:hover::after {
  width: 300px;
  height: 300px;
}

.btn:active { 
  transform: translateY(-4px) translateZ(10px) scale(0.98); 
  transition-duration: var(--duration-quick);
}

section { 
  padding: clamp(5rem, 15vh, 9rem) 5vw; 
  position: relative; 
  z-index: 1;
}

section.container { 
  max-width: var(--max-width); 
  margin: 0 auto; 
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  margin-bottom: var(--gap-lg);
  text-align: center;
  letter-spacing: -0.02em;
}

.card {
  background: 
    linear-gradient(145deg, var(--glass-2), var(--glass-1)),
    linear-gradient(135deg, rgba(138, 43, 226, 0.02), rgba(0, 180, 255, 0.01));
  border-radius: 20px; 
  padding: var(--gap-lg);
  box-shadow: 
    var(--shadow-strong),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  transform-style: none;
  transition: none;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.4), 
    transparent);
}

.card:hover { 
  transform: translateZ(20px) scale(1.02);
  box-shadow: 
    var(--shadow-intense),
    var(--shadow-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.12);
}

#about .about-grid {
  display: grid; 
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap-lg); 
  align-items: center;
}

#about .bio { 
  text-align: left; 
}

#about .bio p { 
  margin-bottom: 1rem; 
  font-size: 1.15rem;
  line-height: 1.8;
  opacity: 0.9;
}

.photo-container {
  display: flex; 
  justify-content: center;
  perspective: var(--perspective-deep);
  position: relative;
}

.photo-container::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: conic-gradient(from 0deg, var(--purple-1), var(--blue-1), var(--gold-1), var(--purple-1));
  border-radius: 50%;
  opacity: 0.3;
  animation: rotate-slow 20s linear infinite;
  z-index: -1;
}

@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#about img.flip-3d { 
  width: 250px; 
  height: 250px; 
  border-radius: 50%;
  object-fit: cover; 
  box-shadow: 
    0 30px 80px rgba(0, 0, 0, 0.6),
    inset 0 0 0 4px rgba(255, 255, 255, 0.1),
    0 0 60px rgba(138, 43, 226, 0.4);
  border: 3px solid rgba(255, 255, 255, 0.15);
  transform-style: none;
  transition: none;
    cursor: pointer;
  position: relative;
  z-index: 1;
}

#about img.flip-3d:hover {
  transform: rotateY(360deg) translateZ(50px) scale(1.1);
  box-shadow: 
    0 40px 120px rgba(0, 0, 0, 0.7),
    0 0 100px rgba(138, 43, 226, 0.6),
    inset 0 0 0 6px rgba(255, 255, 255, 0.2);
  filter: saturate(1.2) brightness(1.1);
}

.skills-grid {
  display: flex; 
  flex-wrap: wrap; 
  gap: var(--gap);
  justify-content: center; 
  list-style: none; 
  padding: 0; 
  margin: 0;
}

.skill-pill {
  padding: 1rem 1.5rem; 
  border-radius: 100px;
  background: 
    linear-gradient(145deg, var(--glass-2), var(--glass-1)),
    linear-gradient(135deg, rgba(138, 43, 226, 0.05), rgba(0, 180, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600; 
  font-size: 0.95rem;
  color: var(--text);
  -webkit-backdrop-filter: blur();
  backdrop-filter: blur(12px);
  transform-style: preserve-3d;
  transition: all var(--duration-normal) var(--easing-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.skill-pill::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  transition: all var(--duration-normal) var(--easing-bounce);
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.skill-pill:hover {
  transform: translateY(-15px) translateZ(25px) rotateX(20deg) scale(1.1);
  box-shadow: 
    0 20px 60px rgba(138, 43, 226, 0.3),
    var(--shadow-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, var(--purple-1), var(--blue-1));
  color: var(--text-accent);
  border-color: rgba(255, 255, 255, 0.3);
}

.skill-pill:hover::before {
  width: 200px;
  height: 200px;
}

/* ==============================================================================
   PROJECT DIMENSION GALLERIES
   ==============================================================================
   Windows into parallel realities of creation.
   ============================================================================== */

#projects .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.project.card-3d {
  position: relative; 
  overflow: hidden;
  border-radius: 24px; 
  min-height: 280px;
  background: 
    linear-gradient(145deg, var(--glass-2), var(--glass-1)),
    linear-gradient(135deg, rgba(138, 43, 226, 0.03), rgba(0, 180, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform-style: preserve-3d;
  transition: all 0.6s var(--easing);
  cursor: pointer;
}

.project.card-3d::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(138, 43, 226, 0.05) 0%,
    rgba(0, 180, 255, 0.03) 50%,
    rgba(255, 209, 102, 0.02) 100%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--easing-smooth);
  z-index: 1;
  pointer-events: none;
}

.project.card-3d:hover {
  transform: perspective(1500px) rotateY(10deg) rotateX(5deg) translateZ(30px) scale(1.03);
  box-shadow: 
    var(--shadow-intense),
    0 0 100px rgba(138, 43, 226, 0.4);
}

.project.card-3d:hover::before {
  opacity: 1;
}

.project-inner { 
  height: 100%; 
  display: flex; 
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.thumb-container {
  position: relative; 
  height: 240px; 
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  perspective: var(--perspective);
}

.thumb {
  width: 100%; 
  height: 100%; 
  object-fit: cover;
  transition: all var(--duration-slower) var(--easing-smooth);
  filter: saturate(0.8) brightness(0.9);
}

.project:hover .overlay { 
  opacity: 1;
  transform: scale(1.05);
}

.overlay h3 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: var(--gap);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.overlay p {
  font-size: 1.1rem;
  line-height: 1.6;
  opacity: 0.95;
  margin-bottom: var(--gap-xs);
}

.project .meta { 
  padding: var(--gap-lg); 
  display: flex; 
  flex-direction: column; 
  gap: var(--gap);
  flex-grow: 1;
  justify-content: space-between;
}

.project h3 { 
  font-size: 1.5rem; 
  font-weight: 700;
  margin-bottom: var(--gap-xs);
  color: var(--text-accent);
}

.project .description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--gap);
}

.links { 
  display: flex; 
  gap: var(--gap-xs); 
  flex-wrap: wrap; 
}

.link-pill {
  padding: 0.8rem 1.5rem; 
  border-radius: 50px;
  text-decoration: none; 
  font-weight: 700; 
  font-size: 0.9rem;
  color: var(--text-accent);
  background: linear-gradient(135deg, var(--blue-2), var(--purple-2));
  box-shadow: 0 8px 25px rgba(138, 43, 226, 0.3);
  transition: all var(--duration-normal) var(--easing-smooth);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.link-pill::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  transition: all var(--duration-normal) var(--easing-bounce);
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.link-pill:hover {
  transform: translateZ(15px) scale(1.08) rotateZ(2deg);
  box-shadow: 
    0 15px 40px rgba(0, 90, 255, 0.4),
    var(--shadow-glow);
  filter: saturate(1.2) brightness(1.1);
}

.link-pill:hover::before {
  width: 300px;
  height: 300px;
}

/* ==============================================================================
   CONTACT PORTAL: BRIDGING DIMENSIONS
   ==============================================================================
   Where messages transcend the digital void.
   ============================================================================== */

#contact form {
  display: grid; 
  gap: var(--gap);
  max-width: 700px; 
  margin: 0 auto var(--gap-lg);
}

input, 
textarea, 
.input-3d {
  background: 
    linear-gradient(145deg, var(--glass-2), var(--glass-1)),
    linear-gradient(135deg, rgba(138, 43, 226, 0.02), rgba(0, 180, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px; 
  padding: 1.3rem 1.5rem;
  color: var(--text); 
  font-size: 1.05rem;
  font-family: inherit;
  outline: none; 
  transition: all var(--duration-normal) var(--easing-smooth);
  transform-style: preserve-3d;
  -webkit-backdrop-filter: blur();
  backdrop-filter: blur(12px);
  resize: vertical;
  min-height: 60px;
}

textarea {
  min-height: 120px;
  font-family: inherit;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

input:focus, 
textarea:focus, 
.input-3d:focus {
  box-shadow: 
    0 15px 50px rgba(0, 180, 255, 0.25),
    var(--shadow-glow),
    inset 0 1px 0 rgba(0, 180, 255, 0.15);
  transform: translateZ(8px) translateY(-4px) scale(1.02);
  border-color: var(--blue-1);
  background: 
    linear-gradient(145deg, var(--glass-3), var(--glass-1)),
    linear-gradient(135deg, rgba(0, 180, 255, 0.05), rgba(138, 43, 226, 0.03));
}

.contact-info {
  text-align: center;
  margin-bottom: var(--gap);
}

.contact-info a {
  color: var(--blue-1);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--duration-normal) var(--easing-smooth);
}

.contact-info a:hover {
  color: var(--purple-1);
  text-shadow: 0 0 20px currentColor;
}

.socials { 
  display: flex; 
  justify-content: center; 
  gap: var(--gap); 
  margin-top: var(--gap);
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  color: var(--text-muted); 
  text-decoration: none;
  background: 
    linear-gradient(145deg, var(--glass-2), var(--glass-1));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: all var(--duration-normal) var(--easing-smooth);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 1.2rem;
}

.social-link:hover { 
  color: var(--text-accent);
  background: linear-gradient(135deg, var(--blue-1), var(--purple-1));
  transform: translateY(-8px) translateZ(20px) scale(1.1);
  box-shadow: 
    0 15px 40px rgba(138, 43, 226, 0.3),
    var(--shadow-glow);
}

/* ==============================================================================
   RESPONSIVE HARMONY: ADAPTING TO ALL DIMENSIONS
   ==============================================================================
   Ensuring beauty across all viewport realities.
   ============================================================================== */

@media (max-width: 1200px) {
  :root {
    --gap: clamp(0.8rem, 2vw, 2rem);
    --gap-lg: clamp(1.5rem, 4vw, 3rem);
  }
}

@media (max-width: 900px) {
  #about .about-grid { 
    grid-template-columns: 1fr; 
    gap: var(--gap-lg); 
    text-align: center; 
  }
  
  .hero-card { 
    padding: var(--gap-lg); 
    border-radius: 24px;
    width: min(95%, 600px);
  }
  
  #about img.flip-3d { 
    width: 200px; 
    height: 200px; 
  }
  
  #hero p { 
    font-size: clamp(1rem, 2vw, 1.2rem); 
  }
  
  .btn-group {
    flex-direction: column;
    align-items: center;
    gap: var(--gap-xs);
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
  }
  
  #projects .grid {
    grid-template-columns: 1fr;
    gap: var(--gap);
  }
  
  .cosmic-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  section {
    padding: clamp(4rem, 10vh, 8rem) 4vw;
  }
  
  .hero-card {
    padding: var(--gap);
    border-radius: 20px;
  }
  
  #hero h1 {
    font-size: clamp(2rem, 8vw, 4rem);
  }
  
  .btn { 
    padding: 0.9rem 2rem; 
    font-size: 1rem; 
  }
  
  h2 { 
    font-size: clamp(1.8rem, 6vw, 2.5rem); 
  }
  
  .card {
    padding: var(--gap);
    border-radius: 20px;
  }
  
  .skill-pill {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
  }
  
  input, textarea {
    padding: 1.1rem;
    font-size: 1rem;
  }
}

@media (max-width: 400px) {
  .hero-card {
    width: 95%;
    padding: 1.5rem;
  }
  
  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
  }
  
  .skills-grid {
    gap: 0.8rem;
  }
  
  .skill-pill {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }
}

/* ==============================================================================
   SCROLL-TRIGGERED REVELATIONS
   ==============================================================================
   Elements that materialize as users journey through space.
   ============================================================================== */

.reveal-section .reveal {
  opacity: 0; 
  transform: translateY(60px) scale(0.95) translateZ(-30px);
  transition: all var(--duration-slower) var(--easing-smooth);
}

.reveal-section .reveal.in-view {
  opacity: 1; 
  transform: translateY(0) scale(1) translateZ(0);
}

.reveal-section .reveal[data-delay="150"].in-view {
  transition-delay: 0.15s;
}

.reveal-section .reveal[data-delay="300"].in-view {
  transition-delay: 0.3s;
}

.reveal-section .reveal[data-delay="450"].in-view {
  transition-delay: 0.45s;
}

/* Staggered animation delays */
.skills-grid .skill-pill:nth-child(1) { animation-delay: 0.1s; }
.skills-grid .skill-pill:nth-child(2) { animation-delay: 0.2s; }
.skills-grid .skill-pill:nth-child(3) { animation-delay: 0.3s; }
.skills-grid .skill-pill:nth-child(4) { animation-delay: 0.4s; }
.skills-grid .skill-pill:nth-child(5) { animation-delay: 0.5s; }
.skills-grid .skill-pill:nth-child(6) { animation-delay: 0.6s; }
.skills-grid .skill-pill:nth-child(7) { animation-delay: 0.7s; }
.skills-grid .skill-pill:nth-child(8) { animation-delay: 0.8s; }
.skills-grid .skill-pill:nth-child(9) { animation-delay: 0.9s; }

/* ==============================================================================
   3D INTERACTION SYSTEM
   ==============================================================================
   Subtle parallax dances that respond to user presence.
   ============================================================================== */

@supports (transform: rotateX(0)) {
  .tilt-3d {
    transition: all var(--duration-normal) var(--easing-smooth);
    transform-style: preserve-3d;
  }
  
  .tilt-3d:hover {
    transform: perspective(1000px) rotateX(8deg) rotateY(8deg) translateZ(30px);
  }

  .hover-3d:hover {
    transform: perspective(1000px) rotateX(3deg) rotateY(-3deg) translateZ(20px) !important;
  }

  .card-3d:hover {
    transform: perspective(1200px) rotateX(4deg) rotateY(-4deg) translateZ(35px) !important;
  }

  .input-3d:focus {
    transform: perspective(800px) rotateX(1deg) translateZ(10px) translateY(-3px) !important;
  }
}

/* Mouse follow effect for hero section */
.hero-card.mouse-follow {
  transition: transform 0.1s ease-out;
}

/* ==============================================================================
   COSMIC RIBBON SYSTEM
   ==============================================================================
   Ethereal elements that drift across the dimensional void.
   ============================================================================== */

.ribbon {
  position: absolute; 
  width: 25vw; 
  height: 4vw; 
  border-radius: 100px;
  opacity: 0.2; 
  filter: blur(12px);
  background: linear-gradient(90deg, 
    var(--gold-2) 0%, 
    var(--blue-1) 33%, 
    var(--purple-1) 66%, 
    var(--gold-3) 100%);
  mix-blend-mode: screen; 
  pointer-events: none;
  transform-style: preserve-3d;
  animation: ribbon-drift 25s linear infinite;
  will-change: transform;
}

.ribbon.r-1 { 
  top: 15vh; 
  left: -15vw; 
  transform: rotate(-20deg) translateZ(100px);
  animation-delay: -5s;
}

.ribbon.r-2 { 
  bottom: 20vh; 
  right: -20vw; 
  transform: rotate(25deg) translateZ(-50px);
  animation-delay: -15s;
}

.ribbon.r-3 {
  top: 60vh;
  left: -25vw;
  transform: rotate(-10deg) translateZ(75px);
  animation-delay: -10s;
  opacity: 0.15;
}

@keyframes ribbon-drift {
  0% { 
    transform: translateX(0) rotate(var(--start-rotation, 0deg)) translateZ(var(--depth, 0px)); 
  }
  100% { 
    transform: translateX(150vw) rotate(calc(var(--start-rotation, 0deg) + 360deg)) translateZ(var(--depth, 0px)); 
  }
}

/* ==============================================================================
   FOOTER: ECHO OF ETERNITY
   ==============================================================================
   The final resonance as users reach the end of their journey.
   ============================================================================== */

footer {
  padding: var(--gap-lg) 5vw; 
  text-align: center;
  color: var(--text-muted); 
  font-size: 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: 
    linear-gradient(180deg, 
      transparent 0%, 
      rgba(138, 43, 226, 0.02) 50%, 
      rgba(0, 180, 255, 0.01) 100%);
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(138, 43, 226, 0.5), 
    transparent);
  transform: translateX(-50%);
}

footer p {
  opacity: 0.8;
  letter-spacing: 0.02em;
}

/* ==============================================================================
   PERFORMANCE OPTIMIZATIONS
   ==============================================================================
   Ensuring smooth operation across all devices and browsers.
   ============================================================================== */

/* GPU acceleration for key elements */
.hero-card,
.card,
.btn,
.skill-pill,
.project.card-3d,
.ribbon {
  will-change: transform;
}

/* Reduce animations on lower-end devices */
@media (max-resolution: 1dppx) {
  .ribbon {
    animation: none;
    opacity: 0.1;
  }
  
  .cosmic-particles {
    display: none;
  }
  
  #bg-gradient {
    animation: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --glass-1: rgba(255, 255, 255, 0.15);
    --glass-2: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-secondary: #e0e0e0;
  }
  
  .card,
  .hero-card {
    border: 2px solid rgba(255, 255, 255, 0.3);
  }
}

/* Dark mode preference (already dark, but ensuring consistency) */
@media (prefers-color-scheme: dark) {
  /* Styles already optimized for dark mode */
}

/* ==============================================================================
   UTILITY CLASSES
   ==============================================================================
   Reusable modifiers for cosmic consistency.
   ============================================================================== */

.cosmic-glow {
  filter: drop-shadow(0 0 20px currentColor);
}

.cosmic-blur {
    -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.cosmic-shadow {
  box-shadow: var(--shadow-intense);
}

.text-cosmic {
  background: linear-gradient(135deg, var(--gold-1), var(--purple-1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.animate-pulse-slow {
  animation: pulse-slow 4s ease-in-out infinite;
}

@keyframes pulse-slow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ==============================================================================
   THE COSMIC SYMPHONY COMPLETE
   ==============================================================================
   Where form meets function in perfect dimensional harmony.
   A CSS architecture that transcends the ordinary and touches the infinite.
   ============================================================================== */thumb {
  transform: scale(1.15) rotateY(5deg);
  filter: saturate(1.2) brightness(1.1);
}

.overlay.gradient-overlay {
  position: absolute; 
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(138, 43, 226, 0.95) 0%,
    rgba(0, 180, 255, 0.9) 40%,
    rgba(255, 209, 102, 0.95) 100%);
  opacity: 0; 
  transition: all var(--duration-normal) var(--easing-smooth);
  display: flex; 
  flex-direction: column;
  padding: var(--gap-lg); 
  justify-content: center;
  color: var(--text-accent); 
  text-align: center;
    -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

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