/* =====================================================
   PORTFOLIO STYLES - Premium Animation System
   ===================================================== */

/* ================================
   CSS Custom Properties (Theme)
   ================================ */
:root {
  --brand-dark: #0B0E14;
  --brand-surface: #161B22;
  --brand-accent: #3B82F6;
  --brand-purple: #8B5CF6;
  --brand-success: #10B981;
  --brand-cyan: #06B6D4;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --gradient-primary: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-purple) 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.15) 0%, rgba(0, 0, 0, 0) 50%);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--brand-dark);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ================================
   Scroll Progress Bar
   ================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--brand-accent), 0 0 20px rgba(59, 130, 246, 0.5);
}

/* ================================
   Glass Panel Effect
   ================================ */
.glass-panel {
  background: rgba(22, 27, 34, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  transition: all var(--transition-normal);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ================================
   Text Gradients
   ================================ */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
  background: linear-gradient(135deg, var(--brand-purple) 0%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-success {
  background: linear-gradient(135deg, var(--brand-success) 0%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================================
   Animated Background Grid
   ================================ */
.grid-bg {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 50px 50px;
  }
}

/* ================================
   Floating Orbs Animation (Enhanced)
   ================================ */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  animation: orb-float 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, rgba(139, 92, 246, 0.2) 50%, transparent 70%);
  top: -250px;
  left: -150px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35) 0%, rgba(236, 72, 153, 0.15) 50%, transparent 70%);
  top: 40%;
  right: -200px;
  animation-delay: -7s;
}

.orb-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, rgba(6, 182, 212, 0.15) 50%, transparent 70%);
  bottom: -150px;
  left: 25%;
  animation-delay: -14s;
}

@keyframes orb-float {

  0%,
  100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 0.7;
  }

  25% {
    transform: translate(50px, -40px) scale(1.1) rotate(5deg);
    opacity: 0.9;
  }

  50% {
    transform: translate(-30px, 30px) scale(0.9) rotate(-5deg);
    opacity: 0.6;
  }

  75% {
    transform: translate(-50px, -30px) scale(1.05) rotate(3deg);
    opacity: 0.8;
  }
}

/* ================================
   Scroll Reveal Animations
   ================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for children */
.stagger>*:nth-child(1) {
  transition-delay: 0.1s;
}

.stagger>*:nth-child(2) {
  transition-delay: 0.2s;
}

.stagger>*:nth-child(3) {
  transition-delay: 0.3s;
}

.stagger>*:nth-child(4) {
  transition-delay: 0.4s;
}

.stagger>*:nth-child(5) {
  transition-delay: 0.5s;
}

.stagger>*:nth-child(6) {
  transition-delay: 0.6s;
}

/* ================================
   Typing Animation
   ================================ */
.typing-container {
  display: inline-block;
}

.typing-text {
  display: inline;
}

.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1.1em;
  background: var(--brand-accent);
  margin-left: 2px;
  animation: cursor-blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes cursor-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ================================
   Counter Animation
   ================================ */
.counter {
  font-variant-numeric: tabular-nums;
}

/* ================================
   Card Hover Effects
   ================================ */
.project-card {
  position: relative;
  background: var(--brand-surface);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, 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;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.project-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(59, 130, 246, 0.15);
}

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

/* Card glow effect on hover */
.project-card.glow-purple:hover {
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(139, 92, 246, 0.2);
}

.project-card.glow-blue:hover {
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(59, 130, 246, 0.2);
}

.project-card.glow-green:hover {
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(16, 185, 129, 0.2);
}

/* ================================
   Button Styles
   ================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ================================
   Badge Styles
   ================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

.badge-purple {
  background: rgba(139, 92, 246, 0.15);
  color: var(--brand-purple);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--brand-accent);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--brand-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-gold {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Built Solo Badge */
.badge-solo {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(239, 68, 68, 0.2) 100%);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: badge-glow 2s ease-in-out infinite;
}

@keyframes badge-glow {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
  }

  50% {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
  }
}

/* ================================
   GitHub Stats Badge
   ================================ */
.github-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.github-stats svg {
  width: 14px;
  height: 14px;
}

.github-stats .count {
  font-weight: 600;
  color: var(--text-primary);
}

/* ================================
   Pulse Animation (Status Indicator)
   ================================ */
.pulse {
  position: relative;
}

.pulse::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ================================
   Scroll Down Indicator
   ================================ */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: bounce-subtle 2s ease-in-out infinite;
}

.scroll-indicator svg {
  width: 20px;
  height: 20px;
}

@keyframes bounce-subtle {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

/* ================================
   Section Divider
   ================================ */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 50%, transparent);
  margin: 0;
}

