/* ───────────────────────────────────────────────────────────────
   petali di cuore — Claudia Rota
   Cinque tagli, cinque petali: la ferita è la forma del fiore,
   e la luce che ne entra è il giorno del sito.

   Tutto vive dentro .pdc: nessuna regola tocca html o body.
   ─────────────────────────────────────────────────────────────── */

.lp .pdc {
  /* il libro: il rosso della copertina e le tinte dei petali */
  --rosso: #7a2d33;
  --rosso-notte: #4a151c;
  --cipria: #E9AEA4;
  --rosa: #d98a86;
  --corallo: #c7605f;
  /* il sito */
  --crema: #FFF6E6;
  --bruno: #2A1A13;
  --beige: #EFDCC6;
  --lilla: #B79FD8;
  --lilla-chiaro: #D8CAEC;
  --lilla-scuro: #8E74B8;

  --carta: var(--beige);          /* la luce che entra dalle ferite è il giorno del sito */
  --inchiostro: var(--rosso);     /* sul beige il rosso della copertina diventa inchiostro */

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --testo: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --molla: cubic-bezier(.19, .78, .16, 1);
  --netta: cubic-bezier(.6, 0, .15, 1);

  --mx: clamp(22px, 4.4vw, 76px);
  --my: clamp(24px, 4.6vh, 46px);

  position: relative;
  isolation: isolate;             /* i livelli della pagina non escono dalla pagina */
  overflow-x: clip;
  background: var(--carta);
  font-family: var(--testo);
  font-optical-sizing: auto;
  color: var(--inchiostro);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.lp .pdc *,
.lp .pdc *::before,
.lp .pdc *::after { box-sizing: border-box; }
.lp .pdc :where(p, h1, h2, dl, dt, dd) { margin: 0; }
.lp .pdc ::selection { background: var(--lilla-chiaro); color: var(--bruno); }

.lp .pdc .solo-lettori {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* etichette: DM Mono, come nel sito */
.lp .pdc .et,
.lp .pdc .pillola,
.lp .pdc .dato dt {
  font-family: var(--mono); font-weight: 400; font-size: 12px; line-height: 1;
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}
/* la pillola del sito: un adesivo */
.lp .pdc .pillola {
  display: inline-block;
  padding: 9px 16px 8px;
  border: 1.5px solid var(--bruno);
  border-radius: 999px;
  background: var(--crema);
  color: var(--bruno);
  line-height: 1.25;
}

/* ═══════════════ I · LA SCENA ═══════════════ */

.lp .scena {
  position: relative;
  height: 620vh;
  background: var(--rosso);
}
.lp .scena.luce { background: var(--carta); }

.lp .palco {
  /* valori di riposo: lo script li sostituisce a ogni misura */
  --hw: min(45vh, 74vw);
  --cx: 50vw; --cy: 62.8vh; --cs: 1;
  --tit: 0; --cornice: 1; --cornice-su: 1; --sw: 1.3; --ded-fs: 5vw;
  --lx: 50%; --ly: 50%; --lr: 40vh; --bagl: 0;
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  z-index: 1;
}

.lp .mondo { position: absolute; inset: 0; overflow: hidden; }
.lp .mondo--rosso { background: var(--rosso); color: var(--crema); --fondo: var(--rosso); --linea: var(--crema); }
.lp .mondo--luce  { background: var(--carta); color: var(--inchiostro); --fondo: var(--carta); --linea: var(--inchiostro);
  visibility: hidden; }
.lp .mondo::after,
.lp .conta::after,
.lp .chiusura::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--grana, none); background-size: 192px 192px;
}

.lp .quadro { position: absolute; inset: 0; }

