/* ─────────────────────────────────────────────────────────────────────────────
   Iscrizione E · «La nicchia di luce»
   The card floats inside a niche of light behind a mashrabiya lattice, like the
   bottles in the strip photos. You write your name and it is struck in gold on
   the card; when you confirm, the card turns over and shows its QR.
   Two moods paired with the two Wallet cards: Notte (oud card) and Giorno (sabbia).
   Mobile-first at 375 px; on a computer the column stays 480 px and the light fills the window.
   ───────────────────────────────────────────────────────────────────────────── */

.e {
  --serif: 'A971 Cifre Serif', 'Cormorant Garamond', Georgia, serif;
  --ease-out: cubic-bezier(.16, .84, .3, 1);
  --ease-carta: cubic-bezier(.2, .75, .15, 1);
  --rx: 7deg;  --ry: -11deg;               /* card tilt, driven by touch/pointer */
}
.e[data-tema="notte"] {
  --fondo: radial-gradient(130% 75% at 72% -6%, #5A4329 0%, #33261A 34%, #211810 68%, #170F09 100%);
  --fondo-piatto: #1C140D;
  --testo: #F3EADB;
  --testo-muto: rgba(243, 234, 219, .66);
  --oro-piccolo: #CDAE73;                 /* small gold text: 6:1 on the night ground */
  --oro-metallo: linear-gradient(100deg, #A27D44 0%, #E9D19B 32%, #B48E53 55%, #F1DCAA 78%, #A98549 100%);
  --linea: rgba(205, 174, 115, .28);
  --campo-linea: rgba(243, 234, 219, .4);
  --errore: #F0A994;
  --luce: 255, 212, 148;
  --arco-luce: #F3D49B;
  --arco-luce-2: rgba(243, 212, 155, 0);
  --arco-bordo: rgba(222, 190, 128, .7);
  --grata: #E3C384;
  --grata-alpha: .22;
  --ombra: rgba(0, 0, 0, .72);
  --raggi-blend: screen;
  --raggi-alpha: .5;
  --pannello: rgba(255, 244, 222, .045);
  color-scheme: dark;
}
.e[data-tema="giorno"] {
  --fondo: radial-gradient(130% 75% at 72% -6%, #FFFBF3 0%, #F4ECDD 36%, #EADFCB 70%, #DCCCB0 100%);
  --fondo-piatto: #E6DAC4;
  --testo: #3B2E1F;
  --testo-muto: rgba(59, 46, 31, .7);
  --oro-piccolo: #7A5C2E;                 /* small gold text: 5:1 on sabbia */
  --oro-metallo: linear-gradient(100deg, #7E5F2E 0%, #B8935A 30%, #8A6A36 55%, #C29E63 78%, #7E5F2E 100%);
  --linea: rgba(138, 106, 54, .3);
  --campo-linea: rgba(59, 46, 31, .38);
  --errore: #A24632;
  --luce: 255, 252, 244;
  --arco-luce: #FFFDF7;
  --arco-luce-2: rgba(255, 250, 238, 0);
  --arco-bordo: rgba(150, 116, 62, .55);
  --grata: #9C7A43;
  --grata-alpha: .2;
  --ombra: rgba(74, 52, 24, .42);
  --raggi-blend: screen;              /* sun streaks, like the Sabbia strip photo */
  --raggi-alpha: .75;
  --pannello: rgba(255, 252, 244, .5);
  color-scheme: light;
}

body.e { background: var(--fondo-piatto) var(--fondo) no-repeat; background-attachment: fixed; color: var(--testo); position: relative; min-height: 100dvh; overflow-x: clip; }

/* film grain over everything */
.grana { position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: 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' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.e[data-tema="giorno"] .grana { opacity: .09; mix-blend-mode: multiply; }

/* light falling from the top right, across the whole window */
.atmosfera { position: absolute; inset: 0 0 auto 0; height: 118svh; overflow: hidden; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.raggi { position: absolute; inset: -30% -60% -10% -20%; opacity: var(--raggi-alpha); mix-blend-mode: var(--raggi-blend); filter: blur(16px);
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(var(--luce), .0) 18%, rgba(var(--luce), .55) 21%, rgba(var(--luce), .0) 26%, transparent 26%),
    linear-gradient(90deg, transparent 0 34%, rgba(var(--luce), .35) 36.5%, rgba(var(--luce), .0) 41%, transparent 41%),
    linear-gradient(90deg, transparent 0 52%, rgba(var(--luce), .5) 55%, rgba(var(--luce), .0) 61%, transparent 61%),
    linear-gradient(90deg, transparent 0 70%, rgba(var(--luce), .28) 72%, rgba(var(--luce), .0) 76%, transparent 76%);
  transform: rotate(-31deg); animation: respiro 16s ease-in-out infinite alternate; }
@keyframes respiro {
  from { transform: rotate(-31deg) translateX(-3%); opacity: calc(var(--raggi-alpha) * .7); }
  to   { transform: rotate(-29deg) translateX(3%);  opacity: var(--raggi-alpha); }
}
/* golden dust in the light */
.polvere i { position: absolute; left: var(--x); top: var(--y); width: var(--s, 2px); height: var(--s, 2px); border-radius: 50%;
  background: rgba(var(--luce), .95); box-shadow: 0 0 6px rgba(var(--luce), .9); opacity: 0;
  animation: pulviscolo var(--t, 12s) linear var(--d, 0s) infinite; }
.e[data-tema="giorno"] .polvere i { background: #C9A96A; box-shadow: 0 0 4px rgba(201, 169, 106, .8); }
@keyframes pulviscolo {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: .85; }
  70% { opacity: .5; }
  100% { transform: translate(-28px, -120px); opacity: 0; }
}

.e-main { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); }
/* pieces that belong to one mood only: hide the other mood, keep each element's own display */
.e[data-tema="notte"] [data-solo="giorno"], .e[data-tema="giorno"] [data-solo="notte"] { display: none !important; }

/* ── the threshold: title, niche, card ─────────────────────────────────────── */
.soglia { padding: 22px 22px 0; }
.soglia__logo { height: 30px; width: auto; }
.soglia .eyebrow { margin-top: 22px; color: var(--oro-piccolo); letter-spacing: .32em; }
.soglia h1 { margin: 12px 0 0; font-family: var(--serif); font-weight: 400; font-size: 52px; line-height: .94; letter-spacing: -.025em; color: var(--testo); }
.soglia h1 em, .oro-testo { font-style: italic; background: var(--oro-metallo); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: luccica 9s ease-in-out infinite; padding-right: .06em; }
.soglia h1 em { display: inline-block; }
.soglia h1:focus { outline: none; }   /* focused only to announce the success */
@keyframes luccica { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
.soglia__sotto { margin: 14px 0 0; max-width: 31ch; font-size: 15px; line-height: 1.55; color: var(--testo-muto); }
.soglia__sotto b { color: var(--testo); font-weight: 600; }

/* the niche is 40 px wider than the card and 400:352 tall: the card stands in its lower half */
.scena { --cw: min(312px, calc(100vw - 58px)); --aw: calc(var(--cw) + 40px); --ah: calc(var(--aw) * 400 / 352);
  position: relative; height: calc(var(--ah) + 8px); margin: 18px -22px 0; perspective: 1100px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.arco { position: absolute; left: 50%; top: 0; width: var(--aw); height: var(--ah); margin-left: calc(var(--aw) / -2); overflow: visible;
  -webkit-mask-image: linear-gradient(#000 74%, transparent 99%); mask-image: linear-gradient(#000 74%, transparent 99%); }
.arco__alone { position: absolute; left: 0; right: 0; top: 10px; height: 360px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--luce), .34), rgba(var(--luce), 0)); filter: blur(6px); }
.e[data-tema="giorno"] .arco__alone { background: radial-gradient(closest-side, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0)); }

.galleggia { position: absolute; left: 50%; top: calc(var(--ah) * .4); width: var(--cw); margin-left: calc(var(--cw) / -2); transform-style: preserve-3d;
  animation: galleggia 7s ease-in-out infinite; }
@keyframes galleggia { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.tilt { transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s var(--ease-out); }
.scena.toccata .tilt { transition-duration: .08s; }
.carta { position: relative; transform-style: preserve-3d; transition: transform 1.1s var(--ease-carta); }
.carta.girata { transform: rotateY(180deg); }

.ombra-carta { position: absolute; left: 50%; top: calc(var(--ah) * .4 + var(--cw) * .73); width: 250px; height: 26px; margin-left: -125px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--ombra), transparent); filter: blur(6px); animation: ombra 7s ease-in-out infinite; }
@keyframes ombra { 0%, 100% { transform: scaleX(1); opacity: .9; } 50% { transform: scaleX(.9); opacity: .7; } }

/* ── generated niche photo (Notte): replaces the drawn arch, same place ──────────
   Photo 1500x2000: outer moulding 206-1294 px (1088 wide, centred), apex at 176, sill face at 1444.
   Scaled so the moulding matches the drawn arch width (--aw); the card floats just above the sill. */
.nicchia-foto { display: none; position: absolute; left: 0; right: 0; z-index: 0; pointer-events: none; overflow: hidden;
  top: calc(var(--aw) * -176 / 1088); height: calc(var(--aw) * 2000 / 1088);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 70%, transparent 90%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 70%, transparent 90%); }
.nicchia-foto img { position: absolute; top: 0; left: 50%; max-width: none; height: auto;
  width: calc(var(--aw) * 1500 / 1088); margin-left: calc(var(--aw) * -750 / 1088); }
@media (min-width: 520px) {
  /* on a computer the column ends inside the photo: fade the sides too */
  .nicchia-foto {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 70%, transparent 90%), linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 70%, transparent 90%), linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
    mask-composite: intersect; }
}
.e[data-tema="notte"][data-nicchia="foto"] .nicchia-foto { display: block; }
.e[data-tema="notte"][data-nicchia="foto"] .arco,
.e[data-tema="notte"][data-nicchia="foto"] .arco__alone { display: none; }
/* the arch keeps the drawn size; the card narrows to the niche opening (inner walls at 310-1190 px = 81% of the moulding) */
.e[data-tema="notte"][data-nicchia="foto"] .scena { --aw: min(352px, calc(100vw - 23px)); --cw: calc(var(--aw) * .81); height: calc(var(--aw) * 1.27); }
.e[data-tema="notte"][data-nicchia="foto"] .lp-carta .pass__primario .campo__v { font-size: 24px; }
.e[data-tema="notte"][data-nicchia="foto"] .lp-carta .pass__riga { gap: 10px; }
.e[data-tema="notte"][data-nicchia="foto"] .galleggia { top: calc(var(--aw) * 1.13 - var(--cw) * .725); }
.e[data-tema="notte"][data-nicchia="foto"] .ombra-carta { top: calc(var(--aw) * 1.145); width: 280px; margin-left: -140px; height: 22px; }
/* text before and after the scene stays above the photo */
.soglia > :not(.scena), .e-form, .fatto { position: relative; z-index: 1; }

