@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("font/instrument-serif-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("font/instrument-serif-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("font/instrument-serif-corsivo-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("font/instrument-serif-corsivo-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300 500; font-display: swap; src: url("font/jost-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300 500; font-display: swap; src: url("font/jost-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --nero: #050404;
  --carta: #f3ece2;
  --carta-tenue: rgba(243, 236, 226, 0.62);
  --sabbia: #d9a66a;
  --vetro: #a9cbea;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --p: 0;
}

* { box-sizing: border-box; }
html { background: var(--nero); color-scheme: dark; scroll-behavior: auto; }
body {
  margin: 0;
  background: transparent;
  color: var(--carta);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--sabbia); outline-offset: 4px; }

/* ---------- caricamento ---------- */
#caricamento {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem;
  background: var(--nero);
  transition: opacity 0.9s ease, visibility 0.9s;
}
#caricamento.via { opacity: 0; visibility: hidden; pointer-events: none; }
.caricamento-titolo { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0; letter-spacing: 0.01em; }
.caricamento-stato { margin: 0; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--carta-tenue); }
.caricamento-barra { width: 180px; height: 1px; background: rgba(243, 236, 226, 0.14); overflow: hidden; }
.caricamento-barra i { display: block; height: 100%; width: 100%; background: var(--sabbia); transform-origin: left; transform: scaleX(var(--carico, 0)); transition: transform 0.25s ease-out; }
html:not(.js) #caricamento { display: none; }

/* ---------- testata e avanzamento ---------- */
.testata {
  position: fixed; left: 0; right: 0; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: clamp(12px, 2vw, 20px) clamp(16px, 3vw, 36px);
  opacity: 0; transform: translateY(-6px); transition: opacity 0.6s ease, transform 0.6s ease; pointer-events: none;
  background: linear-gradient(to bottom, rgba(5, 4, 4, 0.7), rgba(5, 4, 4, 0));
}
.testata.visibile { opacity: 1; transform: none; pointer-events: auto; }
.marchio { font-family: var(--serif); font-size: 1.25rem; letter-spacing: 0.01em; text-decoration: none; color: var(--carta); }
.menu { display: flex; gap: clamp(1rem, 2.4vw, 2.2rem); }
.menu a { font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; color: var(--carta-tenue); transition: color 0.3s; }
.menu a:hover { color: var(--carta); }
.tasto.piccolo { padding: 0.6em 1.3em; font-size: 0.7rem; }
.tasti-testata { display: flex; gap: 0.5rem; align-items: center; }
.tasto.schermo { cursor: pointer; background: transparent; color: inherit; font-family: inherit; display: inline-flex; align-items: center; gap: 0.5em; }
.tasto.schermo svg { width: 13px; height: 13px; }
.tasto.schermo[hidden] { display: none; }
.avanzamento {
  position: fixed; right: clamp(12px, 2vw, 22px); top: 50%; z-index: 30;
  width: 1px; height: 34vh; transform: translateY(-50%);
  background: rgba(243, 236, 226, 0.12); pointer-events: none;
  opacity: 0; transition: opacity 0.6s ease;
}
html.pronto .avanzamento { opacity: 1; }
html.pronto.oltre .avanzamento { opacity: 0; }
.avanzamento i { position: absolute; inset: 0; background: var(--carta); opacity: 0.55; transform-origin: top; transform: scaleY(var(--p)); }

/* ---------- il film ---------- */
.film { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: var(--nero); }
#tela { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#polvere { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; mix-blend-mode: screen; }
.poster { width: 100%; height: auto; display: block; }

