/* Caratteri ospitati nel sito (niente richieste a Google: più veloce e conforme GDPR) */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/poppins-300.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Urbanist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/urbanist-variable.woff2") format("woff2"); }

/* Layout: full-bleed photographs, a quiet text column, justified rows that keep every frame's own ratio */
:root {
  --paper: #f3f3f1;
  --paper-2: #e8e8e4;
  --ink: #1c1e1f;
  --mute: #686d6f;
  --line: #d8d8d3;
  --accent: #4d6d7a;
  --over: #ffffff;
  --night: #0b0c0d;

  --f-display: "Urbanist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --t-xs: 0.72rem;
  --t-s: 0.875rem;
  --t-m: 1rem;
  --t-l: clamp(1.35rem, 2.4vw, 1.75rem);
  --t-xl: clamp(1.7rem, 3.4vw, 2.75rem);
  --t-xxl: clamp(3rem, 10vw, 8.5rem);

  --gut-l: max(clamp(16px, 4vw, 56px), env(safe-area-inset-left, 0px));
  --gut-r: max(clamp(16px, 4vw, 56px), env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(.2, .6, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111213; --paper-2: #1a1c1d; --ink: #e9e9e5; --mute: #9da1a2; --line: #2a2d2f; --accent: #9dbcc8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #111213; --paper-2: #1a1c1d; --ink: #e9e9e5; --mute: #9da1a2; --line: #2a2d2f; --accent: #9dbcc8;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: var(--t-m);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 300; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { padding-left: var(--gut-l); padding-right: var(--gut-r); }
.label {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--t-xs);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--mute);
}

/* Fade photos in once they have loaded */
html.js img.fade { opacity: 0; transition: opacity 1s var(--ease); }
html.js img.fade.in { opacity: 1; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
  padding-left: var(--gut-l);
  padding-right: var(--gut-r);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  transition: background .5s, color .5s, border-color .5s;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 31; background: var(--paper);
}
.brand {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.brand small { font-weight: 300; letter-spacing: .34em; opacity: .7; margin-left: .5em; }
.nav { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav a {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--t-xs);
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  padding-block: 6px;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: background-size .5s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { background-size: 100% 1px; }
.nav .lang { display: flex; gap: 12px; align-items: center; padding-left: clamp(18px, 3vw, 40px); border-left: 1px solid var(--line); border-left-color: color-mix(in srgb, currentColor 35%, transparent); }
.nav .lang a { opacity: .55; background: none; }
.nav .lang a:hover, .nav .lang a[aria-current="page"] { opacity: 1; }
.menu-btn {
  display: none;
  font: 500 var(--t-xs) var(--f-display);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: inherit;
  background: none;
  border: 0;
  padding: 8px 0;
  cursor: pointer;
}

/* Home: header floats over the photograph until you scroll past it */
body.home .site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: transparent;
  color: var(--over);
}
body.home::before { background: transparent; }
body.home .site-header.solid {
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-color: var(--line);
  color: var(--ink);
}

@media (max-width: 760px) {
  .brand small { display: none; }
  .brand, .menu-btn { position: relative; z-index: 2; }
  .menu-btn { display: block; }
  /* Menu a tendina laterale: entra da destra, dietro resta la foto scurita */
  .nav {
    position: fixed;
    top: 0; right: 0;
    width: min(82vw, 340px);
    height: 100vh;
    height: 100dvh;
    z-index: 1;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding-top: calc(92px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    padding-left: 28px;
    padding-right: max(28px, env(safe-area-inset-right, 0px));
    background: var(--paper);
    color: var(--ink);
    overflow-y: auto;
    box-shadow: -24px 0 60px rgb(0 0 0 / .28);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform .5s var(--ease), visibility 0s linear .5s;
  }
  .nav > a {
    font-size: var(--t-l);
    font-weight: 300;
    letter-spacing: .02em;
    text-transform: none;
    padding-block: 14px;
    border-bottom: 1px solid var(--line);
    background: none;
    opacity: 0;
    transform: translateX(12px);
    transition: opacity .4s, transform .4s var(--ease);
  }
  .nav > a[aria-current="page"] { color: var(--accent); }
  .nav .lang { padding-left: 0; border-left: 0; margin-top: 28px; gap: 24px; }
  .nav .lang a { font-size: var(--t-s); font-weight: 500; letter-spacing: .24em; }
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgb(0 0 0 / .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s, visibility 0s linear .5s;
  }
  body.nav-open::after { opacity: 1; visibility: visible; transition: opacity .5s, visibility 0s; }
  body.nav-open .nav { transform: none; visibility: visible; transition: transform .5s var(--ease), visibility 0s; }
  body.nav-open .nav > a { opacity: 1; transform: none; transition-delay: .18s; }
  body.nav-open .menu-btn { color: var(--ink); }
  /* Niente sfocatura sulla barra mentre il menu è aperto: altrimenti la tendina resterebbe chiusa dentro la barra */
  body.nav-open .site-header,
  body.home.nav-open .site-header.solid {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  body.nav-open { overflow: hidden; }
}

/* ---------- Hero slideshow ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: var(--night);
  color: var(--over);
}
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 2.4s ease; }
.slide.on { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); }
.slide.on img { animation: drift 14s linear forwards; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.1); } }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgb(0 0 0 / .38), transparent 22%),
    linear-gradient(to top, rgb(0 0 0 / .55), transparent 48%);
}
.hero-text {
  position: absolute;
  z-index: 2;
  left: var(--gut-l);
  right: var(--gut-r);
  bottom: calc(clamp(116px, 17vh, 176px) + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 18px;
  animation: rise 1.8s var(--ease) both .3s;
}
.hero-text h1 { font-size: var(--t-xxl); font-weight: 200; line-height: .92; letter-spacing: -.015em; }
.hero-text p { font-size: clamp(1rem, 1.6vw, 1.2rem); max-width: 36ch; opacity: .92; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.hero-foot {
  position: absolute;
  z-index: 2;
  left: var(--gut-l);
  right: var(--gut-r);
  /* sopra la firma © impressa in basso a destra nelle foto */
  bottom: calc(clamp(56px, 8vh, 76px) + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  color: var(--over);
}
.hero-foot .label { color: inherit; opacity: .8; transition: opacity .8s; }
.hero-caption { text-align: right; }
@media (max-width: 600px) { .hero-caption { max-width: 60%; letter-spacing: .16em; } }
.scroll-cue { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.scroll-cue i { display: block; width: 1px; height: 34px; background: currentColor; transform-origin: top; animation: cue 2.6s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Home sections ---------- */
.statement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr);
  gap: 32px clamp(24px, 6vw, 96px);
  padding-block: clamp(88px, 14vw, 190px);
}
#work { scroll-margin-top: 72px; }
.statement h2 { font-size: var(--t-xl); line-height: 1.25; max-width: 24ch; }
.statement p { color: var(--mute); max-width: 52ch; margin-top: 28px; }
@media (max-width: 760px) { .statement { grid-template-columns: minmax(0, 1fr); } }

.tiles {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  height: clamp(540px, 86vh, 920px);
}
.tile { position: relative; overflow: hidden; display: block; color: var(--over); text-decoration: none; background: var(--night); }
.tile:first-child { grid-row: span 2; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.8s var(--ease), opacity 1s var(--ease); }
.tile:hover img, .tile:focus-visible img { transform: scale(1.045); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .5), transparent 50%); }
.tile-text { position: absolute; z-index: 1; left: clamp(18px, 2.4vw, 36px); right: 18px; bottom: clamp(18px, 2.4vw, 32px); display: grid; gap: 4px; }
.tile-text h3 { font-size: clamp(2rem, 4.4vw, 4rem); font-weight: 200; line-height: 1; }
.tile-text .label { color: var(--over); opacity: .85; }
@media (max-width: 760px) {
  .tiles { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; height: auto; }
  .tile, .tile:first-child { grid-row: auto; aspect-ratio: 4 / 3.4; }
}

.pause {
  position: relative;
  margin: clamp(88px, 14vw, 180px) 0 0;
  height: 88vh;
  height: 88svh;
  min-height: 420px;
  overflow: hidden;
  background: var(--night);
  color: var(--over);
}
.pause img { width: 100%; height: 100%; object-fit: cover; }
.pause::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .45), transparent 45%); }
.pause figcaption { position: absolute; z-index: 1; left: var(--gut-l); right: var(--gut-r); bottom: clamp(28px, 6vh, 64px); display: grid; gap: 10px; }
.pause blockquote { margin: 0; font-family: var(--f-display); font-weight: 200; font-size: var(--t-xl); line-height: 1.2; max-width: 22ch; }
.pause .label { color: var(--over); opacity: .8; }

