/* ===========================================================
   VILLAVICENCIO — Scene styles
   =========================================================== */

/* ---------- fixed chrome ---------- */
#progress {
  position: fixed;
  top: 0; right: 0;
  width: 2px; height: 100vh;
  z-index: 90;
  background: rgba(243, 239, 231, 0.08);
}
#progress-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transform-origin: top;
  transform: scaleY(0);
  background: linear-gradient(180deg, var(--water-blue), var(--jarilla));
}

#guide {
  position: fixed;
  top: 0; right: 14px;
  z-index: 91;
  pointer-events: none;
}
#guide-drop {
  position: absolute;
  top: 0; right: 0;
  width: 16px; height: 22px;
  opacity: 0;
  transition: opacity 0.6s ease;
  filter: drop-shadow(0 0 8px rgba(143, 184, 193, 0.7));
}
#guide-drop svg { width: 100%; height: 100%; display: block; }

/* scroll cue */
.scroll-cue {
  position: absolute;
  bottom: clamp(1.6rem, 4vh, 3rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  z-index: 12;
}
.scroll-cue .fine { opacity: 0.5; }
.scroll-cue .rail {
  width: 1px; height: 54px;
  background: linear-gradient(180deg, rgba(243,239,231,0.5), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-cue .rail::after {
  content: "";
  position: absolute; top: -50%; left: 0;
  width: 100%; height: 50%;
  background: var(--water-blue);
  animation: railRun 2.4s var(--ease-soft) infinite;
}
@keyframes railRun { to { top: 110%; } }

/* generic key-message band */
.key-msg {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.6rem, 3.6vw, 3.1rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  max-width: 22ch;
  text-wrap: balance;
}
.key-msg em { font-style: italic; }

.datum {
  font-family: var(--display);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   SCENE 1 — HERO / MINERAL ORIGIN
   ============================================================ */
.s-hero {
  --hero-scroll: 85vh;
  --hero-scale: 1.58;
  --hero-shift: -3%;
  --hero-fade: 1;
  position: relative;
  width: 100%;
  max-width: 100%;
  height: calc(100vh + var(--hero-scroll));
  height: calc(100svh + var(--hero-scroll));
  min-height: unset;
  overflow: visible;
  background: #0c100e;
}
.hero-pin {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #0c100e;
}
.hero-bg-img {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  max-width: none;
  object-fit: cover;
  object-position: center 42%;
  transform: translate(-50%, calc(-50% + var(--hero-shift))) scale(var(--hero-scale));
  transform-origin: center center;
  will-change: transform;
}
.hero-bg-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 16, 14, 0.35) 0%, rgba(12, 16, 14, 0.12) 38%, rgba(12, 16, 14, 0.55) 100%),
    radial-gradient(120% 90% at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}
.s-hero .origin-content {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: min(36rem, 100%);
  text-align: center;
  opacity: var(--hero-fade);
  transform: translateY(calc((1 - var(--hero-fade)) * -28px));
  will-change: opacity, transform;
  box-sizing: border-box;
}
.s-hero .scroll-cue {
  z-index: 6;
  opacity: var(--hero-fade);
}
.s-origin .origin-content .display { color: var(--limestone); }
.s-origin .origin-content .lede { margin: 1.6rem auto 0; }
.s-origin .origin-content .lede.is-visible { opacity: 0.82; }

/* forming + falling drop */
.drop-stage {
  position: relative;
  height: 120px;
  margin: 0 auto 2.2rem;
  width: 40px;
}
.drop-form {
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
}
.drop-form svg { display: block; filter: drop-shadow(0 0 14px rgba(143,184,193,0.6)); }
.drop-glyph {
  animation: dropPulse 4.5s var(--ease-soft) infinite;
  transform-origin: center top;
}
@keyframes dropPulse {
  0%, 100% { transform: scaleY(0.96) scaleX(1.02); opacity: 0.85; }
  45% { transform: scaleY(1.04) scaleX(0.98); opacity: 1; }
}
.drop-ripple {
  position: absolute;
  bottom: 2px; left: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 0 rgba(143,184,193,0.5);
  animation: ripple 4.5s ease-out infinite;
}
@keyframes ripple {
  0%, 60% { box-shadow: 0 0 0 0 rgba(143,184,193,0.0); opacity: 0; }
  70% { opacity: 0.9; }
  100% { box-shadow: 0 0 0 26px rgba(143,184,193,0); opacity: 0; width: 4px; }
}

/* ============================================================
   SCENE 2 — PROTECTED TERRITORY
   ============================================================ */
.s-territory {
  min-height: 130vh;
  background:
    linear-gradient(180deg, #0c100e 0%, #1d2723 16%, #2e3a34 40%, #3a4a40 100%);
  display: flex;
  align-items: center;
  padding: 14vh 0;
}
.s-territory .topo {
  position: absolute; inset: 0;
  opacity: 0.55;
}
.s-territory .topo svg { width: 100%; height: 100%; }

/* líneas topográficas — flujo continuo */
.topo-lines {
  animation: topoFloat 20s var(--ease-soft) infinite alternate;
}
@keyframes topoFloat {
  from { transform: translateY(-5px); }
  to   { transform: translateY(7px); }
}
.topo-line {
  fill: none;
  stroke-dasharray: 10 16;
  animation: topoFlow var(--topo-dur, 28s) linear infinite;
  animation-delay: var(--topo-delay, 0s);
}
@keyframes topoFlow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -160; }
}

.territory-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.territory-map {
  position: relative;
  --s: 0;
}
.territory-map svg { width: 100%; height: auto; display: block; overflow: visible; }

/* contornos del mapa — dibujo al scroll + fill progresivo */
.map-echo-path { fill: none; }
.map-outline {
  fill: rgba(143, 184, 193, calc(var(--s, 0) * 0.09));
  transition: fill 0.15s linear;
}

/* pulso del punto central */
.map-locus-ring {
  transform-box: fill-box;
  transform-origin: center;
}
.map-locus-ring--a {
  animation: mapRingPulse 3.4s var(--ease-soft) infinite;
}
.map-locus-ring--b {
  animation: mapRingPulse 3.4s var(--ease-soft) infinite;
  animation-delay: 1.7s;
}
.map-locus-dot {
  animation: mapDotGlow 3.4s var(--ease-soft) infinite;
}
@keyframes mapRingPulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { opacity: 0.15; }
  100% { transform: scale(1.75); opacity: 0; }
}
@keyframes mapDotGlow {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; filter: drop-shadow(0 0 6px rgba(143, 184, 193, 0.9)); }
}

