/* ===== BASE & RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* ===== NOISE OVERLAY ===== */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ===== ANIMATED GRADIENT TEXT ===== */
.animated-gradient-text {
  background: linear-gradient(
    135deg,
    #6366f1 0%,
    #8b5cf6 25%,
    #a78bfa 50%,
    #818cf8 75%,
    #6366f1 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
}

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

/* ===== FLOATING ORBS ===== */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent 70%);
  top: -10%;
  right: -10%;
  animation: orb-float-1 20s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25), transparent 70%);
  bottom: 10%;
  left: -5%;
  animation: orb-float-2 25s ease-in-out infinite;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 70%);
  top: 40%;
  left: 50%;
  animation: orb-float-3 18s ease-in-out infinite;
}

@keyframes orb-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-50px, 80px) scale(1.1); }
  66% { transform: translate(30px, -40px) scale(0.95); }
}

@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -50px) scale(1.05); }
  66% { transform: translate(-30px, 40px) scale(0.9); }
}

@keyframes orb-float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, 60px) scale(1.15); }
  66% { transform: translate(50px, -30px) scale(0.85); }
}

/* ===== CURSOR BLINK ===== */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.animate-blink {
  animation: blink 1s step-end infinite;
}

/* ===== SCROLL INDICATOR ===== */
@keyframes scroll-indicator {
  0% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.3; }
  100% { transform: translateY(0); opacity: 1; }
}

.animate-scroll-indicator {
  animation: scroll-indicator 2s ease-in-out infinite;
}

/* ===== FLOAT ANIMATION ===== */
@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

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

/* ===== NAVIGATION ===== */
.nav-link {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  border-radius: 0.5rem;
  transition: all 0.3s;
  font-weight: 500;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.nav-scrolled {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  border-radius: 0.5rem;
  transition: all 0.3s;
  font-weight: 500;
}

.mobile-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* ===== STAT CARDS ===== */
.stat-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(99, 102, 241, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

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

.stat-card:hover {
  border-color: rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}

/* ===== SKILL CARDS ===== */
.skill-card {
  position: relative;
  padding: 2rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1.25rem;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(99, 102, 241, 0.06), transparent 50%);
  opacity: 0;
  transition: opacity 0.5s;
}

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

.skill-card:hover {
  border-color: rgba(99, 102, 241, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.skill-card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-tag {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  font-weight: 500;
  transition: all 0.3s;
}

.skill-tag:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.1);
}

/* ===== PROJECT CARDS ===== */
.project-card {
  position: relative;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1.25rem;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(99, 102, 241, 0.06),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.5s;
}

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

.project-card:hover {
  border-color: rgba(99, 102, 241, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.project-tag {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.3s;
}

.project-card:hover .project-tag {
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ===== BORDER BEAM (featured project) ===== */
.border-beam-container {
  pointer-events: none;
}

.border-beam {
  position: absolute;
  inset: 0;
  border-radius: 1.25rem;
  padding: 1px;
  background: conic-gradient(from var(--beam-angle, 0deg), transparent 80%, #6366f1 90%, #8b5cf6 95%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: beam-rotate 4s linear infinite;
}

@keyframes beam-rotate {
  to { --beam-angle: 360deg; }
}

@property --beam-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

/* ===== DOT PATTERN ===== */
.dot-pattern {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* ===== MARQUEE ===== */
.marquee-container {
  overflow: hidden;
  width: 100%;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee-item {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.15);
  white-space: nowrap;
  padding: 0 0.5rem;
  transition: color 0.3s;
}

.marquee-item:hover {
  color: rgba(99, 102, 241, 0.5);
}

.marquee-divider {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.06);
  padding: 0 0.75rem;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== REVEAL ANIMATIONS ===== */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--delay, 0s);
}

.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Hero elements start hidden for GSAP */
.hero-element {
  opacity: 0;
  transform: translateY(30px);
}

/* ===== TIMELINE ===== */
.timeline-item {
  padding-left: 3.5rem;
}

@media (min-width: 768px) {
  .timeline-item {
    padding-left: 0;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .orb-1 { width: 300px; height: 300px; }
  .orb-2 { width: 250px; height: 250px; }
  .orb-3 { width: 200px; height: 200px; }
}

/* ===== SMOOTH PAGE TRANSITIONS ===== */
body {
  opacity: 0;
  animation: fade-in 0.6s ease forwards;
}

@keyframes fade-in {
  to { opacity: 1; }
}
