/* L'aeroplanino di carta */
:root {
  --cielo: #f2ece0;               /* the page */
  --cielo-chiaro: #faf6ee;
  --inchiostro: #1b2747;          /* the words and the lines */
  --inchiostro-tenue: rgba(27, 39, 71, 0.66);
  --foglio: #fffdf8;              /* the front of the sheet */
  --foglio-retro: #f1f4fa;        /* the back of the sheet, a touch of airmail blue */
  --rosso: #d2412f;               /* airmail red: stripes, trail, flag */
  --blu: #2c5aa8;                 /* airmail blue: stripes, trail */
  --cassetta: #24365f;            /* the mailbox */
  --cassetta-chiara: #35507f;
  --palo: #9a6a3f;                /* the wooden post */
  --alto: 100vh;
  --alto-grande: 100vh;
}
@supports (height: 100svh) {
  :root { --alto: 100svh; }
}
@supports (height: 100lvh) {
  :root { --alto-grande: 100lvh; }
}

* { box-sizing: border-box; }
html,
body {
  margin: 0;
  background: var(--cielo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
}
body {
  position: relative;
  overflow-x: clip;
}
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

em {
  font-style: italic;
  color: var(--rosso);
}
h2 {
  margin: 0 0 12px;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-weight: 450;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-variation-settings: 'SOFT' 100;
}
p { margin: 0; }

.occhiello {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blu);
}

/* ---------------------------------------------------------------- the top bar */
.barra {
  position: absolute;
  inset: 0 0 auto;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 56px);
}
.marchio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--inchiostro);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}
.marchio__segno { width: 32px; height: 32px; }
.marchio__bordo { fill: none; stroke: var(--rosso); stroke-width: 2.4; stroke-dasharray: 5 3; }
.marchio__ala { fill: var(--blu); }
.marchio__piega { stroke: var(--foglio); stroke-width: 1.6; fill: none; }
.voci { display: flex; gap: clamp(14px, 2.6vw, 34px); }
.voce {
  display: inline-flex;
  color: var(--inchiostro);
  text-decoration: none;
  font-size: 15px;
  font-weight: 550;
}
.voce > span {
  display: inline-block;
  transition: transform 0.55s cubic-bezier(0.34, 1.8, 0.5, 1), color 0.3s;
  transition-delay: calc(var(--i) * 22ms);
}
@media (hover: hover) {
  .voce:hover > span { transform: translateY(-4px) rotate(-4deg); color: var(--rosso); }
}

/* ---------------------------------------------------------------- the opening */
.apertura {
  position: relative;
  min-height: max(600px, var(--alto-grande));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 24px;
  padding: 96px clamp(16px, 6vw, 96px) 48px;
}
.titolo {
  margin: 0 0 22px;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-weight: 420;
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
}
.riga {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}
.riga > span { display: inline-block; }
.sotto {
  max-width: 30em;
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.5;
  color: var(--inchiostro-tenue);
}
.azioni {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 26px;
  margin-top: 30px;
}
.pillola {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 52px;
  padding: 0 28px;
  color: var(--foglio);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}
.pillola__fondo {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--inchiostro);
  transition: transform 0.7s cubic-bezier(0.3, 2.1, 0.45, 0.9), background 0.3s;
}
.pillola__testo {
  position: relative;
  font-stretch: 100%;
  transition: font-stretch 0.5s cubic-bezier(0.34, 1.6, 0.5, 1), letter-spacing 0.5s;
}
@media (hover: hover) {
  .pillola:hover .pillola__fondo { transform: scale(1.07, 1.12); background: var(--rosso); }
  .pillola:hover .pillola__testo { font-stretch: 118%; letter-spacing: 0.01em; }
}
.pillola:active .pillola__fondo { transform: scale(0.95); }
.cenno {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 550;
  color: var(--inchiostro-tenue);
}
.cenno svg {
  width: 14px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.apertura__foglio {
  justify-self: center;
  height: clamp(240px, 52vh, 420px);
  aspect-ratio: 2 / 3;
}

/* ---------------------------------------------------------------- the route */
.rotta {
  padding: 8vh clamp(16px, 6vw, 96px) 4vh;
}
.blocco {
  width: min(38%, 440px);
  margin-bottom: 42vh;
}
.blocco--dx { margin-left: auto; }
.blocco:last-child { margin-bottom: 30vh; }
.blocco__corpo {
  position: relative;
  padding: 26px 26px 28px;
  border-radius: 22px;
  background: var(--cielo-chiaro);
  box-shadow: 0 1px 0 rgba(27, 39, 71, 0.06), 0 18px 40px -26px rgba(27, 39, 71, 0.4);
}
.blocco__corpo > p {
  font-size: 16px;
  line-height: 1.55;
  color: var(--inchiostro-tenue);
}
.timbro {
  position: absolute;
  top: -26px;
  right: 18px;
  width: 70px;
  height: 70px;
  fill: none;
  stroke: var(--rosso);
  stroke-width: 2.2;
  overflow: visible;
}
.timbro circle:last-of-type { stroke-dasharray: 3 3; stroke-width: 1.4; }
.timbro text {
  fill: var(--rosso);
  stroke: none;
  font-size: 8.6px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-anchor: middle;
}

/* ---------------------------------------------------------------- the loop */
.giro {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 24px;
  padding: 0 clamp(16px, 6vw, 96px);
}
.giro__testo { max-width: 440px; }
.giro__testo .blocco__corpo,
.arrivo__testo .blocco__corpo {
  background: none;
  box-shadow: none;
  padding: 0;
}
.giro__testo h2,
.arrivo__testo h2 { font-size: clamp(32px, 4.2vw, 58px); }
.giro__testo p:last-child,
.arrivo__testo p {
  font-size: 17px;
  line-height: 1.55;
  color: var(--inchiostro-tenue);
}

/* ---------------------------------------------------------------- the landing */
.arrivo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px;
  padding: 30vh clamp(16px, 6vw, 96px) 6vh;
}
.arrivo__testo { max-width: 440px; align-self: center; }
.arrivo__testo .occhiello { color: var(--rosso); }
.bollo {
  display: block;
  width: 150px;
  margin-top: 26px;
  fill: none;
  stroke: var(--rosso);
  stroke-width: 3;
  opacity: 0;
}
.bollo rect:last-of-type { stroke-width: 1.4; }
.bollo text {
  fill: var(--rosso);
  stroke: none;
  font-size: 19px;
  font-weight: 800;
  font-stretch: 120%;
  letter-spacing: 0.1em;
  text-anchor: middle;
}
.arrivo__cassetta {
  justify-self: center;
  width: clamp(200px, 26vw, 330px);
  aspect-ratio: 250 / 370;
}
.piede {
  padding: 28px clamp(16px, 6vw, 96px) 36px;
  border-top: 1px solid rgba(27, 39, 71, 0.14);
  font-size: 14px;
  color: var(--inchiostro-tenue);
}
.piede strong { color: var(--inchiostro); margin-right: 8px; }