/* labels aparecen tras el dibujo del contorno */
.map-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  fill: var(--stone-beige);
  text-transform: uppercase;
  opacity: clamp(0, calc((var(--s, 0) - 0.42) * 2.8), 1);
  transition: opacity 0.2s linear;
}
.map-label--coords {
  opacity: clamp(0, calc((var(--s, 0) - 0.48) * 2.8), 0.6);
}
.ha-stat .datum {
  font-size: clamp(3.4rem, 9vw, 8rem);
  color: var(--limestone);
  display: block;
}
.ha-stat .unit {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--water-blue);
  display: block;
  margin-top: 0.6rem;
}
.ha-stat .key-msg { margin-top: 2rem; color: var(--limestone); }

/* ============================================================
   SCENE 3 — WATER AS LIFE
   ============================================================ */
.s-water {
  min-height: 150vh;
  background: linear-gradient(180deg, #3a4a40 0%, #2e3a34 30%, #243430 70%, #1c2a2c 100%);
  display: flex;
  align-items: center;
  padding: 14vh 0;
}
.water-layers { position: absolute; inset: 0; }
.water-layers svg { width: 100%; height: 100%; }
.water-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.s-water .lede em { color: var(--water-blue); }
.ramsar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid rgba(143,184,193,0.35);
  border-radius: 2px;
}
.ramsar-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--water-blue);
  box-shadow: 0 0 10px var(--water-blue);
  animation: pulseDot 3s ease-in-out infinite;
}
@keyframes pulseDot { 50% { opacity: 0.4; } }
.ramsar-badge .fine { opacity: 0.85; }

