/* ==========================================================================
   Silvio & Lucia — "Il filo rosso"
   ========================================================================== */

:root {
  /* Colori del matrimonio: bianco, giallino, verdolino. Il rosso resta solo al filo (e alla ceralacca). */
  --paper: #fdfbf4;        /* bianco caldo */
  --paper-2: #f8f1d4;      /* giallino chiaro */
  --paper-3: #efe2a8;      /* giallino */
  --butter: #f3df8b;       /* giallo burro */
  --sage-soft: #e5ecd8;    /* verdolino chiaro */
  --sage: #b9cb9f;         /* verdolino */
  --accent: #5f7650;       /* verde salvia scuro, per testi e dettagli */
  --accent-deep: #3e5034;
  --ink: #252a20;
  --ink-soft: #5f6553;
  --red: #b1172b;
  --red-deep: #7d0d1b;
  --red-bright: #d42a3c;
  --gold: #b49a45;
  --gold-light: #f3df8b;
  --dark: #1e2a1b;         /* verde bosco */

  --f-display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --f-body: "Cormorant Garamond", Garamond, Georgia, serif;
  --f-script: "Pinyon Script", "Snell Roundhand", cursive;
  --f-type: "Courier Prime", "Courier New", monospace;

  --gutter: clamp(16px, 5vw, 64px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.7, 0, .3, 1);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; height: 100vh; height: 100svh; }

/* grana della carta su tutto */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  opacity: .07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* un elemento con l'attributo hidden resta nascosto anche se il suo stile gli dà un display */
[hidden] { display: none !important; }

.nobr { white-space: nowrap; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

main { position: relative; overflow-x: clip; }

/* ---------- elementi comuni ---------- */
.kicker {
  font-family: var(--f-type);
  font-size: .78rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .8rem;
}

h2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2.6rem, 2rem + 4vw, 5.4rem);
  line-height: 1;
  letter-spacing: -.02em;
  margin: 0;
}

.section-head { text-align: center; position: relative; z-index: 2; padding: 0 var(--gutter); }
.section-sub { color: var(--ink-soft); font-style: italic; max-width: 34rem; margin: 1rem auto 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .95em 1.6em;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--f-type);
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .3s var(--ease-out), background .3s, color .3s;
}
.btn:hover { transform: translateY(-2px); background: var(--accent); border-color: var(--accent); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { color: var(--paper); }
.btn--small { padding: .7em 1.2em; font-size: .72rem; }

.link-btn {
  background: none; border: 0; padding: .4em 0;
  font-family: var(--f-type); font-size: .8rem; letter-spacing: .08em;
  color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 4px;
  cursor: pointer;
  position: relative; z-index: 2;
}
.link-btn:hover { color: var(--accent); }

:focus-visible { outline: 2px dashed var(--accent); outline-offset: 4px; }

/* ==========================================================================
   0. INTRO — busta e ceralacca
   ========================================================================== */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 1.2s var(--ease-in-out) .85s, opacity .6s ease 1.6s;
}
.intro.is-opening { transform: translateY(104%); }
.intro.is-opening { opacity: 0; }

.envelope { position: absolute; inset: 0; perspective: 1400px; }

.envelope__pocket {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top right, transparent 49.7%, rgba(0,0,0,.06) 50%, transparent 50.6%) left bottom / 50.1% 58% no-repeat,
    linear-gradient(to top left, transparent 49.7%, rgba(0,0,0,.06) 50%, transparent 50.6%) right bottom / 50.1% 58% no-repeat,
    radial-gradient(ellipse at 50% 60%, transparent 40%, rgba(150,135,50,.16) 100%),
    var(--paper-2);
}

.envelope__flap {
  position: absolute; inset: 0 0 auto 0;
  height: 56%;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  filter: drop-shadow(0 6px 10px rgba(90,80,20,.22));
  transition: transform 1s var(--ease-in-out) .3s;
  z-index: 1;
}
.envelope__flap::before {
  content: "";
  position: absolute; inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background:
    radial-gradient(ellipse at 50% 0, rgba(255,255,255,.35), transparent 60%),
    linear-gradient(180deg, #f6ecc0, var(--paper-3));
}
.intro.is-opening .envelope__flap { transform: rotateX(178deg); }

.intro__address {
  position: absolute;
  left: 50%; bottom: 12%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
  width: min(90vw, 520px);
}
.intro__to {
  display: block;
  font-family: var(--f-type); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink-soft);
}
.intro__from {
  display: block;
  font-family: var(--f-script);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  line-height: 1.3;
  color: var(--ink);
}