.demo-e__nicchia a { color: var(--testo); }
.demo-e__nicchia a[aria-current] { font-weight: 700; text-decoration: none; }
.demo-e__nicchia span { opacity: .75; }

/* faces of the card: the front is the real Wallet front, the back carries the QR */
.faccia { position: relative; border-radius: 12px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 30px 50px -22px var(--ombra), 0 8px 18px -10px var(--ombra); }
.faccia::before { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(232, 205, 150, .32); }
.faccia::after { content: ''; position: absolute; inset: -30% -60%; z-index: 2; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 43%, rgba(255, 238, 200, .26) 49%, rgba(255, 238, 200, .06) 53%, transparent 58%);
  transform: translateX(-46%); animation: riflesso 8s ease-in-out 2.2s infinite; }
.e[data-tema="giorno"] .faccia::after { mix-blend-mode: soft-light; background: linear-gradient(105deg, transparent 43%, rgba(255, 255, 255, .9) 49%, rgba(255, 255, 255, .2) 53%, transparent 58%); }
@keyframes riflesso { 0% { transform: translateX(-46%); } 30%, 100% { transform: translateX(46%); } }
.faccia--retro { position: absolute; inset: 0; transform: rotateY(180deg); }   /* not .retro: wallet-apple.css uses it */

.lp-carta { font-family: -apple-system, 'SF Pro Text', system-ui, sans-serif; -webkit-font-smoothing: antialiased; text-align: left; }
.lp-carta .pass { --w: var(--cw); margin: 0; border-radius: 12px; box-shadow: none; }
.lp-carta .pass__primario .campo__v { font-size: 26px; }
.lp-carta .pass__header .campo__v { font-size: 17px; }
.lp-carta .pass__riga { padding-bottom: 14px; }
.lp-carta .pass__riga .campo__v { font-size: 15px; }
.lp-carta [data-vuoto] { opacity: .45; }
/* the name being struck in gold */
.lp-carta .incide { background: linear-gradient(90deg, currentColor 0 38%, #FFE7AE 47%, #E2B866 52%, currentColor 62%) 0 0 / 260% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: incide .9s var(--ease-out) both; }
@keyframes incide { from { background-position: 100% 0; } to { background-position: 0% 0; } }

.pass-retro { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 100%; padding: 10px 12px 12px;
  background: var(--p-bg); color: var(--p-fg); }
.pass-retro__testa { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 4px; }
.pass-retro__testa img { height: 30px; width: auto; }
.pass-retro__stato { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--p-lb); }
.pass-retro .qr { width: 128px; padding: 8px 8px 5px; border-radius: 8px; background: #fff; text-align: center; }
.pass-retro .qr img { width: 112px; height: 112px; image-rendering: pixelated; }
.pass-retro .qr span { display: block; margin-top: 2px; font-size: 10px; color: #000; letter-spacing: .02em; }

/* ── the form: first the name, written like ink ───────────────────────────── */
.e-form { padding: 6px 22px 0; }
.voce { position: relative; margin: 0 0 22px; }
.voce label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--oro-piccolo); }
.voce label span { letter-spacing: .04em; text-transform: none; font-weight: 400; color: var(--testo-muto); }
.voce input { display: block; width: 100%; height: 48px; margin: 4px 0 0; padding: 0; border: 0; border-bottom: 1px solid var(--campo-linea); border-radius: 0;
  background: transparent; color: var(--testo); font: 400 18px/1.2 var(--sans); caret-color: #D9B877; transition: border-color .2s; }
.voce input::placeholder { color: var(--testo-muto); opacity: .55; }
.voce input:focus { outline: none; border-bottom-color: transparent; }
/* focus: a gold line draws from the left, right on the input's bottom edge */
.voce__campo { position: relative; display: block; }
.voce__campo::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--oro-metallo); transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease-out); pointer-events: none; }
.voce:focus-within .voce__campo::after { transform: scaleX(1); }
.voce:has(input[aria-invalid="true"]) .voce__campo::after { transform: scaleX(1); background: var(--errore); }
.voce--nome { margin-bottom: 8px; }
.voce--nome input { height: 60px; font: italic 400 30px/1.1 var(--serif); letter-spacing: -.005em; }
.voce--nome input::placeholder { font-style: italic; }
.voce__aiuto { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--testo-muto); }
.voce__aiuto b { font-family: -apple-system, system-ui, sans-serif; font-weight: 500; color: var(--testo); }
.voce__err { margin: 7px 0 0; font-size: 13px; line-height: 1.4; color: var(--errore); }
.voce__err:empty { display: none; }

