/* Layout: pagine separate, hero a tutto schermo con scena 3D in home,
   contenuti su colonna larga con margini ampi e schede che si inclinano in 3D. */
:root {
  --ink: #121016;         /* sfondo */
  --ink-2: #1b1821;       /* superfici */
  --ink-3: #262230;
  --paper: #f2ede6;       /* testo */
  --muted: #a39cac;
  --line: rgba(242, 237, 230, .13);
  --peach: #f0b39a;       /* accento caldo */
  --lilac: #b7a4f5;       /* accento freddo */
  --display: "Syne", "Helvetica Neue", Arial, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1240px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --radius: 18px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
main, .site-footer { overflow-x: clip; }
a, button { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font: 400 1.0625rem/1.7 var(--body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* grana leggera su tutto il sito */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1; margin: 0; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--peach); outline-offset: 4px; border-radius: 4px; }
::selection { background: var(--peach); color: var(--ink); }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(5rem, 10vw, 9rem); position: relative; }
.section-alt { background: var(--ink-2); }
h2 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
.outline { color: transparent; -webkit-text-stroke: 1.5px var(--paper); }
.eyebrow {
  display: flex; align-items: center; gap: .8rem; margin-bottom: 1.4rem;
  font-size: .74rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--peach);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; flex: none; }

