:root {
  color-scheme: light;
  --marfil: #eee5d6;
  --tinta: #492127;
  --vino: #682e3a;
  --noche: #060509;
  --serif: Georgia, 'Palatino Linotype', 'DejaVu Serif', serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--marfil); font-family: var(--serif); }
button { font: inherit; }
[hidden] { display: none !important; }
.experiencia {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at 47% 35%, #faf3e7 0%, #eee4d4 55%, #decebb 100%);
}
.experiencia::before {
  position: absolute;
  inset: 0;
  content: '';
  pointer-events: none;
  background: url('arte/papel.png') repeat;
  opacity: .26;
  mix-blend-mode: multiply;
}
.estacion, .lectura, .reto, .interludio, .jardin { position: absolute; inset: 0; }
.estacion {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: clamp(16px, 4svh, 42px);
  z-index: 2;
}
.dedicatoria, .pista {
  margin: 0;
  text-align: center;
  font-style: italic;
  transition: opacity .24s ease;
}
.dedicatoria {
  color: var(--tinta);
  font-weight: 400;
  font-size: clamp(38px, min(7vw, 9svh), 70px);
  letter-spacing: -.052em;
  line-height: 1;
}
.pista {
  color: #644a41;
  font-size: clamp(17px, 2.3vmin, 23px);
  line-height: 1.4;
}
.sobre {
  position: relative;
  display: block;
  width: min(94vw, 1120px, calc((100svh - 240px) * 1.65));
  aspect-ratio: 1.65;
  flex-shrink: 0;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  isolation: isolate;
  perspective: 1100px;
  -webkit-tap-highlight-color: transparent;
}
.sobre:focus-visible, .continuar:focus-visible, .carta-mensaje:focus-visible {
  outline: 2px solid #652e3b;
  outline-offset: 5px;
}
@media (hover: hover) and (pointer: fine) {
  [data-phase='sealed'] .sobre:hover { animation: tambaleo .89s ease-in-out; }
}
@keyframes tambaleo {
  0% { transform: translateY(0) rotate(0); }
  18% { transform: translate(-4px, -10px) rotate(-6deg); }
  40% { transform: translate(5px, -8px) rotate(4.7deg); }
  61% { transform: translate(-3px, -5px) rotate(-3.2deg); }
  80% { transform: translate(2px, -3px) rotate(1.8deg); }
  100% { transform: translateY(0) rotate(0); }
}
.sobre-fondo, .sobre-flap, .carta-asomada, .pliegues, .sello, .destellos {
  position: absolute;
  display: block;
  pointer-events: none;
}
.sobre-fondo {
  inset: 0;
  border-radius: 3px;
  background: url('arte/papel.png') repeat, linear-gradient(145deg, #fbf1df, #ceb698);
  box-shadow: 0 43px 60px -35px #4e332f79, 0 18px 33px -19px #48312565,
    2px 3px 5px #5a3e333b, inset 0 1px 1px #fffbefb3;
}
.carta, .carta-asomada {
  border-radius: 2px;
  background: url('arte/papel.png') repeat, linear-gradient(125deg, #fff9eb, #f4e8d2);
  color: var(--tinta);
}
.carta-asomada {
  inset: 8% 8% 5%;
  z-index: 2;
  visibility: hidden;
  box-shadow: 0 4px 15px #826f5135;
  transform: translateY(11%);
  transition: transform .64s cubic-bezier(.19,.79,.29,1) .30s;
}
.sobre-flap {
  inset: 0 0 auto;
  height: 65%;
  z-index: 5;
  filter: drop-shadow(0 2px 2px #6f502b72) drop-shadow(0 7px 6px #59402832);
  transform-origin: center top;
  transition: transform .74s cubic-bezier(.27,.69,.36,1) .13s, z-index .38s step-end;
}
.sobre-flap::before, .sobre-flap::after {
  position: absolute;
  inset: 0;
  content: '';
  clip-path: polygon(0 0, 100% 0, 99.6% 2%, 53% 95.6%, 51.4% 98%, 50% 98.4%, 48.6% 98%, 47% 95.6%, .4% 2%);
}
.sobre-flap::before {
  background: url('arte/papel.png') repeat, linear-gradient(164deg, #fff7e8 7%, #f2e4cc 61%, #e0c9ab 100%);
  box-shadow: inset 0 2px 1px #fffbf2db, inset 0 9px 20px #fffaf15c;
}
.sobre-flap::after {
  inset: 1px 2px 3px;
  background: linear-gradient(130deg, #fffaf04a, #fff7e308 68%, #a77c4423);
}
.pliegues { inset: 0; z-index: 4; }
.pliegues::before, .pliegues::after {
  position: absolute;
  inset: 0;
  content: '';
  border-radius: 3px;
}
.pliegues::before {
  clip-path: polygon(0 4%, 50% 69%, 100% 4%, 100% 100%, 0 100%);
  background: url('arte/papel.png') repeat,
    linear-gradient(117deg, #f4e5cd 6%, #eee0c7 33%, #cdb696 63%, #e5d0b0 100%);
}
.pliegues::after {
  clip-path: polygon(0 100%, 46.5% 46%, 49% 44%, 51% 44%, 53.5% 46%, 100% 100%);
  background: url('arte/papel.png') repeat, linear-gradient(17deg, #e8d7bd 5%, #f4e8d2 69%, #f8edd9 100%);
  box-shadow: inset 0 -1px 1px #9a80543e;
}
.sello {
  z-index: 6;
  left: 50%;
  top: 59%;
  width: 21.5%;
  aspect-ratio: 1;
  filter: drop-shadow(1px 4px 3px #4b21205e) drop-shadow(0 9px 13px #49222534);
  transform: translate(-50%, -50%) rotate(-5deg);
  transition: opacity .32s ease .08s, transform .43s ease;
}
.sello img { display: block; width: 100%; height: 100%; object-fit: contain; }
.destellos {
  z-index: 7;
  inset: 0;
  filter: drop-shadow(0 0 5px #f2bf62b0);
}
.destellos::before {
  position: absolute;
  inset: 20% 15% 1%;
  content: '';
  background: radial-gradient(ellipse at 50% 56%, #fff8d1af, #ffdf8d50 26%, transparent 58%);
  opacity: 0;
}
.destellos i {
  position: absolute;
  top: 59%;
  left: 50%;
  width: clamp(25px, 4.7vw, 58px);
  aspect-ratio: 1;
  background: radial-gradient(circle, #fff9d8 14%, #eaba69 45%, #d9ab67 69%);
  clip-path: polygon(50% 0, 59% 38%, 100% 50%, 59% 62%, 50% 100%, 41% 62%, 0 50%, 41% 38%);
  opacity: 0;
}
[data-phase='opening'] .sobre-flap { transform: rotateX(177deg); z-index: 1; }
[data-phase='opening'] .carta-asomada { visibility: visible; transform: translateY(-46%); }
[data-phase='opening'] .sello { opacity: 0; transform: translate(-50%, -19%) rotate(13deg) scale(.82); }
[data-phase='opening'] :is(.dedicatoria, .pista) { opacity: 0; }
[data-phase='opening'] .destellos::before { animation: fulgor .61s ease-out both; }
[data-phase='opening'] .destellos i { animation: destello .77s ease-out var(--d) both; }
@keyframes fulgor { 30% { opacity: .9; } }
@keyframes destello {
  from { transform: translate(-50%, -50%) rotate(0) scale(.04); }
  32% { opacity: 1; }
  67% { opacity: .84; }
  to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(28deg) scale(var(--g)); }
}
.lectura {
  z-index: 2;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2svh, 22px) clamp(8px, 2.5vw, 32px);
}
.carta {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100%, 1240px);
  height: 100%;
  min-height: 0;
  padding: clamp(21px, 5vmin, 54px) clamp(17px, 6vmin, 72px) clamp(16px, 4vmin, 36px);
  box-shadow: 0 27px 57px -22px #604a3662, 0 4px 12px #66513930;
  animation: abrir-lectura .46s cubic-bezier(.19,.79,.29,1) both;
}
@keyframes abrir-lectura {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}
.carta-encabezado { display: grid; justify-items: center; }
.carta-titulo {
  margin: .06em 0 .38em;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(48px, min(9vw, 12svh), 88px);
  line-height: 1.05;
  letter-spacing: -.058em;
}
.carta-titulo:focus, .final:focus, .jardin:focus { outline: none; }
.carta-mensaje {
  overflow-y: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  scrollbar-color: #a98272 #ac836d19;
  scrollbar-width: thin;
  padding: 0 clamp(8px, 2vmin, 20px) 0 2px;
  color: #574039;
  font-size: clamp(20px, calc(1.2vmin + 15px), 30px);
  line-height: 1.6;
}
.carta-mensaje p { margin: 0 0 .95em; }
.carta-mensaje p:last-of-type { margin-bottom: 0; }
.carta-mensaje .saludo { font-size: 1.18em; font-style: italic; }
.carta-polaroid {
  position: relative;
  width: min(78%, 360px);
  margin: .4em auto 1.4em;
  padding: 12px 12px 46px;
  background: #fffdf7;
  box-shadow: 0 14px 28px -12px #5b3f3166, 0 2px 6px #5b3f3126;
  transform: rotate(-2.2deg);
}
.carta-polaroid::before {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 34%;
  height: 28px;
  content: '';
  background: #e9d6b8b8;
  box-shadow: 0 1px 2px #6b4e3424;
  transform: translateX(-50%) rotate(3deg);
}
.carta-foto { display: block; width: 100%; height: auto; }
@media (min-width: 820px) {
  .carta-polaroid { float: right; width: min(36%, 380px); margin: .3em 0 1em 2.2em; transform: rotate(2.4deg); }
}
.carta-pie {
  clear: both;
  display: flex;
  justify-content: center;
  padding: 1.4em 0 1.1em;
}
.continuar, .accion {
  border: 0;
  font-style: italic;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.filtros { position: absolute; width: 0; height: 0; }
/* Botón de gelatina: la silueta se deforma sin parar y, al pasar el cursor, unas gotas lo llenan. */
.continuar {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(190px, 26vmin, 250px);
  height: clamp(64px, 8.6vmin, 82px);
  padding: 0;
  background: none;
  color: #fff4ec;
  font-size: clamp(20px, 2.8vmin, 26px);
  letter-spacing: .01em;
  transition: transform .5s cubic-bezier(.34,1.8,.5,1);
}
.blob-cuerpo, .blob-brillo { position: absolute; inset: 0; pointer-events: none; }
.blob-cuerpo {
  overflow: hidden;
  border-radius: 46% 54% 52% 48% / 58% 44% 56% 42%;
  background: radial-gradient(120% 140% at 30% 18%, #a65a69 0%, #7d3c4a 42%, #5a2633 100%);
  box-shadow: 0 16px 26px -12px #5a2633a8, 0 4px 8px #3f1a2440,
    inset 0 -10px 18px #3b141f8c, inset 0 6px 10px #ffd9d64d;
  animation: blob-forma 6s ease-in-out infinite;
}
.blob-gotas { position: absolute; inset: 0; filter: url('#goo'); }
.blob-gotas i {
  position: absolute;
  top: 2px;
  width: 30%;
  height: 100%;
  border-radius: 50%;
  background: #b8677a;
  transform: translate3d(0, 160%, 0) scale(1.6);
  transition: transform .5s cubic-bezier(.5,0,.2,1);
}
.blob-gotas i:nth-child(1) { left: -6%; transition-delay: 0s; }
.blob-gotas i:nth-child(2) { left: 22%; transition-delay: .07s; }
.blob-gotas i:nth-child(3) { left: 48%; transition-delay: .14s; }
.blob-gotas i:nth-child(4) { left: 74%; transition-delay: .21s; }
.blob-brillo {
  inset: 9% 16% 52% 14%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 40% 35%, #ffffffa6, #ffffff1c 58%, transparent 72%);
  animation: blob-brillo 6s ease-in-out infinite;
}
.blob-texto { position: relative; text-shadow: 0 1px 2px #3b141f80; }
.continuar:hover { transform: scale(1.06); }
.continuar:hover .blob-gotas i { transform: translate3d(0, 0, 0) scale(1.6); }
.continuar:hover .blob-cuerpo { animation-duration: 2.4s; }
.continuar:active { transform: scale(.9, .84); transition-duration: .12s; }
@keyframes blob-forma {
  0%, 100% { border-radius: 46% 54% 52% 48% / 58% 44% 56% 42%; transform: scale(1, 1); }
  25% { border-radius: 58% 42% 38% 62% / 42% 58% 42% 58%; transform: scale(1.03, .96); }
  50% { border-radius: 40% 60% 60% 40% / 60% 38% 62% 40%; transform: scale(.97, 1.04); }
  75% { border-radius: 60% 40% 46% 54% / 46% 62% 38% 54%; transform: scale(1.02, .98); }
}
@keyframes blob-brillo {
  0%, 100% { transform: translate(0, 0) rotate(-4deg); }
  50% { transform: translate(6%, 8%) rotate(3deg); }
}
.reto {
  z-index: 3;
  background: var(--noche);
  animation: aparecer .45s ease-out both;
}
.pregunta {
  position: absolute;
  top: 16%;
  left: 50%;
  width: calc(100% - 32px);
  margin: 0;
  transform: translateX(-50%);
  color: #f0d9d4;
  font-style: italic;
  font-weight: 400;
  text-align: center;
  font-size: clamp(34px, min(7vw, 9svh), 76px);
  letter-spacing: -.04em;
  line-height: 1.1;
  animation: aparecer 1.2s ease-out .2s both;
}
.pregunta:focus { outline: none; }
.accion {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 60%);
  max-width: var(--max, 80vw);
  min-height: 48px;
  padding: .42em 1.15em;
  border-radius: 999px;
  font-size: clamp(20px, 3vmin, 26px);
  line-height: 1.15;
  text-align: center;
  transform: translate(-50%, -50%) scale(var(--s, 1));
  transition: left .5s cubic-bezier(.22,.74,.2,1), top .5s cubic-bezier(.22,.74,.2,1),
    transform .5s cubic-bezier(.34,1.56,.5,1), background-color .2s ease;
  animation: aparecer .8s ease-out .7s both;
}
.si {
  z-index: 2;
  color: #fff1e5;
  background: radial-gradient(120% 140% at 30% 15%, #a65a69, #753b48 55%, #5a2633);
  box-shadow: 0 10px 24px #0007, inset 0 -5px 10px #3b141f80, inset 0 3px 6px #ffd9d640;
}
.si:hover { background: radial-gradient(120% 140% at 30% 15%, #b86a79, #8c4855 55%, #67333e); }
.no {
  color: #e4bebb;
  background: #291923;
  box-shadow: 0 7px 16px #0006;
}
.no:hover { background: #3a2430; }
.accion:focus-visible { outline: 2px solid #e0a9a4; outline-offset: 5px; }
.interludio {
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--noche);
}
.jardin {
  z-index: 4;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  justify-items: center;
  padding: 8px 12px;
  overflow: hidden;
  background: var(--noche);
  animation: aparecer .5s ease-out both;
}
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
.final {
  margin: 0;
  color: #f0d9d4;
  font-style: italic;
  font-weight: 400;
  text-align: center;
  font-size: clamp(32px, min(7vw, 8svh), 68px);
  line-height: 1.12;
  letter-spacing: -.04em;
  animation: interludio 3.6s ease both;
}
.puntos { display: inline-block; letter-spacing: .015em; }
.puntos i { animation: punto 1.22s infinite both; }
.puntos i:nth-child(2) { animation-delay: .17s; }
.puntos i:nth-child(3) { animation-delay: .34s; }
@keyframes interludio {
  0%, 100% { opacity: 0; }
  20%, 74% { opacity: 1; }
}
@keyframes punto {
  0%, 60%, 100% { opacity: .16; }
  25%, 45% { opacity: 1; }
}
.jardin-arte { position: relative; width: 100%; min-height: 0; container-type: size; }
.jardin-arte :is(canvas, img, video) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.jardin-arte[data-interactivo] { touch-action: none; }
.ramo-orbita {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100%, calc(100cqh * 10 / 11));
  aspect-ratio: 10 / 11;
  transform: translate(-50%, -50%);
  background: url('arte/giro.webp') 0 0 / 600% 600%;
}
@media (max-height: 430px) {
  .estacion { gap: 10px; }
  .dedicatoria { font-size: clamp(23px, 9svh, 38px); }
  .sobre { width: min(80vw, calc((100svh - 70px) * 1.65)); }
  .lectura { padding-block: 13px; }
  .carta { padding-block: 15px; }
  .carta-titulo { font-size: clamp(26px, 9svh, 39px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .final, .puntos i { animation: none; }
}
