/* ═══════════════════════════════════════════════════════════════════
   DEMIN EXPERIENCE ENGINE — el espacio donde ocurre la experiencia
   Dirección de arte: docs/experiencias/001-respirar-las-inseguridades/
   MASTER_EXPERIENCE_SHEET.md §09 · Design System V2 · Motion System V1 ·
   Assets Guidelines v2 · referencia de sensación: Canva Respirando Con-ciencia.

   · Tono oscuro para sentir y practicar; papel crema para comprender.
   · Tipografía como imagen: Bricolage Grotesque (HERO) + DM Sans (SUPPORT, WHISPER).
   · Un compositor por tipo de momento (data-type) y una composición móvil propia.
   · Movimiento SOLO bajo html.has-motion, y solo transform / opacity / filter /
     clip-path. Cada animación responde a un estado (ver MOTION_MAP.md).
   ═══════════════════════════════════════════════════════════════════ */

.xp {
  --x-dark: #1C1A18; --x-cream: #F2EDE4; --x-gold: #C9A84C; --x-gold-ink: #94700F;
  --x-display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --x-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --x-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --x-breath: cubic-bezier(0.45, 0, 0.55, 1);
  --x-pad-x: clamp(22px, 7vw, 132px);
  --x-pad-y: clamp(28px, 8vh, 96px);
  position: fixed; inset: 0; z-index: 30;
  background: var(--x-dark); color: var(--x-cream);
  font-family: var(--x-sans);
  overflow: hidden; outline: none;
}
.xp[hidden] { display: none; }
body.is-playing { overflow: hidden; }

/* ─── Escenario y momentos ─────────────────────────────────────── */
.xp-stage { position: absolute; inset: 0; }
.xm {
  --ink: var(--x-cream); --muted: rgba(242, 237, 228, 0.7); --quiet: rgba(242, 237, 228, 0.56);
  --accent: var(--x-gold); --line: rgba(201, 168, 76, 0.34);
  position: absolute; inset: 0;
  display: grid; grid-template-rows: 1fr auto;
  padding: var(--x-pad-y) var(--x-pad-x) calc(var(--x-pad-y) + 40px);
  background: var(--x-dark); color: var(--ink);
  opacity: 0; visibility: hidden;
}
.xm[data-tone="paper"] {
  --ink: var(--x-dark); --muted: rgba(28, 26, 24, 0.74); --quiet: rgba(28, 26, 24, 0.62);
  --accent: var(--x-gold-ink); --line: rgba(148, 112, 15, 0.4);
  background: var(--x-cream);
}
.xm.is-active { opacity: 1; visibility: visible; z-index: 2; }
.xm.is-past { z-index: 1; }
/* Luz ambiental mínima (DESIGN.md: radial ≤ 0.06). */
.xm::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(55% 55% at 50% 48%, rgba(201, 168, 76, 0.05), transparent 70%); }
.xm[data-tone="paper"]::before { background: none; }

