/* ============================================================
   DON VITTORIO — cinematic home
   A24 x Netflix x Il Padrino. The trailer opens the page full-screen,
   followed by Il Codice and Le Lettere. Pure black, white
   serif, a breath of aged gold. Everything slow, everything
   quiet. The page closes on Le Lettere (weekly-letter email
   capture, UI only for now); the ad funnel page lives at entra/
   and is reached from ads directly, not from here.
   ============================================================ */

:root {
  --black: #050505;
  --white: #f2efe9;
  --dim: rgba(242, 239, 233, 0.55);
  --faint: rgba(242, 239, 233, 0.32);
  --gold: #b89b5e;
  --gold-dim: rgba(184, 155, 94, 0.55);
  --hairline: rgba(184, 155, 94, 0.18);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
  --slow: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--black); }

/* ------------------------------------------------------------
   The opening — lights down, then the projector starts.
   ------------------------------------------------------------ */
#veil {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 200;
  pointer-events: none;
  transition: opacity 2.4s ease;
}
#veil.is-lifted { opacity: 0; }

/* ------------------------------------------------------------
   Atmosphere layers
   ------------------------------------------------------------ */
#fog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

main, .footer { position: relative; z-index: 1; }

/* ------------------------------------------------------------
   Reveal — nothing appears; everything emerges.
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 2.2s var(--slow), transform 2.2s var(--slow);
  will-change: opacity, transform;
}
.reveal[data-delay="1"] { transition-delay: 0.35s; }
.reveal[data-delay="2"] { transition-delay: 0.7s; }
.reveal[data-delay="3"] { transition-delay: 1.05s; }
.reveal[data-delay="4"] { transition-delay: 1.5s; }
.reveal.is-in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #veil { display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__cue-arrow { animation: none !important; }
}

/* ------------------------------------------------------------
   Shared section rhythm — negative space is the design.
   ------------------------------------------------------------ */
.section {
  padding: 34vh 8vw;
  max-width: 1280px;
  margin: 0 auto;
}

.kicker {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 3.2rem;
}

.section__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin-bottom: 10rem;
}

/* ------------------------------------------------------------
   HERO — the trailer holds the screen, then cedes it.
   The wrapper is taller than the viewport: the pinned scene
   stays put for a beat while you scroll, fading as the next
   act arrives. No cut, only a dissolve.
   ------------------------------------------------------------ */
.hero-wrap { height: 185vh; }

.hero {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__video.is-missing { display: none; }

.hero__shade {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.42);
}

.hero__center {
  position: relative;
  text-align: center;
  padding: 0 6vw;
  /* the title card comes in late, like an opening credit */
  opacity: 0;
  animation: titleCard 3.2s ease 1.1s forwards;
}
@keyframes titleCard { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hero__center { opacity: 1; animation: none; }
}

.hero__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 9vw, 7.4rem);
  letter-spacing: 0.3em;
  margin-right: -0.3em; /* optically recenter the tracked type */
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
}

.hero__line {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  color: var(--dim);
  letter-spacing: 0.14em;
  margin-top: 2.6rem;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.6);
}

.hero__cue {
  position: absolute;
  bottom: 4.5vh;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--faint);
  opacity: 0;
  animation: titleCard 2.4s ease 2.8s forwards;
  transition: opacity 1.4s ease;
}
.hero__cue.is-gone { opacity: 0 !important; animation: none; }

.hero__cue-arrow {
  font-size: 0.95rem;
  color: var(--gold-dim);
  animation: cueSink 3.4s var(--slow) infinite;
}
@keyframes cueSink {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(9px); opacity: 1; }
}

/* the only visible control: sound, faint, in the corner */
.hero__sound {
  position: absolute;
  bottom: 4.5vh;
  right: 3.2vw;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(242, 239, 233, 0.22);
  border-radius: 50%;
  color: var(--dim);
  cursor: pointer;
  opacity: 0;
  animation: titleCard 2.4s ease 2.8s forwards;
  transition: color 0.8s ease, border-color 0.8s ease;
}
.hero__sound:hover { color: var(--white); border-color: rgba(242, 239, 233, 0.55); }
.hero__sound svg { width: 19px; height: 19px; }
.hero__sound .hero__sound-on { display: none; }
.hero__sound .hero__sound-off { display: block; }
.hero__sound.is-on .hero__sound-on { display: block; }
.hero__sound.is-on .hero__sound-off { display: none; }
.hero__sound.is-hidden { display: none; }

/* ------------------------------------------------------------
   IL CODICE — five sentences in an empty room.
   ------------------------------------------------------------ */
.code { text-align: center; }
.code .section__title { margin-bottom: 5rem; }