.seal {
  position: absolute;
  left: 50%; top: 56%;
  width: 132px; height: 132px;
  margin: -66px 0 0 -66px;
  padding: 0; border: 0; background: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 3;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  animation: sealPulse 2.6s ease-in-out infinite;
}
.intro.is-holding .seal, .intro.is-opening .seal { animation: none; }

@keyframes sealPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.seal__ring {
  position: absolute; left: 50%; top: 50%;
  width: 184px; height: 184px;
  margin: -92px 0 0 -92px;
  transform: rotate(-90deg);
  overflow: visible;
  pointer-events: none;
}
.seal__ring-track { fill: none; stroke: rgba(125,13,27,.15); stroke-width: 2; stroke-dasharray: 2 6; }
.seal__ring-fill {
  fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.intro.is-opening .seal__ring { opacity: 0; transition: opacity .2s; }

.seal__half {
  position: absolute; inset: 0;
  border-radius: 50% 47% 52% 49% / 49% 53% 47% 51%;
  background:
    radial-gradient(circle at 34% 28%, #ec6070 0%, #c21d33 26%, #9a1024 58%, #6a0816 100%);
  box-shadow:
    inset 0 0 0 11px rgba(0,0,0,.07),
    inset 0 0 0 13px rgba(255,255,255,.10),
    inset -7px -9px 16px rgba(0,0,0,.38),
    inset 7px 7px 14px rgba(255,255,255,.2),
    0 12px 26px rgba(60,10,10,.45);
  transition: transform 1.2s cubic-bezier(.45,0,.8,.4), opacity 1.2s;
}
.seal__half::before {
  /* colatura irregolare della cera */
  content: "";
  position: absolute; inset: -7px;
  border-radius: 44% 56% 49% 51% / 56% 45% 55% 44%;
  background: #a31427;
  z-index: -1;
  box-shadow: 10px 6px 0 -4px #9a1024, -8px 9px 0 -5px #9a1024;
}
.seal__half::after {
  content: attr(data-mono);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-style: italic; font-weight: 700;
  font-size: 2.6rem;
  letter-spacing: -.04em;
  color: #86101f;
  text-shadow: 1px 1px 0 rgba(255,255,255,.28), -1px -1px 0 rgba(0,0,0,.4);
}
.seal__half--l { clip-path: polygon(-10% -10%, 53% -10%, 47% 18%, 56% 34%, 45% 52%, 55% 70%, 47% 86%, 51% 110%, -10% 110%); }
.seal__half--r { clip-path: polygon(53% -10%, 110% -10%, 110% 110%, 51% 110%, 47% 86%, 55% 70%, 45% 52%, 56% 34%, 47% 18%); }

.intro.is-opening .seal__half--l { transform: translate(-70px, 115vh) rotate(-70deg); }
.intro.is-opening .seal__half--r { transform: translate(60px, 115vh) rotate(55deg); transition-delay: .06s; }

.intro__hint {
  position: absolute;
  left: 0; right: 0; top: calc(56% + 110px);
  text-align: center;
  font-family: var(--f-type); font-size: .74rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--red-deep);
  z-index: 3;
  margin: 0;
  transition: opacity .3s;
}
.intro.is-opening .intro__hint { opacity: 0; }
.intro__hint.is-nudge { animation: nudge .5s; }
@keyframes nudge {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ==========================================================================
   FILO ROSSO
   ========================================================================== */
.thread {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}
.thread path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.thread__shadow { stroke: rgba(40, 0, 5, .18); stroke-width: 4.5; transform: translate(2px, 4px); }
.thread__base { stroke: var(--red); stroke-width: 3; }
.thread__twist { stroke: #ff8a8f; stroke-width: 1.1; stroke-dasharray: 2.5 4.5; opacity: .75; }
.thread__tip {
  fill: var(--red-bright);
  filter: drop-shadow(0 0 6px rgba(212, 42, 60, .8));
  opacity: 0;
  transition: opacity .4s;
}
body.is-open .thread__tip { opacity: 1; }
body.is-threaded-end .thread__tip { opacity: 0; }

/* ==========================================================================
   1. HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(28px, 51px, 64px) var(--gutter) clamp(90px, 119px, 140px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(170, 160, 70, .16) 100%),
    var(--paper);
  overflow: hidden;
}
.hero__dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.eyebrow {
  position: relative; z-index: 2;
  text-align: center;
  font-family: var(--f-type);
  font-size: .8rem;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.hero__names {
  position: relative; z-index: 2;
  margin: 0;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(4.6rem, 20vw, 17rem);
  line-height: .86;
  letter-spacing: -.035em;
  display: grid;
  grid-template-columns: 1fr;
}
.name { display: block; white-space: nowrap; }
.name--lui { justify-self: start; padding-left: 2vw; }
.name--lei { justify-self: end; font-style: italic; padding-right: 2vw; }

.amp {
  position: relative;
  justify-self: center;
  font-family: var(--f-script);
  font-size: .9em;
  line-height: .62;
  color: var(--red);
  margin: -.06em 0 -.02em;
  opacity: 0;
  transform: scale(.6) rotate(-12deg);
  transition: opacity 1s ease 1.2s, transform 1.4s var(--ease-out) 1.2s;
}
.amp__loop {
  position: absolute;
  left: calc(50% - .5em); top: 36%;
  width: 1em; height: .34em;
  pointer-events: none;
}

.name .ch {
  display: inline-block;
  transform: translateY(105%) rotate(6deg);
  opacity: 0;
  transition: transform 1.3s var(--ease-out), opacity 1s ease;
  transition-delay: calc(var(--i) * 55ms + var(--d, 0ms));
}
.name { overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.name--lei { --d: 380ms; }

body.is-open .name .ch { transform: none; opacity: 1; }
body.is-open .amp { opacity: 1; transform: none; }

.hero__tag {
  position: relative; z-index: 2;
  text-align: center;
  font-size: clamp(1.2rem, 1rem + 1vw, 1.7rem);
  line-height: 1.3;
  margin: 34px 0 0;
  color: var(--ink-soft);
}
.hero__tag em { color: var(--accent); }

.reveal-hero { opacity: 0; transform: translateY(14px); transition: opacity 1s ease, transform 1.2s var(--ease-out); }
body.is-open .reveal-hero { opacity: 1; transform: none; transition-delay: 1.5s; }
body.is-open .eyebrow.reveal-hero { transition-delay: .9s; }

.scroll-cue {
  position: absolute;
  left: 50%; bottom: clamp(18px, 34px, 36px);
  translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--f-type); font-size: .7rem; letter-spacing: .3em; text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  z-index: 2;
}
.scroll-cue i {
  width: 1px; height: 46px;
  background: linear-gradient(var(--red), transparent);
  animation: cue 2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cue {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1); }
  100% { transform: scaleY(1); opacity: 0; }
}
/* pulsante "Scorri": compare quando si resta fermi */
.guide {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  display: inline-flex; align-items: center; gap: .7em;
  padding: .85em 1.25em .85em 1.5em;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--f-type);
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  box-shadow: 0 10px 26px rgba(30, 42, 27, .35), 0 0 0 4px rgba(253, 251, 244, .55);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: opacity .45s ease, transform .45s var(--ease-out);
}
.guide.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.guide i { font-style: normal; font-size: 1.25em; letter-spacing: 0; display: inline-block; animation: guideBounce 1.3s ease-in-out infinite; }
@keyframes guideBounce { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(4px); } }

/* punta del filo che pulsa quando si è fermi */
.thread__tip { transform-box: fill-box; transform-origin: center; }
body.is-idle .thread__tip { animation: tipPulse 1.3s ease-in-out infinite; }
@keyframes tipPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.8); } }

