/* ===========================================================
   SANTAZ — versión interactiva (index-interactivo.html)
   Shell fijo de "app": rail de íconos + panel de contenido con
   scroll interno, hero tipo scrollytelling con panorámica vertical
   del póster, y parallax en el resto de secciones.
   =========================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/inter-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Pirata One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/pirata-one.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0a0710;
  --bg-panel: #130c1e;
  --bg-panel-alt: #170f26;
  --border: rgba(240, 230, 255, 0.09);
  --border-strong: rgba(240, 230, 255, 0.18);

  --ink: #f3ede6;
  --ink-dim: #b9aec4;
  --ink-faint: #8a7d9c;

  --red: #ff3b5c;
  --red-btn: #d31f47;
  --red-deep: #8a0f2b;
  --teal: #2fe8c9;
  --gold: #f0c674;
  --violet: #a78bfa;
  --blue: #5fb3e8;

  --c-esperanza: #2fe8c9;
  --c-berta: #ff3b5c;
  --c-carmela: #f0c674;
  --c-mika: #5fb3e8;
  --c-porfirio: #a78bfa;
  --name-highlight: #75d2db;

  --font-display: "Pirata One", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rail-w: 84px;
}

@media (max-width: 640px) {
  :root { --rail-w: 60px; }
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img {
  max-width: 100%;
  display: block;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}
a { color: inherit; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 500;
  background: var(--red);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===========================================================
   MARCO — dos capas anidadas, nunca más grande que la pantalla:
   .frame-outer (borde delgado) > .app-shell (borde grueso) + .frame-footer
   =========================================================== */
.frame-outer {
  position: fixed;
  inset: clamp(4px, 1.6vw, 16px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vw, 12px);
  padding: clamp(18px, 2.2vw, 28px);
  border-radius: clamp(4px, 1.4vw, 20px);
  background: #050308;
  border: 1.5px solid rgba(95, 248, 255, 0.4);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.7),
    0 50px 120px -30px rgba(0, 0, 0, 0.9),
    0 0 46px -10px rgba(95, 248, 255, 0.2);
}

.app-shell {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  border-radius: clamp(0px, 1vw, 16px);
  overflow: hidden;
  background: var(--bg);
  border: 2.5px solid rgba(95, 248, 255, 0.75);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 30px 70px -24px rgba(0, 0, 0, 0.85),
    0 0 55px -8px rgba(95, 248, 255, 0.4);
}

