/* ==========================================================================
   VIMI — TINGO MARÍA · MUNDO INMERSIVO DE LA SELVA ALTA
   Joyful Sunlit Botanical Mist -> Vibrant Lush Canopy Emerald
   Native Lenis Smooth Scroll + Three.js 3D World — Zero Slop, 100% Responsive
   ========================================================================== */

:root {
  /* Selva Viva Palette — Born from Tingo María's Emerald Rivers, Sunlit Canopy & Golden Sunset */
  --selva-day-bg: #134e2e;
  --selva-corridor-bg: #114729;
  --selva-canopy-bg: #0b341e;
  --selva-deep-card: rgba(9, 39, 23, 0.88);
  --selva-elevated: rgba(16, 60, 36, 0.92);

  --ink-forest: #062414;
  --ink-forest-soft: rgba(6, 36, 20, 0.78);
  --ivory-leaf: #f7f2e4;
  --ivory-soft: rgba(247, 242, 228, 0.84);
  --ivory-muted: rgba(247, 242, 228, 0.58);

  --emerald-vivid: #2fb865;
  --emerald-joy: #7be36a;
  --sun-pollen: #f4c56b;

  --hairline-day: rgba(196, 242, 188, 0.22);
  --hairline-canopy: rgba(196, 242, 188, 0.20);

  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans: "Inter Variable", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 3vw, 44px);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  background-color: var(--selva-day-bg);
  color: var(--ivory-leaf);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body.detail-page-open {
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
}

/* ==========================================================================
   CURVED JUNGLE ROUTE HEADER + ANIMATED WALKING EXPLORER
   ========================================================================== */
.site-header {
  position: fixed;
  top: clamp(10px, 1.8vh, 18px);
  left: var(--gutter);
  right: var(--gutter);
  z-index: 120;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.brand-mark {
  justify-self: start;
  pointer-events: auto;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 15px;
  border-radius: 99px;
  text-decoration: none;
  background: rgba(10, 44, 27, 0.76);
  border: 1px solid var(--hairline-canopy);
  color: var(--ivory-leaf);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.35s ease, border-color 0.35s ease, opacity 0.38s ease, transform 0.38s var(--ease-out-expo);
}

.site-header[data-at-hero="true"] .brand-mark {
  opacity: 0;
  transform: translate3d(0, -6px, 0);
  pointer-events: none;
}

.brand-mark:hover {
  border-color: var(--emerald-joy);
}

.brand-mark__name {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.03em;
  line-height: 1;
}

.brand-mark__loc {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--emerald-joy);
  padding-left: 10px;
  border-left: 1px solid currentColor;
  opacity: 0.9;
}

/* Organic Winding River-Trail Navigation (No straight pill box!) */
.trail-nav {
  grid-column: 2;
  justify-self: center;
  position: relative;
  width: clamp(390px, 46vw, 580px);
  height: 56px;
  pointer-events: auto;
  background: radial-gradient(
    ellipse 54% 58% at 50% 48%,
    rgba(6, 30, 17, 0.56) 0%,
    rgba(6, 30, 17, 0.24) 64%,
    rgba(6, 30, 17, 0) 100%
  );
}

.trail-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 3px 9px rgba(3, 18, 10, 0.65));
}

.trail-node {
  fill: #0b351e;
  stroke: rgba(247, 242, 228, 0.55);
  stroke-width: 1.5;
  transition: fill 0.3s ease, stroke 0.3s ease, transform 0.3s ease;
}

.trail-node.is-reached {
  fill: var(--emerald-joy);
  stroke: var(--ivory-leaf);
}

.trail-walker {
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(4, 20, 11, 0.8));
}

.trail-stops {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.trail-stop {
  position: absolute;
  transform: translateX(-50%);
  pointer-events: auto;
  appearance: none;
  border: 0;
  background: none;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 242, 228, 0.62);
  text-shadow: 0 2px 10px rgba(3, 18, 10, 0.92);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s ease, transform 0.25s ease;
}

.trail-stop:hover {
  color: var(--ivory-leaf);
  transform: translateX(-50%) translateY(-1px);
}

.trail-stop.active {
  color: var(--emerald-joy);
  font-weight: 600;
}

.nav-label-short {
  display: none;
}

/* ==========================================================================
   CONTINUOUS 3D JUNGLE BACKDROP & SCROLL TRACK (SEAMLESS ACROSS ALL SECTIONS!)
   ========================================================================== */
.world-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100vh;
  height: 100svh;
  pointer-events: none;
  overflow: hidden;
  background-color: var(--selva-day-bg);
}

.world-track {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 432vh;
  pointer-events: none;
}

.world-stage {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 5;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  overflow: clip;
  background-color: transparent;
  color: var(--ivory-leaf);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  cursor: grab;
}

.world-stage[data-drag="on"] {
  cursor: grabbing;
}

.world-stage[data-hover="on"] {
  cursor: pointer;
}

/* Tactile botanical paper grain (subtle, organic, zero floating dots) */
.botanical-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .22 0 0 0 0 .14 0 0 0 .14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  transition: opacity 0.5s ease;
}

.world-stage[data-theme="canopy"] .botanical-grain {
  opacity: 0.14;
  mix-blend-mode: overlay;
}

/* WebGL 3D World Canvas */
.vimi-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* ==========================================================================
   3D PROJECTED CONSTELLATION TAGS & CENTRAL ANCHOR NODE
   ========================================================================== */