.hero__exit { position: absolute; right: 8%; bottom: 0; width: 1px; height: 30%; }

/* ==========================================================================
   2. CAMERA OSCURA
   ========================================================================== */
.darkroom {
  position: relative;
  background:
    radial-gradient(ellipse 80% 45% at 50% 0%, rgba(200, 20, 30, .28), transparent 70%),
    radial-gradient(ellipse at 50% 100%, rgba(95, 118, 80, .35), transparent 70%),
    #10150e;
  color: var(--paper);
  padding: clamp(110px, 136px, 180px) 0 clamp(90px, 119px, 160px);
  overflow: hidden;
}
.darkroom .kicker { color: var(--butter); }
.darkroom .section-sub {
  color: rgba(243, 234, 219, .78);
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.85rem);
  line-height: 1.35;
  max-width: 40rem;
}
.darkroom__lamp {
  position: absolute; left: 50%; top: 22px;
  width: 16px; height: 16px; margin-left: -8px;
  border-radius: 50%;
  background: #ff3b4a;
  box-shadow: 0 0 20px 6px rgba(255, 40, 60, .7), 0 0 120px 60px rgba(255, 30, 50, .18);
  animation: lamp 4s ease-in-out infinite;
}
@keyframes lamp { 50% { opacity: .75; } }
/* larghezza fissa: animo solo la parte visibile, così il titolo non va a capo a intermittenza */
.dots { display: inline-block; width: 1.1em; animation: dots 1.6s steps(4) infinite; }
@keyframes dots { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 0 0 0); } }

