:root {
  --bg: #fbf9ef;
  --ink: #161411;
  --muted: #8b877c;
  --soft: #edeadf;
  --line: #e2ded1;
  --accent: #ff4d1f;
  --rail: 96px;
  --pad: clamp(16px, 2.4vw, 36px);
  --radius: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --text: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading, body.sheet-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img, video { display: block; width: 100%; height: auto; }
em { font-style: normal; color: var(--muted); }
::selection { background: var(--accent); color: #fff; }

/* ---------- sipario d'ingresso ---------- */
.curtain {
  position: fixed; inset: 0; z-index: 100;
  background: var(--ink); color: var(--bg);
  display: flex; align-items: flex-end; padding: var(--pad);
  font-family: var(--display); font-weight: 800;
  font-size: clamp(40px, 9vw, 150px); letter-spacing: -.04em; line-height: 1;
  transition: transform 1s var(--ease) .15s;
}
.curtain span { display: block; transform: translateY(110%); animation: up .9s var(--ease) forwards; }
body:not(.is-loading) .curtain { transform: translateY(-100%); }
@keyframes up { to { transform: none; } }

/* ---------- menu laterale ---------- */
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 40;
  width: var(--rail);
  padding: 22px 0 22px 24px;
  display: flex; flex-direction: column; gap: 40px;
}
.rail-logo {
  font-family: var(--display); font-weight: 800;
  font-size: 15px; line-height: .95; letter-spacing: -.03em;
}
.rail-nav { display: flex; flex-direction: column; gap: 10px; margin-top: auto; margin-bottom: auto; }
.rail-nav a {
  position: relative;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--soft);
  display: grid; place-items: center;
  transition: background .35s var(--ease), transform .35s var(--ease);
}
.rail-nav svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; transition: stroke .3s; }
.rail-nav svg .fill { fill: var(--ink); stroke: none; transition: fill .3s; }
/* etichetta che esce al passaggio del mouse */
.rail-nav a::after {
  content: attr(data-label);
  position: absolute; left: calc(100% + 10px); top: 50%;
  white-space: nowrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  background: var(--ink); color: var(--bg);
  padding: 7px 10px; border-radius: 8px;
  opacity: 0; transform: translate(-8px, -50%);
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.rail-nav a:hover, .rail-nav a.is-active { background: var(--ink); }
.rail-nav a:hover svg, .rail-nav a.is-active svg { stroke: var(--bg); }
.rail-nav a:hover svg .fill, .rail-nav a.is-active svg .fill { fill: var(--bg); }
.rail-nav a:hover::after { opacity: 1; transform: translate(0, -50%); }
.rail-nav a:active { transform: scale(.94); }

main { padding-left: var(--rail); padding-right: var(--pad); }

/* ---------- testo che sale parola per parola ---------- */
/* il riquadro di ogni parola ha margine sopra e sotto: accenti e discendenti (g, p, à) non vengono tagliati */
/* ingresso dei titoli come brandappart: ogni parola sale e si raddrizza in 3D (niente ritagli, lettere intere) */
.split { perspective: 500px; }
.split .w { display: inline-block; vertical-align: top; }
.split .w > span {
  display: inline-block; opacity: 0;
  transform: translateY(50%) rotateX(-35deg); transform-origin: 50% 100%;
  transition: transform 1.1s var(--ease), opacity .9s var(--ease);
  transition-delay: calc(var(--i) * 55ms);
}
.split.in .w > span { opacity: 1; transform: none; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- apertura ---------- */
.hero { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; padding-top: 60px; }
.hero-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(52px, 9.6vw, 160px);
  line-height: .96; letter-spacing: -.04em;
  max-width: 11.5ch;
  margin-left: auto; text-align: right;
}
.hero-title sup { font-size: .32em; vertical-align: top; position: relative; top: .25em; color: var(--accent); display: inline-block; animation: spin 12s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-foot {
  margin-top: 56px; margin-left: auto; max-width: 520px;
  display: flex; flex-direction: column; gap: 22px; align-items: flex-start;
  font-size: clamp(18px, 1.6vw, 23px); line-height: 1.25;
}
.pill {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  padding: 12px 16px; border-radius: 99px; background: var(--ink); color: var(--bg);
  transition: transform .4s var(--ease), background .3s;
}
.pill:hover { background: var(--accent); transform: translateY(-2px); }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transition: background .3s; }
.pill:hover .pill-dot { background: var(--bg); }

/* ---------- clienti in scorrimento ---------- */
.marquee {
  overflow: hidden; padding: 26px 0; margin-top: 30px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; gap: 56px; width: max-content; animation: marquee 40s linear infinite; }
.marquee-track span { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.03em; color: var(--muted); white-space: nowrap; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- showreel che si allarga ---------- */
.reel { padding: 80px 0 40px; }
.reel-frame {
  --p: 0;
  position: relative; overflow: hidden;
  border-radius: calc(var(--radius) + (1 - var(--p)) * 18px);
  margin: 0 calc((1 - var(--p)) * 9vw);
  background: var(--ink);
  aspect-ratio: 16 / 9; max-height: 90vh;
  will-change: margin, border-radius;
}
.reel-frame video { width: 100%; height: 100%; object-fit: cover; transform: scale(calc(1.12 - var(--p) * .12)); }
.reel-sound {
  position: absolute; left: 18px; bottom: 18px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: var(--bg); padding: 10px 14px; border-radius: 99px;
  transition: background .3s, color .3s;
}
.reel-sound:hover { background: var(--accent); color: #fff; }

/* ---------- titoli grandi ---------- */
.big-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(46px, 8.2vw, 136px); line-height: .98; letter-spacing: -.04em;
  text-align: center; margin: 120px auto 28px;
}
.works-intro { text-align: center; max-width: 30em; margin: 0 auto 56px; font-size: 19px; color: var(--muted); }

/* ---------- griglia a schede ---------- */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.card {
  position: relative; overflow: hidden; cursor: pointer;
  border-radius: var(--radius); background: var(--ink); color: var(--bg);
  grid-column: span 6; aspect-ratio: 4 / 5;
  opacity: 0; transform: translateY(50px) scale(.98);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.card.in { opacity: 1; transform: none; }
.card.wide { grid-column: span 12; aspect-ratio: 16 / 8; }
.card.third { grid-column: span 4; aspect-ratio: 3 / 4; }
.card.half { aspect-ratio: 4 / 3; }
.card.half.tall { aspect-ratio: 4 / 5; }
.card.quarter { grid-column: span 3; aspect-ratio: 9 / 16; }
.card.quarter .card-foot p { font-size: 13px; }
.card-media, .card-media img, .card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-media { transition: transform 1.2s var(--ease); }
.card:hover .card-media { transform: scale(1.045); }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.28), transparent 30%, transparent 62%, rgba(0,0,0,.55)); pointer-events: none; }
.chip {
  position: absolute; left: 14px; top: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(22, 20, 17, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--bg); padding: 7px 10px; border-radius: 8px;
}
.chip b { font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: -.02em; text-transform: uppercase; }
.chip small { font-family: var(--mono); font-size: 9.5px; line-height: 1.15; letter-spacing: .06em; text-transform: uppercase; opacity: .7; }
.card-foot {
  position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
}
.card-foot p { font-size: 15px; line-height: 1.3; max-width: 30em; opacity: .9; }
.card-open {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: var(--bg); color: var(--ink);
  display: grid; place-items: center; font-size: 18px;
  transform: scale(.6) rotate(-45deg); opacity: 0;
  transition: transform .5s var(--ease), opacity .4s var(--ease);
}
.card:hover .card-open { transform: none; opacity: 1; }

