:root {
  --carta: #ffffff;
  --inchiostro: #000000;
  --tenue: #6f6f6f;
  --riga: #e4e4e4;
  --accento: #ff4fa3;
  --grigio: #f3f3f3;
  --raggio: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--carta); }
html.lenis, html.lenis body { height: auto; }

body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(13px, 1.25vw, 16px);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.marchio {
  font-family: 'Archivo Variable', 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 125;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 13px;
}

/* the opening: the title of the film, very condensed and very heavy */
.apertura {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 5vw;
}
.barra {
  position: absolute;
  top: min(3.4vh, 22px);
  left: 5vw;
  right: 5vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--riga);
}
.barra__voce { font-size: 12px; color: var(--tenue); }
.occhiello { font-size: 12px; color: var(--tenue); margin-bottom: 1.4vh; }
.titolo {
  font-family: 'Archivo Variable', 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 62;
  font-weight: 900;
  text-transform: uppercase;
  font-size: min(21vw, 25vh);
  line-height: 0.8;
  letter-spacing: -0.012em;
}
.sotto { margin-top: 2.2vh; font-size: clamp(13px, 1.3vw, 17px); }
.scendi {
  position: absolute;
  left: 5vw;
  bottom: min(4vh, 28px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--tenue);
}
.scendi svg { width: 8px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.2; }

/* the film section: tall, with a stage that stays on screen */
.film { position: relative; height: 300vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 4vw;
  padding: 7vh 5vw;
  align-items: center;
}

