/* Base atmosphere */
:root {
  --void: #05060a;
  --cyan: #22d3ee;
  --electric: #3b82f6;
  --neon: #4ade80;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--void);
  color: #e2e8f0;
  min-height: 100vh;
}

/* AOS esconde [data-aos] com opacity:0 até o JS rodar.
   Se o init falhar (caminho/CDN), o conteúdo ficaria invisível para sempre. */
html:not(.aos-enabled) [data-aos],
html:not(.aos-enabled) [data-aos][data-aos] {
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}

::selection {
  background: rgba(34, 211, 238, 0.25);
  color: #e2e8f0;
}

#space-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main,
header,
footer {
  position: relative;
  z-index: 10;
}

#space-canvas,
.noise {
  z-index: 0;
}

/* Typing no hero */
.typing-cursor {
  display: inline-block;
  margin-left: 0.12em;
  color: var(--cyan);
  font-weight: 400;
  animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Header fixo: transparente no topo, ganha fundo visível ao rolar */
#site-header {
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

#site-header.is-scrolled {
  background: rgba(10, 18, 36, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

#site-header.is-scrolled #mobile-menu {
  background: rgba(10, 18, 36, 0.95);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: var(--cyan);
  transition: width 0.25s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Panels & cards — interaction containers */
.info-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, rgba(18, 24, 48, 0.65), rgba(10, 12, 22, 0.4));
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.info-panel:hover {
  border-color: rgba(34, 211, 238, 0.25);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.08);
  transform: translateY(-2px);
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  font-size: 0.8125rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.skill-chip:hover {
  border-color: rgba(74, 222, 128, 0.35);
  color: #a7f3d0;
  background: rgba(74, 222, 128, 0.06);
}

.project-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, rgba(14, 18, 36, 0.9), rgba(8, 10, 20, 0.75));
  border-radius: 0.85rem;
  padding: 1.5rem;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 0.35s ease,
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(34, 211, 238, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.project-card:hover {
  border-color: rgba(34, 211, 238, 0.35);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 32px rgba(34, 211, 238, 0.12);
}

.project-card:hover::before {
  opacity: 1;
}

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.45rem;
  border-radius: 0.25rem;
}

/* Stack icons */
.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0.85rem;
  padding: 1.25rem 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  color: #94a3b8;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.stack-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(34, 211, 238, 0.2);
  background: rgba(34, 211, 238, 0.06);
  color: var(--cyan);
  transition: box-shadow 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}

.stack-icon svg,
.stack-icon img {
  width: 1.25rem;
  height: 1.25rem;
}

.stack-item:hover {
  border-color: rgba(34, 211, 238, 0.3);
  color: #e2e8f0;
  transform: translateY(-3px);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.1);
}

.stack-item:hover .stack-icon {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
  transform: scale(1.08);
  animation: icon-pulse 1.6s ease-in-out infinite;
}

@keyframes icon-pulse {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.25);
  }
  50% {
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.5);
  }
}

/* CTA */
.cta-panel {
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 1rem;
  background: linear-gradient(160deg, rgba(10, 18, 36, 0.95), rgba(12, 8, 28, 0.9));
  box-shadow: 0 0 60px rgba(34, 211, 238, 0.06);
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 1.15rem;
  border-radius: 0.5rem;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.contact-btn:hover {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.2);
  transform: translateY(-2px);
}

.contact-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Key glow accent */
#site-header a.group span.inline-flex {
  animation: soft-glow 3s ease-in-out infinite;
}

@keyframes soft-glow {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.25);
  }
  50% {
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.45);
  }
}

/* Focus accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