/* scheda di testo / numeri */
.card.note { background: var(--accent); color: #fff; cursor: default; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; }
.card.note::after { display: none; }
.card.note .kicker { color: rgba(255,255,255,.75); }
.card.note blockquote { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 2.6vw, 38px); line-height: 1.08; letter-spacing: -.025em; }
.card.note .stats { display: flex; gap: 28px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.card.note .stats b { display: block; font-family: var(--display); font-size: 44px; letter-spacing: -.04em; line-height: 1; margin-bottom: 4px; }

/* ---------- about ---------- */
.about { padding: 160px 0 40px; max-width: 1180px; margin-left: auto; }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.statement { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 3.9vw, 62px); line-height: 1.08; letter-spacing: -.03em; }
.about-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; margin-top: 70px; }
.facts { list-style: none; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 6.5em 1fr; padding: 13px 0 12px; border-bottom: 1px solid var(--line); font-size: 16px; }
.facts b { font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--muted); padding-top: 3px; }
.skills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.skills li { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 9px 12px; border-radius: 99px; background: var(--soft); }

/* ---------- contatti ---------- */
.contact { padding: 180px 0 30px; }
.contact-big {
  display: block; font-family: var(--display); font-weight: 800;
  font-size: clamp(48px, 8.6vw, 144px); line-height: .98; letter-spacing: -.04em;
  transition: color .4s;
}
.contact-big:hover { color: var(--accent); }
.contact-row { display: flex; flex-wrap: wrap; gap: 14px 36px; margin-top: 70px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; }
.contact-row span { margin-left: auto; color: var(--muted); }
.contact-row a:hover { color: var(--accent); }

