:root {
  --ink: #111110;
  --ink-soft: #2a2826;
  --ivory: #efe8da;
  --ivory-deep: #e4dac6;
  --muted: #6b645a;
  --frame: 14px;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 16px/1.7 var(--sans);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  border: var(--frame) solid var(--ink);
  pointer-events: none;
  z-index: 60;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 24px; background: var(--ink); color: var(--ivory); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 24px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* Header */
.header {
  position: fixed;
  top: var(--frame); left: var(--frame); right: var(--frame);
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  z-index: 50;
  color: var(--ivory);
  transition: background .4s var(--ease), color .4s var(--ease), padding .4s var(--ease);
}
.header.is-solid { background: var(--ivory); color: var(--ink); padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(17,17,16,.12); }
.header__logo img { width: 64px; height: 64px; transition: width .4s var(--ease), height .4s var(--ease); }
.header.is-solid .header__logo img { width: 48px; height: 48px; }
.header__right { display: flex; align-items: center; gap: 22px; }
.lang { font-size: 12px; letter-spacing: .18em; text-decoration: none; }
.lang span { opacity: .45; }
.burger {
  width: 34px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; color: inherit;
}
.burger span { display: block; height: 1px; background: currentColor; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 13px 30px;
  border: 1px solid currentColor;
  font: 500 12px/1 var(--sans);
  letter-spacing: .22em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.btn--light:hover { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.btn--solid { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.btn--solid:hover { background: transparent; color: var(--ink); }
.header .btn { padding: 11px 20px; }
.header:not(.is-solid) .btn:hover { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }

/* Nav overlay */
.nav {
  position: fixed; inset: 0;
  background: var(--ink); color: var(--ivory);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  z-index: 70;
  opacity: 0; visibility: hidden;
  transition: opacity .45s var(--ease), visibility .45s;
}
.nav.is-open { opacity: 1; visibility: visible; }
.nav a:not(.btn) {
  font: 300 clamp(34px, 6vw, 60px)/1.25 var(--serif);
  text-decoration: none;
  opacity: .85;
  transition: opacity .2s;
}
.nav a:not(.btn):hover { opacity: 1; font-style: italic; }
.nav .btn { margin-top: 28px; }
.nav__close {
  position: absolute; top: 36px; right: 42px;
  width: 40px; height: 40px; border: 0; background: none; color: inherit; cursor: pointer;
  font: 300 40px/1 var(--sans);
}
.nav__meta { position: absolute; bottom: 42px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; opacity: .6; text-align: center; padding: 0 24px; }

/* Hero */
/* Hero: tre arcate della loggia, ognuna con un video verticale */
.hero {
  position: relative; height: 100svh; min-height: 620px; overflow: hidden;
  background: var(--ink); color: var(--ivory);
  display: flex; flex-direction: column;
}
.hero__content { position: relative; z-index: 2; text-align: center; padding: 118px 32px 34px; }
.hero__eyebrow { font-size: 12px; letter-spacing: .32em; text-transform: uppercase; margin: 0 0 18px; opacity: .75; }
.hero h1 {
  font: 300 clamp(36px, 4.6vw, 74px)/1.04 var(--serif);
  margin: 0 auto; max-width: 22ch; letter-spacing: -.01em;
}
.hero h1 em { font-style: italic; }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 26px; margin-top: 26px; }
.hero__arches {
  flex: 1; min-height: 0;
  display: flex; justify-content: center; align-items: flex-end; gap: clamp(14px, 2.4vw, 40px);
  padding: 0 32px;
}
.arch {
  margin: 0; height: 84%; aspect-ratio: 9 / 16; overflow: hidden;
  border-radius: 999px 999px 0 0;
  background: #1d1b19;
  animation: rise 1.6s var(--ease) both;
}
.arch--center { height: 100%; animation-delay: .15s; }
.arch:last-child { animation-delay: .3s; }
.arch video { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes rise { from { transform: translateY(14%); opacity: 0; } to { transform: none; opacity: 1; } }
.hero__pause {
  position: absolute; z-index: 3; right: 34px; bottom: 30px;
  width: 38px; height: 38px; border: 1px solid rgba(239,232,218,.5); border-radius: 50%;
  background: rgba(17,17,16,.35); color: var(--ivory); cursor: pointer; font-size: 12px;
  display: grid; place-items: center;
}
.hero__pause:hover { border-color: var(--ivory); }

/* Aperto ora */
.status { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin: 0; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; }
.status.is-open::before { background: #8fc28a; opacity: 1; box-shadow: 0 0 0 0 rgba(143,194,138,.6); animation: ping 2.4s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(143,194,138,0); } 100% { box-shadow: 0 0 0 0 rgba(143,194,138,0); } }
.status:empty { display: none; }

/* Sections */
.section { padding: clamp(80px, 12vw, 160px) clamp(28px, 7vw, 120px); }
.intro { text-align: center; max-width: 820px; margin: 0 auto; }
.intro p { font: 300 clamp(24px, 3vw, 36px)/1.4 var(--serif); margin: 0 0 26px; }
.intro p.small { font: 400 16px/1.8 var(--sans); color: var(--muted); max-width: 560px; margin: 0 auto; }
.ornament { width: 1px; height: 64px; background: var(--ink); margin: 0 auto 48px; opacity: .5; }

.label { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin: 0 0 18px; }
.panel h2, .split h2, .visit h2, .insta h2 {
  font: 300 clamp(38px, 5vw, 64px)/1.05 var(--serif); margin: 0 0 26px;
}

/* Scena "La finestra": l'arco della loggia si apre sulla Torre */
.vista { position: relative; height: 280vh; background: var(--ink); color: var(--ivory); }
.vista__sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.vista__window { position: absolute; inset: 0; will-change: clip-path; }
.vista__window img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.vista__intro {
  position: absolute; left: 0; right: 0; bottom: 4.5svh;
  text-align: center; padding: 0 28px;
}
.vista__intro p { margin: 0; font: 300 clamp(26px, 3.4vw, 46px)/1.15 var(--serif); }
.vista__intro .label { font: 500 12px/1 var(--sans); color: rgba(239,232,218,.6); margin-bottom: 14px; }
.vista__facts {
  position: absolute; left: clamp(28px, 5vw, 72px); bottom: clamp(28px, 6vh, 64px);
  display: flex; gap: clamp(24px, 4vw, 64px); opacity: 0;
  text-shadow: 0 1px 18px rgba(0,0,0,.35);
}
.vista__facts strong { display: block; font: 300 clamp(44px, 6vw, 88px)/1 var(--serif); }
.vista__facts span { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; }

/* Scena "Una giornata": colazione, pranzo e aperitivo in orizzontale */
.giornata { position: relative; height: 360vh; --bg: #efe8da; --fg: #111110; }
.giornata__sticky {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  background: var(--bg); color: var(--fg);
}
.giornata__sky { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); width: min(560px, 70vw); pointer-events: none; }
.giornata__sky svg { width: 100%; height: auto; overflow: visible; display: block; }
.giornata__sky path { fill: none; stroke: currentColor; stroke-width: 1; stroke-dasharray: 2 6; opacity: .45; }
.giornata__sky circle { fill: currentColor; }
.giornata__clock {
  position: absolute; top: 104px; right: clamp(28px, 5vw, 72px);
  font: 300 clamp(28px, 3vw, 42px)/1 var(--serif);
}
.giornata__clock small { display: block; font: 500 11px/1 var(--sans); letter-spacing: .28em; text-transform: uppercase; opacity: .6; margin-bottom: 8px; }
.giornata__track { display: flex; width: 300vw; height: 100%; will-change: transform; }
.panel {
  width: 100vw; height: 100%;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  gap: clamp(36px, 6vw, 100px);
  padding: 150px clamp(28px, 7vw, 120px) 60px;
}
.panel__media { height: min(64svh, 640px); overflow: hidden; }
.panel__media img { width: 100%; height: 100%; object-fit: cover; }
#aperitivo .panel__media img { object-position: 50% 40%; }
.panel .label { color: inherit; opacity: .6; }
.panel p { margin: 0 0 18px; max-width: 46ch; }
.panel .price { font: 400 italic 24px/1.3 var(--serif); }
.panel .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.panel .btn:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.panel .btn--solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.panel .btn--solid:hover { background: transparent; color: var(--fg); }
.sunset { display: flex; gap: 12px; align-items: baseline; font: 400 italic 19px/1.4 var(--serif); margin-top: 6px; }
.sunset:empty { display: none; }
.sunset::before { content: "☀"; font-style: normal; font-size: 14px; color: #e0843f; }
.giornata__sky text { fill: currentColor; font: 500 10px var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.giornata__sky line { stroke: currentColor; stroke-width: 1; opacity: .6; }
.giornata__sky [hidden] { display: none; }

/* Galleria della cena di gala: scorre lentamente */
.gala { background: var(--ink); padding: 0 0 clamp(70px, 9vw, 120px); overflow: hidden; }
.gala__track { display: flex; gap: 14px; width: max-content; animation: drift 70s linear infinite; }
.gala:hover .gala__track { animation-play-state: paused; }
.gala img { height: clamp(220px, 30vw, 360px); width: auto; display: block; }
.gala__caption { color: rgba(239,232,218,.6); font-size: 12px; letter-spacing: .3em; text-transform: uppercase; text-align: center; margin: 28px 0 0; }
@keyframes drift { to { transform: translateX(-50%); } }

/* Progresso dello scroll nella cornice destra */
.progress { position: fixed; top: 0; right: 0; width: var(--frame); height: 100%; z-index: 61; pointer-events: none; }
.progress span { position: absolute; left: 50%; top: 0; width: 1px; height: 100%; background: var(--ivory); opacity: .55; transform-origin: top; transform: scaleY(0); }

/* Dark split (storia / eventi) */
.dark { background: var(--ink); color: var(--ivory); }
.dark .label { color: rgba(239,232,218,.6); }
.split {
  display: grid; grid-template-columns: 1fr 1fr; min-height: 90vh;
}
.split__media { position: relative; min-height: 420px; }
.split__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.split__text { padding: clamp(60px, 9vw, 140px) clamp(28px, 7vw, 110px); align-self: center; }
.split__text p { max-width: 48ch; margin: 0 0 18px; color: rgba(239,232,218,.85); }
.split__text .btn { margin-top: 22px; }
.split__text .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.split__text .actions .btn { margin-top: 0; }

/* Pagina privacy */
.legal { max-width: 760px; margin: 0 auto; padding: 150px 28px 110px; }
.legal h1 { font: 300 clamp(40px, 6vw, 60px)/1.05 var(--serif); margin: 0 0 12px; }
.legal h2 { font: 400 28px/1.2 var(--serif); margin: 48px 0 14px; }
.legal p, .legal li { color: #3a3631; }
.legal ul { padding-left: 20px; }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.legal .updated { color: var(--muted); font-size: 14px; margin-bottom: 40px; }
.split--reverse .split__media { order: 2; }

/* Banner image */
.banner { height: 70vh; min-height: 380px; overflow: hidden; position: relative; }
.banner img { width: 100%; height: 130%; object-fit: cover; position: absolute; top: -15%; }

/* Instagram */
.insta { text-align: center; }
.insta__grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  margin: 48px auto 40px; max-width: 1400px;
}
.insta__grid a { aspect-ratio: 1; overflow: hidden; display: block; }
.insta__grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), opacity .3s; }
.insta__grid a:hover img { transform: scale(1.06); opacity: .85; }

/* Visit */
.visit { background: var(--ivory-deep); }
.visit__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; max-width: 1200px; margin: 0 auto; text-align: center; }
.visit h2 { text-align: center; margin-bottom: 64px; }
.visit h3 { font: 500 12px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; margin: 0 0 18px; color: var(--muted); }
.visit p { margin: 0; font: 400 22px/1.45 var(--serif); }
.visit p a { text-decoration: none; border-bottom: 1px solid rgba(17,17,16,.3); }
.visit .note { margin-top: 10px; font: 400 14px/1.6 var(--sans); color: var(--muted); }
.visit__cta { text-align: center; margin-top: 64px; }

/* Footer */
.footer { background: var(--ink); color: var(--ivory); padding: 72px clamp(28px, 7vw, 110px) 56px; }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 40px; }
.footer__logo img { width: 120px; height: 120px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.footer a { text-decoration: none; opacity: .8; }
.footer a:hover { opacity: 1; }
.footer__opera { font-size: 13px; opacity: .7; max-width: 280px; }
.footer__bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(239,232,218,.15); font-size: 12px; opacity: .55; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* Cookie banner */
.cookie {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  width: min(560px, calc(100% - 48px));
  background: var(--ink); color: var(--ivory);
  padding: 22px 24px; z-index: 80; font-size: 14px;
  display: none;
}
.cookie.is-visible { display: block; }
.cookie p { margin: 0 0 16px; }
.cookie__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie .btn { padding: 10px 18px; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
/* I titoli entrano con la pendenza della Torre (3,97°) e si raddrizzano */
.reveal--lean { transform: rotate(3.97deg) translateY(24px); transform-origin: left bottom; transition-duration: 1.4s; }

/* Barra "Prenota" nella cornice in basso: solo su mobile, come Manhatta */
.bookbar { display: none; }

@media (max-width: 900px) {
  :root { --frame: 12px; --bar: 58px; }
  body { padding-bottom: var(--bar); }
  .bookbar {
    display: flex; align-items: center; justify-content: center;
    position: fixed; left: 0; right: 0; bottom: 0; height: var(--bar); z-index: 62;
    background: var(--ink); color: var(--ivory);
    font: 500 12px/1 var(--sans); letter-spacing: .28em; text-transform: uppercase; text-decoration: none;
  }
  .bookbar::after { content: ""; position: absolute; left: var(--frame); right: var(--frame); bottom: 10px; height: 1px; background: rgba(239,232,218,.3); }
  .cookie { bottom: calc(var(--bar) + 12px); }
  .header { padding: 12px 16px; }
  .header__logo img { width: 52px; height: 52px; }
  .header .btn { display: none; }
  /* Il video è incorniciato da un filo avorio dentro la cornice nera */
  .hero {
    height: calc(100svh - var(--bar)); min-height: 560px;
    border: solid var(--ivory); border-width: calc(var(--frame) + 5px) calc(var(--frame) + 5px) 5px;
  }
  .hero__arches { position: absolute; inset: 0; padding: 0; }
  .arch { display: none; }
  .arch--center { display: block; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
  .hero__content {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 90px 22px 62px;
    background: linear-gradient(rgba(10,10,9,.5), rgba(10,10,9,0) 18%, rgba(10,10,9,0) 40%, rgba(10,10,9,.75));
  }
  .hero h1 { font-size: 42px; text-shadow: 0 2px 24px rgba(0,0,0,.35); }
  .hero__actions .btn { display: none; }
  .hero__actions { margin-top: 20px; }
  .hero__pause { left: 50%; right: auto; bottom: 18px; transform: translateX(-50%); border: 0; background: none; }
  .vista__sticky, .giornata__sticky { height: calc(100svh - var(--bar)); }
  .vista__facts { flex-direction: column; gap: 18px; }
  .giornata__sky { top: auto; bottom: 64px; width: 62vw; left: 20px; transform: none; }
  .giornata__clock { top: auto; bottom: 22px; right: 20px; font-size: 26px; text-align: right; }
  .panel {
    grid-template-columns: 1fr; align-content: start; gap: 22px;
    padding: 88px 20px 110px;
  }
  .panel__media { height: 30svh; }
  .panel h2 { font-size: 34px; margin-bottom: 14px; }
  .panel p { font-size: 15px; line-height: 1.6; margin-bottom: 10px; }
  .panel .price { font-size: 19px; }
  .panel .actions { margin-top: 16px; }
  .panel .btn { padding: 11px 18px; }
  .split, .split--reverse { grid-template-columns: 1fr; min-height: 0; }
  .split--reverse .split__media { order: 0; }
  .split__media { min-height: 62vh; }
  .insta__grid { grid-template-columns: repeat(3, 1fr); }
  .visit__grid { grid-template-columns: 1fr; gap: 40px; }
  .nav__close { top: 22px; right: 22px; }
  .banner img { height: 100%; top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .arch, .status.is-open::before { animation: none; }
  .gala { overflow-x: auto; }
  .gala__track { animation: none; }
  .vista, .giornata { height: auto; }
  .vista__sticky { position: relative; }
  .vista__facts { opacity: 1; }
  .giornata__sticky { position: static; height: auto; }
  .giornata__sky, .giornata__clock { display: none; }
  .giornata__track { width: 100%; flex-direction: column; }
  .panel { width: 100%; height: auto; padding-top: 80px; padding-bottom: 80px; }
}
