@property --a1 { syntax: "<color>"; inherits: true; initial-value: #6e1b2a; }
@property --a2 { syntax: "<color>"; inherits: true; initial-value: #0e6e6a; }
@property --a3 { syntax: "<color>"; inherits: true; initial-value: #8a6a2f; }

:root {
  --bg: #0b0b0c;
  --fg: #e8dfce;
  --fg-2: rgba(232, 223, 206, .52);
  --line: rgba(232, 223, 206, .1);
  --glass: rgba(22, 22, 26, .55);
  --gut: clamp(12px, 1.6vw, 24px);
  --h: clamp(170px, 25vw, 400px);
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); overflow-x: clip; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
/* grana leggera su tutto, sempre in movimento */
body::after {
  content: ""; position: fixed; inset: -100px; pointer-events: none; z-index: 90; opacity: .07;
  animation: grain .9s steps(6) infinite; will-change: transform;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes grain {
  0% { transform: translate(0, 0); } 17% { transform: translate(-37px, 21px); } 33% { transform: translate(24px, -46px); }
  50% { transform: translate(-13px, 58px); } 67% { transform: translate(49px, 11px); } 83% { transform: translate(-52px, -29px); } 100% { transform: translate(0, 0); }
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; }

/* ——— luce ambientale: tre macchie sfocate dai colori del frame ——— */
#ambient {
  position: fixed; inset: -20vmax; z-index: 0; pointer-events: none; opacity: .5;
  transition: --a1 1.2s var(--ease), --a2 1.4s var(--ease), --a3 1.6s var(--ease), opacity 1s;
}
#ambient i { position: absolute; width: 80vmax; height: 80vmax; will-change: transform; }
#ambient i:nth-child(1) { background: radial-gradient(closest-side, var(--a1), transparent); left: 0; top: 0; animation: drift1 26s ease-in-out infinite alternate; }
#ambient i:nth-child(2) { background: radial-gradient(closest-side, var(--a2), transparent); right: 0; top: 20%; animation: drift2 32s ease-in-out infinite alternate; }
#ambient i:nth-child(3) { background: radial-gradient(closest-side, var(--a3), transparent); left: 25%; bottom: 0; animation: drift1 38s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(12vmax, 8vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vmax, 12vmax) scale(.9); } }
body.on-home #ambient { opacity: calc(.5 * var(--amb, 0)); transition: --a1 1.2s var(--ease), --a2 1.4s var(--ease), --a3 1.6s var(--ease); }
.view { position: relative; z-index: 1; }

/* ——— header ——— */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) var(--gut) 30px;
  background: none;
  pointer-events: none; transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.top > * { pointer-events: auto; }
/* ombra dell'header: leggera e lunga, con curva morbida (niente fascia) */
.top::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 150px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(11,11,12,0.550) 0.0%, rgba(11,11,12,0.540) 8.3%, rgba(11,11,12,0.509) 16.7%, rgba(11,11,12,0.461) 25.0%, rgba(11,11,12,0.401) 33.3%, rgba(11,11,12,0.334) 41.7%, rgba(11,11,12,0.263) 50.0%, rgba(11,11,12,0.194) 58.3%, rgba(11,11,12,0.131) 66.7%, rgba(11,11,12,0.076) 75.0%, rgba(11,11,12,0.034) 83.3%, rgba(11,11,12,0.009) 91.7%, rgba(11,11,12,0.000) 100.0%); transition: opacity .5s var(--ease); }

