:root {
  --bg: #0c0806;
  --paper: #f2e8d5;
  --paper-2: #e9dcc2;
  --ink: #2a1f17;
  --ink-soft: #6b5a4a;
  --leather: #3b2317;
  --leather-2: #2a170e;
  --gold: #d2a75f;
  --warm: #ffb760;
  --W: min(92vw, 1060px, 118vh);   /* ancho del libro abierto */
  --PW: calc(var(--W) / 2);        /* ancho de página */
  --PH: calc(var(--PW) * 1.35);    /* alto de página */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--paper);
  font-family: "Satoshi", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Escenario ---------- */
.libro { height: 2200vh; position: relative; }
.sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #22160f 0%, #0c0806 70%);
}

/* ---------- Libro ---------- */
.book-wrap {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  perspective: 2200px;
  will-change: transform, opacity;
  z-index: 2;
}
.book {
  position: relative;
  width: var(--W); height: var(--PH);
  transform-style: preserve-3d;
  will-change: transform;
}
.book-block {
  position: absolute; top: -1.2%; bottom: -1.2%;
  background: linear-gradient(90deg, var(--leather-2), var(--leather));
  border-radius: 6px 0 0 6px;
  box-shadow: 0 40px 80px rgba(0,0,0,.6), 0 10px 25px rgba(0,0,0,.5);
  transform: translateZ(-2px);
}
.book-block.l { left: -1.4%; right: 50%; opacity: 0; }
.book-block.r { left: 50%; right: -1.4%; border-radius: 0 6px 6px 0; background: linear-gradient(90deg, var(--leather), var(--leather-2)); }

.page {
  position: absolute; top: 0;
  width: var(--PW); height: var(--PH);
  background: var(--paper);
  overflow: hidden;
}
.page-right { left: 50%; border-radius: 0 3px 3px 0; }
.page-right::after, .face.back::after, .face.front::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
}
/* sombra de lomo */
.page-right::after, .face.front::after {
  background: linear-gradient(90deg, rgba(60,40,20,.28), rgba(60,40,20,0) 9%),
              radial-gradient(ellipse at 70% 30%, rgba(255,255,255,.25), transparent 60%);
}
.face.back::after {
  background: linear-gradient(270deg, rgba(60,40,20,.28), rgba(60,40,20,0) 9%);
}

.leaf {
  position: absolute; top: 0; left: 50%;
  width: var(--PW); height: var(--PH);
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
}
.face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--paper);
  overflow: hidden;
}
.face.front { border-radius: 0 3px 3px 0; }
.face.back  { transform: rotateY(180deg); border-radius: 3px 0 0 3px; }
.shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,0));
  opacity: 0;
}

/* textura de papel */
.paper-tex {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    radial-gradient(rgba(120,90,50,.08) 1px, transparent 1px),
    radial-gradient(rgba(120,90,50,.06) 1px, transparent 1px);
  background-size: 7px 7px, 13px 13px;
  background-position: 0 0, 3px 5px;
}

/* ---------- Portada ---------- */
.cover {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.06), transparent 50%),
    linear-gradient(135deg, #4a2c1c, var(--leather) 50%, #26140c);
  display: grid; place-items: center; text-align: center;
  color: var(--gold);
}
.cover::before {
  content: ""; position: absolute; inset: 6%;
  border: 1px solid rgba(210,167,95,.55);
  outline: 1px solid rgba(210,167,95,.25); outline-offset: 6px;
}
.cover .c-small { font-family: "Satoshi", sans-serif; letter-spacing: .45em; font-size: calc(var(--PW) * .022); text-transform: uppercase; opacity: .8; }
.cover h2 {
  font-family: "Zodiak", Georgia, serif; font-style: italic; font-weight: 400;
  font-weight: 300; letter-spacing: -.02em;
  font-size: calc(var(--PW) * .15); line-height: 1; margin: .35em 0 .25em;
  text-shadow: 0 1px 0 rgba(0,0,0,.6), 0 0 18px rgba(210,167,95,.25);
}
.cover .c-orn { font-size: calc(var(--PW) * .05); opacity: .7; }

