/* Jost, ospitato in locale (nessuna richiesta a Google) */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 200 600; font-display: swap;
  src: url("../fonts/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; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 200 600; font-display: swap;
  src: url("../fonts/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; }

/* Token: nero cinema per i film, grigio limbo (il fondale dello studio) per le parti editoriali */
:root {
  --cinema: #000000;
  --limbo: #d9d6d0;
  --ink: #1c1b19;
  --ink-soft: #66625b;
  --paper: #f3f1ed;
  --paper-soft: #a29e96;
  --gutter: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --slow: 900ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-snap-type: y proximity; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cinema);
  color: var(--paper);
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

/* Link testuale: sottolineatura sottile che si disegna all'hover */
.link {
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: background-size 500ms var(--ease);
  padding-bottom: 2px;
}
.link:hover, .link:focus-visible { background-size: 100% 1px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 22px var(--gutter);
  color: #fff;
  mix-blend-mode: difference;
  opacity: 0; pointer-events: none;
  transition: opacity var(--slow) var(--ease);
}
.site-header.visible { opacity: 1; pointer-events: auto; }
.wordmark { font-weight: 400; letter-spacing: .32em; font-size: 13px; text-transform: uppercase; }
.nav { display: flex; gap: clamp(18px, 2.6vw, 40px); font-size: 14px; font-weight: 400; }
.menu-toggle { display: none; font-size: 14px; font-weight: 400; }

/* ---------- Ingresso ---------- */
.entry {
  position: relative; height: 100svh; min-height: 520px;
  display: grid; place-items: center; text-align: center;
  overflow: hidden; scroll-snap-align: start;
}
.film-bg { position: absolute; inset: 0; overflow: hidden; background: var(--cinema); }
.film-bg img, .film-bg iframe {
  position: absolute; top: 50%; left: 50%;
  /* --ar = rapporto dell'immagine utile: molti master hanno le bande nere incise, così le tagliamo */
  width: max(100%, calc(var(--ar, 1.7778) * 100svh)); height: auto; aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  border: 0; pointer-events: none;
}
.film-bg img { max-width: none; }
.film-bg iframe { opacity: 0; transition: opacity 1200ms var(--ease); }
.film-bg iframe.ready { opacity: 1; }
.film-bg::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.38); }

.entry-inner { position: relative; z-index: 1; padding: 0 var(--gutter); }
.entry-mark {
  margin: 0;
  font-weight: 300; text-transform: uppercase;
  font-size: clamp(30px, 6.4vw, 92px);
  letter-spacing: .42em; margin-right: -.42em; /* compensa il tracking dell'ultima lettera */
  line-height: 1;
}
.entry-company { display: block; margin-top: 18px; font-size: 13px; letter-spacing: .32em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-right: -.32em; }
.entry-line { margin: clamp(40px, 7vh, 72px) 0 0; font-size: clamp(22px, 2.4vw, 32px); font-weight: 300; line-height: 1.2; color: #fff; }
.entry-where { margin: 6px 0 0; font-size: 14px; color: rgba(255,255,255,.6); }
.entry-cta {
  position: absolute; left: 50%; bottom: max(36px, 6vh); transform: translateX(-50%);
  z-index: 1; font-size: 15px; font-weight: 400; letter-spacing: .32em; text-transform: uppercase; margin-right: -.32em;
}

/* Sequenza di apertura: l'unico momento coreografato della pagina */
.entry .reveal { opacity: 0; transition: opacity 1400ms var(--ease); }
.entry.on .reveal { opacity: 1; }
.entry.on .reveal:nth-child(2) { transition-delay: 500ms; }
.entry.on .reveal:nth-child(3) { transition-delay: 800ms; }
.entry.on .entry-cta { transition-delay: 1300ms; }

/* ---------- Lavori a tutto schermo ---------- */
.work {
  position: relative; height: 100svh; min-height: 480px;
  overflow: hidden; scroll-snap-align: start; cursor: pointer;
}
.work .film-bg::after { background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 38%); }
.work-caption {
  position: absolute; z-index: 1; left: var(--gutter); right: var(--gutter); bottom: clamp(24px, 5vh, 48px);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
}
.work-title { margin: 0; font-size: clamp(22px, 2.6vw, 36px); font-weight: 300; line-height: 1.15; }
.work-meta { margin: 8px 0 0; font-size: 14px; color: rgba(255,255,255,.66); }
.work-meta span + span::before { content: ""; display: inline-block; width: 18px; height: 1px; background: currentColor; vertical-align: middle; margin: 0 10px; opacity: .6; }
.work-side { text-align: right; font-size: 14px; font-weight: 400; white-space: nowrap; }
.work-count { display: block; margin-top: 8px; color: rgba(255,255,255,.55); font-weight: 300; font-variant-numeric: tabular-nums; }

