:root {
  --blue-deep: #284b59;
  --blue-mid: #1279ac;
  --blue-soft: #6dbad9;
  --gold: #d6b667;
  --paper: #fdfceb;
  --ink: #203a43;
  --ink-soft: rgba(32, 58, 67, 0.78);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font-display: "Corsario Variable", "Cormorant Garamond", Georgia, serif;
  --font-body: "Corsario Variable", Georgia, serif;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--blue-deep);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 400;
}

body { overflow-x: hidden; }

/* Scrollbars discretas */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 182, 103, .72) rgba(20, 45, 54, .38);
}

body::-webkit-scrollbar,
.map-scroll::-webkit-scrollbar,
.modal-panel::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body::-webkit-scrollbar-track,
.map-scroll::-webkit-scrollbar-track,
.modal-panel::-webkit-scrollbar-track {
  background: rgba(20, 45, 54, .38);
}

body::-webkit-scrollbar-thumb,
.map-scroll::-webkit-scrollbar-thumb,
.modal-panel::-webkit-scrollbar-thumb {
  background: rgba(214, 182, 103, .72);
  border-radius: 999px;
  border: 2px solid rgba(20, 45, 54, .38);
}

body::-webkit-scrollbar-thumb:hover,
.map-scroll::-webkit-scrollbar-thumb:hover,
.modal-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(214, 182, 103, .92);
}

button,
a { font-family: inherit; }
button { cursor: pointer; }

.screen,
.view { display: none; }
.screen { min-height: 100vh; }
.screen.is-active,
.view.is-active { display: block; }

/* Pantalla inicial */
.start-screen {
  position: relative;
  place-items: center;
  overflow: hidden;
  background: #071a20;
}

.start-screen.is-active { display: grid; }

.start-video,
.start-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.start-video { z-index: 0; }

.start-fallback {
  z-index: -1;
  background:
    linear-gradient(rgba(7, 26, 32, 0.18), rgba(7, 26, 32, 0.36)),
    url("../medios/img/fondoHitos.png") center / cover no-repeat,
    radial-gradient(circle at center, #315866, #071a20 70%);
}

.video-paused .start-fallback { z-index: 0; }

.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at center, rgba(0,0,0,.05), rgba(0,0,0,.52));
}

.start-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  animation: fadeUp .9s ease both;
}

.eyebrow {
  margin: 0 0 .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: clamp(.8rem, 1.2vw, 1rem);
  color: rgba(253,252,235,.78);
}

.start-content h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: .92;
  text-transform: uppercase;
  text-shadow: 0 4px 26px rgba(0,0,0,.36);
}

.claim {
  margin: .75rem 0 4rem;
  font-size: clamp(1.4rem, 2.7vw, 2.5rem);
  font-weight: 700;
  text-shadow: 0 3px 20px rgba(0,0,0,.42);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  border: 0;
  border-radius: 999px;
  padding: .82rem 2.1rem;
  font-weight: 800;
  font-size: 1.02rem;
  text-decoration: none;
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn:active { transform: translateY(0); }

.btn-primary,
.btn-secondary {
  background: var(--gold);
  color: var(--blue-deep);
}

.btn-secondary { box-shadow: 0 6px 20px rgba(0,0,0,.18); }

.btn-tertiary {
  background: rgba(40,75,89,.1);
  color: var(--blue-deep);
  border: 1px solid rgba(40,75,89,.22);
}

/* Topbar */
.main-experience { background: var(--blue-deep); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 4.6vw;
  background: var(--blue-deep);
  box-shadow: 0 6px 18px rgba(7, 26, 32, 0.14);
}

.brand,
.navlink {
  border: 0;
  background: none;
  color: var(--paper);
  font-weight: 800;
  font-size: clamp(0.7rem, 1.15vw, 1rem);
}

.topnav .navlink {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.4rem;
}

.brand { padding: 0; text-align: left; }
.brand span { opacity: .96; }

.topnav {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: clamp(.5rem, 1vw, 1rem) !important;
}

.navlink { position: relative; padding: .25rem .35rem; }
.navlink + .navlink::before {
  content: "|";
  margin-right: .55rem;
  color: rgba(253,252,235,.78);
}
.navlink.is-active { color: var(--gold); }
.navlink-muted { opacity: .88; }

/* Mapa */
.map-screen {
  position: relative;
  min-height: calc(100vh - 68px);
  background: #162f38;
  overflow: hidden;
}

.map-scroll {
  width: 100%;
  height: calc(100vh - 68px);
  overflow: auto;
}

.map-frame {
  position: relative;
  width: 100%;
  min-width: 980px;
  aspect-ratio: 1619 / 971;
  margin: 0 auto;
  background: #3c4b45;
  overflow: hidden;
}

.map-logos {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;

  display: flex;
  align-items: center;
  gap: 0.7rem;

  padding: 0.45rem 0.65rem;
  border-radius: 999px;

  /* background: rgba(253, 252, 235, 0.78);
  border: 1px solid rgba(40, 75, 89, 0.16);
  box-shadow: 0 6px 18px rgba(7, 26, 32, 0.12);
  backdrop-filter: blur(5px); */

  pointer-events: none;
}

.map-logos img {
  height: 48px;
  width: auto;
  max-width: 92px;
  object-fit: contain;
  opacity: 0.9;
}

.map-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.markers-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border: 0;
  background: transparent;
  color: var(--paper);
  text-align: center;
  filter: drop-shadow(0 5px 7px rgba(0,0,0,.34));
  transition: opacity .2s ease, transform .2s ease, filter .2s ease;
}