/* ============================================================
   SCENE 4 — BIODIVERSITY
   ============================================================ */
.s-bio {
  min-height: 160vh;
  background: linear-gradient(180deg, #1c2a2c 0%, #243430 26%, #435b4d 70%, #4f6a59 100%);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.bio-silhouettes { position: absolute; inset: 0; }
.bio-silhouettes svg { width: 100%; height: 100%; }
.bio-content { text-align: center; }
.bio-stats {
  display: flex;
  justify-content: center;
  gap: clamp(2.5rem, 8vw, 7rem);
  margin: 3rem 0;
  flex-wrap: wrap;
}
.bio-stat .datum {
  font-size: clamp(3rem, 7vw, 6rem);
  color: var(--limestone);
}
.bio-stat .label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--stone-beige);
  margin-top: 0.5rem;
}
.bio-stat .sub { font-size: 0.62rem; opacity: 0.6; margin-top: 0.3rem; }

/* ============================================================
   SCENE 5 — EMBLEMATIC SPECIES
   ============================================================ */
.s-species {
  background: linear-gradient(180deg, #4f6a59 0%, #5b7464 8%, #cfc3ae 60%, #e6ddcc 100%);
  color: var(--shadow);
  padding: 16vh 0;
}
.s-species .eyebrow { color: var(--mineral-green); opacity: 0.8; }
.species-head {
  --species-ink: #f5f1e9;
  --species-muted: #d4c9b4;
  --species-accent: #6aabb8;
  max-width: min(58ch, 100%);
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.species-head .eyebrow {
  color: var(--species-muted);
  opacity: 0.95;
  letter-spacing: 0.36em;
}
.species-head .title {
  color: var(--species-ink);
  text-shadow: 0 1px 3px rgba(12, 16, 14, 0.28);
}
.species-head .key-msg {
  color: rgba(245, 241, 233, 0.94);
  margin-top: 1.4rem;
  max-width: none;
  text-shadow: 0 1px 2px rgba(12, 16, 14, 0.22);
}
.species-head .key-msg em {
  color: var(--species-accent);
  font-style: italic;
  text-shadow: 0 1px 2px rgba(12, 16, 14, 0.18);
}
.species-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(0.8rem, 1.6vw, 1.4rem);
}
.species-card { position: relative; }
.species-card image-slot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
}
.species-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background:
    repeating-linear-gradient(135deg, rgba(46,58,52,0.05) 0 8px, rgba(46,58,52,0.09) 8px 16px);
  border: 1px solid rgba(46,58,52,0.16);
  overflow: hidden;
}
.species-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 0.9rem;
  border-top: 1px solid rgba(46,58,52,0.2);
  padding-top: 0.6rem;
}
.species-meta .name {
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.6vw, 1.5rem);
  font-weight: 400;
}
.species-meta .idx { font-family: var(--mono); font-size: 0.66rem; opacity: 0.55; }
.species-meta .latin { font-family: var(--body); font-style: italic; font-size: 0.78rem; opacity: 0.6; display: block; }

/* ============================================================
   SCENE 6 — GHOST OF THE ANDES
   ============================================================ */