/* ---------- Footer del marco (fijo debajo de la tarjeta interior) ---------- */
.frame-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem clamp(0.9rem, 3vw, 1.75rem);
  color: var(--ink-faint);
  font-size: 0.78rem;
}
.frame-footer-credit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.frame-footer-credit img {
  height: 20px;
  width: auto;
}
.frame-footer-meta {
  margin: 0;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .frame-footer { font-size: 0.66rem; padding-inline: 0.75rem; gap: 0.6rem; }
  .frame-footer-credit img { height: 15px; }
}
.grain { position: relative; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Niebla ambiental (fija dentro del shell, en todas las secciones) ----------
   Viñeta cargada a los bordes izquierdo/derecho (como ref. de íconos), con un
   degradado de máscara arriba para que no se vea como una franja de borde recto.
   Cada capa tiene su propia animación (traslación + escala) para que el conjunto
   se lea como niebla orgánica, no como un bloque deslizándose en línea recta. */
.app-fog {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(130px, 24vh, 260px);
  z-index: 38;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 0%, #000 16%, transparent 94%);
  mask-image: linear-gradient(to top, #000 0%, #000 16%, transparent 94%);
}
/* Textura de humo real (turbulencia de baja frecuencia, tipo nube) sobre los
   degradados de color, para que no se lean como manchas lisas de gradiente. */
.app-fog::after {
  content: "";
  position: absolute;
  inset: -25%;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23f)'/></svg>");
  background-repeat: no-repeat;
  background-size: 160% 160%;
  background-position: center;
  mix-blend-mode: soft-light;
  opacity: 0.28;
  animation: fogNoiseDrift 55s linear infinite;
  pointer-events: none;
}
@keyframes fogNoiseDrift {
  0% { transform: translate(0%, 0%) scale(1); }
  50% { transform: translate(-7%, -5%) scale(1.08); }
  100% { transform: translate(0%, 0%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .app-fog::after { animation: none; }
}
.fog-layer {
  position: absolute;
  inset: -30% -12% -35%;
  filter: blur(20px);
  will-change: transform;
}
.fog-left {
  background:
    radial-gradient(46% 82% at 0% 92%, rgba(95, 248, 255, 0.5), transparent 78%),
    radial-gradient(32% 58% at 14% 100%, rgba(95, 179, 232, 0.42), transparent 76%),
    radial-gradient(20% 36% at 6% 96%, rgba(167, 139, 250, 0.16), transparent 76%);
  animation: fogDriftA 26s ease-in-out infinite;
}
.fog-right {
  background:
    radial-gradient(46% 82% at 100% 92%, rgba(95, 248, 255, 0.46), transparent 78%),
    radial-gradient(32% 58% at 86% 100%, rgba(95, 179, 232, 0.4), transparent 76%),
    radial-gradient(20% 36% at 94% 96%, rgba(201, 169, 240, 0.14), transparent 76%);
  animation: fogDriftB 32s ease-in-out infinite;
}
.fog-center {
  opacity: 0.8;
  background:
    radial-gradient(30% 42% at 50% 100%, rgba(95, 179, 232, 0.2), transparent 76%),
    radial-gradient(20% 32% at 28% 94%, rgba(95, 248, 255, 0.14), transparent 76%),
    radial-gradient(20% 32% at 72% 92%, rgba(95, 179, 232, 0.14), transparent 76%);
  animation: fogDriftC 40s ease-in-out infinite;
}
@keyframes fogDriftA {
  0%   { transform: translate(-3%, 2%) scale(1); }
  33%  { transform: translate(3%, -3%) scale(1.06); }
  66%  { transform: translate(-2%, 3%) scale(0.97); }
  100% { transform: translate(-3%, 2%) scale(1); }
}
@keyframes fogDriftB {
  0%   { transform: translate(3%, -2%) scale(1.03); }
  40%  { transform: translate(-3%, 3%) scale(0.96); }
  75%  { transform: translate(2%, -4%) scale(1.05); }
  100% { transform: translate(3%, -2%) scale(1.03); }
}
@keyframes fogDriftC {
  0%   { transform: translate(-2%, 0%) scale(1); }
  50%  { transform: translate(2%, -2%) scale(1.04); }
  100% { transform: translate(-2%, 0%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .fog-layer { animation: none; }
}

/* Variante del hero: más presente, con azul/celeste/morado/lila tomados del póster */
.app-fog--hero {
  height: clamp(170px, 32vh, 340px);
}
.app-fog--hero .fog-left {
  background:
    radial-gradient(52% 85% at 0% 92%, rgba(95, 248, 255, 0.56), transparent 76%),
    radial-gradient(36% 62% at 14% 100%, rgba(95, 179, 232, 0.46), transparent 78%),
    radial-gradient(22% 40% at 6% 94%, rgba(122, 88, 200, 0.18), transparent 78%);
}
.app-fog--hero .fog-right {
  background:
    radial-gradient(52% 85% at 100% 92%, rgba(95, 248, 255, 0.52), transparent 76%),
    radial-gradient(36% 62% at 86% 100%, rgba(95, 179, 232, 0.44), transparent 78%),
    radial-gradient(22% 40% at 94% 94%, rgba(201, 169, 240, 0.16), transparent 78%);
}
.app-fog--hero .fog-center {
  opacity: 0.9;
  background:
    radial-gradient(38% 48% at 50% 100%, rgba(95, 179, 232, 0.34), transparent 78%),
    radial-gradient(26% 36% at 30% 92%, rgba(95, 248, 255, 0.2), transparent 78%),
    radial-gradient(26% 36% at 70% 90%, rgba(95, 179, 232, 0.2), transparent 78%);
}
.app-fog--hero::after { opacity: 0.24; }

/* ---------- Rail de navegación (izquierda, fijo) ---------- */
/* El rail "flota" sobre el borde izquierdo de .app-shell (mitad afuera, mitad
   adentro) en vez de ser una barra sólida propia. top/height se fijan por JS
   (syncRailFrame) para que calce exacto con el alto real de .app-shell. */
.app-rail {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateX(-50%);
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.3rem, 1.2vh, 0.6rem);
  padding-block: clamp(0.5rem, 1.8vh, 1.5rem);
  z-index: 40;
}
.app-rail-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.25rem, 1vh, 0.5rem);
  flex: 1;
  overflow: visible;
}
.rail-btn {
  position: relative;
  width: clamp(32px, 5vh, 44px); height: clamp(32px, 5vh, 44px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #100a1a;
  border: 1px solid var(--border-strong);
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
  flex-shrink: 0;
  text-decoration: none;
}
.rail-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.rail-btn:hover,
.rail-btn:focus-visible {
  color: var(--ink);
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(47, 232, 201, 0.12);
}
.rail-btn.is-active {
  color: #fff;
  border-color: var(--blue);
  background: #12263d;
  box-shadow: 0 0 16px -2px rgba(95, 179, 232, 0.6);
}
.rail-btn .rail-tip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  white-space: nowrap;
  background: #05030a;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 60;
}
.rail-btn:hover .rail-tip,
.rail-btn:focus-visible .rail-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Botón hamburguesa: solo existe visualmente en móvil */
.rail-hamburger { display: none; }
.rail-hamburger .icon-close { display: none; }

@media (max-width: 640px) {
  .rail-btn { width: 38px; height: 38px; }
  .rail-btn svg { width: 16px; height: 16px; }
  .rail-btn .rail-tip { display: none; }

  /* El hamburguesa reemplaza la fila de iconos: se saca del flujo flex del
     rail y se fija arriba, centrado en el borde visible de la tarjeta. */
  .rail-hamburger {
    display: flex;
    position: absolute;
    top: clamp(0.5rem, 1.8vh, 1.5rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 56;
  }
  /* .rail-btn:hover/:focus-visible también declara `transform` (lift de 2px);
     sin esto, esa regla pisa por completo el translateX(-50%) que centra el
     botón y lo hace saltar de posición al pasar el mouse o hacer click. */
  .rail-hamburger:hover,
  .rail-hamburger:focus-visible {
    transform: translateX(-50%);
  }

  /* Menú de secciones oculto por defecto; se despliega como tarjeta al abrir */
  #appRailNav { display: none; }
  .app-rail.is-open #appRailNav {
    display: flex;
    position: absolute;
    top: calc(clamp(0.5rem, 1.8vh, 1.5rem) + 38px + 0.5rem);
    left: 50%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    min-width: 200px;
    max-width: calc(100vw - 2rem);
    background: #0d0816;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 0.6rem;
    box-shadow: 0 24px 50px -14px rgba(0, 0, 0, 0.85);
    z-index: 55;
  }
  .app-rail.is-open #appRailNav .rail-btn {
    width: auto;
    height: auto;
    flex-direction: row;
    justify-content: flex-start;
    border-radius: 10px;
    gap: 0.65rem;
    padding: 0.6rem 0.8rem;
  }
  .app-rail.is-open #appRailNav .rail-btn svg { width: 18px; height: 18px; }
  .app-rail.is-open #appRailNav .rail-btn .rail-tip {
    display: block;
    position: static;
    opacity: 1;
    pointer-events: none;
    transform: none;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    white-space: normal;
    color: inherit;
  }

  .app-rail.is-open .rail-hamburger .icon-menu { display: none; }
  .app-rail.is-open .rail-hamburger .icon-close { display: block; }
}

