/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* === CSS VARIABLES === */
:root {
  --color-primary: #0066ff;
  --color-primary-dark: #0052cc;
  --color-accent: #00d4aa;
  --color-dark: #050810;
  --color-darker: #020406;
  --color-card: #0c1220;
  --color-card-hover: #111a2e;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* === CUSTOM SCROLLBAR === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-darker);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* === SMOOTH SCROLL === */
html {
  scroll-behavior: smooth;
}

/* === BASE STYLES === */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  background: var(--color-darker);
  color: var(--color-text);
  overflow-x: hidden;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.font-mono {
  font-family: var(--font-mono);
}

.font-display {
  font-family: var(--font-display);
}

/* === SELECTION === */
::selection {
  background: var(--color-primary);
  color: white;
}

/* === ANIMATED BACKGROUND GRID === */
.bg-grid {
  background-image:
    linear-gradient(rgba(0, 102, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 102, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* === GLOW EFFECTS - BOOSTED === */
.glow-blue {
  box-shadow: 0 0 80px rgba(0, 102, 255, 0.5), 0 0 160px rgba(0, 102, 255, 0.3), 0 0 240px rgba(0, 102, 255, 0.1);
  animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 80px rgba(0, 102, 255, 0.5), 0 0 160px rgba(0, 102, 255, 0.3); }
  50% { box-shadow: 0 0 120px rgba(0, 102, 255, 0.7), 0 0 200px rgba(0, 102, 255, 0.4), 0 0 300px rgba(0, 212, 170, 0.2); }
}

.glow-text {
  text-shadow: 0 0 80px rgba(0, 102, 255, 0.6), 0 0 160px rgba(0, 102, 255, 0.4), 0 0 240px rgba(0, 212, 170, 0.2);
  animation: glow-text-pulse 4s ease-in-out infinite;
}

@keyframes glow-text-pulse {
  0%, 100% { text-shadow: 0 0 80px rgba(0, 102, 255, 0.6), 0 0 160px rgba(0, 102, 255, 0.4); }
  50% { text-shadow: 0 0 120px rgba(0, 102, 255, 0.8), 0 0 200px rgba(0, 212, 170, 0.5); }
}

.glow-line {
  box-shadow: 0 0 30px rgba(0, 102, 255, 0.6), 0 0 60px rgba(0, 102, 255, 0.3);
  animation: line-pulse 2s ease-in-out infinite;
}

@keyframes line-pulse {
  0%, 100% { box-shadow: 0 0 30px rgba(0, 102, 255, 0.6); }
  50% { box-shadow: 0 0 50px rgba(0, 102, 255, 0.8), 0 0 80px rgba(0, 212, 170, 0.4); }
}

/* === GRADIENT TEXT - ANIMATED === */
.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, var(--color-primary) 50%, var(--color-accent) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 5s ease infinite;
}

.gradient-text-blue {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent), var(--color-primary));
  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% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* === MOBILE MENU === */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  max-width: 85%;
  height: 100vh;
  background: linear-gradient(180deg, var(--color-card) 0%, var(--color-darker) 100%);
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  z-index: 60;
  overflow-y: auto;
  border-left: 1px solid var(--color-border);
}

.mobile-menu.open {
  right: 0;
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
  display: block;
}

/* === HERO SECTION - BOOSTED === */
.hero-section {
  background: radial-gradient(ellipse at 30% 20%, rgba(0, 102, 255, 0.25) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(0, 212, 170, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 50%, rgba(128, 0, 255, 0.08) 0%, transparent 60%),
              linear-gradient(180deg, var(--color-darker) 0%, var(--color-dark) 100%);
  min-height: 100vh;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(0, 102, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 102, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  animation: grid-move 30s linear infinite;
}

@keyframes grid-move {
  0% { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

/* === FLOATING PARTICLES - BOOSTED === */
.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
  opacity: 0.5;
  animation: float 15s infinite;
  box-shadow: 0 0 20px rgba(0, 102, 255, 0.8), 0 0 40px rgba(0, 102, 255, 0.4);
}

.particle:nth-child(odd) {
  background: var(--color-accent);
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.8), 0 0 40px rgba(0, 212, 170, 0.4);
  animation-duration: 12s;
}

.particle:nth-child(3n) {
  width: 8px;
  height: 8px;
  animation-duration: 18s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); opacity: 0.5; }
  25% { transform: translateY(-150px) translateX(80px) scale(1.3); opacity: 0.9; }
  50% { transform: translateY(-80px) translateX(-50px) scale(0.8); opacity: 0.4; }
  75% { transform: translateY(-200px) translateX(40px) scale(1.1); opacity: 0.7; }
}

/* === REVEAL ANIMATIONS - BOOSTED === */
.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.8) rotate(-2deg);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-80px) rotate(-3deg);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0) rotate(0deg);
}

.reveal-right {
  opacity: 0;
  transform: translateX(80px) rotate(3deg);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0) rotate(0deg);
}

/* === STAGGER ANIMATIONS - BOOSTED === */
.stagger-1 { transition-delay: 0.15s; }
.stagger-2 { transition-delay: 0.3s; }
.stagger-3 { transition-delay: 0.45s; }
.stagger-4 { transition-delay: 0.6s; }
.stagger-5 { transition-delay: 0.75s; }
.stagger-6 { transition-delay: 0.9s; }