.stella { display: flex; align-items: center; gap: 14px; margin: 34px 0 30px; color: var(--oro-piccolo); }
.stella::before, .stella::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--linea)); }
.stella::after { background: linear-gradient(90deg, var(--linea), transparent); }
.stella svg { width: 14px; height: 14px; }

.consensi { margin: 6px 0 0; }
.consenso-e { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; margin: 0 0 14px; }
.consenso-e input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 1px 0 0; border: 1.5px solid var(--campo-linea); border-radius: 5px;
  background: transparent; display: grid; place-items: center; cursor: pointer; transition: background-color .2s, border-color .2s; }
.consenso-e input::after { content: ''; width: 11px; height: 6px; border: solid #2A1F14; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px) scale(.4); opacity: 0; transition: transform .25s var(--ease-out), opacity .2s; }
.consenso-e input:checked { background: var(--oro-metallo); border-color: #C9A96A; }
.consenso-e input:checked::after { opacity: 1; transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.consenso-e input:focus-visible { outline: 2px solid #D9B877; outline-offset: 3px; }
.consenso-e input[aria-invalid="true"] { border-color: var(--errore); }
.consenso-e label { font-size: 13.5px; line-height: 1.5; color: var(--testo-muto); cursor: pointer; }
.consenso-e label a { color: var(--testo); text-underline-offset: 3px; }
.consenso-e label b { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--oro-piccolo); white-space: nowrap; }
.consenso-e + .voce__err { margin: -8px 0 12px 36px; }
.eta-e { margin: 4px 0 0; font-size: 12px; color: var(--testo-muto); }

/* the button: metal leaf, dark ink */
.cta-oro { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 58px; margin: 26px 0 0; padding: 0 22px;
  border: 0; border-radius: 6px; background: var(--oro-metallo); background-size: 200% 100%; color: #2A1F14; cursor: pointer; overflow: hidden;
  font: 600 13.5px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
  box-shadow: 0 1px 0 rgba(255, 245, 220, .5) inset, 0 14px 30px -14px rgba(162, 125, 68, .9); transition: background-position .6s var(--ease-out), transform .15s; }
.cta-oro:hover { background-position: 100% 0; }
.cta-oro:active { transform: translateY(1px) scale(.995); }
.cta-oro:focus-visible { outline: 2px solid var(--testo); outline-offset: 3px; }
.cta-oro__freccia { transition: transform .3s var(--ease-out); }
.cta-oro:hover .cta-oro__freccia { transform: translateX(4px); }
.cta-oro[aria-busy="true"] { cursor: progress; }
.cta-oro[aria-busy="true"]::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  animation: lavoro 1s linear infinite; }
@keyframes lavoro { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.msg-e { margin: 12px 0 0; min-height: 1em; font-size: 13px; text-align: center; color: var(--errore); }

/* ── success: under the turned card ───────────────────────────────────────── */
.fatto { padding: 4px 22px 0; text-align: center; }
.fatto[hidden] { display: none; }
.fatto > * { animation: sale .7s var(--ease-out) both; }
.fatto > :nth-child(2) { animation-delay: .9s; } .fatto > :nth-child(3) { animation-delay: 1.05s; } .fatto > :nth-child(4) { animation-delay: 1.2s; }
.fatto > :nth-child(1) { animation-delay: .8s; }
.fatto__testo { margin: 0 auto; max-width: 32ch; font-size: 14.5px; line-height: 1.6; color: var(--testo-muto); }
.fatto .wallet { margin: 22px 0 0; }
.fatto .wbtn.secondario { color: var(--testo); border-color: var(--campo-linea); }
.codice-e { margin: 22px 0 0; padding: 18px 16px; border-radius: 10px; border: 1px solid var(--linea); background: var(--pannello); }
.codice-e[hidden] { display: none; }
.codice-e .eyebrow { color: var(--oro-piccolo); }
.codice-e__riga { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.codice-e code { font-family: var(--num); font-weight: 600; font-size: 21px; letter-spacing: .08em; color: var(--testo); }
.codice-e button { min-height: 38px; padding: 0 16px; border: 1px solid #C9A96A; border-radius: 999px; background: transparent; color: var(--oro-piccolo); cursor: pointer;
  font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.codice-e p { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--testo-muto); }
.fatto__link { display: inline-block; margin-top: 22px; font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--oro-piccolo); text-decoration: none; }

/* ── the path of gifts: a gold thread that draws itself ──────────────────── */
.percorso { position: relative; margin: 72px 0 0; padding: 56px 22px 48px; }
.percorso::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--pannello);
  -webkit-mask-image: linear-gradient(transparent, #000 90px, #000 calc(100% - 90px), transparent); mask-image: linear-gradient(transparent, #000 90px, #000 calc(100% - 90px), transparent); }
.percorso .eyebrow { color: var(--oro-piccolo); }
.percorso h2 { margin: 12px 0 0; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: -.02em; }
.percorso__sotto { margin: 12px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--testo-muto); }

.tappe { position: relative; list-style: none; margin: 34px 0 0; padding: 0; }
.tappe::before { content: ''; position: absolute; left: 7px; top: 12px; bottom: 26px; width: 1px; background: linear-gradient(var(--grata), rgba(205, 174, 115, .15));
  transform: scaleY(0); transform-origin: top; transition: transform 1.8s var(--ease-out); }
.percorso.in .tappe::before { transform: scaleY(1); }
.tappa { position: relative; display: grid; grid-template-columns: 34px 1fr; padding: 0 0 26px;
  opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: calc(var(--i) * 160ms + 200ms); }
.percorso.in .tappa { opacity: 1; transform: none; }
.tappa__nodo { width: 15px; height: 15px; margin-top: 10px; color: var(--grata); }
.tappa__nodo svg { width: 15px; height: 15px; display: block; background: var(--fondo-piatto); border-radius: 50%; }
.tappa--oggi .tappa__nodo svg path { fill: currentColor; }
.tappa__quando { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--oro-piccolo); }
.tappa__num { display: block; font-family: var(--num); font-weight: 300; font-size: 40px; line-height: 1.05; letter-spacing: -.03em; font-feature-settings: 'tnum' 1;
  background: var(--oro-metallo); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.tappa__dono { display: block; margin-top: 2px; font-family: var(--serif); font-size: 25px; line-height: 1.1; color: var(--testo); }
.tappa__nota { display: block; margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--testo-muto); }

.liv2-e { position: relative; margin: 10px 0 0; padding: 26px 22px 24px; border-radius: 12px; border: 1px solid var(--arco-bordo); overflow: hidden;
  opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease-out) 1.1s, transform .8s var(--ease-out) 1.1s; }