.s-ghost {
  min-height: 150vh;
  background: radial-gradient(120% 100% at 50% 30%, #16201d 0%, #0a0e0c 70%, #060807 100%);
  background-color: #060807;
  display: flex;
  align-items: center;
  padding: 16vh 0;
}
.ghost-frame {
  position: relative;
  width: min(1000px, 92vw);
  margin: 0 auto;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(126,148,116,0.22);
  background: radial-gradient(120% 120% at 50% 60%, #11181500 30%, #060807 100%), #0a100d;
  overflow: hidden;
}
.ghost-frame .scanlines {
  position: absolute; inset: 0; z-index: 25;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.18) 2px 4px);
  opacity: 0.5; mix-blend-mode: multiply;
}
.cam-hud {
  position: absolute;
  z-index: 26;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: rgba(143,184,193,0.7);
  text-transform: uppercase;
}
.cam-hud.tl { top: 14px; left: 16px; }
.cam-hud.tr { top: 14px; right: 16px; }
.cam-hud.bl { bottom: 14px; left: 16px; }
.cam-hud.br { bottom: 14px; right: 16px; display: flex; align-items: center; gap: 0.5rem; }
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: #c25; box-shadow: 0 0 8px #c25; animation: pulseDot 1.6s infinite; }
.ghost-bottle {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  width: clamp(110px, 18vw, 210px);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 1.4s var(--ease-cine) 0.35s;
}
.ghost-bottle-img {
  display: block;
  width: 100%;
  height: auto;
  filter:
    drop-shadow(0 22px 36px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 28px rgba(143, 184, 193, 0.14));
}
.ghost-frame.is-visible .ghost-bottle {
  opacity: 1;
  animation: ghostBottleFloat 5.5s var(--ease-soft) 1.2s infinite;
}
@keyframes ghostBottleFloat {
  0%, 100% { transform: translate(-50%, calc(-50% - 8px)); }
  50% { transform: translate(-50%, calc(-50% + 8px)); }
}
.ghost-cat {
  position: absolute;
  left: 50%; top: 56%;
  width: 26%;
  transform: translate(-50%, -50%);
  opacity: 0;
  filter: blur(1px) brightness(0.8);
}
.ghost-frame.is-visible .ghost-cat { animation: ghostAppear 9s ease-in-out 1s infinite; }
@keyframes ghostAppear {
  0%, 18% { opacity: 0; }
  30%, 44% { opacity: 0.42; }
  60%, 100% { opacity: 0; }
}
.ghost-eyes {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; gap: 14px;
  opacity: 0;
}
.ghost-frame.is-visible .ghost-eyes { animation: eyesFlash 9s ease-in-out 1s infinite; }
@keyframes eyesFlash {
  0%, 46% { opacity: 0; }
  52%, 64% { opacity: 0.9; }
  72%, 100% { opacity: 0; }
}
.ghost-eyes i { width: 5px; height: 5px; border-radius: 50%; background: #cfe3d6; box-shadow: 0 0 10px #aef; }
.ghost-prints path { stroke: rgba(207,195,174,0.55); stroke-width: 1.4; fill: none; }
.ghost-text {
  position: absolute;
  left: clamp(1.5rem, 5vw, 4rem);
  bottom: clamp(1.5rem, 6vh, 4rem);
  z-index: 40;
  max-width: 32ch;
}
.s-ghost .key-msg { color: var(--stone-beige); }
.s-ghost .eyebrow { color: var(--jarilla); }

/* ============================================================
   SCENE 7 — CAMINO DE CARACOLES
   ============================================================ */
.s-road {
  --road-scroll: 80vh;
  position: relative;
  width: 100%;
  max-width: 100%;
  height: calc(100vh + var(--road-scroll));
  height: calc(100svh + var(--road-scroll));
  min-height: unset;
  overflow: visible;
  background: linear-gradient(180deg, #060807 0%, #1d2723 14%, #3a4a40 46%, #6b7e6a 78%, #9aa886 100%);
  padding: 0;
}
.road-stage {
  position: sticky;
  top: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  --s: 0;
}
.road-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.road-svg svg { width: 100%; height: 100%; }

/* trazo del camino / río — capas que se dibujan al scroll */
.road-path-bg {
  stroke: rgba(46, 58, 52, 0.45);
  stroke-width: 12;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.road-path--main {
  stroke: var(--limestone);
  stroke-width: 2.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 12px rgba(243, 239, 231, 0.15));
}
.road-path--river {
  stroke: var(--water-blue);
  stroke-width: 1.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: calc(0.25 + var(--s, 0) * 0.55);
}
.road-dash {
  stroke: rgba(46, 58, 52, 0.5);
  stroke-width: 1.2;
  fill: none;
  stroke-dasharray: 4 12;
  stroke-linecap: round;
}

.road-text {
  position: relative;
  z-index: 10;
  max-width: 34rem;
  margin-left: clamp(1.2rem, 7vw, 7rem);
  padding-left: 3.2rem;
}
.road-alt {
  position: absolute;
  left: 0;
  top: 5rem;
  bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
  opacity: calc(0.2 + var(--s, 0) * 0.45);
  border-left: 1px solid rgba(243, 239, 231, 0.12);
  padding-left: 0.65rem;
}
.road-eyebrow {
  color: var(--stone-beige);
  margin-bottom: 0.4rem;
}
.road-headline {
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1.2vh, 0.75rem);
  margin-top: 0.6rem;
}
.road-number {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(4.2rem, 13vw, 9.5rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--limestone);
}
.road-headline-text {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.1rem, 4.8vw, 4rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--limestone);
}
.road-lede {
  margin-top: clamp(2rem, 4vh, 2.8rem);
  color: var(--stone-beige);
  line-height: 1.74;
  max-width: 34ch;
}
.road-lede em { color: var(--water-blue); font-style: italic; }
.road-closer {
  margin-top: clamp(2.2rem, 4.5vh, 3rem);
  color: var(--limestone);
  max-width: 22ch;
  line-height: 1.32;
}
.s-road .key-msg em { font-style: italic; }