.world-tags {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.world-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(243, 251, 245, 0.82);
  will-change: transform, opacity;
  transition: opacity 0.3s ease;
}

.world-tag i {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  border: 1px solid var(--emerald-joy);
  background: rgba(14, 61, 38, 0.8);
}

.world-tag b {
  position: absolute;
  left: 8px;
  top: -5px;
  font-weight: 500;
  opacity: 0.78;
}

.world-tag em {
  position: absolute;
  left: 8px;
  top: 9px;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  padding: 4px 7px 3px;
  border-radius: 3px;
  background: var(--emerald-joy);
  color: #062515;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.world-tag.is-hovered i {
  background: var(--sun-pollen);
  border-color: var(--sun-pollen);
}

.world-tag.is-hovered em {
  opacity: 1;
  transform: translateY(0);
}

.world-origin-node {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  color: var(--ivory-leaf);
  will-change: transform, opacity;
}

.world-origin-node i {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--emerald-joy);
  box-shadow: 0 0 0 6px rgba(67, 220, 130, 0.22), 0 0 22px 4px rgba(67, 220, 130, 0.45);
}

.world-origin-node span {
  position: absolute;
  left: 12px;
  top: -6px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ivory-soft);
}

/* ==========================================================================
   SHARED EDITORIAL BADGE & PILL CONTROLS
   ========================================================================== */
.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--emerald-vivid);
  margin-bottom: 12px;
}

.eyebrow-badge::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: currentColor;
}

.world-stage[data-theme="canopy"] .eyebrow-badge {
  color: var(--emerald-joy);
}

.world-pill-btn {
  appearance: none;
  border: 1px solid var(--hairline-canopy);
  background: rgba(12, 50, 31, 0.72);
  color: var(--ivory-leaf);
  border-radius: 99px;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.2s ease;
}

.world-pill-btn:hover {
  border-color: var(--emerald-joy);
  transform: translateY(-1px);
}

.world-pill-btn--bright {
  background: var(--emerald-joy);
  color: #062515;
  border-color: var(--emerald-joy);
  font-weight: 600;
}

.world-pill-btn--bright:hover {
  background: #63e89a;
  border-color: #63e89a;
}

/* ==========================================================================
   MOVEMENT 01 HUD: UMBRAL SELVÁTICO FRENTE A LA BELLA DURMIENTE
   ========================================================================== */
.hud-act-1 {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate3d(-50%, -50%, 0);
  z-index: 6;
  width: min(560px, calc(100% - 40px));
  text-align: center;
  pointer-events: none;
  will-change: transform, opacity;
}

.hero-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sun-pollen);
  margin-bottom: 14px;
  text-shadow: 0 4px 18px rgba(4, 22, 12, 0.75);
}

.hero-crest__line {
  width: 24px;
  height: 1px;
  background: var(--sun-pollen);
  opacity: 0.75;
}

.hero-title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--ivory-leaf);
  text-shadow: 0 10px 36px rgba(4, 22, 12, 0.75);
}

.hero-brand-display {
  display: block;
  font-size: clamp(92px, 11.4vw, 164px);
  line-height: 0.82;
  letter-spacing: 0.055em;
  color: var(--ivory-leaf);
  text-shadow: 0 16px 46px rgba(3, 18, 10, 0.82), 0 2px 12px rgba(3, 18, 10, 0.55);
}

.hero-subtitle {
  display: block;
  font-size: clamp(34px, 4.1vw, 58px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  color: var(--ivory-leaf);
}

.hero-title em {
  font-style: italic;
  color: var(--emerald-joy);
}

.hero-lead {
  margin: 15px auto 0;
  max-width: 42ch;
  font-size: clamp(14.8px, 1.12vw, 17px);
  line-height: 1.54;
  color: var(--ivory-soft);
  text-shadow: 0 6px 24px rgba(4, 22, 12, 0.78);
}

.hud-act-1-hint {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 24px;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ivory-soft);
  text-shadow: 0 4px 16px rgba(4, 22, 12, 0.75);
  pointer-events: none;
  will-change: opacity, transform;
}

.hint-mobile {
  display: none;
}

/* ==========================================================================
   MOVEMENT 02 HUD: DYNAMIC EVOCATIVE PHRASES IN THE 3D JUNGLE CORRIDOR
   ========================================================================== */
.hud-act-2-title {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(42px, 7.2vh, 80px);
  z-index: 6;
  max-width: min(720px, 78vw);
  pointer-events: none;
  opacity: 0;
  color: var(--ivory-leaf);
  will-change: transform, opacity;
}

#sendero-eyebrow {
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(6, 30, 17, 0.78);
  border: 1px solid var(--hairline-canopy);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 12px;
}

.sendero-phrase-mask {
  overflow: hidden;
  padding: 2px 8px 12px 0;
}

.hud-act-2-title h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(46px, 6.0vw, 96px);
  line-height: 0.89;
  letter-spacing: -0.03em;
  text-shadow: 0 12px 38px rgba(3, 18, 10, 0.88), 0 3px 14px rgba(3, 18, 10, 0.75);
  transition: transform 0.36s var(--ease-out-expo), opacity 0.24s ease;
}

.hud-act-2-title.is-phrase-swapping h2 {
  transform: translate3d(0, 72%, 0);
  opacity: 0;
}

.hud-act-2-title em {
  font-style: italic;
  color: var(--emerald-joy);
}

