html.delivery-loading { visibility: hidden; }

:root {
  --paper: #efe8d8;
  --ink: #161616;
  --cream: #f8f4e9;
  --orange: #ff6a2a;
  --blue: #77b9d7;
  --muted: #6d695f;
  --line: 2px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
}

* { box-sizing: border-box; }
html { background: var(--paper); overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; }

/* ── Briciole confetti ── */
.briciola {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.92;
  transform-origin: center center;
}
@keyframes briciola-fall {
  0%   { transform: translateX(0)       translateY(0)     rotate(0deg);    opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateX(var(--drift)) translateY(105vh) rotate(var(--rot)); opacity: 0; }
}
button { cursor: pointer; }
#app { width: min(100%, 760px); margin: 0 auto; padding: 0 18px 80px; }
#composeView {
  background: url("/images/home-bg.png") center top / cover no-repeat;
  background-color: var(--blue);
  margin: 0 calc(50% - 50vw);
  padding: 40px calc(50vw - 50% + 18px) 60px;
  width: 100vw;
  min-height: 100dvh;
}
.view { animation: appear .3s ease both; }
.hidden { display: none !important; }

.hero { position: relative; padding: 4px 0 24px; }
.eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 900; letter-spacing: .14em; }
.hero .eyebrow { margin-top: -30px; }
h1 { margin: 0; font-size: clamp(58px, 14vw, 96px); line-height: .82; letter-spacing: -.075em; text-transform: uppercase; }

.logo-wrap { position: relative; display: block; width: 100%; }

.logo-title {
  display: block;
  width: 100%;
  height: auto;
}

.logo-pigeon {
  position: absolute;
  width: 16.52%;
  height: auto;
  pointer-events: none;
  transform-origin: 50% 100%;
  mix-blend-mode: darken;
}

.logo-pigeon-1 { left: 0%; top: 0%; width: 16.52%; }
.logo-pigeon-2 { left: 25.41%; top: 12.48%; width: 17.79%; }
.logo-pigeon-3 { left: 48.29%; top: 0%; width: 16.52%; }
.logo-pigeon-4 { left: 69.89%; top: 8.32%; width: 13.98%; }
.logo-pigeon-5 { left: 0%; top: 55.48%; width: 16.52%; }
.logo-pigeon-6 { left: 82.59%; top: 45.77%; width: 16.52%; }
h2 { margin: 0 0 14px; font-size: clamp(36px, 8vw, 60px); line-height: .94; letter-spacing: -.045em; }
.intro { max-width: 520px; margin: 22px 0 0; font-size: 19px; line-height: 1.35; }
.small-intro { font-size: 16px; margin-top: 8px; }

.card { border: var(--line); background: var(--cream); box-shadow: var(--shadow); }
.form-card { padding: 22px; }
label > span { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
input, textarea { width: 100%; border: var(--line); background: #fffdf7; color: var(--ink); padding: 14px; outline: none; }
input:focus, textarea:focus { box-shadow: 4px 4px 0 var(--orange); }
textarea { min-height: 126px; resize: vertical; }
small { color: var(--muted); }
label small { display: block; margin-top: 7px; font-size: 11px; }

.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.route-line { height: 46px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.route-line span { border-top: 1px solid var(--ink); }
.route-line i { font-style: normal; font-size: 22px; }

.primary, .secondary {
  width: 100%; min-height: 58px; border: var(--line); padding: 15px 18px;
  font-weight: 900; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink); text-align: center;
}
.primary { display: flex; justify-content: center; align-items: center; gap: 8px; background: var(--orange); box-shadow: 5px 5px 0 var(--ink); margin-top: 12px; }
.primary > span:last-child:not(:first-child) { margin-left: auto; }
.secondary { margin-top: 12px; background: var(--cream); box-shadow: 5px 5px 0 var(--ink); }
.primary:first-of-type, .secondary:first-of-type { margin-top: 0; }
a.secondary {
  display: flex; justify-content: center; align-items: center;
  text-decoration: none; color: var(--ink); box-sizing: border-box;
}
.whatsapp-button { background: #25d366; }
.primary:hover, .secondary:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 5px 5px 0 var(--ink); }
.text-button { display: block; margin: 22px auto 0; border: 0; border-bottom: 1px solid; background: none; color: var(--ink); }
.error { min-height: 18px; margin: 14px 0 0; font-size: 13px; font-weight: 800; color: #9b2018; }

.home-pigeon-wrap { position: relative; z-index: 5; display: flex; justify-content: flex-end; height: 130px; padding-right: 10px; }
.mini-pigeon-scene { position: relative; width: 168px; height: 190px; }
.mini-pigeon { position: relative; z-index: 5; top: 78px; height: 116px; width: auto; object-fit: contain; transform: rotate(-8deg); transform-origin: 50% 60%; filter: drop-shadow(2px 3px 0 rgba(0,0,0,.15)); user-select: none; animation: miniFlap .5s infinite alternate ease-in-out; }

/* Desktop: firma in flusso sotto il form, allineata a destra */
.poop-signature {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0;
  margin-top: 14px;
  position: relative;
  z-index: 2;
}
.poop-photo { flex-shrink: 0; width: 110px; height: 82px; transform: rotate(-4deg); }
.poop-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }

#composeView { position: relative; }
#composeView::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 480px;
  background: linear-gradient(to bottom, rgba(255,255,255,.55), rgba(255,255,255,0));
  pointer-events: none;
  z-index: 0;
}
#composeView > *:not(.falling-poop):not(.poop-signature) { position: relative; z-index: 2; }
#composeView > .falling-poop { position: absolute; z-index: 5; }
.falling-poop {
  position: absolute; top: 0; left: 0; z-index: 5; pointer-events: none;
  width: 10px; height: 12px; opacity: 0;
  background: #fdf8ec; border: 1.5px solid var(--ink);
  border-radius: 45% 45% 50% 50% / 60% 60% 40% 40%;
  animation: poopFall 3.6s cubic-bezier(.55,0,.85,.35) infinite;
  animation-play-state: paused;
}
.falling-poop.is-active { animation-play-state: running; }

@keyframes poopFall {
  0%   { transform: translate(var(--sx, 0px), var(--sy, 0px)) scale(.5) rotate(-6deg); opacity: 0; }
  6%   { opacity: 1; transform: translate(var(--sx, 0px), var(--sy, 0px)) scale(.8) rotate(0deg); }
  85%  { opacity: 1; transform: translate(var(--ex, 0px), var(--ey, 0px)) scale(1.15) rotate(6deg); }
  93%  { opacity: 1; transform: translate(var(--ex, 0px), calc(var(--ey, 0px) + 3px)) scale(.6, .3) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--ex, 0px), calc(var(--ey, 0px) + 3px)) scale(.4, .2); }
}

