/* NeuroState — animations, transitions, and hover states */

.site-nav ul li a::after {
  content: "";
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 0.4rem;
  height: 2px;
  background: var(--color-accent-bright);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}

.site-nav ul li a:hover,
.site-nav ul li a:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-accent-bright);
}

.site-nav ul li a:hover::after,
.site-nav ul li a:focus-visible::after {
  transform: scaleX(1);
}

/* Animated hero background */
.hero-animated {
  position: relative;
  overflow: hidden;
  background: linear-gradient(-45deg, #1B263B, #243447, #1B263B, #14314f);
  background-size: 400% 400%;
  animation: hero-gradient 12s ease infinite;
}

@keyframes hero-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Faint moving scanline sweep across hero panels — subtle AAA-menu flavor */
.hero-animated::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 40%, rgba(24, 255, 255, 0.06) 50%, transparent 60%);
  background-size: 300% 300%;
  animation: hero-sheen 9s ease-in-out infinite;
}

@keyframes hero-sheen {
  0% { background-position: 120% 0%; }
  50% { background-position: -20% 0%; }
  100% { background-position: 120% 0%; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Staggered cascade for grid/list children once their section reveals */
.reveal .card,
.reveal .stat,
.reveal .thumb,
.reveal .location-item,
.reveal .accordion-item,
.reveal .timeline-item,
.reveal .art-panel {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), border-color 0.2s ease, box-shadow 0.2s ease;
}

.reveal.in-view .card,
.reveal.in-view .stat,
.reveal.in-view .thumb,
.reveal.in-view .location-item,
.reveal.in-view .accordion-item,
.reveal.in-view .timeline-item,
.reveal.in-view .art-panel {
  opacity: 1;
  transform: none;
}

.reveal.in-view .grid > *:nth-child(1),
.reveal.in-view .location-list > *:nth-child(1),
.reveal.in-view .timeline-item:nth-of-type(1),
.reveal.in-view .accordion-item:nth-of-type(1) { transition-delay: 0.03s; }
.reveal.in-view .grid > *:nth-child(2),
.reveal.in-view .location-list > *:nth-child(2),
.reveal.in-view .timeline-item:nth-of-type(2),
.reveal.in-view .accordion-item:nth-of-type(2) { transition-delay: 0.09s; }
.reveal.in-view .grid > *:nth-child(3),
.reveal.in-view .location-list > *:nth-child(3),
.reveal.in-view .timeline-item:nth-of-type(3),
.reveal.in-view .accordion-item:nth-of-type(3) { transition-delay: 0.15s; }
.reveal.in-view .grid > *:nth-child(4),
.reveal.in-view .location-list > *:nth-child(4),
.reveal.in-view .timeline-item:nth-of-type(4),
.reveal.in-view .accordion-item:nth-of-type(4) { transition-delay: 0.21s; }
.reveal.in-view .grid > *:nth-child(5),
.reveal.in-view .location-list > *:nth-child(5),
.reveal.in-view .timeline-item:nth-of-type(5),
.reveal.in-view .accordion-item:nth-of-type(5) { transition-delay: 0.27s; }
.reveal.in-view .grid > *:nth-child(6),
.reveal.in-view .location-list > *:nth-child(6),
.reveal.in-view .timeline-item:nth-of-type(6),
.reveal.in-view .accordion-item:nth-of-type(6) { transition-delay: 0.33s; }

.btn {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  box-shadow: 0 0 20px rgba(24, 255, 255, 0.65), 0 0 40px rgba(0, 207, 193, 0.25);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 0 10px rgba(24, 255, 255, 0.5);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  box-shadow: 0 0 14px rgba(24, 255, 255, 0.4);
  border-color: var(--color-accent-bright);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.grid-gallery .thumb,
.thumb {
  transition: outline-color 0.2s ease, transform 0.3s var(--ease-out), box-shadow 0.3s ease;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.grid-gallery .thumb:hover,
.thumb:hover {
  outline-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.card {
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--color-accent);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(0, 207, 193, 0.12);
}

.card:hover::before {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.card:hover::after {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.card-icon {
  transition: transform 0.25s var(--ease-out), filter 0.25s ease;
}

.card:hover .card-icon {
  transform: scale(1.15) translateY(-2px);
  filter: drop-shadow(0 0 8px var(--glow-accent-soft));
}

.tag-list li {
  transition: background 0.2s ease, transform 0.2s ease;
}

.tag-list li:hover {
  background: rgba(0, 207, 193, 0.22);
  transform: translateY(-1px);
}

.accordion-icon {
  transition: transform 0.25s var(--ease-out);
}

.accordion-item.open .accordion-icon {
  transform: rotate(45deg);
}

.accordion-trigger {
  transition: color 0.2s ease;
}

.accordion-trigger:hover {
  color: var(--color-accent-bright);
}

/* Consistent focus treatment for interactive elements that don't already
   define their own :focus-visible state */
.filter-btn:focus-visible,
.accordion-trigger:focus-visible,
.thumb:focus-visible,
.lightbox-close:focus-visible,
.nav-toggle:focus-visible,
.map-pin:focus-visible {
  outline: 2px solid var(--color-accent-bright);
  outline-offset: 2px;
  box-shadow: 0 0 12px var(--glow-accent-soft);
}

.accordion-panel {
  transition: grid-template-rows 0.3s var(--ease-out);
}

/* Map pins: idle pulse + hover glow */
.map-pin {
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: pin-pulse 2.4s ease-in-out infinite;
}

@keyframes pin-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(24, 255, 255, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(24, 255, 255, 0); }
}

.map-pin:hover {
  background: #fff;
  border-color: var(--color-accent);
  transform: scale(1.25);
  animation-play-state: paused;
}

.filter-btn {
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-1px);
}

.filter-btn:active {
  transform: translateY(0);
}

.footer-nav a {
  position: relative;
  transition: color 0.2s ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--color-accent);
}

.back-to-top {
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  box-shadow: 0 0 20px rgba(24, 255, 255, 0.6);
  transform: translateY(-3px);
}

/* Status / difficulty / pill badges get a subtle hover lift */
.status,
.difficulty,
.pill {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status:hover,
.difficulty:hover,
.pill:hover {
  transform: translateY(-1px);
}

/* Meter fill shimmer */
.meter-fill {
  position: relative;
  overflow: hidden;
}

.meter-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-100%);
  animation: meter-shimmer 3s ease-in-out infinite;
}

@keyframes meter-shimmer {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

.map-preview img {
  transition: transform 0.4s var(--ease-out);
}

.map-preview:hover img {
  transform: scale(1.04);
}

.map-preview-label {
  transition: color 0.2s ease, background 0.2s ease;
}

.map-preview:hover .map-preview-label,
.map-preview:focus-visible .map-preview-label {
  color: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
  .hero-animated,
  .hero-animated::before,
  .map-pin,
  .meter-fill::after {
    animation: none;
  }

  .reveal,
  .reveal .card,
  .reveal .stat,
  .reveal .thumb,
  .reveal .location-item,
  .reveal .accordion-item,
  .reveal .timeline-item,
  .reveal .art-panel {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .btn::before,
  .accordion-icon,
  .accordion-panel,
  .card,
  .card-icon,
  .thumb,
  .grid-gallery .thumb,
  .back-to-top,
  .grid-stats .stat,
  .location-item,
  .map-preview img {
    transition: none;
  }
}