/* ==========================================================================
   MOVEMENT 03 HUD: MONUMENTAL 3D CAROUSEL + WHITE EDITORIAL CARD (TITLE FIRST)
   ========================================================================== */
.hud-act-3 {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  perspective: 1300px;
}

.hud-act-3.is-hidden {
  visibility: hidden;
}

.hud-act-3.is-interactive .carousel-detail,
.hud-act-3.is-interactive .carousel-stage-ctrl {
  pointer-events: auto;
}

.carousel-sheet-scrim,
.cd-sheet-handle {
  display: none;
}

.cd-sheet-toggle {
  flex-shrink: 0;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid rgba(14, 68, 38, 0.22);
  background: rgba(18, 88, 49, 0.08);
  color: #0e4426;
  font-family: var(--font-mono);
  font-size: 9.2px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cd-sheet-toggle:hover {
  background: rgba(18, 88, 49, 0.16);
}

html[data-card-compact="none"] .cd-sheet-toggle,
html[data-card-compact="none"] .cd-sheet-handle,
html[data-card-compact="cozy"] .cd-sheet-toggle,
html[data-card-compact="cozy"] .cd-sheet-handle {
  display: none !important;
}

.cd-group-pill-row {
  margin-bottom: 6px;
}

.cd-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(18, 88, 49, 0.09);
  border: 1px solid rgba(18, 88, 49, 0.18);
  font-family: var(--font-mono);
  font-size: 8.8px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #135d33;
}

.hud-act-3[data-gallery-mode="mesa"] .cd-group-badge {
  background: rgba(212, 138, 34, 0.13);
  border-color: rgba(212, 138, 34, 0.28);
  color: #7c4d0b;
}

.cd-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

/* Minimal Floating Control Capsule Tucked Below the Giant 3D Protagonist */
.carousel-stage-ctrl {
  position: absolute;
  left: 33%;
  bottom: clamp(18px, 2.8vh, 28px);
  transform: translate3d(-50%, 0, 0);
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 99px;
  background: rgba(7, 34, 19, 0.82);
  border: 1px solid var(--hairline-canopy);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(3, 16, 9, 0.45);
  cursor: auto;
  will-change: transform, clip-path, left;
  transition: left 0.55s var(--ease-out-expo);
}

.hud-act-3[data-gallery-mode="mesa"] .carousel-stage-ctrl {
  left: 67%;
}

.stage-arrow-btn {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 99px;
  border: 1px solid var(--hairline-canopy);
  background: rgba(15, 60, 36, 0.78);
  color: var(--ivory-leaf);
  font-family: var(--font-mono);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.stage-arrow-btn:hover {
  background: var(--emerald-joy);
  color: #062414;
  border-color: var(--emerald-joy);
  transform: scale(1.05);
}

.stage-counter-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}

.stage-counter {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ivory-leaf);
  white-space: nowrap;
}

.carousel-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.carousel-dot {
  appearance: none;
  border: 0;
  padding: 0;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(247, 242, 228, 0.30);
  cursor: pointer;
  transition: width 0.28s var(--ease-out-expo), background 0.25s ease;
}

.carousel-dot:hover {
  background: rgba(247, 242, 228, 0.72);
}

.carousel-dot.is-active {
  width: 18px;
  background: var(--emerald-joy);
}

/* Crisp Warm-White Botanical Field Card (Adapted to Selva Palette, Title First!)
   In 03 · La Ruta: sits on RIGHT while 3D Carousel is on LEFT.
   In 04 · Mesa Local: mirrors to LEFT while 3D Carousel is on RIGHT! */
.carousel-detail {
  position: absolute;
  right: clamp(18px, 2.4vw, 36px);
  left: auto;
  top: calc(50% + 20px);
  transform: translate3d(0, -50%, 0);
  display: flex;
  flex-direction: column;
  width: min(484px, 36vw);
  height: var(--cd-fixed-height, auto);
  max-height: calc(100vh - 96px);
  overflow: hidden;
  padding: clamp(20px, 2.0vw, 26px);
  border-radius: 16px;
  background: #fbfaf5;
  border: 1px solid rgba(11, 46, 27, 0.11);
  box-shadow: 0 34px 84px rgba(3, 18, 10, 0.48), 0 2px 12px rgba(3, 18, 10, 0.14);
  color: #0b2e1b;
  cursor: auto;
  scrollbar-width: thin;
  transform-origin: 60% 0%;
  will-change: height, transform, clip-path;
  transition:
    height 0.44s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.44s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.36s ease;
}

.hud-act-3.is-sheet-expanded .carousel-detail {
  height: var(--cd-expanded-height, auto);
  overflow-y: auto;
}

.hud-act-3[data-gallery-mode="mesa"] .carousel-detail {
  right: auto;
  left: clamp(18px, 2.4vw, 36px);
  transform-origin: 40% 0%;
}

.carousel-detail__spine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #125831 0%, #52c865 55%, #e8b858 100%);
  transform-origin: 0 50%;
}

/* Clean Editorial Content Swap Inside Fixed-Height Card */
.cd-body-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.18s ease, transform 0.22s var(--ease-out-expo);
}

.carousel-detail.is-turning .cd-body-inner {
  opacity: 0;
  transform: translate3d(0, 5px, 0);
  transition: opacity 0.09s ease, transform 0.09s ease;
}

.cd-hero-head {
  margin: 0 0 11px;
}