/* ---------- Acciones fijas arriba a la derecha de la tarjeta (Instagram / Contacto) ---------- */
.app-corner-actions {
  position: absolute;
  top: clamp(0.85rem, 2.2vh, 1.5rem);
  right: clamp(0.85rem, 2.2vw, 1.5rem);
  z-index: 40;
  display: flex;
  gap: 0.5rem;
}
.app-corner-actions .rail-tip {
  left: auto;
  right: calc(100% + 12px);
  transform: translateY(-50%) translateX(4px);
}
.app-corner-actions .rail-btn:hover .rail-tip,
.app-corner-actions .rail-btn:focus-visible .rail-tip {
  transform: translateY(-50%) translateX(0);
}
@media (max-width: 640px) {
  .app-corner-actions { gap: 0.4rem; }
}

/* progreso vertical del scroll, integrado al rail */
.rail-progress {
  width: 3px;
  flex: 1;
  max-height: clamp(24px, 6vh, 90px);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  margin-block: clamp(0.1rem, 0.6vh, 0.35rem);
  flex-shrink: 0;
}
.rail-progress span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, var(--gold), var(--red));
  box-shadow: 0 0 8px rgba(255, 59, 92, 0.6);
  transition: height 0.08s linear;
}
@media (max-width: 640px) { .rail-progress { display: none; } }