/* ============================================================
   SCENE 8 — HOTEL VILLAVICENCIO
   ============================================================ */
.s-hotel {
  min-height: 130vh;
  background: linear-gradient(180deg, #9aa886 0%, #cfc3ae 30%, #e8e0d0 100%);
  color: var(--shadow);
  display: flex;
  align-items: center;
  padding: 16vh 0;
  position: relative;
}
.s-hotel .paper {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.72 0 0 0 0 0.66 0 0 0 0 0.55 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
  opacity: 0.5;
  mix-blend-mode: multiply;
}
.s-hotel .fog {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(243,239,231,0.7), transparent 30%, transparent 70%, rgba(243,239,231,0.5));
  z-index: 6;
}
.hotel-grid {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hotel-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(46,58,52,0.25);
  box-shadow: 0 30px 80px rgba(46,58,52,0.2);
}
.hotel-photo image-slot { width: 100%; height: 100%; display: block; }
.hotel-photo .frame-label {
  position: absolute; bottom: 10px; left: 12px;
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.16em;
  color: var(--shadow); opacity: 0.6; z-index: 3; text-transform: uppercase;
}
.s-hotel .eyebrow { color: var(--mineral-green); }
.s-hotel .title { color: var(--shadow); }
.hotel-facts { display: flex; gap: 2.5rem; margin-top: 2.2rem; flex-wrap: wrap; }
.hotel-fact .datum { font-size: clamp(2.2rem, 4vw, 3.4rem); color: var(--mineral-green); }
.hotel-fact .label { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.7; margin-top: 0.5rem; max-width: 18ch; }
.s-hotel .key-msg { color: var(--mineral-green); margin-top: 2.4rem; }

/* ============================================================
   SCENE 9 — GALLERY (scroll-driven Swiper carousel)
   ============================================================ */