/* ============ PULSANTI ============ */
.btn {
  display: inline-flex; align-items: center; gap: .7rem; padding: 1rem 1.8rem;
  border-radius: 999px; border: 1px solid var(--paper); background: var(--paper); color: var(--ink);
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; translate: var(--tx, 0) var(--ty, 0); transition: background .35s var(--ease), color .35s, border-color .35s, transform .35s var(--ease), translate .5s var(--ease);
}
.btn.magnet { transition: background .35s var(--ease), color .35s, border-color .35s, transform .35s var(--ease), translate .12s linear; }
.btn .arr { transition: transform .35s var(--ease); }
.btn:hover { background: var(--peach); border-color: var(--peach); transform: translateY(-2px); }
.btn:hover .arr { transform: translateX(4px); }
.btn-ghost { background: transparent; color: var(--paper); border-color: var(--line); }
.btn-ghost:hover { background: transparent; border-color: var(--paper); }
.link-arrow { text-decoration: none; font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.link-arrow span { display: inline-block; transition: transform .35s var(--ease); color: var(--peach); }
.link-arrow:hover span { transform: translateX(6px); }

/* ============ HEADER ============ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(1.2rem + env(safe-area-inset-top, 0px)) var(--gutter) 1.2rem;
  transition: background .4s, padding .4s, border-color .4s; border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(18, 16, 22, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-color: var(--line); padding-block: calc(.8rem + env(safe-area-inset-top, 0px)) .8rem;
}
.logo { font-family: var(--display); font-weight: 700; font-size: 1.15rem; text-decoration: none; letter-spacing: -.01em; position: relative; z-index: 2; }
.logo .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--peach); margin-left: 3px; }
.nav { display: flex; gap: clamp(1.2rem, 3vw, 2.4rem); }
.nav a {
  position: relative; text-decoration: none; font-size: .78rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted); transition: color .3s;
}
.nav a:hover, .nav a.active { color: var(--paper); }
.nav a.active::before {
  content: ""; position: absolute; left: 50%; bottom: -10px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--peach); transform: translateX(-50%);
}
.nav-toggle { display: none; position: relative; z-index: 2; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--paper); transition: transform .4s var(--ease); }
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ============ HOME: HERO 3D ============ */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; padding-block: 8rem clamp(5rem, 10vh, 8rem); }
.scene3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.has-3d .cube-wrap, .has-3d .gyro { display: none; }
.hero::before { /* luce di sfondo, visibile anche senza WebGL */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(40% 50% at 75% 40%, rgba(183, 164, 245, .20), transparent 70%),
    radial-gradient(35% 40% at 60% 70%, rgba(240, 179, 154, .16), transparent 70%);
}
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(transparent, var(--ink)); pointer-events: none; }
.hero-inner { position: relative; z-index: 1; pointer-events: none; }
.hero-inner a { pointer-events: auto; }
.hero-title { transform: perspective(1200px) rotateX(var(--hy, 0deg)) rotateY(var(--hx, 0deg)); transition: transform .8s var(--ease); font-size: clamp(3.6rem, 14vw, 12.5rem); font-weight: 800; line-height: .86; letter-spacing: -.045em; }
.hero-title .line { display: block; }
.hero-title .outline { -webkit-text-stroke-width: 2px; }
.hero-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 2rem; }
.hero-sub { max-width: 38ch; color: var(--muted); font-size: clamp(1.02rem, 1.6vw, 1.2rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.scroll-cue {
  position: absolute; right: var(--gutter); top: 50%; z-index: 1; writing-mode: vertical-rl;
  display: flex; align-items: center; gap: 1rem; font-size: .68rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
}
.scroll-cue span { width: 1px; height: 60px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue span::after { content: ""; position: absolute; left: 0; top: -40%; width: 100%; height: 40%; background: var(--peach); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { to { top: 100%; } }

/* testo che entra lettera per lettera, ruotando in 3D */
[data-split] { perspective: 600px; }
.word { display: inline-block; white-space: nowrap; }
.char { display: inline-block; transform-origin: 50% 100%; }
.split-play .char { animation: charIn 1.1s var(--ease) both; animation-delay: calc(var(--i) * 40ms + var(--split-delay, .55s)); }
@keyframes charIn { from { opacity: 0; transform: translateY(80%) rotateX(-100deg) scale(.9); filter: blur(6px); } }

/* titoli che salgono parola per parola da una maschera */
[data-words] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
[data-words] .wi { display: inline-block; }
.js [data-words]:not(.in) .wi { transform: translateY(110%) rotate(4deg); }
.js [data-words] .wi { transition: transform 1.1s var(--ease); transition-delay: calc(var(--i) * 70ms); }

/* barra di avanzamento dello scroll */
.progress { position: fixed; left: 0; right: 0; top: 0; z-index: 70; height: 2px; pointer-events: none; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--peach), var(--lilac)); }

/* ============ NASTRO SCORREVOLE ============ */
.marquee { transform: skewX(var(--skew, 0deg)); transition: transform .3s var(--ease); overflow: hidden; border-block: 1px solid var(--line); padding-block: clamp(1.2rem, 3vw, 2rem); }
.marquee-track { display: flex; align-items: center; gap: 2.2rem; width: max-content; will-change: transform; }
.marquee-track span { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 6vw, 4.6rem); line-height: 1; white-space: nowrap; letter-spacing: -.02em; }
.marquee-track i { font-style: normal; color: var(--peach); font-size: clamp(1.2rem, 3vw, 2rem); }

/* ============ HOME: SEZIONI E IN EVIDENZA ============ */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }

[data-tilt] {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .7s var(--ease); transform-style: preserve-3d;
}
[data-tilt].tilting { transition: transform .12s linear; }