.percorso.in .liv2-e { opacity: 1; transform: none; }
.liv2-e::before { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--luce), .22), transparent); }
.liv2-e .eyebrow { color: var(--oro-piccolo); }
.liv2-e__num { display: block; margin-top: 8px; font-family: var(--num); font-weight: 200; font-size: 76px; line-height: .95; letter-spacing: -.05em;
  background: var(--oro-metallo); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.liv2-e__su { display: block; margin-top: 2px; font-family: var(--serif); font-style: italic; font-size: 26px; line-height: 1.1; }
.liv2-e p { position: relative; margin: 12px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--testo-muto); }
.liv2-e p b { color: var(--testo); font-weight: 600; }
.percorso__dettagli { margin: 22px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--testo-muto); }
.percorso__dettagli a { color: var(--testo); font-weight: 600; text-underline-offset: 3px; }

/* ── footer and prototype panel ── */
.piede-e { padding: 30px 22px 30px; text-align: center; font-size: 12px; line-height: 1.9; color: var(--testo-muto); }
.piede-e img { height: 36px; width: auto; margin: 0 auto 12px; opacity: .9; }
.piede-e b { color: var(--testo); font-weight: 600; }
.demo-e { margin: 0 22px 34px; padding: 12px 14px; border: 1px dashed var(--campo-linea); border-radius: 8px; font-size: 12px; color: var(--testo-muto); }
.demo-e b { display: block; margin-bottom: 8px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--testo); }
.demo-e button { min-height: 34px; margin: 0 6px 6px 0; padding: 0 12px; border: 1px solid var(--linea); border-radius: 999px; background: var(--pannello); color: var(--testo); font-size: 12px; cursor: pointer; }
.demo-e p { margin: 4px 0 0; }