/* ---------------------------------------------------------------- the sky over the page */
.cielo {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  width: 100%;
  height: 0;
  pointer-events: none;
}
.scia {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
}
.scia--rosso { stroke: var(--rosso); }
.scia--blu { stroke: var(--blu); }
.scia__maschera {
  fill: none;
  stroke: #fff;
  stroke-width: 12;
  stroke-linecap: butt;
}
.faccia__carta { stroke: rgba(27, 39, 71, calc(0.38 * var(--linea, 1))); stroke-width: 1; stroke-linejoin: round; }
.faccia__ombra { fill: #0f1a36; }
.righe__carta { fill: var(--foglio); }
.righe__rosso { fill: var(--rosso); }
.righe__blu { fill: var(--blu); }
.lettera__bordo { fill: url(#ap-righe); }
.lettera__etichetta { fill: var(--blu); }
.lettera__via {
  fill: var(--foglio);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-anchor: middle;
}
.lettera__francobollo rect:first-child { fill: var(--foglio); stroke: var(--rosso); stroke-width: 1.4; stroke-dasharray: 2.4 2; }
.francobollo__dentro { fill: var(--rosso); }
.francobollo__ala { fill: var(--foglio); }
.lettera__saluto,
.lettera__firma {
  fill: var(--blu);
  font-family: 'Fraunces Variable', Georgia, serif;
  font-style: italic;
  font-size: 19px;
}
.lettera__firma { text-anchor: end; }
.lettera__righe {
  fill: none;
  stroke: var(--blu);
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: 0.7;
}
.cassetta__corpo { fill: var(--cassetta); }
.cassetta__lato { fill: var(--cassetta-chiara); }
.cassetta__costola { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 2; }
.cassetta__bocca { fill: #0b1226; }
.cassetta__porta { fill: var(--cassetta-chiara); stroke: rgba(255, 255, 255, 0.18); stroke-width: 1.5; }
.cassetta__porta--dentro { fill: #2b3d68; }
.cassetta__maniglia { fill: var(--foglio); }
.cassetta__palo { fill: var(--palo); }
.cassetta__palo-ombra { fill: rgba(0, 0, 0, 0.18); }
.cassetta__ombra { fill: rgba(27, 39, 71, 0.14); }
.cassetta__asta { fill: #c9ccd6; }
.cassetta__bandiera { fill: var(--rosso); }
.cassetta__scritta {
  fill: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 750;
  font-stretch: 120%;
  letter-spacing: 0.22em;
}
.cassetta__colpo { fill: none; stroke: var(--inchiostro); stroke-width: 3; stroke-linecap: round; }
.cassetta__tocco { pointer-events: visiblePainted; cursor: pointer; }

/* ---------------------------------------------------------------- phone */
@media (max-width: 760px) {
  .barra { padding: 14px 16px; }
  .voci { gap: 14px; }
  .voce { font-size: 14px; }
  .marchio span { display: none; }
  .apertura {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    padding: 84px 16px 24px;
  }
  .apertura__foglio { height: clamp(200px, 32vh, 300px); }
  .rotta { padding: 6vh 16px 4vh; }
  .blocco { width: 70%; margin-bottom: 36vh; }
  .blocco__corpo { padding: 22px 18px 22px; border-radius: 18px; }
  .blocco__corpo > p { font-size: 15px; }
  .timbro { width: 56px; height: 56px; top: -22px; right: 10px; }
  .giro,
  .arrivo {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 16px;
    padding-right: 16px;
  }
  .arrivo { padding-top: 22vh; gap: 40px; }
  .arrivo__cassetta { width: min(58vw, 240px); order: -1; }
  .piede { padding: 22px 16px 28px; }
}