.doors { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2vw, 1.6rem); }
.door {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  aspect-ratio: 5 / 4; padding: clamp(1.3rem, 2.5vw, 2.4rem); border-radius: var(--radius);
  text-decoration: none; overflow: hidden; isolation: isolate; border: 1px solid var(--line);
}
.door::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--door-bg); transition: transform 1s var(--ease); }
.door::after { /* riflesso che segue il mouse */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .22), transparent 45%);
}
.door:hover::before { transform: scale(1.08); }
.door:hover::after { opacity: 1; }
.door-grafica { --door-bg: radial-gradient(90% 70% at 80% 15%, #b7a4f5 0%, transparent 60%), linear-gradient(170deg, #3a3160, #1b1821 75%); }
.door-eventi { --door-bg: radial-gradient(90% 70% at 50% 0%, #f3cf8f 0%, transparent 55%), linear-gradient(170deg, #6a3d2e, #1b1821 75%); }
.door-body { display: flex; flex-direction: column; gap: .4rem; transform: translateZ(50px); }
.door-body strong { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 5vw, 4rem); line-height: 1; letter-spacing: -.02em; }
.door-body span { color: rgba(242, 237, 230, .78); font-size: .95rem; }
.door-arrow {
  position: absolute; top: 1.2rem; right: 1.2rem; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(242, 237, 230, .35); font-size: 1.1rem;
  transform: translateZ(40px); transition: background .4s, color .4s, rotate .5s var(--ease);
}
.door:hover .door-arrow { background: var(--paper); color: var(--ink); rotate: 45deg; }

.featured { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2vw, 1.6rem); }
.feat { text-decoration: none; display: block; min-width: 0; }
.feat-media { display: block; border-radius: var(--radius); overflow: hidden; }
.feat-media .placeholder, .feat-media img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.feat:hover .feat-media .placeholder, .feat:hover .feat-media img { transform: scale(1.06); }
.feat-cap { display: grid; gap: .2rem; padding-top: 1rem; }
.feat-cap strong { font-family: var(--display); font-weight: 600; font-size: 1.2rem; line-height: 1.2; }
.feat-cap span { color: var(--muted); font-size: .88rem; }

.cta-band { text-align: center; overflow: hidden; }
.cta-band .eyebrow { justify-content: center; }
.cta-band .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; }
.cta-title { font-size: clamp(2.6rem, 8vw, 6.5rem); font-weight: 800; letter-spacing: -.04em; margin: 0 auto 2.5rem; max-width: 14ch; }

/* breve presentazione in home */
.intro { display: flex; flex-direction: column; align-items: flex-start; gap: 1.8rem; }
.intro .eyebrow { margin-bottom: 0; }
.intro-text { font-family: var(--display); font-weight: 500; font-size: clamp(1.7rem, 4vw, 3.4rem); line-height: 1.2; letter-spacing: -.02em; max-width: 26ch; text-wrap: balance; }

/* ============ PAGINE INTERNE: TITOLO + OGGETTO 3D ============ */
.page-hero { position: relative; overflow: hidden; padding-block: clamp(9rem, 18vw, 13rem) clamp(3rem, 6vw, 5rem); }
.page-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(45% 60% at 85% 30%, rgba(183, 164, 245, .16), transparent 70%),
              radial-gradient(35% 50% at 65% 80%, rgba(240, 179, 154, .12), transparent 70%);
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent);
}
.page-hero .container { position: relative; z-index: 1; }
.page-title { font-size: clamp(3.4rem, 13vw, 10.5rem); font-weight: 800; line-height: .88; letter-spacing: -.045em; }
.page-intro { max-width: 52ch; color: var(--muted); font-size: clamp(1.02rem, 1.6vw, 1.2rem); margin-top: 2rem; }

.cube-wrap { position: absolute; right: clamp(1.5rem, 10vw, 10rem); top: 38%; width: 150px; height: 150px; perspective: 900px; }
.cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: spin 20s linear infinite; }
.cube span {
  position: absolute; inset: 0; border: 1px solid rgba(242, 237, 230, .38); border-radius: 6px;
  background: linear-gradient(135deg, rgba(240, 179, 154, .22), rgba(183, 164, 245, .22));
}
.cube span:nth-child(1) { transform: translateZ(75px); }
.cube span:nth-child(2) { transform: rotateY(180deg) translateZ(75px); }
.cube span:nth-child(3) { transform: rotateY(90deg) translateZ(75px); }
.cube span:nth-child(4) { transform: rotateY(-90deg) translateZ(75px); }
.cube span:nth-child(5) { transform: rotateX(90deg) translateZ(75px); }
.cube span:nth-child(6) { transform: rotateX(-90deg) translateZ(75px); }
@keyframes spin { from { transform: rotateX(-25deg) rotateY(0); } to { transform: rotateX(335deg) rotateY(720deg); } }