.map-marker:hover,
.map-marker:focus-visible {
  transform: translate(-50%, -50%) scale(1.07);
  outline: none;
}

.marker-icon-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.marker-icon {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.marker-icon[src=""] { display: none; }

.marker-fallback {
  display: none;
  width: 34px;
  height: 34px;
  background: var(--gold);
  clip-path: polygon(50% 0%, 100% 38%, 100% 100%, 0 100%, 0 38%);
}

.marker-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(calc(-50% + var(--label-x)), calc(-50% + var(--label-y))) scale(.96);
  min-width: max-content;
  max-width: 220px;
  color: rgba(253,252,235,.88);
  font-weight: 700;
  font-size: clamp(1.2rem, 1.65vw, 1.9rem);
  line-height: 1;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,.52);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.map-marker:hover .marker-label,
.map-marker:focus-visible .marker-label {
  opacity: 1;
  visibility: visible;
  transform: translate(calc(-50% + var(--label-x)), calc(-50% + var(--label-y))) scale(1);
}

.map-marker.is-locked {
  opacity: .36;
  filter: grayscale(.7) drop-shadow(0 5px 7px rgba(0,0,0,.30));
}

.map-marker.is-next .marker-icon,
.map-marker.is-unlocked .marker-icon { filter: saturate(1.08) brightness(1.03); }

.map-marker.is-next .marker-icon-wrap::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 999px;
  box-shadow: 0 0 0 7px rgba(214,182,103,.17), 0 0 0 15px rgba(214,182,103,.09);
  pointer-events: none;
}

.map-marker.is-visited .marker-icon { opacity: .82; }
.map-marker.is-science.is-locked { opacity: .30; }

.next-card {
  position: absolute;
  left: 4.4vw;
  right: auto;
  bottom: 6vh;
  z-index: 3;
  max-width: min(520px, 86vw);
  background: rgba(253,252,235,.96);
  color: var(--blue-deep);
  padding: 1.15rem 1.9rem;
  border-radius: 9px;
  box-shadow: var(--shadow);
  font-weight: 200;
  font-size: clamp(0.7rem, 1vw, 1rem);
}

/* Hitos */
.hit-screen { background: var(--blue-deep); }

.hit-article { min-height: calc(100vh - 68px); }

.hit-hero {
  position: relative;
  min-height: 64vh;
  display: flex;
  align-items: flex-end;
  padding: 7vh 9.5vw;
  background-color: #0f252d;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.hit-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.10) 0%, rgba(0,0,0,.62) 100%);
}

.hit-hero-content {
  position: relative;
  z-index: 1;
  max-width: 850px;
}

.hit-hero h2 {
  margin: 0;
  font-size: clamp(2.7rem, 5.6vw, 5.8rem);
  line-height: .95;
  text-shadow: 0 4px 22px rgba(0,0,0,.45);
}

.hit-subtitle,
.hit-coords {
  margin: .45rem 0 0;
  font-size: clamp(1.1rem, 2vw, 2rem);
  font-weight: 800;
  text-shadow: 0 3px 16px rgba(0,0,0,.46);
}