/* ---------- dettaglio progetto (pannello a schermo pieno) ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform .9s var(--ease);
  display: flex; flex-direction: column;
}
.sheet.open { transform: none; }
.sheet-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--pad); border-bottom: 1px solid var(--line);
}
.sheet-chip { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sheet-close {
  font: inherit; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--ink); color: var(--bg); border: 0; border-radius: 99px; padding: 10px 14px; cursor: pointer;
  display: inline-flex; gap: 10px; align-items: center; transition: background .3s;
}
.sheet-close:hover { background: var(--accent); }
.sheet-body { overflow-y: auto; flex: 1; padding: 0 var(--pad) 120px; overscroll-behavior: contain; }

.d-head { padding: 70px 0 30px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; align-items: end; border-bottom: 1px solid var(--line); }
.d-title { grid-column: 1 / 9; font-family: var(--display); font-weight: 800; font-size: clamp(42px, 6.6vw, 112px); line-height: .98; letter-spacing: -.04em; }
.d-meta { grid-column: 9 / 13; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.d-meta span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.d-meta a { color: var(--accent); }
.d-body { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; padding-top: 28px; align-items: start; }
.d-aside { grid-column: 1 / 4; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 20px; }
.d-desc { font-size: 16px; line-height: 1.4; }
.d-credits dt { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.d-credits dd { font-size: 15px; margin-bottom: 10px; }
.d-hero { grid-column: 4 / 13; }
.d-hero .media { border-radius: var(--radius); overflow: hidden; width: fit-content; max-width: 100%; }
.d-hero .media img, .d-hero .media video { width: auto; max-width: 100%; max-height: 82vh; }
.d-group { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-top: 80px; align-items: start; }
.d-label { grid-column: 1 / 4; position: sticky; top: 20px; }
.d-label b { display: block; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.05; letter-spacing: -.03em; }
.d-label span { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.d-gallery { grid-column: 4 / 13; display: flex; flex-wrap: wrap; gap: 10px; --row-h: 280px; }
.d-gallery::after { content: ""; flex-grow: 999; }
.d-gallery .media { flex-grow: var(--ar, 1); flex-basis: calc(var(--row-h) * var(--ar, 1)); aspect-ratio: var(--ar, 1); border-radius: 8px; overflow: hidden; }
.d-brand { grid-column: 4 / 13; display: block; position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.d-brand img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: object-position 14s linear; }
.d-brand:hover img { object-position: 50% 100%; }
.d-brand span { position: absolute; left: 14px; bottom: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; background: var(--bg); padding: 8px 12px; border-radius: 99px; }

.media { position: relative; background: var(--soft); cursor: zoom-in; }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media .play { position: absolute; left: 8px; bottom: 8px; font-family: var(--mono); font-size: 10px; color: #fff; mix-blend-mode: difference; pointer-events: none; }
.d-anim { opacity: 0; transform: translateY(30px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.d-anim.in { opacity: 1; transform: none; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(22, 20, 17, .94); display: flex; align-items: center; justify-content: center; padding: 50px var(--pad); animation: fade .35s var(--ease); }
.lightbox[hidden] { display: none; }
.lb-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.lb-stage img, .lb-stage video { width: auto; height: auto; max-width: 100%; max-height: 100%; border-radius: 8px; }
.lb-close { position: absolute; top: 14px; right: var(--pad); width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg); cursor: pointer; font-size: 15px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  :root { --rail: 0px; }
  body { font-size: 16px; }
  .rail { top: auto; width: auto; right: 0; padding: 10px; flex-direction: row; justify-content: center; pointer-events: none; }
  .rail-logo { position: fixed; top: 14px; left: var(--pad); pointer-events: auto; background: rgba(251, 249, 239, .85); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 6px 8px; border-radius: 8px; margin-left: -8px; }
  .rail-nav { flex-direction: row; margin: 0; padding: 6px; gap: 6px; border-radius: 16px; background: rgba(251, 249, 239, .85); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 6px 30px rgba(0,0,0,.08); pointer-events: auto; }
  .rail-nav a { width: 44px; height: 44px; }
  .rail-nav a::after { display: none; }
  main { padding: 0 var(--pad); }
  .hero { min-height: 86vh; }
  .hero-title, .hero-foot { margin-left: 0; text-align: left; }
  .card, .card.wide, .card.third, .card.half { grid-column: span 12; aspect-ratio: 4 / 5; }
  .card.quarter { grid-column: span 6; aspect-ratio: 9 / 16; }
  .card-open { opacity: 1; transform: none; }
  .about-cols { grid-template-columns: 1fr; }
  .contact-row span { margin-left: 0; }
  .contact { padding-bottom: 100px; }
  .d-title, .d-meta, .d-aside, .d-hero, .d-label, .d-gallery, .d-brand { grid-column: 1 / 13; }
  .d-aside, .d-label { position: static; }
  .d-gallery { --row-h: 140px; }
  .d-group { margin-top: 48px; }
}

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

/* ---------- scroll fluido (Lenis) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- menu dei lavori ---------- */
.works-menu {
  position: fixed; z-index: 45; top: 12px; bottom: 12px; left: calc(var(--rail) + 6px);
  width: min(460px, calc(100vw - var(--rail) - 20px));
  background: var(--ink); color: var(--bg); border-radius: 18px;
  padding: 22px 22px 18px; overflow-y: auto;
  display: flex; flex-direction: column;
  clip-path: inset(0 100% 0 0 round 18px);
  transition: clip-path .7s var(--ease);
}
.works-menu.open { clip-path: inset(0 0 0 0 round 18px); }
.wm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.works-menu .kicker { color: rgba(251, 249, 239, .55); margin: 0; }
.wm-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(251,249,239,.1); color: var(--bg); cursor: pointer; font-size: 14px; transition: background .3s; }
.wm-close:hover { background: var(--accent); }
.wm-list { list-style: none; }
.wm-list li { opacity: 0; transform: translateX(-24px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(.12s + var(--i) * 45ms); }
.works-menu.open .wm-list li { opacity: 1; transform: none; }
.wm-list a {
  display: grid; grid-template-columns: 2.2em 1fr auto; align-items: baseline; gap: 8px;
  padding: 12px 0 11px; border-bottom: 1px solid rgba(251, 249, 239, .12);
  transition: padding .4s var(--ease), color .3s;
}
.wm-list a:hover { padding-left: 10px; color: var(--accent); }
.wm-list .n { font-family: var(--mono); font-size: 11px; color: rgba(251,249,239,.45); }
.wm-list .t { font-family: var(--display); font-weight: 700; font-size: 25px; line-height: 1.1; letter-spacing: -.025em; }
.wm-list .y { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: rgba(251,249,239,.45); text-align: right; }
.wm-list .g { grid-column: 2 / 4; font-size: 13px; color: rgba(251,249,239,.55); margin-top: 2px; }
.wm-sub { margin-top: 26px !important; margin-bottom: 4px !important; }
.wm-grid { margin-top: auto; padding-top: 22px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(251,249,239,.7); }
.wm-grid:hover { color: var(--accent); }
.wm-scrim { position: fixed; inset: 0; z-index: 44; background: rgba(22,20,17,.18); opacity: 0; pointer-events: none; transition: opacity .5s var(--ease); }
.wm-scrim.open { opacity: 1; pointer-events: auto; }
/* anteprima che segue il mouse sulla lista */
.wm-preview {
  position: fixed; z-index: 46; left: 0; top: 0; width: 240px; aspect-ratio: 4 / 5;
  border-radius: 12px; overflow: hidden; pointer-events: none; background: #222;
  opacity: 0; transform: translate(-50%, -50%) scale(.85); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.wm-preview.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.wm-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- indicatore laterale di scorrimento ---------- */
.scroll-progress {
  position: fixed; z-index: 30; right: 22px; top: 50%; height: 230px; transform: translateY(-50%);
  width: 12px; display: flex; flex-direction: column; align-items: center;
}
.sp-line { width: 1px; background: rgba(0, 0, 0, .12); flex: none; }
.sp-top { height: calc(var(--sp, 0) * 218px); }
.sp-bottom { flex: 1; }
.sp-cursor { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); display: grid; place-items: center; flex: none; }
.sp-cursor i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink); }

