/* ==========================================================================
   Bagni Montecristo · proposta redesign
   Palette e font dal brandbook: Blu Mare #083F75, Sabbia #FFFBE6,
   Altesse Std (script) + IBM Plex Mono.
   La pagina racconta una giornata: carta sabbia di giorno, blu mare la sera.
   ========================================================================== */

@font-face {
  font-family: "Altesse";
  src: url("../assets/fonts/altesse.otf") format("opentype");
  font-display: swap;
}

:root {
  --blu: #083F75;
  --blu-hi: #0D4E8F;
  --sabbia: #FFFBE6;
  --paper: #F3EEDA;

  /* token di tema: animati da JS quando cala la sera */
  --bg: #F3EEDA;
  --fg: #083F75;
  --line: color-mix(in srgb, var(--fg) 22%, transparent);
  --muted: color-mix(in srgb, var(--fg) 76%, var(--bg));

  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --f-script: "Altesse", "Snell Roundhand", "Apple Chancery", cursive;

  --pad: clamp(1rem, 4vw, 3.5rem);
  --nav-h: 76px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --section: clamp(6rem, 12vw, 11rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.65 var(--f-mono);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body.is-loading { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
/* l'altezza segue la larghezza (o l'aspect-ratio della classe), mai l'attributo height */
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px dashed currentColor; outline-offset: 4px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.script { font-family: var(--f-script); font-weight: 400; text-transform: none; letter-spacing: 0; }
.ink { filter: url(#ink); }

/* carta e luce stanno sotto i contenuti: il testo resta sempre nitido */
main, .foot { position: relative; z-index: 1; }

.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--pad); }

.line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.line > span { display: block; }

.h2 {
  font-size: clamp(2.3rem, 5.2vw, 5.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.015em;
  text-transform: uppercase;
}

.lead { font-size: clamp(1rem, 1.25vw, 1.15rem); color: var(--muted); max-width: 46ch; }

/* carta: texture del brandbook su tutta la pagina, gia' fusa col colore della carta
   (una fusione 'multiply' su uno strato fisso costerebbe a ogni frame di scroll) */
.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--paper) url("../assets/img/paper-grain.webp") center / cover no-repeat;
}

/* luce radente: il cursore e' una lampada che sfiora la carta.
   Le maschere sono il rilievo delle fibre estratto dalla stessa texture. */
.paper-light, .paper-shade {
  --lr: 30rem;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .8s ease;
}
.paper-light {
  background: radial-gradient(var(--lr) circle at var(--px, 50%) var(--py, 50%), rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 70%);
}
.paper-shade {
  background: radial-gradient(var(--lr) circle at var(--px, 50%) var(--py, 50%), rgba(4, 30, 60, .28), rgba(4, 30, 60, 0) 70%);
  translate: var(--sx, 1px) var(--sy, 1px);
}
body.has-light .paper-light {
  -webkit-mask: url("../assets/img/paper-hi.webp") center / cover no-repeat;
  mask: url("../assets/img/paper-hi.webp") center / cover no-repeat;
  opacity: 1;
}
body.has-light .paper-shade {
  -webkit-mask: url("../assets/img/paper-lo.webp") center / cover no-repeat;
  mask: url("../assets/img/paper-lo.webp") center / cover no-repeat;
  opacity: 1;
}
body.has-light.on-photo .paper-light, body.has-light.on-photo .paper-shade { opacity: 0; }

/* ---------- Bottoni ---------- */
.btn {
  --btn-bg: var(--fg);
  --btn-fg: var(--bg);
  --btn-hbg: var(--bg);
  --btn-hfg: var(--fg);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.05rem 1.6rem;
  border: 1px solid var(--fg);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 500 .76rem/1 var(--f-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color .55s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-hbg);
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform .55s var(--ease);
}
.btn:hover { color: var(--btn-hfg); }
.btn:hover::before { transform: scaleY(1); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--fg); --btn-hbg: var(--fg); --btn-hfg: var(--bg); }
.btn--sm { padding: .8rem 1.15rem; font-size: .7rem; }

/* ---------- Intro: il timbro ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
body.is-loading .loader { pointer-events: auto; }
.loader__paper {
  position: absolute;
  inset: 0;
  background: var(--paper) url("../assets/img/texture-overlay.webp") center / cover;
  background-blend-mode: multiply;
}
.loader__stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(52vw, 330px);
  margin: calc(min(52vw, 330px) * -.341) 0 0 calc(min(52vw, 330px) * -.5);
  color: var(--blu);
  opacity: 0;
  will-change: transform;
}
.loader__stamp svg { width: 100%; height: auto; filter: url(#ink); }
.loader__year {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12vh;
  text-align: center;
  color: var(--blu);
  font-size: .78rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  opacity: 0;
}
.loader__year [data-year] { display: inline-block; min-width: 4ch; font-variant-numeric: tabular-nums; }

/* ---------- Navigazione ---------- */
.nav {
  --nav-fg: var(--fg);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-inline: var(--pad);
  color: var(--nav-fg);
  transition: transform .7s var(--ease), background-color .5s ease, color .5s ease;
}
.nav.on-photo { --nav-fg: var(--sabbia); --fg: var(--sabbia); --bg: var(--blu); }
/* fondo pieno: niente sfocatura (costava a ogni frame) e niente testo che si intravede dietro */
.nav.is-solid { background: var(--bg); box-shadow: 0 1px 0 color-mix(in srgb, var(--fg) 12%, transparent); }
.nav.is-hidden { transform: translateY(-105%); }
.nav__logo svg { height: 54px; width: auto; }
.nav__links { display: flex; gap: 2.4rem; margin-left: auto; }
.nav__links a, .foot__grid a {
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size .5s var(--ease);
}
.nav__links a:hover, .foot__grid a:hover { background-size: 100% 1px; }
.nav__burger { display: none; width: 44px; height: 44px; margin-left: auto; position: relative; }
.nav__burger span:not(.sr-only) {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1px;
  background: currentColor;
  transition: transform .5s var(--ease);
}
.nav__burger span:nth-child(1) { top: 18px; }
.nav__burger span:nth-child(2) { top: 26px; }
body.menu-open .nav__burger span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
body.menu-open .nav__burger span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }
body.menu-open .nav { --nav-fg: var(--sabbia); background: transparent; backdrop-filter: none; }