.line {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: clamp(18px, 4vw, 56px);
  row-gap: clamp(80px, 11vw, 120px);
  padding: clamp(80px, 102px, 120px) var(--gutter) 0;
  max-width: 1280px;
  margin: 0 auto;
}

.photo {
  position: relative;
  z-index: 2;
  width: clamp(138px, 24vw, 250px);
  margin: 0;
}
.photo__hang { transform: translateY(var(--sag, 0px)); }
.photo__sway {
  transform-origin: 50% 0;
  will-change: transform;
  cursor: grab;
}
.clip {
  position: absolute;
  left: 50%; top: -22px;
  width: 16px; height: 44px;
  margin-left: -8px;
  border-radius: 3px;
  background: linear-gradient(90deg, #b88a59, #e0bb86 45%, #c89a66 55%, #9c7043);
  box-shadow: 0 3px 6px rgba(0,0,0,.4);
  z-index: 3;
}
.clip::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: 18px; height: 6px;
  border-radius: 2px; background: #8a8a8a; box-shadow: inset 0 1px 1px rgba(255,255,255,.5);
}
.photo__frame {
  background: #fbf8f1;
  padding: 9px 9px 0;
  box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 2px 4px rgba(0,0,0,.3);
}
.photo__img {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #1b2418;
}
.photo__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: invert(1) sepia(1) saturate(3) hue-rotate(-30deg) brightness(.35) contrast(1.4) blur(2px);
  transition: filter 3.8s cubic-bezier(.3, .1, .3, 1);
}
.photo.is-developed .photo__img img { filter: none; }
.photo figcaption {
  font-family: var(--f-script);
  font-size: clamp(1.05rem, .9rem + .6vw, 1.5rem);
  color: #3a2d25;
  text-align: center;
  line-height: 1;
  padding: 12px 4px 14px;
  opacity: 0;
  transition: opacity 1.5s ease 2.6s;
}
.photo.is-developed figcaption { opacity: 1; }

/* ==========================================================================
   3. GRATTA & SPOSA
   ========================================================================== */
.luck {
  position: relative;
  padding: clamp(110px, 136px, 180px) var(--gutter) clamp(60px, 85px, 110px);
  text-align: center;
}

.ticket {
  position: relative; z-index: 2;
  max-width: 780px;
  margin: clamp(40px, 60px, 70px) auto 26px;
  padding: 0 0 24px;
  background:
    repeating-radial-gradient(circle at 0 0, transparent 0 9px, rgba(168,132,76,.08) 9px 10px),
    repeating-radial-gradient(circle at 100% 100%, transparent 0 9px, rgba(95,118,80,.07) 9px 10px),
    linear-gradient(160deg, #fffdf2, #f7ecbf);
  border-radius: 14px;
  box-shadow: 0 30px 60px -20px rgba(60, 30, 10, .45), 0 0 0 1px rgba(168,132,76,.35);
  transform: rotate(-1.2deg);
  -webkit-mask:
    radial-gradient(circle 11px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 11px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
          mask:
    radial-gradient(circle 11px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 11px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}

.ticket__head {
  display: grid;
  gap: 4px;
  padding: 22px 20px 20px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #6f8a5e, #445a39);
  color: var(--gold-light);
  border-radius: 14px 14px 0 0;
  border-bottom: 3px double var(--gold);
}
.ticket__serial, .ticket__price {
  font-family: var(--f-type);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .85;
}
.ticket__brand {
  font-family: var(--f-display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(2.4rem, 1.5rem + 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: -.02em;
  background: linear-gradient(180deg, #fff3cf 0%, #e2c68f 40%, #a8844c 60%, #f5dfa8 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.35));
}
.ticket__brand i { font-family: var(--f-script); font-weight: 400; padding: 0 .08em; }

.ticket__spots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 3vw, 28px);
  padding: clamp(22px, 4vw, 36px) clamp(18px, 5vw, 50px) 8px;
}
.spot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff, #f8efc8);
  box-shadow: inset 0 0 0 2px rgba(168,132,76,.6), inset 0 0 0 7px #fffaf0, inset 0 0 0 8px rgba(168,132,76,.35);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.spot__prize {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
  color: var(--accent);
}
.spot__prize small {
  font-family: var(--f-type); font-size: clamp(.5rem, .45rem + .3vw, .68rem);
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft);
}
.spot__prize strong {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.6rem, .9rem + 4vw, 3.4rem);
  margin: .12em 0 .08em;
  letter-spacing: -.02em;
}
.spot__prize em { font-family: var(--f-script); font-style: normal; font-size: clamp(.9rem, .7rem + .8vw, 1.3rem); color: var(--ink-soft); }
.spot__prize--place strong {
  font-size: clamp(1rem, .55rem + 2.4vw, 1.9rem);
  line-height: 1;
  text-align: center;
  max-width: 82%;
  margin: .2em 0 .15em;
}
.spot.is-done .spot__prize { animation: pop .7s var(--ease-out); }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

.spot canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='17' fill='%23d9b86a' stroke='%239a7a36' stroke-width='3'/%3E%3Ccircle cx='20' cy='20' r='11' fill='none' stroke='%23b8963f' stroke-width='1.5'/%3E%3Ctext x='20' y='25' text-anchor='middle' font-family='Georgia' font-size='13' font-weight='bold' fill='%23806020'%3E1%3C/text%3E%3C/svg%3E") 20 20, pointer;
  transition: opacity .8s ease;
}
.spot.is-done canvas { opacity: 0; pointer-events: none; }

