:root {
  color-scheme: dark;
  --bg: #000;
  --ink: #ecebe6;
  --muted: #8a8a84;
  --slot: #161616;
  --pad: clamp(16px, 2.2vw, 32px);
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Barra in alto e piè di pagina */
.top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
footer a:nth-child(2) { justify-self: center; }
footer a:last-child { justify-self: end; }
.top a:hover, footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* HOME: video 16:9 cliccabile, abbastanza piccolo da stare in una schermata col nome */
main {
  width: min(100%, max(520px, calc((100svh - 230px) * 16 / 9)));
  margin-inline: auto;
}
.slot {
  position: relative;
  display: block;
  margin-top: clamp(20px, 3vw, 40px);
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--slot);
  overflow: hidden;
  cursor: pointer;
}
.slot video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.slot .placeholder {
  position: absolute; inset: 0;
  display: grid; place-content: center;
  gap: 0.35rem;
  text-align: center;
  color: var(--muted);
}
.slot .placeholder em { font-size: 12px; font-style: normal; }

.wordmark {
  margin-top: auto;
  padding-top: clamp(16px, 3vw, 40px);
  font-size: clamp(28px, 5vw, 72px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.9;
  text-transform: uppercase;
}

/* PAGINA LAVORI: griglia di copertine con titolo sotto */
.works { width: 100%; flex: 1; margin-top: clamp(24px, 4vw, 56px); margin-bottom: clamp(32px, 5vw, 72px); }
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 20px;
}
.tile .img {
  aspect-ratio: 4 / 5;
  background: var(--slot);
  overflow: hidden;
}
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .2s ease; }
.tile:hover img { opacity: 0.85; }
.tile span { display: block; margin-top: 8px; font-size: 12px; }

/* PAGINA PROGETTO: una foto alla volta, si scorre con le frecce */
.project-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  margin-top: clamp(24px, 4vw, 56px);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.project-head a { justify-self: end; }
.project-head a:hover { text-decoration: underline; text-underline-offset: 3px; }
.project {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 56px;
  margin: clamp(16px, 2.5vw, 32px) 0;
}
.project img {
  display: block;
  max-width: 100%;
  max-height: calc(100svh - 210px);
  min-height: 0;
  width: auto;
  height: auto;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.project .empty { color: var(--muted); }
.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 12px;
  background: none;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.nav:hover { opacity: 1; }
.nav.prev { left: 0; }
.nav.next { right: 0; }
@media (hover: none) {
  .nav { display: none; }
  .project { padding-inline: 0; }
}

@media (max-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) {
  main { width: 100%; }
  .slot { aspect-ratio: 4 / 5; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  footer { grid-template-columns: 1fr 1fr; }
  footer a:nth-child(2) { justify-self: end; }
  footer a:last-child { grid-column: 1 / -1; justify-self: start; }
}

/* CTA a pillola */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.pill:hover, .pill:focus-visible { background: var(--ink); color: var(--bg); text-decoration: none; }
.top { align-items: center; }
.top a.pill:hover { text-decoration: none; }
.cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: clamp(8px, 2vw, 24px) 0 clamp(24px, 4vw, 56px);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* PAGINA CONTATTI */
.contact { width: min(100%, 560px); margin: clamp(32px, 6vw, 80px) auto; flex: 1; }
.contact h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 44px); font-weight: 400; letter-spacing: -0.02em; }
.contact .lead { margin: 0 0 32px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.contact label { display: block; margin-top: 20px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.contact input, .contact select, .contact textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid #3a3a37;
  border-radius: 0;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
}
.contact textarea { min-height: 120px; resize: vertical; }
.contact select option { background: #000; color: var(--ink); }
.contact input:focus, .contact select:focus, .contact textarea:focus { outline: none; border-bottom-color: var(--ink); }
.contact .consent { display: flex; gap: 10px; align-items: flex-start; text-transform: none; letter-spacing: 0; font-size: 12px; line-height: 1.4; }
.contact .consent input { width: auto; margin: 2px 0 0; accent-color: #ecebe6; }
.contact .pill { margin-top: 28px; padding: 12px 22px; }
.contact .pill[disabled] { opacity: .5; cursor: default; }
.contact .hp { position: absolute; left: -9999px; }
.contact .status { margin-top: 20px; font-size: 14px; }
.contact .alt { margin-top: 36px; font-size: 12px; color: var(--muted); }
.contact .alt a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Gruppo di link in alto a destra */
.top-r { display: inline-flex; align-items: center; gap: 20px; }
.top-r a:not(.pill):hover { text-decoration: underline; text-underline-offset: 3px; }

/* PAGINA INFO */
.about {
  width: min(100%, 1100px);
  margin: clamp(32px, 6vw, 80px) auto;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
}
.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--slot);
  overflow: hidden;
}
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait .ph {
  position: absolute; inset: 0;
  display: grid; place-content: center; gap: .35rem;
  text-align: center; padding: 16px;
  color: var(--muted); font-size: 12px;
}
.about-text h1 { margin: 0 0 20px; font-size: clamp(28px, 4vw, 48px); font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; }
.about-text p { margin: 0 0 20px; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.55; max-width: 34em; }
.about-text .likes { color: var(--ink); }
.about-text .lead { color: var(--muted); }
.about-text .pill { margin-top: 12px; padding: 12px 22px; }
@media (max-width: 700px) {
  .about { grid-template-columns: 1fr; }
  .portrait { max-width: 420px; }
}