/* sopra all'header (barra di stato iPhone, rimbalzo dello scroll) niente contenuti che passano */
.top::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 200px; background: var(--bg); }
body.on-home .top:not(.show)::before { background: #000; }
/* in home l'header compare solo dopo la hero */
body.on-home .top .picker, body.on-home .top::after { opacity: var(--hp, 0); transition: none; }
body.on-home .top .wordmark { opacity: var(--hw, 0); transition: none; }
body.on-home .top:not(.show) .wordmark, body.on-home .top:not(.show) .picker { pointer-events: none; }
.picker { transition: opacity .4s var(--ease); }
.wordmark { transition: opacity .4s var(--ease), font-variation-settings .5s var(--ease); }
.wordmark {
  font-weight: 800; text-transform: uppercase; font-size: 15px; letter-spacing: .01em; line-height: 1;
  font-variation-settings: "wdth" 125; transition: font-variation-settings .5s var(--ease);
}
.wordmark:hover { font-variation-settings: "wdth" 70; }
.top-role { color: var(--fg-2); }
body.on-home .top-role { display: none; }

/* ——— menu a pillole ——— */
.pills {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  display: flex; gap: 2px; padding: 4px; border-radius: 99px;
  background: var(--glass); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--line); box-shadow: 0 10px 40px -12px rgba(0,0,0,.6);
}
.pills a {
  position: relative; z-index: 1; padding: 9px 16px 8px; border-radius: 99px; font-size: 13px; line-height: 1; color: var(--fg-2);
  transition: color .4s var(--ease);
}
.pills a:hover { color: var(--fg); }
.pills a.on { color: var(--bg); }
.pill-thumb {
  position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 99px; background: var(--fg);
  transition: transform .6s cubic-bezier(.3, 1.25, .4, 1), width .6s cubic-bezier(.3, 1.25, .4, 1), opacity .3s;
}

/* ——— hero: nome che scorre sopra ai frame preferiti ——— */
.hero { position: relative; height: 100svh; min-height: 520px; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: #000 var(--still, none) center / cover no-repeat; }
.hero-v {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1s var(--ease);
}
.hero-v.on { opacity: 1; z-index: 1; }
.hero-shade, .marquee, .hero-foot { z-index: 2; }
.hero-shade { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.500) 0.0%, rgba(0,0,0,0.490) 2.7%, rgba(0,0,0,0.463) 5.3%, rgba(0,0,0,0.419) 8.0%, rgba(0,0,0,0.364) 10.7%, rgba(0,0,0,0.303) 13.3%, rgba(0,0,0,0.239) 16.0%, rgba(0,0,0,0.176) 18.7%, rgba(0,0,0,0.119) 21.3%, rgba(0,0,0,0.070) 24.0%, rgba(0,0,0,0.031) 26.7%, rgba(0,0,0,0.008) 29.3%, rgba(0,0,0,0.000) 32.0%),
    linear-gradient(to bottom, rgba(11,11,12,0.000) 55.0%, rgba(11,11,12,0.016) 58.8%, rgba(11,11,12,0.062) 62.5%, rgba(11,11,12,0.138) 66.2%, rgba(11,11,12,0.236) 70.0%, rgba(11,11,12,0.353) 73.8%, rgba(11,11,12,0.478) 77.5%, rgba(11,11,12,0.605) 81.2%, rgba(11,11,12,0.727) 85.0%, rgba(11,11,12,0.836) 88.8%, rgba(11,11,12,0.921) 92.5%, rgba(11,11,12,0.977) 96.2%, rgba(11,11,12,1.000) 100.0%); }
.marquee {
  position: absolute; left: 0; right: 0; bottom: clamp(84px, 12vh, 130px); margin: 0; overflow: hidden; white-space: nowrap;
  font-weight: 900; text-transform: uppercase; font-variation-settings: "wdth" 125; letter-spacing: -.02em;
  font-size: clamp(64px, 15vw, 260px); line-height: .82; color: var(--fg);
}
.mq-track { display: inline-flex; align-items: center; animation: mq 38s linear infinite; }
.mq-track span { padding-right: .18em; }
.mq-track i { font-style: normal; font-weight: 300; font-size: .4em; padding-right: .35em; }
@keyframes mq { to { transform: translateX(-50%); } }
.hero-foot {
  position: absolute; left: var(--gut); right: var(--gut); top: 20px;
  display: flex; justify-content: space-between; gap: 12px; color: rgba(232,223,206,.7);
}
#hero-now { transition: opacity .5s; }

