/* Arabesque — una landing normal, pero en vez de bajar se pasan las hojas de un libro */

:root {
  --fondo: #D6C7B6;
  --tinta: #3A332C;
  --salvia: #7E9A72;
  --salvia-o: #556E4C;
  --salvia-c: #C3D0B6;
  --rosa: #E2C6BC;
  --arena: #EADCC6;
  --papel: #F3EADC;
  --crema: #FBF6EC;
  --barra: 56px;
  --reserva: 132px;   /* barra + flechas + márgenes en celular */
}

* { box-sizing: border-box; }

html, body { height: 100%; overscroll-behavior: none; }  /* sin "tirar para recargar": deslizar pasa la hoja */

body {
  margin: 0;
  overflow: hidden;
  color: var(--tinta);
  background: radial-gradient(ellipse 75% 70% at 50% 45%, #DCCFC0 0%, var(--fondo) 65%, #CDBDAC 100%) fixed var(--fondo);
  font-family: 'EB Garamond', Georgia, serif;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; }

/* ───────── Tapa ───────── */

.portada {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px;
}
html.abierto .portada { display: none; }

.tapa-btn {
  height: min(76dvh, calc((100vw - 40px) * 1055 / 855));
  aspect-ratio: 855 / 1055;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 2200px;
}
.tapa-btn:focus-visible { outline: 2px solid var(--salvia-o); outline-offset: 8px; }

.tapa {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform .6s cubic-bezier(.3, .6, .3, 1);
}
.tapa-btn:hover .tapa { transform: rotateY(-9deg); }

.tapa-frente, .tapa-dorso {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 2px 5px 5px 2px;
}
.tapa-frente {
  display: block;
  box-shadow: 0 1px 2px rgba(40, 30, 20, .2), 0 22px 44px -14px rgba(70, 50, 30, .5);
}
.tapa-dorso {
  transform: rotateY(180deg);
  background: var(--papel);
  box-shadow: inset 0 0 0 .55em #66724F;
}

.portada-pista {
  margin: 0;
  font-style: italic;
  font-size: 17px;
  letter-spacing: .02em;
  animation: respirar 2.8s ease-in-out infinite;
}
.con-dedo { display: none; }
@media (hover: none) {
  .con-mouse { display: none; }
  .con-dedo { display: inline; }
}
@keyframes respirar { 0%, 100% { opacity: .5; } 50% { opacity: .95; } }

/* ───────── Escena: barra + mesa con el libro ───────── */

html:not(.abierto) .escena { opacity: 0; pointer-events: none; }

.escena {
  /* Ancho y alto del libro: la hoja de la foto se estira solo a lo alto */
  --bw: min(calc(100vw - 16px), 620px, calc((100dvh - var(--reserva)) * 1007 / 1095));
  --alto: min(calc(100dvh - var(--reserva)), calc(var(--bw) * 1.75));
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* Barra */
.barra {
  position: relative;
  z-index: 20;
  flex: none;
  height: var(--barra);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  background: rgba(244, 236, 224, .88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(58, 51, 44, .1);
}
.barra-logo { display: block; }
.barra-logo img { display: block; height: 44px; width: auto; }

.menu-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  gap: 5px;
  border: 0;
  background: none;
  cursor: pointer;
}
.menu-btn span { display: block; width: 22px; height: 1.6px; background: var(--tinta); transition: transform .25s, opacity .25s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }
.menu-btn:focus-visible { outline: 2px solid var(--salvia-o); outline-offset: 2px; }

.menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  padding: 6px 0 10px;
  background: #F4ECE0;
  box-shadow: 0 14px 24px -12px rgba(60, 40, 20, .35);
}
.menu.abierto { display: flex; }
.menu a {
  padding: 12px 24px;
  border-left: 3px solid transparent;
  color: var(--tinta);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 21px;
  font-weight: 500;
  text-decoration: none;
}
.menu a[aria-current="true"] { border-left-color: var(--salvia-o); background: rgba(195, 208, 182, .35); }
.menu a:focus-visible { outline: 2px solid var(--salvia-o); outline-offset: -2px; }

/* Mesa */
.mesa {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  min-height: 0;
}

.libro {
  position: relative;
  flex: none;
  width: var(--bw);
  height: var(--alto);
  container-type: inline-size;
  perspective: 1900px;
}

.libro-fondo, .cara-fondo {
  border-style: solid;
  border-color: transparent;
  border-width: calc(var(--bw) * 120 / 1007) 0 calc(var(--bw) * 110 / 1007) 0;
  border-image: url(../img/libro-hoja.webp) 120 0 110 0 fill stretch;
}
.libro-fondo {
  position: absolute;
  inset: 0;
  -webkit-mask: linear-gradient(to right, transparent, #000 1.5%);
  mask: linear-gradient(to right, transparent, #000 1.5%);
}

/* La hoja: del borde de las hojas apiladas hasta el lomo (a la derecha) */
.hoja, .hoja-giro {
  position: absolute;
  left: 16.39%;
  width: 82.22%;
  top: calc(var(--bw) * 12 / 1007);
  bottom: calc(var(--bw) * 92 / 1007);
}
.hoja > .pagina, .cara > .pagina {
  top: calc(var(--bw) * 96 / 1007);
  bottom: calc(var(--bw) * 20 / 1007);
  left: 6%;
  right: 7%;
}

/* La hoja que gira, colgada del lomo */
.hoja-giro {
  z-index: 5;
  transform-style: preserve-3d;
  transform-origin: right center;
  pointer-events: none;
}
.cara {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* El frente usa la misma foto que el libro, recortada: arranca y termina sin costura */
.cara-fondo {
  position: absolute;
  left: calc(var(--bw) * -165 / 1007);
  top: calc(var(--bw) * -12 / 1007);
  width: var(--bw);
  height: var(--alto);
}
.cara-dorso .cara-fondo { display: none; }
.cara-dorso {
  transform: rotateY(180deg);
  background: linear-gradient(to right, rgba(110, 85, 50, .22), rgba(110, 85, 50, 0) 8%), var(--papel);
  box-shadow: 0 0 16px rgba(60, 40, 20, .14);
}
.sombra {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(to left, rgba(60, 40, 20, .5), rgba(60, 40, 20, .12) 45%, rgba(60, 40, 20, 0) 80%);
}
.cara-dorso .sombra {
  background: linear-gradient(to right, rgba(60, 40, 20, .5), rgba(60, 40, 20, .12) 45%, rgba(60, 40, 20, 0) 80%);
}

/* Flechas y nombre de la sección */
.ctrl {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 52px;
  margin-right: 44px;   /* deja lugar al botón de WhatsApp */
}
.ctrl-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--salvia-o);
  color: var(--crema);
  cursor: pointer;
  box-shadow: 0 4px 12px -4px rgba(60, 40, 20, .45);
  transition: background .2s, opacity .2s;
}
.ctrl-btn svg { width: 22px; height: 22px; }
.ctrl-btn:hover { background: #46603F; }
.ctrl-btn:disabled { opacity: .3; cursor: default; }
.ctrl-btn:focus-visible { outline: 2px solid var(--tinta); outline-offset: 3px; }
.ctrl-num { margin: 0; min-width: 122px; text-align: center; font-style: italic; font-size: 15px; }

/* ───────── Compu ───────── */

@media (min-width: 900px) {
  :root { --barra: 64px; --reserva: 80px; }

  .barra { padding: 0 32px; }
  .barra-logo img { height: 50px; }
  .menu-btn { display: none; }
  .menu {
    position: static;
    display: flex;
    flex-direction: row;
    gap: 26px;
    padding: 0;
    background: none;
    box-shadow: none;
  }
  .menu a {
    padding: 6px 0;
    border-left: 0;
    border-bottom: 1px solid transparent;
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 16.5px;
    font-weight: 400;
    letter-spacing: .03em;
    transition: border-color .2s;
  }
  .menu a:hover { border-bottom-color: rgba(85, 110, 76, .5); }
  .menu a[aria-current="true"] { background: none; border-bottom-color: var(--salvia-o); }

  .mesa { padding: 8px 0; }

  /* Libro abierto (Niña de cuento en acuarela): contenido a la izquierda, la nena fija a la derecha.
     Medidas en % del recorte de 1460×935 px; el lomo está en x = 728. */
  body { background: radial-gradient(ellipse 80% 75% at 50% 45%, #E6DACB 0%, #DED1C1 60%, #D3C4B2 100%) fixed #DED1C1; }
  .escena { --lw: min(calc(100vw - 190px), calc((100dvh - var(--reserva)) * 1460 / 935)); }
  .libro { width: var(--lw); height: calc(var(--lw) * 935 / 1460); perspective: 2600px; }
  .libro-fondo {
    border: 0;
    border-image: none;
    background: url(../img/libro-nina.webp) 0 0 / 100% 100% no-repeat;
    -webkit-mask: linear-gradient(to right, transparent, #000 1.2%, #000 98.6%, transparent),
                  linear-gradient(to bottom, transparent, #000 2.5%, #000 96.5%, transparent);
    -webkit-mask-composite: source-in;
    mask: linear-gradient(to right, transparent, #000 1.2%, #000 98.6%, transparent),
          linear-gradient(to bottom, transparent, #000 2.5%, #000 96.5%, transparent);
    mask-composite: intersect;
  }
  .hoja, .hoja-giro { left: 10.753%; width: 39.11%; top: 3.209%; height: 87.7%; bottom: auto; }
  .hoja > .pagina, .cara > .pagina { top: 5%; bottom: 3%; left: 6.2%; right: 7.2%; }
  /* Las caras de la hoja que gira son recortes de la misma foto: el frente, la hoja izquierda;
     el dorso, la hoja de la nena. Así el giro arranca y termina sin costura. */
  .cara-fondo {
    border: 0;
    border-image: none;
    background: url(../img/libro-nina.webp) 0 0 / 100% 100% no-repeat;
    left: -27.5%;
    top: -3.659%;
    width: 255.69%;
    height: 114.02%;
  }
  .cara-dorso { background: none; box-shadow: none; }
  .cara-dorso .cara-fondo { display: block; left: -127.5%; }
  .ctrl { height: 0; margin: 0; }
  .ctrl-num { display: none; }
  .ctrl-btn { position: fixed; top: calc(var(--barra) + (100dvh - var(--barra)) / 2 - 26px); width: 52px; height: 52px; }
  .ctrl-ant { left: calc(50vw - var(--lw) / 2 - 72px); }
  .ctrl-sig { left: calc(50vw + var(--lw) / 2 + 20px); }
}

/* ───────── Contenido de las hojas ───────── */

.fuente { display: none; }

.pagina {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--tinta);
  /* el script calcula --fs: la letra más grande con la que entran todas las hojas */
  font-size: var(--fs, 15px);
  line-height: 1.42;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.pagina::-webkit-scrollbar { display: none; }
.pagina p { margin: 0; }
/* Si una hoja no entra (pantallas muy bajas), se avisa que sigue más abajo */
.pagina.desborda {
  -webkit-mask: linear-gradient(to bottom, #000 84%, transparent);
  mask: linear-gradient(to bottom, #000 84%, transparent);
}

.titulo {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 2.1em;
  line-height: 1.05;
  letter-spacing: .01em;
}
.volanta {
  font-size: .72em;
  letter-spacing: .24em;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: .45em !important;
}
.ramita {
  width: 5.6em;
  height: 1.9em;
  flex: none;
  color: var(--salvia);
  margin: .15em 0 .55em;
}
.folio {
  margin-top: auto !important;
  padding-top: .5em;
  font-size: .8em;
  letter-spacing: .12em;
  opacity: .6;
}
.marca { display: flex; align-items: center; gap: .8em; margin: .1em 0 .3em; text-align: left; }
.marca-logo { width: 4.9em; height: auto; flex: none; mix-blend-mode: multiply; }  /* el blanco del logo toma el color del papel */
.marca p { font-style: italic; line-height: 1.35; max-width: 11em; }
.marca strong { font-family: 'Cormorant Garamond', Georgia, serif; font-style: normal; font-weight: 600; font-size: 1.15em; }
.epigrafe {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.22em;
  line-height: 1.28;
  max-width: 17em;
}
.remate {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.22em;
  line-height: 1.3;
}
.bajada { font-style: italic; }

/* Inicio */
.inicio-logo { width: 76%; height: auto; margin-top: auto; }
.pag-inicio .volanta { margin-top: .2em; }
.inicio-titulo {
  margin: 0 0 .35em;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 1.75em;
  line-height: 1.12;
}
.inicio-texto { max-width: 19em; margin-bottom: .6em !important; }
.inicio-oficios {
  margin-bottom: 1.1em !important;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.12em;
}
.botones { display: flex; flex-wrap: wrap; justify-content: center; gap: .6em; }
.pista-bajar {
  display: flex;
  align-items: center;
  gap: .3em;
  margin-top: .9em !important;
  font-size: .86em;
  font-style: italic;
  opacity: .7;
}
.pista-bajar svg { width: 1.2em; height: 1.2em; animation: bajar 1.8s ease-in-out infinite; }
@keyframes bajar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(.3em); } }

/* ¿Qué es Arabesque?: entrada destacada, texto y remate */
.mf-entrada {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.38em;
  line-height: 1.25;
  margin: .45em 0 .6em !important;
}
.mf-texto { max-width: 21em; }
.mf-texto p + p { margin-top: .6em; }
.mf-remate { margin-top: .6em !important; }
.mf-remate::before {
  content: '';
  display: block;
  width: 2.4em;
  height: 1px;
  margin: 0 auto .5em;
  background: var(--salvia);
}

/* Papelería y Literatura */
.verbos { align-self: stretch; text-align: left; margin: .7em 0 0; }
/* cada verbo y su frase en un renglón: se leen como una oración ("Escribir cartas, listas…") */
.verbos div { padding: .32em 0; border-top: 1px solid rgba(126, 154, 114, .5); line-height: 1.35; }
.verbos dt, .verbos dd { display: inline; margin: 0; }
.verbos dt { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; font-size: 1.14em; }
.verbos dd { font-style: italic; }

/* Trabajos: fotos pegadas con cinta */
/* el collage ocupa el papel que sobra en la hoja (con un mínimo) y las fotos crecen sin deformarse */
.collage { align-self: stretch; flex: 1 1 auto; min-height: 13em; margin: .4em 0 .6em; display: grid; place-items: center; container-type: size; }
.collage-caja { position: relative; aspect-ratio: 10 / 7.8; width: min(100cqw, 100cqh * 10 / 7.8); }
.foto {
  position: absolute;
  margin: 0;
  background: var(--rosa);
  border: .45em solid var(--crema);
  box-shadow: 0 .3em .8em rgba(60, 40, 20, .2);
}
.f1 { left: 3%; top: 4%; width: 50%; aspect-ratio: 4 / 5; rotate: -4deg; }
.f2 { right: 2%; top: 9%; width: 45%; aspect-ratio: 1; rotate: 5deg; background: var(--salvia-c); }
.f3 { left: 30%; bottom: 0; width: 44%; aspect-ratio: 5 / 4; rotate: -1.5deg; background: var(--arena); }
/* hoja alta (celular): las fotos se acomodan en vertical y más grandes */
@container (max-aspect-ratio: 1 / 1) {
  .collage-caja { aspect-ratio: 10 / 12; width: min(100cqw, 100cqh * 10 / 12); }
  .f1 { left: 2%; top: 3%; width: 56%; aspect-ratio: 3 / 4; }
  .f2 { right: 1%; top: 12%; width: 46%; aspect-ratio: 3 / 4; }
  .f3 { left: 26%; width: 48%; aspect-ratio: 4 / 5; }
}
.cinta {
  position: absolute;
  top: -.75em;
  left: 50%;
  width: 3.4em;
  height: 1.25em;
  translate: -50% 0;
  rotate: -4deg;
  background: rgba(236, 222, 190, .8);
  box-shadow: 0 1px 2px rgba(60, 40, 20, .12);
}
.collage .foto { cursor: pointer; -webkit-tap-highlight-color: transparent; }   /* tocarla la cambia */
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-ovalo { overflow: hidden; }
.llamado { font-style: italic; margin-bottom: .55em !important; }

/* Quién soy */
.quien-cabeza { display: flex; align-items: center; gap: .9em; align-self: stretch; margin-bottom: .8em; text-align: left; }
.quien-cabeza .volanta { margin-bottom: .25em !important; }
.titulo-largo { font-size: 1.55em; line-height: 1.1; }
.foto-ovalo {
  position: relative;
  width: 5.4em;
  aspect-ratio: 4 / 5;
  border-radius: 50%;
  border-width: .4em;
  margin: 0;
  flex: none;
}

/* Botones */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  padding: .62em 1.5em;
  border: 0;
  border-radius: 999px;
  background: var(--salvia-o);
  color: var(--crema);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: .98em;
  letter-spacing: .05em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s;
}
.boton:hover { background: #46603F; }
.boton:focus-visible { outline: 2px solid var(--tinta); outline-offset: 3px; }
.ico-wa { width: 1.15em; height: 1.15em; flex: none; }
.cta { margin-top: .7em; }
.boton-claro { background: transparent; color: var(--tinta); box-shadow: inset 0 0 0 1px var(--salvia-o); }
.boton-claro:hover { background: rgba(195, 208, 182, .45); }

/* Contacto */
.pag-contacto .bajada { margin: .4em 0 .1em !important; }
.form-wa { align-self: stretch; display: flex; flex-direction: column; gap: .5em; margin-top: .4em; text-align: left; }
.campo { display: flex; flex-direction: column; gap: .25em; margin: 0; padding: 0; border: 0; font-size: .86em; letter-spacing: .04em; }
.campo legend { padding: 0; margin-bottom: .35em; }
.campo input, .campo textarea {
  width: 100%;
  padding: .35em .4em;
  border: 0;
  border-bottom: 1px solid rgba(58, 51, 44, .4);
  border-radius: 3px 3px 0 0;
  background: rgba(255, 252, 245, .55);
  color: var(--tinta);
  font: inherit;
  font-size: max(16px, 1.12em);
  letter-spacing: 0;
}
.campo textarea { resize: none; height: 2.7em; }
.campo input:focus, .campo textarea:focus { outline: 2px solid var(--salvia); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: .35em; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: .25em .75em; border: 1px solid var(--salvia); border-radius: 999px; font-size: 1.06em; letter-spacing: 0; }
.chip input:checked + span { background: var(--salvia-c); border-color: var(--salvia-o); }
.chip input:focus-visible + span { outline: 2px solid var(--salvia-o); outline-offset: 2px; }
.form-wa .boton { align-self: center; margin-top: .35em; }
.redes { margin-top: .6em !important; font-style: italic; font-size: .9em; opacity: .8; }

/* ───────── WhatsApp ───────── */

.wa-flotante {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 60;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 211, 102, .35);
  transition: transform .25s;
}
.wa-flotante svg { width: 28px; height: 28px; }
.wa-flotante:hover { transform: scale(1.07); }
.wa-flotante::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: #25D366;
  animation: wa-pulso 2.6s infinite;
}
@keyframes wa-pulso {
  0% { transform: scale(1); opacity: .6; }
  70%, 100% { transform: scale(1.55); opacity: 0; }
}
@media (min-width: 900px) {
  .wa-flotante { right: 24px; bottom: 24px; width: 58px; height: 58px; }
  .wa-flotante svg { width: 31px; height: 31px; }
}

@media (prefers-reduced-motion: reduce) {
  .portada-pista, .wa-flotante::before, .pista-bajar svg { animation: none; }
  .tapa { transition: none; }
}
