/* Mendoré · pre-lanzamiento.
   Marca: jade #1E3B33 · jade claro #2A5045 · beige #ECE2D0 · marfil #F6F1E9 · oro #C9A24D (solo detalles)
   oro oscuro #A8822F (líneas sobre claro) · oro texto #7A5C1C · tinta suave #535E57.
   Esquinas rectas, sin sombras, sin degradados chillones. Entradas 600–1200 ms con cubic-bezier(.22,1,.36,1);
   microinteracciones 200–300 ms. Nada rebota. */

@font-face { font-family: "Bellefair"; src: url("/fuentes/Bellefair-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jost"; src: url("/fuentes/Jost-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Jost"; src: url("/fuentes/Jost-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --jade: #1e3b33; --jade-claro: #2a5045; --beige: #ece2d0; --marfil: #f6f1e9;
  --oro: #c9a24d; --oro-oscuro: #a8822f; --oro-texto: #7a5c1c; --tinta: #535e57;
  --suave: cubic-bezier(0.22, 1, 0.36, 1);
  --titulo: "Bellefair", "Times New Roman", serif;
  --texto: "Jost", "Helvetica Neue", Arial, sans-serif;
  /* Retraso de la portada: espera a la intro (0 si ya se vio en esta visita). */
  --tras-intro: 2900ms;
}
html[data-intro="vista"] { --tras-intro: 0ms; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--jade); color: var(--beige); font-family: var(--texto); font-weight: 300; font-size: 1.0625rem; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2 { font-family: var(--titulo); font-weight: 400; margin: 0; letter-spacing: 0.005em; }
p, figure { margin: 0; }
::selection { background: var(--oro); color: var(--jade); }
:focus-visible { outline: 1px solid var(--oro); outline-offset: 4px; }

.etiqueta { font-family: var(--texto); font-weight: 400; font-size: 0.6875rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--oro); }
.etiqueta-oscura { color: var(--oro-texto); }
.texto { color: var(--tinta); font-size: 1.0625rem; line-height: 1.8; max-width: 34rem; }

.saltar { position: absolute; left: -999px; top: 0; z-index: 60; background: var(--beige); color: var(--jade); padding: 0.75rem 1rem; }
.saltar:focus { left: 1rem; top: 1rem; }

/* Grano de película muy suave sobre las fotos (no en el texto). Mosaico de ruido ya calculado: el filtro SVG
   en vivo costaba 2 s de CPU en celular (Lighthouse 71 → con mosaico, ver bitácora). */
.grano { position: relative; }
.grano::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay;
  background: url("/media/grano.webp") repeat; background-size: 128px 128px; }

/* ── Intro (≈3.2 s; un toque la salta; solo la primera vez por visita) ─────────── */
.telon { position: fixed; inset: 0; z-index: 50; background: var(--jade); display: grid; place-items: center; overflow: hidden; cursor: pointer;
  animation: telon-sale 900ms var(--suave) 2600ms forwards; }
html[data-intro="vista"] .telon { display: none; }
.telon.fuera { animation: telon-sale 600ms var(--suave) forwards; }
.telon-m { position: absolute; width: min(150vmin, 1100px); height: auto; opacity: 0.02; transform: scale(1.05); animation: aparece-m 1800ms var(--suave) 50ms forwards; }
.telon-centro { position: relative; display: grid; justify-items: center; gap: 1.5rem; }
.telon-logo { position: relative; display: block; width: min(62vw, 340px); opacity: 0; transform: translateY(10px); animation: aparece 1200ms var(--suave) 450ms forwards; }
.telon-logo img { width: 100%; height: auto; }
/* Brillo dorado que recorre el logo una vez (recortado a la forma del logo). */
.telon-brillo { position: absolute; inset: 0;
  -webkit-mask: url("/marca/logo-claro.svg") center / 100% 100% no-repeat; mask: url("/marca/logo-claro.svg") center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 38%, rgb(232 205 140 / 0.95) 50%, transparent 62%) no-repeat; background-size: 260% 100%; background-position: 120% 0;
  animation: brillo 1500ms var(--suave) 1250ms forwards; }