.testi { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.testo { position: absolute; margin: 0; max-width: min(88vw, 40rem); transform: translateY(14px); will-change: transform; }
.testo.attivo { pointer-events: auto; }
.testo.sinistra { left: clamp(20px, 5vw, 90px); }
.testo.destra { right: clamp(20px, 5vw, 90px); text-align: right; }
.testo.alto { top: clamp(13vh, 16vh, 19vh); }
.testo.basso { bottom: clamp(9vh, 12vh, 15vh); }
.testo.mezzo { top: 50%; transform: translateY(-50%); }
html.js:not(.calmo) .testo .vetro, html.js:not(.calmo) .testo .piano, html.js:not(.calmo) .testo .lettera { opacity: 0; }

/* apertura: il nome a destra della clessidra, la frase a sinistra */
.testo.apertura { inset: 0; max-width: none; }
html.js:not(.calmo) .apertura h1 { position: absolute; right: clamp(20px, 5vw, 90px); top: 21%; margin: 0; text-align: right; }
html.js:not(.calmo) .apertura .sotto { position: absolute; left: clamp(20px, 5vw, 90px); bottom: 21%; }

.testo p { margin: 0; }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(3.4rem, 8.6vw, 10.5rem); line-height: 0.92; margin: 0 0 0.9rem; letter-spacing: -0.01em; }
.sotto { font-family: var(--serif); font-style: italic; font-size: clamp(1.35rem, 2.3vw, 2.4rem); line-height: 1.12; color: var(--carta); }
.grande { font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 3.3rem); line-height: 1.06; letter-spacing: -0.005em; }
.enorme { font-family: var(--serif); font-style: italic; font-size: clamp(3.8rem, 10.5vw, 9.5rem); line-height: 0.95; letter-spacing: 0; white-space: nowrap; }
.urto .enorme { color: var(--vetro); }
.urto .enorme span { display: inline-block; will-change: transform; }
.urto .enorme span.spazio { width: 0.28em; }
.urto .enorme span.lettera { color: #dcecff; text-shadow: 0 0 1px rgba(255, 255, 255, 0.9), 0 0 18px rgba(169, 203, 234, 0.45); }
.fine .grande { margin-bottom: 1.6rem; }

.azioni { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.testo.sinistra .azioni { justify-content: flex-start; }

/* ---------- scritte di vetro (js/vetro.js disegna maschera e spessore) ---------- */
.vetro { display: inline-block; white-space: nowrap; padding: 0.16em 0.22em 0.12em; margin: -0.16em -0.22em -0.12em; line-height: 1.04; }
html.vetro-ok .vetro.vetro-pronto {
  color: transparent;
  text-shadow: none;
  -webkit-mask-image: var(--maschera); mask-image: var(--maschera);
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  background-image:
    var(--orlo),
    linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, 0.7) 47%, rgba(255, 255, 255, 0.12) 51%, transparent 58%),
    linear-gradient(172deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03) 55%, rgba(169, 203, 234, 0.12));
  background-size: 100% 100%, 300% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: 0 0, 100% 0, 0 0;
  -webkit-backdrop-filter: blur(var(--sfoca, 7px)) saturate(1.9) brightness(1.75) contrast(1.06);
  backdrop-filter: blur(var(--sfoca, 7px)) saturate(1.9) brightness(1.75) contrast(1.06);
  animation: luce-vetro 7s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}