/* ---------- Página de texto ---------- */
.txt {
  padding: 13% 12%;
  display: flex; flex-direction: column; justify-content: center;
  color: var(--ink);
}
.txt .num {
  font-family: "Satoshi", sans-serif; font-weight: 500; font-size: calc(var(--PW) * .022);
  letter-spacing: .32em; text-transform: uppercase; color: var(--ink-soft);
}
.txt h3 {
  font-family: "Zodiak", Georgia, serif; font-style: italic; font-weight: 400;
  font-weight: 300; letter-spacing: -.02em;
  font-size: calc(var(--PW) * .13); line-height: .98; margin: .3em 0 .45em;
}
.txt .line {
  font-family: "Satoshi", sans-serif; font-weight: 300; font-size: calc(var(--PW) * .036);
  line-height: 1.6; color: #3d3025; max-width: 88%;
}
.txt .hand::before { content: ""; width: 2.2em; height: 1px; background: currentColor; }
.txt .hand {
  font-family: "Satoshi", sans-serif; font-weight: 500; font-size: calc(var(--PW) * .022);
  letter-spacing: .28em; text-transform: uppercase;
  color: #9a4a2c; margin-top: 2.2em; display: flex; align-items: center; gap: .9em;
}
.txt .folio {
  position: absolute; bottom: 6%; left: 0; right: 0; text-align: center;
  font-family: "Zodiak", Georgia, serif; font-size: calc(var(--PW) * .03); color: var(--ink-soft);
}

/* ---------- Página de ilustración ---------- */
.art { display: grid; place-items: center; }
.art svg { width: 78%; height: auto; overflow: visible; }
.art .ink { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.art .ink-thin { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; }
.art .caption {
  position: absolute; bottom: 8%; left: 0; right: 0; text-align: center;
  font-family: "Satoshi", sans-serif; font-size: calc(var(--PW) * .02); letter-spacing: .3em;
  text-transform: uppercase; color: var(--ink-soft);
}
.art .tag {
  position: absolute; top: 5%; right: 6%;
  font-family: "Satoshi", sans-serif; font-size: calc(var(--PW) * .018); letter-spacing: .15em; text-transform: uppercase;
  color: rgba(42,31,23,.35);
}

/* ---------- Página sellada ---------- */
.sealed { display: grid; place-items: center; color: var(--ink); }
.folder {
  position: absolute; inset: 12% 12%;
  border: 1.5px solid rgba(42,31,23,.5);
  background: repeating-linear-gradient(0deg, transparent 0 calc(var(--PW)*.06), rgba(42,31,23,.07) calc(var(--PW)*.06) calc(var(--PW)*.062));
  display: grid; place-items: center;
}
.stamp {
  position: absolute; top: 9%; left: 50%; transform: translateX(-50%) rotate(-6deg);
  border: 2px solid #9b2f22; color: #9b2f22; padding: .2em .7em;
  font-family: "Satoshi", sans-serif; font-weight: 400; letter-spacing: .35em; font-size: calc(var(--PW) * .03);
}
.folder-label {
  position: absolute; bottom: 12%; left: 0; right: 0; text-align: center;
  font-family: "Zodiak", Georgia, serif; font-style: italic; font-size: calc(var(--PW) * .06);
}
.seal {
  position: relative; width: calc(var(--PW) * .26); height: calc(var(--PW) * .26);
}
.seal i {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c94a36, #8f2418 60%, #5e140c);
  box-shadow: 0 4px 10px rgba(0,0,0,.35), inset 0 -3px 6px rgba(0,0,0,.3);
  display: grid; place-items: center;
  font-family: "Zodiak", Georgia, serif; font-style: italic; color: rgba(255,220,200,.75);
  font-size: calc(var(--PW) * .14);
}
.seal i.l { clip-path: polygon(0 0, 52% 0, 44% 35%, 56% 60%, 46% 100%, 0 100%); }
.seal i.r { clip-path: polygon(52% 0, 100% 0, 100% 100%, 46% 100%, 56% 60%, 44% 35%); }
.who {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  opacity: 0; pointer-events: none;
}
.who h3 {
  font-family: "Zodiak", Georgia, serif; font-style: italic; font-weight: 400;
  font-size: calc(var(--PW) * .15); line-height: 1; color: var(--ink);
  text-shadow: 0 0 30px rgba(255,190,100,.6);
}
.glow {
  position: absolute; inset: -20%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,214,150,.95), rgba(255,183,96,.35) 35%, transparent 65%);
  mix-blend-mode: screen;
}

/* ---------- Cuarto ---------- */
.room {
  position: absolute; inset: 0; opacity: 0; z-index: 1;
  will-change: transform, opacity;
}
.room img { position: absolute; max-width: none; display: block; }
.placeholder-note {
  position: absolute; right: 16px; bottom: 16px;
  font-size: 11px; letter-spacing: .05em; color: rgba(242,232,213,.35);
}

/* ---------- Textos finales ---------- */
.reveal {
  position: absolute; left: max(16px, 6vw); top: 50%; transform: translateY(-50%);
  z-index: 3; pointer-events: none; max-width: 520px;
}
.reveal > * { opacity: 0; will-change: opacity, transform; }
.reveal-1, .reveal-2 {
  font-family: "Zodiak", Georgia, serif; font-style: italic;
  font-size: clamp(22px, 3vw, 38px); line-height: 1.2; color: rgba(242,232,213,.85);
}
.reveal-name {
  font-family: "Zodiak", Georgia, serif; font-weight: 400;
  font-weight: 300; letter-spacing: -.035em;
  font-size: clamp(52px, 9vw, 128px); line-height: .92; margin-top: .3em; color: var(--paper);
}
.reveal-sub {
  margin-top: 14px; font-size: 12px; letter-spacing: .35em; text-transform: uppercase; color: var(--gold);
}