.compact-header { padding: 34px 0 24px; }

/* ── Waiting box: scena + info row ── */
.waiting-box {
  border: var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 14px;
}

/* Scena dentro il box — modalità attesa */
.waiting-box > .scene {
  border: none;
  margin: 0;
  width: 100%;
  height: 280px;
  box-shadow: none;
}
/* Ridimensiona elementi interni per l'altezza ridotta */
.waiting-box:not(.landing-mode) .scene .ground  { height: 44px; }
.waiting-box:not(.landing-mode) .scene .cloud-b { top: 150px; }
.waiting-box:not(.landing-mode) .scene .sun     { width: 54px; height: 54px; top: 22px; }

/* Scena durante l'atterraggio: altezza naturale piena */
.waiting-box.landing-mode > .scene {
  height: min(66vh, 520px);
}
.waiting-info {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 12px 14px;
  background: var(--cream);
  border-top: var(--line);
}
.waiting-info__time {
  flex: 1;
  min-width: 0;
}
.waiting-info__sep {
  flex-shrink: 0;
  width: 1px;
  align-self: stretch;
  background: var(--ink);
  opacity: .15;
  margin: 0 14px;
}
.waiting-info__identity {
  flex-shrink: 0;
  width: 90px;
  text-align: center;
}
.waiting-info__img {
  display: block;
  width: 100%;
  height: auto;
}
.waiting-info__name {
  margin: 4px 0 3px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1.2;
}
.waiting-info__desc {
  margin: 0;
  font-size: 9px;
  line-height: 1.4;
  color: var(--muted, #666);
}
.waiting-info__origin {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted, #666);
  line-height: 1.3;
}
/* Box tempo mancante */
.flight-time-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 8px;
  padding: 7px 10px;
  border: var(--line);
  background: var(--orange);
  box-shadow: 3px 3px 0 var(--ink);
}
.flight-time-box__label {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
  opacity: .7;
  line-height: 1;
  margin-bottom: 3px;
}
.flight-time-box__value {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1;
}
#flightCountdown {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  opacity: .7;
}