.s-gallery {
  --gallery-bg: #b0a18a;
  --gallery-card-w: clamp(220px, 22vw, 320px);
  --gallery-card-h: clamp(300px, 30vw, 420px);
  --gallery-scroll: 1600px;
  position: relative;
  width: 100%;
  max-width: 100%;
  height: calc(100vh + var(--gallery-scroll));
  height: calc(100svh + var(--gallery-scroll));
  background: var(--gallery-bg);
  color: var(--shadow);
  overflow: visible; /* sticky + scatter requieren visible (override .scene) */
}
.gallery-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.gallery-glitch {
  width: 100%;
  height: 100%;
  opacity: 0.7;
}
.gallery-pin {
  position: sticky;
  top: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
  z-index: 2;
  padding-bottom: clamp(4rem, 12vh, 8rem);
  box-sizing: border-box;
}
.gallery-head {
  position: absolute;
  top: clamp(4rem, 10vh, 7rem);
  left: clamp(1.2rem, 5vw, 4rem);
  z-index: 5;
  pointer-events: none;
}
.s-gallery .eyebrow { color: var(--mineral-green); opacity: 0.85; }
.s-gallery .title { color: var(--shadow); font-size: clamp(2rem, 4.5vw, 3.6rem); margin-top: 0.6rem; }
.gallery-hint { margin-top: 0.8rem; color: var(--shadow); opacity: 0.5; }

.gallery-swiper {
  width: 100%;
  padding: clamp(5rem, 12vh, 8rem) 0 clamp(2rem, 6vh, 4rem);
  overflow: visible !important;
}
.gallery-swiper.swiper {
  overflow: visible !important;
}
.gallery-swiper .swiper-wrapper {
  align-items: flex-start;
  padding-left: clamp(2rem, 12vw, 10rem);
  padding-right: clamp(2rem, 22vw, 18rem);
}
.gallery-swiper .swiper-slide {
  width: var(--gallery-card-w);
  height: var(--gallery-card-h);
  flex-shrink: 0;
  overflow: visible;
}

.gallery-slide-inner {
  width: 100%;
  height: 100%;
  transform-origin: center center;
  will-change: transform;
}

.gallery-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 24px 60px rgba(46, 58, 52, 0.22);
  transition: box-shadow 0.45s var(--ease-cine);
  overflow: hidden;
}
.gallery-card:hover { box-shadow: 0 32px 80px rgba(46, 58, 52, 0.32); }

.gallery-card_bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: rgba(46, 58, 52, 0.15);
}
.gallery-card_mask {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.gallery-card_mask img,
.gallery-card_mask video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  transform: scale(1);
  transition: transform 0.65s var(--ease-cine);
}
.gallery-card:hover .gallery-card_mask img,
.gallery-card:hover .gallery-card_mask video {
  transform: scale(1.1);
}
.gallery-card_shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(22, 29, 26, 0.62) 100%);
  pointer-events: none;
}
.gallery-card_front {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.gallery-label {
  position: absolute;
  left: 14px;
  bottom: 14px;
  font-family: var(--mono);
  font-size: clamp(0.58rem, 0.7vw, 0.68rem);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--limestone);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  z-index: 2;
  pointer-events: none;
}
.gallery-plus {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(243, 239, 231, 0.85);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.1rem;
  line-height: 1;
  color: var(--limestone);
  z-index: 2;
  pointer-events: none;
  transition:
    background 0.35s var(--ease-cine),
    color 0.35s var(--ease-cine),
    border-color 0.35s var(--ease-cine),
    transform 0.35s var(--ease-cine);
}
.gallery-card:hover .gallery-plus {
  background: var(--limestone);
  color: var(--shadow);
  border-color: var(--limestone);
  transform: scale(1.08);
}

/* Fancybox theme tweaks */
.fancybox__container { --fancybox-bg: rgba(22, 29, 26, 0.94); }

/* ============================================================
   SCENE 10 — CLOSING
   ============================================================ */