.cd-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(35px, 3.3vw, 47px);
  line-height: 0.91;
  letter-spacing: -0.025em;
  color: #082615;
}

.cd-kicker {
  margin: 8px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9.8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #186b3b;
}

.cd-kicker::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: #289e57;
  flex-shrink: 0;
}

.cd-story {
  margin-top: 12px;
  flex: 0 0 auto;
}

.cd-story p {
  margin: 0;
  font-size: clamp(15.2px, 1.12vw, 16.4px);
  line-height: 1.56;
  color: #173423;
}

.cd-story__secondary {
  margin-top: 8px !important;
  color: #3d5b4a !important;
  font-size: clamp(14.3px, 1.04vw, 15.4px) !important;
  line-height: 1.52 !important;
  max-height: 220px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition:
    max-height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    margin-top 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Flat Editorial Field Notes — ZERO nested box, pure whitespace + subtle top hairline */
.cd-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 18px;
  margin: 16px 0 0;
  padding: 15px 0 0;
  border-top: 1px solid rgba(11, 46, 27, 0.09);
  max-height: 340px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition:
    max-height 0.44s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.30s ease,
    margin-top 0.40s cubic-bezier(0.22, 1, 0.36, 1),
    padding-top 0.40s cubic-bezier(0.22, 1, 0.36, 1),
    border-top-color 0.30s ease,
    transform 0.40s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   5-TIER ADAPTIVE CARD CAPACITY SYSTEM (data-card-compact):
   - "none": Full spacious desktop layout (all content visible, no "Ver detalles" button)
   - "cozy": Full adaptive layout for medium heights (e.g. 993x642, 1366x768, tall tablets) —
             scales padding/type so 100% of text & facts fit comfortably with NO "Ver detalles" button!
   - "story": Full primary + secondary story visible (zero "..." truncation); only 4-fact grid folds
   - "primary": Full primary paragraph visible (zero "..." truncation); secondary story + facts fold
   - "compact": 2-line preview for small/short mobile screens; secondary story + facts fold
   ========================================================================== */
html[data-card-compact="cozy"] .carousel-detail {
  width: min(492px, 41vw);
  padding: 16px 22px;
}

html[data-card-compact="cozy"] .cd-hero-head,
html[data-card-compact="story"] .hud-act-3.is-sheet-expanded .cd-hero-head,
html[data-card-compact="primary"] .hud-act-3.is-sheet-expanded .cd-hero-head,
html[data-card-compact="compact"] .hud-act-3.is-sheet-expanded .cd-hero-head {
  margin-bottom: 7px;
}

html[data-card-compact="cozy"] .cd-title,
html[data-card-compact="story"] .hud-act-3.is-sheet-expanded .cd-title,
html[data-card-compact="primary"] .hud-act-3.is-sheet-expanded .cd-title,
html[data-card-compact="compact"] .hud-act-3.is-sheet-expanded .cd-title {
  font-size: clamp(27px, 2.6vw, 35px);
}

html[data-card-compact="cozy"] .cd-story,
html[data-card-compact="story"] .hud-act-3.is-sheet-expanded .cd-story,
html[data-card-compact="primary"] .hud-act-3.is-sheet-expanded .cd-story,
html[data-card-compact="compact"] .hud-act-3.is-sheet-expanded .cd-story {
  margin-top: 8px;
}

html[data-card-compact="cozy"] .cd-story p,
html[data-card-compact="story"] .hud-act-3.is-sheet-expanded .cd-story p,
html[data-card-compact="primary"] .hud-act-3.is-sheet-expanded .cd-story p,
html[data-card-compact="compact"] .hud-act-3.is-sheet-expanded .cd-story p {
  font-size: 14px;
  line-height: 1.43;
}

html[data-card-compact="cozy"] .cd-story__secondary,
html[data-card-compact="story"] .hud-act-3.is-sheet-expanded .cd-story__secondary,
html[data-card-compact="primary"] .hud-act-3.is-sheet-expanded .cd-story__secondary,
html[data-card-compact="compact"] .hud-act-3.is-sheet-expanded .cd-story__secondary {
  margin-top: 5px !important;
  font-size: 13.2px !important;
  line-height: 1.39 !important;
}

html[data-card-compact="cozy"] .cd-facts,
html[data-card-compact="story"] .hud-act-3.is-sheet-expanded .cd-facts,
html[data-card-compact="primary"] .hud-act-3.is-sheet-expanded .cd-facts,
html[data-card-compact="compact"] .hud-act-3.is-sheet-expanded .cd-facts {
  gap: 7px 14px;
  margin-top: 10px;
  padding-top: 9px;
}

html[data-card-compact="cozy"] .cd-fact dd,
html[data-card-compact="story"] .hud-act-3.is-sheet-expanded .cd-fact dd,
html[data-card-compact="primary"] .hud-act-3.is-sheet-expanded .cd-fact dd,
html[data-card-compact="compact"] .hud-act-3.is-sheet-expanded .cd-fact dd {
  font-size: 12.1px;
  line-height: 1.35;
}

html[data-card-compact="cozy"] .cd-footer,
html[data-card-compact="story"] .hud-act-3.is-sheet-expanded .cd-footer,
html[data-card-compact="primary"] .hud-act-3.is-sheet-expanded .cd-footer,
html[data-card-compact="compact"] .hud-act-3.is-sheet-expanded .cd-footer {
  margin-top: auto;
  padding-top: 9px;
}

/* Tier "story": Full primary & secondary story visible; only 4-fact grid folds until expanded */
html[data-card-compact="story"] .hud-act-3:not(.is-sheet-expanded) .cd-facts {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  border-top-color: transparent;
  pointer-events: none;
  transform: translateY(-8px);
}

/* Tier "primary": Full primary paragraph visible (no ellipsis); secondary story + facts fold */
html[data-card-compact="primary"] .hud-act-3:not(.is-sheet-expanded) .cd-story__secondary,
html[data-card-compact="primary"] .hud-act-3:not(.is-sheet-expanded) .cd-facts {
  max-height: 0;
  opacity: 0;
  margin-top: 0 !important;
  padding-top: 0;
  border-top-color: transparent;
  pointer-events: none;
  transform: translateY(-8px);
}

/* Tier "compact": 2-line clamped preview for short/narrow screens; secondary story + facts fold */
html[data-card-compact="compact"] .hud-act-3:not(.is-sheet-expanded) #cd-why,
html[data-card-compact="compact"] .hud-act-3:not(.is-sheet-expanded) #md-why {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

html[data-card-compact="compact"] .hud-act-3:not(.is-sheet-expanded) .cd-story__secondary,
html[data-card-compact="compact"] .hud-act-3:not(.is-sheet-expanded) .cd-facts {
  max-height: 0;
  opacity: 0;
  margin-top: 0 !important;
  padding-top: 0;
  border-top-color: transparent;
  pointer-events: none;
  transform: translateY(-8px);
}

.cd-fact {
  margin: 0;
}

.cd-fact dt {
  font-family: var(--font-mono);
  font-size: 8.8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1c723f;
  margin-bottom: 4px;
}

.cd-fact dd {
  margin: 0;
  font-size: clamp(12.8px, 0.94vw, 13.8px);
  line-height: 1.44;
  color: #102e1d;
}

/* Minimalist Baseline Footer — ZERO giant full-width buttons! */
.cd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid rgba(11, 46, 27, 0.09);
  flex-shrink: 0;
}

