html { scroll-behavior: smooth; }

:focus-visible {
  outline: 3px solid #60a5fa !important;
  outline-offset: 2px;
  border-radius: 2px;
}

.typed-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background-color: #60a5fa;
  vertical-align: text-bottom;
  animation: cursorBlink 1s step-end infinite;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.bg-tech {
  background-color: #0f172a;
}

#bg-layers {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background-color: #0f172a;
}

.bg-anim {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 25%, #172554 50%, #111827 75%, #0f172a 100%);
  background-size: 300% 300%;
  animation: bgShift 18s ease-in-out infinite;
}

@keyframes bgShift {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(100, 116, 139, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 116, 139, 0.14) 1px, transparent 1px);
  background-size: 45px 45px;
  -webkit-mask-image: radial-gradient(ellipse 90% 85% at 50% 30%, black 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 85% at 50% 30%, black 35%, transparent 100%);
  animation: gridMove 30s linear infinite;
}

@keyframes gridMove {
  from { background-position: 0 0, 0 0; }
  to { background-position: 45px 45px, 45px 45px; }
}

.bg-glow {
  position: absolute;
  top: -12%;
  left: 50%;
  transform: translateX(-50%);
  width: 75%;
  height: 65%;
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.35), transparent 70%);
  filter: blur(30px);
  animation: glowPulse 6s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.skill-bar {
  height: 10px;
  background-color: #1e40af;
  border-radius: 5px;
  transition: width 1.5s ease-in-out;
}

.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

nav a[aria-current="page"] {
  color: #93c5fd;
}

@media (min-width: 768px) {
  nav a[aria-current="page"] {
    position: relative;
  }
  nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    background-color: #60a5fa;
    border-radius: 1px;
  }
}

.scroll-down {
  animation: bounce-down 2s ease-in-out infinite;
}

@keyframes bounce-down {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(10px); opacity: 0.6; }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

#backToTop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#backToTop.show {
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
}

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

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px #1e3a5f inset;
  transition: background-color 5000s ease-in-out 0s;
}

@media (prefers-reduced-motion: reduce) {
  .bg-anim, .grid-lines, .bg-glow, .scroll-down {
    animation: none !important;
  }
  .typed-cursor {
    animation: none !important;
  }
  .fade-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .card {
    transition: none !important;
  }
}
