/* Marcos de iPhone 16 Pro y iPad Pro 11 con capturas reales de la app adentro. */
:root { --device: #1b2124; --device-edge: #3a4347; }
.iphone, .ipad { position: relative; background: var(--device); box-shadow: 0 0 0 2px var(--device-edge), 0 40px 80px rgba(0, 0, 0, .3); cursor: pointer; }
.iphone { width: 300px; max-width: 100%; padding: 10px; border-radius: 52px; }
.screen, .ipad-screen { overflow: hidden; background: #F9F9F9; }
.screen { border-radius: 43px; aspect-ratio: 1206 / 2622; }
.screen img, .ipad-screen img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ipad { width: min(100%, calc((100vh - 140px) * 1.42)); padding: clamp(10px, 2vw, 16px); border-radius: clamp(26px, 4vw, 40px); }
.ipad-screen { border-radius: clamp(16px, 2.6vw, 26px); aspect-ratio: 2420 / 1668; }

/* Recorrido de pantallas bajo cada dispositivo */
.flow { display: grid; justify-items: center; gap: 4px; margin-top: 20px; }
.flow-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 320px; }
.flow-steps button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.flow-steps button[aria-current="step"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.flow .hint { margin-top: 6px; }

/* Reproductor dentro del teléfono del hero: deja claro que la historia se puede escuchar. */
.screen { position: relative; }
.player { position: absolute; left: 12px; right: 12px; bottom: 14px; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: rgba(30, 42, 47, .93); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 22px rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.player:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.player-play { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--coral); position: relative; }
.player-play::after { content: ""; position: absolute; left: 14px; top: 10px; border-left: 12px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.player[aria-pressed="true"] .player-play::after { left: 12px; top: 11px; width: 4px; height: 14px; border: 0; background: #fff; box-shadow: 7px 0 0 #fff; }
.player-meta { flex: 1; min-width: 0; display: grid; gap: 6px; }
.player-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.1; }
.player-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.player-bar i { display: block; height: 100%; width: 0; background: var(--gold); }
.player-time { flex: none; font-variant-numeric: tabular-nums; font-size: 12px; opacity: .85; }

/* Botón principal "Escucha esta historia": grande, con pulso hasta el primer play. */
.hero-device .listen { margin-top: 22px; padding: 15px 28px 15px 18px; font-size: 18px; gap: 12px; }
.hero-device .listen .listen-ic { width: 32px; height: 32px; }
.hero-device .listen .listen-ic::after { left: 12px; top: 8px; border-left-width: 11px; border-top-width: 8px; border-bottom-width: 8px; }
.hero-device .listen[aria-pressed="true"] .listen-ic::after { left: 10px; top: 10px; width: 4px; height: 12px; box-shadow: 7px 0 0 var(--coral); }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(250, 84, 87, .55); } 70% { box-shadow: 0 0 0 16px rgba(250, 84, 87, 0); } 100% { box-shadow: 0 0 0 0 rgba(250, 84, 87, 0); } }
.hero-device:not(.played) .listen, .hero-device:not(.played) .player-play { animation: pulse-ring 2.2s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .hero-device:not(.played) .listen, .hero-device:not(.played) .player-play { animation: none; } }
.hero-device .flow .hint { background: var(--bg); padding: 3px 12px; border-radius: 999px; }

/* Enlace del hero: prueba una historia narrada. */
.try { justify-self: start; display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 2px 0; font: inherit; font-size: 16px; font-weight: 700; color: var(--fg); cursor: pointer; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--coral); }
.try .listen-ic { flex: none; background: var(--coral); }
.try .listen-ic::after { border-left-color: #fff; }

/* Lector en vivo (lector.js): el texto sigue a la narración como en la app. Colores fijos: es la pantalla de la app en claro. */
.player { z-index: 3; }
.reader { position: absolute; inset: 0; z-index: 2; background: #FBF8F3; color: #37474F; opacity: 0; visibility: hidden; transition: opacity .25s ease; }
.reader.on { opacity: 1; visibility: visible; }
.reader-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.reader-scroll::-webkit-scrollbar { display: none; }
.reader-in { position: relative; padding: 44px 10px 130px; }
.reader::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 46px; z-index: 1; background: linear-gradient(#FBF8F3 70%, rgba(251, 248, 243, 0)); pointer-events: none; } /* el texto no pasa por detrás de la isla */
.reader-island { position: absolute; top: 10px; left: 50%; width: 88px; height: 25px; margin-left: -44px; border-radius: 14px; background: #000; z-index: 2; }
.rm + .rm { margin-top: 26px; }
.rm img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; background: #efe8dc; }
.rp { margin: 8px 0 0; padding: 7px 9px; border-radius: 10px; font: 400 16px/1.5 Charter, 'Iowan Old Style', Georgia, serif; transition: background-color .35s ease; cursor: pointer; }
.rp.on { background: #E6F7F8; }
.hero-device.session .hint { visibility: hidden; }