@keyframes luce-vetro {
  0%, 52% { background-position: 0 0, 100% 0, 0 0; }
  100% { background-position: 0 0, 0% 0, 0 0; }
}
html.vetro-ok h1 .vetro { --sfoca: 10px; }
/* telefono: niente sfocatura dal vivo (misurato: 13% di fotogrammi saltati contro 5%), vetro smerigliato fisso */
html.vetro-leggero .vetro.vetro-pronto {
  animation: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  background-image: var(--orlo), linear-gradient(172deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.22) 55%, rgba(200, 222, 245, 0.34));
  background-size: 100% 100%, 100% 100%;
  background-position: 0 0, 0 0;
}
.tasto {
  display: inline-block; padding: 0.8em 1.7em; border: 1px solid rgba(243, 236, 226, 0.45); border-radius: 999px;
  font-size: 0.78rem; font-weight: 400; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.tasto:hover { background: var(--carta); color: var(--nero); border-color: var(--carta); }
.tasto.secondario { border-color: transparent; color: var(--carta-tenue); }
.tasto.secondario:hover { background: transparent; color: var(--carta); border-color: transparent; }

/* ---------- sezioni di contenuto ---------- */
.sezione { position: relative; padding: clamp(5rem, 12vh, 9rem) 0; overflow: hidden; isolation: isolate; }
.sezione .sfondo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; opacity: 0.42;
  mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
}
.dentro { max-width: 1100px; margin: 0 auto; padding: 0 clamp(20px, 6vw, 90px); }
.dentro.stretto { max-width: 680px; }
.etichetta { margin: 0 0 1rem; font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--sabbia); }
.sezione h2, .titolo-lastra { font-family: var(--serif); font-weight: 400; font-size: clamp(2.1rem, 4.8vw, 3.9rem); line-height: 1.06; letter-spacing: -0.01em; margin: 0 0 1.2rem; }
.intro { font-size: clamp(1.02rem, 1.5vw, 1.18rem); color: var(--carta-tenue); max-width: 54ch; margin: 0 0 2.6rem; text-wrap: pretty; }
.schede { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.schede li {
  padding: 1.6rem 1.5rem 1.7rem; border: 1px solid rgba(243, 236, 226, 0.12); border-radius: 18px;
  background: rgba(5, 4, 4, 0.18);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.schede li:hover { border-color: rgba(169, 203, 234, 0.45); background: rgba(243, 236, 226, 0.06); }
.schede li { position: relative; overflow: hidden; }
.schede li::after { /* controllo-trattini:ok, riflesso di luce a tutta scheda che segue il puntatore */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.45s ease;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(169, 203, 234, 0.18), transparent 62%);
}
.schede li:hover::after { opacity: 1; }
html.js:not(.calmo) .rivela { opacity: 0; transform: translateY(26px); }
.schede h3, .passi h3 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 0 0 0.5rem; }
.schede p, .passi p { margin: 0; color: var(--carta-tenue); font-size: 0.98rem; line-height: 1.55; }
.passi { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem 2.5rem; }
.passi li { position: relative; padding-top: 0.4rem; }
.numero { display: block; font-family: var(--serif); font-size: 3.2rem; line-height: 1; color: var(--vetro); margin-bottom: 0.6rem; }
.azioni.inizio { justify-content: flex-start; margin-top: 0.4rem; }
.modulo { display: grid; gap: 1rem; }
.modulo label { display: grid; gap: 0.4rem; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--carta-tenue); }
.modulo input, .modulo textarea {
  font: inherit; font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--carta);
  background: rgba(243, 236, 226, 0.05); border: 1px solid rgba(243, 236, 226, 0.18); border-radius: 12px; padding: 0.85rem 1rem;
}
.modulo input::placeholder, .modulo textarea::placeholder { color: rgba(243, 236, 226, 0.35); }
.modulo input:focus, .modulo textarea:focus { outline: none; border-color: var(--vetro); }
.modulo button { justify-self: start; margin-top: 0.4rem; cursor: pointer; background: transparent; color: inherit; font-family: inherit; }
/* ---------- le lastre di vetro dietro le sezioni (js/lastre.js) ---------- */
#lastre { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.8s ease; }
html.lastre-accese #lastre { opacity: 1; }
.pannello { position: relative; max-width: 1100px; margin: 0 auto; padding: clamp(30px, 5vw, 68px); opacity: var(--intero, 1); }
.pannello.stretto { max-width: 760px; }
html.senza-lastre .pannello, html.calmo .pannello {
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 4px;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
/* ---------- il footer: una lastra che si rompe e si ripara ---------- */
.lastra { position: relative; min-height: 100vh; min-height: 100svh; padding: clamp(6rem, 16vh, 11rem) 0 2.5rem; overflow: hidden; display: flex; flex-direction: column; }
.lastra > .pannello { width: calc(100% - 2 * clamp(12px, 4vw, 48px)); }
.titolo-lastra { margin-bottom: 2.4rem; }
.sezione { padding: clamp(7rem, 22vh, 14rem) clamp(12px, 4vw, 48px); }
.vetrine { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.vetrina {
  position: relative; padding: 1.5rem 1.5rem 1.6rem; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.vetrina p { margin: 0; color: var(--carta-tenue); line-height: 1.7; }
.vetrina .nome { font-family: var(--serif); font-size: 1.4rem; color: var(--carta); margin-bottom: 0.4rem; }
.vetrina a { color: var(--carta); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.marchio-gigante {
  margin: auto 0 0; padding: 4vh 0 0; text-align: center; white-space: nowrap; user-select: none;
  font-family: var(--serif); font-size: clamp(6rem, 27vw, 30rem); line-height: 0.86; letter-spacing: -0.02em; color: rgba(243, 236, 226, 0.85);
}
.marchio-gigante .vetro { --sfoca: 5px; will-change: transform; }
.piede { margin-top: 2.6rem; padding: 0 clamp(20px, 6vw, 90px); text-align: center; }
.piede p { max-width: 62ch; margin: 0 auto; font-size: 0.8rem; color: rgba(243, 236, 226, 0.45); line-height: 1.6; }
.piede .firma { margin-top: 0.6rem; }
.piede a { color: var(--carta); }
  40% { transform: translate(3px, -3px); }
  60% { transform: translate(-2px, 2px); }
  80% { transform: translate(1px, -1px); }
}
/* ---------- grana e vignetta ---------- */
.grana {
  position: fixed; inset: -60%; z-index: 20; pointer-events: none; opacity: 0.075; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  animation: grana 0.7s steps(5) infinite;
}
@keyframes grana {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}
.vignetta { position: fixed; inset: 0; z-index: 19; pointer-events: none; background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.62) 100%); }

/* ---------- meno movimento: fotogrammi fermi, uno per testo ---------- */
html.calmo .grana, html.calmo .avanzamento, html.telefono .grana { display: none; }
html.calmo .film { height: auto; overflow: visible; }
html.calmo #tela { display: none; }
html.calmo .testi { position: static; pointer-events: auto; }
.quadro { position: relative; max-width: 1100px; margin: 0 auto; }
.quadro img { display: block; width: 100%; height: auto; }
html.calmo .testo { position: static; transform: none; max-width: none; padding: 1.4rem clamp(20px, 6vw, 90px) 3.2rem; text-align: left; pointer-events: auto; }
html.calmo .azioni { justify-content: center; }

/* ---------- senza JavaScript: poster e testi in colonna ---------- */
html:not(.js) .film { height: auto; overflow: visible; }
html:not(.js) #tela, html:not(.js) .grana, html:not(.js) .avanzamento { display: none; }
html:not(.js) .testi { position: static; pointer-events: auto; }
html:not(.js) .testo { position: static; transform: none; max-width: none; padding: 1.4rem clamp(20px, 6vw, 90px); pointer-events: auto; }
html:not(.js) .testata { opacity: 1; pointer-events: auto; transform: none; }

@media (max-width: 640px) {
  .menu { display: none; }
  .tasto.schermo span { display: none; }
  .tasto.schermo { padding: 0.6em 0.8em; }
  .testo.sinistra, .testo.destra { max-width: 90vw; }
  .testo.alto { top: 11vh; }
  .testo.basso { bottom: 9vh; }
  html.js:not(.calmo) .apertura h1 { top: 9vh; font-size: 19vw; }
  html.js:not(.calmo) .apertura .sotto { bottom: 9vh; }
  .marchio-gigante { font-size: 29vw; }
  .vignetta { background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.7) 100%); }
}
