*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-y: scroll; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body { background: #09090B; color: #FAFAFA; font-family: 'Space Grotesk', Inter, sans-serif; overflow-x: hidden; user-select: none; }
::selection { background: #5b95ff; color: #000814; }

.starfield-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

.page-content { position: relative; z-index: 1; opacity: 0; transition: opacity 0.6s ease; pointer-events: none; }
.page-content.is-visible { opacity: 1; pointer-events: auto; }

.page-loader { position: fixed; inset: 0; background: #09090B; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 3000; gap: 10px; }
.page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.5s ease, visibility 0.5s ease; }
.loader-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.loader-title { color: #FAFAFA; font-size: 1.4rem; letter-spacing: 0.04em; }
.loader-sub { font-family: "JetBrains Mono", monospace; font-size: 0.85rem; color: #A1A1AA; }
.loader-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #3F3F46; }
.loader-bar-fill { height: 100%; width: 0%; background: #5b95ff; box-shadow: 0 0 12px rgba(91, 149, 255, 0.6); transition: width 0.2s ease; }

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5vw;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #3F3F46;
}
.logo-link { text-decoration: none; color: inherit; }
.logo { font-size: 1.35rem; font-weight: 600; font-family: "Oswald", sans-serif; letter-spacing: 0.02em; color: #FAFAFA; text-transform: uppercase; }
.logo .dot { color: #5b95ff; }

.nav-links { font-size: large; gap: 2.5rem; align-items: center; }
.nav-links a { font-family: "JetBrains Mono", monospace; color: #A1A1AA; text-decoration: none; font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; position: relative; transition: color 0.3s ease; }
.nav-links a:hover, .nav-links a.active { color: #FAFAFA; }
.nav-links a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: #5b95ff; transition: width 0.25s ease; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 1rem; }

@media (min-width: 768px) {
  #menuToggle { display: none !important; }
  #mobileMenu { display: none !important; }
}

#mobileMenu { 
  position: fixed; top: 76px; right: 5vw; width: 240px; 
  background: rgba(9, 9, 11, 0.85); backdrop-filter: blur(16px); 
  border: 1px solid #3F3F46; border-radius: 12px; padding: 1.75rem 1.5rem; 
  display: flex; flex-direction: column; gap: 0.5rem; z-index: 99; 
  opacity: 0; visibility: hidden; transform: translateY(-16px) scale(0.98); 
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05); 
}
#mobileMenu.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
#mobileMenu a { 
  font-family: "JetBrains Mono", monospace; font-size: 0.85rem; font-weight: 600; 
  letter-spacing: 0.1em; text-transform: uppercase; color: #A1A1AA; text-decoration: none; 
  display: flex; align-items: center; gap: 0.75rem; transition: all 0.3s ease; 
  padding: 0.75rem 0.5rem; border-bottom: 1px solid rgba(63, 63, 70, 0.3); 
}
#mobileMenu a:last-child { border-bottom: none; }
#mobileMenu a::before { content: '>'; color: #3F3F46; font-weight: 700; transition: all 0.3s ease; }
#mobileMenu a:hover, #mobileMenu a.active-mobile { color: #FAFAFA; transform: translateX(6px); border-color: rgba(91, 149, 255, 0.2); background: rgba(91, 149, 255, 0.03); border-radius: 6px; }
#mobileMenu a:hover::before, #mobileMenu a.active-mobile::before { color: #5b95ff; }

.intro { font-size: 4rem; font-family: "Oswald", sans-serif; color: #FAFAFA; }
.name { font-size: 4rem; font-family: "Oswald", sans-serif; margin-top: -30px; margin-bottom: -20px; }
.name:hover { text-shadow: 0 0 4px #5b95ff; }

.underline-svg { height: 30px; margin-top: -5px; bottom: -38px; }
.underline-svg path { stroke-dasharray: 250; stroke-dashoffset: 250; animation: draw-line 3s ease-in-out infinite; }
@keyframes draw-line {
  0% { stroke-dashoffset: 250; }
  40% { stroke-dashoffset: 0; }
  60% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -250; }
}

.dynamic-text::after { content: "|"; animation: blink 1s infinite; }
@keyframes blink { 0%, 50%, 100% { opacity: 1; } 25%, 75% { opacity: 0; } }

.social-btn { font-size: 1.5rem;margin-top:-25px; color: #A1A1AA; transition: color 0.3s ease, transform 0.3s ease; display: inline-block; }
.social-btn:hover { color: #5b95ff; transform: translateY(-2px); }

.profile-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  animation: ghost-float 6s ease-in-out infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: opacity, transform;
}
.profile-frame.is-active { opacity: 1; }

@keyframes ghost-float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

.noise-layer { position: fixed; inset: 0; pointer-events: none; z-index: 999; opacity: 0.03; mix-blend-mode: overlay; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .profile-frame { animation: none; transition: none; }
  .reveal { transition: none; }
}

@media (max-width: 768px) {
  .intro { font-size: 2.6rem; }
  .name { font-size: 2.8rem; margin-top: -10px; margin-bottom: -10px; }
  .underline-svg { max-width: 220px; margin: -20px auto; bottom: -8px; }
  .hero-text { text-align: center; }
  .social-links { justify-content: center; }
}

#contactForm input:focus,
#contactForm textarea:focus {
  box-shadow: 0 0 0 1px rgba(91, 149, 255, 0.3);
}

#contactForm button:active {
  transform: scale(0.98);
}

.section-num {
  font-variant-numeric: tabular-nums;
}

.skill-tag {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-tag:hover {
  box-shadow: 0 0 20px rgba(91, 149, 255, 0.35);
  border-color: #5b95ff;
  color: #FAFAFA;
  transform: translateY(-2px) scale(1.02);
}

.skill-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.project-card-glow {
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(91, 149, 255, 0.08), transparent 40%);
}

.project-card {
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover {
  transform: translateY(-4px);
}

.project-link {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-link:hover {
  transform: translateY(-2px) scale(1.1);
}

.project-tech {
  transition: all 0.3s ease;
}

.project-tech:hover {
  background: rgba(91, 149, 255, 0.1);
  border-color: rgba(91, 149, 255, 0.4);
  color: #5b95ff;
}

.contact-icon {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-link:hover .contact-icon {
  transform: scale(1.15) rotate(-3deg);
  border-color: rgba(91, 149, 255, 0.5);
  box-shadow: 0 0 20px rgba(91, 149, 255, 0.3);
}

.floating-label {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.submit-btn {
  background: linear-gradient(135deg, #5b95ff 0%, #3a7bd5 100%);
  position: relative;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #3a7bd5 0%, #5b95ff 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.submit-btn:hover::before {
  opacity: 1;
}

.submit-btn:hover {
  box-shadow: 0 0 30px rgba(91, 149, 255, 0.6), 0 0 60px rgba(91, 149, 255, 0.2);
}

.skill-card {
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(91, 149, 255, 0.05), transparent);
  transition: left 0.5s ease;
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(91, 149, 255, 0.3); }
  50% { box-shadow: 0 0 25px rgba(91, 149, 255, 0.5); }
}

.skill-tag:hover {
  animation: pulse-glow 2s ease-in-out infinite;
}

.featured-badge {
  animation: badge-glow 3s ease-in-out infinite;
}

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(91, 149, 255, 0.4); }
  50% { box-shadow: 0 0 16px rgba(91, 149, 255, 0.7); }
}

@media (prefers-reduced-motion: reduce) {
  .skill-tag:hover,
  .project-card:hover,
  .contact-link:hover .contact-icon,
  .featured-badge {
    animation: none;
    transform: none;
  }
}