.code__credo {
  max-width: 24em;
  margin: 0 auto 13rem;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  color: var(--dim);
}

.code__list {
  list-style: none;
  counter-reset: codice;
}

.code__list li {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.55rem, 3.4vw, 2.6rem);
  line-height: 1.35;
  margin-bottom: 11rem;
}
.code__list li:last-child { margin-bottom: 0; }

.code__list li::before {
  counter-increment: codice;
  content: counter(codice, upper-roman);
  display: block;
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.42em;
  color: var(--gold-dim);
  margin-bottom: 1.6rem;
}

/* ------------------------------------------------------------
   LE LETTERE — the first page of an old book. No room, no box:
   a chapter rule, the words, one line to sign.
   ------------------------------------------------------------ */
.lettere { text-align: center; }

.lettere__rule {
  display: block;
  width: 72px;
  height: 1px;
  margin: 0 auto 4.5rem;
  background: var(--gold-dim);
}

.lettere__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  line-height: 1.1;
  margin-bottom: 9rem;
}

.lettere__body p {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.55;
  margin-bottom: 3.6rem;
}

.lettere__close {
  color: var(--dim);
  max-width: 30em;
  margin-left: auto !important;
  margin-right: auto !important;
}

.lettere__form { margin-top: 9rem; }

.lettere__input {
  display: block;
  width: min(420px, 82vw);
  margin: 0 auto;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(184, 155, 94, 0.28);
  padding: 1.1rem 0.5rem;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--white);
  border-radius: 0;
  transition: border-color 1.2s ease;
}
.lettere__input::placeholder {
  font-style: italic;
  color: var(--faint);
}
.lettere__input:focus {
  outline: none;
  border-color: var(--gold);
}

.lettere__submit {
  display: inline-block;
  margin-top: 4rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--white);
  background: none;
  border: 1px solid var(--gold-dim);
  padding: 1.35rem 3.6rem;
  cursor: pointer;
  transition: background-color 1.1s var(--slow), color 1.1s var(--slow), border-color 1.1s var(--slow);
}
.lettere__submit:hover {
  background-color: var(--gold);
  border-color: var(--gold);
  color: var(--black);
}

.lettere__note {
  margin-top: 2.6rem;
  font-size: 0.64rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
  opacity: 0.7;
  transition: color 0.8s ease, opacity 0.8s ease;
}
.lettere__note.is-warn { color: var(--gold); opacity: 1; }

/* the trap nobody should see */
.lettere__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lettere__form { transition: opacity 1.4s ease; }
.lettere__form.is-gone { opacity: 0; pointer-events: none; }

.lettere__done {
  margin-top: 9rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.7;
  color: var(--gold);
  opacity: 0;
  transition: opacity 2.2s var(--slow);
}
.lettere__done.is-in { opacity: 1; }

/* ------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------ */
.footer {
  text-align: center;
  padding: 26vh 8vw 12vh;
}

.footer__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  letter-spacing: 0.34em;
  margin-right: -0.34em;
}

.footer__line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--faint);
  margin-top: 2.2rem;
}

.footer__legal {
  margin-top: 5rem;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  justify-content: center;
  gap: 1.4rem;
}
.footer__legal a {
  color: var(--faint);
  text-decoration: none;
  transition: color 0.8s ease;
}
.footer__legal a:hover { color: var(--gold); }

/* ------------------------------------------------------------
   Legal pages (privacy.html / termini.html)
   ------------------------------------------------------------ */
.legal {
  max-width: 680px;
  margin: 0 auto;
  padding: 22vh 7vw 16vh;
}
.legal h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 4.5rem;
}
.legal h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.45rem;
  margin: 3.4rem 0 1.1rem;
}
.legal p {
  font-size: 0.86rem;
  line-height: 1.85;
  color: var(--dim);
  margin-bottom: 1.2rem;
}
.legal .back {
  display: inline-block;
  margin-bottom: 6rem;
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-dim);
  text-decoration: none;
  transition: color 0.8s ease;
}
.legal .back:hover { color: var(--gold); }

/* ------------------------------------------------------------
   Smaller rooms
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  .hero__name { font-size: 2.05rem; letter-spacing: 0.22em; margin-right: -0.22em; }
  .hero-wrap { height: 165vh; }
  .section { padding: 26vh 7vw; }
  .section__title { margin-bottom: 6rem; }
  .code .section__title { margin-bottom: 3.5rem; }
  .code__credo { margin-bottom: 8rem; }
  .code__list li { margin-bottom: 7rem; }
  .br-desk { display: none; }
  .lettere__submit { padding: 1.2rem 2.2rem; letter-spacing: 0.26em; }
  .footer__legal { flex-direction: row; }
}