.telon-linea { display: block; width: 104px; height: 1px; background: var(--oro); transform: scaleX(0); animation: linea 1100ms var(--suave) 1200ms forwards; }
@keyframes aparece-m { to { opacity: 1; transform: scale(1); } }
@keyframes aparece { to { opacity: 1; transform: none; } }
@keyframes linea { to { transform: scaleX(1); } }
@keyframes brillo { to { background-position: -20% 0; } }
@keyframes telon-sale { to { opacity: 0; visibility: hidden; } }

/* ── 1 · Manifiesto (portada) ─────────────────────────────────────────────── */
.portada { position: relative; overflow: hidden; background: var(--jade); }
.portada-medio { position: relative; height: 66svh; min-height: 26rem; }
.portada-foto, .portada-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.portada-video { opacity: 0; transition: opacity 1600ms var(--suave); }
.portada-video.visible { opacity: 1; }
.portada-texto { position: relative; padding: 2.75rem 1.5rem 4rem; }
.portada-logo { width: 9.5rem; height: auto; margin: 0 0 2.25rem -0.5rem; }
.portada h1 { font-size: clamp(3.25rem, 15vw, 7rem); line-height: 1; margin-top: 1rem; }
.lema { font-family: var(--titulo); font-size: clamp(1.6rem, 6.4vw, 2.5rem); line-height: 1.2; margin-top: 0.85rem; color: var(--beige); }
.enlace-fino { display: inline-block; margin-top: 2.25rem; font-weight: 400; font-size: 0.6875rem; letter-spacing: 0.32em; text-transform: uppercase; text-decoration: none; color: var(--beige); padding: 0.75rem 0; position: relative; }
.enlace-fino::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.45rem; height: 1px; background: var(--oro); transform-origin: left; transition: transform 300ms var(--suave); }
.enlace-fino:hover::after { transform: scaleX(0.35); }

/* Revelado por líneas: cada línea sube detrás de su propio margen, lento. */
.linea { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; }
.linea > span { display: inline-block; transform: translateY(105%); animation: sube 1200ms var(--suave) forwards; }
@keyframes sube { to { transform: none; } }
.portada .etiqueta.linea > span { animation-delay: calc(var(--tras-intro) + 0ms); }
.portada h1 .linea > span { animation-delay: calc(var(--tras-intro) + 150ms); }
.portada .lema .linea:nth-child(1) > span { animation-delay: calc(var(--tras-intro) + 450ms); }
.portada .lema .linea:nth-child(2) > span { animation-delay: calc(var(--tras-intro) + 600ms); }
.portada .enlace-fino.linea > span { animation-delay: calc(var(--tras-intro) + 900ms); }