.gyro { position: absolute; right: clamp(1.5rem, 10vw, 10rem); top: 34%; width: 190px; height: 190px; transform-style: preserve-3d; perspective: 900px; animation: float 7s ease-in-out infinite; }
.gyro span { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid; transform-style: preserve-3d; }
.gyro span:nth-child(1) { border-color: var(--peach); animation: ring1 9s linear infinite; }
.gyro span:nth-child(2) { border-color: var(--lilac); inset: 18px; animation: ring2 7s linear infinite; }
.gyro span:nth-child(3) { border-color: rgba(242, 237, 230, .5); inset: 40px; animation: ring3 11s linear infinite; }
@keyframes ring1 { from { transform: rotateX(70deg) rotateZ(0); } to { transform: rotateX(70deg) rotateZ(360deg); } }
@keyframes ring2 { from { transform: rotateY(70deg) rotateX(0); } to { transform: rotateY(70deg) rotateX(360deg); } }
@keyframes ring3 { from { transform: rotateX(20deg) rotateY(0); } to { transform: rotateX(20deg) rotateY(360deg); } }
@keyframes float { 50% { translate: 0 -14px; } }

/* ============ CHI SONO ============ */
.about-section { padding-top: 0; }
.about { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(2.5rem, 7vw, 7rem); align-items: center; }
.portrait { position: relative; max-width: min(460px, calc(100% - 24px)); width: 100%; }
.portrait-frame {
  position: absolute; inset: 0; border: 1px solid var(--peach); border-radius: var(--radius);
  transform: translate3d(22px, 22px, -60px);
}
.portrait-img { position: relative; display: block; border-radius: var(--radius); overflow: hidden; transform: translateZ(0); }
.portrait-img .placeholder, .portrait-img img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; }
.portrait-tag {
  position: absolute; left: -14px; bottom: 28px; padding: .5rem 1rem; border-radius: 999px;
  background: var(--paper); color: var(--ink); font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  transform: translateZ(70px); box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.about-text { display: flex; flex-direction: column; align-items: flex-start; gap: 1.4rem; min-width: 0; }
.about-text > p { max-width: 60ch; color: var(--muted); }
.about-text .lead { font-family: var(--display); font-weight: 500; font-size: clamp(1.35rem, 2.4vw, 1.8rem); line-height: 1.35; color: var(--paper); letter-spacing: -.01em; }
.facts { display: grid; gap: .9rem; margin: .4rem 0 .8rem; width: 100%; }
.facts div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.facts dt { font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--peach); padding-top: .25rem; }
.facts dd { margin: 0; }

.split-2 { display: grid; grid-template-columns: 4fr 7fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.split-2 > * { min-width: 0; }
.services li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1.3rem 0; border-top: 1px solid var(--line); transition: padding .5s var(--ease), color .3s;
}
.services li:last-child { border-bottom: 1px solid var(--line); }
.services li strong { font-family: var(--display); font-weight: 600; font-size: clamp(1.15rem, 2.2vw, 1.6rem); letter-spacing: -.01em; line-height: 1.25; }
.services li em { font-style: normal; font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.services li:hover { padding-left: 1rem; color: var(--peach); }

.clients { display: flex; flex-wrap: wrap; gap: .2rem 2.2rem; }
.clients li { font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 4.5vw, 3.4rem); letter-spacing: -.03em; line-height: 1.2; transition: color .3s, -webkit-text-stroke-color .3s; }
.clients li:nth-child(even) { color: transparent; -webkit-text-stroke: 1.2px var(--paper); }
.clients li:hover { color: var(--peach); -webkit-text-stroke-color: var(--peach); }
.tools-label { margin-top: clamp(3rem, 6vw, 5rem); }
.tags { display: flex; flex-wrap: wrap; gap: .6rem; }
.tags li { padding: .45rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; transition: border-color .3s, background .3s; }
.tags li:hover { border-color: var(--lilac); background: rgba(183, 164, 245, .1); }

