/* Portada de Naipora: descenso multiplano por La Estrella. Medidas en % del comp (1152 × 2048). */
.scene {
  position: relative;
  width: 100%;
  aspect-ratio: 1152 / 2048;
  overflow: hidden;
  container-type: inline-size;
  background: var(--ink);
}
.plane { position: absolute; display: block; }
.plane img { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-sky img { transform: scale(1.03); transform-origin: 50% 100%; } /* margen para el paralaje del puntero */
.p-sky       { left: 0;      top: .73%;   width: 100%;   height: 41.26%; } /* el comp deja 15 px de tinta sobre el cielo */
.p-landscape { left: 0;      top: 40.04%; width: 100%;   height: 51.27%; }
.p-shrub     { left: 80.3%;  top: 33.69%; width: 19.7%;  height: 30.27%; }
.p-irises    { left: 0;      top: 54.69%; width: 26.04%; height: 35.35%; }
.p-irises img { object-fit: contain; object-position: left top; }
.p-deck      { left: 16.06%; top: 74.71%; width: 32.55%; height: 14.16%; }
/* Plano de bruma pintado (capa sacada de las nubes del comp): la banda clara sobre la que se lee el subtítulo. */
.p-mist { position: absolute; left: -6%; top: 22.4%; width: 112%; height: 18.5%; pointer-events: none; display: block; }
.p-mist img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  /* valor del comp (#66–#6f) y solo lo justo más claro detrás del subtítulo para 4,5:1; el borde superior se funde con el cielo */
  filter: brightness(.72) saturate(.8);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 80%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 80%, transparent 100%);
}
/* Suelo pintado de la sección inferior (textura en espejo sacada del comp). */
.scene-foot  { position: absolute; left: 0; top: 90.72%; width: 100%; height: 9.28%; background: var(--umber) url('/assets/plates/ground.png') repeat; background-size: 19.1% auto; }