/* ================================
   Code Block Styling
   ================================ */
.code-block {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.code-block code {
  color: var(--text-secondary);
}

.code-block .copy-btn {
  background: none;
  border: none;
  color: var(--brand-accent);
  cursor: pointer;
  padding: 4px;
  transition: all var(--transition-fast);
}

.code-block .copy-btn:hover {
  color: white;
}

/* ================================
   Image Hover Effects
   ================================ */
.image-glow {
  position: relative;
}

.image-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  background: var(--gradient-primary);
  opacity: 0;
  filter: blur(20px);
  transition: opacity var(--transition-slow);
  z-index: -1;
}

.image-glow:hover::before {
  opacity: 0.5;
}

/* ================================
   Mobile Menu Styles
   ================================ */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(22, 27, 34, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(-100%);
  transition: transform var(--transition-normal);
  z-index: 40;
}

.mobile-menu.active {
  transform: translateY(0);
}

.mobile-menu a {
  display: block;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 8px;
  transition: background var(--transition-fast);
}

.mobile-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .mobile-menu {
    display: block;
  }

  .desktop-nav {
    display: none;
  }
}

/* ================================
   Stat Counter Cards
   ================================ */
.stat-card {
  text-align: center;
  padding: 24px;
}

.stat-value {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ================================
   Feature List Styling
   ================================ */
.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}

.feature-list li svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

/* ================================
   Timeline/Steps
   ================================ */
.timeline-item {
  display: flex;
  gap: 16px;
  padding-bottom: 24px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), transparent);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* ================================
   Link Hover Underline Effect
   ================================ */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width var(--transition-fast);
}

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

/* ================================
   Loading State
   ================================ */
.skeleton {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.05) 25%,
      rgba(255, 255, 255, 0.1) 50%,
      rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ================================
   Particle Canvas
   ================================ */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ================================
   Blog Card Styles
   ================================ */
.blog-card {
  background: var(--brand-surface);
  border-radius: 16px;
  overflow: hidden;
  transition: all var(--transition-normal);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.blog-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.blog-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.blog-card-content {
  padding: 24px;
}

.blog-card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.blog-card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.blog-card-excerpt {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* ================================
   Responsive Adjustments
   ================================ */
@media (max-width: 1024px) {

  .orb-1,
  .orb-2,
  .orb-3 {
    transform: scale(0.7);
  }
}

@media (max-width: 640px) {
  .stat-value {
    font-size: 36px;
  }

  .orb-1,
  .orb-2,
  .orb-3 {
    display: none;
  }
}

/* ================================
   Premium Hero Text Shimmer
   ================================ */
.text-gradient {
  background: linear-gradient(135deg,
      var(--brand-accent) 0%,
      var(--brand-purple) 25%,
      #ec4899 50%,
      var(--brand-purple) 75%,
      var(--brand-accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-shimmer 4s linear infinite;
}

@keyframes text-shimmer {
  0% {
    background-position: 0% center;
  }

  100% {
    background-position: 200% center;
  }
}

/* ================================
   Aurora Background Effect
   ================================ */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 0% 0%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ================================
   Dramatic Glow on Hover
   ================================ */
.project-card.glow-green:hover {
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(16, 185, 129, 0.25),
    0 0 100px rgba(16, 185, 129, 0.1);
}

.project-card.glow-blue:hover {
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(59, 130, 246, 0.25),
    0 0 100px rgba(59, 130, 246, 0.1);
}

.project-card.glow-purple:hover {
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(139, 92, 246, 0.25),
    0 0 100px rgba(139, 92, 246, 0.1);
}

/* ================================
   Premium Button Shine
   ================================ */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.25),
      transparent);
  transition: left 0.6s ease;
}

.btn-primary:hover::after {
  left: 100%;
}

/* ================================
   Selection Styling
   ================================ */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: white;
}

/* ================================
   Custom Scrollbar
   ================================ */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--brand-dark);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-accent), var(--brand-purple));
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--brand-purple), var(--brand-accent));
}

/* ================================
   Noise Texture Overlay
   ================================ */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.015;
  pointer-events: none;
  z-index: 9998;
}

/* ================================
   Enhanced Stat Cards Glow
   ================================ */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
  animation: stat-pulse 4s ease-in-out infinite;
}

@keyframes stat-pulse {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.5;
  }

  50% {
    transform: translate(10%, 10%) scale(1.1);
    opacity: 0.8;
  }
}

/* ================================
   Image Zoom on Hover
   ================================ */
[data-lightbox] {
  cursor: zoom-in;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-lightbox]:hover {
  transform: scale(1.02);
}

/* ================================
   Focus States
   ================================ */
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 4px;
}