:root {
  --azul: #2d408f;
  --beige: #fff0df;
  --ink: #0a1030;
  --ocean: #0b2036;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  font-family: "paralucent", sans-serif;
  font-weight: 300;
  background: var(--ocean);
  color: var(--beige);
  overflow-x: hidden;
}

img { user-select: none; -webkit-user-drag: none; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--azul);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  transition: opacity 0.7s ease, visibility 0.7s;
}
.loader.is-done { opacity: 0; visibility: hidden; }

/* Marca: contorno visible desde el inicio + relleno progresivo + brillo, sensación de carga real */
.loader { --loader-w: min(46vw, 340px); }
.loader__mark {
  position: relative;
  width: var(--loader-w);
  aspect-ratio: 464.82 / 257.6;
}
.loader__outline-svg,
.loader__fill-svg {
  position: absolute; top: 0; left: 0;
  display: block;
  height: 100%;
}
.loader__outline-svg { width: 100%; }
.loader__outline-use {
  fill: none;
  stroke: var(--beige);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
  opacity: 0.4;
}
.loader__fill {
  position: absolute; inset: 0;
  width: 0%;
  overflow: hidden;
  animation: loaderFill 2.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
.loader__fill-svg { width: var(--loader-w); }
.loader__fill-use { fill: var(--beige); }
@keyframes loaderFill {
  0% { width: 0%; }
  55% { width: 100%; }
  78% { width: 100%; }
  92% { width: 0%; }
  100% { width: 0%; }
}
.loader__shine {
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.95) 50%, transparent 65%);
  background-size: 260% 100%;
  background-repeat: no-repeat;
  -webkit-mask-image: url("assets/logo-venice-beige.svg");
  mask-image: url("assets/logo-venice-beige.svg");
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  mix-blend-mode: screen;
  animation: loaderShine 2.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes loaderShine {
  0% { background-position: 160% 0; }
  60% { background-position: -60% 0; }
  100% { background-position: -60% 0; }
}
.loader__tag {
  font-weight: 700;
  letter-spacing: 0.5em;
  font-size: clamp(16px, 2.6vw, 24px);
  margin-top: 6px;
}
@media (prefers-reduced-motion: reduce) {
  .loader__fill, .loader__shine { animation: none; }
  .loader__fill { width: 100%; }
}

/* ---------- HUD ---------- */
.hud {
  position: fixed; z-index: 40;
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px;
  pointer-events: none;
}
.hud__logo { width: 92px; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45)); }
.hud__stop {
  display: flex; align-items: center; gap: 12px;
  background: rgba(10, 16, 48, 0.55);
  border: 1px solid rgba(255, 240, 223, 0.25);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 10px 20px;
}
.hud__stop-code {
  font-weight: 700; font-size: 13px; letter-spacing: 0.08em;
  color: var(--azul);
  background: var(--beige);
  border-radius: 999px;
  padding: 3px 10px;
}
.hud__stop-name { font-weight: 700; letter-spacing: 0.22em; font-size: 13px; }

.hud__right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

/* Botón de tienda permanente: mismo hueco que el HUD (siempre libre de tarjetas/overlays,
   que se anclan abajo), visible en toda la web sin depender de en qué parada estés. */
.shopfab {
  display: flex; align-items: center; gap: 7px;
  color: var(--azul); background: var(--beige);
  font-weight: 700; font-size: 11px; letter-spacing: 0.14em;
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 16px;
  box-shadow: 0 8px 22px rgba(4, 8, 24, 0.35);
  pointer-events: auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.shopfab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 240, 223, 0.3); }
.shopfab svg { flex-shrink: 0; }

/* ---------- Dots ---------- */
.dots {
  position: fixed; z-index: 40;
  right: 22px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px;
}
.dots__dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid rgba(255, 240, 223, 0.6);
  background: transparent;
  cursor: pointer;
  transition: all 0.35s ease;
  padding: 0;
}
.dots__dot.is-active { background: var(--beige); height: 26px; border-radius: 999px; }

/* ---------- Stage / world ---------- */
.stage { position: relative; height: 100vh; overflow: hidden; }

.world { position: absolute; inset: 0; background: var(--ocean); }
.map-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s linear;
  pointer-events: none;
}
.map-video.is-active { opacity: 1; }

/* ---------- FX ---------- */
.fx { position: absolute; inset: 0; pointer-events: none; }
.fx--vignette {
  background: radial-gradient(ellipse at center, transparent 55%, rgba(4, 8, 24, 0.55) 100%);
}
.fx--grain {
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Overlays ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 24px;
}
.overlay--hero { background: radial-gradient(ellipse at center, rgba(4, 8, 24, 0.25), rgba(4, 8, 24, 0.62)); }