.waiting-panel {
  margin: 0 0 14px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

/* ── Email CTA ── */
.notify-email {
  padding: 16px 0 10px;
}
.notify-email__card {
  border: var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.notify-email__hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.notify-email__body {
  background: var(--cream);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.notify-email__subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
/* Input + bottone affiancati */
.notify-email__row {
  display: flex;
}
.notify-email__input {
  flex: 1;
  min-width: 0;
  border: var(--line);
  border-right: none;
  background: #fffdf7;
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}
.notify-email__input:focus {
  box-shadow: inset 0 0 0 2px var(--orange);
}
.notify-email__btn {
  flex-shrink: 0;
  background: var(--orange);
  border: var(--line);
  color: var(--ink);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px 16px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.notify-email__btn:hover { transform: none; }
/* Checkbox in box */
.notify-email__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  padding: 10px 12px;
  border: 1.5px solid rgba(22,22,22,.18);
  background: var(--paper);
  line-height: 1.5;
}
.notify-email__consent input[type=checkbox] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  padding: 0 !important;
  border: 1px solid var(--ink) !important;
  background: #fff !important;
  box-shadow: none !important;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--orange);
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: checkbox;
}
.notify-email__pigeon-note {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  display: none; /* nascosto, usato solo come riferimento JS */
}

/* ── Push toggle link ── */
.push-toggle-wrap {
  text-align: center;
  padding: 4px 0 16px;
}
.push-toggle-btn {
  font-size: 11px;
  color: var(--muted);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

/* ── Push accordion ── */
.push-accordion {
  border: var(--line);
  background: var(--cream);
  box-shadow: 4px 4px 0 var(--ink);
  margin-bottom: 16px;
  overflow: hidden;
}
.push-accordion__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: var(--line);
  cursor: pointer;
}
.push-accordion__title {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.push-accordion__x {
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}
.push-accordion__body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.push-accordion__divider {
  height: 1px;
  background: var(--ink);
  opacity: .15;
}
#enablePushButton {
  margin-top: 4px;
}

.pwa-platform {
  border: var(--line);
  padding: 12px 14px;
  background: var(--paper);
}
.pwa-platform__name {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.pwa-platform__steps {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.6;
}
.pwa-platform__steps li + li {
  margin-top: 2px;
}

/* ── Inganna l'attesa banner ── */
/* ── Inganna l'attesa popup ── */
.inganna-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
}
.inganna-popup.hidden {
  display: none;
}
.inganna-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22,22,22,.45);
  cursor: pointer;
}
.inganna-popup__card {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100vw - 32px));
  border: var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: inganna-slide-up .22s ease;
}
@keyframes inganna-slide-up {
  from { transform: translateY(28px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.inganna-popup__hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.inganna-popup__close {
  background: none;
  border: none;
  color: var(--cream);
  font-size: 16px;
  cursor: pointer;
  padding: 0 0 0 12px;
  line-height: 1;
  font-family: inherit;
}
.inganna-popup__body {
  background: var(--cream);
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.inganna-popup__lead {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.4;
  color: var(--ink);
}
.inganna-popup__cta {
  display: block;
  background: var(--orange);
  border: var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .04em;
  text-align: center;
  padding: 15px 20px;
}
.inganna-popup__cta:hover {
  filter: brightness(1.05);
}
.inganna-popup__sub {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.pwa-icon {
  display: inline-block;
  font-size: 11px;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0 3px;
  line-height: 1.4;
  vertical-align: middle;
}

.text-center { text-align: center; }
.text-\[color\:var\(--cream\)\] { color: var(--cream); }

/* ── Spotlight pigeon select ── */
.spotlight-wrap { padding: 20px 0 12px; }
.spotlight-stage { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; gap: 12px; }
.spotlight-nav { width: 38px; height: 38px; border-radius: 50%; border: var(--line); background: var(--paper); box-shadow: 3px 3px 0 var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0; transition: all .1s; }
.spotlight-nav:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.spotlight-card { flex: 1; border: var(--line); background: var(--cream); box-shadow: 6px 6px 0 var(--ink); overflow: hidden; }
.spotlight-card__img { height: 180px; background: var(--blue); border-bottom: var(--line); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.spotlight-card__img .pigeon-figure { width: 150px; height: 100%; }
.spotlight-card__body { padding: 12px 14px; text-align: center; }
.spotlight-card__title { color: var(--orange); font-size: 11px; font-weight: 900; text-transform: uppercase; margin: 0 0 4px; letter-spacing: .05em; }
.spotlight-card__name { font-size: 32px; font-weight: 900; margin: 0 0 6px; letter-spacing: -.03em; line-height: 1; }
.spotlight-card__desc { color: var(--muted); font-size: 13px; margin: 0 0 8px; line-height: 1.3; }
.spotlight-card__stats { font-size: 12px; font-weight: 700; margin: 0; }
.spotlight-dots { display: flex; justify-content: center; gap: 10px; margin: 14px 0 8px; }
.spotlight-dot { width: 14px; height: 14px; border-radius: 50%; border: var(--line); background: transparent; padding: 0; cursor: pointer; transition: background .2s; }
.spotlight-dot.is-active { background: var(--orange); }
.spotlight-counter { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .08em; margin: 0 0 10px; }
.spotlight-choose-btn { width: calc(100% - 32px); margin: 0 16px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pigeon-stats { margin-top: 6px; font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: center; }
.pigeon-stats strong { font-size: 13px; }
.pigeon-stats--new { opacity: .45; font-style: italic; }
.avatar { height: 130px; display: grid; place-items: center; overflow: hidden; }

.pigeon-figure { position: relative; width: 150px; height: 105px; display: grid; place-items: center; }
.pigeon-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(2px 3px 0 rgba(0,0,0,.15)); user-select: none; z-index: 1; transform-origin: 50% 65%; }

.scene { position: relative; overflow: hidden; height: min(66vh, 520px); border: var(--line); background: var(--blue); isolation: isolate; }

/* ── Sky critters (visibili solo durante l'attesa) ── */
.sky-critters { position: absolute; inset: 0; pointer-events: none; z-index: 1; display: none; }
.scene.is-waiting .sky-critters { display: block; }
.critter { position: absolute; will-change: transform; }

/* Piccioni lontani — piccoli, lenti, semitrasparenti */
.critter--pf1 img,
.critter--pf2 img,
.critter--pf3 img,
.critter--pf4 img,
.critter--pf5 img { width: 24px; height: auto; opacity: 0.5; }
.critter--pf1 { top: 8%;  animation: cFlyR 22s linear infinite -4s; }
.critter--pf2 { top: 16%; animation: cFlyL 18s linear infinite -10s; }
.critter--pf3 { top: 11%; animation: cFlyR 26s linear infinite -16s; }
/* gruppo in formazione (volano quasi insieme) */
.critter--pf4 { top: 7%;  animation: cFlyL 20s linear infinite -7s; }
.critter--pf5 { top: 10%; animation: cFlyL 20s linear infinite -8.5s; }

/* Passerotti — più scuri, veloci, piccoli */
.critter--sp1 img,
.critter--sp2 img,
.critter--sp3 img { width: 12px; height: auto; filter: brightness(0.55) saturate(0.2); }
.critter--sp1 { top: 32%; animation: cFlyR  7s linear infinite -1s; }
.critter--sp2 { top: 44%; animation: cFlyL  9s linear infinite -5s; }
.critter--sp3 { top: 26%; animation: cFlyR  6s linear infinite -3s; }

/* Farfalle — emoji, traiettoria ondulata */
.critter--bf1,
.critter--bf2 { font-size: 14px; line-height: 1; }
.critter--bf1 { top: 38%; animation: cFlutter 15s ease-in-out infinite -2s; }
.critter--bf2 { top: 54%; animation: cFlutter 11s ease-in-out infinite -7s; }

/* Moscerini — puntini neri, vibrazione locale */
.critter--gn1,
.critter--gn2,
.critter--gn3,
.critter--gn4 { width: 4px; height: 4px; border-radius: 50%; background: rgba(15,15,15,.55); }
.critter--gn1 { top: 60%; left: 22%; animation: cGnat 2.3s ease-in-out infinite -0.4s; }
.critter--gn2 { top: 66%; left: 48%; animation: cGnat 1.8s ease-in-out infinite -1.1s; }
.critter--gn3 { top: 58%; left: 68%; animation: cGnat 2.6s ease-in-out infinite -0.8s; }
.critter--gn4 { top: 62%; left: 35%; animation: cGnat 2.0s ease-in-out infinite -1.7s; }

@keyframes cFlyR {
  0%   { left: -4%;  transform: scaleX(1); }
  100% { left: 106%; transform: scaleX(1); }
}
@keyframes cFlyL {
  0%   { left: 106%; transform: scaleX(-1); }
  100% { left: -4%;  transform: scaleX(-1); }
}
@keyframes cFlutter {
  0%   { left: -4%;  transform: scaleX(1) translateY(0); }
  20%  {             transform: scaleX(1) translateY(-14px); }
  40%  { left: 40%;  transform: scaleX(1) translateY(9px); }
  60%  {             transform: scaleX(1) translateY(-11px); }
  80%  { left: 86%;  transform: scaleX(1) translateY(7px); }
  100% { left: 106%; transform: scaleX(1) translateY(0); }
}
@keyframes cGnat {
  0%   { transform: translate(0,    0); }
  15%  { transform: translate(9px,  -6px); }
  30%  { transform: translate(-6px, 10px); }
  50%  { transform: translate(13px, 2px); }
  65%  { transform: translate(-7px, -8px); }
  80%  { transform: translate(4px,  9px); }
  100% { transform: translate(0,    0); }
}
.sun { position: absolute; top: 34px; right: 34px; width: 72px; height: 72px; border: var(--line); border-radius: 50%; background: var(--orange); }
.cloud { position: absolute; width: 115px; height: 31px; border: var(--line); border-radius: 50px; background: var(--cream); }
.cloud-a { top: 110px; left: -15px; }
.cloud-b { top: 210px; right: -32px; transform: scale(.7); }
.ground { position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 72px; border-top: var(--line); background: var(--cream); }

.animated-avatar { position:absolute; width:180px; height:130px; left:8%; bottom:55px; }
.animated-avatar .letter { position:absolute; left:70px; bottom:3px; width:40px; height:28px; border:var(--line); background:var(--cream); transform:rotate(6deg); z-index:5; }

/* wing flap illusion: whole bird bobs/tilts, speed & amplitude tuned per personality */
.animated-avatar.depart-piero .pigeon-photo, .animated-avatar.arrive-piero .pigeon-photo { animation: flapSteady .32s infinite alternate ease-in-out; }
.animated-avatar.depart-fulmine .pigeon-photo, .animated-avatar.arrive-fulmine .pigeon-photo { animation: flapFast .11s infinite alternate linear; }
.animated-avatar.depart-beatrice .pigeon-photo, .animated-avatar.arrive-beatrice .pigeon-photo { animation: flapSlow .55s infinite alternate ease-in-out; }
.animated-avatar.depart-kevin .pigeon-photo, .animated-avatar.arrive-kevin .pigeon-photo { animation: flapErratic .28s infinite alternate ease-in-out; }
.animated-avatar.depart-ernesto .pigeon-photo, .animated-avatar.arrive-ernesto .pigeon-photo { animation: flapLazy .6s infinite alternate ease-in-out; }
.animated-avatar.depart-walter .pigeon-photo, .animated-avatar.arrive-walter .pigeon-photo { animation: flapWild .18s infinite alternate ease-in-out; }

.depart-piero { animation: departPiero 4.6s cubic-bezier(.25,.1,.2,1) forwards; }
.depart-fulmine { animation: departFulmine 2.4s forwards; }
.depart-beatrice { animation: departBeatrice 5.6s ease-in-out forwards; }
.depart-kevin { animation: departKevin 5.4s forwards; }
.depart-ernesto { animation: departErnesto 4.9s forwards; }
.depart-walter { animation: departWalter 5.2s forwards; }

.arrive-piero { animation: arrivePiero 5.4s cubic-bezier(.2,.6,.15,1) forwards; }
.arrive-fulmine { animation: arriveFulmine 3.2s forwards; }
.arrive-beatrice { animation: arriveBeatrice 5.8s ease-in-out forwards; }
.arrive-kevin { animation: arriveKevin 5.8s forwards; }
.arrive-ernesto { animation: arriveErnesto 5.3s forwards; }
.arrive-walter { animation: arriveWalter 6s forwards; }

/* landing impact effects (classes are applied directly to .scene) */
.impact-shake { animation: sceneShake .35s ease; }
.impact-shake-hard { animation: sceneShakeHard .5s ease; }
.impact-glow::after { content:""; position:absolute; inset:0; background:radial-gradient(circle at 41% 82%, rgba(255,255,255,.55), transparent 55%); animation: glowPulse .8s ease forwards; pointer-events:none; }
.impact-feathers::before, .impact-feathers::after { content:""; position:absolute; left:41%; bottom:120px; width:14px; height:20px; background:#eee7db; border:var(--line); border-radius:60% 20% 60% 20%; animation: featherPuff .9s ease-out forwards; pointer-events:none; z-index:6; }
.impact-feathers::after { left:46%; bottom:100px; animation-delay:.08s; transform:rotate(30deg); }

.status-panel { padding: 28px 4px 0; }

/* ── Cockpit departure layout ── */
#departureView .scene { height: 240px; }
#departureView .scene .ground { height: 44px; }
#departureView .scene .cloud-b { top: 130px; }
#departureView .scene .animated-avatar { zoom: 0.68; }
.departure-badge { display: flex; align-items: center; justify-content: center; padding: 6px 18px; border-bottom: var(--line); background: var(--paper); }
.departure-badge__pill { background: var(--orange); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 14px; font-size: 10px; font-weight: 900; letter-spacing: .05em; }
.departure-grid { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-bottom: var(--line); }
.departure-grid__cell { padding: 10px 14px; }
.dgc-br { border-right: 1px dashed var(--ink); }
.dgc-bb { border-bottom: 1px dashed var(--ink); }
.departure-grid__label { display: block; font-size: 9px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; letter-spacing: .05em; }
.departure-grid__val { display: block; font-size: 26px; font-weight: 900; line-height: 1; color: var(--ink); }
.departure-grid__val--sm { font-size: 13px; line-height: 1.3; font-weight: 800; }
.departure-log { background: var(--cream); border-bottom: var(--line); }
.departure-log__hdr { padding: 8px 14px; border-bottom: 1px solid var(--ink); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.departure-log__body { padding: 12px 14px; }
.departure-log__title { margin: 0 0 4px; font-size: 15px; font-weight: 900; font-family: monospace; }
.departure-log__status { margin: 0; font-size: 12px; color: var(--muted); font-family: monospace; }
.departure-share { padding: 0 0 8px; }
.departure-share .secondary { margin-top: 0; }
.progress { height: 18px; margin-top: 24px; border: var(--line); background: var(--cream); }
.progress span { display:block; width:0; height:100%; background:var(--orange); transition:width .4s ease; }

.ticket { position:relative; padding:28px; }
.stamp-pigeon { position:absolute; right:16px; top:16px; width:72px; height:auto; transform:rotate(6deg); filter:drop-shadow(2px 2px 0 rgba(0,0,0,.18)); }
.route-summary { max-width:75%; font-size:16px; font-weight:800; }
.metric { margin:30px 0 12px; }
.metric strong { display:block; font-size:clamp(72px,20vw,118px); line-height:.8; letter-spacing:-.07em; }
.metric span { font-size:13px; font-weight:900; text-transform:uppercase; }
.divider { margin:22px 0; border-top:1px dashed var(--ink); }
#shareView .ticket { margin-bottom:28px; }
#shareView .whatsapp-button { margin-top:0; }

.share-email-form {
  margin-top: 10px;
  border: var(--line);
  background: #fffdf7;
  box-shadow: 4px 4px 0 var(--ink);
}
.share-email-form__hdr {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: var(--line);
  background: var(--cream);
  font-size: 16px;
  line-height: 1;
}
.share-email-form__title {
  margin: 0 0 3px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.share-email-form__desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.share-email-form__row {
  display: flex;
  gap: 8px;
  padding: 12px 14px 0;
}
.share-email-form__input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  border: var(--line);
  background: #fffdf7;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.share-email-form__input:focus { box-shadow: 4px 4px 0 var(--orange); }
.share-email-form__btn {
  min-height: 44px;
  padding: 9px 16px;
  border: var(--line);
  background: var(--ink);
  color: var(--cream);
  font: inherit;
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  cursor: pointer;
}
.share-email-form__btn:disabled { opacity: .5; cursor: wait; }
.share-email-form__status {
  min-height: 18px;
  margin: 8px 14px 12px;
  font-size: 13px;
  font-weight: 700;
}
.new-pigeon-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  padding: 14px 16px;
  border: var(--line);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  box-sizing: border-box;
}
.new-pigeon-btn:hover { background: var(--cream); }
.selected-pigeon-mini { margin: 8px 0 18px; font-weight:900; }

/* ── Header logo ── */
.pv-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 190;
  background: var(--paper);
  border-bottom: var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px;
}
.pv-header__logo {
  display: block;
  height: 36px;
  width: auto;
}
.pv-header__copy {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .55;
}

/* spazio sotto l'header fisso per tutte le view interne */
section.view:not(#composeView) { padding-top: 56px; }

.arrival-copy { padding:24px 0 18px; }
.arrival-status { min-height:58px; padding:18px 2px; font-size:17px; font-weight:800; }

/* ── Giornale arrivalView ── */
#arrivalView .arrival-copy { padding:14px 16px 10px; border-bottom:var(--line); }
#arrivalView .arrival-copy .eyebrow { font-size:9px; letter-spacing:.16em; }
#arrivalView #arrivalHeadline { font-size:26px; font-weight:900; text-transform:uppercase; letter-spacing:-.01em; line-height:1.1; margin:4px 0 4px; }
#arrivalView #arrivalRoute { font-size:12px; color:var(--muted); margin:0; }
#arrivalView .waiting-box.landing-mode { margin:14px 14px 0; border:var(--line); box-shadow:5px 5px 0 var(--ink); }
#arrivalView .arrival-status { background:var(--ink); color:var(--paper); font-family:monospace; font-size:11px; font-weight:700; letter-spacing:.04em; padding:10px 12px; min-height:0; margin:8px 14px 0; border:var(--line); }
#arrivalView .arrival-status::before { content:"LOG OPERATIVO"; display:block; font-size:9px; font-weight:900; letter-spacing:.14em; color:var(--orange); margin-bottom:6px; }
#arrivalView #openMessageButton { margin:10px 14px 0; width:calc(100% - 28px); }
.landing-shadow { position:absolute; left:42%; bottom:57px; width:130px; height:20px; border-radius:50%; background:rgba(0,0,0,.22); transform:scale(0); }
.arrival-scene-active .landing-shadow { animation:shadow 5.4s ease forwards; }

.letter-card { position:relative; min-height:270px; padding:42px 30px 30px; border:var(--line); background:#fffdf7; box-shadow:var(--shadow); transform:rotate(-1deg); }
.letter-card p { margin:0; white-space:pre-wrap; font-family:Georgia,serif; font-size:clamp(24px,6vw,36px); line-height:1.35; }
.letter-card footer { margin-top:36px; font-weight:900; }
.paper-fold { position:absolute; right:-2px; top:-2px; width:44px; height:44px; border-left:var(--line); border-bottom:var(--line); background:var(--paper); }
.delivery-proof { margin:30px 0; padding:20px; }

/* ── Pergamena messageView ── */
#messageView { background: var(--blue); }
@keyframes pergDropIn {
  0%   { opacity:0; transform:translateY(-28px) scaleY(.4); }
  70%  { transform:translateY(4px) scaleY(1.02); }
  100% { opacity:1; transform:translateY(0) scaleY(1); }
}
@keyframes pergFloat {
  0%,100% { transform:translateY(0) rotate(-2deg); }
  50%     { transform:translateY(-6px) rotate(2deg); }
}
.perg-sky { position:relative; height:140px; overflow:hidden; background:var(--blue); }
.perg-sky__sun { position:absolute; top:18px; right:24px; width:52px; height:52px; border-radius:50%; background:var(--orange); border:var(--line); }
.perg-sky__cloud { position:absolute; top:32px; left:18px; width:68px; height:26px; border-radius:13px; background:var(--paper); border:var(--line); }
.perg-sky__logo-wrap { position:absolute; top:10px; left:50%; transform:translateX(-50%); border:0; padding:0; background:none; display:flex; }
.perg-sky__pigeon { position:absolute; top:36px; left:52px; animation:pergFloat 3s ease-in-out infinite; }
.perg-sky__pigeon img { height:56px; object-fit:contain; }
.perg-sky__ground { position:absolute; bottom:0; left:0; right:0; height:36px; background:var(--paper); border-top:var(--line); }
.perg-scroll { margin:0 14px; border:var(--line); background:#fffdf7; box-shadow:6px 6px 0 var(--ink); display:flex; flex-direction:column; animation:pergDropIn .6s cubic-bezier(.22,.68,0,1.1) .1s both; transform-origin:top center; }
.perg-roll { height:28px; background:var(--cream); border-bottom:var(--line); display:flex; align-items:center; justify-content:center; }
.perg-roll--bot { border-bottom:0; border-top:var(--line); }
.perg-roll__cylinder { display:block; width:48px; height:12px; border-radius:6px; background:#ddd5c0; border:1.5px solid var(--ink); }
.perg-check { height:8px; background:repeating-linear-gradient(90deg, var(--cream) 0 8px, #fffdf7 8px 16px); border-bottom:1px solid #ddd5c0; }
.perg-check--bot { border-bottom:0; border-top:1px solid #ddd5c0; }
.perg-scroll__hdr { padding:14px 18px 10px; text-align:center; border-bottom:1px dashed #c8c2b0; }
.perg-eyebrow { margin:0 0 4px; font-size:9px; font-weight:900; letter-spacing:.18em; text-transform:uppercase; color:var(--muted); }
.perg-scroll__title { margin:0; font-size:19px; font-weight:900; line-height:1.25; }
.perg-scroll__body { padding:18px; flex:1; overflow:hidden; }
.perg-stamp { float:right; margin:0 0 8px 12px; width:56px; height:56px; border:var(--line); background:var(--cream); display:flex; align-items:center; justify-content:center; transform:rotate(3deg); flex-shrink:0; }
.perg-stamp img { height:40px; object-fit:contain; }
.perg-message { margin:0 0 18px; font-size:15px; line-height:1.7; font-style:italic; color:var(--ink); white-space:pre-wrap; }
.perg-sender { text-align:right; border-top:1px dashed #c8c2b0; padding-top:12px; font-size:14px; font-weight:900; }
.perg-proof { background:var(--cream); border-top:var(--line); padding:10px 14px; }
.perg-proof__main { margin:0 0 2px; font-size:12px; font-weight:900; }
.perg-proof__sub { font-size:11px; color:var(--muted); }
.perg-actions { padding:16px 14px; background:var(--blue); display:flex; flex-direction:column; gap:10px; }
.perg-actions .secondary { margin-top:0; }

.site-footer { position:fixed; bottom:0; left:0; right:0; z-index:200; background:var(--paper); padding:10px 18px; display:flex; justify-content:space-between; align-items:center; gap:16px; border-top:1px solid var(--ink); font-size:11px; font-weight:800; text-transform:uppercase; }
.copy-status { min-height:22px; text-align:center; font-weight:800; }
.whatsapp-preview {
  margin: 10px 0 0; padding: 12px 14px; background: var(--cream);
  border: 2px dashed var(--muted); font-size: 13px; line-height: 1.4;
  color: var(--ink); white-space: pre-wrap; word-break: break-word;
}

@keyframes appear { from { opacity:0; transform:translateY(9px);} to {opacity:1; transform:none;} }
@keyframes miniFlap { from { transform: rotate(-8deg) translateY(0) scaleY(1);} to { transform: rotate(-3deg) translateY(-5px) scaleY(1.04);} }
@keyframes shadow { 0%,40%{transform:scale(0);opacity:0} 100%{transform:scale(1);opacity:.35} }

/* wing-flap illusion on the whole bird: subtle bob + squash, amplitude/speed per personality */
@keyframes flapSteady { from { transform:translateY(0) rotate(-1deg) scaleY(1);} to { transform:translateY(-5px) rotate(1deg) scaleY(1.03);} }
@keyframes flapFast { from { transform:translateY(0) rotate(-3deg) scaleY(.94);} to { transform:translateY(-9px) rotate(3deg) scaleY(1.07);} }
@keyframes flapSlow { from { transform:translateY(0) rotate(-1deg) scaleY(1);} to { transform:translateY(-4px) rotate(1.5deg) scaleY(1.02);} }
@keyframes flapErratic { 0%{transform:translateY(0) rotate(-4deg);} 40%{transform:translateY(-7px) rotate(5deg);} 70%{transform:translateY(-2px) rotate(-6deg);} 100%{transform:translateY(-8px) rotate(3deg);} }
@keyframes flapLazy { from { transform:translateY(0) rotate(-1deg) scaleY(1);} to { transform:translateY(-3px) rotate(1deg) scaleY(1.01);} }
@keyframes flapWild { 0%{transform:translateY(0) rotate(-5deg) skewX(0);} 50%{transform:translateY(-10px) rotate(6deg) skewX(-4deg);} 100%{transform:translateY(-3px) rotate(-3deg) skewX(4deg);} }

/* PIERO — decollo pulito e lineare, nessuna esitazione */
@keyframes departPiero {
  0%   { left:8%;  bottom:55px; transform:rotate(0) scale(1); }
  15%  { left:14%; bottom:60px; transform:rotate(-2deg) scale(1); }
  45%  { left:45%; bottom:170px; transform:rotate(-4deg) scale(.75); }
  100% { left:118%; bottom:400px; transform:rotate(-4deg) scale(.28); }
}
/* FULMINE — scatto fulmineo, quasi perde il controllo per la velocità */
@keyframes departFulmine {
  0%   { left:8%; bottom:55px; transform:scale(1) skewX(0); }
  10%  { left:10%; bottom:52px; transform:scale(1.05,.85) skewX(6deg); }
  22%  { left:38%; bottom:95px; transform:scale(.8) skewX(-22deg); }
  45%  { left:70%; bottom:180px; transform:scale(.5) skewX(-26deg) rotate(-6deg); }
  100% { left:135%; bottom:330px; transform:scale(.12) skewX(-30deg); }
}
/* LADY BEATRICE — decollo ampio, lento e cerimonioso */
@keyframes departBeatrice {
  0%   { left:8%;  bottom:55px; transform:rotate(0) scale(1); }
  25%  { left:18%; bottom:80px; transform:rotate(-6deg) scale(.95); }
  50%  { left:35%; bottom:150px; transform:rotate(5deg) scale(.75); }
  75%  { left:60%; bottom:230px; transform:rotate(-4deg) scale(.55); }
  100% { left:116%; bottom:330px; transform:rotate(2deg) scale(.42); }
}
/* KEVIN — parte nella direzione sbagliata, sbatte, poi corregge la rotta */
@keyframes departKevin {
  0%   { left:8%;  bottom:55px; transform:rotate(0) scale(1); }
  14%  { left:-2%; bottom:70px; transform:rotate(-25deg) scale(.95); }
  24%  { left:-6%; bottom:66px; transform:rotate(-15deg) scale(.93) translateY(4px); }
  38%  { left:5%;  bottom:110px; transform:rotate(140deg) scale(.85); }
  55%  { left:28%; bottom:150px; transform:rotate(200deg) scale(.7); }
  70%  { left:45%; bottom:190px; transform:rotate(360deg) scale(.55); }
  100% { left:120%; bottom:360px; transform:rotate(360deg) scale(.32); }
}
/* ERNESTO — parte, si ferma per "pausa tecnica", riparte scattoso */
@keyframes departErnesto {
  0%   { left:8%;  bottom:55px; transform:scale(1); }
  16%  { left:16%; bottom:60px; transform:scale(.97); }
  38%  { left:16%; bottom:60px; transform:scale(.97); }
  40%  { left:19%; bottom:65px; transform:scale(.95); }
  60%  { left:19%; bottom:65px; transform:scale(.95); }
  62%  { left:24%; bottom:100px; transform:scale(.85); }
  100% { left:112%; bottom:330px; transform:scale(.38); }
}
/* WALTER — decollo scomposto, selvaggio, poco elegante */
@keyframes departWalter {
  0%   { left:8%;  bottom:55px; transform:rotate(0) scale(1); }
  12%  { left:12%; bottom:40px; transform:rotate(14deg) scale(1.02); }
  28%  { left:22%; bottom:95px; transform:rotate(-22deg) scale(.9); }
  46%  { left:38%; bottom:55px; transform:rotate(18deg) scale(.8); }
  64%  { left:55%; bottom:150px; transform:rotate(-16deg) scale(.65); }
  82%  { left:80%; bottom:110px; transform:rotate(10deg) scale(.5); }
  100% { left:120%; bottom:290px; transform:rotate(-8deg) scale(.4); }
}

/* PIERO — atterraggio perfetto, preciso, quasi nessun rimbalzo */
@keyframes arrivePiero {
  0%   { left:-220px; top:40px; transform:scale(.2) rotate(0); }
  55%  { left:44%; top:150px; transform:scale(.85) rotate(0); }
  82%  { left:41%; top:250px; transform:scale(1.02) rotate(0); }
  92%  { left:41%; top:258px; transform:scale(.98) rotate(0); }
  100% { left:41%; top:260px; transform:scale(1) rotate(0); }
}
/* FULMINE — arriva troppo veloce, frenata bruscissima con sbandata */
@keyframes arriveFulmine {
  0%   { left:-240px; top:30px; transform:scale(.1) skewX(-18deg); }
  55%  { left:70%; top:220px; transform:scale(1.15) skewX(10deg); }
  70%  { left:30%; top:255px; transform:scale(1.3) skewX(-14deg) rotate(-8deg); }
  80%  { left:48%; top:245px; transform:scale(.9) skewX(8deg) rotate(6deg); }
  90%  { left:37%; top:265px; transform:scale(1.05) skewX(-4deg) rotate(-3deg); }
  100% { left:41%; top:260px; transform:scale(1) skewX(0) rotate(0); }
}
/* LADY BEATRICE — atterraggio a spirale, aggraziato in più tempi */
@keyframes arriveBeatrice {
  0%   { left:-220px; top:60px; transform:scale(.2) rotate(-8deg); }
  30%  { left:15%; top:100px; transform:scale(.5) rotate(10deg); }
  55%  { left:55%; top:150px; transform:scale(.75) rotate(-8deg); }
  75%  { left:28%; top:200px; transform:scale(.92) rotate(5deg); }
  90%  { left:44%; top:245px; transform:scale(.98) rotate(-2deg); }
  100% { left:41%; top:260px; transform:scale(1) rotate(0); }
}
/* KEVIN — supera la destinazione, torna indietro, ci riprova */
@keyframes arriveKevin {
  0%   { left:-220px; top:40px; transform:scale(.2) rotate(0); }
  35%  { left:60%; top:110px; transform:scale(.7) rotate(0); }
  50%  { left:85%; top:130px; transform:scale(.75) rotate(20deg); }
  62%  { left:60%; top:170px; transform:scale(.8) rotate(200deg); }
  78%  { left:30%; top:210px; transform:scale(.9) rotate(340deg); }
  92%  { left:46%; top:250px; transform:scale(1.05) rotate(360deg); }
  100% { left:41%; top:260px; transform:scale(1) rotate(360deg); }
}
/* ERNESTO — avvicinamento regolamentare con pausa a metà volo */
@keyframes arriveErnesto {
  0%   { left:-220px; top:40px; transform:scale(.2); }
  40%  { left:20%; top:150px; transform:scale(.6); }
  55%  { left:20%; top:150px; transform:scale(.6); }
  57%  { left:22%; top:152px; transform:scale(.62); }
  85%  { left:41%; top:250px; transform:scale(.95); }
  100% { left:41%; top:260px; transform:scale(1); }
}
/* WALTER — atterraggio violento, rimbalza due volte prima di fermarsi */
@keyframes arriveWalter {
  0%   { left:-220px; top:80px; transform:scale(.2) rotate(-12deg); }
  45%  { left:35%; top:150px; transform:scale(.75) rotate(10deg); }
  62%  { left:44%; top:270px; transform:scale(1.1) rotate(-14deg); }
  70%  { left:38%; top:225px; transform:scale(.85) rotate(10deg); }
  80%  { left:44%; top:265px; transform:scale(1.05) rotate(-8deg); }
  88%  { left:39%; top:240px; transform:scale(.92) rotate(5deg); }
  100% { left:41%; top:260px; transform:scale(1) rotate(0); }
}

@keyframes sceneShake { 0%,100%{transform:translateX(0);} 20%{transform:translateX(-6px);} 40%{transform:translateX(5px);} 60%{transform:translateX(-4px);} 80%{transform:translateX(3px);} }
@keyframes sceneShakeHard { 0%,100%{transform:translate(0,0);} 15%{transform:translate(-9px,3px) rotate(-1deg);} 30%{transform:translate(8px,-2px) rotate(1deg);} 45%{transform:translate(-7px,2px) rotate(-1deg);} 60%{transform:translate(6px,-3px);} 75%{transform:translate(-4px,1px);} }
@keyframes glowPulse { 0%{opacity:0;} 30%{opacity:1;} 100%{opacity:0;} }
@keyframes featherPuff { 0%{opacity:1; transform:translate(0,0) rotate(0);} 100%{opacity:0; transform:translate(18px,-38px) rotate(120deg);} }

@media (max-width: 620px) {
  /* layout */
  .two-cols { grid-template-columns: 1fr; }

  #app { padding: 0 8px 14px; }

  /* composeView — padding-bottom abbastanza alto da non finire sotto la cacca fissa (28px+52px+10px) */
  #composeView { padding: 6px calc(50vw - 50% + 8px) 90px; }
  .hero { padding: 0 0 4px; }
  .hero .eyebrow { margin-top: -4px; }
  .intro { font-size: 12px; margin-top: 4px; line-height: 1.25; }
  .home-pigeon-wrap { height: 31px; padding-right: 2px; }
  .mini-pigeon-scene { width: 55px; height: 62px; }
  .mini-pigeon { top: 6px; height: 41px; }
  .form-card { padding: 8px; }
  input, textarea { padding: 7px 8px; font-size: 16px; }
  textarea { min-height: 54px; }
  .two-cols { margin: 4px 0; gap: 5px; }
  .route-line { height: 22px; }
  .primary, .secondary { min-height: 36px; padding: 7px 9px; font-size: 12px; }
  .primary { box-shadow: 3px 3px 0 var(--ink); }
  .secondary { box-shadow: 3px 3px 0 var(--ink); margin-top: 6px; }
  .text-button { margin-top: 6px; font-size: 12px; }
  /* Mobile: firma fissa in basso a destra */
  .poop-signature {
    position: fixed;
    bottom: 36px;
    right: 18px;
    margin-top: 0;
    z-index: 1;
    padding: 0;
  }
  .poop-photo { width: 38px; height: 28px; }
  .error { margin: 4px 0 0; font-size: 11px; }
  label > span { font-size: 10px; margin-bottom: 4px; }

  /* pigeonView */
  .compact-header { padding: 8px 0 6px; }
  h2 { font-size: clamp(20px, 5.5vw, 34px); margin-bottom: 5px; }
  .small-intro { margin-top: 2px; font-size: 12px; }
  .spotlight-card__img { height: 140px; }
  .spotlight-card__name { font-size: 26px; }
  .spotlight-choose-btn { width: calc(100% - 24px); margin: 0 12px; }

  /* departureView / arrivalView */
  .scene { height: 240px; margin-left: -8px; margin-right: -8px; width: calc(100% + 16px); border-left: none; border-right: none; }
  .ground { height: 50px; }
  .animated-avatar { width: 130px; height: 94px; bottom: 38px; }
  .sun { width: 48px; height: 48px; top: 18px; right: 18px; }
  .cloud { width: 80px; height: 22px; }
  .cloud-a { top: 70px; }
  .cloud-b { top: 140px; }
  .status-panel { padding: 8px 4px 0; }
  .progress { margin-top: 8px; height: 8px; }

  /* Arrivo: top scalati da 520px → 240px (×0.37) così il piccione non viene tagliato */
  @keyframes arrivePiero {
    0%   { left:-220px; top:15px;  transform:scale(.2) rotate(0); }
    55%  { left:44%;   top:56px;  transform:scale(.85) rotate(0); }
    82%  { left:41%;   top:93px;  transform:scale(1.02) rotate(0); }
    92%  { left:41%;   top:95px;  transform:scale(.98) rotate(0); }
    100% { left:41%;   top:96px;  transform:scale(1) rotate(0); }
  }
  @keyframes arriveFulmine {
    0%   { left:-240px; top:11px;  transform:scale(.1) skewX(-18deg); }
    55%  { left:70%;    top:81px;  transform:scale(1.15) skewX(10deg); }
    70%  { left:30%;    top:94px;  transform:scale(1.3) skewX(-14deg) rotate(-8deg); }
    80%  { left:48%;    top:91px;  transform:scale(.9) skewX(8deg) rotate(6deg); }
    90%  { left:37%;    top:98px;  transform:scale(1.05) skewX(-4deg) rotate(-3deg); }
    100% { left:41%;    top:96px;  transform:scale(1) skewX(0) rotate(0); }
  }
  @keyframes arriveBeatrice {
    0%   { left:-220px; top:22px;  transform:scale(.2) rotate(-8deg); }
    30%  { left:15%;    top:37px;  transform:scale(.5) rotate(10deg); }
    55%  { left:55%;    top:56px;  transform:scale(.75) rotate(-8deg); }
    75%  { left:28%;    top:74px;  transform:scale(.92) rotate(5deg); }
    90%  { left:44%;    top:91px;  transform:scale(.98) rotate(-2deg); }
    100% { left:41%;    top:96px;  transform:scale(1) rotate(0); }
  }
  @keyframes arriveKevin {
    0%   { left:-220px; top:15px;  transform:scale(.2) rotate(0); }
    35%  { left:60%;    top:41px;  transform:scale(.7) rotate(0); }
    50%  { left:85%;    top:48px;  transform:scale(.75) rotate(20deg); }
    62%  { left:60%;    top:63px;  transform:scale(.8) rotate(200deg); }
    78%  { left:30%;    top:78px;  transform:scale(.9) rotate(340deg); }
    92%  { left:46%;    top:93px;  transform:scale(1.05) rotate(360deg); }
    100% { left:41%;    top:96px;  transform:scale(1) rotate(360deg); }
  }
  @keyframes arriveErnesto {
    0%   { left:-220px; top:15px;  transform:scale(.2); }
    40%  { left:20%;    top:56px;  transform:scale(.6); }
    55%  { left:20%;    top:56px;  transform:scale(.6); }
    57%  { left:22%;    top:56px;  transform:scale(.62); }
    85%  { left:41%;    top:93px;  transform:scale(.95); }
    100% { left:41%;    top:96px;  transform:scale(1); }
  }
  @keyframes arriveWalter {
    0%   { left:-220px; top:30px;  transform:scale(.2) rotate(-12deg); }
    45%  { left:35%;    top:56px;  transform:scale(.75) rotate(10deg); }
    62%  { left:44%;    top:100px; transform:scale(1.1) rotate(-14deg); }
    70%  { left:38%;    top:83px;  transform:scale(.85) rotate(10deg); }
    80%  { left:44%;    top:98px;  transform:scale(1.05) rotate(-8deg); }
    88%  { left:39%;    top:89px;  transform:scale(.92) rotate(5deg); }
    100% { left:41%;    top:96px;  transform:scale(1) rotate(0); }
  }

  /* shareView */
  .ticket { padding: 8px; }
  .stamp-pigeon { right: 8px; top: 8px; width: 54px; }
  .route-summary { max-width: 100%; padding-right: 34px; font-size: 11px; }
  .metric { margin: 8px 0 3px; }
  .divider { margin: 6px 0; }

  /* arrivalView */
  .arrival-copy { padding: 6px 0 4px; }
  .arrival-status { min-height: 20px; padding: 5px 2px; font-size: 12px; }
  #openMessageButton { margin-top: 10px; }
  /* waiting-box mobile */
  .waiting-box { margin-left: -8px; margin-right: -8px; }
  .waiting-box > .scene { height: 200px; border: none; margin: 0; width: 100%; }
  .waiting-box:not(.landing-mode) .scene .ground  { height: 36px; }
  .waiting-box:not(.landing-mode) .scene .cloud-a { top: 80px; }
  .waiting-box:not(.landing-mode) .scene .cloud-b { top: 120px; }
  .waiting-box:not(.landing-mode) .scene .sun     { width: 42px; height: 42px; top: 16px; right: 20px; }
  .waiting-box.landing-mode > .scene { height: 240px; }
  .waiting-info { padding: 10px 12px; }
  .waiting-info__identity { width: 72px; }
  .waiting-info__sep { margin: 0 10px; }
  .flight-time-box { padding: 5px 8px; box-shadow: 2px 2px 0 var(--ink); margin-bottom: 5px; }
  .flight-time-box__value { font-size: 18px; }
  #flightCountdown { font-size: 9px; }

  /* waitingPanel */
  .waiting-panel { padding: 0; }
  .pwa-platform { padding: 6px 8px; }
  .pwa-platform__steps { font-size: 10px; }

  /* messageView */
  .letter-card { padding: 14px 8px 10px; min-height: 0; }
  .letter-card p { font-size: clamp(14px, 3.8vw, 20px); }
  .letter-card footer { margin-top: 10px; }
  .delivery-proof { padding: 8px; margin: 10px 0; }

  /* footer */
  .site-footer { flex-wrap: wrap; gap: 2px 8px; padding: 6px 8px; font-size: 9px; }
}

@media (max-width: 380px) {
  .scene { height: 280px; }
  .animated-avatar { width: 140px; height: 100px; }
  .metric strong { font-size: clamp(52px, 20vw, 90px); }
}
.email-alternative {
  width: 100%;
  margin-top: 18px;
}

.email-alternative__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: #777167;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.email-alternative__divider::before,
.email-alternative__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(20, 20, 20, 0.22);
}

.email-alternative__label {
  display: block;
  margin-bottom: 12px;
  color: #171717;
  font-size: 16px;
  line-height: 1.4;
}

.email-alternative__row {
  display: flex;
  gap: 10px;
}

.email-alternative__input {
  min-width: 0;
  flex: 1;
  min-height: 48px;
  padding: 12px 14px;
  border: 2px solid #171717;
  border-radius: 0;
  background: #fffdf8;
  color: #171717;
  font: inherit;
}

.email-alternative__input:focus {
  outline: 3px solid rgba(23, 23, 23, 0.16);
  outline-offset: 2px;
}

.email-alternative__button {
  min-height: 48px;
  padding: 12px 16px;
  border: 2px solid #171717;
  border-radius: 0;
  background: #171717;
  color: #f3eddf;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.email-alternative__button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.email-alternative__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  color: #5f5a51;
  font-size: 12px;
  line-height: 1.35;
}

.email-alternative__consent input {
  width: auto;
  flex: 0 0 auto;
  margin: 2px 0 0;
  padding: 0;
  border: none;
  background: none;
  accent-color: var(--ink);
}

.email-alternative__status {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.email-alternative__status.is-success {
  color: #276333;
}

.email-alternative__status.is-error {
  color: #9f2525;
}

@media (max-width: 600px) {
  .email-alternative__row {
    flex-direction: column;
  }

  .email-alternative__button {
    width: 100%;
  }
}
