:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #8b8680;
  --line: rgba(17, 17, 17, 0.12);
  --tint: #f3f1ee;
  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --logo: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --pad: clamp(16px, 3.2vw, 48px);
  --header-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: #fff; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: .6; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Etichette piccole in maiuscolo */
.card h2, .team h2, .contact-info h3, .site-footer h3, .legal h2, .p-head dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  background: var(--bg);
  transition: background-color .35s ease, color .35s ease;
}
.logo { display: block; flex: none; line-height: 0; }
.logo:hover { opacity: 1; }
.logo-svg { display: block; width: clamp(150px, 13vw, 200px); height: auto; overflow: visible; }
.site-nav { display: flex; align-items: center; gap: clamp(28px, 5vw, 96px); font-size: 15px; margin-left: auto; }
.h-right { display: flex; align-items: center; gap: 14px; margin-left: clamp(24px, 3vw, 48px); }
.ig { display: flex; padding: 6px; margin-right: -6px; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.site-nav .lang { font-size: 12px; font-weight: 500; letter-spacing: .08em; margin-left: clamp(0px, 2vw, 40px); }
.menu-toggle { display: none; }

/* Header trasparente sopra l'immagine di copertina */
.has-hero:not(.scrolled) .site-header { background: transparent; color: #fff; }
/* Home: header trasparente sopra il video (fondo bianco) */
.is-home .site-header { background: transparent; }

main { padding-top: var(--header-h); }
.is-home main, .has-hero main { padding-top: 0; }

/* ---------- Home ---------- */
.is-home { overflow: hidden; }
.home-hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: #fff url(/img/home-poster.jpg) center / cover no-repeat; }
.home-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Schermi in verticale (smartphone): video e poster verticali a tutto schermo */
@media (orientation: portrait) { .home-hero { background-image: url(/img/home-poster-mobile.jpg); } }

/* ---------- Progetti: griglia sfalsata ---------- */
.projects { padding: var(--header-h) var(--pad) 140px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 30px 0 48px; }
.filters button {
  font: inherit; font-size: 14px; color: var(--muted);
  background: none; border: 0; padding: 0; cursor: pointer;
}
.filters button.on, .filters button:hover { color: var(--ink); }
.filters button.on { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

.stagger { display: flex; justify-content: space-between; align-items: flex-start; gap: clamp(16px, 2.5vw, 40px); max-width: 1500px; margin: 0 auto; }
.col { width: 50%; display: flex; flex-direction: column; gap: clamp(32px, 4vw, 64px); }
.col-r { padding-top: clamp(60px, 9vw, 150px); }

.card { display: block; }
.card:hover { opacity: 1; }
.card figure { margin: 0 0 16px; overflow: hidden; background: var(--tint); }
.card figure { aspect-ratio: var(--ar, 4 / 5); }
.card img, .card .ph { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s cubic-bezier(.2,.7,.2,1); }
.card:hover img { transform: scale(1.03); }
.card-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.card h2 { font-size: 12px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
/* larghezze diverse per un ritmo irregolare */
.col-l .card.v0 { width: 100%; }
.col-l .card.v1 { width: 82%; margin-left: auto; }
.col-l .card.v2 { width: 90%; }
.col-r .card.v0 { width: 86%; }
.col-r .card.v1 { width: 100%; }
.col-r .card.v2 { width: 80%; margin-left: auto; }
.card.hide { display: none; }

/* ---------- Singolo progetto ---------- */
.p-hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: #2b2722; color: #fff; }
.p-hero > img, .p-hero > video { width: 100%; height: 100%; object-fit: cover; }
.p-hero::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 180px; background: linear-gradient(rgba(0,0,0,.35), transparent); pointer-events: none; z-index: 1; }
.p-hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, rgba(0,0,0,.5)); pointer-events: none; }
.p-hero-title { position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(28px, 5vw, 64px); z-index: 2; }
.p-hero-title h1, .p-head h1 {
  font-size: clamp(40px, 7.4vw, 124px);
  font-weight: 600;
  font-stretch: 108%;
  line-height: .92;
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.p-head h1 { font-size: clamp(32px, 5vw, 72px); margin-bottom: 24px; }
.p-sub { font-size: clamp(16px, 1.5vw, 22px); font-weight: 300; margin: 14px 0 0; }
.p-head .p-sub { margin: -10px 0 28px; }

/* Copertina verticale: titolo a sinistra, foto intera a destra (nessun taglio) */
.p-hero--port {
  height: auto; background: var(--bg); color: var(--ink);
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: clamp(24px, 4vw, 64px);
  padding: calc(var(--header-h) + 8px) var(--pad) 0;
}
.p-hero--port::before, .p-hero--port::after { display: none; }
.p-hero--port > img, .p-hero--port > video {
  grid-column: 2; grid-row: 1; width: auto; height: calc(100svh - var(--header-h) - 8px);
  max-width: 62vw; object-fit: contain;
}
.p-hero--port .p-hero-title { position: static; grid-column: 1; grid-row: 1; padding-bottom: 8px; }
.has-hero-port main { padding-top: 0; }

.p-intro {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 32px;
  padding: clamp(56px, 8vw, 128px) var(--pad);
}
.p-head { grid-column: 1 / span 4; }
.p-head dl { margin: 0; font-size: 14px; }
.p-head dl div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.p-head dl div:last-child { border-bottom: 1px solid var(--line); }
.p-head dt { color: var(--muted); padding-top: 2px; }
.p-head dd { margin: 0; }
.p-text { grid-column: 6 / span 7; font-size: clamp(18px, 1.55vw, 23px); font-weight: 300; line-height: 1.42; letter-spacing: -.01em; }
.p-text p { margin-bottom: .9em; }

.p-gallery { width: min(100% - 2 * var(--pad), 1100px, 125vh); margin: 0 auto; display: flex; flex-direction: column; gap: clamp(16px, 2vw, 28px); }
.g-row { display: flex; gap: clamp(16px, 2vw, 28px); }
.g-row figure { margin: 0; min-width: 0; overflow: hidden; background: var(--tint); }
.g-row img, .g-row video { display: block; width: 100%; height: 100%; object-fit: cover; }
.g-alone { justify-content: center; }
.g-alone figure { flex: 0 0 calc(50% - clamp(8px, 1vw, 14px)) !important; }

.p-next {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  padding: clamp(80px, 11vw, 180px) var(--pad) 40px;
}
.p-next .all { font-size: 14px; color: var(--muted); }
.p-next .nx { text-align: right; font-weight: 600; font-stretch: 108%; font-size: clamp(28px, 4.4vw, 72px); text-transform: uppercase; letter-spacing: -.025em; line-height: .95; }
.p-next .nx span { display: block; font-weight: 400; font-stretch: 100%; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); margin-bottom: 12px; }

/* ---------- Studio ---------- */
.studio { padding: calc(var(--header-h) + clamp(32px, 7vw, 112px)) var(--pad) 80px; }
.statement { max-width: 1120px; margin-left: 33.33%; font-size: clamp(22px, 2.5vw, 38px); font-weight: 300; line-height: 1.22; letter-spacing: -.015em; }
.statement p { margin-bottom: .8em; }
.studio-intro { max-width: 980px; font-size: clamp(20px, 2vw, 30px); font-weight: 300; line-height: 1.28; letter-spacing: -.012em; margin: 0 0 clamp(56px, 7vw, 112px); }
.studio-intro p { margin-bottom: .7em; }
.studio-body { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(24px, 3vw, 48px); align-items: start; }
.studio-img { grid-column: 1 / span 5; margin: 0; }
.studio-img img { width: 100%; }
.studio-text { grid-column: 7 / span 6; font-size: clamp(16px, 1.15vw, 18px); font-weight: 300; line-height: 1.55; }
.studio-body.no-img .studio-text { grid-column: 1 / span 8; }
.studio-text p { margin-bottom: 1em; }
.team { margin: clamp(40px, 5vw, 72px) 0 0; }
.team h2 { margin-bottom: 18px; }
.team ul { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.team li { display: flex; justify-content: space-between; gap: 24px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 17px; font-weight: 300; }
.team li:last-child { border-bottom: 1px solid var(--line); }
.team li strong { font-weight: 400; }
.team li span { color: var(--muted); font-size: 14px; }

/* ---------- Contatti ---------- */
.contact { padding: calc(var(--header-h) + clamp(32px, 7vw, 112px)) var(--pad) 80px; }
.statement-sm { font-size: clamp(30px, 4.4vw, 68px); font-weight: 300; line-height: 1.04; letter-spacing: -.03em; max-width: 13em; margin-left: 33.33%; }
.contact-cols { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; margin-top: clamp(56px, 8vw, 110px); }
.contact-info h3, .site-footer h3 { margin: 0 0 10px; color: var(--muted); }
.contact-info h3:not(:first-child) { margin-top: 32px; }
.contact-info a, .contact-info p { display: block; font-size: 18px; margin: 0 0 2px; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px; max-width: 900px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.contact-form label.full, .contact-form .check, .contact-form .cf-turnstile, .contact-form button, .form-status { grid-column: 1 / -1; }
.contact-form input, .contact-form textarea {
  font: inherit; font-size: 18px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 8px 0; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-bottom-color: var(--ink); }
.contact-form .check { flex-direction: row; align-items: flex-start; gap: 12px; font-size: 13px; line-height: 1.45; }
.contact-form .check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.contact-form .check a { text-decoration: underline; }
.contact-form button {
  justify-self: start; font: inherit; font-size: 14px; font-weight: 500; letter-spacing: .04em;
  background: var(--ink); color: #fff; border: 0; border-radius: 99px; padding: 14px 28px; cursor: pointer;
}
.contact-form button:hover { opacity: .8; }
.contact-form button[disabled] { opacity: .4; cursor: wait; }
.form-status { margin: 0; font-size: 16px; min-height: 1.5em; }
.hp { position: absolute !important; left: -9999px; }

/* ---------- Pagine testuali ---------- */
.legal { padding: calc(var(--header-h) + clamp(32px, 7vw, 112px)) var(--pad) 80px; max-width: 860px; margin-left: 33.33%; }
.legal h1 { font-size: clamp(30px, 4vw, 56px); font-weight: 300; letter-spacing: -.03em; margin-bottom: 32px; }
.legal h2 { margin: 36px 0 10px; }
.legal a { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { padding: clamp(96px, 11vw, 180px) var(--pad) 32px; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.footer-cols a, .footer-cols p { display: block; font-size: 14px; margin: 0 0 2px; }
.contact-info a:hover, .footer-cols a:hover { opacity: .6; }
.footer-logo { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: clamp(56px, 8vw, 120px); }
.footer-logo .logo-svg { width: clamp(240px, 34vw, 520px); }
.footer-credits { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; font-size: 12px; color: var(--muted); text-align: right; }
.footer-credits a { color: var(--muted); }
.footer-credits a:hover { color: var(--ink); opacity: 1; }

/* ---------- Animazione di comparsa ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
  .reveal.in { opacity: 1; transform: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .p-head { grid-column: 1 / -1; }
  .p-text { grid-column: 1 / -1; }
  .statement, .statement-sm, .legal { margin-left: 0; }
  .studio-img { grid-column: 1 / span 6; }
  .studio-text { grid-column: 7 / span 6; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .menu-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 7px;
    width: 40px; height: 40px; margin-right: -8px; padding: 8px;
    background: none; border: 0; color: inherit; cursor: pointer;
  }
  .menu-toggle span:not(.sr) { display: block; height: 1.5px; background: currentColor; transition: transform .3s ease; }
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(4.25px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }
  .site-nav {
    position: fixed; inset: 0; z-index: 55;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px;
    padding: 0 var(--pad);
    background: var(--bg); color: var(--ink);
    font-size: 44px; font-weight: 300; letter-spacing: -.03em; line-height: 1.1;
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s;
  }
  .site-nav a[aria-current="page"] { text-decoration-thickness: 2px; text-underline-offset: 8px; }
  .menu-open .site-nav { opacity: 1; visibility: visible; }
  .menu-open .site-header { color: var(--ink) !important; }
  .logo, .h-right { position: relative; z-index: 60; }
  .logo-svg { width: 150px; }
  .h-right { gap: 6px; }
  .footer-logo { flex-direction: column; align-items: flex-start; }
  .footer-logo .logo-svg { width: 72%; }
  .footer-credits { align-items: flex-start; text-align: left; }
  .site-nav .lang { margin: 24px 0 0; font-size: 14px; letter-spacing: .08em; }
  .menu-open { overflow: hidden; }

  .filters { padding: 18px 0 30px; }
  .stagger { flex-direction: column; gap: 52px; }
  .col { display: contents; }
  .col-r { padding-top: 0; }
  .card { width: 100% !important; margin-left: 0 !important; }
  .card-cap { flex-direction: column; gap: 4px; }
  .card p { text-align: left; }
  /* smartphone: copertina intera, senza tagli */
  .p-hero { height: auto; }
  .p-hero > img, .p-hero > video { height: auto; }
  .p-hero--port { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 20px; padding: var(--header-h) 0 0; }
  .p-hero--port > img, .p-hero--port > video { width: 100%; height: auto; max-width: none; }
  .p-hero--port .p-hero-title { padding: 0 var(--pad); }
  .p-head dl div { grid-template-columns: 90px 1fr; }
  .g-row { flex-direction: column; }
  .g-row figure, .g-alone figure { flex: none !important; width: 100%; }
  .p-next { flex-direction: column-reverse; align-items: flex-start; }
  .p-next .nx { text-align: left; }
  .studio-body { grid-template-columns: 1fr; }
  .studio-img, .studio-text, .studio-body.no-img .studio-text { grid-column: 1 / -1; }
  .contact-cols { grid-template-columns: 1fr; }
  .contact-form { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 28px 16px; }
}