/* ——— home: griglia giustificata, niente didascalie ——— */
.grid {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 18px var(--gut) 120px; min-height: 100vh; align-content: flex-start;
}
.grid::after { content: ""; flex-grow: 1e4; }
/* l'inizio della griglia parte dal nero della hero e lascia emergere la luce colorata */
#grid { background: linear-gradient(to bottom, rgba(11,11,12,1.000) 0px, rgba(11,11,12,0.981) 30px, rgba(11,11,12,0.926) 60px, rgba(11,11,12,0.838) 90px, rgba(11,11,12,0.729) 120px, rgba(11,11,12,0.607) 150px, rgba(11,11,12,0.478) 180px, rgba(11,11,12,0.353) 210px, rgba(11,11,12,0.238) 240px, rgba(11,11,12,0.139) 270px, rgba(11,11,12,0.062) 300px, rgba(11,11,12,0.016) 330px, rgba(11,11,12,0.000) 360px) no-repeat; }
.tile {
  position: relative; overflow: hidden; display: block; border-radius: 2px; background: #141416;
  flex: var(--r) 1 calc(var(--r) * var(--h)); aspect-ratio: var(--r);
  min-width: 0; max-width: 100%; /* un frame largo da solo in riga si stringe invece di sbordare */
  transition: opacity .5s var(--ease);
}
.tile img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: filter .55s var(--ease), transform 1.1s var(--ease);
}
.tile .ov {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  padding: clamp(10px, 1.4vw, 18px); opacity: 0; transform: translateY(6px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  background: linear-gradient(to top, rgba(0,0,0,.35), transparent 70%);
}
.ov-a { font-weight: 800; text-transform: uppercase; font-variation-settings: "wdth" 118; font-size: clamp(16px, 1.7vw, 26px); line-height: .95; }
.ov-t { font-weight: 300; font-variation-settings: "wdth" 70; font-size: clamp(14px, 1.3vw, 20px); line-height: 1; text-transform: uppercase; }
.ov-m { color: rgba(232,223,206,.75); margin-top: 6px; font-size: 10px; }
@media (hover: hover) {
  #grid .tile:hover img { filter: brightness(.8); transform: scale(1.04); }
  #grid .tile:hover .ov { opacity: 1; transform: none; }
}
.hv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--ease); pointer-events: none; }
.hv.playing { opacity: 1; }
.tile .ov { z-index: 2; background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,.1) 45%, transparent 70%); }
#ppreview { overflow: hidden; }
.tile.peek img { filter: blur(18px) brightness(.62) saturate(1.25); transform: scale(1.1); }
.tile.peek .ov { opacity: 1; transform: none; }
.tile.out { opacity: 0; }
.empty { padding: 140px var(--gut); color: var(--fg-2); text-align: center; }

/* ——— filtri home, nell'header ——— */
.picker { position: relative; display: none; }
body.on-home .picker { display: block; }
.picker-bar { display: flex; gap: 6px; align-items: center; }
.seg, .picker-pill, .picker-panel {
  background: var(--glass); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--line);
}
.picker-pill { display: flex; align-items: center; gap: 9px; padding: 8px 14px 7px; border-radius: 99px; }
.seg { display: flex; border-radius: 99px; padding: 3px; }
.seg button { padding: 5px 11px 4px; border-radius: 99px; color: var(--fg-2); transition: background .25s, color .25s; }
.seg button.on { background: rgba(232,223,206,.12); color: var(--fg); }
#picker-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: conic-gradient(#c0231e, #e2541b, #c8852b, #0e6e6a, #1f4e8c, #6e1b2a, #c0231e);
}
.picker-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  border-radius: 14px; padding: 10px; width: min(340px, calc(100vw - 32px));
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.picker.open .picker-panel { opacity: 1; transform: none; pointer-events: auto; }
#spectrum { display: block; width: 100%; height: 64px; border-radius: 8px; cursor: crosshair; touch-action: none; }
.picker-row { display: flex; justify-content: space-between; padding: 9px 2px 1px; color: var(--fg-2); }
.picker-row button:hover, .picker-row button.on { color: var(--fg); }