.about-teaser {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  padding-block: clamp(80px, 11vw, 150px);
}
.about-teaser img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% 55%; }
.about-teaser .copy { display: grid; gap: 22px; max-width: 54ch; }
.about-teaser h2 { font-size: var(--t-xl); line-height: 1.2; }
.about-teaser p { color: var(--mute); }
@media (max-width: 760px) { .about-teaser { grid-template-columns: minmax(0, 1fr); } }

.more {
  justify-self: start;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: var(--t-xs);
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  padding-block: 6px;
  border-bottom: 1px solid currentColor;
}
.more span { transition: transform .5s var(--ease); }
.more:hover span { transform: translateX(6px); }

/* ---------- Gallery page ---------- */
.g-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px clamp(24px, 6vw, 96px);
  padding-block: clamp(64px, 10vw, 140px) clamp(40px, 6vw, 72px);
}
.g-head h1 { font-size: var(--t-xxl); font-weight: 200; line-height: .9; letter-spacing: -.015em; margin-top: 14px; animation: rise 1.4s var(--ease) both; }
.g-head p { color: var(--mute); max-width: 44ch; font-size: 1.05rem; }
@media (max-width: 760px) { .g-head { grid-template-columns: minmax(0, 1fr); } }

.grid { display: flex; flex-wrap: wrap; gap: 12px; }
.grid::after { content: ""; flex-grow: 1000000; }
.grid figure {
  position: relative;
  margin: 0;
  flex-grow: calc(var(--r) * 100);
  flex-basis: calc(var(--r) * clamp(140px, 17vw, 270px));
  background: var(--paper-2);
  overflow: hidden;
}
.grid a { display: block; cursor: zoom-in; }
.grid img { width: 100%; height: auto; aspect-ratio: var(--r); object-fit: cover; transition: transform 1.6s var(--ease), opacity 1s var(--ease); }
.grid figure:hover img { transform: scale(1.03); }
.grid figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 16px 14px;
  color: var(--over);
  font-size: var(--t-s);
  background: linear-gradient(to top, rgb(0 0 0 / .55), transparent);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  pointer-events: none;
}
.grid figcaption i { opacity: .75; margin-left: .4em; }
.grid figure:hover figcaption { opacity: 1; transform: none; }
@media (max-width: 600px) {
  .grid { gap: 28px; }
  .grid figure { flex-basis: 100%; background: none; }
  .grid img { background: var(--paper-2); }
}
@media (hover: none) {
  .grid figcaption { display: block; position: static; opacity: 1; transform: none; background: none; color: var(--mute); padding: 10px 0 0; font-size: var(--t-xs); letter-spacing: .04em; }
}