@media (min-width: 768px) {
  .portada { display: grid; min-height: 100svh; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .portada-medio { grid-column: 2; grid-row: 1; height: 100svh; min-height: 0; }
  .portada-medio::before { content: ""; position: absolute; inset: 2.5rem 2.5rem 2.5rem 0; border: 1px solid rgb(201 162 77 / 0.55); pointer-events: none; z-index: 1; }
  .portada-foto, .portada-video { inset: 3.5rem 3.5rem 3.5rem 1rem; width: calc(100% - 4.5rem); height: calc(100% - 7rem); }
  .portada-medio.grano::after { inset: 3.5rem 3.5rem 3.5rem 1rem; }
  .portada-texto { grid-column: 1; grid-row: 1; padding: 0 2.5rem 0 clamp(2.5rem, 8vw, 8rem); }
  .portada-logo { width: clamp(9.5rem, 14vw, 12rem); margin-bottom: clamp(2.5rem, 5vw, 4rem); }
  .portada h1 { font-size: clamp(3.5rem, 8vw, 7rem); }
  .lema { font-size: clamp(1.6rem, 3vw, 2.5rem); }
}

/* ── 2 · Momentos: capítulos a pantalla completa ─────────────────────────── */
.escena { position: relative; overflow: hidden; min-height: 100svh; display: grid; align-content: center; padding: 6rem 1.5rem; }
.escena-marfil { background: var(--marfil); color: var(--jade); }
.escena-beige { background: var(--beige); color: var(--jade); }
.escena-jade { background: var(--jade); color: var(--beige); }
.escena-texto { position: relative; max-width: 40rem; }
/* Marco fino dorado en las escenas solo de texto: da estructura al aire (como el marco del video en escritorio). */
.escena-marco::before { content: ""; position: absolute; inset: 1.25rem; border: 1px solid rgb(168 130 47 / 0.38); pointer-events: none; }
.escena-jade.escena-marco::before { border-color: rgb(201 162 77 / 0.4); }
.escena-marco { padding: 7rem 2.75rem; }
.escena-numero { font-family: var(--titulo); font-size: 1.6rem; letter-spacing: 0.04em; line-height: 1; color: var(--oro-texto); }
.escena-jade .escena-numero { color: var(--oro); }
.escena h2 { font-size: clamp(2.6rem, 11vw, 5.5rem); line-height: 1.04; margin: 1.25rem 0 0; max-width: 13ch; }
.escena-regla { display: block; width: 3.5rem; height: 1px; background: var(--oro-oscuro); margin: 2.25rem 0 1.5rem; transform-origin: left; }
.escena-jade .escena-regla { background: var(--oro); }
.escena-nota { font-size: 1.0625rem; line-height: 1.8; color: var(--tinta); max-width: 26rem; }
.escena-jade .escena-nota { color: rgb(236 226 208 / 0.8); }
.escena-m { position: absolute; right: -28%; bottom: -12%; width: 115%; max-width: none; height: auto; opacity: 0.55; pointer-events: none; }
/* Número del capítulo como marca de agua editorial (muy tenue). */
.escena-marca { position: absolute; right: 6%; bottom: -4%; font-family: var(--titulo); font-size: 70vw; line-height: 0.8; color: rgb(168 130 47 / 0.09); pointer-events: none; user-select: none; }

/* Tableta: el video encuadra ojos y cadenas; las fotos de escena no crecen de más. */
@media (min-width: 600px) and (max-width: 1023px) {
  .escena-foto { margin: 0; justify-self: center; width: 100%; max-width: 30rem; }
  .escena-con-foto { padding-top: 6rem; }
  .escena-marca { font-size: 48vw; }
}
.escena-con-foto { align-content: start; gap: 3rem; padding-top: 0; }
.escena-foto { margin: 0 -1.5rem; aspect-ratio: 4 / 5; overflow: hidden; background: var(--beige); }
.escena-foto img { width: 100%; height: 100%; object-fit: cover; }
/* Placeholders borrosos (16×20 px) mientras carga la foto. */
.escena-foto-perfil { background: url("data:image/webp;base64,UklGRmIAAABXRUJQVlA4IFYAAAAQBACdASoQABQAPu1iqU2ppaQiMAgBMB2JYgCdL1yBPI62vWFrclAJ+AD+ieMzU5NIthFF4GgZnwuJcf7lZrAbRH5pSOXOTn1vpWUEx8jDjyG9X7kAAA==") center / cover; }
.escena-foto-detalle { background: url("data:image/webp;base64,UklGRlgAAABXRUJQVlA4IEwAAACwAwCdASoQABQAPu1iqU2ppaOiMAgBMB2JQBOl65AsmnidS0Cw8AD+NHXdpyrtoWLYV/vKWy745bv9beSyW8FJla7Rses3ZpDLeYAA") center / cover; }

@media (min-width: 1024px) {
  .escena { padding: 8rem clamp(3rem, 8vw, 8rem); }
  .escena-con-foto { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); align-items: center; align-content: center; gap: clamp(3rem, 7vw, 8rem); padding-top: 8rem; }
  .escena-foto { margin: 0; max-height: 78svh; aspect-ratio: 4 / 5; }
  .escena-invertida .escena-foto { order: 2; }
  .escena-m { right: -6%; bottom: -18%; width: 62%; }
  .escena-marca { right: 8%; bottom: -6%; font-size: 40vw; }
  .escena-nota, .texto { font-size: 1.1875rem; }
  .escena:not(.escena-con-foto) .escena-texto { margin-left: clamp(0rem, 12vw, 14rem); }
  .escena-marco::before { inset: 2.5rem; }
}