.ticket__win {
  display: grid;
  gap: 4px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 1s var(--ease-out), opacity .8s, margin .8s;
  padding: 0 20px;
}
.ticket.is-won .ticket__win { max-height: 420px; opacity: 1; margin-top: 12px; }
.ticket__win-big {
  font-family: var(--f-display); font-weight: 900; font-style: italic;
  font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem);
  color: var(--accent);
  line-height: 1;
}
.ticket.is-won .ticket__win-big { animation: wiggle 1.2s ease .3s; }
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-4deg) scale(1.08); }
  40% { transform: rotate(3deg) scale(1.08); }
  60% { transform: rotate(-2deg); }
}
.ticket__win-small { font-style: italic; font-size: 1.15rem; }
.ticket__win-when {
  font-family: var(--f-display);
  font-size: clamp(1.3rem, 1rem + 1.6vw, 1.9rem);
  line-height: 1.2;
}
.ticket__win-where { font-family: var(--f-type); font-size: .85rem; letter-spacing: .08em; color: var(--ink-soft); }
.ticket__maps { justify-self: center; margin-top: .8rem; }

.ticket__foot {
  font-family: var(--f-type);
  font-size: .62rem;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin: 16px 24px 0;
  opacity: .8;
}

/* ==========================================================================
   4. COUNTDOWN
   ========================================================================== */
.countdown {
  position: relative;
  padding: clamp(60px, 85px, 110px) var(--gutter) clamp(110px, 136px, 180px);
  text-align: center;
}
.countdown .kicker { position: relative; z-index: 2; }
.cd {
  position: relative; z-index: 2;
  display: flex;
  justify-content: center;
  gap: clamp(12px, 4vw, 56px);
  transition: filter 1s ease, opacity 1s;
}
.cd__unit { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.cd__num {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 1rem + 8vw, 8rem);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -.03em;
}
.cd__unit:first-child .cd__num { color: var(--accent); font-style: italic; }
.cd__unit small {
  font-family: var(--f-type); font-size: .68rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--ink-soft); margin-top: .8em;
}
.cd__lock {
  position: relative; z-index: 2;
  font-family: var(--f-type); font-size: .78rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--accent);
  margin: 1.2em 0 0;
  height: 1.4em;
  transition: opacity .6s;
}
.countdown.is-locked .cd { filter: blur(14px); opacity: .55; }
.countdown:not(.is-locked) .cd__lock { opacity: 0; }

.cal-btns {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin-top: clamp(24px, 42px, 44px);
  transition: opacity .6s;
}
.countdown.is-locked .cal-btns { opacity: .3; pointer-events: none; }

/* ==========================================================================
   5. RSVP
   ========================================================================== */
.rsvp {
  position: relative;
  padding: clamp(60px, 85px, 110px) var(--gutter) clamp(100px, 119px, 160px);
}
.rsvp .section-sub strong { font-weight: 600; color: var(--ink); }