/* ---------- Sezioni editoriali (limbo) ---------- */
.limbo { background: var(--limbo); color: var(--ink); }
.section { padding: clamp(96px, 16vh, 180px) var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.section-name { grid-column: 1 / 4; margin: 0; font-size: 15px; font-weight: 400; }
.lead {
  grid-column: 4 / 12; margin: 0;
  font-size: clamp(26px, 3.3vw, 48px); line-height: 1.18; font-weight: 300; letter-spacing: -.005em;
  max-width: 22em;
}
.body { grid-column: 7 / 12; margin: clamp(48px, 7vh, 80px) 0 0; color: var(--ink-soft); max-width: 34em; }
.limbo .section + .section { padding-top: 0; }

/* Automotive */
.year {
  grid-column: 1 / 7; margin: 0;
  font-size: clamp(110px, 21vw, 330px); font-weight: 200; line-height: .8; letter-spacing: -.04em;
}
.year-text { grid-column: 7 / 12; align-self: end; margin: 0; font-size: clamp(19px, 1.7vw, 23px); line-height: 1.45; max-width: 24em; }
.services {
  grid-column: 4 / 12; list-style: none; margin: clamp(80px, 13vh, 140px) 0 0; padding: 0;
  font-size: clamp(24px, 3vw, 42px); line-height: 1.32; font-weight: 300;
}
.services li { color: var(--ink); }
.services li:nth-child(even) { color: var(--ink-soft); }
.also { grid-column: 4 / 12; margin: clamp(48px, 7vh, 72px) 0 0; color: var(--ink-soft); }

/* Metodo */
.method { grid-column: 4 / 12; margin: clamp(64px, 10vh, 112px) 0 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gutter); row-gap: 40px; }
.method div { border-top: 1px solid rgba(28,27,25,.22); padding-top: 18px; }
.method dt { font-weight: 400; }
.method dd { margin: 6px 0 0; color: var(--ink-soft); max-width: 26em; }

/* ---------- Olimpia Studio ---------- */
.studio { position: relative; scroll-snap-align: start; }
.studio-image { height: 100svh; min-height: 480px; position: relative; overflow: hidden; }
.studio-image img { width: 100%; height: 100%; object-fit: cover; }
.studio-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0) 45%); }
.studio-title {
  position: absolute; z-index: 1; left: var(--gutter); bottom: clamp(24px, 5vh, 48px); margin: 0;
  font-size: clamp(44px, 8vw, 120px); font-weight: 200; line-height: .95; letter-spacing: -.02em;
}
.studio-text { padding: clamp(80px, 13vh, 150px) var(--gutter); }
.studio-text .lead { color: var(--paper); }
.studio-text .body { color: var(--paper-soft); }
.uses { grid-column: 7 / 12; list-style: none; margin: 40px 0 0; padding: 0; color: var(--paper); }
.uses li { padding: 12px 0; border-top: 1px solid rgba(243,241,237,.16); }

/* ---------- Manifesto e contatti ---------- */
.manifesto {
  margin: 0; padding: clamp(110px, 20vh, 220px) var(--gutter) clamp(80px, 12vh, 140px);
  font-size: clamp(40px, 7.6vw, 124px); font-weight: 200; line-height: 1; letter-spacing: -.025em;
  max-width: 12em;
}
.contact { padding-top: 0; }
.mail { grid-column: 1 / 13; font-size: clamp(20px, 2.2vw, 30px); font-weight: 300; justify-self: start; overflow-wrap: anywhere; }
.contact-cols { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: clamp(56px, 9vh, 96px); }
.contact-cols h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.contact-cols p { margin: 0; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 28px var(--gutter); font-size: 13px; color: var(--ink-soft); border-top: 1px solid rgba(28,27,25,.18); }


/* ---------- Social ---------- */
.social { display: flex; gap: 16px; align-items: center; }
.social-icon { display: block; width: 22px; height: 22px; opacity: .7; transition: opacity 300ms var(--ease); }
.social-icon:hover, .social-icon:focus-visible { opacity: 1; }
.social-icon svg { display: block; width: 100%; height: 100%; }
.nav-social { display: none; }
.footer-end { display: flex; gap: 28px; align-items: center; }
.footer .social-icon { width: 18px; height: 18px; }