.hit-coords {
  font-size: clamp(.95rem, 1.4vw, 1.2rem);
  opacity: .9;
}

.hit-actions {
  position: absolute;
  z-index: 2;
  right: 8vw;
  bottom: 13vh;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.hit-actions[hidden] { display: none; }
.hit-actions a[hidden] { display: none; }

.hit-body-wrap {
  min-height: 60vh;
  background:
    linear-gradient(rgba(18,121,172,.78), rgba(18,121,172,.78)),
    url("../medios/img/fondoHitos.png") center / cover repeat;
  padding: 6.2rem 9.5vw 8rem;
}

.hit-body {
  max-width: 920px;
  margin: 0 auto;
  color: var(--paper);
}

.content-block + .content-block { margin-top: 3rem; }

.content-block h3 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.content-block p {
  margin: 0 0 1.1rem;
  font-size: clamp(1rem, 1.25vw, 1.35rem);
  line-height: 1.42;
  font-weight: 400;
}

.hit-footer-actions {
  max-width: 920px;
  margin: 3.5rem auto 0;
}

/* Modal */
.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.44);
  backdrop-filter: blur(2px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 94vw);
  max-height: 88vh;
  overflow: auto;
  background: var(--paper);
  color: var(--blue-deep);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.65rem, 3.2vw, 2.8rem);
}

.modal-close {
  position: absolute;
  top: .75rem;
  right: 1rem;
  border: 0;
  background: transparent;
  color: var(--blue-deep);
  font-size: 2.2rem;
  line-height: 1;
}

.modal-panel h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.55rem, 2.6vw, 2.35rem);
  line-height: 1.03;
  font-weight: 800;
}

.modal-body p {
  margin: 0 0 .9rem;
  font-weight: 400;
  font-size: clamp(.98rem, 1.12vw, 1.16rem);
  line-height: 1.36;
}

.modal-body strong { font-weight: 800; }

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.8rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .topbar {
    position: sticky;
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem 5vw;
  }

  .topnav { justify-content: flex-start; }

  .map-scroll { height: calc(100vh - 114px); }
  .map-frame { min-width: 850px; }

  .next-card {
    left: 5vw;
    right: 5vw;
    bottom: 1rem;
  }

  .hit-hero { min-height: 58vh; padding: 5rem 6vw; }
  .hit-actions {
    position: relative;
    right: auto;
    bottom: auto;
    margin-top: 2rem;
  }

  .hit-body-wrap { padding: 4rem 6vw 6rem; }
}

.hit-inline-image {
  margin: 1.4rem 0 1.6rem;
}

.hit-inline-image img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(230, 220, 190, 0.22);
}

.hit-inline-image figcaption {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 400;
  opacity: 0.72;
}

/* =========================================================
   MOTION SYSTEM / CASA MONETA
   Animaciones generales suaves
========================================================= */

:root {
  --motion-fast: 260ms;
  --motion-base: 560ms;
  --motion-slow: 920ms;
  --motion-ease: cubic-bezier(.22, .61, .36, 1);
}

/* Reveal base */
.reveal,
.reveal-card {
  opacity: 0;
  will-change: opacity, transform, filter, clip-path;
}

