/* ─── RESET & BASE ─── */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}
body {
  background-color: #0a0a0a;
  color: #f5f5f5;
  font-family: 'Space Grotesk', sans-serif;
  cursor: none;
}
@media (max-width: 768px) {
  body { cursor: auto; }
  #cursor-dot, #cursor-follower { display: none !important; }
}

/* ─── BACKGROUND GRID (GPU accelerated) ─── */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  will-change: transform;
}

/* ─── CONTENT VISIBILITY FOR SECTIONS ─── */
section {
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: 800px;
}

/* ─── SIDEBAR ─── */
.sidebar {
  background: linear-gradient(180deg, #0a0a0a 0%, #111111 100%);
}
.sidebar-link {
  position: relative;
  transition: color 0.3s, background 0.3s;
}
.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, #ff6b35, #00d4aa);
  border-radius: 2px;
  transition: height 0.3s;
}
.sidebar-link:hover::before,
.sidebar-link.active::before {
  height: 24px;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ─── GRADIENT BORDER ─── */
.gradient-border {
  position: relative;
  background: #111111;
  border-radius: 16px;
  overflow: hidden;
}
.gradient-border::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, #ff6b35, #00d4aa, #6366f1, #ff6b35);
  background-size: 400% 400%;
  animation: gradient-move 6s ease infinite;
  -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;
  opacity: 0;
  transition: opacity 0.4s;
}
.gradient-border:hover::before {
  opacity: 1;
}
@keyframes gradient-move {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ─── GLOW TEXT ─── */
.glow-text {
  text-shadow: 0 0 40px rgba(255, 107, 53, 0.3);
}

/* ─── CUSTOM SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff6b35, #00d4aa);
  border-radius: 3px;
}

/* ─── PROJECT CARD ─── */
.project-card {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.project-card:hover {
  transform: translateY(-4px);
}
.project-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}
.project-image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,107,53,0.15), rgba(0,212,170,0.15));
  opacity: 1;
  transition: opacity 0.4s;
}
.project-card:hover .project-image-wrapper::after {
  opacity: 0;
}
.project-image {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.project-card:hover .project-image {
  transform: scale(1.08);
}

/* ─── CURSOR ─── */
#cursor-dot, #cursor-follower {
  will-change: transform;
}

/* ─── SKILL RING ICON ─── */
.skill-ring-item i {
  filter: drop-shadow(0 0 6px currentColor);
}

/* ─── PROJECT OVERLAY ─── */
.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.project-image-wrapper:hover .project-overlay {
  opacity: 1;
}

/* ─── FLOATING ANIMATIONS ─── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.float-animation {
  animation: float 4s ease-in-out infinite;
  will-change: transform;
}

/* ─── STAT NUMBERS ─── */
.stat-number {
  background: linear-gradient(135deg, #ff6b35, #00d4aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── PULSE RING ─── */
.pulse-ring {
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.4); }
  50% { box-shadow: 0 0 0 15px rgba(0, 212, 170, 0); }
}

/* ─── 3D ROTATING SHAPE (3 rings, GPU) ─── */
.shape-3d-container {
  perspective: 800px;
  transform-style: preserve-3d;
  will-change: transform;
}
.shape-ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--c, rgba(255,107,53,0.25));
  border-radius: 50%;
  animation: spin3d var(--d, 10s) linear infinite;
  transform: rotateX(var(--rx, 65deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
  backface-visibility: hidden;
}
.shape-ring.thick {
  border-width: 3px;
  opacity: 0.6;
}
@keyframes spin3d {
  from { transform: rotateX(var(--rx, 65deg)) rotateY(var(--ry, 0deg)) rotateZ(0deg); }
  to { transform: rotateX(var(--rx, 65deg)) rotateY(var(--ry, 0deg)) rotateZ(360deg); }
}

/* ─── BADGE FLOAT ─── */
.badge-float {
  animation: badgeBounce 3s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform;
}
@keyframes badgeBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ─── SCROLL INDICATOR ─── */
.scroll-indicator {
  animation: scrollBounce 2s ease-in-out infinite;
}
.scroll-chevrons i {
  animation: chevronFade 1.5s ease-in-out infinite;
}
.scroll-chevrons i:nth-child(2) { animation-delay: 0.3s; }
.scroll-chevrons i:nth-child(3) { animation-delay: 0.6s; }
@keyframes scrollBounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}
@keyframes chevronFade {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.3; transform: translateY(4px); }
}

/* ─── TIMELINE ─── */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #ff6b35, #00d4aa, #6366f1);
  transform-origin: top;
  animation: timelineGrow 1.5s ease-out forwards;
}
@keyframes timelineGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
.timeline-item {
  position: relative;
  padding-bottom: 2rem;
  opacity: 0;
  transform: translateX(-20px);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -1.65rem;
  top: 0.3rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b35, #00d4aa);
  border: 3px solid #0a0a0a;
  box-shadow: 0 0 20px rgba(255,107,53,0.3);
  transform: scale(0);
}
.timeline-content {
  background: #111111;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: border-color 0.3s;
}
.timeline-content:hover {
  border-color: rgba(255,107,53,0.2);
}

/* ─── CONTACT BLOBS (static gradient, no animation) ─── */
#contact {
  background: linear-gradient(135deg, #050505 0%, #0a0a0a 30%, #0d0d0d 70%, #050505 100%);
}
#contact::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255,107,53,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0,212,170,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(99,102,241,0.03) 0%, transparent 50%);
}

/* ─── VANILLA TILT GLARE ─── */
.tilt-card .js-tilt-glare {
  border-radius: 16px !important;
}

/* ─── INTRO TYPING (GSAP handles width, CSS only for blink) ─── */
.typing-intro {
  border-right: 2px solid #ff6b35;
  animation: blink 0.7s step-end infinite;
}
@keyframes blink {
  50% { border-color: transparent; }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .shape-3d-container { display: none; }
  .floating-tech-icons { display: none; }
  .badge-float { animation: none; }
  html { scroll-behavior: auto; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .skill-ring-item.col-span-2 { grid-column: span 1; }
  #skills-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── LEGACY STYLES ─── */
.tag {
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #9ca3af;
}