/* ---------- Panel de contenido (único con scroll) ---------- */
.app-content {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.app-content::-webkit-scrollbar {
  display: none;
}

/* Solo un panel visible a la vez: navegar cambia de sección, no hace scroll largo */
.panel { display: none; }
.panel.is-active { display: block; min-height: 100%; box-sizing: border-box; }

.container {
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.section { padding-block: clamp(3rem, 7vw, 6rem); position: relative; overflow: hidden; }
.section--panel {
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-alt));
  border-block: 1px solid var(--border);
}
.section-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 2.6vw + 1rem, 2.6rem);
  color: var(--ink);
  margin-bottom: 1.5rem;
}
.lead {
  font-size: clamp(1rem, 0.4vw + 1rem, 1.15rem);
  color: var(--ink-dim);
  max-width: 66ch;
}
.lead-highlight { color: var(--gold); font-weight: 700; }

/* parallax genérico: capa de fondo por sección */
.parallax-bg {
  position: absolute;
  inset: -15% 0 -15% 0;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
.section > .container { position: relative; z-index: 1; }

/* Concepto y Por qué funciona necesitan overflow:visible en la sección para
   que la imagen sticky funcione (ver reglas #concepto/#por-que-funciona más
   abajo); eso deja el bleed vertical de -15% del .parallax-bg sin recortar,
   agregando scroll fantasma vacío al final de la sección. Se quita el bleed
   solo aquí; el degradado ya se desvanece a transparente antes del borde. */
#concepto .parallax-bg,
#por-que-funciona .parallax-bg {
  inset: 0;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ===========================================================
   HERO — panel "pinned" con panorámica vertical del póster
   =========================================================== */
.hero-pin {
  position: relative;
  height: 280vh; /* distancia de scroll para recorrer el póster completo */
}
.hero-sticky {
  position: sticky;
  top: 0;
  height: 100dvh;
  max-height: 100%;
  overflow: hidden;
  background: #000;
}
.hero-pan {
  position: absolute;
  top: 0; left: -4%;
  width: 108%;
  will-change: transform;
}
.hero-pan img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(1.05) contrast(1.03);
}
.hero-pan.is-settling {
  transition: transform 0.5s ease-out;
}
.hero-sticky::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 3, 12, 0.75) 0%, rgba(6, 3, 12, 0.1) 22%, rgba(6, 3, 12, 0.05) 55%, rgba(6, 3, 12, 0.55) 82%, rgba(6, 3, 12, 0.92) 100%),
    linear-gradient(90deg, rgba(6, 3, 12, 0.35), transparent 18%, transparent 82%, rgba(6, 3, 12, 0.35));
}

.hero-title-wrap {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  z-index: 3;
  text-align: center;
  padding-inline: 1rem;
  transform: translateY(-50%);
  pointer-events: none; /* deja pasar el scroll (Safari no lo hace pasar a través de overlays no interactivos); se reactiva en .hero-actions para el botón */
}
.hero-title-wrap::before {
  content: "";
  position: absolute;
  inset: -2.5rem -1.5rem -3rem;
  z-index: -1;
  background: radial-gradient(65% 85% at 50% 42%, rgba(5, 3, 10, 0.62), transparent 75%);
  pointer-events: none;
}
.hero-eyebrow {
  color: var(--teal);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px rgba(47, 232, 201, 0.5);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4.5rem, 17vw, 12rem);
  line-height: 0.88;
  letter-spacing: 0.01em;
  color: #d9cdfb;
  text-shadow:
    0 0 22px rgba(167, 139, 250, 0.9),
    0 0 70px rgba(167, 139, 250, 0.55),
    0 0 130px rgba(120, 90, 210, 0.4),
    0 6px 34px rgba(0, 0, 0, 0.85);
  margin: 0;
}
.hero-sub {
  margin-top: 0.75rem;
  color: var(--ink-dim);
  font-size: clamp(0.95rem, 0.6vw + 0.8rem, 1.15rem);
  max-width: 42ch;
  margin-inline: auto;
}