.xm-body { position: relative; z-index: 1; align-self: center; display: flex; flex-direction: column; min-width: 0; }
.xm-foot { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.xm[data-comp="center"] .xm-body, .xm[data-comp="center"] .xm-foot { align-items: center; text-align: center; }
.xm[data-comp="left"] .xm-body { align-items: flex-start; max-width: min(60vw, 980px); }
.xm[data-comp="right"] .xm-body { align-items: flex-end; text-align: right; margin-left: auto; max-width: min(60vw, 980px); }
.xm[data-comp="type-bleed"] .xm-body { align-self: end; margin-bottom: 8vh; }

/* ─── Tipografía: HERO · SUPPORT · WHISPER ─────────────────────── */
.xm-hero {
  margin: 0; font-family: var(--x-display); font-weight: 500; letter-spacing: -0.03em;
  font-size: clamp(2.5rem, 6.4vw, 6.4rem); line-height: 1; text-wrap: balance; max-width: 16ch;
  font-variation-settings: "opsz" 96;
}
.xm[data-comp="type-bleed"] .xm-hero { font-size: clamp(3.6rem, 13.5vw, 15rem); line-height: 0.9; letter-spacing: -0.045em; max-width: 9ch; font-weight: 600; }
.xm-support { margin: 0.9em 0 0; font-size: clamp(1.15rem, 2.1vw, 1.75rem); line-height: 1.35; color: var(--muted); max-width: 30ch; }
.xm-whisper { margin: 0; font-style: italic; font-size: clamp(0.95rem, 1.3vw, 1.1rem); line-height: 1.5; color: var(--quiet); max-width: 46ch; }
.xm-question { margin: 0; font-family: var(--x-display); font-weight: 400; letter-spacing: -0.025em; font-size: clamp(2.2rem, 5.4vw, 5.2rem); line-height: 1.05; text-wrap: balance; max-width: 17ch; font-variation-settings: "opsz" 96; }
.xm-question--integration { font-size: clamp(2rem, 4.6vw, 4.2rem); }
.xm-phase { margin: 0; font-family: var(--x-display); font-weight: 300; letter-spacing: -0.02em; font-size: clamp(2rem, 5vw, 4.4rem); line-height: 1.05; }
.xm-invite { margin: 0 0 1.4em; font-size: clamp(1.05rem, 1.7vw, 1.4rem); color: var(--muted); max-width: 38ch; }
.xm-steps { display: flex; flex-direction: column; gap: 0.18em; }
.xm-step { margin: 0; font-family: var(--x-display); font-weight: 400; letter-spacing: -0.02em; font-size: clamp(1.9rem, 4.4vw, 4rem); line-height: 1.08; }
.xm-steps--quiet .xm-step { font-weight: 300; font-size: clamp(1.4rem, 3vw, 2.6rem); color: var(--muted); }
.xm-ask { margin: 1.1em 0 0; font-style: italic; font-size: clamp(1.25rem, 2.2vw, 1.8rem); color: var(--accent); }
.xm-final { margin: 1.6em 0 0; font-style: italic; font-size: clamp(1.1rem, 1.9vw, 1.55rem); line-height: 1.4; color: var(--muted); max-width: 34ch; }
.xm[data-comp="center"] .xm-final, .xm[data-comp="center"] .xm-support { margin-inline: auto; }

/* REVEAL · sequence: una línea a la vez, en el mismo lugar. */
.xm-reveal--sequence { display: grid; }
.xm-reveal--sequence .xm-beat { grid-area: 1 / 1; font-family: var(--x-display); font-weight: 400; letter-spacing: -0.025em; font-size: clamp(2rem, 5vw, 4.6rem); line-height: 1.08; max-width: 17ch; text-wrap: balance; }
.xm-reveal--sequence .xm-beat.is-in:not(.is-now) { opacity: 0 !important; }
/* REVEAL · accumulate: las palabras se suman, separadas por el punto dorado. */
.xm-reveal--accumulate { display: flex; flex-wrap: wrap; row-gap: 0.1em; font-family: var(--x-display); font-weight: 400; letter-spacing: -0.02em; font-size: clamp(1.8rem, 4.8vw, 4.4rem); line-height: 1.15; max-width: 20ch; }
.xm[data-comp="center"] .xm-reveal--accumulate { justify-content: center; margin-inline: auto; }
/* El punto va DESPUÉS de cada palabra: al partirse la línea, ninguna empieza con "·". */
.xm-reveal--accumulate .xm-beat:not(:last-child)::after { content: "·"; color: var(--accent); margin: 0 0.35em; }

/* SCIENCE: concepto → cadena → experiencia (DS V2 §9). */
.xm-hero--science { font-size: clamp(2.1rem, 4.6vw, 4.4rem); max-width: 18ch; }
.xm-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 0; margin-top: clamp(28px, 6vh, 64px); }
.xm-hop { display: inline-flex; align-items: center; white-space: nowrap; }
.xm-node { font-family: var(--x-display); font-weight: 400; font-size: clamp(1.1rem, 1.9vw, 1.7rem); letter-spacing: -0.01em; }
.xm-link { position: relative; display: inline-block; width: clamp(28px, 4vw, 64px); height: 1px; margin: 0 14px; background: var(--accent); }
.xm-link::after { content: ""; position: absolute; right: -1px; top: -3px; width: 7px; height: 7px; border-top: 1px solid var(--accent); border-right: 1px solid var(--accent); transform: rotate(45deg); }

/* BODY: el cuerpo protagonista; la palabra, pequeña a su lado. */
.xm-hero--body { font-size: clamp(3rem, 8.5vw, 8.4rem); font-weight: 600; }
.xm-words { margin: 0.6em 0 0; font-family: var(--x-display); font-size: clamp(1.2rem, 2vw, 1.7rem); color: var(--muted); }
.xm-words i { color: var(--accent); font-style: normal; }