/* ---------- elementi fissi ---------- */
.top-cta {
  position: fixed; z-index: 30; top: 18px; right: 22px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 99px; transition: background .3s, transform .4s var(--ease);
}
.top-cta:hover { background: var(--accent); transform: translateY(-2px); }
.clock { position: fixed; z-index: 30; right: 22px; bottom: 18px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.clock b { color: var(--ink); font-weight: 500; }
.float-cta {
  position: fixed; z-index: 35; left: 50%; bottom: 18px;
  display: flex; align-items: center; gap: 18px;
  background: var(--ink); color: var(--bg); padding: 8px 8px 8px 20px; border-radius: 99px;
  box-shadow: 0 10px 40px rgba(0,0,0,.18);
  transform: translate(-50%, 140%); transition: transform .8s var(--ease);
}
.float-cta.show { transform: translate(-50%, 0); }
.float-cta span { font-size: 15px; white-space: nowrap; }
.float-cta b { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 99px; }
body.sheet-open .float-cta, body.menu-open .float-cta { transform: translate(-50%, 140%); }

/* ---------- cursore personalizzato ---------- */
.cursor-dot, .cursor-label { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; }
.cursor-dot { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; mix-blend-mode: difference; transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease); }
.cursor-dot.big { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
.cursor-label {
  display: flex; align-items: center; gap: 10px; margin: 16px 0 0 16px;
  background: var(--accent); color: #fff; border-radius: 99px; padding: 9px 14px;
  font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap;
  opacity: 0; transform: scale(.6); transform-origin: 0 0; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.cursor-label.show { opacity: 1; transform: scale(1); }
.cursor-label i { font-style: normal; }
@media (hover: none), (max-width: 860px) { .cursor-dot, .cursor-label { display: none; } }
@media (hover: hover) and (min-width: 861px) { .card, .card *, .wm-list a, .s-tile, .s-tile * { cursor: none; } }

/* ---------- mockup dispositivi (in CSS, niente immagini) ---------- */
.devices { padding-bottom: 40px; }
.device-stage { position: relative; max-width: 1180px; margin: 0 auto; padding: 40px 0 80px; min-height: 640px; }
.devices figcaption { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 16px; text-align: center; }
.mac { width: 78%; margin-right: auto; }
.mac-screen {
  position: relative; aspect-ratio: 16 / 10; background: #0b0b0b;
  border-radius: 18px 18px 0 0; padding: 2.2% 2.2% 3.4%;
  box-shadow: inset 0 0 0 2px #2a2a2a, 0 30px 60px -20px rgba(0,0,0,.35);
}
.mac-screen::before { content: ""; position: absolute; top: 0; left: 50%; width: 13%; height: 3.2%; background: #0b0b0b; border-radius: 0 0 8px 8px; transform: translateX(-50%); z-index: 2; }
.mac-screen video { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; background: #111; }
.mac-base {
  position: relative; height: 0; padding-bottom: 3.2%; margin: 0 -7%;
  background: linear-gradient(180deg, #e3e3e0, #b9b9b5 70%, #8f8f8b);
  border-radius: 0 0 22px 22px / 0 0 60% 60%;
}
.mac-base::before { content: ""; position: absolute; top: 0; left: 50%; width: 16%; height: 35%; transform: translateX(-50%); background: #a6a6a2; border-radius: 0 0 10px 10px; }
.phone { position: absolute; width: 22%; }
.phone-a { right: 15%; top: 18%; }
.phone-b { right: 0; top: 2%; }
.phone-screen {
  position: relative; aspect-ratio: 9 / 19.5; background: #0b0b0b;
  border-radius: 17% / 8%; padding: 4.2%;
  box-shadow: inset 0 0 0 2px #2c2c2c, 0 0 0 3px #c9c9c4, 0 30px 60px -18px rgba(0,0,0,.4);
}
.phone-screen::before { content: ""; position: absolute; top: 3.6%; left: 50%; width: 30%; height: 3.6%; background: #000; border-radius: 99px; transform: translateX(-50%); z-index: 2; }
.phone-screen video { width: 100%; height: 100%; object-fit: cover; border-radius: 13% / 6%; background: #111; }
.devices .reveal { transition-duration: 1.2s; }

@media (max-width: 860px) {
  .scroll-progress, .clock { display: none; }
  .top-cta { top: 14px; right: var(--pad); }
  .works-menu { left: 10px; right: 10px; width: auto; top: auto; bottom: 76px; max-height: 70vh; clip-path: inset(100% 0 0 0 round 18px); }
  .works-menu.open { clip-path: inset(0 0 0 0 round 18px); }
  .wm-preview { display: none; }
  .float-cta { bottom: 80px; }
  .float-cta span { display: none; }
  .float-cta { padding: 6px; }
  .device-stage { min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .mac { grid-column: 1 / 3; width: 100%; }
  .phone { position: static; width: auto; }
}

/* ---------- social: un nastro per cliente ---------- */
.social { padding-bottom: 40px; }
.s-row { margin-top: 70px; }
.s-head {
  display: grid; grid-template-columns: 3.2em 1fr auto; gap: 18px; align-items: end;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.s-num { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-bottom: 6px; }
.s-title { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 3.6vw, 56px); line-height: 1; letter-spacing: -.035em; }
.s-meta { display: flex; gap: 14px 22px; flex-wrap: wrap; margin-top: 10px; font-size: 15px; color: var(--muted); }
.s-meta b { font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); padding-top: 3px; }
.s-arrows { display: flex; gap: 8px; }
.s-arrows button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--soft); color: var(--ink); font-size: 17px;
  transition: background .3s, color .3s, transform .3s var(--ease);
}
.s-arrows button:hover { background: var(--ink); color: var(--bg); }
.s-arrows button:active { transform: scale(.92); }
.s-strip {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin-right: calc(var(--pad) * -1); padding-right: var(--pad);
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.s-strip::-webkit-scrollbar { display: none; }
.s-tile {
  position: relative; flex: none; width: clamp(170px, 17vw, 250px); aspect-ratio: 9 / 16;
  border-radius: 10px; overflow: hidden; background: var(--soft); cursor: zoom-in;
  scroll-snap-align: start;
  opacity: 0; transform: translateY(30px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--i) * 60ms);
}
.s-row.in .s-tile { opacity: 1; transform: none; }
.s-tile img, .s-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.s-tile:hover img, .s-tile:hover video { transform: scale(1.05); }
.s-tile .kind {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(22,20,17,.7); color: var(--bg); padding: 4px 7px; border-radius: 6px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
@media (max-width: 860px) {
  .s-head { grid-template-columns: 1fr auto; }
  .s-num { display: none; }
  .s-tile { width: 42vw; }
}

/* anteprima social in home: un reel per cliente */
.s-teaser { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.s-teaser .s-tile { width: auto; cursor: pointer; }
.s-teaser.in .s-tile, .s-teaser .s-tile.in { opacity: 1; transform: none; }
.s-teaser .s-tile .kind { font-size: 10px; text-transform: none; letter-spacing: 0; font-family: var(--display); font-weight: 700; }
.s-cta-wrap { display: flex; justify-content: center; margin-top: 34px; }
.sheet .s-row:first-of-type { margin-top: 40px; }
@media (max-width: 860px) {
  .s-teaser { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-right: calc(var(--pad) * -1); scrollbar-width: none; }
  .s-teaser .s-tile { width: 42vw; }
}

/* ---------- "Cosa faccio": mazzo di schede bloccato sullo schermo ---------- */
.deck { padding-top: 40px; }
.deck-wrap { position: relative; height: calc(var(--n, 4) * 85vh + 20vh); margin-top: 30px; }
.deck-sticky { position: sticky; top: 9vh; height: 82vh; perspective: 1200px; }
.deck-card {
  position: absolute; inset: 0; margin: 0 auto; max-width: 1080px;
  border-radius: 14px; color: #fff; padding: clamp(22px, 3vw, 42px);
  display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: auto 1fr auto; gap: 18px 30px;
  transform-origin: 50% 0; will-change: transform;
  box-shadow: 0 -10px 40px rgba(0,0,0,.08);
}
.deck-card h3 { grid-column: 1; font-family: var(--display); font-weight: 800; font-size: clamp(30px, 4.2vw, 64px); line-height: 1; letter-spacing: -.035em; }
.deck-card .dc-num { grid-column: 2; justify-self: end; font-family: var(--display); font-weight: 500; font-size: clamp(22px, 2.4vw, 34px); opacity: .7; }
.deck-card p { grid-column: 1; font-size: clamp(16px, 1.35vw, 20px); line-height: 1.35; opacity: .85; max-width: 34em; align-self: start; }
.deck-card .dc-thumbs { grid-column: 1 / 3; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-self: end; }
.deck-card .dc-thumbs div { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.12); }
.deck-card .dc-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.deck-card .dc-cta { grid-column: 2; grid-row: 2; justify-self: end; align-self: start; }
.deck-card .dc-cta a { display: inline-flex; gap: 10px; align-items: center; background: #fff; color: var(--ink); border-radius: 99px; padding: 11px 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; transition: transform .4s var(--ease); }
.deck-card .dc-cta a:hover { transform: translateY(-2px); }

/* ---------- About: foto sparse che si muovono in profondità ---------- */
.about { position: relative; }
/* sezione staccata dalle vicine, con tanto spazio sopra e sotto */
.floaters-sec { padding: 240px 0 200px; }
/* spazio 3D unico: testo a profondità 0, foto davanti (z > 0) e dietro (z < 0); il browser le ordina da solo */
.floaters { position: relative; height: clamp(380px, 48vw, 680px); margin: 0 auto; perspective: 1100px; transform-style: preserve-3d; }
.floaters .big-word {
  position: absolute; left: 50%; top: 50%; text-align: center; white-space: nowrap;
  margin: 0; pointer-events: none; transform: translate(-50%, -50%) translateZ(0);
  font-family: var(--display); font-weight: 800; color: #8f8778;
  font-size: clamp(60px, 11vw, 190px); line-height: .95; letter-spacing: -.045em;
}
.floater {
  position: absolute; border-radius: 12px; overflow: hidden; background: var(--soft);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.35); will-change: transform;
}
.floater .fl-in { width: 100%; height: 100%; animation: floaty 6s ease-in-out infinite alternate; }
.floater img { width: 100%; height: 100%; object-fit: cover; }
@keyframes floaty {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { transform: translate3d(8px, -18px, 0) rotate(1.8deg); }
  100% { transform: translate3d(-6px, 10px, 0) rotate(-1.4deg); }
}

/* ---------- "Tutti i lavori": cerchio di schede che ruota ---------- */
.ring { background: var(--ink); color: var(--bg); margin: 120px calc(var(--pad) * -1) 0; border-radius: 22px; overflow: hidden; position: relative; height: 150vh; }
.ring-sticky { position: sticky; top: 0; height: 100vh; display: grid; place-items: center; overflow: hidden; }
.ring-center { position: relative; z-index: 3; text-align: center; font-family: var(--display); font-weight: 800; font-size: clamp(56px, 9vw, 150px); line-height: .9; letter-spacing: -.045em; color: #8f8778; transition: color .4s; }
.ring-center:hover { color: var(--bg); }
.ring-center small { display: block; font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: rgba(251,249,239,.55); margin-top: 18px; }
.ring-list { position: absolute; left: 50%; top: 50%; width: 0; height: 0; will-change: transform; }
.ring-item {
  position: absolute; left: 0; top: 0; width: clamp(120px, 14vw, 210px); aspect-ratio: 1;
  margin: calc(clamp(120px, 14vw, 210px) / -2) 0 0 calc(clamp(120px, 14vw, 210px) / -2);
  border-radius: 14px; overflow: hidden; background: #222;
  transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) rotate(var(--tilt)) scale(var(--s, 0));
  transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 40ms);
}
.ring.in .ring-item { --s: 1; }
.ring-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.ring-item:hover img { transform: scale(1.08); }
@media (max-width: 860px) {
  .deck-card { grid-template-columns: 1fr; }
  .deck-card .dc-num, .deck-card .dc-cta { grid-column: 1; justify-self: start; }
  .deck-card .dc-cta { grid-row: auto; }
  .deck-card .dc-thumbs { grid-column: 1; grid-template-columns: repeat(2, 1fr); }
  .deck-card .dc-thumbs div:nth-child(n+3) { display: none; }
  .ring { margin-left: calc(var(--pad) * -1); margin-right: calc(var(--pad) * -1); border-radius: 0; }
}

/* ---------- pagina myBox (Molotov stagione 2) ---------- */
.mb-intro { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; padding-top: 28px; }
.mb-intro p { grid-column: 1 / 8; font-size: clamp(18px, 1.6vw, 24px); line-height: 1.3; }
.mb-intro dl { grid-column: 9 / 13; }
.mb-intro dt { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mb-intro dd { font-size: 15px; margin-bottom: 10px; }
.mb-tabs {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap;
  padding: 14px 0; margin: 36px 0 10px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.mb-tabs button {
  font: inherit; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  border: 0; border-radius: 99px; padding: 10px 14px; cursor: pointer; background: var(--soft); color: var(--ink);
  transition: background .3s, color .3s, transform .3s var(--ease);
}
.mb-tabs button:hover { transform: translateY(-2px); }
.mb-tabs button.on { background: var(--ink); color: var(--bg); }
.mb-tabs button span { opacity: .5; margin-left: 6px; }
.mb-cat { transition: opacity .5s var(--ease), transform .5s var(--ease); }
.mb-cat.hide { display: none; }
.mb-cat.fade { opacity: 0; transform: translateY(20px); }
/* scaletta della serata */
.mb-timeline { grid-column: 4 / 13; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.mb-step { background: #161411; color: var(--bg); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 8px; min-height: 170px; }
.mb-step.red { background: #e0302a; color: #111; }
.mb-step b { font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.mb-step h4 { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.05; letter-spacing: -.02em; }
.mb-step p { font-size: 14px; line-height: 1.35; opacity: .85; }
/* keynote */
.mb-keynotes { grid-column: 4 / 13; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mb-key { position: relative; border-radius: 14px; overflow: hidden; background: #111; color: #fff; aspect-ratio: 4 / 5; cursor: pointer; }
.mb-key img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; transition: transform 1.2s var(--ease), opacity .5s; }
.mb-key:hover img { transform: scale(1.05); opacity: .9; }
.mb-key::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.75)); }
.mb-key div { position: absolute; left: 18px; right: 18px; bottom: 18px; z-index: 2; }
.mb-key small { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.mb-key h4 { font-family: var(--display); font-weight: 800; font-size: clamp(24px, 2.4vw, 36px); line-height: 1; letter-spacing: -.03em; margin: 6px 0 8px; }
.mb-key p { font-size: 14px; line-height: 1.35; opacity: .85; }
.mb-key .go { display: inline-block; margin-top: 12px; background: #fff; color: #111; border-radius: 99px; padding: 9px 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
/* keynote a schermo pieno */
.kn-overlay { position: fixed; inset: 0; z-index: 85; background: #000; display: flex; flex-direction: column; animation: fade .4s var(--ease); }
.kn-overlay[hidden] { display: none; }
.kn-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; color: #fff; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.kn-bar a, .kn-bar button { color: #fff; background: rgba(255,255,255,.12); border: 0; border-radius: 99px; padding: 8px 12px; font: inherit; cursor: pointer; margin-left: 8px; }
.kn-overlay iframe { flex: 1; width: 100%; border: 0; background: #000; }
.d-open { grid-column: 4 / 13; margin-top: 12px; }
@media (max-width: 860px) {
  .mb-intro p, .mb-intro dl, .mb-timeline, .mb-keynotes, .d-open { grid-column: 1 / 13; }
  .mb-keynotes { grid-template-columns: 1fr; }
}
@media (max-width: 860px) { .floaters-sec { padding: 140px 0 120px; } }

/* foto che girano attorno al testo: rotazione sull'asse verticale, sempre rivolte verso chi guarda */
.orbiter {
  position: absolute; left: 50%; top: calc(50% + var(--y, 0%)); aspect-ratio: 4 / 5;
  border-radius: 12px; overflow: hidden; background: var(--soft);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.35);
  animation: orbit 22s linear infinite; will-change: transform;
}
.orbiter .fl-in { width: 100%; height: 100%; animation: floaty 7s ease-in-out infinite alternate; }
.orbiter img { width: 100%; height: 100%; object-fit: cover; }
@keyframes orbit {
  from { transform: translate(-50%, -50%) rotateX(-8deg) rotateY(0deg)   translateZ(var(--r)) rotateY(0deg)    rotateX(8deg); }
  to   { transform: translate(-50%, -50%) rotateX(-8deg) rotateY(360deg) translateZ(var(--r)) rotateY(-360deg) rotateX(8deg); }
}
@media (prefers-reduced-motion: reduce) { .orbiter { animation: none; transform: translate(-50%, -50%) translateZ(var(--r)); } }
.d-meta a.d-link { display: inline-flex; align-self: flex-start; margin-top: 8px; background: #1db954; color: #fff; border-radius: 99px; padding: 10px 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.d-meta a.d-link:hover { background: var(--ink); }
.d-meta .d-award { display: inline-block; align-self: flex-start; margin-top: 6px; background: #f2c94c; color: #161411; border-radius: 99px; padding: 7px 12px; font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.d-meta a.d-link.soundcloud { background: #ff5500; }

/* testi lunghi nelle pagine progetto (Monstrous) */
.d-text { max-width: 68ch; font-size: 17px; line-height: 1.5; }
.d-text h3 { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin: 28px 0 10px; }
.d-text h3:first-child { margin-top: 0; }
.d-text p { margin-bottom: 12px; }
.d-text code { font-family: var(--mono); font-size: .85em; }
.d-prov { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; }
.d-prov dt { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.d-prov dd { word-break: break-all; }