/* ——— projects: tabella pulita ——— */
.pro { padding: 110px var(--gut) 120px; }
.pro-filters { display: flex; gap: 22px; align-items: baseline; margin-bottom: 34px; color: var(--fg-2); }
.pro-filters > span { color: var(--fg); }
#pfilters { display: flex; flex-wrap: wrap; gap: 4px 16px; }
#pfilters button { color: var(--fg-2); text-transform: uppercase; }
#pfilters button:hover, #pfilters button.on { color: var(--fg); }
#pfilters button.on { text-decoration: underline; text-underline-offset: 4px; }
.plist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.plist a {
  display: grid; grid-template-columns: 70px minmax(0, 1.6fr) 1fr .7fr 1fr; gap: 16px; align-items: baseline;
  padding: 13px 0 12px; border-bottom: 1px solid var(--line); transition: opacity .3s, padding .4s var(--ease);
  font-size: 14px; text-transform: uppercase; letter-spacing: .02em;
}
.plist .n { color: var(--fg-2); font-family: var(--mono); font-size: 11px; }
.plist .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist .c { color: var(--fg-2); }
.plist .c:last-child { text-align: right; }
.plist:hover a { opacity: .3; }
.plist:hover a:hover { opacity: 1; padding-left: 10px; }
#ppreview {
  position: fixed; right: var(--gut); top: 50%; width: min(30vw, 480px, calc(70vh * var(--ar, 1.78))); aspect-ratio: 16/9; z-index: 2;
  transition: opacity .35s var(--ease), filter .5s var(--ease), aspect-ratio .4s var(--ease);
  transform: translateY(-50%); border-radius: 2px; pointer-events: none;
  background-size: cover; background-position: center; opacity: 0; filter: blur(14px);
}
#ppreview.on { opacity: 1; filter: blur(0); }

/* ——— pagina progetto ——— */
.work { padding: 120px var(--gut) 100px; }
.w-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 34px; }
.display {
  font-weight: 900; text-transform: uppercase; margin: 0;
  font-size: clamp(42px, 8vw, 132px); line-height: .86; letter-spacing: -.02em; font-variation-settings: "wdth" 125;
}
.display em { display: block; font-style: normal; font-weight: 300; font-variation-settings: "wdth" 62; }
.w-meta { display: grid; grid-template-columns: auto auto; gap: 5px 18px; color: var(--fg-2); }
.w-meta b { color: var(--fg); font-weight: 400; }
.back { display: inline-block; color: var(--fg-2); margin-bottom: 26px; transition: color .2s; }
.back:hover { color: var(--fg); }
.films { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.film { position: relative; width: 100%; background: #000; border-radius: 2px; overflow: hidden; }
.film video { width: 100%; height: 100%; display: block; object-fit: contain; }
.film .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: rgba(0,0,0,.25); transition: opacity .4s var(--ease);
}
.film .play span { padding: 11px 18px 10px; border-radius: 99px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); }
.film.playing .play { opacity: 0; pointer-events: none; }
.credits { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 var(--gut); margin: 34px 0 40px; }
.credits section { border-top: 1px solid var(--line); padding: 12px 0 18px; }
.credits h4 { margin: 0 0 12px; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; }
.credits dl { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 16px; margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; }
.credits dt { color: var(--fg-2); }
.credits dd { margin: 0; }
.w-grid { --h: clamp(180px, 26vw, 420px); padding: 0; }
.w-grid .tile { cursor: zoom-in; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .badge { position: absolute; left: 10px; bottom: 9px; font-size: 10px; color: rgba(232,223,206,.8); }
.w-nav { display: flex; justify-content: space-between; margin-top: 60px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--fg-2); }
.w-nav a:hover { color: var(--fg); }