.cd-action-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #4c6858;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cd-inline-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 99px;
  background: #0e4426;
  color: #f7f2e4;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cd-inline-cta:hover {
  background: #18683c;
  transform: translateY(-1px);
}

/* ==========================================================================
   SECTION 04: MESA LOCAL (NORMAL VERTICAL SCROLL · INVERTED RIGHT-TO-LEFT)
   Transparent over the continuous 3D jungle world!
   ========================================================================== */
.mesa-section {
  position: relative;
  z-index: 5;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  background-color: transparent;
  overflow: visible;
}

.mesa-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: visible;
  user-select: none;
  background-color: transparent;
}

.mesa-pass-title {
  position: absolute;
  left: 50%;
  top: clamp(58px, 9.2vh, 92px);
  transform: translate3d(-50%, 0, 0);
  z-index: 8;
  width: min(760px, calc(100% - 32px));
  margin: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(38px, 5.2vw, 74px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: var(--ivory-leaf);
  text-shadow: 0 12px 36px rgba(3, 18, 10, 0.88), 0 2px 10px rgba(3, 18, 10, 0.72);
  pointer-events: none;
  will-change: transform, opacity;
}

.mesa-pass-title em {
  font-style: italic;
  color: var(--emerald-joy);
}

.mesa-stage[data-hover="on"] {
  cursor: pointer;
}

.mesa-stage[data-drag="on"] {
  cursor: grabbing;
}

/* ==========================================================================
   FINAL SECTION: CASTILLO VIMI & EL DIRECTORIO
   Desktop: Clean white cards over the live continuous 3D selva backdrop.
   Mobile / Tablet: Compact host card + single-surface expandable accordion directory.
   ========================================================================== */
.refuge-section {
  position: relative;
  z-index: 6;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(86px, 10vh, 114px) var(--gutter) clamp(52px, 6vh, 76px);
  background: linear-gradient(180deg, rgba(6, 32, 18, 0) 0%, rgba(4, 22, 12, 0.42) 100%);
  color: var(--ivory-leaf);
  overflow: hidden;
}

.botanical-grain--refuge {
  opacity: 0.14;
  mix-blend-mode: overlay;
}

.refuge-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
}

.eyebrow-badge--canopy {
  color: var(--emerald-joy);
  margin-bottom: 6px;
}

.refuge-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(18px, 2.4vw, 26px);
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(196, 242, 188, 0.16);
}

.refuge-main-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(38px, 4.3vw, 62px);
  line-height: 0.90;
  letter-spacing: -0.02em;
  color: var(--ivory-leaf);
}

.refuge-main-title em {
  font-style: italic;
  color: var(--emerald-joy);
}

.refuge-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.refuge-social-link,
.refuge-back-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 6px 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(247, 242, 228, 0.78);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid rgba(196, 242, 188, 0.28);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.refuge-social-link:hover,
.refuge-back-link:hover {
  color: var(--emerald-joy);
  border-color: var(--emerald-joy);
  transform: translateY(-1px);
}

/* Main Grid: Host Card Left + 6 Independent Directory Cards Right on Desktop */
.refuge-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.58fr);
  gap: clamp(18px, 2.2vw, 28px);
  align-items: stretch;
}

