/* Nonna Maryland · Live (tablet o TV): foto e dediche che scorrono. Stessi font e colori del sito. */
@font-face { font-family: "Great Vibes"; src: url("/fonts/great-vibes.woff2?v=37") format("woff2"); }
@font-face { font-family: "Playfair Display"; src: url("/fonts/playfair.woff2?v=37") format("woff2"); font-weight: 400 900; }
@font-face { font-family: "Playfair Display"; src: url("/fonts/playfair-italic.woff2?v=37") format("woff2"); font-weight: 400 900; font-style: italic; }
@font-face { font-family: "Jost"; src: url("/fonts/jost.woff2?v=37") format("woff2"); font-weight: 300 600; }

:root { --ink: #13234b; --ink-2: #33416a; --paper: #fffdf8; --gold: #c9921f; --gold-light: #ecc261; --gold-text: #946409; --night: #0b1530; }
* { box-sizing: border-box; }
html, body { margin: 0; height: calc(100% + var(--gap, 0px)); overflow: hidden; background: var(--night); color: var(--paper); font-family: "Jost", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body.idle { cursor: none; }
[hidden] { display: none !important; }

/* due strati che si danno il cambio in dissolvenza */
/* --gap: la striscia che su iPad (app dalla Home / schermo intero) a volte resta sotto la pagina; la calcola live.js.
   Lì arriva solo lo sfondo: foto, cartoline, scritte, QR e comandi restano nella parte che si vedeva già intera
   (spostati fino in fondo, su iPad il QR finiva tagliato). */
.slide { position: fixed; inset: 0 0 calc(0px - var(--gap, 0px)); padding-bottom: var(--gap, 0px); opacity: 0; transition: opacity 1.6s ease; overflow: hidden; }
.slide.on { opacity: 1; z-index: 1; }

/* foto: a tutto schermo senza tagli, con la stessa foto sfocata dietro */
.slide .bg { position: absolute; inset: -60px; width: calc(100% + 120px); height: calc(100% + 120px); object-fit: cover; filter: blur(34px) brightness(.42) saturate(1.15); }
.slide .ph { position: absolute; inset: 0 0 var(--gap, 0px); width: 100%; height: calc(100% - var(--gap, 0px)); object-fit: contain; }
.slide.on .ph { animation: kb 10s ease-out forwards; }
.slide.on .ph.vid { animation: none; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.06) translate(var(--kx, 0), var(--ky, 0)); } }
.caption { position: absolute; z-index: 2; left: 3vmin; bottom: calc(3vmin + var(--gap, 0px)); display: flex; align-items: center; gap: 1.4vmin; padding: 1.1vmin 2vmin; border-radius: 999px; background: rgba(8, 15, 33, .55); font-size: 2.3vmin; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.caption .who { font: italic 600 2.6vmin/1 "Playfair Display", serif; }
.new { padding: .5vmin 1.3vmin; border-radius: 999px; background: linear-gradient(180deg, #f0c766, #cf9a2a); color: #2a1d04; font: 600 1.6vmin/1 "Jost", sans-serif; letter-spacing: .12em; text-transform: uppercase; }

/* dediche: cartolina su fondo di mare */
.slide.words { display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 0%, #3d86bd 0%, #1f5a91 45%, #0f2f57 100%); }
.slide.words::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 18% 22%, rgba(255,255,255,.18) 0 .25vmin, transparent .4vmin), radial-gradient(circle at 82% 30%, rgba(255,255,255,.14) 0 .2vmin, transparent .35vmin), radial-gradient(circle at 70% 78%, rgba(255,255,255,.16) 0 .25vmin, transparent .4vmin), radial-gradient(circle at 26% 80%, rgba(255,255,255,.12) 0 .2vmin, transparent .35vmin); }
.postcard { position: relative; width: min(80vw, 120vmin); max-height: 76vh; padding: 6vmin 7vmin 4.5vmin; color: var(--ink); background: repeating-linear-gradient(transparent 0 calc(var(--fs) * 1.6 - 1px), rgba(19, 35, 75, .06) calc(var(--fs) * 1.6 - 1px) calc(var(--fs) * 1.6)) 0 6vmin / 100% calc(100% - 12vmin) no-repeat, var(--paper); border-radius: 6px; box-shadow: 0 4vmin 9vmin -3vmin rgba(0, 0, 0, .6); transform: rotate(-1deg); display: flex; flex-direction: column; }
.slide.on .postcard { animation: rise 1.4s ease-out both; }
@keyframes rise { from { transform: translateY(3vmin) rotate(-1deg); opacity: 0; } to { transform: rotate(-1deg); opacity: 1; } }
.postcard::after { content: "80"; position: absolute; top: 3vmin; right: 3vmin; width: 7vmin; height: 8.4vmin; display: grid; place-items: center; font: 800 2.6vmin/1 "Playfair Display", serif; color: var(--gold-text); border: .3vmin dashed rgba(201, 146, 31, .7); border-radius: .5vmin; background: #fbf3df; }
.postcard .msg { margin: 0; padding-right: 8vmin; font: italic 400 var(--fs)/1.6 "Playfair Display", serif; white-space: pre-line; overflow-wrap: anywhere; overflow: hidden; -webkit-mask: linear-gradient(#000 85%, transparent); mask: linear-gradient(#000 85%, transparent); }
.postcard .msg.fits { -webkit-mask: none; mask: none; }
/* dedica lunga che scorre: due righe vuote in fondo, così l'ultima arriva fuori dalla sfumatura */
.postcard .msg.roll { padding-bottom: 3.2em; -webkit-mask: linear-gradient(#000 calc(100% - 3.2em), transparent); mask: linear-gradient(#000 calc(100% - 3.2em), transparent); }
.postcard footer { display: flex; align-items: baseline; justify-content: space-between; gap: 2vmin; margin-top: 2.4vmin; }
.postcard .firma { font: 400 7vmin/1.1 "Great Vibes", cursive; }
.postcard time { font-size: 2vmin; color: #69718a; }
.label { margin: 0 0 2vmin; font: 600 1.8vmin/1 "Jost", sans-serif; letter-spacing: .28em; text-transform: uppercase; color: var(--gold-text); }
.wave { display: flex; align-items: center; gap: .35vmin; height: 12vmin; margin: 1vmin 8vmin 0 0; }
.wave i { flex: 1; border-radius: .3vmin; background: rgba(19, 35, 75, .25); }
.wave.playing i { background: var(--gold); }
.listen { align-self: flex-start; margin-top: 3vmin; min-height: 7vmin; padding: 0 4vmin; border: 0; border-radius: 999px; background: var(--ink); color: var(--gold-light); font: 500 2.6vmin/1 "Jost", sans-serif; cursor: pointer; }

/* benvenuto quando non c'è ancora niente */
.welcome { display: grid; place-items: center; text-align: center; background: radial-gradient(120% 90% at 50% 0%, #3d86bd 0%, #1f5a91 45%, #0f2f57 100%); }
.welcome p { margin: 0; }
.welcome .big { font: 400 13vmin/1.1 "Great Vibes", cursive; }
.welcome .sub { margin-top: 2vmin; font: italic 500 4vmin/1.3 "Playfair Display", serif; }

/* marchio e QR sempre visibili */
.brand { position: fixed; z-index: 5; top: max(2.6vmin, env(safe-area-inset-top)); left: 3.2vmin; font: 400 6vmin/1 "Great Vibes", cursive; text-shadow: 0 .3vmin 2vmin rgba(0, 0, 0, .55); pointer-events: none; }
.brand small { display: block; margin-top: .6vmin; font: 600 1.5vmin/1 "Jost", sans-serif; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-light); }
.qrbox { position: fixed; z-index: 5; right: 2.2vmin; bottom: 2.2vmin; display: flex; align-items: center; gap: 1.3vmin; padding: 1.1vmin 1.6vmin 1.1vmin 1.1vmin; color: var(--ink); background: var(--paper); border-radius: 1.3vmin; box-shadow: 0 1vmin 3.4vmin rgba(0, 0, 0, .45); outline: .25vmin solid rgba(201, 146, 31, .7); outline-offset: -.75vmin; }
.qrbox img { display: block; width: clamp(110px, 16vmin, 175px); height: auto; }
.qrbox p { margin: 0; max-width: 14vmin; font: 400 1.65vmin/1.35 "Jost", sans-serif; }
.qrbox b { display: block; font: italic 700 2.3vmin/1.1 "Playfair Display", serif; }
@media (orientation: portrait) { .qrbox p { max-width: 20vmin; } }

/* musica sì/no: sempre a portata durante la presentazione, in alto a destra */
.music { position: fixed; z-index: 5; top: max(2.6vmin, env(safe-area-inset-top)); right: 3vmin; display: grid; place-items: center; width: max(46px, 6.4vmin); height: max(46px, 6.4vmin); padding: 0; border: 1px solid rgba(255, 253, 248, .35); border-radius: 50%; background: rgba(8, 15, 33, .45); color: var(--paper); cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); -webkit-tap-highlight-color: transparent; }
.music svg { width: 54%; height: 54%; }
.music path { fill: currentColor; }
.music .w { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.music[aria-pressed="false"] { color: rgba(255, 253, 248, .65); }
.music[aria-pressed="true"] .m-off, .music[aria-pressed="false"] .m-on { display: none; }
body.idle .music { cursor: none; }

/* comandi al tocco */
.controls { position: fixed; z-index: 6; left: 50%; bottom: max(3vmin, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 1vmin; padding: 1vmin; border-radius: 999px; background: rgba(8, 15, 33, .8); }
.controls button { min-height: 52px; padding: 0 2.4vmin; border: 1px solid rgba(255, 253, 248, .35); border-radius: 999px; background: transparent; color: var(--paper); font: 500 max(16px, 2vmin)/1 "Jost", sans-serif; cursor: pointer; }

/* schermata iniziale: un tocco serve per schermo intero, audio e per tenere acceso il tablet */
.start { position: fixed; z-index: 10; inset: 0 0 calc(0px - var(--gap, 0px)); display: grid; place-items: center; padding: 24px 24px calc(24px + var(--gap, 0px)); text-align: center; background: radial-gradient(120% 90% at 50% 0%, #2a5f93 0%, #13234b 60%, #0b1530 100%); }
.start-in { max-width: 640px; }
.start-brand { margin: 0; font: 400 clamp(64px, 14vmin, 140px)/1.05 "Great Vibes", cursive; }
.start-sub { margin: 12px 0 0; font: italic 500 clamp(20px, 3.4vmin, 30px)/1.35 "Playfair Display", serif; }
.start button { margin-top: 32px; min-height: 64px; padding: 0 2em; border: 0; border-radius: 999px; background: linear-gradient(180deg, #f0c766, #cf9a2a); color: #2a1d04; font: 500 clamp(18px, 2.6vmin, 24px)/1 "Jost", sans-serif; box-shadow: 0 14px 30px -12px rgba(170, 115, 15, .9); cursor: pointer; }
.start .radio { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 30px; }
.start .radio span { width: 100%; margin-bottom: 2px; font: 500 13px/1 "Jost", sans-serif; letter-spacing: .24em; text-transform: uppercase; color: var(--gold-light); }
.start .radio button { margin: 0; min-height: 44px; padding: 0 1.1em; border: 1px solid rgba(255, 253, 248, .35); background: transparent; box-shadow: none; color: var(--paper); font: 500 16px/1 "Jost", sans-serif; }
.start .radio button[aria-pressed="true"] { border-color: var(--gold-light); background: rgba(236, 194, 97, .16); color: var(--gold-light); }
.start-back { display: inline-block; margin-top: 22px; padding: 10px 4px; color: var(--gold-light); font: 500 15px/1 "Jost", sans-serif; letter-spacing: .06em; text-decoration: underline; text-underline-offset: 4px; }
.start-tip { margin: 28px auto 0; max-width: 520px; font-size: 15px; line-height: 1.5; color: rgba(255, 253, 248, .7); }

/* il grande "80" fatto con le foto */
.slide.mosaic { background: radial-gradient(120% 90% at 50% 0%, #2f73ab 0%, #184a80 45%, #0b1f3d 100%); }
.m80 { position: absolute; transform-origin: 50% 55%; }
.slide.on .m80 { animation: m80 16s ease-out forwards; }
@keyframes m80 { from { transform: scale(.985); } to { transform: scale(1.03); } }
.m80-cap { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.m80-cap p { margin: 0; }
.m80-cap .n { font: 400 9vmin/1 "Great Vibes", cursive; color: var(--paper); text-shadow: 0 .3vmin 2vmin rgba(0, 0, 0, .5); }
.m80-cap .sub { margin-top: 1.2vmin; font: 600 1.9vmin/1 "Jost", sans-serif; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-light); }
.slide.on .m80-cap { animation: capin 1.4s 2.6s ease-out both; }
@keyframes capin { from { transform: translateY(2vmin); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .slide.on .ph, .slide.on .postcard, .slide.on .m80, .slide.on .m80-cap { animation: none; } }
.misure { position: fixed; z-index: 20; left: 2vmin; right: 2vmin; top: 40%; margin: 0; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, .78); color: #fff; font: 15px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; pointer-events: none; }
