/* ========= GLOBAL RESET & VARIABLES ========= */
:root {
  --primary: #06b6d4;
  --primary-dark: #0891b2;
  --dark: #0f172a;
  --darker: #020617;
  --light: #f8fafc;
  --gray: #94a3b8;
  --gray-dark: #475569;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--darker);
  color: var(--light);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--primary), #3b82f6);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ========= HEADER ========= */
#header {
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(6, 182, 212, 0.1);
}

#header.scrolled {
  background: rgba(2, 6, 23, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.logo {
  background: linear-gradient(to right, var(--primary), #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-link {
  color: #cbd5e1;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary), #3b82f6);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--primary);
}

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

/* ========= HERO SECTION ========= */
.hero {
  position: relative;
}

.animate-blob {
  animation: blob 7s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

@keyframes blob {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  33% {
    transform: translate(30px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
  100% {
    transform: translate(0px, 0px) scale(1);
  }
}

.typing-text::after {
  content: 'Junior Software Developer';
  animation: typing 8s infinite;
}

@keyframes typing {
  0%, 33% {
    content: 'Junior Software Developer';
  }
  34%, 66% {
    content: 'Frontend Specialist';
  }
  67%, 100% {
    content: 'React & Flutter Developer';
  }
}

.cursor {
  animation: blink 1s infinite;
  color: var(--primary);
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* ========= SERVICE CARDS ========= */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.1), transparent);
  transition: left 0.5s;
}

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

/* ========= PROJECT CARDS ========= */
.project-card {
  position: relative;
}

.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  padding: 2px;
  background: linear-gradient(to right, var(--primary), #3b82f6);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
}

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

/* ========= FORM STYLING ========= */
.contact-form input:focus,
.contact-form textarea:focus {
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* ========= REVEAL ANIMATIONS ========= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

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

/* ========= MOBILE MENU ========= */
@media (max-width: 768px) {
  nav ul {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 80%;
    height: calc(100vh - 70px);
    background: rgba(2, 6, 23, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 60px;
    gap: 30px;
    transition: right 0.4s ease;
    border-left: 1px solid rgba(6, 182, 212, 0.2);
  }

  nav ul.active {
    right: 0;
  }

  .menu-toggle {
    display: block !important;
    cursor: pointer;
    z-index: 100;
  }

  .menu-toggle.active i::before {
    content: '\f00d';
  }
}

/* ========= RESPONSIVE ADJUSTMENTS ========= */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero h2 {
    font-size: 1.25rem;
  }
}

/* ========= LOADING ANIMATION ========= */
.loading {
  position: fixed;
  inset: 0;
  background: var(--darker);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s, visibility 0.5s;
}

.loading.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(6, 182, 212, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}