/* ── 3 · La Casa ──────────────────────────────────────────────────────────── */
.casa { background: var(--beige); color: var(--jade); padding: clamp(7rem, 20vw, 12rem) 1.5rem; }
.contenedor { max-width: 46rem; margin: 0 auto; }
.casa h2 { font-size: clamp(2.4rem, 9vw, 4rem); line-height: 1.06; margin: 1.5rem 0 2rem; }
.fundadores { margin-top: 3.5rem; display: grid; grid-template-columns: 3rem 1fr; gap: 1.25rem; align-items: start; }
.fundadores-linea { height: 1px; background: var(--oro-oscuro); margin-top: 0.85rem; }
.fundadores p { font-family: var(--titulo); font-size: clamp(1.35rem, 5vw, 1.8rem); line-height: 1.35; color: var(--jade); }
.fundadores em { font-style: normal; color: var(--oro-texto); }

/* ── 4 · Invitación ───────────────────────────────────────────────────────── */
.invitacion { background: var(--marfil); color: var(--jade); padding: clamp(5rem, 14vw, 9rem) 1rem; }
.tarjeta { max-width: 34rem; margin: 0 auto; border: 1px solid rgb(168 130 47 / 0.45); padding: clamp(2.25rem, 7vw, 3.75rem) clamp(1.5rem, 6vw, 3.5rem); background: var(--marfil); }
.invitacion h2 { font-size: clamp(2rem, 7.6vw, 2.9rem); line-height: 1.1; margin: 1.25rem 0 1rem; }
.formulario { margin-top: 2.5rem; display: grid; gap: 1.75rem; }
.campo { display: grid; gap: 0.35rem; }
.campo span { font-weight: 400; font-size: 0.6875rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--tinta); }
.campo small { font-size: inherit; letter-spacing: 0.12em; text-transform: none; }
.campo input { font: inherit; font-size: 1.125rem; color: var(--jade); background: transparent; border: 0; border-bottom: 1px solid rgb(30 59 51 / 0.35); border-radius: 0; padding: 0.55rem 0; min-height: 2.75rem; transition: border-color 250ms var(--suave); }
.campo input:focus { outline: none; border-bottom-color: var(--oro-oscuro); box-shadow: 0 1px 0 0 var(--oro-oscuro); }
.trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.acepto { display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.75rem; align-items: start; font-size: 0.9375rem; color: var(--tinta); min-height: 2.75rem; cursor: pointer; }
.acepto input { appearance: none; width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; border: 1px solid rgb(30 59 51 / 0.5); border-radius: 0; display: grid; place-items: center; cursor: pointer; transition: background-color 200ms, border-color 200ms; }
.acepto input::after { content: ""; width: 0.55rem; height: 0.55rem; background: var(--marfil); transform: scale(0); transition: transform 200ms var(--suave); }
.acepto input:checked { background: var(--jade); border-color: var(--jade); }
.acepto input:checked::after { transform: scale(1); }
.acepto input:focus-visible { outline: 1px solid var(--oro-oscuro); outline-offset: 3px; }
.acepto a { color: var(--oro-texto); text-underline-offset: 0.2em; }
button { font: inherit; font-weight: 400; font-size: 0.75rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--beige); background: var(--jade); border: 1px solid var(--jade); border-radius: 0; min-height: 3.5rem; padding: 0 1.5rem; cursor: pointer; transition: background-color 250ms var(--suave), letter-spacing 300ms var(--suave); }
button:hover { background: var(--jade-claro); letter-spacing: 0.36em; }
button:disabled { opacity: 0.6; cursor: default; }
.mensaje-error { color: #7a1f1f; font-size: 0.9375rem; }
.mensaje-error:empty { display: none; }
.aviso-sinjs { display: none; margin-top: 1.5rem; color: #7a1f1f; }
[data-estado-registro="error"] .aviso-error, [data-estado-registro="espera"] .aviso-espera { display: block; }

.bienvenida { display: none; text-align: center; padding: 1rem 0; }
.bienvenida:focus { outline: none; }
.bienvenida-linea { display: block; width: 64px; height: 1px; margin: 0 auto 2rem; background: var(--oro-oscuro); }
.bienvenida-titulo { font-family: var(--titulo); font-size: clamp(2.1rem, 8vw, 3rem); line-height: 1.1; margin-bottom: 1rem; }
.bienvenida .texto { margin: 0 auto; }
[data-estado-registro="ok"] .formulario-bloque { display: none; }
[data-estado-registro="ok"] .bienvenida { display: block; animation: aparece 1100ms var(--suave) both; }
[data-estado-registro="ok"] .bienvenida-linea { transform: scaleX(0); animation: linea 1100ms var(--suave) 300ms forwards; }

/* ── Pie ─────────────────────────────────────────────────────────────────── */
.pie { background: var(--jade); color: var(--beige); text-align: center; padding: 6rem 1.5rem calc(3rem + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 1.25rem; }
.pie-logo { width: 9rem; height: auto; }
.pie-frase { font-family: var(--titulo); font-size: 1.35rem; color: rgb(236 226 208 / 0.85); }
.pie-redes { display: flex; gap: 2.5rem; margin-top: 1.25rem; }
.pie-redes a, .pie-datos a { text-decoration: none; position: relative; }
.pie-redes a { font-weight: 400; font-size: 0.6875rem; letter-spacing: 0.32em; text-transform: uppercase; padding: 0.75rem 0; }
.pie-redes a::after, .pie-datos a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.4rem; height: 1px; background: var(--oro); transform: scaleX(0); transition: transform 250ms var(--suave); }
.pie-redes a:hover::after, .pie-datos a:hover::after { transform: scaleX(1); }
.pie-datos { font-size: 0.9375rem; color: rgb(236 226 208 / 0.82); }
.pie-datos a { display: inline-block; padding: 0.6rem 0; }
.pie-ia { margin-top: 1.5rem; font-size: 0.8125rem; color: rgb(236 226 208 / 0.72); }

/* Cursor discreto (solo escritorio con mouse): un aro dorado que sigue con calma. */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; position: fixed; left: 0; top: 0; z-index: 70; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 1px solid rgb(201 162 77 / 0.75);
    border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity 300ms var(--suave), width 250ms var(--suave), height 250ms var(--suave), margin 250ms var(--suave); }
  .cursor.activo { opacity: 1; }
  .cursor.sobre { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
}

/* Aparición al hacer scroll (solo con JavaScript: sin JS todo se ve). */
@media (scripting: enabled) {
  .revela { opacity: 0; transform: translateY(24px); transition: opacity 1100ms var(--suave), transform 1100ms var(--suave); }
  .revela.visible { opacity: 1; transform: none; }
  .escena-regla.revela { transform: scaleX(0); }
  .escena-regla.revela.visible { transform: scaleX(1); }
  .escena-texto .revela:nth-child(2) { transition-delay: 120ms; }
  .escena-texto .revela:nth-child(3) { transition-delay: 320ms; }
  .escena-texto .revela:nth-child(4) { transition-delay: 420ms; }
  .revela-foto img { transform: scale(1.08); opacity: 0; transition: transform 1800ms var(--suave), opacity 1200ms var(--suave); }
  .revela-foto.visible img { transform: scale(1); opacity: 1; }
}

/* Movimiento reducido: sin intro, sin video, todo aparece quieto. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .telon, .cursor { display: none !important; }
  .linea > span { transform: none; animation: none; }
  .revela, .revela-foto img, .escena-regla.revela { opacity: 1 !important; transform: none !important; transition: none !important; }
  .portada-video { display: none; }
  [data-estado-registro="ok"] .bienvenida, [data-estado-registro="ok"] .bienvenida-linea { animation: none; transform: none; }
}

/* ── Aviso de privacidad ─────────────────────────────────────────────────── */
.aviso h1 { font-size: clamp(2.25rem, 8vw, 3.25rem); line-height: 1.08; margin: 1.5rem 0 2rem; }
.aviso h2 { font-size: 1.6rem; margin: 2.5rem 0 0.75rem; }
.aviso .texto a { color: var(--oro-texto); }
.volver { display: inline-block; text-decoration: none; padding: 0.75rem 0; }