.reveal {
  transform: translate3d(0, 18px, 0);
  transition:
    opacity var(--motion-base) var(--motion-ease),
    transform var(--motion-base) var(--motion-ease),
    filter var(--motion-base) var(--motion-ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.reveal-left {
  transform: translate3d(-24px, 0, 0);
}

.reveal-right {
  transform: translate3d(24px, 0, 0);
}

.reveal-scale {
  transform: scale(.96);
}

.reveal-soft {
  filter: blur(4px);
}

.reveal-soft.is-visible {
  filter: blur(0);
}

.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-scale.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Reveal tipo placa documental */
.reveal-card {
  transform: translate3d(0, 16px, 0);
  clip-path: inset(0 0 18% 0);
  transition:
    opacity var(--motion-base) var(--motion-ease),
    transform var(--motion-base) var(--motion-ease),
    clip-path var(--motion-slow) var(--motion-ease);
}

.reveal-card.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  clip-path: inset(0 0 0 0);
}

/* Delays */
.delay-1 { transition-delay: 90ms; }
.delay-2 { transition-delay: 180ms; }
.delay-3 { transition-delay: 270ms; }
.delay-4 { transition-delay: 360ms; }
.delay-5 { transition-delay: 450ms; }

/* Fondo de inicio: movimiento mínimo */
.start-video,
.start-fallback {
  transform: scale(1.035);
  animation: startDrift 18s ease-in-out infinite alternate;
}

@keyframes startDrift {
  from {
    transform: scale(1.035) translate3d(-0.4%, -0.4%, 0);
  }
  to {
    transform: scale(1.07) translate3d(0.4%, 0.4%, 0);
  }
}

/* Textura atmosférica sutil */
.start-screen::after,
.map-screen::after,
.hit-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .12;
  mix-blend-mode: soft-light;
  background:
    radial-gradient(circle at 20% 20%, rgba(253,252,235,.22), transparent 28%),
    radial-gradient(circle at 80% 70%, rgba(253,252,235,.12), transparent 30%),
    repeating-linear-gradient(
      0deg,
      rgba(253,252,235,.045) 0,
      rgba(253,252,235,.045) 1px,
      transparent 1px,
      transparent 4px
    );
}

.map-screen::after {
  z-index: 1;
  opacity: .08;
}

.hit-hero::after {
  z-index: 1;
  opacity: .10;
}

/* Garantiza que el contenido quede sobre la textura */
.start-content,
.hit-hero-content,
.hit-actions {
  z-index: 3;
}

/* Entrada de vistas */
.view.is-active {
  animation: viewIn var(--motion-base) var(--motion-ease) both;
}

@keyframes viewIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Marcadores: entrada visual sin alterar estados locked/visited */
.marker-icon-wrap {
  opacity: 0;
  transform: scale(.78) translate3d(0, 8px, 0);
  animation: markerIconIn 520ms var(--motion-ease) both;
  animation-delay: var(--marker-delay, 0ms);
}

@keyframes markerIconIn {
  to {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
  }
}

/* Próximo hito: pulso más orgánico */
.map-marker.is-next .marker-icon-wrap::after {
  animation: nextMarkerPulse 2.8s ease-in-out infinite;
}

@keyframes nextMarkerPulse {
  0%, 100% {
    opacity: .62;
    transform: scale(.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

/* Modal con entrada más suave */
.modal-panel {
  animation: modalPanelIn 360ms var(--motion-ease) both;
}

@keyframes modalPanelIn {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

/* Respeto por accesibilidad */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }

  .reveal,
  .reveal-card,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-soft {
    opacity: 1;
    transform: none;
    filter: none;
    clip-path: none;
  }
}

/* =========================================================
   MAP MOTION / CASA MONETA
   Dinámica visual del mapa y marcadores
========================================================= */

/* Parallax leve del mapa */
.map-frame {
  --map-parallax-x: 0px;
  --map-parallax-y: 0px;
  isolation: isolate;
}

.map-image {
  transform:
    scale(1.014)
    translate3d(var(--map-parallax-x), var(--map-parallax-y), 0);
  transition: transform 220ms ease-out;
}

.markers-layer {
  transform: translate3d(var(--map-parallax-x), var(--map-parallax-y), 0);
  transition: transform 220ms ease-out;
}

.map-frame.is-parallax-idle .map-image,
.map-frame.is-parallax-idle .markers-layer {
  transition-duration: 620ms;
}

/* Placa Próximo hito */
.next-card {
  overflow: hidden;
  transform-origin: left bottom;
  transition:
    opacity 220ms var(--motion-ease),
    transform 220ms var(--motion-ease),
    box-shadow 220ms var(--motion-ease);
}

.next-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--gold);
  opacity: .86;
}

.next-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .40);
}

.next-card.is-updating {
  opacity: 0;
  transform: translate3d(-12px, 8px, 0) scale(.985);
}

.next-card-kicker {
  margin: 0 0 .35rem;
  color: rgba(40, 75, 89, .62);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.next-card-title {
  margin: 0;
  font-size: clamp(1.1rem, 1.45vw, 1.55rem);
  line-height: 1.05;
  font-weight: 800;
}

.next-card-meta {
  margin: .35rem 0 0;
  color: rgba(40, 75, 89, .72);
  font-size: .92rem;
  font-weight: 500;
}

/* Marcadores con presencia documental */
.map-marker {
  z-index: 3;
}

.map-marker::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: -1;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(253, 252, 235, .30), rgba(253, 252, 235, 0) 68%);
  opacity: 0;
  transform: scale(.72);
  transition:
    opacity 220ms var(--motion-ease),
    transform 220ms var(--motion-ease);
}