/* cornice: una pillola in alto, sotto la fascia della barra del sito; tre note in basso */
.lp .palco .et { position: absolute; opacity: var(--cornice); }
.lp .et--genere  { left: var(--mx);  top: max(104px, 12vh); }
.lp .palco .et--genere { opacity: var(--cornice-su); }
.lp .et--data    { left: var(--mx);  bottom: var(--my); }
.lp .et--pagine  { right: var(--mx); bottom: var(--my); }
.lp .palco .et--scorri {
  left: 50%; bottom: var(--my); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 11px;
  opacity: calc(1 - var(--tit) * 3);
}
.lp .et--scorri span { margin-right: -.14em; }
.lp .et--scorri i {
  order: -1; display: block; width: 1px; height: 34px; background: currentColor; opacity: .7;
  transform-origin: 50% 0; animation: filo 2.4s var(--netta) infinite;
}
@keyframes filo {
  0% { transform: scaleY(0); transform-origin: 50% 0; }
  45% { transform: scaleY(1); transform-origin: 50% 0; }
  55% { transform: scaleY(1); transform-origin: 50% 100%; }
  100% { transform: scaleY(0); transform-origin: 50% 100%; }
}
.lp .mondo--rosso .et > span { display: inline-block; animation: affiora 1s var(--molla) 1.1s both; }
.lp .mondo--rosso .et > .pillola { animation: attacca-pillola .5s var(--molla) .95s both; }
@keyframes affiora { from { opacity: 0; transform: translateY(8px); } }
@keyframes attacca-pillola {
  0% { opacity: 0; transform: translate(-5px, -7px) rotate(-5deg) scale(1.16); }
  1% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

/* titolo */
.lp .titolo {
  position: absolute; left: 0; right: 0; top: max(112px, 12.5vh);
  margin: 0; text-align: center;
  font-family: var(--serif); font-weight: 300;
  font-size: min(15.2vw, 25.5vh); line-height: .9; letter-spacing: -.042em;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  /* esce salendo poco e svanendo presto: non attraversa la fascia della barra */
  transform: translate3d(0, calc(var(--tit) * -5vh), 0);
  opacity: calc(1 - var(--tit) * 1.8);
  will-change: transform, opacity;
}
.lp .t-riga {
  display: inline-block; white-space: nowrap; overflow: hidden;
  padding: .1em .06em .24em; margin: -.1em -.06em -.24em;
  transform: translate3d(0, calc(var(--tit) * var(--dy, 0vh)), 0);
}
.lp .t-riga:first-child { --dy: -2.5vh; }
.lp .c { display: inline-block; }
.lp .mondo--rosso .c {
  animation: sali 1.05s var(--molla) both;
  animation-delay: calc(60ms + var(--i) * 34ms);
}
@keyframes sali { from { transform: translateY(112%) rotate(7deg); } }

/* il disegno */
.lp .disegno {
  position: absolute; left: 0; top: 0;
  width: var(--hw); aspect-ratio: 400 / 440;
  transform: translate3d(calc(var(--cx) - 50%), calc(var(--cy) - 50%), 0) scale(var(--cs));
  will-change: transform;
}
.lp .cuore {
  display: block; width: 100%; height: 100%; overflow: visible;
  transform-origin: 50.5% 67%;
  will-change: scale;
}
.lp .cuore .f { fill: var(--fondo); stroke: none; }
.lp .cuore .l {
  fill: none; stroke: var(--linea); stroke-width: var(--sw);
  stroke-linecap: round; stroke-linejoin: round;
}
.lp .cuore .l.t { stroke-width: calc(var(--sw) * .7); }
.lp .cuore .l.occ { fill: var(--fondo); }

.lp .mondo--rosso .organo .l {
  stroke-dasharray: 1 1.3; stroke-dashoffset: 1.04;
  animation: traccia 1.15s var(--netta) forwards;
  animation-delay: calc(140ms + var(--i) * 15ms);
}
@keyframes traccia { to { stroke-dashoffset: 0; } }

.lp .cuore.colpo-a { animation: colpo-a .46s var(--molla); }
.lp .cuore.colpo-b { animation: colpo-b .46s var(--molla); }
@keyframes colpo-a { 0% { translate: var(--ux) var(--uy); rotate: var(--ur); } 100% { translate: 0 0; rotate: 0deg; } }
@keyframes colpo-b { 0% { translate: var(--ux) var(--uy); rotate: var(--ur); } 100% { translate: 0 0; rotate: 0deg; } }

/* fiori (solo nel mondo di luce) */
.lp .cuore .tinta { stroke: none; opacity: 0; transition: opacity 1.1s var(--netta); }
.lp .cuore .tinta.on { opacity: 1; }
.lp .cuore .tinta--cuore { transition-duration: 1.8s; }
.lp .fiori .velo { fill: var(--fondo); stroke: none; }
.lp .fiori .l { stroke-dasharray: 1 1.3; stroke-dashoffset: 1.04; }

/* dedica */
.lp .dedica {
  position: absolute; left: var(--mx); top: 50%;
  transform: translateY(-54%);
  font-family: var(--serif);
  font-weight: 300; font-size: var(--ded-fs); line-height: 1.1; letter-spacing: -.022em;
  font-variation-settings: "opsz" 144, "SOFT" 100;
}
.lp .riga { display: block; white-space: nowrap; }
.lp .riga--2 { font-style: italic; letter-spacing: -.016em; }
.lp .p {
  display: inline-block; opacity: 0;
  transform: translate3d(0, .42em, 0) rotate(2.5deg);
  transition: opacity .55s var(--netta), transform .95s var(--molla);
}
.lp .p.su { opacity: 1; transform: none; }
.lp .riga--2 .p { transform: translate3d(0, .3em, 0) scale(.94); transform-origin: 0 80%; transition-duration: .8s, 1.2s; }
.lp .riga--2 .p.su { transform: none; }

/* il graffio: anche il cursore ferisce la tela, e la tela si rimargina */
.lp .graffio { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.lp .graffio path { fill: var(--carta); stroke: none; }

/* il bagliore: dalla ferita entra la luce, crema al centro, e si posa sul beige */
.lp .bagliore {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at var(--lx) var(--ly), rgba(255, 246, 230, .55) 0, rgba(255, 246, 230, .25) calc(var(--lr) * .5), rgba(255, 246, 230, 0) var(--lr));
  opacity: var(--bagl);
}
/* il bordo dei tagli: la tela rossa ha uno spessore, e fa ombra sulla carta */
.lp .bordo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.lp .bordo path { fill: none; stroke: var(--rosso-notte); stroke-linejoin: round; }
.lp .bordo .ombra { transform: translate(5px, 8px); }
.lp .bordo .filo { stroke-width: 1.5; opacity: .42; }

/* ═══════════════ II · 158 ═══════════════ */

.lp .conta { position: relative; height: 240vh; margin-top: -20vh; background: transparent; }
.lp .conta-fermo {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; place-items: center; align-content: center;
}
.lp .numero {
  --peso: 100;
  position: relative;
  font-family: var(--serif);
  font-size: min(41vw, 76vh); line-height: .78;
  font-weight: var(--peso);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -.02em;
  color: var(--rosso);
  white-space: nowrap;
  padding-bottom: .06em;
}
.lp .cifra { display: inline-block; width: .6em; text-align: center; transition: opacity .3s; }
.lp .cifra.fantasma { opacity: .16; }       /* le pagine che devono ancora cadere */
.lp .conta-et {
  font-family: var(--serif);
  font-style: italic; font-weight: 300;
  font-size: min(6.4vw, 11vh); line-height: 1; letter-spacing: -.02em;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  margin-top: -.08em;
  justify-self: center;
  transform: translateX(min(16vw, 30vh));
}

/* ═══════════════ III · IL LIBRO, POSATO TRA I PETALI ═══════════════
   È già giorno: il beige è entrato dalle ferite. Qui entra il bruno. */

.lp .chiusura {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  padding: 15vh var(--mx) 21vh;
  background: var(--beige); color: var(--bruno);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(32px, 6vw, 110px);
  align-items: center;
}

/* la copertina: un adesivo posato */
.lp .ch-libro { position: relative; z-index: 6; display: grid; place-items: center; }
.lp .copertina {
  width: min(24vw, 40vh);
  transition: transform .62s var(--molla) .1s, opacity .01s linear .1s;
}
.lp .chiusura:not(.dentro) .copertina { opacity: 0; transform: translate3d(0, -30px, 0) rotate(-7deg) scale(1.12); }
.lp .cop {
  display: block; width: 100%; height: auto; aspect-ratio: 937 / 1500; object-fit: cover;
  border: 2px solid var(--bruno); border-radius: 6px;
  box-shadow: 0 7px 0 var(--bruno);
  background: var(--rosso);
  transform: rotate(-3deg);
  transition: transform .5s var(--molla), box-shadow .5s var(--molla);
}
@media (hover: hover) {
  .lp .cop:hover { transform: rotate(-1deg) translateY(-4px); box-shadow: 0 11px 0 var(--bruno); }
}

.lp .ch-testo { position: relative; z-index: 6; max-width: 660px; }

/* il titolo in lettere adesive, il segno dell'autrice: arriva come i tagli, un colpo per lettera */
.lp .ch-titolo {
  margin-top: clamp(16px, 2.8vh, 28px);
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(52px, 7.2vw, 124px); line-height: .95; letter-spacing: -.02em;
  font-variation-settings: "SOFT" 100;
  color: #FFF6E6;
  -webkit-text-stroke: .05em #2A1A13;
  paint-order: stroke fill;
  text-shadow: 0 .05em 0 #2A1A13;
}
.lp .ch-riga { position: relative; display: block; width: max-content; max-width: 100%; white-space: nowrap; }
.lp .a { display: inline-block; opacity: 0; }
.lp .chiusura.dentro .a {
  animation: attacca .46s var(--molla) both;
  animation-delay: calc(300ms + var(--i) * 34ms);
}
@keyframes attacca {
  0% { opacity: 0; transform: translate(var(--ux, 0px), var(--uy, -10px)) rotate(var(--ur, 4deg)) scale(1.26); }
  1% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
.lp .chiusura.subito .a { animation: none; opacity: 1; }

/* una scintilla: l'aria di casa */
.lp .scintilla {
  position: absolute; left: 100%; top: -.02em; margin-left: .06em;
  width: .36em; height: .4em; overflow: visible;
  transform-origin: 50% 46%;
  transition: transform .5s var(--molla) .82s, opacity .01s linear .82s;
}
.lp .scintilla .sc-ombra { fill: var(--bruno); stroke: var(--bruno); stroke-width: 3; stroke-linejoin: round; transform: translateY(4px); }
.lp .scintilla .sc-stella { fill: var(--lilla); stroke: var(--bruno); stroke-width: 3; stroke-linejoin: round; }
.lp .chiusura:not(.dentro) .scintilla { opacity: 0; transform: scale(.2) rotate(-50deg); }
.lp .chiusura.dentro .scintilla { animation: brilla 5.2s ease-in-out 1.6s infinite; }
@keyframes brilla { 0%, 78%, 100% { transform: none; } 86% { transform: rotate(14deg) scale(1.14); } 93% { transform: rotate(-5deg) scale(.96); } }

.lp .ch-autrice {
  margin-top: clamp(16px, 2.6vh, 26px);
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(20px, 1.9vw, 30px); line-height: 1;
  font-variation-settings: "SOFT" 100;
  color: var(--bruno);
}

/* i due dati: cifre grandi, etichetta sotto */
.lp .dati { display: flex; flex-wrap: wrap; gap: 18px 48px; margin-top: clamp(26px, 4.6vh, 46px); }
.lp .dato { display: flex; flex-direction: column-reverse; }
.lp .dato dd {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 4.2vw, 64px); line-height: 1; letter-spacing: -.02em;
  font-variation-settings: "SOFT" 100;
  font-variant-numeric: lining-nums;
  color: var(--bruno); white-space: nowrap;
}
.lp .dato dt { margin-top: 10px; color: var(--bruno); }

/* il pulsante del sito: lilla, come i petali che gli si posano accanto */
.lp .ch-azione { margin-top: clamp(28px, 5vh, 52px); }
.lp .bottone {
  --bx: 50%; --by: 50%;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center;
  padding: 22px 34px; border-radius: 999px;
  background: var(--lilla); color: var(--bruno); text-decoration: none;
  font-family: var(--mono); font-weight: 400; font-size: 12px; line-height: 1;
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  transition: transform .5s var(--molla);
  -webkit-tap-highlight-color: transparent;
}
.lp .bottone-t { display: inline-flex; align-items: center; gap: 12px; }
.lp .bottone-f {
  display: inline-block; font-size: 15px; line-height: 12px; letter-spacing: 0;
  transition: transform .5s var(--molla);
}
.lp .bottone-luce {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center;
  padding: inherit; border-radius: inherit;
  background: var(--bruno); color: var(--crema);
  clip-path: ellipse(0% 0% at var(--bx) var(--by));
  transition: clip-path .75s var(--molla);
}
.lp .bottone:hover .bottone-luce,
.lp .bottone:focus-visible .bottone-luce { clip-path: ellipse(125% 240% at var(--bx) var(--by)); }
.lp .bottone:hover .bottone-f,
.lp .bottone:focus-visible .bottone-f { transform: translate(3px, -3px); }
.lp .bottone:active { transform: scale(.97); }
.lp .bottone:focus-visible { outline: 2px solid var(--bruno); outline-offset: 4px; }

/* ingresso della chiusura */
.lp .ch-testo > :not(.ch-titolo) { transition: opacity .9s var(--netta), transform 1.2s var(--molla); transition-delay: calc(var(--n, 0) * 85ms + 120ms); }
.lp .chiusura:not(.dentro) .ch-testo > :not(.ch-titolo) { opacity: 0; transform: translate3d(0, 34px, 0); }

/* i petali che cadono: davanti a tutto, come davanti all'occhio */
.lp .petali {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 5; /* dietro al libro e ai testi della chiusura (z 6), davanti a tutto il resto */
  visibility: hidden;
}
.lp .petali.attivo { visibility: visible; }

/* un salto di scroll non va animato: si arriva e basta */
.lp .pdc.salto *,
.lp .pdc.salto *::before,
.lp .pdc.salto *::after { transition: none !important; }

/* ═══════════════ TELEFONO ═══════════════ */

@media (max-width: 760px), (max-aspect-ratio: 82/100) {
  .lp .scena { height: 640vh; }
  .lp .titolo { top: max(156px, 18.5vh); font-size: min(25vw, 14.2vh); line-height: .84; }
  .lp .t-riga { display: block; }
  .lp .t-riga:first-child { --dy: -2vh; }
  .lp .et--scorri i { height: 26px; }

  .lp .dedica { left: 0; right: 0; top: 70%; transform: none; text-align: center; line-height: 1.14; }

  .lp .conta { height: 270vh; margin-top: -30vh; }
  .lp .numero { font-size: min(53vw, 34vh); }
  .lp .conta-et { font-size: min(11.5vw, 7vh); transform: translateX(17vw); margin-top: .04em; }

  .lp .chiusura {
    grid-template-columns: minmax(0, 1fr); align-content: start; align-items: start;
    row-gap: 3.1vh; padding: 10.5vh var(--mx) 13.5vh;
    text-align: center;
  }
  .lp .copertina { width: min(46vw, 21vh); }
  .lp .ch-testo { max-width: none; }
  .lp .ch-titolo { margin-top: 14px; font-size: min(15vw, 8vh); }
  .lp .ch-riga { margin-inline: auto; }
  .lp .ch-autrice { margin-top: 13px; font-size: 20px; }
  .lp .dati { justify-content: center; gap: 14px 30px; margin-top: 2.6vh; }
  .lp .dato { align-items: center; }
  .lp .dato dd { font-size: clamp(28px, 8.6vw, 40px); }
  .lp .dato dt { margin-top: 8px; }
  .lp .ch-azione { margin-top: 3vh; }
}
@media (max-width: 349px) {
  .lp .et--scorri span { display: none; }
}

/* telefono in orizzontale: titolo a sinistra, cuore a destra, la fascia alta resta libera */
@media (orientation: landscape) and (max-height: 480px) and (min-width: 761px) {
  .lp .titolo { top: 96px; left: var(--mx); right: auto; text-align: left; font-size: 19vh; }
  .lp .et--genere { top: calc(96px + 19vh + 34px); }
}

/* ═══════════════ MENO MOVIMENTO ═══════════════ */

@media (prefers-reduced-motion: reduce) {
  .lp .mondo--rosso .c,
  .lp .mondo--rosso .et > span,
  .lp .mondo--rosso .et > .pillola,
  .lp .et--scorri i { animation: none; }
  .lp .mondo--rosso .organo .l { animation: none; stroke-dashoffset: 0; }
  .lp .cuore.colpo-a,
  .lp .cuore.colpo-b { animation: none; }
  .lp .p,
  .lp .riga--2 .p { transform: none; transition: opacity .4s linear; }
  .lp .palco { transition: opacity .28s linear; }
  .lp .palco.cambio { opacity: 0; }
  .lp .copertina,
  .lp .cop,
  .lp .scintilla,
  .lp .ch-testo > :not(.ch-titolo),
  .lp .fiori .tinta,
  .lp .bottone-luce,
  .lp .bottone-f,
  .lp .cifra { transition-duration: .01s; transition-delay: 0s; }
  .lp .chiusura:not(.dentro) .copertina,
  .lp .chiusura:not(.dentro) .scintilla { transform: none; }
  .lp .chiusura:not(.dentro) .ch-testo > :not(.ch-titolo) { transform: none; }
  .lp .chiusura.dentro .a { animation: none; opacity: 1; }
  .lp .chiusura.dentro .scintilla { animation: none; }
}

/* ═══════════════ SENZA SCRIPT ═══════════════ */

html:not(.pdc-js) .lp .scena { height: auto; }
html:not(.pdc-js) .lp .palco { position: relative; height: auto; min-height: 150vh; --ded-fs: clamp(32px, 6vw, 84px); }
html:not(.pdc-js) .lp .mondo--rosso { position: relative; min-height: 150vh; }
html:not(.pdc-js) .lp .mondo--rosso .organo .l { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
html:not(.pdc-js) .lp .dedica { left: 0; right: 0; top: auto; bottom: 14vh; transform: none; text-align: center; }
html:not(.pdc-js) .lp .p { opacity: 1; transform: none; }
html:not(.pdc-js) .lp .conta { height: auto; margin-top: 0; }
html:not(.pdc-js) .lp .conta-fermo { position: relative; }
html:not(.pdc-js) .lp .chiusura:not(.dentro) .copertina,
html:not(.pdc-js) .lp .chiusura:not(.dentro) .scintilla,
html:not(.pdc-js) .lp .chiusura:not(.dentro) .ch-testo > :not(.ch-titolo) { opacity: 1; transform: none; }