/* ——— about ——— */
#about-bg {
  position: fixed; inset: -8%; width: 116%; height: 116%; object-fit: cover; z-index: 0; pointer-events: none;
  filter: blur(28px) brightness(.5) saturate(1.2); opacity: 0; transition: opacity 1.2s var(--ease);
}
#about-bg.on { opacity: 1; }
.about { position: relative; padding: 130px var(--gut) 100px; max-width: 1300px; }
.about-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; margin-top: 56px; }
.lede { font-size: clamp(18px, 1.8vw, 24px); line-height: 1.32; margin: 0; max-width: 34em; }
.about h3 { font-size: 11px; font-weight: 500; color: var(--fg-2); margin: 0 0 8px; }
.about p { margin: 0 0 28px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 24px; }
/* disponibilità: pallino che "respira" */
.avail { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.avail i { position: relative; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #39ff8a; }
/* alone morbido che respira (sfocato, nessun bordo netto) */
.avail i::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; background: #39ff8a;
  filter: blur(5px); opacity: .55; animation: breathe 2.8s ease-in-out infinite;
}
.avail.booked i { background: #c0231e; }
.avail.booked i::after { background: #c0231e; animation: none; opacity: .35; }
@keyframes breathe { 50% { opacity: .12; transform: scale(1.5); } }
/* on set */
.onset { margin-top: 70px; border-top: 1px solid var(--line); padding-top: 14px; }
.onset h2 { font-size: 11px; font-weight: 500; color: var(--fg-2); margin: 0 0 22px; }
#onset { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-items: start; }
.bts { width: 100%; }
/* proporzione 4:5 fissa con padding (indipendente dal contenuto) */
.bts { margin: 0; position: relative; height: 0; padding-bottom: 125%; overflow: hidden; border-radius: 2px; background: #141416; }
.bts img, .bts video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.9) contrast(1.05); }
.bts figcaption { position: absolute; left: 10px; bottom: 9px; right: 10px; font-size: 10px; color: rgba(232,223,206,.75); }
.bts.blank span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.bts.blank { border: 1px dashed rgba(232,223,206,.18); background: rgba(20,20,22,.4); color: var(--fg-2); }
.worked { margin-top: 70px; border-top: 1px solid var(--line); padding-top: 14px; }
.worked h2 { font-size: 11px; font-weight: 500; color: var(--fg-2); margin: 0 0 22px; }
#clients { display: grid; grid-template-columns: 9em 1fr; gap: 6px var(--gut); align-items: baseline; }
#clients > div { display: contents; }
#clients h3 { margin: 0; }
#clients b { font-weight: inherit; white-space: nowrap; }
#clients p { margin: 0 0 18px; font-size: clamp(17px, 1.6vw, 22px); line-height: 1.45; text-transform: uppercase; letter-spacing: .01em; }
#clients i { font-style: normal; color: var(--fg-2); margin: 0 .5em; font-weight: 300; }
.about a { border-bottom: 1px solid var(--line); }
.about a:hover { border-color: var(--fg); }
#clock { color: var(--fg-2); margin-left: 6px; }

/* ——— cursore custom (immagini generate in app.js) ——— */
html.has-cur, html.has-cur * { cursor: var(--cur-dot) !important; }
html.has-cur :is(a, button, .seg button, #pfilters button) { cursor: var(--cur-ring) !important; }
html.has-cur :is(#grid .tile, #grid .tile *, .plist a, .plist a *, .w-grid .tile, .w-grid .tile *) { cursor: var(--cur-view) !important; }
html.has-cur :is(.film, .film *) { cursor: var(--cur-play) !important; }
html.has-cur #spectrum { cursor: var(--cur-cross) !important; }
html.has-cur #lightbox video { cursor: var(--cur-dot) !important; }

/* video decorativi: niente comandi di sistema (Safari mostra play/pausa al centro) */
:is(.hv, .hero-v, #about-bg, .w-grid video, .bts video)::-webkit-media-controls,
:is(.hv, .hero-v, #about-bg, .w-grid video, .bts video)::-webkit-media-controls-panel,
:is(.hv, .hero-v, #about-bg, .w-grid video, .bts video)::-webkit-media-controls-overlay-play-button,
:is(.hv, .hero-v, #about-bg, .w-grid video, .bts video)::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; opacity: 0; }
:is(.hv, .hero-v, #about-bg, .bts video) { pointer-events: none; }

/* ——— animazioni ——— */
/* le pagine entrano in dissolvenza */
.view.enter { animation: viewIn .7s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }
/* i frame si "sviluppano" quando entrano nello schermo: da sfocati e sovraesposti a nitidi */
.rv { opacity: 0; transform: translateY(22px) scale(.985); filter: blur(12px) brightness(1.7) saturate(.6);
  transition: opacity .9s var(--ease), transform 1.1s var(--ease), filter 1.3s var(--ease); transition-delay: var(--d, 0ms); }
.rv.in { opacity: 1; transform: none; filter: none; }
/* titoli: le righe salgono da sotto */
.lines .ln { display: block; overflow: hidden; padding-bottom: .05em; margin-bottom: -.05em; }
.lines .ln > span { display: inline-block; animation: lineUp 1.05s var(--ease) both; }
.lines .ln:nth-child(2) > span { animation-delay: .1s; }
.lines .ln:nth-child(3) > span { animation-delay: .2s; }
@keyframes lineUp { from { transform: translateY(108%); } }
/* hero: il nome sale, poi le didascalie */
.marquee { animation: rise 1.5s .15s var(--ease) both; }
.hero-foot { animation: fade 1.2s .9s both; }
@keyframes rise { from { opacity: 0; transform: translateY(45%); } }
@keyframes fade { from { opacity: 0; } }
/* visore */
#lightbox:not([hidden]) { animation: fade .35s both; }
#lightbox:not([hidden]) .lb-stage > * { animation: lbIn .6s var(--ease) both; }
@keyframes lbIn { from { opacity: 0; transform: scale(.96); filter: blur(10px); } }

/* contenuti ancora da caricare */
.empty-note { color: var(--fg-2); text-align: center; padding: 8vh var(--gut) 22vh; margin: 0; }
.pro .empty-note { text-align: left; padding: 40px 0; }
/* descrizione del progetto */
.w-desc { max-width: 38em; margin: 18px 0 0; color: var(--fg-2); font-size: clamp(15px, 1.25vw, 18px); line-height: 1.45; }
.w-head { flex-direction: column; align-items: flex-start; }

/* ——— lightbox ——— */
#lightbox {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  background: rgba(11,11,12,.72); backdrop-filter: blur(30px) saturate(1.2); -webkit-backdrop-filter: blur(30px) saturate(1.2);
}
.lb-stage { width: min(92vw, 1600px); height: 82vh; display: flex; align-items: center; justify-content: center; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; display: block; border-radius: 2px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.lb-close { position: absolute; top: 20px; right: var(--gut); color: var(--fg-2); }
.lb-close:hover { color: var(--fg); }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--fg-2); padding: 20px; }
.lb-prev { left: 0; } .lb-next { right: 0; }
.lb-prev:hover, .lb-next:hover { color: var(--fg); }
.lb-count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: var(--fg-2); }

/* ——— mobile ——— */
@media (max-width: 720px) {
  :root { --h: 92px; }
  #grid .tile.wide { flex-basis: 100%; }
  .top { padding-top: 14px; }
  .wordmark { font-size: 13px; }
  .grid { gap: 4px; padding-top: 12px; }
  body.on-home .wordmark { display: none; }
  .top { justify-content: flex-end; }
  body:not(.on-home) .top { justify-content: space-between; }
  #ppreview { display: none; }
  .work, .about { padding-top: 96px; }
  .w-grid { --h: 92px; }
  .w-grid .tile:nth-child(3n+1) { flex-basis: 100%; }
  .about-cols { grid-template-columns: 1fr; }
  #clients { grid-template-columns: 1fr; }
  #onset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pills a { padding: 9px 12px 8px; font-size: 12px; }
  .top-role { display: none; }
  .seg button { padding: 5px 9px 4px; }
  .hero-foot span:first-child { display: none; }
  .pro { padding-top: 84px; }
  .pro-filters { flex-direction: column; gap: 8px; }
  .plist a { grid-template-columns: 30px 1fr auto; font-size: 13px; }
  .plist .c:nth-child(3), .plist .c:nth-child(4) { display: none; }
  .seg button { padding: 6px 9px 5px; }
  .picker-pill { padding: 9px 12px 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; filter: none; }
  .lines .ln > span, .marquee, .hero-foot, .view.enter, .avail i::after { animation: none; }
  #ambient i { animation: none; }
  * { transition-duration: .01ms !important; }
}