.next {
  display: grid;
  gap: 10px;
  margin-top: clamp(80px, 11vw, 150px);
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.next-title { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; font-family: var(--f-display); font-weight: 200; font-size: var(--t-xxl); line-height: .95; letter-spacing: -.015em; }
.next-arrow { font-weight: 200; transition: transform .6s var(--ease); }
.next:hover .next-arrow, .next:focus-visible .next-arrow { transform: translateX(12px); }
.next:hover .next-title > span:first-child { color: var(--accent); }

/* ---------- About page ---------- */
.about { display: grid; gap: clamp(32px, 5vw, 64px); padding-block: clamp(56px, 9vw, 120px) 0; }
.about-head h1 { font-size: var(--t-xxl); font-weight: 200; line-height: .9; letter-spacing: -.015em; margin-top: 14px; animation: rise 1.4s var(--ease) both; }
.about-photo { margin: 0; background: var(--paper-2); overflow: hidden; }
.about-photo img { width: 100%; height: auto; aspect-ratio: 16 / 8; object-fit: cover; object-position: 50% 56%; }
.about-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px clamp(32px, 6vw, 96px); }
.about .lead { font-family: var(--f-display); font-size: var(--t-xl); font-weight: 300; line-height: 1.25; max-width: 20ch; }
.about-text { display: grid; gap: 20px; color: var(--mute); max-width: 56ch; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 32px; margin: 0; padding-top: 32px; border-top: 1px solid var(--line); }
.facts dt { font-family: var(--f-display); font-weight: 500; font-size: var(--t-xs); letter-spacing: .24em; text-transform: uppercase; color: var(--mute); }
.facts dd { margin: 8px 0 0; font-family: var(--f-display); font-size: 1.2rem; }
.facts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.facts a { text-decoration: none; }
.facts a:hover { color: var(--accent); }
@media (max-width: 760px) {
  .about-photo img { aspect-ratio: 4 / 3; }
  .about-body { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 404 ---------- */
.notfound { display: grid; gap: 20px; padding-block: clamp(80px, 14vw, 200px) 0; max-width: 60ch; }
.notfound h1 { font-size: var(--t-xxl); font-weight: 200; line-height: .9; letter-spacing: -.015em; }
.notfound p { color: var(--mute); }
.notfound-links { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 16px; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  margin-top: clamp(72px, 10vw, 140px);
  color: var(--mute);
  font-size: var(--t-s);
}
.next + .site-footer { margin-top: 0; }
.pause + .site-footer { margin-top: 0; border-top: 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer nav { display: flex; gap: 24px; flex-wrap: wrap; }

/* ---------- Lightbox ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--night);
  color: var(--over);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  animation: lb-in .5s ease both;
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-bar, .lb-cap { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px max(16px, 2.4vw); }
.lb-count { font: 500 var(--t-xs) var(--f-display); letter-spacing: .24em; font-variant-numeric: tabular-nums; opacity: .75; }
.lb button { color: inherit; background: none; border: 0; cursor: pointer; }
.lb-close { font: 500 var(--t-xs) var(--f-display); letter-spacing: .24em; text-transform: uppercase; padding: 8px 0; opacity: .8; }
.lb-close:hover { opacity: 1; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding-inline: max(16px, 5vw); }
.lb-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; opacity: 0; transition: opacity .6s var(--ease); user-select: none; -webkit-user-select: none; }
.lb-img.in { opacity: 1; }
.lb-prev, .lb-next { position: absolute; top: 0; bottom: 0; width: max(16px, 5vw); display: grid; place-items: center; opacity: .55; transition: opacity .3s; }
.lb-prev { left: 0; } .lb-next { right: 0; }
.lb-prev:hover, .lb-next:hover { opacity: 1; }
.lb-prev svg, .lb-next svg { width: 22px; height: 40px; }
.lb-cap { justify-content: center; text-align: center; min-height: 64px; font-size: var(--t-s); }
.lb-cap i { opacity: .65; margin-left: .5em; }
.lb-copy { display: block; margin-top: 4px; font: 500 var(--t-xs) var(--f-display); letter-spacing: .24em; text-transform: uppercase; opacity: .5; }
@media (max-width: 600px) { .lb-prev, .lb-next { display: none; } .lb-stage { padding-inline: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