.area {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* the frame: one box that is the poster first and the still afterwards; its size comes from the script */
.quadro {
  position: relative;
  width: 200px;
  height: 300px;
  border-radius: var(--raggio);
  overflow: hidden;
  background: var(--grigio);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 calc(var(--ombra, 1) * 18px) calc(var(--ombra, 1) * 40px) calc(var(--ombra, 1) * -14px) rgba(10, 12, 30, 0.35);
  isolation: isolate;
  transform: translateZ(0);
}
.strato { position: absolute; inset: 0; }
.dentro { position: absolute; inset: 0; will-change: transform; }
.dentro svg { display: block; width: 100%; height: 100%; }
.strato--trailer { opacity: 0; visibility: hidden; }

/* the drawings */
.filo { stroke: rgba(40, 10, 30, 0.45); stroke-width: 1; fill: none; }
.filo--scuro { stroke: rgba(225, 210, 190, 0.35); }
.piega { fill: none; stroke: rgba(150, 110, 80, 0.28); stroke-width: 1; stroke-linecap: round; }
.piega--scura { stroke: rgba(120, 90, 70, 0.35); }
.p-falce { fill: rgba(170, 40, 100, 0.18); }
.p-ombra { fill: rgba(120, 10, 60, 0.22); }
.p-piccolo, .p-crediti, .p-data, .p-titolo { font-family: 'Archivo Variable', 'Archivo', sans-serif; fill: #14060d; }
.p-piccolo { font-size: 10px; font-weight: 700; letter-spacing: 0.22em; font-variation-settings: 'wdth' 110; }
.p-titolo { font-size: 104px; font-weight: 900; font-variation-settings: 'wdth' 62; letter-spacing: -0.5px; }
.p-crediti { font-size: 6.6px; font-weight: 600; font-variation-settings: 'wdth' 70; letter-spacing: 0.06em; opacity: 0.78; }
.p-data { font-size: 10px; font-weight: 800; letter-spacing: 0.18em; font-variation-settings: 'wdth' 100; }

.telaio { stroke: #070a16; stroke-width: 6; fill: none; }
.telaio--bordo { stroke-width: 8; }
.davanzale { stroke: #2a3155; stroke-width: 3; }
.stella { fill: #dfe5ff; }
.pavimento { stroke: #1f2440; stroke-width: 1; }
.tavolo { stroke: #2b2238; stroke-width: 5; stroke-linecap: round; fill: none; }
.lampada { stroke: #3a2c2a; stroke-width: 3; fill: none; }
.paralume { fill: #f6c98c; }
.alone { mix-blend-mode: screen; }
.t-falce { fill: rgba(30, 30, 70, 0.32); }
.t-ombra { fill: rgba(0, 0, 0, 0.35); }
.polvere { fill: #ffe2b4; }
.vignetta { fill: none; stroke: rgba(0, 0, 0, 0.42); stroke-width: 80; filter: blur(30px); }

.grana {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: overlay;
  background-size: 160px 160px;
}

/* the line that runs along the bottom while the trailer plays */
.avanza {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  height: 2px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
}
.avanza span { position: absolute; inset: 0; background: #fff; transform-origin: left center; transform: scaleX(0); }

.play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(64px, 11vh);
  height: min(64px, 11vh);
  margin: calc(min(64px, 11vh) / -2) 0 0 calc(min(64px, 11vh) / -2);
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0;
  -webkit-tap-highlight-color: transparent;
}
.play svg { width: 100%; height: 100%; overflow: visible; }
.play__tri { fill: rgba(255, 255, 255, 0); stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; transition: fill 0.35s cubic-bezier(0.19, 1, 0.22, 1); }
.play__pausa { stroke: #fff; stroke-width: 1.4; stroke-linecap: round; opacity: 0; }
.play:focus-visible { outline: 1px solid #fff; outline-offset: 6px; border-radius: 50%; }
@media (hover: hover) {
  .play:hover .play__tri { fill: rgba(255, 255, 255, 0.92); }
}

.didascalia {
  position: relative;
  height: 18px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--tenue);
  width: 100%;
  text-align: center;
}
.didascalia span { position: absolute; left: 0; right: 0; top: 0; }
[data-dida-trailer] { opacity: 0; }

/* the text goes by in a window of its own while the frame stays */
.testi {
  position: relative;
  height: min(64vh, 560px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 86%, transparent 100%);
}
.testi__scorre { position: absolute; left: 0; right: 0; top: 0; max-width: 30em; }
.etichetta { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tenue); margin-bottom: 1.2em; }
.sinossi { font-size: clamp(16px, 1.7vw, 22px); line-height: 1.32; letter-spacing: -0.005em; font-variation-settings: 'wdth' 96; }
.meta { margin-top: 1.4em; color: var(--tenue); font-size: 13px; }
.crediti { margin-top: 3.4em; border-top: 1px solid var(--riga); }
.crediti div { display: grid; grid-template-columns: 8.5em 1fr; gap: 1em; padding: 0.8em 0; border-bottom: 1px solid var(--riga); }
.crediti dt { color: var(--tenue); font-size: 12px; padding-top: 0.15em; }
.crediti dd { font-size: 14px; }
.uscita {
  margin-top: 3em;
  font-family: 'Archivo Variable', 'Archivo', sans-serif;
  font-variation-settings: 'wdth' 62;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(34px, 4.6vw, 64px);
  line-height: 0.86;
}

.chiusura {
  height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-top: 1px solid var(--riga);
}
.marchio--grande { font-size: clamp(28px, 6vw, 64px); letter-spacing: 0.06em; }
.chiusura__frase { color: var(--tenue); font-size: 13px; }

/* narrow screens: the frame on top, the text window under it */
@media (max-width: 700px), (max-aspect-ratio: 4/5) {
  .palco {
    grid-template-columns: 1fr;
    grid-template-rows: 58% 1fr;
    gap: 2.4vh;
    padding: 5vh 5vw 4vh;
    align-items: stretch;
  }
  .testi { height: 100%; }
  .testi__scorre { max-width: none; }
  .sinossi { font-size: clamp(15px, 4.2vw, 19px); }
  .crediti div { grid-template-columns: 7.2em 1fr; padding: 0.6em 0; }
  .crediti dd { font-size: 13px; }
  .uscita { font-size: clamp(30px, 10vw, 46px); }
  .didascalia { margin-top: 8px; height: 16px; font-size: 11px; }
}
