/* Reproject — studio, cantiere, palazzo
   Layout: film a tutto schermo in loop; logo e contatti in basso dopo un istante. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --night: #1A1410;       /* ombra calda del tramonto */
  --light: #F4ECDF;       /* luce calda dell'insegna */
  --muted: rgba(244, 236, 223, .62);
  --hair: rgba(244, 236, 223, .28);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --side-l: max(20px, env(safe-area-inset-left, 0px));
  --side-r: max(20px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100dvh;
  background: var(--night);
  color: var(--light);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── film ──────────────────────────────────────────────────── */
.film { position: fixed; inset: 0; overflow: hidden; background: var(--night); }
.film video, .film .still {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 45%;
}
.film .still { opacity: 0; transition: opacity 1.2s ease; }
.film video { transition: opacity 1.2s ease; }
.static .film .still { opacity: 1; }
.static .film video { opacity: 0; }

.scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgba(14, 10, 8, .88) 0%, rgba(14, 10, 8, .5) 24%, rgba(14, 10, 8, 0) 50%),
    radial-gradient(130% 100% at 50% 45%, transparent 55%, rgba(14, 10, 8, .5) 100%);
}

/* ── contenuti ─────────────────────────────────────────────── */
.content {
  position: relative;
  align-self: end;
  display: grid; justify-items: center; gap: 22px;
  padding: 24px var(--side-r) 18px var(--side-l);
  text-align: center;
}
.wordmark-wrap { width: min(52vw, 260px); }
.wordmark { display: block; width: 100%; height: auto; color: var(--light); }
.contact { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }

.mail {
  color: var(--light); text-decoration: none;
  font-size: clamp(17px, 1.45vw, 20px); letter-spacing: .02em;
  padding-top: 6px;
  background-image: linear-gradient(var(--light), var(--light));
  background-size: 0% 1px; background-repeat: no-repeat; background-position: 50% 100%;
  padding-bottom: 4px; transition: background-size .6s var(--ease-out);
}
.mail:hover, .mail:active { background-size: 100% 1px; }
.mail:focus-visible { outline: 1px solid var(--light); outline-offset: 4px; }

.foot address { font-style: normal; }
.foot {
  position: relative;
  display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px var(--side-r) max(16px, env(safe-area-inset-bottom, 0px)) var(--side-l);
  font-size: 11.5px; letter-spacing: .02em; color: var(--muted);
}

/* comparsa: i testi arrivano quando l'insegna si accende */
/* nascosti solo se lo script è attivo (classe "js" su <html>): senza script restano visibili */
.js .wordmark-wrap, .js .contact, .js .foot { opacity: 0; transform: translateY(12px); }
.reveal .wordmark-wrap { animation: rise 1.8s var(--ease-out) forwards; }
.reveal .contact       { animation: rise 1.6s var(--ease-out) .5s forwards; }
.reveal .foot          { animation: rise 1.6s var(--ease-out) 1s forwards; }

@keyframes rise    { to { opacity: 1; transform: none; } }

/* telefono in verticale: il film si vede intero, a tutta larghezza,
   (riquadro 4:3, al massimo 1/8 tagliato per lato) sopra una copia sfocata */
.film .bgs { display: none; }
@media (max-aspect-ratio: 6/5) {
  /* sfondo: immagini già sfocate (una per scena), niente secondo video né filtri in tempo reale */
  .film .bgs { display: block; position: absolute; inset: -4%; }
  .film .bgs img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0; transition: opacity .6s ease;
  }
  .film .bgs img.on { opacity: 1; }
  .film #film, .film .still {
    inset: auto 0 auto 0; top: calc(36% - 37.5vw);
    height: auto; aspect-ratio: 4 / 3;
    object-fit: cover; object-position: 50% 50%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  }
}

@media (max-width: 700px) {
  .foot { justify-content: center; text-align: center; }
  .content { gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .wordmark-wrap, .contact, .foot { opacity: 1 !important; transform: none !important; animation: none !important; }
  .film video { display: none !important; }
  .film .still { opacity: 1 !important; }
}