.hero-caption {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  z-index: 3;
  text-align: center;
  padding-inline: clamp(1.25rem, 6vw, 4rem);
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-50% + 24px));
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.hero-caption::before {
  content: "";
  position: absolute;
  inset: -60vh -60vw;
  z-index: -1;
  background: radial-gradient(55vw 45vh at 50% 50%, rgba(5, 3, 10, 0.85), transparent 75%);
  pointer-events: none;
}
.hero-caption.is-shown { opacity: 1; transform: translateY(-50%); }
.hero-caption p {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw + 0.8rem, 2.1rem);
  color: #fff;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.95),
    0 4px 22px rgba(0, 0, 0, 0.9),
    0 0 46px rgba(0, 0, 0, 0.75);
  max-width: 26ch;
  margin-inline: auto;
  line-height: 1.2;
}
.hero-caption p span { color: var(--name-highlight); }

.hero-scrollhint {
  position: absolute;
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-faint);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.hero-scrollhint svg {
  width: 18px; height: 18px;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(6px); opacity: 1; }
}
.hero-pin.is-scrolled .hero-scrollhint { opacity: 0; pointer-events: none; }

/* Navegación por clic (solo Safari de escritorio, ver .is-safari más abajo) */
.hero-safari-nav {
  display: none;
  position: absolute;
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6; /* por encima de .hero-outro-credit (5): debe verse incluso en el último slide */
  align-items: center;
  gap: 1rem;
}
.hero-safari-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(10, 7, 16, 0.55);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.hero-safari-nav-btn svg { width: 18px; height: 18px; }
.hero-safari-nav-btn:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.hero-safari-nav-btn:disabled { opacity: 0.3; cursor: default; }
.hero-safari-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hero-safari-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  opacity: 0.5;
  transition: opacity 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.hero-safari-dot.is-active {
  background: var(--teal);
  opacity: 1;
  transform: scale(1.3);
}

.hero-outro {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: #000;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}
.hero-outro-credit {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  text-align: center;
  padding-inline: 1rem;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}
.hero-outro-label {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hero-outro-logo {
  height: clamp(140px, 16vw, 240px);
  width: auto;
}

/* ---------- Hero estático para Safari de escritorio ----------
   WebKit pierde el scroll por trackpad al pasar sobre capas compuestas
   (opacity/transform) superpuestas dentro de un position:sticky — es
   exactamente el mecanismo del pin del hero. En vez de perseguir ese bug,
   Safari de escritorio recibe un hero estático (sin panorámica) y navega
   el título/leyendas por clic (.hero-safari-nav) en vez de por scroll.
   Ver isSafari en main-interactivo.js (excluye iPhone/iPad). */
.is-safari .hero-pin {
  height: 100dvh;
}
.is-safari .hero-sticky {
  position: relative;
  height: 100dvh;
}
.is-safari .hero-pan {
  top: 0; left: 0; right: 0; bottom: 0;
  width: auto;
}
.is-safari .hero-pan img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}
.is-safari .hero-scrollhint {
  display: none;
}
.is-safari .hero-safari-nav {
  display: flex;
}
.is-safari .hero-title-wrap,
.is-safari .hero-outro,
.is-safari .hero-outro-credit {
  transition: opacity 0.3s var(--ease);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: linear-gradient(135deg, var(--red-btn), var(--red-deep));
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(255, 59, 92, 0.55);
}
.btn--primary:hover { box-shadow: 0 12px 28px -8px rgba(255, 59, 92, 0.75); }
.btn--outline {
  background: rgba(0,0,0,0.25);
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn--outline:hover { border-color: var(--teal); color: var(--teal); }

.btn--play {
  padding: 0.4rem 1.9rem 0.4rem 0.4rem;
  gap: 0.85rem;
  background: linear-gradient(160deg, #241019, #0d060a 70%);
  border-color: rgb(255 52 90);
  box-shadow: 0 10px 30px -10px rgba(211, 31, 71, 0.6), inset 0 0 0 1px rgba(255,255,255,0.03);
  color: var(--ink);
  cursor: pointer;
}
.btn--play:hover {
  border-color: rgba(255, 59, 92, 0.6);
  box-shadow: 0 14px 34px -8px rgba(211, 31, 71, 0.8), inset 0 0 0 1px rgba(255,255,255,0.05);
}
.btn-play-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, var(--red), var(--red-btn) 55%, var(--red-deep) 100%);
  box-shadow: 0 4px 14px -2px rgba(255, 59, 92, 0.75);
}
.btn-play-icon svg { width: 22px; height: 22px; margin-left: 3px; color: #fff; }
.btn-play-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
  pointer-events: auto;
}

/* ---------- Concepto ---------- */
.concept-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: 2.25rem;
}
@media (max-width: 720px) {
  .concept-grid { grid-template-columns: 1fr; }
  .concept-side { margin-top: 1.25rem; }
}
.concept-side {
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: linear-gradient(160deg, rgba(47, 232, 201, 0.16), rgba(47, 232, 201, 0.04));
  border: 1px solid rgba(47, 232, 201, 0.35);
  box-shadow: 0 20px 45px -25px rgba(47, 232, 201, 0.45);
}

