/* Fetal Heart 3D · Paleta clara y tipografía del workshop. */
:root {
  --bg: #fbfbfc; --surface: #ffffff; --ink: #0a0a0c; --text-2: #2b2f37; --muted: #6d7480; --line: #e6e7eb; --line-2: #cfd2d9;
  --accent: #3d5afe; --accent-soft: rgb(61 90 254 / 9%);
  --f-display: "Newsreader", Georgia, serif; --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(20px, 4.2vw, 64px);
  --bar-h: 60px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 20px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.kicker { margin: 0; font: 500 11.5px/1.4 var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }


.bar { position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 var(--gutter); transition: color .35s var(--ease), background .35s var(--ease), border-color .35s var(--ease); border-bottom: 1px solid transparent; }
.bar.solid { background: rgb(251 251 252 / 86%); border-bottom-color: var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.lab { display: inline-flex; align-items: baseline; gap: 9px; font: 600 12px/1 var(--f-mono); letter-spacing: .22em; text-decoration: none; }
.lab b { font-weight: 600; } .lab span { color: var(--accent); }
.bar-r { display: flex; align-items: center; gap: 22px; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 40px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: 600 13px/1 var(--f-body); text-decoration: none; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.pill:hover { background: transparent; color: var(--accent); }
.pill.quiet { background: transparent; color: var(--ink); border-color: var(--line-2); }
.pill.quiet:hover { border-color: var(--accent); color: var(--accent); }
.lab { min-height: 44px; align-items: center; }
.bar-link { display: inline-flex; align-items: center; min-height: 44px; font: 500 12px/1.4 var(--f-mono); color: var(--muted); text-decoration: none; }
.bar-link:hover { color: var(--accent); }
.phone-label { display: none; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- I · Escena fijada y capítulos */
.anat { position: relative; height: calc(8 * 112vh + 100vh); height: calc(8 * 112svh + 100svh); }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage canvas, .stage .poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .poster { object-fit: contain; transition: opacity .6s var(--ease); pointer-events: none; }
.stage .poster.gone { opacity: 0; }
.stage .tags, .pnums { position: absolute; inset: 0; pointer-events: none; }
.tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 7px; white-space: nowrap; font: 500 11px/1 var(--f-mono); letter-spacing: .06em; color: var(--ink); will-change: transform, opacity; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px rgb(255 255 255 / 85%); flex: none; }
.tag.l { flex-direction: row-reverse; }
.tag span { padding: 4px 7px; background: rgb(255 255 255 / 88%); box-shadow: 0 0 0 1px rgb(10 10 12 / 12%); border-radius: 4px; }
.pnum { position: absolute; left: 0; top: 0; font: 600 10.5px/1 var(--f-mono); letter-spacing: .08em; color: var(--accent); background: rgb(255 255 255 / 90%); padding: 3px 5px; border-radius: 3px; box-shadow: 0 0 0 1px rgb(61 90 254 / 35%); will-change: transform, opacity; }

.hero { position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(28px, 6svh, 64px); display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; pointer-events: none; }
.hero .kicker { margin-bottom: 18px; }
.hero h1 { margin: 0; font: 500 clamp(38px, 4.4vw, 66px)/1 var(--f-display); letter-spacing: -.015em; }
.hero h1 em { display: block; margin-top: .14em; font-style: italic; font-weight: 500; font-size: .5em; letter-spacing: -.005em; color: var(--muted); }
.hero .meta { margin: 22px 0 0; font: 500 11.5px/1.6 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.hero .meta i { font-style: normal; color: var(--line-2); padding: 0 .5em; }
.cue { display: grid; justify-items: end; gap: 10px; font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cue::after { content: ""; width: 1px; height: 48px; background: linear-gradient(var(--ink), transparent); transform-origin: top; animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.chap { position: absolute; left: var(--gutter); top: 50%; width: min(31vw, 430px); transform: translateY(-50%); opacity: 0; visibility: hidden; will-change: opacity, transform; }
.chap .n { margin: 0 0 16px; font: 500 11.5px/1 var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.chap .n span { color: var(--muted); }
.chap h2 { margin: 0 0 16px; font: 500 clamp(30px, 3.1vw, 46px)/1.08 var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.chap p { margin: 0; font-size: 16px; line-height: 1.62; color: var(--text-2); max-width: 40ch; }
.chap .src { margin-top: 14px; font: 400 11.5px/1.5 var(--f-mono); color: var(--muted); }
.yagel { list-style: none; margin: 20px 0 0; padding: 0; border-top: 1px solid var(--line); }
.yagel li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text-2); transition: color .3s var(--ease), opacity .3s var(--ease); opacity: .35; }
.yagel li.on { opacity: 1; color: var(--ink); }
.yagel li b { font: 600 11px/1.9 var(--f-mono); color: var(--accent); }

.info { position: absolute; left: var(--gutter); top: 50%; width: min(36vw, 500px); transform: translateY(-50%); opacity: 0; visibility: hidden; }
.info h2 { margin: 16px 0 0; font: 500 clamp(34px, 3.6vw, 54px)/1.04 var(--f-display); letter-spacing: -.012em; }
.facts { margin: 28px 0 28px; display: grid; grid-template-columns: 120px 1fr; border-top: 1px solid var(--line); }
.facts dt, .facts dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font: 500 10.5px/1.9 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.facts dd { font-size: 15px; color: var(--ink); }
.rail { position: absolute; right: var(--gutter); top: 50%; transform: translateY(-50%); display: grid; gap: 10px; justify-items: end; opacity: 0; transition: opacity .4s var(--ease); }
.rail.on { opacity: 1; }
.rail i { display: block; width: 14px; height: 1px; background: var(--line-2); transition: width .35s var(--ease), background .35s var(--ease); }
.rail i.on { width: 30px; background: var(--accent); }


/* ---------- Secciones editoriales */
.sec { position: relative; padding: clamp(96px, 14vh, 160px) var(--gutter); }
/* Planos → Fuentes: sin el bloque intermedio, los dos márgenes juntos dejaban un hueco; una línea fina como en las demás uniones. */
#planos { padding-bottom: clamp(56px, 8vh, 88px); }
#fuentes { padding-top: clamp(56px, 8vh, 88px); border-top: 1px solid var(--line); }
.wrap { max-width: 1180px; margin: 0 auto; }
.row { display: grid; grid-template-columns: 180px minmax(0, 1fr); column-gap: 56px; }
.row > .lbl { padding-top: 8px; }
.h2 { margin: 0 0 22px; font: 500 clamp(34px, 4.2vw, 58px)/1.06 var(--f-display); letter-spacing: -.012em; text-wrap: balance; }
.lead { margin: 0; max-width: 60ch; font-size: 18px; line-height: 1.62; color: var(--text-2); }
.row > *, .modo > * { min-width: 0; }
.fine { margin: 24px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.screen, .frame { overflow: hidden; border: 1px solid var(--line-2); border-radius: 14px; background: #000; box-shadow: 0 18px 48px -32px rgb(10 10 12 / 28%); }
.screen img { width: 100%; height: auto; }

/* ---------- II · Modos: imagen arriba en móvil */
.modo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 56px; }
.modo figure { margin: 0; min-width: 0; }
.modo figcaption { margin-top: 14px; font: 400 11.5px/1.5 var(--f-mono); color: var(--muted); }
.modo h3 { margin: 14px 0 18px; font: 500 clamp(29px, 3vw, 40px)/1.1 var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.modo-txt > p:not(.kicker) { margin: 0; color: var(--text-2); line-height: 1.62; }
.modo .tags { display: flex; flex-wrap: wrap; gap: 8px 0; margin: 24px 0 0; padding: 0; list-style: none; font: 400 11.5px/1.5 var(--f-mono); color: var(--muted); }
.modo .tags li:not(:last-child)::after { content: "·"; margin: 0 9px; }
@media (min-width: 821px) {
  .modo { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); align-items: center; gap: clamp(32px, 5vw, 72px); margin-top: 88px; }
  .modo figure { grid-column: 2; grid-row: 1; }
  .modo-txt { grid-column: 1; grid-row: 1; }
  .modo:nth-of-type(even) { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
  .modo:nth-of-type(even) figure { grid-column: 1; }
  .modo:nth-of-type(even) .modo-txt { grid-column: 2; }
}

/* ---------- III · Puente claro, fundido y barrido */
.bridge { position: relative; height: 300vh; height: 300svh; }
.bridge .stick { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 48px; padding: var(--bar-h) var(--gutter) 0; background: var(--bg); }
.bridge .txt { max-width: 470px; justify-self: end; }
.bridge .txt > p:not(.kicker):not(.fine) { margin: 0; font-size: 16.5px; line-height: 1.62; color: var(--text-2); }
.bridge .kicker { margin-bottom: 18px; }
.frame { position: relative; width: min(100%, 42vw, 88svh); aspect-ratio: 4 / 3; }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.frame .e { clip-path: inset(0 0 100% 0); }
.frame .scan { position: absolute; left: 0; right: 0; height: 1px; background: var(--accent); box-shadow: 0 0 18px 2px rgb(61 90 254 / 60%); opacity: 0; }
.steps3 { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px 22px; font: 500 10.5px/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.steps3 span { color: var(--muted); transition: color .3s var(--ease); }
.steps3 span.on { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

/* ---------- IV · Galería y conmutador */
.image-switch { display: inline-flex; gap: 4px; margin: 36px 0 26px; padding: 4px; border: 1px solid var(--line-2); border-radius: 32px; }
.image-switch button { min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 28px; background: transparent; font: 500 12px/1.4 var(--f-mono); cursor: pointer; }
.image-switch button[aria-pressed="true"] { color: #fff; background: var(--accent); }
.image-switch button[aria-pressed="false"]:hover { background: var(--accent-soft); }
.gal { display: flex; gap: 18px; margin: 0; padding: 4px 4px 20px; list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gal::-webkit-scrollbar { display: none; }
.gal > li { display: flex; flex-direction: column; flex: 0 0 86%; min-width: 0; scroll-snap-align: start; }
.gal .screen { flex: none; aspect-ratio: 4 / 3; }
.gal-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: space-between; margin-top: 18px; font: 400 10.5px/1.5 var(--f-mono); color: var(--muted); }
.gal-meta span:first-child { font-weight: 600; color: var(--accent); }
.gal h3 { margin: 12px 0; font: 500 27px/1.12 var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.gal p { margin: 0 0 20px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.gal .count { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font: 400 11px/1.5 var(--f-mono); color: var(--muted); }
@media (min-width: 601px) {
  .gal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 22px; overflow: visible; scroll-snap-type: none; }
}
@media (min-width: 1100px) {
  .gal { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- V–VIII · Volumen, fuentes, autor y acceso */
.text-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 5px; }
.refs { margin: 32px 0 0; padding-left: 24px; }
.refs li { padding: 18px 0 18px 8px; border-top: 1px solid var(--line); color: var(--text-2); }
.refs li::marker { font: 400 11px var(--f-mono); color: var(--muted); }
.refs p { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.who .h2 { margin-bottom: 14px; }
.who .roles { margin: 0 0 28px; font: 500 11.5px/1.8 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.who p:not(.kicker):not(.roles) { margin: 0; max-width: 62ch; color: var(--text-2); font-size: 17px; line-height: 1.65; }
.close { border-top: 1px solid var(--line); text-align: center; }
.close .kicker { margin-bottom: 24px; }
.close .h2 { max-width: 24ch; margin-inline: auto; }
/* Títulos que no deben partirse por la mitad de un dato («28 / semanas»). */
.nw { white-space: nowrap; }
.close .ctas { justify-content: center; margin-top: 32px; }
.close .pill { min-height: 48px; }

/* ---------- Pie */
.foot { padding: 40px var(--gutter) calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 40px; font: 400 11.5px/1.6 var(--f-mono); color: var(--muted); }
.foot b { font: 600 15px/1 var(--f-display); color: var(--ink); letter-spacing: 0; margin-right: 6px; }
.foot .lm { display: inline-flex; align-items: center; gap: 9px; letter-spacing: .12em; text-transform: uppercase; }
.foot .lm svg { height: 10px; width: auto; color: var(--ink); }

.foot a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Revelado */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.in { opacity: 1; transform: none; }
@media (max-width: 1080px) {
  .row { grid-template-columns: minmax(0, 1fr); }
  .row > .lbl { padding: 0 0 14px; }
}

/* ---------- CTA flotante y progreso de anatomía */
.cta-f { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 20px 8px 22px; border-radius: 40px; background: var(--accent); color: #fff; text-decoration: none; font: 600 14px/1.2 var(--f-body); box-shadow: 0 14px 30px -16px rgb(10 10 12 / 60%); opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity .35s var(--ease), transform .35s var(--ease), visibility 0s linear .35s; -webkit-tap-highlight-color: transparent; }
.cta-f.on { opacity: 1; visibility: visible; transform: none; transition: opacity .35s var(--ease), transform .35s var(--ease), visibility 0s; }
.cta-f:hover { background: #2f4ae8; }
.cta-f .t { display: grid; gap: 2px; }
.cta-f .s { font: 500 9.5px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; opacity: .82; }
.cta-f .a { font-size: 17px; }
.prog { position: fixed; z-index: 49; left: 0; right: 0; top: var(--bar-h); height: 2px; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease); }
.prog.on { opacity: 1; }
.prog i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
a, button { -webkit-tap-highlight-color: transparent; }


@media (max-width: 820px) {
  :root { --bar-h: 54px; --gutter: 20px; }
  .bar-link, .desktop-label { display: none; }
  .phone-label { display: inline; }
  .bar .pill { min-height: 44px; padding: 0 16px; font-size: 12.5px; }
  .bar-r { gap: 0; }
  /* Capítulos como hoja inferior, con el corazón encuadrado arriba. */
  .anat { height: calc(8 * 86vh + 100vh); height: calc(8 * 86svh + 100svh); }
  .chap, .info { left: 20px; right: 20px; width: auto; top: auto; bottom: calc(18px + env(safe-area-inset-bottom)); transform: none; }
  .chap::before, .info::before { content: ""; position: absolute; inset: -72px -20px calc(-18px - env(safe-area-inset-bottom)); background: linear-gradient(rgb(251 251 252 / 0%), rgb(251 251 252 / 90%) 34%, #fbfbfc 58%); z-index: -1; }
  .chap h2 { font-size: 27px; margin-bottom: 8px; }
  .chap p { font-size: 14.5px; line-height: 1.52; }
  .chap .n { margin-bottom: 9px; font-size: 10.5px; }
  .chap .src { margin-top: 8px; font-size: 10.5px; }
  .yagel { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; border-top: 0; }
  .yagel li { grid-template-columns: 24px 1fr; padding: 6px 0; font-size: 12.5px; line-height: 1.3; border-bottom: 1px solid var(--line); }
  .yagel li:last-child { grid-column: 1 / -1; }
  .info h2 { font-size: 30px; }
  .facts { grid-template-columns: 88px 1fr; margin: 14px 0 16px; } .facts dt, .facts dd { padding: 7px 0; } .facts dd { font-size: 14px; }
  .info .ctas { display: grid; gap: 8px; }
  .info .pill { width: 100%; min-height: 46px; }
  .rail { display: none; }
  .hero { flex-direction: column; align-items: flex-start; gap: 0; bottom: calc(22px + env(safe-area-inset-bottom)); }
  .hero::before { content: ""; position: absolute; inset: -90px -20px calc(-22px - env(safe-area-inset-bottom)); background: linear-gradient(rgb(251 251 252 / 0%), rgb(251 251 252 / 92%) 42%); z-index: -1; }
  .hero .kicker { margin-bottom: 12px; font-size: 10.5px; }
  .hero h1 { font-size: clamp(36px, 11vw, 46px); line-height: .98; }
  .hero h1 em { font-size: .48em; margin-top: .3em; }
  .hero .meta { margin-top: 14px; font-size: 10.5px; letter-spacing: .1em; line-height: 1.7; }
  .cue, .pnums { display: none; }
  .tag { font-size: 10px; }
  .tag span { padding: 3px 6px; }
  .sec { padding: 76px var(--gutter); }
  .h2 { font-size: clamp(32px, 9vw, 40px); }
  .lead { font-size: 16.5px; }
  /* El puente conserva su recorrido; la altura se mide tras cargar las fuentes. */
  .bridge { height: 240vh; height: calc(140svh + var(--stick-h, 100svh)); }
  .bridge .stick { grid-template-columns: 1fr; align-content: center; gap: 26px; height: auto; padding-top: 14px; padding-bottom: 14px; }
  .bridge .txt { justify-self: start; order: 2; max-width: none; }
  .bridge .txt .h2 { font-size: 30px; margin-bottom: 14px; }
  .bridge .txt > p:not(.kicker):not(.fine) { font-size: 14.5px; }
  .bridge .fine { margin-top: 18px; font-size: 12px; }
  .steps3 { margin-top: 18px; gap: 10px 16px; font-size: 9.5px; }
  .frame { width: min(100%, 86vw, 44svh); justify-self: center; }
  .who p:not(.kicker):not(.roles) { font-size: 16px; }
  .foot { flex-direction: column; gap: 10px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .cta-f { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); max-width: calc(100% - 28px); min-height: 46px; gap: 10px; padding: 8px 16px; font-size: 13.5px; }
}
/* Teléfono apaisado: composición compacta del workshop. */
@media (max-height: 520px) and (orientation: landscape) {
  .hero h1 { font-size: 32px; } .hero .kicker { margin-bottom: 8px; } .hero .meta { margin-top: 10px; }
  .chap { width: 42vw; } .chap h2 { font-size: 24px; margin-bottom: 8px; } .chap p { font-size: 13.5px; } .chap .n { margin-bottom: 8px; }
  .yagel li { padding: 4px 0; font-size: 12px; }
  .info { width: 46vw; } .info h2 { font-size: 26px; } .facts { margin: 10px 0 12px; } .facts dt, .facts dd { padding: 5px 0; } .facts dd { font-size: 13px; }
  .rail { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; }
}