/* === BUTTONS - BOOSTED === */
.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary), #0052cc);
  border: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 102, 255, 0.3);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s ease;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent), var(--color-primary));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  filter: blur(8px);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 102, 255, 0.5), 0 0 40px rgba(0, 102, 255, 0.3);
}

.btn-secondary {
  position: relative;
  background: transparent;
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.1), rgba(0, 212, 170, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.btn-secondary:hover::before {
  opacity: 1;
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
}

/* === CARDS - BOOSTED === */
.card {
  background: linear-gradient(135deg, var(--color-card) 0%, rgba(12, 18, 32, 0.8) 100%);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  right: 0;
  height: 2px;
  width: 200%;
  background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-accent), var(--color-primary), transparent);
  opacity: 0;
  transition: all 0.5s ease;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 102, 255, 0.15), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover {
  border-color: rgba(0, 102, 255, 0.5);
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4), 0 0 60px rgba(0, 102, 255, 0.2), 0 0 100px rgba(0, 212, 170, 0.1);
}

.card:hover::before {
  opacity: 1;
  left: 0;
  animation: card-shine 2s ease infinite;
}

.card:hover::after {
  opacity: 1;
}

@keyframes card-shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* === STAT CARDS - BOOSTED === */
.stat-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 102, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-card:hover::before {
  opacity: 1;
}

/* === ICON BOX - BOOSTED === */
.icon-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent);
  transition: all 0.3s ease;
}

.card:hover .icon-box {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 10px 30px rgba(0, 102, 255, 0.3);
}

.card:hover .icon-box::after {
  background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(0, 102, 255, 0.2));
}

/* === SECTION DIVIDER === */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

/* === TECH BADGE - BOOSTED === */
.tech-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: rgba(0, 102, 255, 0.1);
  border: 1px solid rgba(0, 102, 255, 0.2);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tech-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.tech-badge:hover {
  background: rgba(0, 102, 255, 0.25);
  border-color: var(--color-primary);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 102, 255, 0.3);
}

.tech-badge:hover::before {
  left: 100%;
}

/* === HEADER === */
header {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-link {
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* === BG MATTEH CARD - Keep for Tailwind compatibility === */
.bg-matteh-card {
  background: var(--color-card);
  transition: all 0.3s ease;
}

.bg-matteh-dark {
  background: var(--color-dark);
}

/* === FORM STYLING === */
input, select, textarea {
  font-family: inherit;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

select option {
  background: var(--color-card);
  color: white;
}

/* === LIGHTBOX === */
.lightbox {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === PULSE ANIMATION - BOOSTED === */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 30px rgba(0, 102, 255, 0.5), 0 0 60px rgba(0, 212, 170, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 60px rgba(0, 102, 255, 0.8), 0 0 100px rgba(0, 102, 255, 0.4), 0 0 150px rgba(0, 212, 170, 0.3);
    transform: scale(1.02);
  }
}

.pulse-glow {
  animation: pulse-glow 2s infinite;
}

/* === TYPING CURSOR - BOOSTED === */
@keyframes blink {
  0%, 100% { opacity: 1; text-shadow: 0 0 10px var(--color-primary); }
  50% { opacity: 0.3; text-shadow: 0 0 20px var(--color-accent); }
}

.typing-cursor::after {
  content: '█';
  animation: blink 0.7s infinite;
  color: var(--color-primary);
  font-size: 0.9em;
}

/* === GRADIENT BORDER - BOOSTED === */
.gradient-border {
  position: relative;
  background: var(--color-card);
  border-radius: 16px;
  transition: all 0.4s ease;
}

.gradient-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent), #8b5cf6, var(--color-primary));
  background-size: 300% 300%;
  border-radius: 18px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: border-glow 4s ease infinite;
}

@keyframes border-glow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.gradient-border:hover::before {
  opacity: 1;
}

.gradient-border:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0, 102, 255, 0.2);
}

/* === TECH STACK MARQUEE - BOOSTED === */
.tech-marquee {
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, white 5%, white 95%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, white 5%, white 95%, transparent);
}

.tech-marquee-content {
  display: inline-flex;
  animation: marquee 25s linear infinite;
}

.tech-marquee-content:hover {
  animation-play-state: paused;
}

.tech-marquee-content span {
  transition: all 0.3s ease;
}

.tech-marquee-content span:hover {
  color: var(--color-primary);
  transform: scale(1.1);
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* === HEXAGON PATTERN === */
.hex-pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%230066ff' fill-opacity='0.03'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero-section {
    padding-top: 5rem;
    padding-bottom: 3rem;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }
}

/* === BACKDROP BLUR FALLBACK === */
@supports not (backdrop-filter: blur(10px)) {
  .backdrop-blur-md {
    background-color: rgba(5, 8, 16, 0.98);
  }
  .backdrop-blur-sm {
    background-color: rgba(255, 255, 255, 0.1);
  }
}

/* === LOADING STATE === */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 102, 255, 0.1), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% { left: 100%; }
}

/* === ASPECT RATIO FALLBACK === */
@supports not (aspect-ratio: 16 / 9) {
  .aspect-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
  }
  .aspect-video > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* === IMAGE PLACEHOLDER === */
img[src=""] {
  background: var(--color-card);
}

/* === LINE CLAMP === */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === NUMBER COUNTER === */
.counter {
  font-variant-numeric: tabular-nums;
}