/* ---------- Por qué funciona ---------- */
#por-que-funciona.section.is-active {
  display: flex;
  align-items: flex-start;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: 0;
  overflow: visible; /* .section trae overflow:hidden, que convertiría a la
    sección misma (en vez de .app-content) en el ancestro con scroll para la
    imagen sticky, y como la sección no tiene scroll propio (crece para
    ajustarse a su contenido) la imagen nunca tendría margen para quedar fija */
}
.funciona-media {
  position: sticky;
  top: 0;
  flex: 0 0 42%;
  align-self: flex-start;
}
.funciona-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 75% 22%;
  display: block;
}
.funciona-copy {
  position: relative;
  flex: 1 1 auto;
  padding-block: clamp(2rem, 4vw, 3.5rem);
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}
@media (max-width: 720px) {
  #por-que-funciona.section.is-active { flex-direction: column; }
  .funciona-media { position: static; width: 100%; height: 260px; margin-bottom: 1.5rem; }
  .funciona-copy { padding-inline: clamp(1.1rem, 4vw, 2.5rem); }
}

/* ---------- Concepto (imagen espejo, a la derecha) ---------- */
#concepto.section.is-active {
  display: flex;
  align-items: flex-start;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: 0;
  overflow: visible; /* ver nota en #por-que-funciona.section.is-active */
}
.concepto-media {
  position: sticky;
  top: 0;
  flex: 0 0 42%;
  align-self: flex-start;
}
.concepto-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.concepto-copy {
  position: relative;
  flex: 1 1 auto;
  max-width: 1050px;
  padding-block: clamp(3rem, 7vw, 6rem);
  padding-left: clamp(2.1rem, 4vw, 0.5rem);
}
@media (max-width: 720px) {
  #concepto.section.is-active { flex-direction: column; }
  .concepto-media { position: static; width: 100%; height: 260px; margin-bottom: 1.5rem; order: -1; }
  .concepto-copy { padding-inline: clamp(1.1rem, 4vw, 2.5rem); }
}

.concept-subtitle {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
  color: var(--teal);
}
.concept-side p { color: var(--ink-dim); margin-bottom: 0.5rem; }
.concept-side strong { color: var(--ink); }
.concept-refs-label { margin-top: 0.9rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); }
.badge-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.55rem; }
.badge {
  font-size: 0.78rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: var(--violet);
  font-weight: 500;
}
.differentiators {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
}
.differentiators li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--ink-dim);
}
.diff-mark { color: var(--gold); flex-shrink: 0; }

/* ---------- Slider de fondo (fotogramas atmosféricos: Concepto / Producción) ---------- */
.bg-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-slide {
  position: absolute;
  inset: -1%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 2.4s ease, transform 6s ease;
  filter: blur(1.5px) saturate(1.05);
}
.bg-slide.is-active {
  opacity: 1;
  transform: scale(1);
}
.bg-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 7, 16, 0.55), rgba(10, 7, 16, 0.82) 60%, rgba(10, 7, 16, 0.94)),
    linear-gradient(90deg, rgba(10, 7, 16, 0.5), transparent 30%, transparent 70%, rgba(10, 7, 16, 0.5));
}
@media (prefers-reduced-motion: reduce) {
  .bg-slide { transition: opacity 0.6s ease; transform: none; }
}

/* ---------- Piloto ---------- */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Popup del piloto ---------- */
.video-modal {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 5vw, 3.5rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.video-modal.is-open { opacity: 1; pointer-events: auto; }
.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 10, 0.6);
  backdrop-filter: blur(10px);
}
.video-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 900px;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.3s var(--ease);
}
.video-modal.is-open .video-modal-dialog { transform: translateY(0) scale(1); }
.video-modal-dialog .video-frame {
  border: 1px solid rgba(95, 248, 255, 0.4);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.85), 0 0 40px -10px rgba(95, 248, 255, 0.3);
}
.video-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #100a1a;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.video-modal-close:hover, .video-modal-close:focus-visible { border-color: var(--blue); color: var(--blue); }
.video-modal-close svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .video-modal-close { top: 12px; right: 12px; width: 32px; height: 32px; }
}