/* ---- Capa de texto y controles (celuloide sobre la pintura). Tamaños: px del comp / 1152 × 100cqw. ---- */
.scene-top, .headline, .subline, .question, .shuffle, .note, .divider, .section-title { position: absolute; margin: 0; }
.scene-top { left: 0; top: 0; width: 100%; height: 6%; }
.brand {
  position: absolute; left: 3.3%; top: 1.37%; height: 3.81%;
  /* la caja del header ocupa el 6 % del comp: reescalar las coordenadas a su altura */
  top: calc(1.37% / 0.06); height: calc(3.81% / 0.06);
  display: flex; align-items: center;
  font: 400 6.337cqw/1 'Linden Hill', serif; color: #e8ceaf; text-decoration: none; letter-spacing: .02em;
}
.scene-nav { position: absolute; inset: 0; }
.nav-how, .nav-lang, .nav-acct {
  position: absolute; top: calc(2.44% / 0.06); height: calc(2.2% / 0.06);
  display: flex; align-items: center;
  font: 400 max(13px, 3.125cqw)/1 'Cormorant Garamond', serif; color: #ebd7b4; text-decoration: none; letter-spacing: .02em;
}
.nav-how { left: 60.07%; }
.nav-acct { left: 28%; }  /* a la izquierda de los rayos de la estrella: cielo oscuro */
.nav-sep.s-acct { left: 25.8%; }
.nav-lang { left: 86.37%; }
.nav-sep { position: absolute; left: 83.2%; top: calc(1.95% / 0.06); height: calc(3.03% / 0.06); width: 1px; background: color-mix(in srgb, #ebd7b4 45%, transparent); }
.nav-how:hover, .nav-lang:hover, .nav-acct:hover, .brand:hover { color: #fff3dc; }

.headline {
  left: 10.24%; top: 18.8%; width: 81.6%; height: 8.3%;
  display: flex; align-items: center; justify-content: center; white-space: nowrap;
  font: 400 12.6cqw/1 'Linden Hill', serif; color: #dfc9a9; letter-spacing: -.01em; /* Linden Hill es más ancha que el rótulo del comp: se iguala el ancho, no la altura */
  text-shadow: 0 .3cqw 1.2cqw rgb(6 12 16 / .55);
}
.subline {
  left: 22.14%; top: 27.93%; width: 55.73%; height: 4.88%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  font: 600 max(14.5px, 3.55cqw)/1.1 'Cormorant Garamond', serif; color: #0b1215;
}
.subline span { display: block; white-space: nowrap; }

.ask { display: contents; }
.scene .question {
  position: absolute; min-height: 0; margin: 0;
  left: 16.49%; top: 34.18%; width: 66.67%; height: 6.15%;
  box-sizing: border-box; padding: 0 3.5cqw;
  font: 500 max(16px, 3.41cqw)/1 'Cormorant Garamond', serif; color: var(--mist-ink); /* 16 px: iOS no hace zoom al enfocar */
  background: color-mix(in srgb, var(--cel) 88%, transparent);
  border: .18cqw solid var(--slate); border-radius: 1.8cqw;
  box-shadow: 0 .4cqw 1.6cqw rgb(10 16 18 / .25), inset 0 .15cqw .4cqw rgb(255 250 235 / .5);
}
.scene .question::placeholder { color: #4f554a; opacity: 1; } /* 4,78:1 sobre el celuloide */
.scene .question:focus-visible { outline: .3cqw solid var(--amber); outline-offset: .4cqw; }
.shuffle {
  left: 49.05%; top: 77.25%; width: 36.89%; height: 7.57%;
  font: 400 7.9cqw/1 'Linden Hill', serif; color: #efdcbb; letter-spacing: .01em;
  /* pintura ámbar del comp (muestra en espejo) con un canto biselado claro */
  background: #a8691e url('/assets/plates/amber.png') repeat; background-size: 10.4cqw auto;
  border: .25cqw solid #5a3a10; border-radius: 1.9cqw; cursor: pointer;
  box-shadow: 0 .7cqw 1.8cqw rgb(20 12 2 / .5), inset 0 0 0 .45cqw rgb(232 176 92 / .35), inset 0 .3cqw .4cqw rgb(255 222 160 / .4), inset 0 -.45cqw .6cqw rgb(60 34 6 / .45);
  text-shadow: 0 .15cqw .2cqw rgb(60 34 6 / .6);
}
.shuffle:hover { filter: brightness(1.06); }
.shuffle:active { transform: translateY(.2cqw); }
.shuffle:focus-visible { outline: .3cqw solid #f3e1bf; outline-offset: .5cqw; }
.note {
  left: 45.83%; top: 85.55%; width: 43.4%; height: 2.44%;
  display: flex; align-items: center; justify-content: center; white-space: nowrap;
  font: 500 max(12.5px, 2.9cqw)/1 'Cormorant Garamond', serif; color: #ecdfc1;
  isolation: isolate;
  text-shadow: 0 0 .8cqw rgb(12 14 6 / .95), 0 .15cqw .3cqw rgb(12 14 6 / .9);
}

.divider {
  left: 0; top: 90.72%; width: 100%; height: 1.95%;
  display: flex; align-items: center; justify-content: center; color: #8a6c3c;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: .75; }
.divider svg { width: 2.6cqw; height: 2.6cqw; margin: 0 1.2cqw; }
.section-title {
  left: 26.04%; top: 93.75%; width: 48.61%; height: 3.91%;
  display: flex; align-items: center; justify-content: center; gap: 2cqw; white-space: nowrap;
  font: 400 5.47cqw/1 'Linden Hill', serif; color: #e7d0b1;
}
.section-title .leaf { width: 5cqw; height: 2cqw; color: #8a6c3c; }
.section-title .leaf.flip { transform: scaleX(-1); }

/* ---- Escenario: en pantallas más anchas que el comp, la escena se centra y los planos desenfocados llenan los lados ---- */
.stage { position: relative; background: var(--ink); }
.backdrop { display: none; }
@media (min-aspect-ratio: 1152 / 2048) {
  .stage { overflow: hidden; }
  .scene { width: min(100%, calc(100svh * 1152 / 2048)); margin: 0 auto; box-shadow: 0 0 6vw rgb(0 0 0 / .6); }
  .backdrop { display: block; position: absolute; inset: 0; }
  .backdrop img { position: absolute; left: 0; width: 100%; object-fit: cover; filter: blur(28px) saturate(.85) brightness(.45); transform: scale(1.1); }
  .backdrop img:first-child { top: 0; height: 45%; }
  .backdrop img:last-child { top: 40%; height: 60%; }
}

/* ---- Secciones bajo la escena: mismo suelo, filetes dorados y tipos ---- */
.descent, .honest, .close {
  background: var(--umber) url('/assets/plates/ground.png') repeat; background-size: 220px auto;
  color: var(--parchment);
  padding: clamp(40px, 9vw, 96px) 16px;
}
.descent { padding-top: clamp(24px, 6vw, 56px); }
.path { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; position: relative; }
/* el hilo dorado que baja de un paso al siguiente */
.path::before { content: ''; position: absolute; left: 50%; top: 4%; bottom: 4%; width: 1px; background: linear-gradient(#8a6c3c00, #8a6c3c 12%, #8a6c3c 88%, #8a6c3c00); }
.step { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 6vw, 64px); align-items: center; margin: 0 0 clamp(40px, 10vw, 96px); }
.step:last-child { margin-bottom: 0; }
.step-card { margin: 0; justify-self: end; width: min(100%, 220px); }
.step-card img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 18px 40px rgb(0 0 0 / .55), 0 2px 6px rgb(0 0 0 / .4); transform: rotate(-4deg); }
.step-2 .step-card { order: 2; justify-self: start; }
.step-2 .step-card img { transform: rotate(4deg); }
.step-2 .step-text { text-align: right; }
.step h3 { font: 400 clamp(28px, 7vw, 44px)/1.05 'Linden Hill', serif; color: #e7d0b1; margin: 0 0 12px; }
.step p { font: 500 clamp(17px, 4.2vw, 21px)/1.45 'Cormorant Garamond', serif; color: #d9c7a6; margin: 0; max-width: 32ch; }
.step-2 p { margin-left: auto; }

.honest { text-align: center; position: relative; }
.honest::before { content: ''; display: block; width: min(560px, 80%); height: 1px; margin: 0 auto clamp(40px, 9vw, 80px); background: linear-gradient(90deg, transparent, #8a6c3c, transparent); }
.honest h2, .close h2 { font: 400 clamp(34px, 9vw, 60px)/1.05 'Linden Hill', serif; color: #e7d0b1; margin: 0 0 clamp(24px, 6vw, 44px); }
.honest dl { margin: 0 auto; max-width: 600px; display: grid; gap: clamp(22px, 5vw, 36px); }
.honest dt { font: italic 400 clamp(22px, 5.4vw, 30px)/1.15 'Linden Hill', serif; color: #e9cf9d; margin-bottom: 6px; }
.honest dd { margin: 0; font: 500 clamp(17px, 4.2vw, 21px)/1.5 'Cormorant Garamond', serif; color: #d2c1a2; }
.honest .more { margin: clamp(28px, 6vw, 44px) 0 0; font: 500 clamp(18px, 4.4vw, 21px)/1.4 'Cormorant Garamond', serif; }
.honest .more a { color: #e2bf7f; text-underline-offset: .2em; text-decoration-thickness: 1px; }

.close { text-align: center; padding-bottom: clamp(56px, 12vw, 120px); }
.close-deck { display: block; width: min(260px, 60vw); margin: 0 auto clamp(12px, 3vw, 24px); }
.close-deck img { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 20px rgb(0 0 0 / .55)); }
.close p { font: 500 clamp(18px, 4.4vw, 22px)/1.45 'Cormorant Garamond', serif; color: #d2c1a2; margin: 0 0 20px; }
.close .close-note { font-size: clamp(15px, 3.6vw, 18px); color: #a99a7d; }

@media (max-width: 560px) {
  .path::before { left: 34%; }
  .step { grid-template-columns: 34% 1fr; gap: 20px; }
  .step-2 .step-card { order: 0; justify-self: end; }
  .step-2 .step-text { text-align: left; }
  .step-2 p { margin-left: 0; }
}

/* ---- Movimiento: la cámara multiplano. home.js mueve los planos; aquí, la bruma y el barajado del mazo. ---- */
.plane, .p-mist { will-change: transform; }
.p-mist { animation: mist-drift 38s ease-in-out infinite alternate; }
@keyframes mist-drift { from { translate: -3% 0; } to { translate: 3% 0; } }
.scene.is-entering .plane, .scene.is-entering .p-mist { transition: transform 1.8s cubic-bezier(.16, 1, .3, 1); }
/* barajado: el mazo se levanta, se abre en dos mitades y se recompone antes de ir a la consulta */
.p-deck.is-shuffling { animation: deck-riffle .75s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes deck-riffle {
  0%   { transform: translateY(0) rotate(0); }
  30%  { transform: translateY(-6%) rotate(-3deg); }
  55%  { transform: translateY(-4%) rotate(4deg) scale(1.03); }
  100% { transform: translateY(-2%) rotate(0) scale(1.02); filter: drop-shadow(0 2.5cqw 2cqw rgb(0 0 0 / .5)); }
}
@media (prefers-reduced-motion: reduce) {
  .p-mist, .p-deck.is-shuffling { animation: none; }
}

/* sombra del suelo bajo la nota: en el comp descansa sobre tierra oscura, no sobre rocas claras */
.note::before {
  content: ''; position: absolute; inset: -60% -8%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(16 18 8 / .82), rgb(16 18 8 / .55) 60%, transparent);
  filter: blur(1cqw);
}

/* La bruma también atraviesa «Cómo funciona»: las cartas quedan entre dos planos. */
.descent { position: relative; overflow: hidden; }
.descent-mist {
  position: absolute; left: -15%; top: 26%; width: 130%; height: 48%; opacity: .14; pointer-events: none; mix-blend-mode: screen;
  /* velo suave sin bordes: nunca aclara el fondo lo bastante para bajar el texto de 4,5:1 */
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
  filter: blur(6px);
}
.descent-mist img { display: block; width: 100%; height: 100%; object-fit: cover; }
.path { z-index: 1; }

/* Cada carta de «Cómo funciona» descansa en su propio velo de bruma pintada: las cartas quedan entre planos,
   y el velo no llega a la columna del texto. */
.step-card { position: relative; isolation: isolate; }
.step-card::before {
  content: ''; position: absolute; inset: -22% -30%; z-index: -1; pointer-events: none;
  background: url('/assets/plates/mist.webp') center / cover no-repeat;
  opacity: .36; filter: blur(3px);
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
}