.s-close {
  min-height: 140vh;
  background: linear-gradient(180deg, #e8e0d0 0%, #cfc3ae 12%, #7e9474 40%, #435b4d 66%, #2e3a34 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 18vh 0;
  position: relative;
}
.close-ridges { position: absolute; inset: 0; }
.close-ridges svg { width: 100%; height: 100%; }
.close-content { position: relative; z-index: 10; }
.close-content .eyebrow { color: var(--stone-beige); }
.close-content .display { color: var(--limestone); margin: 1.6rem 0; }
.close-content .lede { margin: 0 auto; color: rgba(243,239,231,0.85); }
.thread-row {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.6rem);
  margin: 3rem 0 1rem;
  flex-wrap: wrap;
}
.thread {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--stone-beige);
  opacity: 0.75;
  display: flex; align-items: center; gap: 0.7rem;
}
.thread::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--water-blue); }
.close-footer {
  position: relative;
  z-index: 10;
  margin-top: clamp(4rem, 10vh, 8rem);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(243,239,231,0.5);
  display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1100px) {
  .territory-grid,
  .water-grid,
  .hotel-grid {
    grid-template-columns: 1fr;
    gap: clamp(2rem, 4vw, 3rem);
  }
  .territory-map {
    max-width: min(100%, 26rem);
    margin: 0 auto;
  }
  .ha-stat {
    text-align: center;
  }
  .ha-stat .key-msg {
    margin-left: auto;
    margin-right: auto;
  }
  .water-grid .key-msg {
    max-width: none;
  }
}

@media (max-width: 900px) {
  .species-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.85rem, 2.4vw, 1.3rem);
  }
  .bio-stats {
    gap: clamp(2rem, 5vw, 3.5rem);
  }
  .road-stage {
    align-items: flex-end;
    padding-bottom: clamp(6vh, 10vh, 9vh);
  }
  .road-text {
    margin-left: clamp(1rem, 4vw, 2.5rem);
    padding-right: 1rem;
  }
  .s-road { --road-scroll: 65vh; }
  .s-hero { --hero-scroll: 72vh; }
  .s-hero .origin-content {
    width: 100%;
    max-width: 100%;
    padding-inline: clamp(1rem, 4vw, 2rem);
  }
  .ghost-text {
    padding: 0 clamp(1rem, 4vw, 2rem);
  }
  .gallery-swiper .swiper-wrapper {
    padding-left: clamp(1.2rem, 6vw, 4rem);
    padding-right: clamp(2rem, 12vw, 8rem);
  }
}

