:root {
  --bg: #fff;
  --fg: #111;
  --muted: #8a8a8a;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad: clamp(16px, 3vw, 40px);
  --t: clamp(14px, 1.25vw, 18px);
  --ph: #f2f2f2;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font: 400 var(--t)/1.5 var(--mono);
  letter-spacing: .04em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* Barra in alto */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(var(--pad) * .6) var(--pad);
  padding-top: max(calc(var(--pad) * .6), env(safe-area-inset-top));
  color: #fff; mix-blend-mode: difference;
  text-transform: uppercase;
}
.bar-current { text-align: center; opacity: 0; transition: opacity .4s; }
.bar-current.on { opacity: 1; }
.bar-nav { justify-self: end; display: flex; gap: 2em; }
.bar a { transition: opacity .2s; }
.bar a:hover { opacity: .5; }
.bar-nav a.active { text-decoration: underline; text-underline-offset: 3px; }

/* Home: un progetto per schermata */
.home { scroll-snap-type: y mandatory; }
.slide {
  position: relative; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; place-items: center; background: #ddd;
}
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-title {
  position: relative; color: #fff; text-transform: uppercase;
  font-size: clamp(26px, 4.8vw, 68px); letter-spacing: .02em; line-height: 1.1;
  text-align: center; padding: 0 var(--pad);
  text-shadow: 0 0 30px rgba(0,0,0,.15);
}
.slide::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.08); pointer-events: none; }
.slide-title { z-index: 1; }
html.snap { scroll-snap-type: y mandatory; }
html.snap .slide { scroll-snap-align: start; }

/* Pagine bianche */
.page { padding: calc(var(--pad) * 3.5) var(--pad) calc(var(--pad) * 2); min-height: 100vh; }

