/* The cover intro with a title that boils like pencil — colours of the site it comes from */
:root {
  --rosso: #d45054;        /* the red of the cover */
  --bordeaux: #68142b;     /* title, logo, button text */
  --carta: #fde4e1;        /* the pink paper under the drawing */
  --carta-scura: #f8cfcb;  /* the warmer corners of the paper */
  --matita: #c9464d;       /* the red pencil of the drawing */
  --timbro: #2c2e2c40;     /* the hard stamp shadow of the button */
  --crema: #fff7b1;        /* the button */
  --crema-bassa: #f6e7a6;
  --serif: 'Libre Baskerville', Georgia, serif;
  --sans: 'Mona Sans Variable', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--carta); color: var(--bordeaux); font-family: var(--serif); overflow: hidden; }

.filtri { position: absolute; width: 0; height: 0; }

.pagina { position: relative; width: 100%; height: 100vh; overflow: hidden; }

/* the paper: pink with warmer corners and a faint grain */
.carta {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, var(--carta-scura) 100%),
    radial-gradient(60% 40% at 50% 46%, #fff1ee 0%, transparent 70%),
    var(--carta);
}
.carta::after {
  content: ''; position: absolute; inset: 0; opacity: .22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .25  0 0 0 0 .27  0 0 0 .55 0'/></filter><rect width='160' height='160' filter='url(%23g)'/></svg>");
}

/* the drawing: centred, sized on the height too; GSAP scales this element from its top */
.disegno {
  position: absolute; left: 50%; top: 54%;
  width: min(58vh, 78vw); aspect-ratio: 400 / 520;
  translate: -50% -50%;
}
.disegno__scala { width: 100%; height: 100%; }
.disegno svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tratti path, .tratti circle, .tratti rect {
  fill: none; stroke: var(--matita); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.tratti .ripasso { stroke-width: .9; opacity: .38; }
.tratti .ombra { stroke-width: 1.1; opacity: .55; }

/* the red veil of the cover, it dissolves when the page is ready */
.velo { position: absolute; inset: 0; background: var(--rosso); }

/* header that arrives once you are in */
.testa {
  position: absolute; top: clamp(14px, 4vh, 34px); left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.marchio { font-size: clamp(15px, min(2.4vw, 3.4vh), 24px); letter-spacing: .32em; padding-left: .32em; color: var(--bordeaux); }
.marchio span { display: inline-block; }
.cartellino {
  font-family: var(--serif); font-style: italic; font-size: clamp(11px, min(1.3vw, 2vh), 14px);
  color: var(--bordeaux); opacity: .75;
}

/* the cover */
.copertina {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(14px, 3.6vh, 34px); text-align: center; padding: 0 16px;
}
.titolo {
  position: relative; font-weight: 400; line-height: 1; color: var(--bordeaux);
  font-size: clamp(30px, min(9vw, 13vh), 118px);
}
.riga { display: block; white-space: nowrap; }
.riga--corsivo { font-style: italic; letter-spacing: -.01em; }
.riga--maiuscolo { letter-spacing: .005em; margin-top: .02em; }
.riga .lettera { display: inline-block; will-change: transform; }
.sottolineato {
  position: absolute; left: 6%; right: 6%; bottom: -.2em; width: 88%; height: .16em; overflow: visible;
}
.sottolineato path { fill: none; stroke: var(--bordeaux); stroke-width: 1.2; stroke-linecap: round; opacity: .55; }
.sottolineato path + path { opacity: .3; }

.frase {
  font-style: italic; font-size: clamp(12px, min(1.7vw, 2.6vh), 21px); line-height: 1.5; color: var(--bordeaux);
  max-width: 34em;
}
.maschera { display: block; overflow: hidden; padding-bottom: .08em; }
.frase__riga { display: block; }

/* the button: cream with the hard stamp shadow, which flattens on hover and press */
.entra {
  position: relative; border: 0; background: none; cursor: pointer; color: var(--bordeaux);
  font-family: var(--serif); font-size: clamp(12px, min(1.3vw, 2.2vh), 16px);
  padding: .78em 1.7em; border-radius: 999px;
  filter: drop-shadow(4px 4px var(--timbro));
  transition: filter .5s cubic-bezier(.215, .61, .355, 1), translate .5s cubic-bezier(.215, .61, .355, 1);
}
.entra__fondo {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, var(--crema) 0%, var(--crema-bassa) 100%);
  box-shadow: inset 0 0 0 1.5px var(--bordeaux), inset 0 2px 0 rgba(255, 255, 255, .7);
}
.entra__scritta { position: relative; }
.entra.calmo, .entra:focus-visible { filter: drop-shadow(0 0 #2c2e2c00); translate: 2px 2px; }
@media (hover: hover) {
  .entra:hover { filter: drop-shadow(0 0 #2c2e2c00); translate: 2px 2px; }
}
.entra:active { translate: 3px 3px; }
.entra:focus-visible { outline: 2px solid var(--bordeaux); outline-offset: 4px; }

/* replay */
.ancora {
  position: absolute; left: 50%; bottom: clamp(14px, 4vh, 34px); translate: -50% 0;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 13px;
  border: 1px solid #68142b33; border-radius: 999px; background: #fff7f5cc; color: var(--bordeaux);
  font-family: var(--sans); font-size: 13px; font-weight: 500; cursor: pointer;
  opacity: 0; visibility: hidden;
}
.ancora svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .ancora:hover { background: #fff; } }