/* Primary White Card: Castillo Vimi Stay Info */
.vimi-host-card {
  position: relative;
  overflow: hidden;
  background: #fbfaf5;
  color: #0b2e1b;
  border-radius: 18px;
  padding: clamp(22px, 2.4vw, 30px);
  box-shadow:
    0 24px 60px rgba(3, 18, 10, 0.36),
    0 2px 10px rgba(3, 18, 10, 0.14);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.host-card-spine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #125831 0%, #52c865 55%, #e8b858 100%);
}

.host-card-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #186b3b;
  margin-bottom: 6px;
}

.host-card-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(34px, 3.2vw, 44px);
  line-height: 0.94;
  letter-spacing: -0.015em;
  color: #082615;
}

.host-card-lead {
  margin: 10px 0 0;
  font-size: 14.5px;
  line-height: 1.54;
  color: #274634;
}

/* Clean Typographic Dividers inside Host Card (Zero Nested Cards) */
.host-essentials {
  margin-top: 18px;
  border-top: 1px solid rgba(11, 46, 27, 0.11);
  border-bottom: 1px solid rgba(11, 46, 27, 0.11);
  display: flex;
  flex-direction: column;
}

.essential-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
}

.essential-row + .essential-row {
  border-top: 1px dashed rgba(11, 46, 27, 0.12);
}

.essential-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.essential-label {
  font-family: var(--font-mono);
  font-size: 8.8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #52705f;
}

.essential-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #082615;
}

.essential-action-link {
  appearance: none;
  border: 0;
  background: rgba(18, 88, 49, 0.09);
  color: #0e4426;
  padding: 6px 12px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.essential-action-link:hover,
.essential-action-link.is-copied {
  background: #125831;
  color: #f7f2e4;
}

.essential-note {
  font-size: 12px;
  color: #4c6a59;
  text-align: right;
}

.host-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 4px;
}

.host-contact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.host-phone {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 600;
  color: #082615;
}

.host-wa-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 99px;
  background: #0e4426;
  color: #f7f2e4;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.host-wa-cta:hover {
  background: #17663a;
  transform: translateY(-1px);
}

/* Right Side: 6 Independent White Contact Cards on Desktop */
.directorio-wrapper {
  display: flex;
  flex-direction: column;
}

.directorio-mobile-head {
  display: none;
}

.directorio-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.contact-card {
  background: #fbfaf5;
  color: #0b2e1b;
  border-radius: 15px;
  padding: 18px 18px 16px;
  box-shadow:
    0 16px 38px rgba(3, 18, 10, 0.26),
    0 1px 6px rgba(3, 18, 10, 0.10);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: transform 0.24s var(--ease-out-expo), box-shadow 0.24s ease;
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 22px 46px rgba(3, 18, 10, 0.34),
    0 2px 8px rgba(3, 18, 10, 0.14);
}

.contact-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.contact-card__title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-role {
  font-family: var(--font-mono);
  font-size: 8.6px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #186b3b;
}

.contact-name {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 25px;
  line-height: 0.98;
  color: #082615;
}

.contact-card__head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  color: #547060;
  white-space: nowrap;
}

.contact-toggle-icon {
  display: none;
}

.contact-card__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 12px;
}

.contact-card__expand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 12px;
}

.contact-desc {
  margin: 0;
  font-size: 13.4px;
  line-height: 1.48;
  color: #294836;
}

.contact-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(11, 46, 27, 0.10);
}