/* Griglia progetti */
.grid {
  display: grid; gap: clamp(12px, 2vw, 28px);
  grid-template-columns: repeat(4, 1fr);
  max-width: 1400px; margin: 0 auto;
}
.tile figure { aspect-ratio: 1; overflow: hidden; background: var(--ph); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.tile:hover img { transform: scale(1.03); }
.tile figcaption { margin-top: .7em; text-transform: uppercase; font-size: clamp(18px, 1.8vw, 26px); letter-spacing: .02em; line-height: 1.15; }
.tile:hover figcaption { color: var(--muted); }

/* Pagina progetto */
.project-head { text-align: center; text-transform: uppercase; margin-bottom: calc(var(--pad) * 2); }
.project-head h1 { font-weight: 400; font-size: clamp(26px, 3.4vw, 46px); letter-spacing: .02em; }
.project-head p { color: var(--muted); margin-top: .6em; }
.shots { display: flex; flex-direction: column; align-items: center; gap: clamp(40px, 9vh, 120px); }
.shots img { max-height: 88vh; width: auto; object-fit: contain; background: var(--ph); }
.shots .land img { width: min(100%, 1400px); max-height: none; }
.next { display: block; text-align: center; text-transform: uppercase; margin: calc(var(--pad) * 4) 0 var(--pad); }
.next span { color: var(--muted); display: block; margin-bottom: .6em; }
.next:hover { opacity: .5; }

/* Info */
.info { max-width: 760px; margin: 10vh auto 0; }
.info p { font-size: clamp(19px, 1.9vw, 26px); line-height: 1.6; margin-bottom: 2.2em; letter-spacing: .01em; }
.info dl { display: grid; grid-template-columns: 9em 1fr; row-gap: .8em; font-size: clamp(15px, 1.4vw, 20px); text-transform: uppercase; }
.info dt { color: var(--muted); }
.info a:hover { opacity: .5; }
.info dd a { text-transform: none; }
.info dd a::after { content: " ↗"; color: var(--muted); }

/* Comparsa morbida */
.fade { opacity: 0; transition: opacity .9s ease; }
.fade.in { opacity: 1; }

@media (max-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
  .bar { grid-template-columns: 1fr auto; }
  .bar-current { display: none; }
  .bar-nav { gap: 1.2em; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .shots img, .shots .land img { width: 100%; max-height: none; }
  .info dl { grid-template-columns: 7em 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Modalità scura */
:root[data-theme="dark"] { --bg: #0d0d0d; --fg: #e9e9e6; --muted: #777; --ph: #1a1a1a; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0d0d0d; --fg: #e9e9e6; --muted: #777; --ph: #1a1a1a; color-scheme: dark; }
}
body { transition: background-color .4s, color .4s; }
.theme-btn { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; transition: opacity .2s; }
.theme-btn:hover { opacity: .5; }
.theme-btn { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin: -.3em -.3em -.3em 0; }
.theme-btn svg { width: 1.25em; height: 1.25em; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.theme-btn.is-dark svg { transform: rotate(180deg); }
.bar-nav { align-items: center; }
.bar-sections { display: contents; }
.next b { font-weight: 400; font-size: clamp(22px, 2.6vw, 36px); display: block; }
/* Il primo progetto (Palestra Popolari) è il più grande */
.tile.feature { grid-column: span 2; grid-row: span 2; }
.tile.feature { display: flex; flex-direction: column; }
.tile.feature figure { flex: 1; aspect-ratio: auto; position: relative; min-height: 0; }
.tile.feature figure img { position: absolute; inset: 0; }
.tile.feature figcaption { font-size: clamp(24px, 3vw, 44px); }
@media (max-width: 640px) { .tile.feature figure { flex: none; aspect-ratio: 4 / 5; } }
.project-text { max-width: 680px; margin: 0 auto calc(var(--pad) * 2.5); text-align: center; }
.project-text p { font-size: clamp(16px, 1.5vw, 20px); line-height: 1.6; letter-spacing: .01em; }
.project-text .pub { margin-top: 1.6em; font-size: var(--t); text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.project-text .pub a { color: var(--fg); }
.project-text .pub a:hover { opacity: .5; }
/* Video */
.slide video.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shots video.full { display: block; width: min(100%, 1400px); height: auto; background: #000; }
.info-h { font-weight: 400; font-size: var(--t); text-transform: uppercase; color: var(--muted); margin: 3.5em 0 1.2em; letter-spacing: .04em; }
.pubs { list-style: none; display: grid; gap: 1.1em; }
.pubs li { display: grid; grid-template-columns: 1fr; gap: .2em; }
.pubs li > a { font-size: clamp(20px, 2vw, 28px); line-height: 1.15; }
.pubs span { font-size: var(--t); color: var(--muted); }
.pubs a:hover { opacity: .5; }

/* Titolo in basso a sinistra, non sul volto */
.slide { place-items: end start; }
.slide-title { text-align: left; padding: 0 var(--pad) calc(var(--pad) * 1.3); }
.slide::after { background: linear-gradient(to top, rgba(0,0,0,.38), rgba(0,0,0,0) 38%); }

/* Menu telefono */
.menu-btn { display: none; font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.menu { position: fixed; inset: 0; z-index: 30; background: var(--bg); color: var(--fg); display: flex; flex-direction: column; justify-content: center; padding: var(--pad); }
.menu[hidden] { display: none; }
.menu nav { display: flex; flex-direction: column; gap: .5em; font-size: clamp(28px, 8vw, 44px); text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; }
.menu nav a.active { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.menu-close { position: absolute; top: max(calc(var(--pad) * .6), env(safe-area-inset-top)); right: var(--pad); font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
html.menu-open { overflow: hidden; }
@media (max-width: 640px) {
  .bar-sections a, .bar-nav > a { display: none; }
  .menu-btn { display: inline; }
}

/* Titolo in alto al centro, sopra la testa (richiesta Cristina) */
.slide { place-items: start center; }
.slide-title { text-align: center; padding: 0 var(--pad); margin-top: clamp(96px, 20vh, 220px); }
.slide::after { background: linear-gradient(to bottom, rgba(0,0,0,.30), rgba(0,0,0,0) 45%); }

/* Titoli in dissolvenza */
.slide .slide-title { opacity: 0; filter: blur(10px); transform: translateY(10px); transition: opacity 1.4s ease, filter 1.4s ease, transform 1.4s ease; }
.slide.in-view .slide-title { opacity: 1; filter: blur(0); transform: none; transition-delay: .25s; }
.dissolve { animation: dissolve 1.4s ease both .1s; }
@keyframes dissolve { from { opacity: 0; filter: blur(10px); transform: translateY(10px); } to { opacity: 1; filter: blur(0); transform: none; } }
@media (prefers-reduced-motion: reduce) { .slide .slide-title { opacity: 1; filter: none; transform: none; } .dissolve { animation: none; } }
/* League Gothic è molto stretto: più grande, come Druk su Athleta */
.slide-title[style*="Big Shoulders"] { font-size: clamp(56px, 11vw, 150px); line-height: .9; letter-spacing: .005em; }
.project-head h1[style*="Big Shoulders"] { font-size: clamp(48px, 7vw, 110px); line-height: .9; letter-spacing: .005em; }
.tile figcaption[style*="Big Shoulders"], .next b[style*="Big Shoulders"], .pubs a[style*="Big Shoulders"] { font-size: 1.5em; line-height: 1; }
/* la dissolvenza in home ora segue lo scorrimento (graduale) */
.slide .slide-title, .slide.in-view .slide-title { transition: none; will-change: opacity, filter, transform; }
.tile figcaption { will-change: opacity, filter; }
/* barra: niente sovrapposizioni */
.bar-nav a { white-space: nowrap; }
@media (max-width: 1100px) { .bar-current { display: none; } .bar { grid-template-columns: 1fr auto; } }
@media (max-width: 860px) { .bar-sections a, .bar-nav > a { display: none; } .menu-btn { display: inline; } }
/* Tanker: stretto come Big Shoulders */
.slide-title[style*="Tanker"] { font-size: clamp(56px, 11vw, 150px); line-height: .9; letter-spacing: .01em; }
.project-head h1[style*="Tanker"] { font-size: clamp(48px, 7vw, 110px); line-height: .9; }
.tile figcaption[style*="Tanker"], .next b[style*="Tanker"], .pubs a[style*="Tanker"] { font-size: 1.5em; line-height: 1; }
/* Panchang è molto largo: un po' più piccolo */
.slide-title[style*="Panchang"] { font-size: clamp(22px, 4vw, 54px); }
.project-head h1[style*="Panchang"] { font-size: clamp(20px, 2.6vw, 34px); }
/* Italiana è sottile: più grande */
.slide-title[style*="Italiana"] { font-size: clamp(34px, 6vw, 84px); }
/* Iran (Boska) più grande */
.slide-title[style*="Boska"] { font-size: clamp(64px, 12vw, 170px); line-height: .95; }
.project-head h1[style*="Boska"] { font-size: clamp(52px, 7.5vw, 120px); line-height: .95; }
.tile figcaption[style*="Boska"], .next b[style*="Boska"], .pubs a[style*="Boska"] { font-size: 1.6em; line-height: 1; }

/* Tutti i testi più grandi */
:root { --t: clamp(15px, 1.4vw, 20px); }
.slide-title { font-size: clamp(34px, 6.4vw, 92px); }
.tile figcaption { font-size: clamp(22px, 2.3vw, 34px); }
.tile.feature figcaption { font-size: clamp(30px, 3.8vw, 56px); }
.project-head h1 { font-size: clamp(34px, 4.6vw, 64px); }
.project-text p { font-size: clamp(18px, 1.8vw, 24px); }
.info p { font-size: clamp(21px, 2.2vw, 30px); }
.info dl { font-size: clamp(16px, 1.6vw, 22px); }
.pubs li > a { font-size: clamp(24px, 2.5vw, 36px); }
.next b { font-size: clamp(28px, 3.4vw, 48px); }
.slide-title[style*="Big Shoulders"], .slide-title[style*="Tanker"] { font-size: clamp(68px, 13vw, 190px); }
.project-head h1[style*="Big Shoulders"], .project-head h1[style*="Tanker"] { font-size: clamp(58px, 8.5vw, 140px); }
.slide-title[style*="Panchang"] { font-size: clamp(28px, 5vw, 68px); }
.project-head h1[style*="Panchang"] { font-size: clamp(26px, 3.4vw, 44px); }
.slide-title[style*="Italiana"] { font-size: clamp(42px, 7.5vw, 104px); }
.slide-title[style*="Boska"] { font-size: clamp(76px, 14vw, 200px); }
.project-head h1[style*="Boska"] { font-size: clamp(62px, 9vw, 150px); }

/* Titoli home più piccoli, con ombra che li stacca dalla foto */
.slide-title { font-size: clamp(26px, 4.6vw, 66px); }
.slide-title[style*="Big Shoulders"], .slide-title[style*="Tanker"] { font-size: clamp(44px, 8vw, 116px); }
.slide-title[style*="Boska"] { font-size: clamp(50px, 9vw, 128px); }
.slide-title[style*="Panchang"] { font-size: clamp(20px, 3.6vw, 50px); }
.slide-title[style*="Italiana"] { font-size: clamp(32px, 5.6vw, 78px); }
.project-head h1[style*="Big Shoulders"], .project-head h1[style*="Tanker"] { font-size: clamp(46px, 6.8vw, 108px); }
.project-head h1[style*="Boska"] { font-size: clamp(50px, 7.2vw, 116px); }
.slide-title {
  text-shadow:
    0 1px 1px rgba(0,0,0,.28),
    0 3px 6px rgba(0,0,0,.22),
    0 10px 24px rgba(0,0,0,.28),
    0 24px 60px rgba(0,0,0,.30);
}

/* Nomi dei progetti sempre in maiuscolo */
.slide-title, .tile figcaption, .project-head h1, .next b, .pubs li > a, .bar-current, .menu nav a { text-transform: uppercase; }

/* Refugee Hotels: Anton (spigoloso) */
.slide-title[style*="Anton"] { font-size: clamp(44px, 8vw, 116px); line-height: .95; letter-spacing: .01em; }
.project-head h1[style*="Anton"] { font-size: clamp(46px, 6.8vw, 108px); line-height: .95; }
.tile figcaption[style*="Anton"], .next b[style*="Anton"], .pubs a[style*="Anton"] { font-size: 1.4em; line-height: 1; }

/* HOME moodboard */
html.is-home:not([data-theme="dark"]) { --bg: #f2efe9; }
@media (prefers-color-scheme: dark) { html.is-home:not([data-theme="light"]) { --bg: #111; } }
html.is-home body { background: var(--bg); }
.mood { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(28px, 5vh, 56px); padding: 84px 0 40px; }
.mood-board { position: relative; }
.mood-item { position: absolute; display: block; opacity: 0; transform: translateY(14px) scale(.97);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.7,.2,1), filter .4s, box-shadow .4s;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.10); }
.mood-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mood-item.show { opacity: 1; transform: none; }
.mood-item.show.hot { transform: scale(1.05); z-index: 99 !important;
  box-shadow: 0 4px 10px rgba(0,0,0,.18), 0 22px 50px rgba(0,0,0,.28); transition: opacity .3s, transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s; }
.mood-board.hovering .mood-item.show:not(.hot) { opacity: .4; filter: grayscale(.3); }
.mood-names { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .35em 1.1em;
  padding: 0 var(--pad); max-width: 1200px; text-transform: uppercase; font-size: clamp(20px, 2.2vw, 32px); line-height: 1; }
.mood-names a { color: var(--fg); transition: opacity .3s, filter .3s; }
.mood-names a[style*="Panchang"] { font-size: .62em; }
.mood-names a[style*="Big Shoulders"], .mood-names a[style*="Anton"], .mood-names a[style*="Boska"] { font-size: 1.3em; }
.mood-names:has(a.hot) a:not(.hot) { opacity: .3; filter: blur(1.5px); }
@media (max-width: 640px) { .mood { justify-content: flex-start; padding-top: 96px; } .mood-names { font-size: 22px; gap: .5em 1em; } }

/* Nomi che scorrono (si ferma passandoci sopra) */
.mood-names { display: block; width: 100%; max-width: none; padding: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.mood-track { display: flex; width: max-content; animation: mood-scroll 40s linear infinite; }
.mood-run { display: flex; align-items: baseline; gap: 1.4em; padding-right: 1.4em; white-space: nowrap; }
.mood-names:hover .mood-track { animation-play-state: paused; }
@keyframes mood-scroll { to { transform: translateX(-50%); } }
@media (max-width: 640px) { .mood-names { font-size: 26px; } .mood-track { animation-duration: 30s; } }
@media (prefers-reduced-motion: reduce) { .mood-track { animation: none; } }

/* Home: dissolvenze lente e foto che fluttuano */
.mood-item { opacity: 0; filter: blur(10px); transform: scale(.98);
  transition: opacity 1.8s ease, filter 1.8s ease, transform 1.8s cubic-bezier(.2,.7,.2,1), box-shadow .45s;
  animation: mood-drift var(--dur, 12s) ease-in-out var(--del, 0s) infinite alternate; }
.mood-item.show { opacity: 1; filter: none; transform: none; }
.mood-item:not(.show) { pointer-events: none; }
@keyframes mood-drift { from { translate: calc(var(--dx) * -1) calc(var(--dy) * -1); } to { translate: var(--dx) var(--dy); } }
@media (prefers-reduced-motion: reduce) { .mood-item { animation: none; } }

/* Niente sfocato: solo dissolvenza pulita */
.mood-item, .mood-item.show { filter: none; }
.mood-item { transition: opacity 1.8s ease, transform 1.8s cubic-bezier(.2,.7,.2,1), box-shadow .45s; }
.mood-board.hovering .mood-item.show:not(.hot) { opacity: .45; filter: none; }
.mood-item.show.hot { transform: scale(1.03); }
.mood-names:has(a.hot) a:not(.hot) { filter: none; }

/* Fondo bianco anche in home; niente sfocato da nessuna parte */
html.is-home:not([data-theme="dark"]) { --bg: #fff; }
@keyframes dissolve { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.slide .slide-title, .slide.in-view .slide-title { filter: none; }

/* Nomi neri e pieni, ben distanziati; foto grandi */
.mood { gap: clamp(18px, 3vh, 36px); padding: 72px 0 28px; }
.mood-names { -webkit-mask-image: none; mask-image: none; }
.mood-names a { color: #000; opacity: 1; }
html[data-theme="dark"] .mood-names a { color: #fff; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .mood-names a { color: #fff; } }
.mood-names:has(a.hot) a:not(.hot) { opacity: 1; }
.mood-names a.hot { text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .12em; }
.mood-run { gap: 2.6em; padding-right: 2.6em; }
