/* Merlina de noche: a kitsch late-night radio agony-aunt set, rosa chicle. */

@font-face { font-family: "Shrikhand"; src: url("fonts/shrikhand-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Yellowtail"; src: url("fonts/yellowtail-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-latin.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-italic-latin.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }

:root {
  --tinta: #3b0a26;          /* the plum-black of the illustrations' ink */
  --tinta-suave: #6e1a45;
  --rosa: #f8c6da;           /* page ground under the capitoné */
  --papel: #fff8f6;
  --crema: #fffaf2;
  --fucsia: #b3134f;         /* buttons: cream on it is 6.3:1 */
  --fucsia-hondo: #8a0d3c;
  --rojo: #d7262e;           /* telephone and airmail red */
  --azul: #3f7fc0;           /* airmail blue */
  --pauta: #c9dff1;          /* ruled lines on the writing paper */
  --foco: #1f5fae;
  --merlina: clamp(250px, 69vw, 300px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--tinta);
  background: var(--rosa) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cdefs%3E%3CradialGradient id='g'%3E%3Cstop offset='0' stop-color='%23fde3ee'/%3E%3Cstop offset='1' stop-color='%23f7c3d8'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='64' height='64' fill='%23f7c3d8'/%3E%3Cpath d='M32 1 63 32 32 63 1 32Z' fill='url(%23g)' stroke='%23e8a3c0' stroke-width='1.5'/%3E%3Cg fill='%23e290b3'%3E%3Ccircle cx='32' cy='0' r='3'/%3E%3Ccircle cx='32' cy='64' r='3'/%3E%3Ccircle cx='0' cy='32' r='3'/%3E%3Ccircle cx='64' cy='32' r='3'/%3E%3C/g%3E%3C/svg%3E") center top / 64px 64px repeat;
  font: 400 1rem/1.45 "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
::selection { background: var(--fucsia); color: var(--crema); }
img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }
a { color: var(--tinta); text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--fucsia); }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- The set (mobile first) ---------- */

.plato {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 16px 18px;
  display: grid;
  grid-template-areas: "cabecera" "cabina" "correo" "patrocinio";
}

.cabecera { grid-area: cabecera; padding-right: 128px; }
.rotulo { margin: 0; font-weight: 400; line-height: .9; }
.coletilla { display: block; font-family: "Yellowtail", cursive; font-size: 1.9rem; color: var(--fucsia-hondo); margin: -2px 0 0 2.4em; transform: rotate(-4deg); transform-origin: left top; }
.nombre { display: block; font-family: "Shrikhand", Georgia, serif; font-size: 3rem; color: var(--rojo); letter-spacing: .01em; text-shadow: 2px 2px 0 var(--crema), 4px 4px 0 var(--tinta); }
.lema { margin-top: 2px; font-weight: 600; font-size: 1rem; line-height: 1.3; max-width: 24ch; }

.antena { position: absolute; top: 18px; right: 12px; width: 124px; transform: rotate(3deg); }
.antena img { width: 100%; filter: saturate(.15) brightness(1.25) opacity(.7); transition: filter .12s ease-out; }
.al-aire .antena img { filter: none; }
@keyframes parpadeo { 0% { filter: none; } 20% { filter: saturate(.15) brightness(1.25) opacity(.7); } 40% { filter: none; } 60% { filter: saturate(.15) brightness(1.25) opacity(.7); } 80%, 100% { filter: none; } }

.cabina {
  grid-area: cabina;
  position: relative;
  height: calc(var(--merlina) + 120px);
  margin-top: 4px;
}

.merlina { position: absolute; left: -14px; bottom: 0; width: var(--merlina); margin: 0; z-index: 1; }
.merlina img { width: 100%; aspect-ratio: 1; }
.merlina img.encima { position: absolute; inset: 0; opacity: 0; transform: scale(.985); transform-origin: 50% 90%; transition: opacity .3s ease-out, transform .3s ease-out; }
.merlina img.encima.visible { opacity: 1; transform: none; }

/* Comic balloon: ink outline like the drawings, tail pointing at her mouth. */
.bocadillo {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  background: var(--crema);
  border: 3px solid var(--tinta);
  border-radius: 30px 24px 28px 22px / 24px 30px 22px 28px;
  padding: 12px 16px 13px;
  box-shadow: 0 6px 14px -6px rgba(59, 10, 38, .35);
}
.rabo { position: absolute; width: 46px; height: 38px; left: 96px; bottom: -35px; overflow: visible; }
.rabo path { fill: var(--crema); stroke: var(--tinta); stroke-width: 3; stroke-linejoin: round; }
.bocadillo-texto:focus { outline: none; }
.golpe { font-family: "Shrikhand", Georgia, serif; font-size: 1.5rem; line-height: 1.12; color: var(--fucsia-hondo); }
.apostilla, .resto { margin-top: 6px; font-size: 1rem; line-height: 1.4; }
.falta { visibility: hidden; }
.resto.espera { opacity: 0; }
.resto { transition: opacity .25s ease-out; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.oyente { font-style: italic; font-size: 1rem; color: var(--tinta-suave); margin-bottom: 4px; }
.bocadillo.entra { animation: entra .42s cubic-bezier(.16, 1, .3, 1); }
@keyframes entra { from { transform: scale(.94) rotate(-1deg); opacity: .2; } to { transform: none; opacity: 1; } }

/* The listeners' mail: a stack of airmail envelopes on the desk. */
.sobres {
  position: absolute; right: 0; bottom: 30px; z-index: 2;
  width: 150px; justify-items: end; padding: 0; border: 0; background: none;
  display: grid; justify-items: center; gap: 0;
}
.pila { position: relative; width: 120px; height: 92px; display: block; }
.pila img { position: absolute; left: 0; top: 0; width: 120px; }
.pila > img:nth-of-type(1) { transform: translate(6px, 14px) rotate(-8deg); }
.pila > img:nth-of-type(2) { transform: translate(-2px, 7px) rotate(5deg); }
/* The top envelope, with its rubber stamp; a letter peeks out from behind it. */
.arriba { position: absolute; left: 0; top: 0; width: 100%; transform: rotate(-2deg); transform-origin: 50% 80%; transition: transform .3s cubic-bezier(.3, 1.5, .5, 1), filter .3s ease-out, opacity .3s ease-out; }
.arriba img { position: relative; width: 100%; }
.leeme {
  position: absolute; left: 9%; bottom: 17%; transform: rotate(-13deg);
  border: 2.5px solid #b8102a; border-radius: 5px; padding: 1px 6px 0;
  color: #b8102a; font: 900 .8rem/1.15 "Schibsted Grotesk", sans-serif; text-transform: uppercase; letter-spacing: .05em;
  mix-blend-mode: multiply; transition: color .3s, border-color .3s;
}
.asoma {
  position: absolute; left: 16%; top: 2%; width: 64%; height: 70%;
  background: var(--papel) repeating-linear-gradient(to bottom, transparent 0 11px, var(--pauta) 11px 12px) 0 22px / 100% 100% no-repeat;
  border: 1.5px solid #c9a3b5; border-radius: 2px;
  transform: translateY(-8px) rotate(-5deg); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1), background-color .3s;
  box-shadow: 0 2px 4px rgba(59, 10, 38, .15);
}
.asoma span { display: block; padding: 3px 0 0 7px; font: .8rem/1 "Yellowtail", cursive; color: var(--fucsia-hondo); white-space: nowrap; }
.contador {
  position: absolute; right: -8px; top: -12px; z-index: 1;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--rojo); color: var(--crema); border: 2.5px solid var(--tinta);
  font: 1.05rem/1 "Shrikhand", Georgia, serif; transform: rotate(8deg);
  transition: background-color .3s;
}
.sobres:hover .arriba, .sobres:focus-visible .arriba { transform: translateY(-12px) rotate(-7deg); }
.sobres:hover .asoma, .sobres:focus-visible .asoma { transform: translateY(-24px) rotate(-9deg); }
.sobres.fuera .arriba { opacity: 0; transition-duration: .12s; }
/* Idle nudge: until the first letter is opened, the top envelope wiggles now and then. */
.sobres.llama .arriba { animation: menea .8s ease-in-out; }
.sobres.llama .asoma { animation: asoma .8s ease-in-out; }
.sobres.llama .contador { animation: late .8s ease-in-out; }
@keyframes menea { 25% { transform: translateY(-9px) rotate(-8deg); } 50% { transform: translateY(-9px) rotate(3deg); } 75% { transform: translateY(-4px) rotate(-5deg); } }
@keyframes asoma { 40%, 60% { transform: translateY(-26px) rotate(-8deg); } }
@keyframes late { 30%, 60% { transform: rotate(8deg) scale(1.2); } }
.sobres-rotulo {
  margin-top: -6px; position: relative;
  background: var(--tinta); color: var(--crema);
  font-weight: 700; font-size: .95rem; line-height: 1.1;
  padding: 7px 10px 8px; border-radius: 6px; transform: rotate(-2deg); white-space: nowrap;
  min-height: 34px; display: inline-flex; align-items: center;
}
.sobres:focus-visible { outline-offset: 0; }

/* ---------- The letter: writing paper with an airmail border ---------- */

.correo { grid-area: correo; display: grid; position: relative; z-index: 4; margin-top: -26px; }
.correo > * { grid-area: 1 / 1; }

.carta, .leida, .tras {
  background: var(--papel);
  border: 9px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--rojo) 0 11px, var(--papel) 11px 17px, var(--azul) 17px 28px, var(--papel) 28px 34px) 9;
  box-shadow: 0 10px 24px -10px rgba(59, 10, 38, .45), 0 1px 2px rgba(59, 10, 38, .2);
  padding: 12px 16px 14px;
}
.carta, .leida, .tras { transform-origin: 0 0; position: relative; }
.carta { transform: rotate(-.6deg); display: grid; gap: 8px; }
.saludo { font-family: "Yellowtail", cursive; font-size: 2rem; line-height: 1; color: var(--fucsia-hondo); }
textarea, input {
  font: inherit; color: var(--tinta); width: 100%;
  border: 0; border-radius: 0; background-color: transparent;
}
textarea {
  font-size: 1.0625rem; line-height: 30px; min-height: 92px; padding: 0 2px; resize: vertical;
  background-image: repeating-linear-gradient(to bottom, transparent 0 29px, var(--pauta) 29px 30px);
  background-attachment: local;
}
textarea::placeholder, input::placeholder { color: #8a4a68; opacity: 1; font-style: italic; }
textarea:focus, input:focus { outline: none; background-color: #fff0f5; }
textarea:focus-visible, input:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
.remite { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 0 10px; }
.remite label { grid-column: 1 / -1; font-weight: 700; font-size: 1rem; }
.remite label span { font-weight: 400; }
.remite input { grid-column: 1 / -1; min-height: 44px; border-bottom: 2px dotted var(--tinta-suave); padding: 6px 2px; }
.aviso { color: #a1122f; font-weight: 700; }
[aria-invalid="true"] { background-color: #ffe3ea; }

.boton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 22px;
  background: var(--fucsia); color: var(--crema);
  border: 3px solid var(--tinta); border-radius: 10px;
  font-weight: 800; font-size: 1.0625rem; text-decoration: none; letter-spacing: .01em;
  box-shadow: inset 0 -4px 0 var(--fucsia-hondo);
  transition: transform .12s ease-out, box-shadow .12s ease-out;
}
.boton:hover { background: #c4175a; }
.boton:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 var(--fucsia-hondo); }
.boton.claro { background: var(--crema); color: var(--tinta); box-shadow: inset 0 -4px 0 #f1c9d8; }
.boton[disabled] { opacity: .6; cursor: default; }
.enviar { width: 100%; font-size: 1.125rem; }
/* Sending failed: Merlina apologises in her balloon and hands over a mailto carrying the letter. */
.fallo-accion { margin-top: 14px; }

.leida { transform: rotate(1deg); display: grid; gap: 10px; align-content: start; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.leida:focus { outline: none; }
.leida-saludo { font-family: "Yellowtail", cursive; font-size: 2rem; line-height: 1; color: var(--fucsia-hondo); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
/* A real letter: several sentences on ruled paper; if it runs long it scrolls inside the sheet, never the page. */
.leida-cuerpo {
  overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 0 2px;
  font-size: 1.0625rem; line-height: 30px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 29px, var(--pauta) 29px 30px); background-attachment: local;
  scrollbar-width: thin; scrollbar-color: var(--fucsia) transparent;
}
.leida-cuerpo p + p { text-indent: 1.5em; }
.leida-cuerpo:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
.leida-firma { font-family: "Yellowtail", cursive; font-size: 1.75rem; line-height: 1.05; color: var(--fucsia-hondo); text-align: right; }
.leida-botones, .tras { display: flex; flex-wrap: wrap; gap: 10px; }
.tras { transform: rotate(.8deg); align-content: start; }
.tras p { flex-basis: 100%; }
.tras-texto { font-size: 1.125rem; line-height: 1.35; font-style: italic; font-weight: 500; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; overflow-wrap: anywhere; }
.tras-firma { font-family: "Yellowtail", cursive; font-size: 1.6rem; line-height: 1; color: var(--fucsia-hondo); }
.tras-nota { font-family: "Shrikhand", Georgia, serif; font-size: 1.15rem; line-height: 1.15; color: var(--fucsia-hondo); }
.tras:focus { outline: none; }
[hidden] { display: none !important; }

/* ---------- Sponsor line ---------- */

.patrocinio { grid-area: patrocinio; margin-top: 22px; display: grid; gap: 6px; font-size: 1rem; }
.patrocina, .desde { font-style: italic; }
.marca { display: block; width: max-content; padding: 4px 0; }
.marca img { width: 190px; }
.cuenta { font: 700 .95rem/1 "Schibsted Grotesk", sans-serif; color: var(--tinta-suave); margin-left: .5em; }
.enlaces { display: flex; flex-wrap: wrap; gap: 0 22px; }
.enlaces a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* ---------- Desktop and the stand screen: one screen, a compact centred stage ----------
   The capitoné fills the window; the set itself is a stage of ~60% of the width (never edge to edge).
   Left: masthead, balloon and Merlina. Right column: the listeners' mail, the letter, the sponsor. */

@media (min-width: 900px) {
  :root {
    --S: min(calc(100vw - 48px), clamp(880px, 60vw, 1160px));
    --R: clamp(330px, calc(var(--S) * .37), 430px);
    --izq: calc(var(--S) - var(--R) - var(--S) * .035);
    --merlina: min(calc(var(--S) * .6), 60vh);
    --correo-top: calc(2.5vh + 196px);
  }
  body { background-size: 88px 88px; }
  .plato {
    max-width: none; width: var(--S); height: 100vh; min-height: 640px; padding: 0;
    display: block; overflow: visible clip;
  }
  .cabecera { position: absolute; top: 3vh; left: 0; padding: 0; z-index: 5; }
  .coletilla { font-size: clamp(2.1rem, calc(var(--S) * .036), 3rem); }
  .nombre { font-size: clamp(4rem, calc(var(--S) * .075), 5.8rem); text-shadow: 3px 3px 0 var(--crema), 5px 5px 0 var(--tinta); }
  .lema { font-size: clamp(1.0625rem, calc(var(--S) * .0165), 1.3rem); max-width: var(--izq); margin-top: 4px; }
  .antena { top: 3.5vh; left: calc(var(--izq) - clamp(150px, calc(var(--S) * .17), 200px) - 10px); right: auto; width: clamp(150px, calc(var(--S) * .17), 200px); }

  .cabina { position: absolute; inset: 0; height: auto; margin: 0; }
  .merlina { left: calc(var(--S) * -.02); bottom: calc(var(--merlina) * -.1); }
  /* Her balloon is the loudest thing on the set: about twice the old size, above her head, never over the letter. */
  .bocadillo {
    top: calc(3vh + var(--S) * .15 + 4px); left: 0; right: auto;
    width: min(calc(var(--izq) - 6px), 700px); padding: 20px 30px 24px; border-width: 4px;
  }
  .rabo { left: calc(var(--merlina) * .4); bottom: -36px; width: 52px; height: 42px; }
  .rabo path { stroke-width: 4; }
  .golpe { font-size: clamp(2.8rem, calc(var(--S) * .05), 3.7rem); line-height: 1.04; }
  .apostilla, .resto { font-size: clamp(1.5rem, calc(var(--S) * .026), 2rem); line-height: 1.3; margin-top: 10px; }
  .oyente { font-size: clamp(1.6rem, calc(var(--S) * .028), 2.1rem); }
  .sobres { right: calc(var(--R) / 2 - 95px); left: auto; top: 2.5vh; bottom: auto; width: 190px; }
  .pila { width: 160px; height: 116px; }
  .pila img { width: 160px; }
  .leeme { font-size: .95rem; }
  .asoma span { font-size: .95rem; }
  .contador { width: 40px; height: 40px; font-size: 1.2rem; }
  .sobres-rotulo { font-size: 1.0625rem; padding: 9px 14px 10px; }

  .correo {
    position: absolute; z-index: 4; margin: 0;
    right: 0; top: var(--correo-top); width: var(--R);
  }
  .leida { height: min(calc(100vh - var(--correo-top) - 196px), 640px); min-height: 330px; gap: 8px; padding-bottom: 14px; }
  .leida-saludo { font-size: 1.8rem; }
  .leida-firma { font-size: 1.5rem; }
  .leida-botones { flex-wrap: nowrap; gap: 8px; }
  .leida-botones .boton { padding: 8px 12px; font-size: 1rem; min-height: 44px; white-space: nowrap; }
  .leida-cuerpo { font-size: 1.125rem; }
  .marca img { width: min(230px, calc(var(--R) * .66)); }
  .carta, .leida, .tras { padding: 16px 20px 18px; }
  .carta { gap: 9px; }
  .saludo { font-size: 2.4rem; }
  textarea { min-height: 150px; font-size: 1.125rem; }
  .leida-texto { font-size: 1.3rem; }

  .patrocinio {
    position: absolute; z-index: 5; right: 0; bottom: 1.6vh; margin: 0;
    width: var(--R); gap: 2px; font-size: 1rem;
  }
}

@media (min-width: 900px) and (max-height: 840px) {
  textarea { min-height: 96px; }
  .pila { width: 130px; height: 94px; }
  .pila img { width: 130px; }
  .leeme { font-size: .8rem; }
  :root { --correo-top: calc(2.5vh + 150px); }
}

/* First screen: the pile is the first thing to do; the letter slot waits, dimmed, until a letter has been read. */
.correo { transition: opacity .5s ease-out, filter .5s ease-out; }
.portada .correo { opacity: .38; filter: saturate(.5); }
@media (min-width: 900px) {
  .portada .sobres { right: auto; left: calc(62% - 95px); top: calc(50vh - 30px); transform: scale(1.6); z-index: 7; }
  .portada .sobres-rotulo { font-size: 1.125rem; }
}
/* Invitation: a ring ripples out from the pile and the stamp jiggles, gently and on repeat while nothing else happens. */
.anillo { position: absolute; inset: -16px -22px -10px; border: 3px solid var(--fucsia); border-radius: 50%; opacity: 0; pointer-events: none; }
.invita .anillo { animation: onda 2.6s ease-out infinite; }
.invita .leeme { animation: sello-menea 2.6s ease-in-out infinite; }
@keyframes onda { 0% { opacity: .9; transform: scale(.9); } 60%, 100% { opacity: 0; transform: scale(1.25); } }
@keyframes sello-menea { 0%, 70%, 100% { transform: rotate(-13deg); } 76% { transform: rotate(-4deg) scale(1.12); } 84% { transform: rotate(-19deg) scale(1.12); } 92% { transform: rotate(-10deg); } }

/* Sound toggle: sound only ever starts after a click, and this switch is always in view. */
.sonido {
  position: absolute; top: 58px; right: 12px; z-index: 6;
  min-height: 44px; padding: 6px 12px; border-radius: 22px;
  background: var(--crema); color: var(--tinta); border: 2px solid var(--tinta);
  font-weight: 700; font-size: .95rem; box-shadow: inset 0 -3px 0 #f1c9d8;
}
.sonido[aria-pressed="false"] { background: #f3d3df; color: var(--tinta-suave); }
.sonido span { display: inline-block; min-width: 1.4em; text-align: left; }
/* Desktop: in the empty capitoné margin, top right of the window, clear of the set. */
@media (min-width: 900px) { .sonido { position: fixed; top: 16px; right: 16px; } }

/* The envelope that gets opened on air: the house illustration cut into interior, pocket and flap. */
.vuelo { position: absolute; z-index: 6; left: 0; top: 0; pointer-events: none; }
.sobre-abierto { position: relative; aspect-ratio: 800 / 471; filter: drop-shadow(0 10px 12px rgba(59, 10, 38, .3)); }
.sobre-abierto > img, .hoja { position: absolute; left: 0; width: 100%; }
.s-interior, .s-bolsillo, .s-solapa { top: 0; }
.s-interior { z-index: 1; }
.hoja {
  z-index: 2; left: 8%; width: 84%; top: 9%; height: 86%;
  background: var(--papel) repeating-linear-gradient(to bottom, transparent 0 15px, var(--pauta) 15px 16px) 0 34px / 100% 100% no-repeat;
  border: 6px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--rojo) 0 7px, var(--papel) 7px 11px, var(--azul) 11px 18px, var(--papel) 18px 22px) 6;
  transition: transform .38s cubic-bezier(.2, .8, .2, 1);
}
.hoja span { display: block; padding: 6px 10px; font: 1.35rem/1 "Yellowtail", cursive; color: var(--fucsia-hondo); }
.s-bolsillo { z-index: 3; }
.s-solapa { z-index: 4; transform-origin: 50% 0; transition: transform .16s ease-out .16s, opacity 0s .16s; }
.s-dentro { z-index: 1; bottom: 99.5%; transform-origin: 50% 100%; transform: perspective(700px) rotateX(-90deg); opacity: 0; transition: transform .16s ease-in, opacity 0s .16s; }
.vuelo.abierto .s-solapa { transform: perspective(700px) rotateX(-90deg); opacity: 0; transition: transform .16s ease-in, opacity 0s .16s; }
.vuelo.abierto .s-dentro { transform: none; opacity: 1; transition: transform .18s ease-out .16s, opacity 0s .16s; }
.vuelo.fuera .hoja { transform: translateY(-74%); }
.vuelo.quieto, .vuelo.quieto * { transition: none !important; }

/* Folds on a sheet that has just been opened out (or is about to be folded): they fade as it flattens. */
.carta::after, .leida::after, .tras::after {
  content: ""; position: absolute; inset: -9px; pointer-events: none; opacity: 0; transition: opacity .7s ease-out;
  background: linear-gradient(to bottom, transparent calc(33.3% - 2px), rgba(59, 10, 38, .16) calc(33.3% - 1px), rgba(255, 255, 255, .7) calc(33.3% + 1px), transparent calc(33.3% + 3px), transparent calc(66.6% - 2px), rgba(59, 10, 38, .16) calc(66.6% - 1px), rgba(255, 255, 255, .7) calc(66.6% + 1px), transparent calc(66.6% + 3px));
}
.pliegues::after { opacity: 1; transition-duration: .1s; }
.desplegando > * { animation: tinta .44s ease-out both; }
@keyframes tinta { 0%, 45% { opacity: 0; } }
.plegando > * { opacity: 0; transition: opacity .15s ease-out; }

/* The on-air sign switches on with a click: a quick flicker, then steady. */
.al-aire .antena img { animation: parpadeo .42s steps(1) 1; }

/* Panels (the visitor's letter, a listener's letter, the after-send note) arrive like paper laid on the desk. */
.llega { animation: llega .42s cubic-bezier(.16, 1, .3, 1); }
@keyframes llega { from { opacity: 0; transform: translate(26px, -22px) rotate(5deg); } }

/* Reduced motion: every key moment still happens, as a dissolve instead of movement or blinking. */
/* Reduced motion: every key moment still happens, as a dissolve, a light change or a scale of 3% at most.
   Nothing travels across the screen and nothing blinks. */
@media (prefers-reduced-motion: reduce) {
  .bocadillo.entra { animation: aparece .3s ease-out; }
  .llega { animation: aparece .4s ease-out; }
  @keyframes aparece { from { opacity: 0; transform: scale(.98); } }
  .al-aire .antena img { animation: enciende .45s ease-out; }
  @keyframes enciende { 0% { filter: brightness(1.5) saturate(1.2); } }
  .merlina img.encima { transform: none; }
  .boton { transition: none; }
  .arriba, .asoma { transition: filter .3s ease-out, transform .3s ease-out, background-color .3s, opacity .3s; }
  .sobres:hover .arriba, .sobres:focus-visible .arriba { transform: rotate(-2deg) scale(1.03); filter: brightness(1.06); }
  .sobres:hover .asoma, .sobres:focus-visible .asoma { transform: translateY(-8px) rotate(-5deg); background-color: #fff; }
  .sobres:hover .leeme, .sobres:focus-visible .leeme { color: var(--rojo); border-color: var(--rojo); }
  .sobres.llama .arriba { animation: late-suave 1s ease-in-out; }
  .sobres.llama .asoma { animation: none; }
  .sobres.llama .contador { animation: enrojece 1s ease-in-out; }
  @keyframes late-suave { 50% { transform: rotate(-2deg) scale(1.03); filter: brightness(1.08); } }
  @keyframes enrojece { 50% { background-color: var(--fucsia-hondo); } }
  .s-solapa, .s-dentro, .vuelo.abierto .s-solapa, .vuelo.abierto .s-dentro { transform: none; transition: opacity .28s ease-out; }
  .hoja { transform: translateY(-74%); opacity: 0; transition: opacity .3s ease-out; }
  .vuelo.fuera .hoja { opacity: 1; }
  .portada .sobres { transition: none; }
  /* The ring stays put and is always visible; it pulses in colour and weight only. */
  .invita .anillo { opacity: 1; animation: onda-color 2s ease-in-out infinite; }
  .invita .leeme { animation: sello-color 2s ease-in-out infinite; }
  @keyframes onda-color { 0%, 100% { border-color: var(--fucsia); border-width: 3px; } 50% { border-color: var(--rojo); border-width: 5px; } }
  @keyframes sello-color { 50% { color: var(--rojo); border-color: var(--rojo); background: rgba(255, 248, 246, .8); } }
}