.map-marker:hover::before,
.map-marker:focus-visible::before {
  opacity: .8;
  transform: scale(1.45);
}

.map-marker:hover .marker-icon,
.map-marker:focus-visible .marker-icon {
  filter: saturate(1.16) brightness(1.08);
}

.map-marker.is-next {
  z-index: 7;
}

.map-marker.is-next::before {
  opacity: .72;
  animation: nextMarkerBreath 3.6s ease-in-out infinite;
}

.map-marker.is-locked::before {
  display: none;
}

@keyframes nextMarkerBreath {
  0%, 100% {
    transform: scale(1.05);
    opacity: .42;
  }

  50% {
    transform: scale(1.72);
    opacity: .86;
  }
}

/* Etiquetas de marcadores */
.marker-label {
  padding: .14rem .5rem .2rem;
  border-radius: 999px;
  background: rgba(7, 26, 32, .18);
  backdrop-filter: blur(2px);
}

/* Entrada al mapa */
body[data-view="map"] .map-frame {
  animation: mapFrameSettle 720ms var(--motion-ease) both;
}

@keyframes mapFrameSettle {
  from {
    opacity: .86;
    transform: scale(1.012);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Entrada al hito */
body[data-view="hit"] .hit-hero {
  animation: hitHeroSettle 760ms var(--motion-ease) both;
}

body[data-view="hit"] .hit-body-wrap {
  animation: hitBodyIn 620ms var(--motion-ease) both;
}

@keyframes hitHeroSettle {
  from {
    opacity: .86;
    transform: scale(1.012);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes hitBodyIn {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-image,
  .markers-layer,
  .next-card,
  .map-marker::before {
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* =========================================================
   NAVBAR HOVER
   Subrayado animado y cambio de color
========================================================= */

.topnav .navlink {
  position: relative;
  color: var(--paper);
  transition: color 180ms var(--motion-ease);
}

.topnav .navlink::after {
  content: "";
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  bottom: -0.28rem;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  transition:
    transform 220ms var(--motion-ease),
    opacity 220ms var(--motion-ease);
}

.topnav .navlink:hover,
.topnav .navlink:focus-visible {
  color: var(--gold);
  outline: none;
}

.topnav .navlink:hover::after,
.topnav .navlink:focus-visible::after,
.topnav .navlink.is-active::after {
  transform: scaleX(1);
  opacity: 1;
}

.topnav .navlink.is-active {
  color: var(--gold);
}

/* =========================================================
   REFERENCIAS BIBLIOGRÁFICAS POR HITO
========================================================= */

.hit-references {
  margin-top: 4.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(253, 252, 235, .32);
}

.hit-references h3 {
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
}

.hit-references-intro {
  max-width: 720px;
  opacity: .82;
}

.hit-references-list {
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
}

.hit-references-list li {
  position: relative;
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  max-width: 900px;
  font-size: clamp(.92rem, 1.05vw, 1.08rem);
  line-height: 1.42;
  font-weight: 400;
  opacity: .9;
}

.hit-references-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: .42rem;
  height: .42rem;
  border-radius: 999px;
  background: var(--gold);
  opacity: .9;
}

.hit-references-list a {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: rgba(214, 182, 103, .75);
  text-underline-offset: .2em;
  transition: color 180ms var(--motion-ease), text-decoration-color 180ms var(--motion-ease);
}

.hit-references-list a:hover,
.hit-references-list a:focus-visible {
  color: var(--gold);
  text-decoration-color: var(--gold);
  outline: none;
}

/* =========================================================
   RESPONSIVE / PANTALLAS CHICAS
   Ajustes para mobile y orientación vertical
========================================================= */

.screen-advice {
  display: none;
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 3000;
  padding: .85rem 1rem;
  border: 1px solid rgba(214, 182, 103, .45);
  border-radius: 14px;
  background: rgba(253, 252, 235, .96);
  color: var(--blue-deep);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .28);
  font-size: .86rem;
  line-height: 1.25;
  text-align: center;
}

@media (max-width: 760px), (orientation: portrait) {
  .screen-advice {
    display: block;
  }

  .start-content {
    width: min(88vw, 560px);
    padding: 0 1rem;
  }

  .start-content .eyebrow {
    font-size: .72rem;
  }

  .start-content h1 {
    font-size: clamp(3.1rem, 18vw, 5.6rem);
    line-height: .86;
  }

  .start-content .claim {
    font-size: clamp(1rem, 4.2vw, 1.35rem);
  }

  .topbar {
    min-height: auto;
    padding: .72rem 1rem;
    align-items: flex-start;
    gap: .7rem;
  }

  .brand {
    max-width: 58vw;
    font-size: .85rem;
    line-height: 1.05;
  }

  .topnav {
    gap: .15rem;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .topnav .navlink {
    padding: .25rem .35rem;
    font-size: .68rem;
  }

  .topnav .navlink + .navlink::before {
    display: none;
  }

  .map-screen {
    min-height: calc(100vh - 58px);
    overflow: hidden;
  }

  .map-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .map-frame {
    min-width: 980px;
  }

  .next-card {
    left: 1rem;
    right: 1rem;
    bottom: 4.8rem;
    max-width: none;
    padding: .95rem 1rem;
  }

  .next-card-title {
    font-size: 1rem;
  }

  .next-card-meta {
    font-size: .82rem;
  }

  .map-logos {
    right: 1rem;
    bottom: 1rem;
    gap: .5rem;
  }

  .map-logos img {
    height: 34px;
    max-width: 88px;
  }

  .hit-hero {
    min-height: 68vh;
  }

  .hit-hero-content {
    padding: 0 1.1rem 4.8rem;
  }

  .hit-title {
    font-size: clamp(2.4rem, 13vw, 4.4rem);
    line-height: .9;
  }

  .hit-subtitle {
    font-size: 1rem;
  }

  .hit-coords {
    font-size: .8rem;
  }

  .hit-actions {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    justify-content: flex-start;
    gap: .5rem;
  }

  .hit-actions .btn {
    padding: .65rem .85rem;
    font-size: .72rem;
  }

  .hit-body-wrap {
    padding: 3rem 1.1rem 4rem;
  }

  .content-block {
    margin-bottom: 3rem;
  }

  .content-block h2 {
    font-size: clamp(1.8rem, 9vw, 2.8rem);
  }

  .content-block p {
    font-size: 1rem;
    line-height: 1.48;
  }

  .hit-inline-image img {
    max-height: none;
  }

  .modal {
    padding: 1rem;
  }

  .modal-panel {
    max-height: 82vh;
    padding: 1.25rem;
  }
}

/* =========================================================
   MAPA A ALTO DE PANTALLA SOLO EN MOBILE
========================================================= */

@media (max-width: 760px), (orientation: portrait) {
  body[data-view="map"] #main-experience.is-active {
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  body[data-view="map"] .topbar {
    position: relative;
    top: auto;
  }

  body[data-view="map"] .map-screen.is-active {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body[data-view="map"] .map-scroll {
    height: 100%;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  body[data-view="map"] .map-frame {
    height: 100%;
    min-height: 100%;
    min-width: 980px;
  }

  body[data-view="map"] .map-image {
    height: 100%;
    width: 100%;
    object-fit: cover;
  }

  body[data-view="map"] .markers-layer {
    height: 100%;
  }
}

/* =========================================================
   GALERÍA DE IMÁGENES POR HITO
========================================================= */

.hit-gallery {
  margin-top: 4.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(253, 252, 235, .22);
}

.hit-gallery h3 {
  font-size: clamp(1.8rem, 2.6vw, 2.8rem);
}

.hit-gallery-intro {
  max-width: 720px;
  opacity: .82;
}

.hit-gallery-grid {
  column-count: 4;
  column-gap: 0.45rem;
  margin-top: 1.6rem;
}

.hit-gallery-item {
  display: block;
  width: 100%;
  margin: 0 0 0.45rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(253, 252, 235, .18);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(7, 26, 32, .16);

  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;

  position: relative;
}

.hit-gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition:
    transform 280ms var(--motion-ease),
    filter 280ms var(--motion-ease);
}

.hit-gallery-item:hover img,
.hit-gallery-item:focus-visible img {
  transform: scale(1.02);
  filter: brightness(.88) saturate(1.03);
}

.hit-gallery-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.hit-gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: .65rem .75rem;
  color: var(--paper);
  font-size: .76rem;
  line-height: 1.25;
  text-align: left;
  background: linear-gradient(
    to top,
    rgba(7, 26, 32, .78),
    rgba(7, 26, 32, 0)
  );
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 220ms var(--motion-ease),
    transform 220ms var(--motion-ease);
}

.hit-gallery-item:hover .hit-gallery-caption,
.hit-gallery-item:focus-visible .hit-gallery-caption {
  opacity: 1;
  transform: translateY(0);
}

.hit-gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: .65rem .75rem;
  color: var(--paper);
  font-size: .76rem;
  line-height: 1.25;
  text-align: left;
  background: linear-gradient(
    to top,
    rgba(7, 26, 32, .78),
    rgba(7, 26, 32, 0)
  );
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 220ms var(--motion-ease),
    transform 220ms var(--motion-ease);
}

.hit-gallery-item:hover .hit-gallery-caption,
.hit-gallery-item:focus-visible .hit-gallery-caption {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   LIGHTBOX GALERÍA
========================================================= */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(7, 26, 32, .92);
}

.gallery-lightbox.is-active {
  display: flex;
}

.gallery-lightbox-figure {
  position: relative;
  width: min(1120px, 88vw);
  max-height: 90vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .48);
  background: rgba(0, 0, 0, .22);
}

.gallery-lightbox-caption {
  margin-top: .85rem;
  max-width: 820px;
  color: var(--paper);
  font-size: .92rem;
  line-height: 1.35;
  text-align: center;
  opacity: .86;
}

.gallery-lightbox-counter {
  margin: .35rem 0 0;
  color: rgba(253, 252, 235, .64);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.gallery-lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.2rem;
  z-index: 222;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(253, 252, 235, .14);
  color: var(--paper);
  font-size: 2rem;
  line-height: 1;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible {
  background: rgba(253, 252, 235, .24);
  outline: none;
}

.gallery-lightbox-nav {
  position: fixed;
  top: 50%;
  z-index: 222;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: rgba(253, 252, 235, .14);
  color: var(--paper);
  font-size: 3rem;
  line-height: .8;
  transform: translateY(-50%);
}

.gallery-lightbox-nav:hover,
.gallery-lightbox-nav:focus-visible {
  background: rgba(253, 252, 235, .24);
  outline: none;
}

.gallery-lightbox-prev {
  left: 1.2rem;
}

.gallery-lightbox-next {
  right: 1.2rem;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .hit-gallery-grid {
    column-count: 3;
  }
}

@media (max-width: 760px), (orientation: portrait) {
  .hit-gallery-grid {
    column-count: 2;
    column-gap: 0.35rem;
  }

  .hit-gallery-item {
    margin-bottom: 0.35rem;
  }

  .gallery-lightbox {
    padding: 1rem;
  }

  .gallery-lightbox-img {
    max-height: 72vh;
  }

  .gallery-lightbox-nav {
    top: auto;
    bottom: 1rem;
    transform: none;
    width: 44px;
    height: 44px;
    font-size: 2.4rem;
  }

  .gallery-lightbox-prev {
    left: 1rem;
  }

  .gallery-lightbox-next {
    right: 1rem;
  }

  .gallery-lightbox-close {
    top: .75rem;
    right: .75rem;
  }
}

.screen-advice {
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  text-align: left;
}

.screen-advice span {
  flex: 1;
}

.screen-advice-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(40, 75, 89, .12);
  color: var(--blue-deep);
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 800;
}

.screen-advice.is-hidden {
  display: none !important;
}

/* No mostrar antes de empezar ni dentro de hitos */
body:not(.experience-started) .screen-advice,
body[data-view="hit"] .screen-advice {
  display: none !important;
}

/* No mostrar en horizontal */
@media (orientation: landscape) {
  .screen-advice {
    display: none !important;
  }
}

/* Mostrar solo en mapa, mobile y orientación vertical */
@media (max-width: 900px) and (orientation: portrait) {
  body.experience-started[data-view="map"] .screen-advice:not(.is-hidden) {
    display: flex;
  }
}