/* ---------- Personajes ---------- */
#personajes.section { padding-block: clamp(2rem, 4vw, 3.5rem); }
#personajes .container { max-width: 1280px; }
#personajes .section-title { margin-bottom: 0.8rem; }
.character-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
}
/* Debajo de 900px, 5 columnas fijas dejan tarjetas demasiado angostas y el
   texto se corta (especialmente en celulares grandes, ~560-900px de ancho).
   auto-fit + minmax reparte columnas según el espacio real disponible en
   vez de depender de breakpoints fijos que no cubren todos los anchos de
   pantalla de celular. */
@media (max-width: 900px) {
  .character-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 360px) { .character-grid { grid-template-columns: 1fr; } }
.char-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.char-card:hover, .char-card:focus-within {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 16px 40px -18px var(--accent);
}
.char-photo { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% center; transition: transform 0.4s var(--ease); }
/* Las fotos fuente son tomas panorámicas; se apunta el recorte 4:5 hacia el rostro de cada quien */
.char-photo--esperanza { object-position: 27% center; }
.char-photo--berta { object-position: 62% center; }
.char-photo--carmela { object-position: 68% center; }
.char-photo--mika { object-position: 72% center; }
.char-photo--porfirio { object-position: 22% center; }
.char-card:hover .char-photo, .char-card:focus-within .char-photo { transform: scale(1.05); }
.char-card-body { position: relative; padding: 0.85rem 1.1rem 1rem; }
.char-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; margin-bottom: 0.15rem; color: var(--ink); }
.char-role { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; margin-bottom: 0.7rem; }
.char-card p:not(.char-role) { color: var(--ink-dim); font-size: 0.92rem; }

/* ---------- Universo ---------- */
.universe-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
@media (max-width: 560px) { .universe-grid { grid-template-columns: 1fr; } }
.universe-card {
  padding: 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
}
.universe-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; margin-bottom: 0.5rem; color: var(--teal); }
.universe-card p { color: var(--ink-dim); font-size: 0.9rem; }

/* ---------- Por qué funciona ---------- */
.check-list { margin-top: 1.75rem; display: grid; gap: 0.85rem; }
.check-list li { display: flex; align-items: flex-start; gap: 0.7rem; color: var(--ink-dim); font-size: 0.95rem; }
.check-mark {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(47, 232, 201, 0.12); color: var(--teal);
  font-size: 0.75rem; font-weight: 700; margin-top: 0.1em;
}

/* ---------- Producción ---------- */
.status-badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; margin-top: 1.5rem; }
@media (max-width: 560px) { .status-badges { grid-template-columns: 1fr; } }
.status-badge {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem;
  padding: 1.1rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
}
.status-badge-value {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(240, 198, 116, 0.14);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1;
}
.status-badge-label { font-size: 0.8rem; color: var(--ink-dim); }

/* ---------- Footer / Contacto ---------- */
.site-footer {
  position: relative;
  padding-block: clamp(3rem, 7vw, 5rem) 2rem;
  background:
    radial-gradient(60% 60% at 15% 0%, rgba(120, 110, 210, 0.16), transparent 70%),
    radial-gradient(50% 50% at 90% 20%, rgba(47, 232, 201, 0.1), transparent 70%),
    var(--bg-panel);
  border-top: 1px solid var(--border);
}
.site-footer.panel.is-active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100%;
}
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); padding-bottom: 2.5rem; }
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-meta { border-left: none; border-top: 2px solid var(--border-strong); padding-left: 0; padding-top: 1.25rem; align-self: start; }
}
.footer-cta .section-title { margin-bottom: 0.9rem; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 1.5rem; }
.footer-meta { border-left: 2px solid var(--border-strong); padding-left: clamp(1rem, 2vw, 1.5rem); align-self: center; }
.footer-name { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); }
.footer-role { color: var(--ink-faint); font-size: 0.82rem; margin-bottom: 0.7rem; }
.footer-meta a { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; color: var(--ink-dim); transition: color 0.2s var(--ease); }
.footer-meta a:hover { color: var(--teal); }
.btn-icon { width: 18px; height: 18px; flex-shrink: 0; }