.hero__logo { width: min(64vw, 520px); filter: drop-shadow(0 6px 30px rgba(0, 0, 0, 0.5)); }
.hero__title {
  font-weight: 700; letter-spacing: 0.3em; font-size: clamp(15px, 2.2vw, 24px);
  margin-top: 26px;
}
.hero__sub {
  font-weight: 300; letter-spacing: 0.12em; font-size: clamp(13px, 1.5vw, 17px);
  margin-top: 12px; opacity: 0.85;
}
.hero__actions {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  margin-top: 34px;
  pointer-events: auto;
}
.hero__btn {
  font-family: "paralucent", sans-serif;
  font-weight: 700; font-size: 13px; letter-spacing: 0.18em;
  border-radius: 999px;
  padding: 16px 32px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.hero__btn--start {
  color: var(--azul); background: var(--beige);
  border: none;
}
.hero__btn--start:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(255, 240, 223, 0.3); }
.hero__btn--shop {
  color: var(--beige); background: rgba(10, 16, 48, 0.35);
  border: 1.5px solid rgba(255, 240, 223, 0.6);
  backdrop-filter: blur(8px);
}
.hero__btn--shop:hover { transform: translateY(-2px); background: rgba(10, 16, 48, 0.6); }

.hero__scroll {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 11px; letter-spacing: 0.34em;
  opacity: 0.9;
}
.hero__scroll span {
  display: block; width: 1px; height: 42px;
  background: linear-gradient(var(--beige), transparent);
  animation: drop 1.6s ease-in-out infinite;
}
@keyframes drop { 0% { transform: scaleY(0); transform-origin: top; } 60% { transform: scaleY(1); } 100% { opacity: 0; } }

/* visibility:hidden (no solo opacity:0) para que sus CTA reales no intercepten clics del hero
   mientras está "apagado" — mismo motivo por el que heroOverlay hace lo simétrico al revés */
.overlay--end { background: radial-gradient(ellipse at center, rgba(45, 64, 143, 0.45), rgba(4, 8, 24, 0.82)); opacity: 0; visibility: hidden; }
.end__logo { width: min(58vw, 460px); }
.end__next { font-weight: 700; letter-spacing: 0.34em; font-size: clamp(12px, 1.6vw, 16px); margin-top: 28px; }
.end__cta {
  pointer-events: auto;
  margin-top: 26px;
  font-weight: 700; font-size: 13px; letter-spacing: 0.18em;
  color: var(--azul); background: var(--beige);
  text-decoration: none;
  border-radius: 999px;
  padding: 15px 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.end__cta:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(255, 240, 223, 0.25); }
.end__cta--ghost {
  color: var(--beige); background: transparent;
  border: 1.5px solid rgba(255, 240, 223, 0.5);
  margin-top: 14px;
}
.end__credit { position: absolute; bottom: 26px; font-size: 11px; letter-spacing: 0.3em; opacity: 0.6; }

/* Votación CC/05: vote-config.js pone html.is-vote-closed al llegar la hora de cierre y estos
   pares de textos (abierta/cerrada) se intercambian solos, sin volver a desplegar */
.vote-closed { display: none; }
html.is-vote-closed .vote-open { display: none; }
html.is-vote-closed .vote-closed { display: inline; }