.menu {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--blu);
  color: var(--sabbia);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--nav-h) var(--pad) 3rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .8s var(--ease);
}
body.menu-open .menu { clip-path: inset(0 0 0 0); }
.menu__links { display: flex; flex-direction: column; gap: .4rem; }
.menu__links a { font-family: var(--f-script); font-size: clamp(2.6rem, 11vw, 4rem); line-height: 1.25; }
.menu__seal { width: 120px; margin-top: 3rem; opacity: .9; }

/* ---------- Hero ----------
   La tenda a righe (WebGL) copre la spiaggia: scorrendo si apre.
   Senza WebGL restano due teli a righe in CSS che scorrono ai lati. */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--blu);
  color: var(--sabbia);
  --fg: var(--sabbia);
  --bg: var(--blu);
}
.hero__media { position: absolute; inset: 0; overflow: hidden; background: var(--blu); }
.hero__photo, .hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__photo { animation: breathe 24s ease-in-out infinite alternate; }
@keyframes breathe { from { transform: scale(1.03); } to { transform: scale(1.1) translate(-1%, -1%); } }
.hero.is-off .hero__photo { animation-play-state: paused; }
.hero__video { opacity: 0; transition: opacity 1.2s ease; }
.hero.has-video .hero__video { opacity: 1; }

.hero__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 36, 70, .5) 0%, rgba(5, 36, 70, 0) 24%),
    linear-gradient(0deg, rgba(5, 36, 70, .86) 0%, rgba(5, 36, 70, .5) 40%, rgba(5, 36, 70, 0) 70%),
    linear-gradient(90deg, rgba(5, 36, 70, .4) 0%, rgba(5, 36, 70, 0) 55%);
}
.hero__tenda { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; display: none; }
.hero.gl-ready .hero__tenda { display: block; }

/* teli di riserva, senza WebGL */
.hero__curtains { position: absolute; inset: 0; display: none; pointer-events: none; }
.js .hero:not(.gl-ready) .hero__curtains { display: block; }
.hero__curtains span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: repeating-linear-gradient(90deg, var(--blu) 0 clamp(36px, 4.2vw, 60px), var(--sabbia) 0 clamp(72px, 8.4vw, 120px));
  box-shadow: 0 0 40px rgba(2, 20, 42, .45);
}
.hero__curtains span:first-child { left: 0; }
.hero__curtains span:last-child { right: 0; transform: scaleX(-1); }

