*, *::before, *::after { box-sizing: border-box; }
html { background: #fff; }
body { margin: 0; background: #fff; color: #000; font-family: 'Pontano Sans', sans-serif; font-weight: 400; animation: fade .6s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
a { color: #767676; text-decoration: none; outline: none; transition: color .2s; }
a.white { color: #000; }
a:hover, a:focus-visible, a.active, .active { color: #f00; }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid #000; margin: 0; }
h1 { margin: 0; font-size: 4em; line-height: 1; font-weight: 300; letter-spacing: 1px; white-space: nowrap; }
nav a { font-size: 1.4em; }

/* ---------- home ---------- */
.home-wrap { display: flex; height: 100vh; height: 100dvh; max-width: 1280px; margin: 0 auto; }
.home-img { flex: 0 0 45%; display: flex; justify-content: flex-end; height: 100%; padding: 4px 0; }
.home-img img { height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: right center; }
.home-side { flex: 1; display: flex; flex-direction: column; padding: 0 10px 12px 14px; }
.home-side header { margin-top: auto; padding-top: 30vh; }
.home-side nav { padding: .6em 0 0 2px; }
.home-side nav a { margin-right: 18px; line-height: 30px; }
.home-side footer { margin-top: auto; font-size: 1.5em; }
.home-side footer a { margin-right: 18px; }
.home-side header { margin-bottom: auto; }

/* ---------- pagine interne ---------- */
.container { max-width: 1024px; margin: 0 auto; padding: 0 16px; }
.header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px 24px; padding: 18px 0 14px; }
.header nav { display: flex; flex-wrap: wrap; gap: 4px 44px; }
.footer { display: flex; justify-content: flex-end; gap: 28px; padding: 18px 0 30px; font-size: 1.5em; }

.subnav { text-align: center; padding: 12px 0; font-size: 1.05em; line-height: 1.7; }
.subnav .label, .subnav .sep { color: #000; }
.subnav .sep { margin: 0 .5em; }

/* ---------- galleria ---------- */
.gallery { outline: none; padding-bottom: 20px; }
.gnav { display: flex; align-items: center; justify-content: space-between; height: 50px; }
.dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.dot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid #000; background: transparent; padding: 0; cursor: pointer; transition: background .2s, border-color .2s; }
.dot:hover { border-color: #f00; }
.dot.on { background: #000; }
.arrow { width: 39px; height: 50px; background: none; border: 0; cursor: pointer; position: relative; }
.arrow::before { content: ''; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; border-left: 1px solid #000; border-bottom: 1px solid #000; transform: translate(-30%, -50%) rotate(45deg); transition: border-color .2s; }
.arrow.next::before { transform: translate(-70%, -50%) rotate(-135deg); }
.arrow:hover::before { border-color: #f00; }
.caption { min-height: 1.5em; margin: 0 0 10px; text-align: center; color: #767676; font-size: 1em; }
.caption:empty { display: none; }
.slides { position: relative; }
.slide { margin: 0 0 16px; }
.slide img { margin: 0 auto; }
.js .slide { display: none; margin: 0; cursor: pointer; }
.js .slide.on { display: block; animation: fade .45s ease both; }
.js .slide img { max-height: calc(100vh - 40px); width: auto; }

/* ---------- testi ---------- */
.text { padding: 24px 0 34px; font-size: 1.25em; line-height: 1.55; }
.text p { margin: 0 0 1em; max-width: 46em; }
.text em { font-style: normal; color: #000; }
.text .strip { width: 100%; margin-bottom: 28px; }
.text .more a { color: #f00; }
.text .more a:hover { color: #000; }
h2 { font-size: 1.2em; font-weight: 400; color: #767676; margin: 0 0 1em; scroll-margin-top: 20px; }
.cv + h2 { margin-top: 2.4em; }
.cv { display: grid; grid-template-columns: 7em 1fr; gap: 0 20px; margin: 0; }
.cv dt { color: #767676; padding: 10px 0; border-top: 1px solid #ddd; }
.cv dd { margin: 0; padding: 10px 0 2px; border-top: 1px solid #ddd; }
.cv dd p { margin: 0 0 8px; max-width: none; }
.cv dd span { display: block; color: #767676; font-size: .82em; line-height: 1.4; }
.contacts { display: flex; flex-wrap: wrap; gap: 10px 80px; justify-content: flex-end; }
.contacts p { margin-bottom: 1.2em; }

/* ---------- mobile ---------- */
@media (max-width: 50em) {
  h1 { font-size: 2.9em; }
  nav a { font-size: 1.2em; }
  .header nav { gap: 2px 22px; }
  .text { font-size: 1.08em; }
  .contacts { justify-content: flex-start; }
}
@media (max-width: 40em) {
  h1 { font-size: 2.3em; }
  .home-wrap { flex-direction: column; height: auto; min-height: 100dvh; }
  .home-img { flex: none; height: 62vh; justify-content: center; padding: 8px 8px 0; }
  .home-img img { object-position: center; }
  .home-side { padding: 0 18px 18px; }
  .home-side header { padding-top: 22px; margin: 0 0 28px; }
  .home-side nav a { display: inline-block; }
  .cv { grid-template-columns: 1fr; }
  .cv dd { border-top: 0; padding-top: 0; }
  .cv dt { padding-bottom: 4px; }
  .dots { gap: 10px; }
  .footer { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { body, .js .slide.on { animation: none; } }

/* ---------- seo / firma ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.brand { margin: 0; font-size: 4em; line-height: 1; font-weight: 300; letter-spacing: 1px; white-space: nowrap; }
.credit { font-size: .5em; color: #aaa; margin-right: auto; align-self: center; letter-spacing: .5px; }
.home-side footer { display: flex; align-items: baseline; }
.home-side footer .credit { margin: 0 0 0 auto; }
.text h2 { margin-top: 2.4em; }
.text h2:first-child, .text #personali { margin-top: 0; }
.faq { margin: 0; max-width: 46em; }
.faq dt { color: #000; margin-top: 1em; }
.faq dd { margin: .2em 0 0; color: #555; font-size: .9em; }
.press { list-style: none; margin: 0; padding: 0; font-size: .9em; }
.press li { padding: 4px 0; }
@media (max-width: 50em) { .brand { font-size: 2.9em; } }
@media (max-width: 40em) { .brand { font-size: 2.3em; } }

/* ---------- galleria a tutto schermo ---------- */
.fs-close { display: none; }
.js .slide { cursor: zoom-in; }
.fs-open { overflow: hidden; }
.gallery.fs { position: fixed; inset: 0; z-index: 10; background: #fff; padding: 0; display: flex; flex-direction: column; }
.gallery.fs .gnav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 10px; background: linear-gradient(transparent, rgba(255,255,255,.85)); }
.gallery.fs .caption { position: absolute; left: 60px; right: 60px; bottom: 46px; z-index: 2; margin: 0; text-shadow: 0 0 6px #fff; }
.gallery.fs .slides { flex: 1; min-height: 0; }
.gallery.fs .slide { height: 100%; cursor: e-resize; }
.gallery.fs .slide img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.gallery.fs .fs-close { display: block; position: absolute; top: 4px; right: 10px; z-index: 3; background: none; border: 0; color: #000; font: 300 2.6em/1 'Pontano Sans', sans-serif; cursor: pointer; }
.gallery.fs .fs-close:hover { color: #f00; }
.credit, .credit .signed { color: #aaa; font-family: Consolas, Menlo, monospace; letter-spacing: 0; }
.credit:hover .signed { color: #767676; }

/* ---------- griglia opere ---------- */
.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 34px 22px; padding: 26px 0 36px; }
.work { margin: 0; }
.work a { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #f2f2f2; cursor: zoom-in; }
.work img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s; }
.work a:hover img, .work a:focus-visible img { transform: scale(1.04); }
.work figcaption { padding-top: 9px; line-height: 1.35; }
.work figcaption em { font-style: normal; display: block; color: #000; font-size: 1.05em; }
.work figcaption span { display: block; color: #767676; font-size: .82em; }
.work figcaption .n { color: #aaa; margin-top: 2px; }
.work:target figcaption em { color: #f00; }

/* ---------- visore ---------- */
.lb { position: fixed; inset: 0; z-index: 20; background: #fff; display: none; flex-direction: column; }
.lb.open { display: flex; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 54px 60px 8px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; animation: fade .35s ease both; cursor: e-resize; }
.lb-bar { display: flex; align-items: baseline; justify-content: center; gap: 14px; padding: 10px 60px 18px; text-align: center; }
.lb-title { color: #000; }
.lb-cap { color: #767676; font-size: .9em; }
.lb-count { color: #aaa; font-size: .85em; white-space: nowrap; }
.lb .arrow { position: absolute; top: 50%; margin-top: -25px; z-index: 2; }
.lb .prev { left: 8px; } .lb .next { right: 8px; }
.lb .arrow::before { border-color: #000; width: 22px; height: 22px; }
.lb .arrow:hover::before { border-color: #f00; }
.lb-close { position: absolute; top: 6px; right: 12px; z-index: 3; background: none; border: 0; color: #000; font: 300 2.6em/1 'Pontano Sans', sans-serif; cursor: pointer; }
.lb-close:hover { color: #f00; }
.lb.single .arrow, .lb.single .lb-count { display: none; }

/* ---------- biografia ---------- */
.text .portrait { float: right; width: 34%; max-width: 300px; margin: 4px 0 18px 28px; }
.text h2 { clear: both; }
.essay { margin: 0; padding: 0 0 0 22px; border-left: 1px solid #ddd; font-size: .9em; color: #333; }
.essay p { max-width: 44em; }
.essay .epigraph { font-style: italic; color: #000; }
.essay .epigraph span { font-style: normal; color: #767676; font-size: .85em; }

@media (max-width: 40em) {
  .works { grid-template-columns: 1fr 1fr; gap: 22px 12px; }
  .work figcaption em { font-size: .95em; }
  .lb-stage { padding: 48px 6px 4px; }
  .lb-bar { flex-direction: column; gap: 2px; padding: 8px 14px 16px; }
  .lb .arrow { top: auto; bottom: 10px; margin: 0; }
  .text .portrait { float: none; width: 60%; margin: 0 0 18px; }
  .essay { padding-left: 14px; }
}
.lb-close:focus { outline: none; }
.lb-close:focus-visible { outline: 1px solid #ddd; }
@media (max-width: 40em) {
  .lb-bar { padding: 8px 52px 16px; min-height: 64px; justify-content: center; align-items: center; }
  .lb .arrow { bottom: 14px; }
}