/* ---------- Cards (nube orgánica) ---------- */
.card {
  position: absolute; z-index: 25;
  left: 48px; bottom: 48px;
  width: min(580px, calc(100vw - 72px));
  color: var(--ink);
  opacity: 0; visibility: hidden;
  pointer-events: none;
}
.card__inner {
  position: relative;
  padding: 48px 52px 42px;
  pointer-events: none;
}
.card.is-active .card__inner { pointer-events: auto; }
/* Nube realista: pompones apilados (base ancha + cúmulos arriba), cada uno con su deriva */
.cloud {
  position: absolute;
  inset: -24px -34px -28px -36px;
  z-index: -1;
  filter: blur(10px);
  pointer-events: none;
}
.cloud span {
  position: absolute;
  background: radial-gradient(circle at 50% 42%, rgba(255, 240, 223, 0.99) 52%, rgba(255, 240, 223, 0.85) 64%, rgba(255, 240, 223, 0) 74%);
  border-radius: 50%;
  animation: puff 12s ease-in-out infinite alternate;
}
/* base ancha y aplanada: el pompón más sólido, sostiene el texto */
.cloud span:nth-child(1) { left: -2%; right: -2%; top: 32%; bottom: 2%; border-radius: 46%; animation-duration: 16s; opacity: 0.92; }
/* cúmulos superiores de tamaños y densidades distintos */
.cloud span:nth-child(2) { left: 4%; top: 12%; width: 32%; height: 55%; animation-duration: 11s; animation-delay: -3s; opacity: 0.68; filter: blur(2px); }
.cloud span:nth-child(3) { left: 27%; top: -8%; width: 42%; height: 66%; animation-duration: 14s; animation-delay: -7s; opacity: 1; }
.cloud span:nth-child(4) { left: 60%; top: 6%; width: 32%; height: 55%; animation-duration: 10s; animation-delay: -1.5s; opacity: 0.6; filter: blur(3px); }
/* laterales vaporosos que rompen la silueta sin tapar el mapa */
.cloud span:nth-child(5) { left: -9%; top: 40%; width: 26%; height: 42%; animation-duration: 13s; animation-delay: -5s; opacity: 0.4; filter: blur(5px); }
.cloud span:nth-child(6) { right: -8%; top: 34%; width: 27%; height: 44%; animation-duration: 15s; animation-delay: -9s; opacity: 0.35; filter: blur(6px); }
@keyframes puff {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(10px, -7px) scale(1.07); }
}
/* Cada parada tiene una nube distinta (espejos, giros y proporciones) */
#card2 .cloud { transform: scaleX(-1); inset: -22px -30px -24px -38px; }
#card3 .cloud { transform: rotate(2.5deg) scale(1.06); }
#card3 .cloud span:nth-child(3) { left: 40%; width: 36%; }
#card4 .cloud { transform: scaleX(-1) rotate(-2deg); }
#card4 .cloud span:nth-child(2) { width: 40%; top: 4%; }
#card5 .cloud { transform: rotate(-1.5deg) scale(1.04); }
.card__code { font-weight: 700; font-size: 12px; letter-spacing: 0.22em; color: var(--azul); }
.card__title {
  font-weight: 700; font-size: clamp(30px, 3.4vw, 42px); letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink);
  margin-top: 6px; line-height: 1.02;
}
.card__body { font-weight: 300; font-size: 16.5px; line-height: 1.6; margin-top: 16px; }
.card__cta {
  pointer-events: auto;
  display: inline-block;
  margin-top: 16px;
  font-weight: 700; font-size: 12px; letter-spacing: 0.18em;
  color: var(--beige); background: var(--azul);
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 22px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card__cta:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(45, 64, 143, 0.45); }

/* Tarjeta misteriosa CC/05 */
.card--dark { color: var(--beige); }
.card--dark .cloud span {
  background: radial-gradient(circle at 50% 42%, rgba(9, 13, 30, 0.97) 52%, rgba(9, 13, 30, 0.85) 64%, rgba(9, 13, 30, 0) 74%);
}
.card--dark .card__code { color: #8fd3ff; }
.card__mystery {
  font-weight: 700;
  font-size: clamp(34px, 3.6vw, 46px);
  line-height: 1.02;
  letter-spacing: 0.04em;
  margin-top: 10px;
  color: var(--beige);
  text-shadow: 0 0 18px rgba(90, 180, 255, 0.55);
}
.card--dark .card__cta--vote {
  color: #06122c; background: #8fd3ff;
  box-shadow: 0 0 24px rgba(90, 180, 255, 0.45);
}
.card--dark .card__cta--vote:hover { box-shadow: 0 0 40px rgba(90, 180, 255, 0.7); }
.card__art {
  margin-top: 16px;
  border: 1.5px dashed rgba(45, 64, 143, 0.5);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  font-weight: 700; font-size: 10px; letter-spacing: 0.24em;
  color: rgba(45, 64, 143, 0.65);
}
.card__title-art {
  margin-top: 16px;
  display: flex; align-items: center; justify-content: flex-start;
}
.card__title-art img { max-height: 190px; max-width: 100%; object-fit: contain; }
.card__title-art--shadow img {
  max-height: 106px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 16px rgba(0, 0, 0, 0.4));
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hud { padding: 16px 18px; }
  .hud__logo { width: 72px; }
  .hud__stop-name { display: none; }
  .hud__right { gap: 8px; }
  .shopfab { padding: 8px; }
  .shopfab span { display: none; }
  .dots { right: 12px; }
  .card {
    left: 18px; right: 18px; bottom: 16px;
    width: auto;
  }
  .card__inner { padding: 30px 26px 26px; }
  .card__title-art img { max-height: 120px; }
  .card__body { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll span { animation: none; }
}
