/* Tokens y utilidades globales */
:root {
  --header-height: 4rem;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

/* Entrada suave al cargar */
.reveal {
  animation: fade-in-up 0.6s ease-out forwards;
}

.reveal-delay-1 {
  animation-delay: 0.08s;
  opacity: 0;
}

.reveal-delay-2 {
  animation-delay: 0.16s;
  opacity: 0;
}

.reveal-delay-3 {
  animation-delay: 0.24s;
  opacity: 0;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enlaces de sección activos (actualizado por JS en Header) */
.nav-link {
  position: relative;
  padding-bottom: 0.125rem;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: theme("colors.brand.500");
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

.dark .nav-link::after {
  background: theme("colors.brand.400");
}

/* Focus visible accesible */
:focus-visible {
  outline: 2px solid theme("colors.brand.500");
  outline-offset: 2px;
}

.dark :focus-visible {
  outline-color: theme("colors.brand.400");
}

/* Modal de foto de perfil */
.profile-photo-modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  max-height: 100dvh;
}

.profile-photo-modal::backdrop {
  background: rgb(0 0 0 / 0.82);
  backdrop-filter: blur(4px);
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-delay-1,
  .reveal-delay-2,
  .reveal-delay-3 {
    animation: none;
    opacity: 1;
  }

  .nav-link::after {
    transition: none;
  }
}