/* ---------- HUD ---------- */
.hint {
  position: absolute; bottom: 7vh; left: 0; right: 0; text-align: center; z-index: 6;
  font-size: 12px; letter-spacing: .35em; text-transform: uppercase; color: rgba(242,232,213,.6);
}
.hint span { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }
.hud {
  position: absolute; top: 24px; left: 0; right: 0; text-align: center; z-index: 6;
  font-family: "Zodiak", Georgia, serif; font-style: italic; font-size: 18px;
  color: rgba(242,232,213,.75); transition: opacity .4s;
}
.hud #hudNum { font-style: normal; letter-spacing: .3em; font-size: 12px; margin-right: 12px; color: var(--gold); }
.progress { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: rgba(255,255,255,.06); z-index: 6; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); }

/* ---------- Siguiente sección ---------- */
.next {
  min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 14px;
  padding: 0 16px; background: #0c0806;
}
.next .eyebrow { letter-spacing: .4em; color: var(--gold); font-size: 12px; }
.next h2 { font-family: "Zodiak", Georgia, serif; font-style: italic; font-weight: 400; font-size: clamp(44px, 7vw, 90px); }
.next p { color: rgba(242,232,213,.6); }

@media (max-width: 1000px) {
  .reveal { top: auto; bottom: 0; left: 0; right: 0; transform: none; max-width: none;
    padding: 80px 16px 9vh; background: linear-gradient(transparent, rgba(8,5,3,.92) 45%); }
  .placeholder-note { display: none; }
}
@media (max-width: 700px) {
  :root { --W: 96vw; }
  .hud { font-size: 15px; }
}

/* ---------- Foto montada en la página ---------- */
.photo-page { display: grid; place-items: center; }
.print {
  width: 80%; aspect-ratio: 4 / 5; background: #fff; padding: 4% 4% 14%;
  box-shadow: 0 2px 4px rgba(0,0,0,.15), 0 14px 30px rgba(60,40,20,.25);
  transform: rotate(-2.2deg);
}
.print img { width: 100%; height: 100%; object-fit: cover; display: block; filter: sepia(.18) contrast(1.05) saturate(.9); }
.photo-page .caption {
  position: absolute; bottom: 8%; left: 0; right: 0; text-align: center;
  font-family: "Satoshi", sans-serif; font-size: calc(var(--PW) * .02); letter-spacing: .3em;
  text-transform: uppercase; color: var(--ink-soft);
}

/* ---------- Inmersión de cine ---------- */
.cine { position: absolute; inset: 0; z-index: 3; opacity: 0; overflow: hidden; pointer-events: none; background: #000; }
.cine img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.cine::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0,0,0,.55) 100%),
              linear-gradient(transparent 55%, rgba(0,0,0,.7));
}
.cine-cap { position: absolute; left: max(16px, 6vw); bottom: 14vh; z-index: 2; }
.cine-cap p { font-size: 12px; letter-spacing: .4em; text-transform: uppercase; color: var(--gold); }
.cine-cap h2 {
  font-family: "Zodiak", Georgia, serif; font-style: italic; font-weight: 300; letter-spacing: -.03em;
  font-size: clamp(48px, 8vw, 120px); line-height: .95; margin-top: .15em; color: #fff;
}

/* ---------- Grano y franjas de cine ---------- */
.grain {
  position: absolute; inset: -50%; z-index: 5; pointer-events: none; opacity: .09;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.6s steps(4) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,-1%)} 100%{transform:translate(0,0)} }
.bars i { position: absolute; left: 0; right: 0; height: 5.5vh; background: #000; z-index: 4; }
.bars i:first-child { top: 0; } .bars i:last-child { bottom: 0; }
.print.print-1 { position: absolute; width: 62%; left: 8%; top: 12%; transform: rotate(-4deg); }
.print.print-2 { position: absolute; width: 56%; right: 7%; top: 30%; transform: rotate(5deg); }
.print.print-1 img, .print.print-2 img { aspect-ratio: 1; height: auto; }

/* ---------- Apertura en video ---------- */
.intro { position: absolute; inset: 0; z-index: 4; background: #000; will-change: transform, opacity; }
.intro video { width: 100%; height: 100%; object-fit: cover; display: block; }
.intro::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(0,0,0,.6)); }
.intro-title {
  position: absolute; left: 0; right: 0; top: 12vh; text-align: center; z-index: 1;
  font-size: 12px; letter-spacing: .5em; text-transform: uppercase; color: rgba(242,232,213,.75);
}