/* ---------- Pellicola: si srotola con lo scorrimento (--p) e avanza con la pagina ---------- */
.reel { grid-column: 12 / 13; grid-row: 1 / span 12; justify-self: end; width: 64px; position: relative; }
.reel-inner {
  position: sticky; top: 16vh; height: min(68vh, 100%);
  clip-path: inset(0 0 calc((1 - var(--p, 0)) * 100%) 0);
  opacity: .42;
}
.reel svg { display: block; width: 64px; height: calc(100% - 26px); }
.reel-tc {
  position: absolute; right: 0; bottom: 0; white-space: nowrap;
  font-size: 11px; font-weight: 500; letter-spacing: .04em; text-align: right;
  font-variant-numeric: tabular-nums;
}
.studio-text .reel { color: var(--paper); }

/* ---------- Player ---------- */
.player {
  position: fixed; inset: 0; z-index: 50; background: #000;
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transition: opacity 600ms var(--ease), visibility 0s linear 600ms;
}
.player.open { opacity: 1; visibility: visible; transition: opacity 600ms var(--ease); }
.player-frame { width: min(100vw, 177.78svh); aspect-ratio: 16 / 9; }
.player-frame iframe { width: 100%; height: 100%; border: 0; }
.player-bar { position: absolute; inset: 0 0 auto 0; display: flex; justify-content: space-between; align-items: baseline; padding: 22px var(--gutter); font-size: 14px; }
.player-bar span { color: var(--paper-soft); }
.player-close { font-weight: 400; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .nav {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 18px;
    padding: 0 var(--gutter); font-size: 34px; font-weight: 300;
    background: #fff; color: #000; mix-blend-mode: normal;
    opacity: 0; visibility: hidden; transition: opacity 500ms var(--ease), visibility 0s linear 500ms;
  }
  .site-header.menu-open { mix-blend-mode: normal; color: #000; }
  .site-header.menu-open .nav { opacity: 1; visibility: visible; transition: opacity 500ms var(--ease); }
  .menu-toggle { display: block; position: relative; z-index: 1; }
  .wordmark { position: relative; z-index: 1; }

  .section-name, .lead, .body, .year, .year-text, .services, .also, .method, .uses, .mail, .contact-cols { grid-column: 1 / -1; }
  .section-name { margin-bottom: 28px; }
  .body { margin-top: 32px; }
  .year-text { margin-top: 28px; }
  .method { grid-template-columns: 1fr; row-gap: 28px; }
  .contact-cols { grid-template-columns: 1fr; row-gap: 28px; }
  .work-caption { flex-direction: column; align-items: flex-start; }
  .work-side { text-align: left; display: flex; gap: 20px; align-items: baseline; }
  .work-count { margin: 0; }
  .entry-mark { letter-spacing: .28em; margin-right: -.28em; }
  .nav-social { display: flex; margin-top: 32px; }
  .nav-social .social-icon { width: 26px; height: 26px; }
  .reel { grid-column: 1 / -1; grid-row: auto; justify-self: stretch; width: auto; margin-bottom: 40px; }
  .reel-inner { position: relative; top: 0; height: 64px; clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0); }
  .reel svg { width: 100%; height: 40px; }
  .reel-tc { text-align: left; }
  .footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; transition-delay: 0ms !important; }
}

/* Dati legali nel footer */
.legal { display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* ---------- Pagine di servizio (privacy, 404) ---------- */
.doc-header { position: static; opacity: 1; pointer-events: auto; mix-blend-mode: normal; color: var(--ink); }
.doc { padding: clamp(64px, 12vh, 140px) var(--gutter) clamp(80px, 12vh, 140px); }
.doc h1 { grid-column: 4 / 12; margin: 0 0 clamp(40px, 7vh, 72px); font-size: clamp(34px, 5vw, 72px); font-weight: 200; line-height: 1.05; letter-spacing: -.02em; }
.doc-body { grid-column: 4 / 11; max-width: 40em; }
.doc-body h2 { margin: 48px 0 10px; font-size: 18px; font-weight: 600; }
.doc-body p, .doc-body li { color: var(--ink-soft); }
.doc-body a { color: var(--ink); }
.doc-body ul { padding-left: 1.1em; }
@media (max-width: 860px) {
  .doc h1, .doc-body { grid-column: 1 / -1; }
}

/* Barra di amministrazione di WordPress (visibile solo a chi ha fatto l'accesso) */
.admin-bar .site-header:not(.doc-header) { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header:not(.doc-header) { top: 46px; } }
