/* Invito di Rossella e Luca — solo lavanda e ortensia blu */
:root {
  --carta: #faf8fc;
  --carta-scura: #efeaf7;
  --lavanda: #8674ba;
  --lavanda-chiara: #d6ceee;
  --lavanda-tenue: #ece7f6;
  --ortensia: #4f66a8;
  --ortensia-scura: #2f3b6b;
  --ortensia-piena: #3a4c8c;
  --testo: #2f3b6b;
  --tenue: #7076aa;
  --corsivo: 'Pinyon Script', cursive;
  --serif: 'Cormorant Garamond', Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--carta); color: var(--testo); font-family: var(--serif); font-size: 19px; line-height: 1.5; overflow-x: hidden; }
body.chiuso { overflow: hidden; height: 100svh; }
img { max-width: 100%; display: block; }
.corsivo { font-family: var(--corsivo); font-weight: 400; color: var(--ortensia); line-height: 1.1; }
.maiuscoletto { text-transform: uppercase; letter-spacing: .28em; font-size: 13px; font-weight: 600; color: var(--lavanda); margin: 0; }

/* ---------- 1. L'INVITO CHIUSO: due ante ---------- */
#intro { position: fixed; inset: 0; z-index: 50; perspective: 1700px; perspective-origin: 50% 45%; cursor: pointer; outline: none; }
.ante { position: absolute; inset: 0; transform-style: preserve-3d; }
.anta { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; will-change: transform; }
.anta.sx { left: 0; transform-origin: 0 50%; }
.anta.dx { right: 0; transform-origin: 100% 50%; }
.anta .faccia { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.anta .fuori img { position: absolute; top: 0; height: 100%; width: 200%; max-width: none; object-fit: cover; object-position: 50% 32%; }
.anta.sx .fuori img { left: 0; }
.anta.dx .fuori img { left: -100%; }
.ombra-piega { position: absolute; top: 0; bottom: 0; width: 18px; pointer-events: none; }
.anta.sx .ombra-piega { right: 0; background: linear-gradient(90deg, transparent, rgba(47,59,107,.22)); }
.anta.dx .ombra-piega { left: 0; background: linear-gradient(270deg, transparent, rgba(47,59,107,.22)); }
.anta .dentro { transform: rotateY(180deg); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .42 0 0 0 0 .6 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), #f8f5fc; }
.fiori-anta { position: absolute; top: -2%; width: 120%; opacity: .95; }
.anta.sx .dentro .fiori-anta { right: -6%; transform: scaleX(-1); }
.anta.dx .dentro .fiori-anta { left: -6%; }
/* il sigillo è diviso a metà: ogni metà sta sulla sua anta e si separa quando si apre */
.mezzo-sigillo { position: absolute; top: 61%; width: 46px; height: 92px; overflow: hidden; transform: translateY(-50%); filter: drop-shadow(0 4px 6px rgba(40,30,80,.35)); }
.anta.sx .mezzo-sigillo { right: 0; }
.anta.dx .mezzo-sigillo { left: 0; }
.mezzo-sigillo .cera, .mezzo-sigillo .iniziali { position: absolute; top: 0; width: 92px; height: 92px; }
.anta.sx .mezzo-sigillo .cera, .anta.sx .mezzo-sigillo .iniziali { left: 0; }
.anta.dx .mezzo-sigillo .cera, .anta.dx .mezzo-sigillo .iniziali { left: -46px; }
.mezzo-sigillo .cera { border-radius: 47% 53% 50% 50% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 35% 30%, #b6a6e0 0%, #8674ba 38%, #6a58a3 72%, #55468c 100%);
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.08), inset 0 -7px 13px rgba(40,30,80,.35); }
.mezzo-sigillo .iniziali { display: flex; align-items: center; justify-content: center; white-space: nowrap; font-family: var(--corsivo); font-size: 33px; color: #e9e3f7; text-shadow: 0 -1px 0 rgba(40,30,80,.45), 0 1px 0 rgba(255,255,255,.3); }
.mezzo-sigillo .iniziali em { font-style: normal; font-size: .55em; margin: 0 .05em; }
.tocca { position: absolute; left: 0; right: 0; bottom: calc(26px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-style: italic; color: #fff; font-size: 19px; letter-spacing: .04em; text-shadow: 0 1px 8px rgba(47,59,107,.7); animation: respira 2.2s ease-in-out infinite; pointer-events: none; }
@keyframes respira { 50% { opacity: .4; } }

/* musica e petali */
.tasto-musica { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 60; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--lavanda-chiara); background: rgba(250,248,252,.85); backdrop-filter: blur(6px); display: grid; place-items: center; cursor: pointer; }
.tasto-musica[hidden] { display: none; }
.tasto-musica svg { width: 22px; height: 22px; fill: var(--ortensia); stroke: var(--ortensia); stroke-width: 1.6; stroke-linecap: round; }
.tasto-musica .onde { fill: none; }
.tasto-musica.spento .onde { opacity: .15; }
#petali { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* ---------- 2. L'INVITO ---------- */
main { position: relative; z-index: 1; }
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 40px 18px; overflow: hidden; background: radial-gradient(90% 60% at 50% 45%, #fff 0%, var(--carta) 55%, var(--lavanda-tenue) 100%); }
.pergola { position: absolute; left: 0; right: 0; top: 0; height: 50svh; pointer-events: none; z-index: 1; }
.tralcio { position: absolute; left: 50%; top: -2px; width: max(230vw, 900px); max-width: none; transform-origin: 50% 0; }
.tralcio.dietro { opacity: .55; filter: blur(1px) saturate(.9); transform: translateX(-46%) scaleX(-1); animation: dondola-dietro 9s ease-in-out infinite; }
.tralcio.davanti { transform: translateX(-50%); animation: dondola 7s ease-in-out infinite; }
@keyframes dondola { 0%,100% { transform: translateX(-50%) rotate(-.7deg); } 50% { transform: translateX(-50%) rotate(.7deg); } }
@keyframes dondola-dietro { 0%,100% { transform: translateX(-46%) scaleX(-1) rotate(.6deg); } 50% { transform: translateX(-46%) scaleX(-1) rotate(-.6deg); } }
.ortensie-basso { position: absolute; left: 50%; bottom: -6px; width: max(140vw, 700px); max-width: none; transform: translateX(-50%); pointer-events: none; }
.hero-testo { position: relative; z-index: 2; text-align: center; display: grid; gap: 14px; margin-top: 6vh; }
.nomi { margin: 0; font-family: var(--corsivo); font-weight: 400; color: var(--ortensia); font-size: clamp(54px, 16vw, 92px); line-height: .95; display: grid; }
.nomi .e { font-size: .5em; color: var(--lavanda); }
.data { margin: 0; font-style: italic; font-size: 21px; }
.scorri { position: absolute; z-index: 3; bottom: 22px; left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--tenue); display: grid; justify-items: center; gap: 8px; }
.scorri span { width: 1px; height: 34px; background: linear-gradient(var(--lavanda), transparent); animation: scendi 1.8s ease-in-out infinite; }
@keyframes scendi { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

.sezione { padding: 84px 22px; text-align: center; max-width: 620px; margin: 0 auto; }
.sezione h2 { margin: 6px 0 10px; font-size: clamp(44px, 12vw, 62px); }
.sezione p { margin: 0 0 12px; }

.conto .caselle { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.conto .caselle div { background: #fff; border: 1px solid var(--lavanda-chiara); border-radius: 14px; padding: 14px 4px 10px; box-shadow: 0 6px 18px rgba(79,102,168,.08); }
.conto b { display: block; font-size: clamp(30px, 9vw, 42px); font-weight: 500; color: var(--ortensia); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.conto span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--tenue); }

.annuncio .china { width: 70%; margin: 0 auto 6px; }
.annuncio .grande { font-size: 50px; margin-bottom: 14px; }
.annuncio strong { font-weight: 600; color: var(--ortensia); }
.foto { margin: 40px auto 0; width: min(88vw, 440px); border-radius: 220px 220px 12px 12px; overflow: hidden; box-shadow: 0 18px 40px rgba(47,59,107,.18); border: 6px solid #fff; }
.foto img { width: 100%; transform: scale(1.12); }

.luogo .icona { width: 84px; margin: 0 auto 8px; }
.luogo .icona.piccola { width: 58px; margin-top: 28px; }
.nome-luogo { font-size: 24px; font-weight: 500; line-height: 1.25; }
.indirizzo { font-style: italic; color: var(--tenue); }
.tasti { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.tasto { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .03em; padding: 12px 22px; border-radius: 40px; border: 0; background: var(--ortensia); color: #fff; text-decoration: none; cursor: pointer; box-shadow: 0 8px 18px rgba(79,102,168,.25); transition: transform .2s; }
.tasto:active { transform: scale(.97); }
.tasto.chiaro { background: #fff; color: var(--ortensia); border: 1px solid var(--lavanda-chiara); box-shadow: none; }
.link-piccoli { margin-top: 10px; font-size: 15px; }
.link-piccoli a { color: var(--lavanda); }
.villa { margin: 0 -22px 10px; overflow: hidden; }
.villa img { width: 100%; transform: scale(1.1); }

.programma .linea { list-style: none; padding: 0; margin: 26px auto 0; max-width: 360px; text-align: left; position: relative; }
.programma .linea::before { content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px; border-left: 2px dotted var(--lavanda); }
.programma li { position: relative; padding: 0 0 30px 44px; display: grid; }
.programma li::before { content: ''; position: absolute; left: 3px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--ortensia); }
.programma .ora { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--lavanda); font-weight: 600; }
.programma b { font-family: var(--corsivo); font-weight: 400; font-size: 34px; color: var(--ortensia); line-height: 1.15; }

.conferma .mazzolino { width: 110px; margin: 0 auto; }
.da-definire { color: var(--lavanda); font-style: italic; }
.whatsapp { display: grid; gap: 14px; margin: 26px auto 0; max-width: 330px; }
.tasto-wa { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 22px; border-radius: 40px; color: #fff; text-decoration: none; font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: .02em; box-shadow: 0 10px 22px rgba(47,59,107,.22); transition: transform .2s; }
.tasto-wa:active { transform: scale(.97); }
.tasto-wa svg { width: 26px; height: 26px; fill: #fff; flex: none; }
.tasto-wa.lavanda { background: linear-gradient(135deg, #9a89cc, #8674ba 60%, #7461ab); }
.tasto-wa.ortensia { background: linear-gradient(135deg, #6178bd, #4f66a8 60%, #3f5596); }
form { display: grid; gap: 14px; text-align: left; margin-top: 22px; background: #fff; border: 1px solid var(--lavanda-chiara); border-radius: 18px; padding: 22px 18px; }
form label { display: grid; gap: 6px; font-size: 16px; color: var(--ortensia-scura); }
input, textarea { font: inherit; font-size: 17px; color: var(--testo); padding: 11px 12px; border-radius: 10px; border: 1px solid var(--lavanda-chiara); background: var(--carta); }
input:focus, textarea:focus { outline: 2px solid var(--lavanda); border-color: transparent; }
.scelta { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.scelta label { display: flex; align-items: center; gap: 10px; font-size: 18px; padding: 10px 12px; border: 1px solid var(--lavanda-chiara); border-radius: 10px; }
.scelta input { accent-color: var(--ortensia); width: 18px; height: 18px; padding: 0; }
form .tasto { justify-content: center; margin-top: 4px; }
.nota { font-size: 14px; color: var(--tenue); font-style: italic; text-align: center; margin: 0; }
.grazie { text-align: center; padding: 20px 6px; }
.grazie .corsivo { font-size: 46px; }

.fine { text-align: center; padding: 70px 20px calc(90px + env(safe-area-inset-bottom)); position: relative; }
.fine .corona { width: 220px; margin: 0 auto; }
.iniziali-fine { position: absolute; left: 50%; top: 70px; width: 220px; height: 225px; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; white-space: nowrap; padding-bottom: 8px; font-family: var(--corsivo); font-size: 44px; color: var(--lavanda); }
.iniziali-fine em { font-style: normal; font-size: .5em; }
.fine .maiuscoletto { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) { .tocca, .scorri span, .tralcio { animation: none !important; } }