/* CONTRAST: dos lugares y el paso entre ellos. */
.xm-contrast { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0.2em 0.5em; font-family: var(--x-display); letter-spacing: -0.025em; font-size: clamp(2rem, 4.8vw, 4.8rem); line-height: 1.06; text-align: center; max-width: 24ch; margin-inline: auto; }
.xm[data-comp="left"] .xm-contrast { justify-content: flex-start; text-align: left; margin-inline: 0; }
.xm-pole { margin: 0; text-wrap: balance; }
.xm-pole--a { font-weight: 400; }
.xm-pole--b { font-weight: 500; }
.xm-symbol { color: var(--accent); font-family: var(--x-sans); font-weight: 300; }
.xm-contrast--morph { flex-direction: column; align-items: center; gap: 0.3em; }
.xm-contrast--morph .xm-symbol { transform: rotate(90deg); font-size: 0.7em; }

/* INTEGRATION */
.xm-options { display: flex; flex-direction: column; gap: 10px; margin-top: clamp(24px, 5vh, 48px); width: min(100%, 26rem); }
.xm-option { min-height: 52px; padding: 12px 24px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--ink); font: 16px var(--x-sans); text-align: left; cursor: pointer; }
.xm-option:hover { border-color: var(--accent); }
.xm-option[aria-pressed="true"] { background: var(--x-gold); border-color: var(--x-gold); color: var(--x-dark); }
.xm-option:focus-visible, .xm-door:focus-visible, .xm-learn__btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.xm-closing { margin: 26px 0 0; font-style: italic; font-size: clamp(1.1rem, 1.8vw, 1.45rem); line-height: 1.4; color: var(--muted); max-width: 30ch; }
.xm-closing[hidden] { display: none; }
.xm-map { list-style: none; margin: clamp(24px, 5vh, 48px) 0 0; padding: 0; width: min(100%, 62rem); display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
.xm-map li { border-top: 1px solid var(--line); }
.xm-door { display: grid; grid-template-columns: 36px minmax(0, 1fr) 24px; column-gap: 10px; align-items: baseline; width: 100%; min-height: 48px; padding: 12px 0; border: 0; background: none; color: var(--muted); text-align: left; font: inherit; cursor: pointer; }
.xm-door__n { font-size: 12px; letter-spacing: 0.12em; }
.xm-door__q { font-family: var(--x-display); font-size: 1.1rem; line-height: 1.3; }
.xm-door:hover .xm-door__q, .xm-door[aria-current="true"] { color: var(--ink); }
.xm-door[aria-current="true"] .xm-door__n { color: var(--accent); }
.xm-state { align-self: center; color: var(--accent); }
.xm-state svg, .xp svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.xm-state svg { width: 18px; height: 18px; }
.xm-state .fill { fill: currentColor; stroke: none; }

/* Contraindicaciones incluidas desde la fuente única. */
.xm-include { margin-top: clamp(20px, 4vh, 40px); }
.xm-contra { list-style: none; margin: 0; padding: 0; font-family: var(--x-display); font-size: clamp(1.1rem, 1.9vw, 1.6rem); line-height: 1.45; max-width: 40ch; }
.xm-contra li { display: inline; }
.xm-contra li:not(:last-child)::after { content: " · "; color: var(--accent); }
.xm-contra__care { margin: 14px 0 0; font-size: 15px; color: var(--muted); max-width: 46ch; }

/* Referencias a microclases: una línea, no una tarjeta. */
.xm-learn { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; color: var(--quiet); }
.xm-learn > span { font-style: italic; margin-right: 4px; }
.xm-learn i { color: var(--accent); font-style: normal; }
.xm-learn__btn { min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font: 15px var(--x-sans); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; }
.xm-learn__btn:hover { text-decoration-color: var(--accent); }

/* ─── Portada / sala de espera: la misma del hub (M00 · core:bienvenida) ───
   Excepción tipográfica deliberada: es la identidad de marca, así que usa
   exactamente el hub (Playfair 400 · 0.06em · declaración en itálica). */
.xm-brand { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.xm-brand__halo { position: absolute; left: 50%; top: 58%; width: min(680px, 94vw); aspect-ratio: 1; transform: translate(-50%, -50%); color: var(--x-gold); pointer-events: none; }
.xm-brand__halo svg { width: 100%; height: 100%; overflow: visible; }
.xm-brand__halo circle { fill: none; stroke: currentColor; stroke-width: 0.35; }
.xm-brand__halo circle:nth-child(1) { opacity: 0.18; }
.xm-brand__halo circle:nth-child(2) { opacity: 0.12; }
.xm-brand__halo circle:nth-child(3) { opacity: 0.08; }
.xm-brand__title { position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; font-family: 'Playfair Display', Georgia, serif; font-weight: 400; font-size: clamp(2.6rem, 9.5vw, 6.25rem); line-height: 0.98; letter-spacing: 0.06em; padding-left: 0.06em; color: var(--x-cream); }
.xm-brand__lines { position: relative; margin: clamp(1.5rem, 4vh, 2.5rem) 0 0; display: flex; flex-direction: column; gap: 0.15em; font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: clamp(1.2rem, 3.6vw, 1.625rem); color: var(--muted); }
.xm-brand__lines span:last-child { color: var(--x-cream); }
/* El ojo animado: el negro del video desaparece sobre el oscuro (screen); queda la línea dorada. */
.xm-video { position: relative; margin: 0 0 clamp(8px, 2vh, 20px); width: clamp(110px, 13vw, 180px); aspect-ratio: 1; }
.xm-video video { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: screen; background: #000; }
/* Trampa: mix-blend-mode mezcla dentro de su contexto de apilamiento. .xm-body crea uno (z-index: 1)
   y ahí el fondo es transparente, así que el negro del video se veía como un cuadro. En la portada
   .xm-body no crea contexto: el video se mezcla con el fondo real del momento. */
.xm-body:has(.xm-video) { z-index: auto; }
.xm[data-comp="center"] .xm-foot:has(.xm-countdown) { align-items: center; }
.xm-countdown { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.xm-countdown__label { font-style: italic; font-size: clamp(1rem, 1.6vw, 1.25rem); color: var(--x-gold); }
.xm-countdown__time { font-family: var(--x-sans); font-weight: 300; font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; color: var(--x-cream); }
.xm-countdown.is-done .xm-countdown__label { visibility: hidden; }
@media (max-width: 760px) {
  .xm-brand__title { font-size: clamp(2.2rem, 11.5vw, 3.4rem); }
  .xm-brand__halo { top: 60%; width: 118vw; }
}

/* ─── Assets A01–A10: posición · escala · opacidad (nunca se editan) ── */
.xm-asset { position: absolute; z-index: 0; margin: 0; width: calc(var(--s) * 100vw); max-width: 1100px; opacity: var(--o); pointer-events: none; }
.xm-asset img { display: block; width: 100%; height: auto; max-height: 88vh; object-fit: contain; }
.xm-asset--center { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.xm-asset--right { right: 5vw; top: 50%; transform: translateY(-50%); }
.xm-asset--left { left: 5vw; top: 50%; transform: translateY(-50%); }
.xm-asset--bleed { right: -6vw; top: 50%; transform: translateY(-50%); }
.xm-asset--top { left: 50%; top: 10vh; transform: translateX(-50%); }

/* ─── Controles: aparecen y se van ─────────────────────────────── */
.xp-chrome { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; }
.xp.is-awake .xp-chrome, .xp:focus-within .xp-chrome:focus-within { opacity: 1; }
.xp.is-awake .xp-chrome > * { pointer-events: auto; }
.xp-exit { position: absolute; top: max(16px, env(safe-area-inset-top)); right: var(--x-pad-x); min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(242, 237, 228, 0.28); background: rgba(28, 26, 24, 0.55); color: var(--x-cream); font: 13px var(--x-sans); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.xp-ctl { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 10px; padding: 6px; border-radius: 999px; background: rgba(28, 26, 24, 0.55); }
.xp-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(242, 237, 228, 0.24); background: none; color: var(--x-cream); cursor: pointer; }
.xp-btn svg, .xp-safe svg { width: 20px; height: 20px; }
.xp-btn--next { background: var(--x-gold); border-color: var(--x-gold); color: var(--x-dark); }
.xp-btn[aria-pressed="true"] { border-color: var(--x-gold); color: var(--x-gold); }
.xp-btn:focus-visible, .xp-exit:focus-visible, .xp-safe:focus-visible, .xp-pill:focus-visible, .xp-link:focus-visible { outline: 2px solid var(--x-cream); outline-offset: 3px; }
/* Seguridad: siempre presente, casi transparente. */
.xp-safe { position: absolute; z-index: 6; left: max(14px, calc(var(--x-pad-x) - 14px)); bottom: max(18px, env(safe-area-inset-bottom)); display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(242, 237, 228, 0.22); background: none; color: var(--x-cream); opacity: 0.42; cursor: pointer; }
.xp-safe:hover, .xp.is-awake .xp-safe { opacity: 1; }
.xp[data-tone="paper"] .xp-safe { color: var(--x-dark); border-color: rgba(28, 26, 24, 0.3); }
.xp[data-tone="paper"] .xp-exit, .xp[data-tone="paper"] .xp-ctl { background: rgba(242, 237, 228, 0.8); }
.xp[data-tone="paper"] .xp-exit, .xp[data-tone="paper"] .xp-btn:not(.xp-btn--next) { color: var(--x-dark); border-color: rgba(28, 26, 24, 0.28); }

/* Subtítulos: el guion de voz, opcional. */
.xp-caption { position: absolute; z-index: 4; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(92vw, 62ch); margin: 0; padding: 10px 16px; border-radius: 8px; background: rgba(28, 26, 24, 0.82); color: var(--x-cream); font-size: 17px; line-height: 1.45; text-align: center; }
.xp-caption[hidden] { display: none; }

/* Capas: seguridad y pausa. */
.xp-layer, .xp-error { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: var(--x-pad-y) var(--x-pad-x); background: var(--x-dark); color: var(--x-cream); }
.xp-layer[hidden], .xp-error[hidden] { display: none; }
.xp-layer__in { max-width: 36rem; }
.xp-layer .xm-hero { font-size: clamp(2.2rem, 5vw, 4.2rem); }
.xp-safe-list { list-style: none; margin: 24px 0; padding: 0; font-family: var(--x-display); font-size: clamp(1.4rem, 3vw, 2.2rem); line-height: 1.3; }
.xp-layer .xm-whisper { color: rgba(242, 237, 228, 0.66); }
.xp-layer__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 32px; }
.xp-pill { min-height: 52px; min-width: 220px; padding: 0 28px; border-radius: 999px; border: 0; background: var(--x-gold); color: var(--x-dark); font: 500 16px var(--x-sans); cursor: pointer; }
.xp-link { min-height: 44px; padding: 0; border: 0; background: none; color: var(--x-cream); font: 15px var(--x-sans); text-decoration: underline; text-decoration-color: rgba(242, 237, 228, 0.4); text-underline-offset: 5px; cursor: pointer; }
.xp-layer__note { margin: 28px 0 0; font-size: 13px; color: rgba(242, 237, 228, 0.6); }
.xp-error ul { font-size: 14px; color: #F0B98A; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Móvil: intimidad, verticalidad, un foco por pantalla ─────── */
@media (max-width: 760px) {
  .xp { --x-pad-x: 22px; --x-pad-y: 56px; }
  .xm[data-comp="left"] .xm-body, .xm[data-comp="right"] .xm-body { max-width: none; align-items: flex-start; text-align: left; margin-left: 0; }
  .xm-asset { width: calc(var(--sm) * 100vw); opacity: var(--om); }
  .xm-asset--m-center { left: 50%; right: auto; top: 50%; transform: translate(-50%, -50%); }
  .xm-asset--m-top { left: 50%; right: auto; top: 7vh; transform: translateX(-50%); }
  .xm-asset--m-bleed { right: -18vw; left: auto; top: 46%; transform: translateY(-50%); }
  .xm-hero { max-width: 13ch; }
  .xm[data-comp="type-bleed"] .xm-hero { font-size: clamp(3.4rem, 19vw, 6rem); }
  .xm-chain { flex-direction: column; align-items: flex-start; gap: 0; }
  .xm-hop { flex-direction: column; align-items: flex-start; white-space: normal; }
  .xm-link { width: 1px; height: 26px; margin: 8px 0 8px 10px; }
  .xm-link::after { right: -3px; top: auto; bottom: -1px; transform: rotate(135deg); }
  .xm-contrast { flex-direction: column; align-items: flex-start; text-align: left; margin-inline: 0; }
  .xm[data-comp="center"] .xm-contrast { align-items: center; text-align: center; margin-inline: auto; }
  .xm-contrast:not(.xm-contrast--morph) .xm-symbol { transform: rotate(90deg); font-size: 0.7em; }
  .xm-map { grid-template-columns: 1fr; }
  /* Las preguntas de las capas (2026-10-10) son más largas: nueve caben en un celular. */
  .xm-map .xm-door { min-height: 44px; padding: 6px 0; }
  .xm-door__q { font-size: 0.95rem; line-height: 1.25; }
  .xp-ctl { gap: 6px; }
  .xp-btn { width: 44px; height: 44px; }
  .xp-btn--full { display: none; }
  .xp-caption { bottom: 84px; font-size: 16px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .xm-map .xm-door { min-height: 44px; padding: 8px 0; }
}

/* ═══ MOVIMIENTO ═══════════════════════════════════════════════════
   Estados, no decoración (MOTION_MAP.md):
   · entrada del momento: REVEAL (escalonado) · PAUSE (en bloque, lento) · MORPH (de un estado a otro)
   · transición entre momentos: FLOW (fundido) · PAUSE (oscuridad breve) · MORPH (papel que emerge)
   · beats: REVEAL de cada paso con →
   · loop BREATH solo donde el momento lo declara con una razón (M01)
   ═══════════════════════════════════════════════════════════════ */
[data-beat] { opacity: 0; }
[data-beat].is-in { opacity: 1; }

html.has-motion .xp { transition: opacity 500ms var(--x-ease); }
html.has-motion .xp:not(.is-open) { opacity: 0; }
html.has-motion .xp.is-open { animation: xp-open 900ms var(--x-ease) backwards; }
@keyframes xp-open { from { clip-path: circle(0% at 50% 100%); } to { clip-path: circle(150% at 50% 100%); } }

/* Transiciones entre momentos: la declara el momento que se va. */
html.has-motion .xm { transition: opacity 900ms var(--x-ease), visibility 0s linear 900ms; }
html.has-motion .xm.is-active { transition: opacity 1100ms var(--x-ease), visibility 0s; }
html.has-motion .xm.is-active[data-in="PAUSE"] { transition: opacity 1400ms var(--x-ease) 900ms, visibility 0s; }
html.has-motion .xm.is-active[data-in="MORPH"] { animation: xm-morph 1300ms var(--x-ease) backwards; }
@keyframes xm-morph { from { clip-path: circle(0% at 50% 55%); } to { clip-path: circle(150% at 50% 55%); } }

/* Entrada de los elementos del momento. */
html.has-motion .xm.is-active .xr { animation: xm-reveal 1100ms var(--x-ease) backwards; animation-delay: calc(350ms + var(--i, 0) * 480ms); }
html.has-motion .xm.is-active[data-slow] .xr { animation-duration: 2200ms; animation-delay: calc(700ms + var(--i, 0) * 600ms); }
html.has-motion .xm.is-active[data-enter="PAUSE"] .xr { animation: xm-fade 1800ms var(--x-ease) backwards 500ms; }
html.has-motion .xm.is-active[data-enter="MORPH"] .xr { animation: xm-morph-in 1800ms var(--x-ease) backwards 300ms; }
html.has-motion .xm.is-active .xm-asset { animation: xm-fade 2200ms var(--x-ease) backwards 200ms; }
html.has-motion .xm.is-active .xm-foot { animation: xm-fade 1400ms var(--x-ease) backwards 1400ms; }
html.has-motion [data-beat] { transform: translateY(14px); filter: blur(4px); transition: opacity 900ms var(--x-ease), transform 900ms var(--x-ease), filter 900ms var(--x-ease); }
html.has-motion [data-beat].is-in { transform: none; filter: none; }
/* En la cadena de ciencia, la flecha se traza (MORPH) y el concepto aparece después. */
html.has-motion .xm-hop[data-beat] .xm-link { transform: scaleX(0); transform-origin: 0 50%; transition: transform 700ms var(--x-ease); }
html.has-motion .xm-hop[data-beat].is-in .xm-link { transform: none; }
@media (max-width: 760px) { html.has-motion .xm-hop[data-beat] .xm-link { transform: scaleY(0); transform-origin: 50% 0; } html.has-motion .xm-hop[data-beat].is-in .xm-link { transform: none; } }
html.has-motion .xm-contrast--morph .xm-pole--a { transition: opacity 1200ms var(--x-ease), filter 1200ms var(--x-ease); }
.xm-contrast--morph:has(.xm-pole--b.is-in) .xm-pole--a { opacity: 0.4; }
/* BREATH: solo donde el momento lo declara (M01: el espacio respira al llegar). */
html.has-motion .xm.is-active[data-loop="BREATH"] .xm-asset img { animation: xm-breath 8s var(--x-breath) infinite 2.4s; transform-origin: center; }
/* M00: el halo de la portada respira como en el hub (por qué: el umbral espera, no marca ritmo). */
html.has-motion .xm.is-active[data-loop="BREATH"] .xm-brand__halo svg { animation: xm-breath 6s var(--x-breath) infinite 2.6s; transform-origin: center; }
/* PULSE al elegir una respuesta de integración. */
html.has-motion .xm-option[aria-pressed="true"] { animation: xm-pulse 700ms var(--x-ease); }
html.has-motion .xp-chrome { transition: opacity 500ms var(--x-ease); }
html.has-motion .xp-btn, html.has-motion .xp-pill { transition: transform 200ms var(--x-ease); }
html.has-motion .xp-btn:hover, html.has-motion .xp-pill:hover { transform: scale(1.04); }
html.has-motion .xp-btn:active, html.has-motion .xp-pill:active { transform: scale(0.97); }
html.has-motion .xp-layer:not([hidden]) .xp-layer__in { animation: xm-reveal 700ms var(--x-ease) backwards; }

@keyframes xm-reveal { from { opacity: 0; transform: translateY(20px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes xm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes xm-morph-in { from { opacity: 0; filter: blur(14px); transform: scale(0.985); } to { opacity: 1; filter: none; transform: none; } }
@keyframes xm-breath { 0%, 100% { transform: scale(0.96); } 50% { transform: scale(1); } }
@keyframes xm-pulse { 50% { transform: scale(1.025); } }

/* ═══ CONSOLA DEL FACILITADOR (?consola) — laptop-first ════════════ */
body.is-consola { overflow: auto; background: #14120F; }
.xc { min-height: 100vh; padding: 20px 28px; color: #F2EDE4; font-family: 'DM Sans', system-ui, sans-serif; }
.xc[hidden] { display: none; }
.xc-head { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline; padding-bottom: 14px; border-bottom: 1px solid rgba(201, 168, 76, 0.3); }
.xc-title { margin: 0; font-size: 18px; }
.xc-conn, .xc-clock { margin: 0; font-size: 14px; color: rgba(242, 237, 228, 0.7); }
.xc-clock strong { font-size: 20px; color: #C9A84C; font-variant-numeric: tabular-nums; }
.xc-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 32px; margin-top: 18px; }
.xc h2 { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: #C9A84C; margin: 22px 0 8px; }
.xc h3 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: #E3C988; margin: 18px 0 6px; }
.xc-meta { margin: 0 0 6px; font-size: 13px; color: rgba(242, 237, 228, 0.7); }
.xc-func { margin: 0 0 12px; font-size: 15px; }
.xc-func em { color: rgba(242, 237, 228, 0.66); }
.xc-script p { margin: 0 0 10px; font-size: 22px; line-height: 1.4; color: rgba(242, 237, 228, 0.62); }
.xc-script p.is-now { color: #F2EDE4; }
.xc ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; }
.xc-avoid li { color: #F0B98A; }
.xc-lv { display: inline-block; min-width: 18px; text-align: center; border-radius: 3px; font-size: 11px; background: #C9A84C; color: #1C1A18; }
.xc-lv--M { background: #9DC7B4; } .xc-lv--S { background: #E3C988; } .xc-lv--I { background: #F0B98A; }
.xc small { color: rgba(242, 237, 228, 0.6); }
.xc-dur { font-size: 14px; }
.xc-first { font-style: italic; color: rgba(242, 237, 228, 0.7); }
.xc button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(242, 237, 228, 0.3); background: none; color: #F2EDE4; font: 14px 'DM Sans', sans-serif; cursor: pointer; }
.xc button:disabled { opacity: 0.35; cursor: default; }
.xc button.is-suggested { border-color: #C9A84C; color: #C9A84C; }
.xc-cues, .xc-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.xc-nav { margin-top: 20px; }
.xc-list { list-style: none; margin: 0; padding: 0; max-height: 36vh; overflow: auto; }
.xc-list button { width: 100%; min-height: 34px; border: 0; border-radius: 6px; text-align: left; font-size: 13px; }
.xc-list button span { color: #C9A84C; margin-right: 6px; }
.xc-list button em { color: rgba(242, 237, 228, 0.5); }
.xc-list button.is-now { background: rgba(201, 168, 76, 0.18); }
.xc .pending { color: #F0B98A; }
