:root {
  color-scheme: dark;
  --ink: #f3ece0;
  --gold: #e8952f;
  --nav-offset: 76px;
  --heading: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
html { background: #000; scroll-behavior: smooth; scroll-padding-top: var(--nav-offset); }
body { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--ink); }
button, input { font: inherit; }
button { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
.skip-link { position: fixed; z-index: 25; top: 12px; left: 12px; padding: .65rem 1rem; background: #000; }
.skip-link:not(:focus) { clip-path: inset(50%); }
.top-nav .brand { margin-right: auto; }
.top-nav a { white-space: nowrap; }
.top-nav a:hover { color: var(--gold) !important; }
.top-nav button:hover { border-color: var(--gold) !important; }
.asset-logo, .asset-arc, .asset-wave { object-fit: cover; }
.asset-logo { aspect-ratio: 740 / 510; }
.asset-arc { aspect-ratio: 1294 / 612; object-position: center top; }
.asset-wave { aspect-ratio: 1290 / 1074; object-position: 39% center; }


.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  min-height: 640px;
}

.wave-crop, .logo-crop { overflow: hidden; pointer-events: none; }
.wave-crop { aspect-ratio: 1290 / 1074; }
.hero-wave {
  position: absolute;
  top: 10%;
  left: -10%;
  width: 120%;
  opacity: .55;
  mix-blend-mode: screen;
  filter: blur(1px);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 45%, transparent 100%);
}

.wave-crop img, .logo-crop img { position: absolute; display: block; max-width: none; height: auto; }
/* Match the mockup's crop using the supplied source images at their original resolution. */
.wave-crop img { top: -40.16%; left: -26.30%; width: 207.46%; }
.logo-crop img { top: -1.95%; left: -31.06%; width: 164.35%; }

.hero-paint {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
}
.hero-logo {
  position: relative;
  z-index: 3;
  width: min(620px, 86vw);
  mix-blend-mode: screen;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.hero-filters { position: absolute; }
.hero-logo-drift { position: relative; aspect-ratio: 740 / 510; animation: drift 7s ease-in-out infinite; }
.hero-logo-layer { position: absolute; inset: 0; transform-origin: 50% 42%; }
.hero-logo-edge {
  filter: url(#heroPaint);
  mask-image: radial-gradient(circle at 50% 42%, transparent 29%, #000 34%);
}
.hero-logo-swirl {
  opacity: .45;
  mix-blend-mode: screen;
  filter: url(#heroPaint);
  mask-image: radial-gradient(circle at 50% 42%, transparent 30%, #000 38%);
}
.hero-logo-center { mask-image: radial-gradient(circle at 50% 42%, #000 30%, transparent 34%); }
.hero-title {
  position: relative;
  z-index: 3;
  margin: 8px 0 0;
  color: var(--gold);
  font: 400 clamp(40px, 6vw, 84px) var(--heading);
  letter-spacing: .06em;
  text-align: center;
}
.hero-word, .hero-letter { display: inline-block; }
.hero-word { white-space: nowrap; }
.hero-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: .3em;
  text-align: center;
  text-transform: uppercase;
}
.stage-link { position: relative; color: #f3ece0aa; }
.stage-link::before { position: absolute; inset: -12px -8px; content: ""; }
.hero-cue > span { width: 1px; height: 48px; background: var(--ink); animation: cue 2.4s ease-in-out infinite; }

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes cue {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.finale {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  min-height: 100vh;
  min-height: 100svh;
  padding: 120px 24px 160px;
  overflow: hidden;
  text-align: center;
  scroll-margin-top: calc(-1 * var(--nav-offset));
}

.finale-wave {
  position: absolute;
  top: 0;
  left: -5%;
  width: 110%;
  opacity: .5;
  mix-blend-mode: screen;
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 45%, transparent 100%);
}

.finale [data-finale-reveal] { position: relative; }
.finale-label { color: #f3ece0aa; font-size: 14px; letter-spacing: .3em; text-transform: uppercase; }
#finale-title { margin: 0; font: 400 clamp(56px, 9vw, 150px) / .95 var(--heading); }
#finale-title em { color: var(--gold); }

.finale-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 36px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: #000a;
  color: var(--ink);
  font-size: 20px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.finale-cta:is(:hover, :focus-visible) { background: var(--gold); color: #000; }
.motion .finale [data-finale-reveal] { transition: opacity 1.4s ease, transform 1.4s cubic-bezier(.2,.7,.2,1); }
.motion .finale .finale-pending:not(:focus-within) {
  opacity: 0;
  transform: translateY(50px);
  transition: none;
}
.motion .finale .finale-cta:focus-visible { transition: none; }

.voice-stage { position: relative; }
.voice-scene {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: clamp(80px, 12vw, 140px) 20px;
}

.voice-backdrop {
  position: absolute;
  inset: -10vh 0;
  overflow: hidden;
  mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  pointer-events: none;
}

.voice-backdrop-layer { position: absolute; mix-blend-mode: screen; }
.voice-logo {
  top: 50%;
  left: 50%;
  width: 150vmax;
  aspect-ratio: 740 / 510;
  margin: -50vmax 0 0 -75vmax;
  opacity: .16;
  filter: blur(24px) saturate(1.3);
  mask-image: radial-gradient(circle at 50% 42%, transparent 22%, #000 34%);
}

.voice-arc {
  top: 55%;
  left: 50%;
  width: 170vw;
  aspect-ratio: 1294 / 612;
  margin-left: -85vw;
  overflow: hidden;
  opacity: .12;
  filter: blur(18px);
  transform: scaleY(-1);
}
.voice-arc img { position: absolute; top: 0; left: -20.59%; width: 134.45%; max-width: none; }

.voice-drift { top: -10%; left: -20%; width: 80vw; opacity: .1; filter: blur(14px); }

.voice-paint {
  position: absolute;
  top: 50%;
  left: 50%;
  display: none;
  width: max(130vw, 1200px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.voice-ink {
  position: relative;
  mix-blend-mode: screen;
  filter: url(#achPaint);
  mask-image: radial-gradient(ellipse 0% 0% at 0% 85%, #000 40%, transparent 100%);
}

.voice-word {
  position: relative;
  color: var(--word-color);
  font: 400 clamp(40px, 6vw, 104px) / 1 var(--heading);
  white-space: nowrap;
}
.voice-word[data-word="0"] { --word-x: 18%; --word-y: 70%; --word-color: #f3ece0; }
.voice-word[data-word="1"] { --word-x: 36%; --word-y: 56%; --word-color: #c9a6cd; }
.voice-word[data-word="2"] { --word-x: 54%; --word-y: 44%; --word-color: #e0386a; }
.voice-word[data-word="3"] { --word-x: 70%; --word-y: 32%; --word-color: #e8952f; }
.voice-word[data-word="4"] { --word-x: 84%; --word-y: 20%; --word-color: #3fc6d6; }
.voice-word:is([data-word="0"], [data-word="2"], [data-word="4"]) { font-style: italic; }

.voice-description {
  position: relative;
  width: min(820px, 88vw);
  margin: 22px 0 0;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.45;
  text-align: center;
  text-wrap: pretty;
}
.voice-description em { color: var(--gold); }

.motion .voice-stage {
  height: 280vh;
  height: 280svh;
  scroll-margin-top: calc(-1 * var(--nav-offset));
}
.motion .voice-scene {
  position: sticky;
  top: 0;
  display: block;
  height: 100vh;
  height: 100svh;
  padding: 0;
}
.motion .voice-paint { display: block; }
.motion .voice-word {
  position: absolute;
  top: var(--word-y);
  left: var(--word-x);
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.motion .voice-description {
  position: absolute;
  bottom: clamp(60px, 12vh, 130px);
  left: 50%;
  margin: 0;
  opacity: 0;
  transform: translateX(-50%);
}

html:not(.motion) #inizio *, html:not(.motion) [data-act] * { animation: none !important; transition: none !important; }

.laboratories { position: relative; }
.lab-scene { position: relative; overflow: hidden; }
.lab-wave {
  position: absolute;
  top: -10%;
  right: -20%;
  width: 90%;
  opacity: .35;
  mix-blend-mode: screen;
  transform: scaleX(-1);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 45%, transparent 100%);
  pointer-events: none;
}

.lab-label {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 20px;
}
#lab-title {
  margin: 0;
  color: #f3ece0aa;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.lab-count { display: none; color: var(--gold); font: italic 22px var(--heading); font-variant-numeric: tabular-nums; }
.lab-track {
  position: relative;
  display: grid;
  gap: 36px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}
.lab-item { --lab-accent: var(--gold); display: flex; flex: none; flex-direction: column; gap: 18px; }
.lab-act { color: var(--lab-accent); font: italic 24px var(--heading); }
.lab-item h3 {
  margin: 0;
  font: 400 clamp(2.25rem, 8vw, 5rem) / .95 var(--heading);
}
.lab-item em { color: var(--lab-emphasis, var(--lab-accent)); }
.lab-item-canto { --lab-accent: #3fc6d6; }
.lab-item-pagine { --lab-accent: #b38bb8; --lab-emphasis: #c9a6cd; }
.lab-item-donna { --lab-accent: #e0386a; --lab-emphasis: var(--ink); }
.lab-item-canto h3 { color: #3fc6d6; }
.lab-item-donna h3 { color: var(--lab-accent); }
.lab-progress { display: none; }

.pinned-labs .laboratories {
  height: 340vh;
  height: 340svh;
  scroll-margin-top: calc(-1 * var(--nav-offset));
}
.pinned-labs .lab-scene {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100vh;
  height: 100svh;
}
.pinned-labs .lab-label {
  position: absolute;
  top: clamp(90px, 14vh, 140px);
  left: clamp(24px, 4vw, 56px);
}
.pinned-labs .lab-count { display: inline; }
.pinned-labs .lab-track {
  display: flex;
  align-items: center;
  gap: 12vw;
  width: max-content;
  margin: 0;
  padding: 0 10vw;
  will-change: transform;
}
.pinned-labs .lab-item h3 { font-size: clamp(72px, 11vw, 180px); white-space: nowrap; }

@supports (-webkit-text-stroke: 1px #000) {
  .pinned-labs .lab-item-canto h3 { color: transparent; -webkit-text-stroke: 1.5px var(--lab-accent); }
}

.pinned-labs .lab-progress {
  position: absolute;
  display: block;
  right: clamp(24px, 4vw, 56px);
  bottom: clamp(40px, 8vh, 80px);
  left: clamp(24px, 4vw, 56px);
  height: 1px;
  background: #f3ece022;
}
.lab-progress > div { height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; }
html:not(.pinned-labs) .lab-scene { padding: 64px clamp(24px, 6vw, 72px); }

@media (max-width: 720px) {
  :root { --nav-offset: 102px; }
  .pinned-labs .lab-track { gap: 0; padding: 0; }
  .pinned-labs .lab-item { width: 100vw; padding-inline: clamp(24px, 8vw, 56px); }
  .pinned-labs .lab-item h3 { font-size: clamp(2.1rem, 10.5vw, 4.5rem); white-space: normal; }
  .pinned-labs .lab-wave { top: 14%; right: -36%; width: 140%; }
  .top-nav {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: 36px auto;
    gap: 4px !important;
    padding: 8px 12px 12px !important;
    background: linear-gradient(#000 80%, #0000) !important;
  }
  .top-nav .brand { grid-column: 2; margin: 0; line-height: 1; }
  .top-nav .nav-links {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: center;
    gap: clamp(8px, 2.8vw, 20px) !important;
    font-size: .75rem !important;
    letter-spacing: .09em !important;
  }
  .top-nav [data-action="toggleSound"] { grid-row: 1; grid-column: 3; justify-self: end; }
  .nav-links a { padding: 10px 0; }
  .hero { min-height: 460px; height: 100svh; padding: 68px 16px 110px; }
  .hero-title { font-size: clamp(2rem, 9.8vw, 2.5rem); }
  #finale-title { font-size: clamp(2.75rem, 13.5vw, 3.5rem); }
  .voice-word { font-size: clamp(1.75rem, 8vw, 3.25rem); }
  .voice-word[data-word="0"] { --word-x: 21%; }
  .voice-word[data-word="4"] { --word-x: 79%; }
  .voice-description { font-size: clamp(1.225rem, 5.2vw, 1.65rem); }
  .motion .voice-description { bottom: clamp(40px, 10vh, 84px); }
  .motion .voice-word, .motion .voice-description { text-shadow: 0 2px 12px #000b; }

}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