/* Mobile */
@media (max-width: 640px) {
  #guide { right: 8px; }
  #guide-drop { width: 14px; height: 18px; }

  /* Hero */
  .hero-pin {
    align-items: flex-end;
    padding-bottom: max(clamp(10vh, 14vh, 16vh), env(safe-area-inset-bottom, 0px));
  }
  .s-hero .origin-content {
    width: 100%;
    max-width: 100%;
    padding: 0 clamp(1.1rem, 5vw, 1.75rem);
    text-align: center;
  }
  .s-hero .origin-content .display {
    font-size: clamp(1.95rem, 9.2vw, 3rem);
    line-height: 1.04;
  }
  .s-hero .origin-content .lede {
    margin-top: 1.25rem;
    padding: 0 0.15rem;
    font-size: clamp(0.98rem, 3.9vw, 1.12rem);
  }
  .drop-stage {
    height: 88px;
    margin-bottom: 1.4rem;
  }
  .s-hero { --hero-scroll: 58vh; }
  .hero-bg-img { object-position: center 36%; }

  /* Escenas — respiro vertical */
  .s-territory,
  .s-water,
  .s-species,
  .s-ghost,
  .s-hotel {
    padding-top: 11vh;
    padding-bottom: 11vh;
  }
  .s-bio {
    min-height: auto;
    padding: 12vh 0;
  }
  .s-water { min-height: auto; }
  .s-territory { min-height: auto; padding: 12vh 0; }

  /* Biodiversidad */
  .bio-stats {
    flex-direction: column;
    align-items: center;
    gap: 2.4rem;
    margin: 2rem 0;
  }
  .bio-stat .datum {
    font-size: clamp(2.5rem, 14vw, 3.8rem);
  }
  .bio-stat .label {
    letter-spacing: 0.18em;
    font-size: 0.64rem;
  }
  .bio-stat .sub {
    max-width: 24ch;
    margin-left: auto;
    margin-right: auto;
  }
  .bio-content .title {
    font-size: clamp(1.75rem, 7vw, 2.4rem);
  }

  /* Territorio */
  .ha-stat .datum {
    font-size: clamp(2.6rem, 15vw, 4.2rem);
  }
  .ha-stat .unit {
    letter-spacing: 0.16em;
    font-size: 0.66rem;
  }

  /* Especies */
  .species-head {
    max-width: none;
    text-align: center;
    margin-inline: auto;
    padding-inline: 0.25rem;
  }
  .species-head .key-msg {
    margin-inline: auto;
  }
  .species-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
    margin: 0;
    gap: clamp(0.65rem, 3vw, 1rem);
  }
  .species-meta .name {
    font-size: clamp(0.9rem, 3.6vw, 1.05rem);
  }
  .species-meta .latin {
    font-size: 0.66rem;
  }

  /* Gato andino */
  .s-ghost {
    min-height: auto;
    padding: 10vh 0;
  }
  .s-ghost .scene-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  .ghost-frame {
    aspect-ratio: 4 / 3;
    width: min(1000px, 94vw);
  }
  .ghost-bottle {
    width: clamp(92px, 32vw, 148px);
  }
  .ghost-text {
    text-align: center;
    margin-top: 2rem;
    max-width: 34ch;
    margin-inline: auto;
  }
  .cam-hud { font-size: 0.5rem; letter-spacing: 0.12em; }

  /* Caracoles */
  .road-text {
    margin-left: 1rem;
    margin-right: 1rem;
    padding-left: 0;
    max-width: none;
  }
  .road-alt { display: none; }
  .road-number {
    font-size: clamp(2.8rem, 20vw, 4.2rem);
  }
  .road-headline-text {
    font-size: clamp(1.5rem, 7.2vw, 2rem);
    line-height: 1.16;
  }
  .road-lede,
  .road-closer {
    max-width: none;
  }
  .s-road { --road-scroll: 52vh; }

  /* Hotel */
  .hotel-facts {
    flex-direction: column;
    gap: 1.4rem;
  }
  .hotel-fact .label {
    max-width: none;
  }
  .s-hotel {
    min-height: auto;
    padding: 11vh 0;
  }

  /* Galería */
  .gallery-pin {
    justify-content: flex-start;
    padding-bottom: 1.5rem;
    min-height: 100svh;
    height: 100svh;
  }
  .gallery-head {
    position: relative;
    top: auto;
    left: auto;
    padding: clamp(4.5rem, 12vh, 5.5rem) 1rem 0;
  }
  .gallery-swiper {
    padding-top: 1.2rem;
    padding-bottom: 1.5rem;
  }
  .gallery-swiper .swiper-wrapper {
    padding-left: 1rem;
    padding-right: 2.5rem;
  }
  .s-gallery {
    --gallery-card-w: min(76vw, 270px);
    --gallery-card-h: min(98vw, 320px);
  }

  /* Cierre */
  .s-close {
    min-height: auto;
    padding: 12vh 1rem;
  }
  .close-content .display {
    font-size: clamp(2rem, 9vw, 3rem);
  }
  .thread-row {
    gap: 0.75rem 1rem;
    justify-content: center;
  }
  .thread {
    font-size: 0.56rem;
    letter-spacing: 0.14em;
  }
  .close-footer {
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    text-align: center;
    padding: 0 1rem;
  }
}

/* Mobile pequeño */
@media (max-width: 380px) {
  .species-grid { gap: 0.55rem; }
  .species-meta .name { font-size: 0.86rem; }
  .species-meta .latin { font-size: 0.62rem; }
  .road-number { font-size: clamp(2.4rem, 22vw, 3.2rem); }
  .gallery-head .title { font-size: clamp(1.65rem, 8vw, 2rem); }
}