/* ============ LAVORI ============ */
.works-section { padding-top: 0; }
.works-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 2.5rem; }
.filters { display: inline-flex; flex-wrap: wrap; gap: .3rem; padding: .3rem; border: 1px solid var(--line); border-radius: 999px; }
.filters button {
  background: none; border: 0; border-radius: 999px; padding: .6rem 1.3rem; cursor: pointer;
  font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); transition: background .35s, color .35s;
}
.filters button:hover { color: var(--paper); }
.filters button.active { background: var(--paper); color: var(--ink); }
.works-count { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

.grid { columns: 3 300px; column-gap: clamp(1rem, 2vw, 1.6rem); }
.work { margin: 0 0 clamp(1.5rem, 3vw, 2.4rem); break-inside: avoid; }
.work.pop { animation: pop .7s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: perspective(900px) translateY(30px) rotateX(18deg); } }
.work-open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius); overflow: hidden; }
.work-images { display: block; }
.work-images > :not(:first-child) { display: none; }
.work-images .placeholder, .work-images img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 1s var(--ease), filter .6s; }
.work:nth-child(3n+2) .work-images > * { aspect-ratio: 3 / 4; }
.work:nth-child(4n+3) .work-images > * { aspect-ratio: 1 / 1; }
.work-open:hover .work-images > * { transform: scale(1.06); filter: brightness(.7); }
.work-hover {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .4s;
  font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
}
.work-hover span { padding: .8rem 1.4rem; border-radius: 999px; background: var(--paper); color: var(--ink); transform: translateY(12px); transition: transform .5s var(--ease); }
.work-open:hover .work-hover, .work-open:focus-visible .work-hover { opacity: 1; }
.work-open:hover .work-hover span { transform: none; }
.badge {
  position: absolute; left: .9rem; top: .9rem; padding: .3rem .8rem; border-radius: 999px;
  background: rgba(18, 16, 22, .7); backdrop-filter: blur(6px); color: var(--paper); font-size: .72rem; font-weight: 600; letter-spacing: .06em;
}
.work figcaption { padding-top: 1rem; display: grid; gap: .25rem; }
.work .w-meta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.work .w-meta b { color: var(--peach); font-weight: 600; }
.work figcaption strong { font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.work figcaption > span { color: var(--muted); font-size: .92rem; }
.empty { color: var(--muted); padding: 3rem 0; }

/* ============ CONTATTI ============ */
.contact-section { padding-top: 0; }
.contact-grid { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(2.5rem, 7vw, 7rem); align-items: start; }
.contact-grid > div { min-width: 0; }
.mail {
  display: inline-block; max-width: 100%; overflow-wrap: anywhere; text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: clamp(1.5rem, 4.4vw, 3.4rem); line-height: 1.1; letter-spacing: -.03em;
  background: linear-gradient(var(--peach), var(--peach)) 0 100% / 0 2px no-repeat; transition: background-size .6s var(--ease), color .3s;
}
.mail:hover { background-size: 100% 2px; color: var(--peach); }
.copy {
  display: block; margin-top: 1.2rem; background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: .55rem 1.1rem; font-size: .76rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); cursor: pointer; transition: .3s;
}
.copy:hover { color: var(--paper); border-color: var(--paper); }
.socials { margin-top: 3rem; }
.socials a {
  display: flex; justify-content: space-between; padding: 1.1rem 0; border-top: 1px solid var(--line); text-decoration: none;
  font-family: var(--display); font-weight: 600; font-size: 1.4rem; transition: padding .5s var(--ease), color .3s;
}
.socials li:last-child a { border-bottom: 1px solid var(--line); }
.socials a:hover { padding-inline: .8rem; color: var(--peach); }
.avail li { padding: 1rem 0 1rem 1.8rem; border-top: 1px solid var(--line); position: relative; }
.avail li::before { content: "✦"; position: absolute; left: 0; color: var(--peach); }
.based { margin-top: 2rem; color: var(--muted); font-size: .92rem; }