.contact-link {
  font-family: var(--font-mono);
  font-size: 9.6px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #466654;
  text-decoration: none;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-link.is-primary {
  color: #0f592f;
  border-bottom-color: rgba(15, 89, 47, 0.35);
}

.contact-link:hover {
  color: #082615;
  border-bottom-color: #082615;
}

/* ==========================================================================
   TABLET & MOBILE RESPONSIVENESS (100% Spatial Fidelity on Portrait Screens)
   ========================================================================== */
@media (max-width: 1120px) {
  .refuge-layout {
    grid-template-columns: 1fr;
  }

  .directorio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  /* When lateral space beside the Hero text is narrower than the 3D portals (<= 1080px),
     anchor the Hero text cleanly in the upper band so the 3D Valley opens below without collision */
  .hud-act-1 {
    top: clamp(66px, 9.2vh, 84px);
    left: 50%;
    right: auto;
    width: min(560px, calc(100% - 32px));
    transform: translate3d(-50%, 0, 0);
    text-align: center;
  }

  .hero-brand-display {
    font-size: clamp(66px, 11.5vw, 96px);
    line-height: 0.84;
  }

  .hero-subtitle {
    font-size: clamp(28px, 4.8vw, 40px);
    line-height: 0.94;
  }

  .hero-lead {
    margin-top: 10px;
    font-size: clamp(13.5px, 1.8vw, 15.2px);
    line-height: 1.46;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto 1fr;
  }

  .trail-nav {
    grid-column: 2;
    justify-self: end;
    width: min(490px, 100%);
  }

  /* Portrait / Tablet Progressive Disclosure Bottom Sheet for Movements 03 & 04:
     - Flex-stacked bottom column: .carousel-stage-ctrl sits directly ABOVE .carousel-detail
       with a guaranteed 10px gap — NEVER covered or overlapped on any mobile screen!
     - Expanded (.is-sheet-expanded): Scrim dims background & full editorial sheet opens cleanly */
  .hud-act-3 {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 58px var(--gutter) 12px;
  }

  .carousel-sheet-scrim {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 8;
    background: rgba(4, 20, 11, 0.54);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none !important;
    transition: opacity 0.36s ease;
  }

  .hud-act-3.is-interactive.is-sheet-expanded .carousel-sheet-scrim {
    opacity: 1;
    pointer-events: none !important;
  }

  .carousel-stage-ctrl,
  .hud-act-3[data-gallery-mode="mesa"] .carousel-stage-ctrl {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    transform: none !important;
    z-index: 10;
    flex-shrink: 0;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.25s ease;
  }

  .carousel-detail,
  html[data-card-compact="cozy"] .carousel-detail,
  .hud-act-3[data-gallery-mode="mesa"] .carousel-detail {
    position: relative;
    z-index: 9;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    height: var(--cd-fixed-height, auto);
    max-height: calc(100svh - 124px);
    overflow: hidden;
    padding: 13px 18px 16px;
    transition:
      height 0.44s cubic-bezier(0.22, 1, 0.36, 1),
      max-height 0.44s cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 0.34s ease;
  }

  .hud-act-3.is-sheet-expanded .carousel-detail,
  .hud-act-3.is-sheet-expanded[data-gallery-mode="mesa"] .carousel-detail {
    height: var(--cd-expanded-height, auto);
    overflow-y: auto;
  }

  .cd-sheet-handle {
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 99px;
    background: rgba(11, 46, 27, 0.18);
    margin: 0 auto 8px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .cd-sheet-toggle {
    display: inline-flex;
  }

  /* Collapsed Peek State on <= 980px:
     Kicker stays single-line, while story/facts visibility is controlled by the
     smart 5-tier capacity detector (data-card-compact="cozy" | "story" | "primary" | "compact")! */
  .hud-act-3:not(.is-sheet-expanded) .cd-kicker {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hud-act-3:not(.is-sheet-expanded) .cd-kicker::before {
    display: inline-block;
    vertical-align: middle;
    margin-right: 7px;
  }

  .hud-act-3.is-sheet-expanded .cd-story__secondary {
    max-height: 240px;
    opacity: 1;
    transform: translateY(0);
  }

  .hud-act-3.is-sheet-expanded .cd-facts {
    max-height: 380px;
    opacity: 1;
    transform: translateY(0);
  }

  /* ========================================================================
     MOBILE / PORTRAIT SOLUTION FOR EL DIRECTORIO (<= 980px):
     Instead of stacking 6 repetitive cards vertically, transform El Directorio
     into a sleek, single-surface Interactive Accordion Directory where tapping
     any row expands its details & quick actions in place.
     ======================================================================== */
  .directorio-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 8px;
    font-family: var(--font-mono);
    font-size: 9.2px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--emerald-joy);
  }

  .directorio-mobile-head span:last-child {
    color: rgba(247, 242, 228, 0.60);
    font-weight: 400;
  }

  .directorio-grid {
    grid-template-columns: 1fr;
    gap: 0;
    background: #fbfaf5;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 48px rgba(3, 18, 10, 0.34);
  }

  .contact-card {
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
    border-bottom: 1px solid rgba(11, 46, 27, 0.10);
    gap: 0;
  }

  .contact-card:last-child {
    border-bottom: 0;
  }

  .contact-card:hover {
    transform: none;
    box-shadow: none;
  }

  .contact-card.is-mobile-open {
    background: rgba(18, 88, 49, 0.045);
  }

  .contact-card__head {
    padding: 13px 16px;
    align-items: center;
    cursor: pointer;
    user-select: none;
  }

  .contact-card__title-group {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 4px 10px;
    min-width: 0;
  }

  /* When any card's subtitle would wrap on the current width, ALL cards stack subtitle below name for 100% coherence */
  .directorio-grid.is-uniform-stacked .contact-card__title-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .directorio-grid.is-uniform-stacked .contact-name,
  .directorio-grid.is-uniform-stacked .contact-role {
    white-space: normal;
  }

  .contact-name {
    font-size: 21px;
    order: 1;
    white-space: nowrap;
  }

  .contact-role {
    order: 2;
    font-size: 8.2px;
    white-space: nowrap;
  }

  .contact-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(18, 88, 49, 0.09);
    color: #0e4426;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, color 0.2s ease;
  }

  .contact-toggle-icon::before {
    content: "+";
  }

  .contact-card.is-mobile-open .contact-toggle-icon {
    background: #125831;
    color: #f7f2e4;
    transform: rotate(180deg);
  }

  .contact-card.is-mobile-open .contact-toggle-icon::before {
    content: "−";
  }

  .contact-card__body {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    padding: 0 16px;
    transition:
      grid-template-rows 0.36s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.26s ease,
      padding-bottom 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .contact-card__expand {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    transform: translateY(-6px);
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .contact-card.is-mobile-open .contact-card__body {
    grid-template-rows: 1fr;
    opacity: 1;
    padding: 0 16px 14px;
  }

  .contact-card.is-mobile-open .contact-card__expand {
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .site-header {
    top: 8px;
    left: 12px;
    right: 12px;
    gap: 8px;
  }

  .brand-mark {
    padding: 7px 12px;
  }

  .brand-mark__name {
    font-size: 19px;
  }

  .brand-mark__loc,
  .nav-label-full {
    display: none;
  }

  .nav-label-short {
    display: inline;
  }

  .trail-nav {
    width: 100%;
    min-width: 0;
    height: 46px;
    max-width: 300px;
  }

  .trail-stop {
    font-size: 8px;
    letter-spacing: 0.05em;
    padding: 2px 2px;
  }

  /* Hero copy framed cleanly at the top while 3D Valley opens below */
  .hud-act-1 {
    top: 66px;
    left: 50%;
    right: auto;
    width: calc(100% - 32px);
    max-width: 520px;
    transform: translate3d(-50%, 0, 0);
    text-align: center;
  }

  .hero-crest {
    font-size: 9px;
    letter-spacing: 0.13em;
    gap: 8px;
    margin-bottom: 7px;
  }

  .hero-crest__line {
    width: 14px;
  }

  .eyebrow-badge {
    font-size: 9px;
    letter-spacing: 0.13em;
    margin-bottom: 7px;
  }

  .eyebrow-badge::before {
    width: 15px;
  }

  .hero-title {
    gap: 3px;
  }

  .hero-brand-display {
    font-size: clamp(64px, 17.5vw, 84px);
    line-height: 0.84;
    letter-spacing: 0.05em;
  }

  .hero-subtitle {
    font-size: clamp(27px, 7.6vw, 35px);
    line-height: 0.94;
  }

  .hero-lead {
    margin-top: 9px;
    font-size: 13.5px;
    line-height: 1.44;
  }

  .hud-act-1-hint {
    bottom: 14px;
    left: 14px;
    right: 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 9px;
  }

  /* Dynamic Sendero Phrases on portrait screens */
  .hud-act-2-title {
    left: 16px;
    right: 16px;
    bottom: 26px;
    max-width: none;
  }

  .hud-act-2-title h2 {
    font-size: clamp(40px, 11vw, 52px);
  }

  /* Monumental 3D Carousel + Compact Control + Progressive Disclosure Bottom Sheet on mobile */
  .hud-act-3 {
    padding: 52px 12px 10px;
    gap: 8px;
  }

  .carousel-stage-ctrl,
  .hud-act-3[data-gallery-mode="mesa"] .carousel-stage-ctrl {
    padding: 4px 6px;
    gap: 9px;
  }

  .stage-arrow-btn {
    width: 29px;
    height: 29px;
    font-size: 11.5px;
  }

  .carousel-dots {
    gap: 4px;
  }

  .carousel-dot {
    width: 5px;
    height: 5px;
  }

  .carousel-dot.is-active {
    width: 14px;
  }

  .carousel-detail,
  .hud-act-3[data-gallery-mode="mesa"] .carousel-detail {
    padding: 11px 15px 13px;
    border-radius: 15px;
  }

  .cd-group-pill-row {
    margin-bottom: 4px;
  }

  .cd-group-badge {
    font-size: 7.8px;
    padding: 2.5px 8px;
  }

  .cd-hero-head {
    margin-bottom: 6px;
  }

  .cd-title {
    font-size: clamp(26px, 7.4vw, 33px);
  }

  .cd-kicker {
    margin-top: 4px;
    font-size: 8.6px;
  }

  .cd-story {
    margin-top: 7px;
  }

  .cd-story p {
    font-size: 13.6px;
    line-height: 1.45;
  }

  .cd-facts {
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    margin-top: 12px;
    padding-top: 11px;
  }

  .cd-fact dd {
    font-size: 12.2px;
    line-height: 1.38;
  }

  .cd-footer {
    margin-top: 10px;
    padding-top: 9px;
  }

  /* Compact Castillo Vimi + Accordion Directory on Mobile */
  .refuge-section {
    justify-content: flex-start;
    padding: 72px 12px 44px;
  }

  .refuge-head {
    margin-bottom: 14px;
    padding-bottom: 12px;
    gap: 12px;
  }

  .refuge-main-title {
    font-size: clamp(32px, 9.5vw, 42px);
  }

  .refuge-head-actions {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .vimi-host-card {
    padding: 18px 16px;
    gap: 14px;
  }

  .host-card-title {
    font-size: 30px;
  }

  .host-card-lead {
    font-size: 13.4px;
  }

  .essential-row {
    padding: 10px 0;
  }

  .contact-badge {
    font-size: 8.4px;
  }
}

@media (max-width: 980px) and (max-height: 700px) {
  .hud-act-3 {
    padding: 50px var(--gutter) 8px;
    gap: 6px;
  }

  .carousel-stage-ctrl,
  .hud-act-3[data-gallery-mode="mesa"] .carousel-stage-ctrl {
    padding: 4px 7px;
    gap: 8px;
  }

  .stage-arrow-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .carousel-detail,
  .hud-act-3[data-gallery-mode="mesa"] .carousel-detail {
    padding: 9px 15px 11px;
  }

  .cd-sheet-handle {
    margin-bottom: 5px;
  }

  .cd-group-pill-row {
    margin-bottom: 3px;
  }

  .cd-hero-head {
    margin-bottom: 4px;
  }

  .cd-title {
    font-size: clamp(23px, 5.5vw, 29px);
  }

  .cd-kicker {
    margin-top: 3px;
    font-size: 8.4px;
  }

  .cd-story {
    margin-top: 5px;
  }

  .cd-story p {
    font-size: 13px;
    line-height: 1.36;
  }

  .cd-footer {
    margin-top: 7px;
    padding-top: 7px;
  }

  .hud-act-2-title {
    bottom: 18px;
  }

  .hud-act-2-title h2 {
    font-size: clamp(32px, 8.8vw, 44px);
  }
}