/* ── page-load choreography ── */
.entra { animation: sale .9s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 110ms + 120ms); }
@keyframes sale { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.galleggia.entra { animation: arriva-carta 1.4s var(--ease-carta) both .5s, galleggia 7s ease-in-out 1.9s infinite; }
@keyframes arriva-carta { from { opacity: 0; transform: translateY(46px) rotateX(38deg) scale(.94); } to { opacity: 1; transform: none; } }
.arco.entra { animation: apri-arco 1.6s var(--ease-out) both .25s; }
@keyframes apri-arco { from { opacity: 0; transform: scale(.96); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

@media (min-width: 520px) {
  .soglia h1 { font-size: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .raggi, .polvere, .faccia::after { animation: none !important; }
  .polvere { display: none; }
  .galleggia, .galleggia.entra, .ombra-carta { animation: none !important; }
  .tappa, .liv2-e, .tappe::before { transition: none !important; opacity: 1 !important; transform: none !important; }
}

/* ── the path of gifts: three versions side by side in the prototype ───────── */
.percorsi { margin: 64px 0 0; }
.percorsi .percorso { margin-top: 0; }
[data-percorso-v] { display: none; }
.e[data-percorso="filo"] [data-percorso-v="filo"], .e[data-percorso="nicchie"] [data-percorso-v="nicchie"], .e[data-percorso="prova"] [data-percorso-v="prova"] { display: block; }
.proto-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 22px; padding: 10px 12px; border: 1px dashed var(--campo-linea); border-radius: 8px; font-size: 12px; color: var(--testo-muto); }
.proto-switch span { margin-right: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.proto-switch a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--linea); color: var(--testo); text-decoration: none; }
.proto-switch a[aria-current] { background: var(--testo); color: var(--fondo-piatto); border-color: var(--testo); }

/* Nicchie: an arcade of niches, one gift each, the same arch as the threshold */
.arcata__scorri { margin: 18px 0 0; text-align: right; font-size: 10.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--oro-piccolo); }
.arcata__scorri span { display: inline-block; animation: scorri 2.4s ease-in-out infinite; }
@keyframes scorri { 0%, 100% { transform: none; } 50% { transform: translateX(5px); } }
.arcata { display: flex; margin: 8px -22px 0; padding: 0 14px 12px; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 14px; scrollbar-width: none; overscroll-behavior-x: contain; }
.arcata::-webkit-scrollbar { display: none; }
.arcata:focus-visible { outline-offset: -2px; }
.arcata > li { position: relative; flex: 0 0 66%; padding: 0 8px; text-align: center; scroll-snap-align: start;
  opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: calc(var(--i) * 120ms + 150ms); }
.percorso.in .arcata > li { opacity: 1; transform: none; }
/* the gold thread runs through the thresholds, a star on each */
.arcata > li::before { content: ''; position: absolute; top: 40px; left: 0; right: 0; height: 1px; background: var(--linea); }
.arcata > li:first-child::before { left: 50%; }
.arcata > li:last-child::before { right: 50%; }
.arcata > li::after { content: ''; position: absolute; top: 34px; left: 50%; width: 13px; height: 13px; margin-left: -6.5px; background: var(--grata);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 5h10v10H5zM10 2.93 17.07 10 10 17.07 2.93 10z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 5h10v10H5zM10 2.93 17.07 10 10 17.07 2.93 10z'/%3E%3C/svg%3E") center / contain no-repeat; }
.arcata__quando { display: block; height: 30px; font-family: var(--num); font-weight: 300; font-size: 26px; line-height: 1; letter-spacing: -.02em;
  background: var(--oro-metallo); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
/* a thin gold frame around each niche, then the niche itself, both cut to the arch */
.arcata__cornice { margin: 28px auto 0; padding: 1.5px; background: var(--oro-metallo);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 352 430' preserveAspectRatio='none'%3E%3Cpath d='M0 430V150C0 78 76 34 176 4c100 30 176 74 176 146v280z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 352 430' preserveAspectRatio='none'%3E%3Cpath d='M0 430V150C0 78 76 34 176 4c100 30 176 74 176 146v280z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.arcata__cornice--piena { padding: 2.5px; }
.arcata__nicchia { position: relative; aspect-ratio: 352 / 430; overflow: hidden; background: var(--fondo-piatto);
  -webkit-mask: inherit; mask: inherit; }
.arcata__nicchia img { width: 100%; height: 100%; object-fit: cover; }
/* depth: the top of the niche is in shadow */
.arcata__nicchia::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(18, 12, 7, .5), rgba(18, 12, 7, 0) 32%), linear-gradient(90deg, rgba(18, 12, 7, .25), transparent 18%, transparent 82%, rgba(18, 12, 7, .25)); }
.e[data-tema="giorno"] .arcata__nicchia::after { background: linear-gradient(180deg, rgba(90, 66, 34, .22), rgba(90, 66, 34, 0) 32%); }
/* the lit niches (today's 5%, level 2): the lattice of the photographed niche, or a glow by day */
.arcata__nicchia--luce { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 16%;
  background: radial-gradient(ellipse 70% 45% at 50% 34%, rgba(var(--luce), .55), rgba(var(--luce), 0) 100%), var(--fondo-piatto); }
.e[data-tema="notte"] .arcata__nicchia--luce { background: linear-gradient(180deg, rgba(20, 14, 8, 0) 45%, rgba(20, 14, 8, .82) 78%), url("img/nicchia/notte-1000.jpg") 50% 34% / 170% auto no-repeat, var(--fondo-piatto); }
.e[data-tema="giorno"] .arcata__nicchia--luce { background:
    linear-gradient(180deg, rgba(239, 231, 216, 0) 30%, #EDE3D0 64%),
    radial-gradient(ellipse 70% 45% at 50% 30%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cg fill='none' stroke='%23AE8A4F' stroke-opacity='.45' stroke-width='.8'%3E%3Cpath d='M7 7h12v12H7z'/%3E%3Cpath d='M13 4.5 21.5 13 13 21.5 4.5 13z'/%3E%3Cpath d='M13 0v4.5M13 21.5V26M0 13h4.5M21.5 13H26'/%3E%3C/g%3E%3C/svg%3E") 50% 0 / 26px 26px,
    var(--fondo-piatto); }
.arcata__grande { position: relative; z-index: 1; font-family: var(--num); font-weight: 200; font-size: 62px; line-height: .9; letter-spacing: -.05em; color: var(--testo); text-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.e[data-tema="giorno"] .arcata__grande { text-shadow: none; background: var(--oro-metallo); -webkit-background-clip: text; background-clip: text; color: transparent; }
.arcata__cornice--piena .arcata__nicchia--luce { padding-bottom: 8%; }
.e[data-tema="notte"] .arcata__cornice--piena .arcata__nicchia--luce { background: linear-gradient(180deg, rgba(20, 14, 8, 0) 40%, rgba(20, 14, 8, .86) 70%), url("img/nicchia/notte-1000.jpg") 50% 34% / 170% auto no-repeat, var(--fondo-piatto); }
.arcata__cornice--piena .arcata__grande { font-size: 56px; }
.arcata__su { position: relative; z-index: 1; margin-top: 4px; font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--testo); }
.arcata__dono { display: block; margin-top: 16px; font-family: var(--serif); font-size: 23px; line-height: 1.1; }
.arcata__nota { display: block; margin-top: 5px; padding: 0 4px; font-size: 12.5px; line-height: 1.45; color: var(--testo-muto); }
@media (min-width: 520px) { .arcata > li { flex-basis: 44%; } }

/* Simulatore: a spend slider fills the thread and lights the gifts it reaches */
.prova { position: sticky; top: 50px; z-index: 3; margin: 22px -22px 0; padding: 14px 22px 14px;
  background: color-mix(in srgb, var(--fondo-piatto) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.prova__riga { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.prova__riga label { font-size: 11px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--oro-piccolo); }
.prova__riga output { font-family: var(--num); font-weight: 300; font-size: 36px; line-height: 1; letter-spacing: -.03em; font-feature-settings: 'tnum' 1;
  background: var(--oro-metallo); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.prova__cursore { --p: 0%; display: block; width: 100%; height: 32px; margin: 8px 0 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.prova__cursore::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #D9B877 var(--p), var(--campo-linea) var(--p)); }
.prova__cursore::-moz-range-track { height: 4px; border-radius: 4px; background: var(--campo-linea); }
.prova__cursore::-moz-range-progress { height: 4px; border-radius: 4px; background: #D9B877; }
.prova__cursore::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #FBEFD2, #C9A96A 70%); border: 3px solid var(--fondo-piatto); box-shadow: 0 0 0 1px #C9A96A, 0 6px 14px rgba(0, 0, 0, .35); }
.prova__cursore::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #FBEFD2, #C9A96A 70%);
  border: 3px solid var(--fondo-piatto); box-shadow: 0 0 0 1px #C9A96A, 0 6px 14px rgba(0, 0, 0, .35); }
.prova__cursore:focus-visible { outline: 2px solid #D9B877; outline-offset: 4px; border-radius: 6px; }
.prova__scala { display: flex; justify-content: space-between; margin-top: 2px; font-family: var(--num); font-size: 10.5px; color: var(--testo-muto); }
.prova__esito { margin: 10px 0 0; min-height: 3em; font-size: 13.5px; line-height: 1.5; color: var(--testo-muto); }
.prova__esito b { color: var(--testo); font-weight: 600; }

.cammino { position: relative; list-style: none; margin: 26px 0 0; padding: 0; }
.cammino::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 30px; width: 1px; background: var(--linea); }
.cammino::after { content: ''; position: absolute; left: 6px; top: 10px; width: 3px; height: var(--pieno, 0px); border-radius: 3px; z-index: 0;
  background: linear-gradient(#F4DFAE, #C9A96A); box-shadow: 0 0 12px rgba(var(--luce), .75); transition: height .3s var(--ease-out); }
.passo { position: relative; display: grid; grid-template-columns: 34px 1fr; padding: 0 0 24px; opacity: .42; transition: opacity .4s var(--ease-out); }
.passo.raggiunto { opacity: 1; }
.passo__nodo { position: relative; z-index: 1; width: 15px; height: 15px; margin-top: 9px; color: var(--grata); }
.passo__nodo svg { display: block; width: 15px; height: 15px; background: var(--fondo-piatto); border-radius: 50%; transition: filter .4s; }
.passo.raggiunto .passo__nodo svg path { fill: currentColor; }
.passo.raggiunto .passo__nodo svg { filter: drop-shadow(0 0 6px rgba(var(--luce), .9)); }
.passo__num { display: block; padding-bottom: .1em; font-family: var(--num); font-weight: 300; font-size: 28px; line-height: 1.05; letter-spacing: -.03em;
  background: var(--oro-metallo); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.passo__dono { display: block; margin-top: 2px; font-family: var(--serif); font-size: 22px; line-height: 1.1; }
.passo__nota { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--testo-muto); }
.passo__manca { display: inline-block; margin-top: 8px; padding: 4px 11px; border-radius: 999px; border: 1px solid #C9A96A;
  font-family: var(--num); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--oro-piccolo); }
.passo__manca[hidden] { display: none; }
.passo--liv { padding-bottom: 30px; }
.passo--liv::after { content: 'Livello 2'; position: absolute; left: 34px; bottom: 6px; font-size: 10px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--oro-piccolo); }
.passo--giro .passo__num { font-size: 24px; }

@media (prefers-reduced-motion: reduce) {
  .arcata > li { transition: none !important; opacity: 1 !important; transform: none !important; }
  .arcata__scorri span { animation: none; }
  .cammino::after { transition: none; }
}

/* production: the real QR is an inline SVG drawn after sign-up */
.pass-retro .qr .qr__codice { display: block; margin: 0; width: 112px; height: 112px; }
.pass-retro .qr .qr__codice svg { width: 112px; height: 112px; display: block; }