/* ============ FOOTER ============ */
.site-footer { border-top: 1px solid var(--line); overflow: hidden; }
.footer-big {
  font-family: var(--display); font-weight: 800; font-size: clamp(3rem, 14.5vw, 14rem); line-height: .85; letter-spacing: -.05em;
  white-space: nowrap; text-align: center; color: transparent; -webkit-text-stroke: 1px rgba(242, 237, 230, .25);
  padding-top: clamp(2rem, 5vw, 4rem); margin-bottom: -.12em; user-select: none;
}
.footer-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem;
  padding-block: 1.6rem calc(1.6rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--muted); position: relative; background: var(--ink);
}
.footer-row nav { display: flex; gap: 1.5rem; }
.footer-row a { text-decoration: none; transition: color .3s; }
.footer-row a:hover { color: var(--paper); }

/* ============ SEGNAPOSTO (finché non ci sono le foto) ============ */
.placeholder {
  display: block; width: 100%; aspect-ratio: 4 / 3;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .28), transparent 38%), var(--g, linear-gradient(135deg, #f0b39a, #5a3a4a));
}
.ph-1 { --g: linear-gradient(135deg, #f0b39a, #6b3d57); }
.ph-2 { --g: linear-gradient(160deg, #b7a4f5, #2b2540); }
.ph-3 { --g: linear-gradient(120deg, #ffd9c2, #b8604a); }
.ph-4 { --g: linear-gradient(145deg, #9fd3c7, #24404a); }
.ph-5 { --g: linear-gradient(170deg, #f3dfa8, #8f5f33); }
.ph-6 { --g: linear-gradient(135deg, #e3b7d4, #452853); }
.ph-portrait { --g: linear-gradient(170deg, #d9b3a3, #3d2c3a); display: grid; place-items: center; }
.ph-portrait::after { content: "La tua foto"; font-family: var(--display); font-size: 1.1rem; color: rgba(255, 255, 255, .7); }

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 9, 12, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-body { width: min(1000px, 86vw); max-height: 92vh; overflow: auto; transform: scale(.96); transition: transform .5s var(--ease); }
.lightbox.open .lb-body { transform: none; }
.lb-media { border-radius: 14px; overflow: hidden; }
.lb-media .placeholder, .lb-media img { width: 100%; max-height: 64vh; aspect-ratio: 16 / 10; object-fit: contain; background-color: #0c0b0e; }
.lb-media > * { animation: fadeIn .45s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: scale(1.02); } }
.lb-info { padding-top: 1.2rem; }
.lb-meta { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--peach); }
.lb-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: .4rem 0 .6rem; }
.lb-desc { color: var(--muted); max-width: 65ch; }
.lb-thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.lb-thumbs button { width: 70px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; cursor: pointer; opacity: .5; transition: .3s; }
.lb-thumbs button.active, .lb-thumbs button:hover { opacity: 1; border-color: var(--peach); }
.lb-thumbs .placeholder, .lb-thumbs img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.lb-works { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.lb-works button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); font-size: .85rem; transition: color .3s; }
.lb-works button:hover { color: var(--paper); }
.lb-close, .lb-nav {
  position: absolute; z-index: 2; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(18, 16, 22, .6); cursor: pointer; font-size: 1.8rem; line-height: 1; display: grid; place-items: center; transition: background .3s, color .3s;
}
.lb-close:hover, .lb-nav:hover { background: var(--paper); color: var(--ink); }
.lb-close { top: calc(1rem + env(safe-area-inset-top, 0px)); right: 1rem; }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }

/* ============ TRANSIZIONE TRA PAGINE ============ */
/* 5 bande che si alzano in sequenza; al centro il nome della pagina */
.curtain { position: fixed; inset: 0; z-index: 200; pointer-events: none; display: grid; place-items: center; overflow: hidden; }
.curtain i {
  position: absolute; top: -2px; bottom: -2px; width: calc(20% + 2px); left: calc(var(--k) * 20%);
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2) 55%, var(--ink));
  transform: translateY(-102%); animation: panelOut .95s cubic-bezier(.76, 0, .24, 1) both;
  animation-delay: calc(var(--k) * 70ms + .45s);
}
.curtain i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--peach), var(--lilac)); }
.curtain i:nth-child(1) { --k: 0; } .curtain i:nth-child(2) { --k: 1; } .curtain i:nth-child(3) { --k: 2; }
.curtain i:nth-child(4) { --k: 3; } .curtain i:nth-child(5) { --k: 4; }
.curtain-label {
  position: relative; z-index: 1; font-family: var(--display); font-weight: 800; letter-spacing: -.04em; line-height: 1;
  font-size: clamp(2.4rem, 9vw, 6rem); padding-inline: 1rem; text-align: center;
  background: linear-gradient(100deg, var(--paper) 30%, var(--peach) 55%, var(--lilac) 80%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: labelOut .5s cubic-bezier(.76, 0, .24, 1) .3s both;
}
.curtain.enter i { animation: panelIn .6s cubic-bezier(.76, 0, .24, 1) both; animation-delay: calc((4 - var(--k)) * 50ms); }
.curtain.enter .curtain-label { animation: labelIn .7s var(--ease) .35s both, shine 1.4s linear .35s both; }
@keyframes panelOut { from { transform: translateY(0); } to { transform: translateY(-102%); } }
@keyframes panelIn { from { transform: translateY(102%); } to { transform: translateY(0); } }
@keyframes labelOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-40px) scale(.96); filter: blur(4px); } }
@keyframes labelIn { from { opacity: 0; transform: translateY(50px) scale(.94); filter: blur(8px); } }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ============ CURSORE ============ */
.cursor-dot, .cursor-ring { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; border-radius: 50%; mix-blend-mode: difference; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; }
.cursor-ring { width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid #fff; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s; }
.cursor-ring.hover { width: 70px; height: 70px; margin: -35px 0 0 -35px; background: rgba(255, 255, 255, .12); }
.cursor-ring.label { width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--paper); border-color: var(--paper); mix-blend-mode: normal; display: grid; place-items: center; }
.cursor-ring.label::after { content: attr(data-label); color: var(--ink); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

/* ============ COMPARSA ALLO SCROLL (in 3D) ============ */
.js .feat.reveal .feat-media, .js .work.reveal .work-open, .js .portrait.reveal .portrait-img {
  clip-path: inset(100% 0 0 0 round var(--radius)); transition: clip-path 1.3s var(--ease) .1s;
}
.js .feat.reveal.in .feat-media, .js .work.reveal.in .work-open, .js .portrait.reveal.in .portrait-img { clip-path: inset(0 0 0 0 round var(--radius)); }
.js .reveal .feat-media > *, .js .work.reveal .work-images > *:first-child, .js .portrait.reveal .portrait-img > * { scale: 1.25; transition: scale 1.6s var(--ease), transform 1s var(--ease), filter .6s; }
.js .reveal.in .feat-media > *, .js .work.reveal.in .work-images > *:first-child, .js .portrait.reveal.in .portrait-img > * { scale: 1; }
.js .reveal { opacity: 0; transform: perspective(900px) translateY(40px) rotateX(14deg); transform-origin: 50% 100%; transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal[data-tilt].in { transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .curtain, .progress { display: none; }
  .js [data-words] .wi { transform: none !important; }
}

/* ============ TABLET / MOBILE ============ */
@media (hover: none), (max-width: 760px) {
  [data-tilt], .js .reveal[data-tilt].in { transform: none; }
  .portrait-tag, .door-body, .door-arrow { transform: none; }
  .portrait-frame { transform: translate(12px, 12px); }
  .hero-title { transform: none; }
  .js .reveal { transform: translateY(28px); }
  .work.pop { animation-name: popFlat; }
  .work-open:hover .work-images > *, .feat:hover .feat-media > *, .door:hover::before { transform: none; filter: none; }
}
@keyframes popFlat { from { opacity: 0; transform: translateY(24px); } }
@media (max-width: 900px) {
  .about, .split-2, .contact-grid { grid-template-columns: 1fr; }
  .scroll-cue { display: none; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: 0; z-index: 1; flex-direction: column; justify-content: center; gap: .4rem;
    padding: 6rem var(--gutter) 3rem; background: var(--ink);
    clip-path: circle(0 at calc(100% - 42px) 38px); transition: clip-path .7s cubic-bezier(.76, 0, .24, 1), visibility .7s; visibility: hidden;
  }
  .nav.open { clip-path: circle(150% at calc(100% - 42px) 38px); visibility: visible; }
  .nav a { font-family: var(--display); font-size: clamp(2.4rem, 11vw, 3.4rem); font-weight: 700; letter-spacing: -.03em; text-transform: none; color: var(--paper); }
  .nav a.active { color: var(--peach); }
  .nav a.active::before { display: none; }
  .site-header.menu-open { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .hero { padding-block: 7rem 3.5rem; }
  .hero-title { font-size: clamp(3.2rem, 17.5vw, 6rem); }
  .cube-wrap { width: 90px; height: 90px; top: 5.5rem; right: 1.2rem; opacity: .7; }
  .cube span:nth-child(1) { transform: translateZ(45px); }
  .cube span:nth-child(2) { transform: rotateY(180deg) translateZ(45px); }
  .cube span:nth-child(3) { transform: rotateY(90deg) translateZ(45px); }
  .cube span:nth-child(4) { transform: rotateY(-90deg) translateZ(45px); }
  .cube span:nth-child(5) { transform: rotateX(90deg) translateZ(45px); }
  .cube span:nth-child(6) { transform: rotateX(-90deg) translateZ(45px); }
  .gyro { width: 110px; height: 110px; top: 5rem; right: 1.2rem; opacity: .75; }
  .gyro span:nth-child(2) { inset: 12px; }
  .gyro span:nth-child(3) { inset: 26px; }
  .lb-nav { top: 30vh; width: 44px; height: 44px; }
  .lb-prev { left: .4rem; }
  .lb-next { right: .4rem; }
  .facts div { grid-template-columns: 1fr; gap: .2rem; }
  .portrait-tag { left: .8rem; bottom: .8rem; }
  .filters { width: 100%; justify-content: space-between; }
  .filters button { flex: 1; padding: .8rem .6rem; }
  .works-count { width: 100%; }
  .section { padding-block: 4.5rem; }
  .page-hero { padding-block: 8rem 2.5rem; }
  .page-title { font-size: clamp(3rem, 16vw, 5rem); }
  .marquee-track span { font-size: clamp(1.8rem, 10vw, 2.6rem); }
  .lb-body { width: 100%; max-height: 100%; padding: calc(4.5rem + env(safe-area-inset-top, 0px)) 1rem calc(2rem + env(safe-area-inset-bottom, 0px)); }
  .lb-media .placeholder, .lb-media img { max-height: 52vh; }
  .lb-thumbs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .lb-thumbs button { flex: none; }
  .footer-row nav { width: 100%; justify-content: center; }
  .btn { padding: 1rem 1.5rem; }
}
@media (max-width: 520px) {
  .doors { grid-template-columns: 1fr; }
  .door { aspect-ratio: 4 / 3; }
  .footer-row { justify-content: center; text-align: center; }
}