.letter {
  position: relative; z-index: 2;
  max-width: 660px;
  margin: clamp(36px, 51px, 60px) auto 0;
  padding: clamp(28px, 6vw, 56px) clamp(20px, 6vw, 60px) clamp(28px, 5vw, 48px);
  background:
    linear-gradient(90deg, transparent 0 calc(clamp(20px, 6vw, 60px) - 14px), rgba(177,23,43,.25) calc(clamp(20px, 6vw, 60px) - 14px) calc(clamp(20px, 6vw, 60px) - 13px), transparent 0),
    #fffaf0;
  box-shadow: 0 1px 0 #efe3cb, 0 2px 0 #fffaf0, 0 3px 0 #e8dbc0, 0 30px 60px -20px rgba(60,30,10,.4);
  transform: rotate(-.6deg);
  transition: transform 1s var(--ease-in-out), opacity 1s;
}
.letter__already {
  font-family: var(--f-type); font-size: .78rem; color: var(--accent);
  margin: 0 0 1.2em;
  text-align: center;
}

.choice {
  border: 0; padding: 0; margin: 0 0 1.6rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 3vw, 24px);
}
.stamp-choice { position: relative; cursor: pointer; }
.stamp-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.stamp-choice span {
  display: grid; place-items: center;
  min-height: 74px;
  padding: .6em;
  border: 3px double var(--ink-soft);
  border-radius: 8px;
  font-family: var(--f-type);
  font-weight: 700;
  font-size: clamp(.9rem, .75rem + .6vw, 1.15rem);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
  transform: rotate(-2deg);
  transition: all .35s var(--ease-out);
}
.stamp-choice--no span { transform: rotate(1.6deg); }
.stamp-choice input:focus-visible + span { outline: 2px dashed var(--accent); outline-offset: 4px; }
.stamp-choice:hover span { color: var(--ink); border-color: var(--ink); }
.stamp-choice input:checked + span {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--sage-soft);
  transform: rotate(-4deg) scale(1.04);
  animation: stampIn .45s var(--ease-out);
}
.stamp-choice--no input:checked + span { color: #2c3a6b; border-color: #2c3a6b; background: rgba(44, 58, 107, .06); transform: rotate(3deg) scale(1.04); }
@keyframes stampIn { 0% { transform: scale(1.5) rotate(-8deg); opacity: .3; } 100% { } }

.field { display: block; margin-bottom: 1.2rem; }
.field > span {
  display: block;
  font-family: var(--f-type);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: .2rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(31,26,22,.35);
  border-radius: 0;
  background: transparent;
  font-family: var(--f-script);
  font-size: 1.7rem;
  line-height: 1.3;
  color: #2c3a6b;
  padding: .1em 0 .05em;
  transition: border-color .3s;
}
.field textarea {
  resize: vertical;
  background: repeating-linear-gradient(180deg, transparent 0 calc(1.3em * 1.7 - 1px), rgba(31,26,22,.2) calc(1.3em * 1.7 - 1px) calc(1.3em * 1.7));
  line-height: calc(1.3 * 1.7rem);
  font-size: 1.7rem;
  border-bottom: 0;
}
.field select { font-family: var(--f-body); font-size: 1.3rem; padding: .35em 0; appearance: none; -webkit-appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235d5148' stroke-width='1.5'/%3E%3C/svg%3E") right 4px center no-repeat; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field.is-invalid input { border-color: var(--red); }
.field.is-invalid > span { color: var(--red); }

.field-row { display: grid; grid-template-columns: 9rem 1fr; gap: 1.2rem; }

.if-yes {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .6s var(--ease-out), opacity .5s;
  opacity: 0;
}
.if-yes > * { min-height: 0; overflow: hidden; }
.if-yes { overflow: hidden; }
.if-yes.is-open { grid-template-rows: 1fr; opacity: 1; }
.if-yes-inner { min-height: 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.letter__error { color: var(--red); font-family: var(--f-type); font-size: .8rem; margin: 0 0 1em; }

.btn--send { width: 100%; margin-top: .6rem; padding: 1.15em 1.6em; font-size: .9rem; }
.btn--send[disabled] { opacity: .6; cursor: wait; }

.postmark {
  position: absolute;
  right: -10px; top: -30px;
  width: clamp(120px, 28vw, 170px);
  color: var(--red);
  font-family: var(--f-type);
  opacity: 0;
  transform: scale(3) rotate(-40deg);
  pointer-events: none;
  mix-blend-mode: multiply;
}
.letter.is-sent .postmark { animation: slam .5s cubic-bezier(.5, 0, .75, 0) forwards; }
@keyframes slam {
  0% { opacity: 0; transform: scale(3) rotate(-40deg); }
  80% { opacity: .9; transform: scale(.95) rotate(-16deg); }
  100% { opacity: .85; transform: scale(1) rotate(-16deg); }
}
.letter.is-sent { animation: thud .5s ease .38s; }
@keyframes thud { 50% { transform: rotate(-.6deg) translateY(4px) scale(.992); } }
.letter.is-flying { transform: translate(40vw, -30vh) rotate(18deg) scale(.4); opacity: 0; transition-duration: 1.1s; }

.rsvp__done {
  position: relative; z-index: 2;
  text-align: center;
  max-width: 560px;
  margin: 50px auto 0;
  animation: fadeUp 1s var(--ease-out);
}
.rsvp__done-big {
  font-family: var(--f-script);
  font-size: clamp(3.6rem, 2rem + 8vw, 6.5rem);
  line-height: 1;
  color: var(--accent);
  margin: 0;
}
.rsvp__done-text { font-size: 1.35rem; font-style: italic; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } }

/* ==========================================================================
   6. FINALE
   ========================================================================== */
.finale {
  position: relative;
  background: var(--dark);
  color: var(--paper);
  text-align: center;
  padding: clamp(80px, 102px, 130px) var(--gutter) clamp(60px, 85px, 100px);
}
.knot {
  position: relative; z-index: 2;
  width: clamp(170px, 30vw, 240px);
  overflow: visible;
}
.knot path { fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.knot circle { fill: var(--red); transform-origin: 120px 82px; transform: scale(0); }
.knot.is-tied path { transition: stroke-dashoffset 1.6s var(--ease-out); stroke-dashoffset: 0; }
.knot.is-tied path:nth-child(2) { transition-delay: .9s; }
.knot.is-tied path:nth-child(3) { transition-delay: 1s; }
.knot.is-tied circle { transition: transform .6s var(--ease-out) .7s; transform: scale(1); }

.finale__names {
  font-family: var(--f-display);
  font-size: clamp(2.4rem, 1.5rem + 5vw, 5rem);
  line-height: 1;
  letter-spacing: -.02em;
  margin: .4em 0 .1em;
}
.finale__names i { font-family: var(--f-script); font-style: normal; color: var(--red-bright); }
.finale__date {
  font-family: var(--f-type);
  letter-spacing: .4em;
  color: var(--gold-light);
  margin: 0;
}
.finale__small { font-style: italic; opacity: .7; margin: 2.4em 0 0; }
.finale__credit {
  position: relative; z-index: 2;
  margin: 3.2em 0 0;
  font-family: var(--f-type);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(253, 251, 244, .5);
}
.finale__credit a {
  color: var(--gold-light);
  text-decoration: none;
  border-bottom: 1px solid rgba(243, 223, 139, .4);
  padding-bottom: 2px;
  text-transform: none;
  letter-spacing: .06em;
  transition: color .3s, border-color .3s;
}
.finale__credit a:hover { color: var(--paper); border-color: var(--paper); }

/* ==========================================================================
   Chicchi di riso
   ========================================================================== */
.rice {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 150;
}

/* comparsa generica */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1.1s ease, transform 1.3s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.ticket.reveal { transform: translateY(60px) rotate(3deg); }
.ticket.reveal.is-in { transform: rotate(-1.2deg); }

/* ==========================================================================
   Riso da lanciare
   ========================================================================== */
.shake-btn { margin-top: 1.6rem; }
.btn--ghost-light { background: transparent; color: var(--paper); border-color: rgba(253, 251, 244, .5); }
.btn--ghost-light:hover { background: var(--accent); border-color: var(--accent); }

/* ==========================================================================
   Charlino
   ========================================================================== */
.cat-hint { display: inline-block; margin-top: .7em; color: var(--butter); font-size: 1.05em; }

.charlino {
  position: absolute;
  z-index: -1;               /* dietro al biglietto, alla cartolina o alla foto */
  width: 72px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: catPeek 5s ease-in-out infinite;
}
.charlino svg { display: block; width: 100%; height: auto; overflow: visible; }
.charlino:focus-visible { outline-offset: 2px; }
@keyframes catPeek {
  0%, 62%, 100% { translate: 0 0; }
  70%, 86% { translate: 0 -9px; }
}
.charlino__bubble {
  position: absolute;
  left: 50%; bottom: 100%;
  translate: -50% -4px;
  padding: .25em .7em;
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  font-family: var(--f-type);
  font-size: .72rem;
  letter-spacing: .1em;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
  opacity: 0;
  scale: .6;
  transition: opacity .25s, scale .3s var(--ease-out);
  pointer-events: none;
}
.charlino.is-meow .charlino__bubble { opacity: 1; scale: 1; }
.charlino.is-meow { animation: catJump .6s var(--ease-out); }
@keyframes catJump { 40% { translate: 0 -22px; } 100% { translate: 0 0; } }

/* nascondigli */
.ticket-wrap { position: relative; z-index: 2; max-width: 780px; margin: 0 auto; } /* sopra al filo, con Charlino dietro al biglietto */
.charlino--letter { top: -52px; right: 9%; width: 70px; }
.charlino--ticket { left: -46px; top: 44%; rotate: -90deg; }
.charlino--ticket .charlino__bubble { rotate: 90deg; }
.charlino--photo { right: -44px; top: 42%; width: 62px; rotate: 90deg; }
.charlino--photo .charlino__bubble { rotate: -90deg; }

.cat-toast {
  position: fixed;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top, 0px));
  z-index: 140;
  padding: .7em 1.2em;
  background: var(--dark);
  color: var(--paper);
  border-radius: 999px;
  font-family: var(--f-type);
  font-size: .78rem;
  letter-spacing: .06em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
  opacity: 0;
  transform: translate(-50%, -20px);
  transition: opacity .35s, transform .45s var(--ease-out);
  pointer-events: none;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.cat-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

.secret {
  position: fixed; inset: 0;
  z-index: 160;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(30, 42, 27, .6);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .4s ease;
}
.secret.is-open { opacity: 1; }
.secret__card {
  position: relative;
  width: min(100%, 460px);
  padding: 34px 26px 28px;
  background: var(--paper);
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
  transform: translateY(30px) rotate(-1.5deg);
  transition: transform .6s var(--ease-out);
}
.secret.is-open .secret__card { transform: rotate(-1deg); }
.secret__cat { width: 96px; margin: -78px auto 6px; display: block; }
.secret h2 { font-size: clamp(2rem, 1.5rem + 3vw, 2.8rem); margin-bottom: .5em; }
.secret__text { font-size: 1.2rem; margin: 0 0 .8em; }
.secret__prize { font-family: var(--f-script); font-size: 1.6rem; line-height: 1.25; color: var(--accent-deep); margin: 0 0 1.4em; }

/* ==========================================================================
   Carillon
   ========================================================================== */
.sound {
  position: fixed;
  right: 14px;
  top: calc(14px + env(safe-area-inset-top, 0px));
  z-index: 125;
  display: inline-flex; align-items: center; gap: .45em;
  padding: .55em .9em;
  border: 1px solid rgba(95, 118, 80, .35);
  border-radius: 999px;
  background: rgba(253, 251, 244, .88);
  color: var(--accent-deep);
  font-family: var(--f-type);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease 1.5s;
  -webkit-tap-highlight-color: transparent;
}
body.is-open .sound { opacity: 1; pointer-events: auto; }
.sound__icon { font-size: 1.3em; letter-spacing: 0; line-height: 1; }
.sound.is-off { color: var(--ink-soft); }
.sound.is-off .sound__icon { text-decoration: line-through; text-decoration-thickness: 2px; }

.note-float {
  position: absolute;
  z-index: 3;
  margin: -14px 0 0 -6px;
  font-size: 1.3rem;
  color: var(--red);
  pointer-events: none;
  animation: noteUp 1.6s ease-out forwards;
}
@keyframes noteUp {
  0% { opacity: 0; transform: translate(0, 0) scale(.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), -70px) scale(1.1) rotate(12deg); }
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 640px) {
  .hero__names { font-size: clamp(4.2rem, 23vw, 9rem); }
  .eyebrow { font-size: .68rem; letter-spacing: .22em; }
  .ticket__brand { font-size: 10.5vw; white-space: nowrap; }
  .ticket__serial, .ticket__price { font-size: .56rem; letter-spacing: .14em; }
  .line { column-gap: 16px; row-gap: 86px; }
  .photo { width: calc(50% - 16px); max-width: 190px; }
  .ticket { transform: none; }
  .ticket.reveal { transform: translateY(60px); }
  .ticket.reveal.is-in { transform: none; }
  .ticket__spots { gap: 10px; padding-left: 14px; padding-right: 14px; }
  .charlino--ticket { left: auto; right: 10%; top: -48px; rotate: 0deg; width: 64px; }
  .charlino--ticket .charlino__bubble { rotate: 0deg; }
  .charlino--photo { width: 52px; right: -30px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .cd__unit small { letter-spacing: .15em; font-size: .6rem; }
}

/* ==========================================================================
   Movimento ridotto
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .photo__img img { filter: none; }
}