/* il sigillo cucito sulla tenda: a meta' su ciascun telo */
.hero__patch {
  position: absolute;
  left: 50%;
  top: 52%;
  width: clamp(190px, 21vw, 310px);
  aspect-ratio: 397.9 / 271.3;
  translate: -50% -50%;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(2, 20, 42, .35)) drop-shadow(0 10px 16px rgba(2, 20, 42, .3));
  display: none;
}
.js .hero__patch { display: block; }
.hero__patch-half { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--blu); will-change: transform; }
.hero__patch-half:first-child { clip-path: inset(-5% 50% -5% -5%); }
.hero__patch-half:last-child { clip-path: inset(-5% -5% -5% 50%); }

.hero__pull {
  position: absolute;
  left: 50%;
  bottom: clamp(2rem, 8vh, 4.5rem);
  translate: -50% 0;
  padding: .85rem 1.4rem;
  background: var(--sabbia);
  color: var(--blu);
  font: 500 .7rem/1 var(--f-mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  outline: 1px dashed color-mix(in srgb, var(--blu) 55%, transparent);
  outline-offset: -5px;
  box-shadow: 0 8px 18px rgba(2, 20, 42, .3);
  display: none;
}
.js .hero__pull { display: block; }
.js .hero__scrim, .js .hero__content { opacity: 0; }

/* varianti mare (?hero=risacca|scintillio|linee): al posto di tenda e foto c'e' il mare disegnato */
.hero__mare { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.hero:not([data-variant="tenda"]) .hero__mare { display: block; }
.js .hero:not([data-variant="tenda"]) :is(.hero__media, .hero__tenda, .hero__curtains, .hero__patch, .hero__pull) { display: none; }
.hero[data-variant="risacca"], .hero[data-variant="linee"] { --fg: var(--blu); --bg: var(--sabbia); color: var(--blu); background: var(--paper); }
.hero[data-variant="risacca"] .hero__scrim, .hero[data-variant="linee"] .hero__scrim { display: none; }
.hero[data-variant="risacca"] .hero__content, .hero[data-variant="linee"] .hero__content { text-shadow: none; }
.hero[data-variant="scintillio"] { background: #051f42; }
/* il video resta 'visibile' (opacita' 0, non display:none): su iPhone un video nascosto non dà fotogrammi allo shader */
.hero__sea-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; }
.hero:not([data-variant="video"]) .hero__sea-video { display: none; }
/* senza WebGL si vede il video com'e', senza grading */
.hero[data-variant="video"].no-gl .hero__sea-video { opacity: 1; filter: sepia(1) hue-rotate(175deg) saturate(2.4) brightness(.78) contrast(1.1); }
.hero.no-gl .hero__mare { display: none; }
/* il video sfuma nella carta: lo sfondo dell'hero resta trasparente, sotto si vede la pagina */
.hero[data-variant="video"] { background: transparent; }
.hero[data-variant="video"] .hero__scrim,
.hero[data-variant="video"].no-gl .hero__sea-video {
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 94%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 94%);
}
.hero[data-variant="linee"] .hero__content, .hero[data-variant="video"] .hero__content { top: calc(var(--nav-h) + clamp(1.5rem, 6vh, 4rem)); bottom: auto; }
.hero[data-variant="video"] .hero__scrim {
  background:
    linear-gradient(180deg, rgba(5, 36, 70, .6) 0%, rgba(5, 36, 70, .2) 40%, rgba(5, 36, 70, 0) 60%),
    linear-gradient(90deg, rgba(5, 36, 70, .8) 0%, rgba(5, 36, 70, .6) 32%, rgba(5, 36, 70, 0) 64%);
}
@media (max-width: 700px) {
  .hero[data-variant="video"] .hero__scrim { background: linear-gradient(180deg, rgba(5, 36, 70, .75) 0%, rgba(5, 36, 70, .6) 62%, rgba(5, 36, 70, 0) 85%); }
}
/* sul mare disegnato la sfumatura scura sta sopra il canvas, il testo sopra entrambi */
.hero:not([data-variant="tenda"]) .hero__scrim { z-index: 1; }
.hero:not([data-variant="tenda"]) .hero__content { z-index: 2; }


.hero__content {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: clamp(2.2rem, 8vh, 5.5rem);
  max-width: 1100px;
  pointer-events: none;
  text-shadow: 0 2px 22px rgba(4, 28, 56, .6);
}
.hero__content a { pointer-events: auto; }
.hero__eyebrow {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  font-size: .74rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.hero__eyebrow .script { font-size: clamp(1.9rem, 2.7vw, 2.6rem); letter-spacing: 0; line-height: 1; }
.hero__title {
  margin: .35em 0 .4em;
  font-size: clamp(2.5rem, 6.6vw, 6.8rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.hero__sub { max-width: 40ch; font-size: clamp(.95rem, 1.15vw, 1.08rem); opacity: .92; }
.hero__ctas .btn { text-shadow: none; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.9rem; }

/* ---------- Manifesto ---------- */
.manifesto {
  position: relative;
  padding-block: clamp(7rem, 16vw, 14rem);
  overflow: hidden;
  --lx: .5;
  --ly: .5;
  --mx: 70%;
  --my: 50%;
}
.manifesto::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(38rem circle at var(--mx) var(--my), rgba(255, 255, 255, .34), transparent 70%);
  mix-blend-mode: soft-light;
}
.manifesto__emboss {
  position: absolute;
  top: 50%;
  right: -14vw;
  width: min(84vw, 1040px);
  translate: 0 -50%;
  color: var(--bg);
  pointer-events: none;
  filter:
    drop-shadow(calc(var(--lx) * -2.2px) calc(var(--ly) * -2.2px) 1px rgba(255, 255, 255, .95))
    drop-shadow(calc(var(--lx) * 2.6px) calc(var(--ly) * 2.6px) 2px rgba(8, 63, 117, .2));
}
.manifesto__emboss svg { width: 100%; height: auto; }
.manifesto__inner { position: relative; z-index: 1; }
.manifesto__text {
  max-width: 21ch;
  font-size: clamp(1.75rem, 3.7vw, 3.7rem);
  line-height: 1.16;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.manifesto__text .w { display: inline-block; opacity: .14; }
.manifesto__body { max-width: 44ch; margin-top: 3rem; color: var(--muted); font-size: clamp(1rem, 1.2vw, 1.12rem); }
.manifesto__sign { width: clamp(200px, 22vw, 300px); height: auto; margin-top: 3.5rem; color: var(--fg); }

/* ---------- Cartolina ---------- */
.pc-sec {
  position: relative;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pc-stage { perspective: 2200px; width: 100%; display: grid; place-items: center; padding-inline: var(--pad); }
.postcard {
  position: relative;
  width: min(88vw, 1000px, calc(78svh * 1.5));
  aspect-ratio: 3 / 2;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
  color: var(--blu);
}
.pc-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--sabbia) url("../assets/img/texture-overlay.webp") center / cover;
  background-blend-mode: multiply;
  box-shadow:
    0 1px 2px rgba(8, 63, 117, .12),
    0 40px 80px -30px rgba(8, 63, 117, .45);
}
.pc-back { transform: rotateY(180deg); }
.postcard.is-flipped { transform: rotateY(180deg); }

.pc-front__emboss {
  position: absolute;
  left: -8%;
  bottom: -30%;
  width: 70%;
  color: var(--sabbia);
  filter: drop-shadow(-1.5px -1.5px 1px rgba(255, 255, 255, .95)) drop-shadow(2px 2px 2px rgba(8, 63, 117, .18));
}
.pc-front__lockup {
  position: absolute;
  left: 7%;
  top: 14%;
  rotate: -5deg;
}
.pc-front__saluti {
  display: block;
  font-size: clamp(1.6rem, 4.6vw, 3.6rem);
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.pc-front__forte { display: block; margin: -.12em 0 0 .5em; font-size: clamp(1.6rem, 4.4vw, 3.4rem); line-height: 1.3; }
.pc-front__photo {
  position: absolute;
  right: 9%;
  top: 9%;
  height: 82%;
  width: auto;
  rotate: 4deg;
  filter: drop-shadow(0 10px 14px rgba(8, 63, 117, .22));
}
.pc-front__seal {
  position: absolute;
  right: 34%;
  bottom: 10%;
  width: 26%;
  height: auto;
  color: var(--blu);
  rotate: -14deg;
  opacity: .92;
}
.pc-front__caption {
  position: absolute;
  left: 7%;
  bottom: 9%;
  font-size: .68rem;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.pc-back {
  display: grid;
  grid-template-columns: 1.25fr 1px 1fr;
  gap: 5%;
  padding: 7% 6% 6%;
}
.pc-back__print {
  position: absolute;
  left: 0;
  right: 0;
  top: 4.5%;
  text-align: center;
  font-size: clamp(.5rem, .8vw, .66rem);
  letter-spacing: .4em;
  text-transform: uppercase;
  opacity: .7;
}
.pc-back__left { display: flex; flex-direction: column; justify-content: center; }
.pc-back__label { font-size: clamp(.7rem, 1.1vw, .9rem); letter-spacing: .22em; text-transform: uppercase; margin-bottom: 1.2em; }
.pc-back__msg { font-size: clamp(1rem, 2.15vw, 1.85rem); line-height: 1.55; }
.pc-back__msg span { display: block; width: fit-content; }
.pc-back__sign { font-size: clamp(1.2rem, 2.6vw, 2.3rem); margin-top: .5em; text-align: right; padding-right: 8%; }
.pc-back__rule { background: color-mix(in srgb, var(--blu) 30%, transparent); }
.pc-back__right { display: flex; flex-direction: column; justify-content: space-between; }
.pc-back__stamp { position: relative; align-self: flex-end; width: 44%; }
.pc-back__stamp img { width: 100%; height: auto; rotate: -3deg; }
.pc-back__postmark {
  position: absolute;
  left: -62%;
  top: 34%;
  width: 118%;
  height: auto;
  color: var(--blu);
  transform: rotate(-12deg);
  opacity: .85;
}
.pc-back__addr li {
  padding: .7em 0 .35em;
  border-bottom: 1px solid color-mix(in srgb, var(--blu) 32%, transparent);
  font-size: clamp(.58rem, 1.05vw, .86rem);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------- La spiaggia ---------- */
.beach { padding-block: var(--section); }
.wave-rule { width: 100%; height: 22px; margin-bottom: clamp(3rem, 7vw, 6rem); overflow: visible; }
.wave-rule path { fill: none; stroke: var(--fg); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.beach__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
}
.beach__text { grid-column: 1 / span 5; }
.beach__text .h2 { margin-bottom: 2rem; }
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.4rem 2rem;
  margin: 3.2rem 0 3.4rem;
  padding-top: 2.4rem;
  border-top: 1px solid var(--line);
}
.fact dt { font-size: clamp(2.4rem, 4.2vw, 3.8rem); line-height: 1; font-variant-numeric: tabular-nums; }
.fact dt.script { font-size: clamp(2rem, 3.3vw, 3rem); line-height: 1.2; }
.fact dd { margin-top: .7rem; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.beach__media { grid-column: 7 / span 6; }

.develop {
  --dev: 0;
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
}
.develop img { position: absolute; inset: -8% 0; width: 100%; height: 116%; object-fit: cover; will-change: transform; }
.develop__mono {
  position: absolute;
  inset: 0;
  background: var(--blu);
  -webkit-mask-image: linear-gradient(to top, transparent calc(var(--dev) * 1% - 22%), #000 calc(var(--dev) * 1%));
  mask-image: linear-gradient(to top, transparent calc(var(--dev) * 1% - 22%), #000 calc(var(--dev) * 1%));
}
.develop__mono img { filter: grayscale(1) contrast(1.18) brightness(1.06); mix-blend-mode: screen; opacity: .95; }

/* ---------- Dal 1912 ---------- */
.album { padding-block: var(--section); }
.album__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
}
.album__intro { grid-column: 1 / span 4; }
.album__intro .h2 { margin-bottom: 2rem; }
.album__intro p { color: var(--muted); max-width: 40ch; }
.album__hint {
  margin-top: 2rem;
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.album__hint::before { content: "↔"; margin-right: .8em; letter-spacing: 0; }
.album__table {
  grid-column: 5 / span 8;
  position: relative;
  height: clamp(520px, 78vh, 760px);
}
.stamp-item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}
.stamp-item__in { will-change: transform; }
.stamp-item img, .stamp-item svg {
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 12px 16px rgba(8, 63, 117, .2));
  transition: filter .4s ease;
}
.stamp-item--seal svg { color: var(--blu); filter: url(#ink); opacity: .9; }
.stamp-item.is-drag { cursor: grabbing; }
.stamp-item.is-drag img { filter: drop-shadow(0 34px 34px rgba(8, 63, 117, .3)); }

/* ---------- La sera: foglio blu in cianotipia ----------
   Le sezioni serali stanno su un foglio blu sotto la carta del giorno.
   Il bordo superiore e' uno strappo (clip-path generato in JS). */
.cyano {
  --bg: var(--blu);
  --fg: var(--sabbia);
  --line: color-mix(in srgb, var(--fg) 22%, transparent);
  --muted: color-mix(in srgb, var(--fg) 76%, var(--bg));
  position: relative;
  isolation: isolate;
  color: var(--fg);
  /* macchie irregolari della cianotipia: rumore a bassa frequenza, piastrellabile */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='n' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0045' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 .98  0 0 0 0 .9  0 0 0 .34 -.115'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 900px 900px repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='700'%3E%3Cfilter id='d' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.008' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .01  0 0 0 0 .1  0 0 0 0 .22  0 0 0 .44 -.155'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23d)'/%3E%3C/svg%3E") 0 0 / 700px 700px repeat,
    var(--blu);
}
/* le fibre della carta affiorano chiare, come in una stampa al ferroprussiato */
.cyano::before, .cyano > .moon {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.cyano::before {
  background: var(--sabbia);
  -webkit-mask: url("../assets/img/paper-lo.webp") 0 0 / 1280px auto repeat;
  mask: url("../assets/img/paper-lo.webp") 0 0 / 1280px auto repeat;
  opacity: .13;
}
/* luce di luna: le fibre vicine al cursore si accendono.
   Elemento vuoto dedicato: le sue variabili cambiano senza ricalcolare il resto del foglio */
.cyano > .moon {
  background: radial-gradient(28rem circle at var(--nx, -999px) var(--ny, -999px), rgba(255, 251, 230, .5), rgba(255, 251, 230, 0) 70%);
  -webkit-mask: url("../assets/img/paper-hi.webp") 0 0 / 1280px auto repeat;
  mask: url("../assets/img/paper-hi.webp") 0 0 / 1280px auto repeat;
}

.night {
  --band: 96px;
  margin-top: calc(var(--band) * -1);
  padding-top: var(--band);
  /* il foglio blu inizia sotto la fascia dello strappo; la fascia la disegna .night__lip */
  background-clip: content-box;
}
.night::before, .night > .moon { top: var(--band); }
.night::before {
  -webkit-mask-position: 0 calc(var(--band) * -1);
  mask-position: 0 calc(var(--band) * -1);
}
/* la striscia frastagliata in cima: e' l'unica cosa che si ridisegna durante lo strappo */
.night__lip {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(var(--band) + 2px);
  background: inherit;
  pointer-events: none;
}
.night__lip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sabbia);
  -webkit-mask: url("../assets/img/paper-lo.webp") 0 0 / 1280px auto repeat;
  mask: url("../assets/img/paper-lo.webp") 0 0 / 1280px auto repeat;
  opacity: .13;
}
.tear {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: calc(var(--band) + 40px);
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 3px 3px rgba(2, 20, 42, .55)) drop-shadow(0 10px 14px rgba(2, 20, 42, .3));
}
/* il bordo fibroso, bianco, della carta strappata */
.tear__rim { position: absolute; inset: 0; background: #FBF8EE; }

.nav.is-night { --nav-fg: var(--sabbia); --fg: var(--sabbia); --bg: var(--blu); }

/* ---------- Il ristorante ---------- */
/* niente sbordamenti: su iPhone basta un elemento oltre il bordo per allargare tutta la pagina */
.resto { position: relative; padding: var(--section) var(--pad); overflow: hidden; }
.resto__stage {
  position: relative;
  height: clamp(620px, 118vh, 1150px);
  max-width: 1440px;
  margin-inline: auto;
  display: grid;
  place-items: center;
}
.resto__oval {
  --ox: 26%;
  --oy: 22%;
  position: absolute;
  width: min(62vw, 640px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  clip-path: ellipse(var(--ox) var(--oy) at 50% 50%);
}
.resto__oval img { position: absolute; inset: -10% 0; width: 100%; height: 120%; object-fit: cover; }
.resto__ring {
  position: absolute;
  width: min(62vw, 640px);
  aspect-ratio: 3 / 4;
  border: 1px solid color-mix(in srgb, var(--fg) 55%, transparent);
  border-radius: 50%;
  pointer-events: none;
}
.resto__title { position: absolute; inset: 0; font-weight: 400; pointer-events: none; }
.resto__word {
  position: absolute;
  font-size: clamp(3.4rem, 12.5vw, 12.5rem);
  line-height: 1;
  letter-spacing: -.03em;
  text-transform: uppercase;
  will-change: transform;
}
.resto__word--1 { left: 3%; top: 4%; }
.resto__word--2 { right: 1%; top: 40%; }
.resto__word--3 { left: 9%; bottom: 3%; }
.resto__text { max-width: 54ch; margin: clamp(3rem, 6vw, 5rem) auto 0; text-align: center; }
.resto__kicker { font-size: clamp(2.2rem, 3.6vw, 3.2rem); line-height: 1.2; margin-bottom: 1.2rem; }
.resto__text p:not(.resto__kicker) { color: var(--muted); }
.resto__ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; margin-top: 2.4rem; }

/* ---------- Eventi ---------- */
.events { padding-block: var(--section); }
.events__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
}
.events__media { grid-column: 2 / span 4; position: relative; transform-style: preserve-3d; }
.perf {
  --r: 7px;
  padding: calc(2 * var(--r));
  background: var(--sabbia);
  -webkit-mask:
    radial-gradient(var(--r), #0000 97%, #000) round calc(-1.5 * var(--r)) calc(-1.5 * var(--r)) / calc(3 * var(--r)) calc(3 * var(--r)),
    linear-gradient(#000 0 0) no-repeat 50% / calc(100% - 3 * var(--r)) calc(100% - 3 * var(--r));
  mask:
    radial-gradient(var(--r), #0000 97%, #000) round calc(-1.5 * var(--r)) calc(-1.5 * var(--r)) / calc(3 * var(--r)) calc(3 * var(--r)),
    linear-gradient(#000 0 0) no-repeat 50% / calc(100% - 3 * var(--r)) calc(100% - 3 * var(--r));
  rotate: -3deg;
}
.perf img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: saturate(.85); }
.events__badge {
  position: absolute;
  right: -28%;
  bottom: -6%;
  width: 72%;
  height: auto;
  rotate: 8deg;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .25));
  transform: translateZ(40px);
}
.events__text { grid-column: 8 / span 5; }
.events__text .h2 { margin-bottom: 2.2rem; }
.events__name {
  font-weight: 400;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.1;
}
.events__name .script { display: block; margin-top: .25em; font-size: 1.3em; line-height: 1.3; }
.events__list { margin: 2rem 0 2.6rem; border-top: 1px solid var(--line); }
.events__list li {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: .95rem 0;
  color: var(--muted);
}
.events__list li::before {
  content: "";
  flex: 0 0 22px;
  height: 7px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 7'%3E%3Cpath d='M1 3.5c2.5-3 5-3 7.5 0s5 3 7.5 0 4-2.5 5.5-1' fill='none' stroke='%23000' stroke-width='1.3'/%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 22 7'%3E%3Cpath d='M1 3.5c2.5-3 5-3 7.5 0s5 3 7.5 0 4-2.5 5.5-1' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Claim ---------- */
.marquee { overflow: hidden; padding-block: clamp(1.4rem, 2.6vw, 2.4rem); border-block: 1px solid var(--line); }
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__set { display: flex; align-items: center; gap: clamp(1.4rem, 2.6vw, 2.6rem); padding-right: clamp(1.4rem, 2.6vw, 2.6rem); }
.marquee__set span { font-size: clamp(1.5rem, 3.4vw, 3.2rem); line-height: 1; text-transform: uppercase; white-space: nowrap; }
.marquee__set svg { width: clamp(2.4rem, 4vw, 3.6rem); height: auto; color: var(--fg); flex: none; }

/* ---------- Prenota ---------- */
.book { padding-block: var(--section); }
.book .h2 { margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.tickets { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.2rem, 2.5vw, 2.4rem); }
.ticket {
  --stub: clamp(120px, 12vw, 170px);
  --n: 15px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr var(--stub);
  min-height: clamp(300px, 30vw, 380px);
  background: var(--sabbia) url("../assets/img/texture-overlay.webp") center / cover;
  background-blend-mode: multiply;
  color: var(--blu);
  -webkit-mask:
    radial-gradient(circle var(--n) at calc(100% - var(--stub)) 0, #0000 97%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--n) at calc(100% - var(--stub)) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle var(--n) at calc(100% - var(--stub)) 0, #0000 97%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--n) at calc(100% - var(--stub)) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
}
.ticket.is-ready { transition: transform .7s var(--ease); }
.ticket.is-ready:hover { transform: translateY(-8px) rotate(-.6deg); }
.ticket__main { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(1.6rem, 3vw, 2.8rem); }
.ticket__kind { font-size: clamp(2.2rem, 3.6vw, 3.4rem); line-height: 1.15; }
.ticket__title { margin-top: .6rem; font-size: clamp(1.1rem, 1.7vw, 1.6rem); text-transform: uppercase; letter-spacing: .03em; }
.ticket__meta { margin-top: 1rem; font-size: .84rem; opacity: .8; }
.ticket__cta {
  margin-top: auto;
  padding: .9rem 1.3rem;
  border: 1px solid var(--blu);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: background-color .4s ease, color .4s ease;
}
.ticket:hover .ticket__cta { background: var(--blu); color: var(--sabbia); }
.ticket__stub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-left: 2px dashed color-mix(in srgb, var(--blu) 35%, transparent);
  transform-origin: 0 0;
  transition: transform .7s var(--ease);
}
.ticket:hover .ticket__stub { transform: rotate(5deg) translate(4px, 2px); }
.ticket__stub svg { width: 76%; height: auto; filter: url(#ink); }
.ticket__stub span { font-size: .72rem; letter-spacing: .24em; }
.ticket::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%) -100% 0 / 250% 100% no-repeat;
  transition: background-position 1.1s var(--ease);
  mix-blend-mode: soft-light;
}
.ticket:hover::after { background-position: 100% 0; }

/* ---------- Footer ---------- */
.foot { padding: var(--section) 0 2rem; overflow: hidden; }
.foot__lockup { display: flex; flex-direction: column; }
.foot__saluti { font-size: clamp(3rem, 11.5vw, 12rem); line-height: .9; letter-spacing: -.02em; text-transform: uppercase; }
.foot__forte {
  margin: -.18em 0 0 clamp(1rem, 9vw, 9rem);
  padding-bottom: .15em;
  font-size: clamp(3.2rem, 12vw, 12.6rem);
  line-height: 1.15;
  rotate: -4deg;
  width: fit-content;
}
.foot__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 2rem;
  align-items: start;
  margin-top: clamp(4rem, 8vw, 7rem);
  padding-top: 2.4rem;
  border-top: 1px solid var(--line);
}
.foot__grid h3 { margin-bottom: 1rem; font-family: var(--f-script); font-size: 1.9rem; font-weight: 400; line-height: 1.2; }
.foot__grid p { color: var(--muted); margin-bottom: .6rem; }
.foot__grid a { display: table; margin-bottom: .55rem; }
.foot__seal { width: clamp(110px, 12vw, 160px); height: auto; }
.foot__legal {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.8rem;
  margin-top: 4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  font-size: .68rem;
  letter-spacing: .06em;
  color: var(--muted);
}
.foot__legal a:hover { text-decoration: underline; }

/* ---------- Reveal generico ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; }
  .nav__logo svg { height: 46px; }

  .beach__text, .beach__media,
  .album__intro, .album__table,
  .events__media, .events__text { grid-column: 1 / -1; }
  .beach__media { order: -1; }
  .events__media { width: 78%; margin: 0 auto 2rem; }
  .events__badge { right: -16%; width: 62%; }

  .album__table {
    height: auto;
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 1rem var(--pad) 2rem;
    margin-inline: calc(var(--pad) * -1);
    scrollbar-width: none;
  }
  .album__table::-webkit-scrollbar { display: none; }
  .stamp-item { position: relative; left: auto; top: auto; flex: 0 0 66%; scroll-snap-align: center; touch-action: auto; cursor: auto; }
  .stamp-item--seal { flex-basis: 56%; align-self: center; }
  .album__hint { display: none; }

  .tickets { grid-template-columns: 1fr; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__seal { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  :root { --nav-h: 64px; }
  .hero__title { font-size: 9.2vw; }
  .hero__ctas .btn { flex: 1 1 auto; }

  .postcard { width: min(88vw, calc(74svh * .66)); aspect-ratio: 2 / 3; }
  .pc-front__lockup { left: 8%; top: 7%; }
  .pc-front__saluti { font-size: 2.2rem; }
  .pc-front__forte { font-size: 2.1rem; }
  .pc-front__photo { right: 10%; top: auto; bottom: 14%; height: auto; width: 66%; }
  .pc-front__seal { right: auto; left: 6%; bottom: 8%; width: 42%; }
  .pc-front__caption { left: auto; right: 8%; bottom: 5%; }
  .pc-front__emboss { width: 120%; left: -30%; bottom: -10%; }
  .pc-back { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; gap: 1.2rem; padding: 14% 8% 8%; }
  .pc-back__rule { display: none; }
  .pc-back__right { order: -1; flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 1rem; }
  .pc-back__addr { flex: 1; }
  .pc-back__stamp { width: 34%; }
  .pc-back__postmark { left: -40%; width: 100%; }
  .pc-back__msg { font-size: 1.28rem; }
  .pc-back__sign { font-size: 1.6rem; }
  .pc-back__addr li { font-size: .56rem; }

  .facts { gap: 2rem 1.2rem; }
  .resto__stage { height: min(150vw, 680px); }
  .resto__oval, .resto__ring { width: 86vw; }
  .resto__word--2 { top: 44%; }
  .ticket { --stub: 84px; }
  .ticket__cta { padding: .9rem 1rem; letter-spacing: .1em; white-space: nowrap; }
  .ticket__stub svg { width: 70%; }
  .foot__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .manifesto__text .w { opacity: 1; }
  .develop { --dev: 130; }
  .resto__oval { --ox: 50%; --oy: 50%; }
}
