/* valeriomorici.it
   Nero bluastro, blu-violetto per l'interfaccia, oro solo dove c'e' la luce:
   la scena. Il giallo e' il fuoco del drago, e se lo usasse anche l'interfaccia
   smetterebbe di essere il fuoco di qualcosa. */

:root {
  --bg: #07070d;
  --bg-2: #10101c;
  --ink: #ece9f6;
  --muted: #9794b2;
  --acc: #8b7cff;
  --acc-soft: #8b7cff8c;
  --acc-dim: #8b7cff1f;
  --gold: #ffc24a;
  --line: #ece9f624;

  --gutter: clamp(20px, 4.2vw, 88px);
  --header-h: 84px;
  --cut: 10px;
  --corner: linear-gradient(var(--acc), var(--acc));

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  --f-display: "Cinzel", Georgia, "Times New Roman", serif;
  --f-brand: "Space Grotesk", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.is-loading { overflow: hidden; }
html.menu-open body { overflow: hidden; }

a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

::selection { background: var(--acc); color: #fff; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; border-radius: 3px; }

.mono {
  font-family: var(--f-mono);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
main { position: relative; z-index: 2; }
/* un ancora non deve finire sotto alla testata fissa */
[id] { scroll-margin-top: calc(var(--header-h) + 26px); }
main h1[tabindex="-1"]:focus { outline: none; }

/* ---- la scena ---------------------------------------------------------- */
.scene {
  position: fixed; inset: 0; z-index: 0;
  display: block; width: 100%; height: 100%;
  pointer-events: none;
}
.scene-fallback {
  position: fixed; inset: 0; z-index: 0; display: none;
  place-items: center;
  background:
    radial-gradient(58% 48% at 50% 38%, #ffc24a1f, transparent 70%),
    linear-gradient(#0b0912, #171433 62%, var(--bg));
}
.scene-fallback i {
  display: block;
  width: min(30vw, 240px);
  aspect-ratio: 272 / 360;
  margin-bottom: 16vh;
  background: var(--gold);
  -webkit-mask: url(../img/drago.png) center / contain no-repeat;
  mask: url(../img/drago.png) center / contain no-repeat;
  filter: drop-shadow(0 0 40px #ffc24a66);
}
.no-webgl .scene-fallback { display: grid; }

/* ---- caricamento -------------------------------------------------------- */
.loader {
  position: fixed; inset: 0; z-index: 50;
  display: grid; align-content: center; place-items: center; gap: 34px;
  background: var(--bg);
  --r: 0px;
  -webkit-mask: radial-gradient(circle at var(--cx, 50%) var(--cy, 42%), transparent var(--r), #000 calc(var(--r) + 1px));
  mask: radial-gradient(circle at var(--cx, 50%) var(--cy, 42%), transparent var(--r), #000 calc(var(--r) + 1px));
  transition: --r 1.6s var(--ease-io) .1s;
}
.loader.is-out { --r: 150vmax; pointer-events: none; }
.loader.is-quick { transition-duration: 1.1s; transition-delay: 0s; }
.loader__art {
  --art-h: clamp(140px, min(26vh, 40vw), 260px);
  position: relative; z-index: 1;
  width: calc(var(--art-h) * .756); height: var(--art-h);
}
.art-particelle { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.loader__below { position: relative; z-index: 1; display: grid; place-items: start center; transition: opacity .35s; }
.loader.is-out .loader__below { opacity: 0; }
.loader__gate {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .6s, visibility 0s linear .6s;
}
.loader.is-asking .loader__gate { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .7s .2s; }
.loader.is-chosen .loader__gate { pointer-events: none; }
.gate__lang {
  --cut: 12px;
  justify-self: auto; justify-content: center;
  min-width: 96px; height: 52px; padding: 0 20px 0 24px;
  font-size: 13px; letter-spacing: .2em;
}
.gate__lang[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: #0b0a14; }
.gate__lang[aria-pressed="true"] .pill__dot { background: #0b0a14; }

/* ---- testata ------------------------------------------------------------ */
.header {
  position: fixed; inset: 0 0 auto; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: var(--header-h); padding: 0 var(--gutter);
  pointer-events: none;
}
.header > * { pointer-events: auto; }
.header::before {
  content: ""; position: absolute; inset: 0 0 -36px; z-index: -1; pointer-events: none;
  background: linear-gradient(#07070de6, #07070d8c 55%, transparent);
}
.logo { justify-self: start; display: inline-flex; align-items: center; gap: 11px; }
.logo__mark {
  display: block; width: 17px; height: 22px; flex: none;
  background: var(--acc);
  -webkit-mask: url(../img/drago.png) center / contain no-repeat;
  mask: url(../img/drago.png) center / contain no-repeat;
  transition: background .4s;
}
.logo:hover .logo__mark { background: var(--gold); }
.logo__word { font-family: var(--f-brand); font-size: 15px; font-weight: 300; letter-spacing: .09em; }
.logo__word b { font-weight: 700; margin-right: .3em; }

.nav { display: flex; gap: clamp(22px, 2.6vw, 44px); font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.nav a { position: relative; padding: 10px 0; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 1px;
  background: var(--acc); transform: scaleX(0); transform-origin: 100%;
  transition: transform .5s var(--ease-out);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: 0; }

.header__end { justify-self: end; display: flex; align-items: center; gap: 18px; }
.lang { display: inline-flex; align-items: center; height: 42px; padding: 0 6px; color: var(--muted); font-size: 11px; letter-spacing: .14em; transition: color .3s; }
.lang:hover { color: var(--ink); }

.pill {
  display: inline-flex; align-items: center; gap: 12px; justify-self: end;
  height: 42px; padding: 0 18px 0 20px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  background: var(--acc-dim);
  border: 1px solid var(--acc-soft);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .4s, color .4s, border-color .4s;
  cursor: pointer;
}
.pill:hover { background: var(--acc); border-color: var(--acc); color: #0b0a14; }
.pill__dot {
  width: 6px; height: 6px; flex: none; background: var(--acc);
  transform: rotate(45deg);
  animation: pulse 2.4s ease-out infinite;
}
.pill:hover .pill__dot { background: #0b0a14; }
.pill--solid {
  --cut: 12px;
  height: 52px; padding: 0 24px 0 26px; font-size: 12.5px; font-weight: 500;
  background: var(--acc); border-color: var(--acc); color: #0b0a14;
}
.pill--solid .pill__dot { background: #0b0a14; }
.pill--solid:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 #8b7cff8c; }
  70%  { box-shadow: 0 0 0 10px #8b7cff00; }
  100% { box-shadow: 0 0 0 0 #8b7cff00; }
}

.sound {
  display: inline-flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 6px; border: 0; background: none;
  color: var(--muted); font-size: 11px; cursor: pointer;
}
.sound:hover, .sound[aria-pressed="true"] { color: var(--ink); }
.sound__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
/* Le barrette crescono con scaleY, non con height: un'altezza animata rifa il
   calcolo del riquadro a ogni fotogramma, una scala no. */
.sound__bars i {
  width: 2px; height: 14px; background: currentColor;
  transform-origin: bottom; transform: scaleY(.21);
  transition: transform .3s;
}
.sound[aria-pressed="true"] .sound__bars i { background: var(--acc); animation: eq 1s ease-in-out infinite; }
.sound[aria-pressed="true"] .sound__bars i:nth-child(2) { animation-delay: -.3s; }
.sound[aria-pressed="true"] .sound__bars i:nth-child(3) { animation-delay: -.6s; }
.sound[aria-pressed="true"] .sound__bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { transform: scaleY(.21); } 50% { transform: scaleY(1); } }
.sound-armed .sound .sound__bars i { background: var(--acc); opacity: .6; }
.sound--mobile { display: none; }

.burger {
  position: relative; justify-self: end; display: none;
  width: 44px; height: 44px; padding: 0; cursor: pointer;
  background: var(--acc-dim); border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.burger span {
  position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--ink);
  transition: transform .5s var(--ease-out);
}
.burger span:first-child { top: 17px; }
.burger span:last-child { top: 25px; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 25;
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--header-h) var(--gutter) 40px;
  background: #07070df0;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  --r: 0px;
  clip-path: circle(var(--r) at calc(100% - var(--gutter) - 22px) calc(var(--header-h) / 2));
  transition: --r .9s var(--ease-io);
}
.menu.is-open { --r: 160vmax; }
.menu nav { display: grid; gap: 6px; }
.menu nav a {
  display: flex; align-items: baseline; gap: 14px;
  font-family: var(--f-display); font-size: clamp(2rem, 8.5vw, 3.6rem); font-weight: 600;
  line-height: 1.05; text-transform: uppercase;
  transition: color .3s;
}
.menu nav a .mono { color: var(--acc); }
.menu nav a:hover { color: var(--acc); }
.menu__mail { margin-top: 40px; color: var(--muted); }
.menu__lang { margin-top: 14px; color: var(--muted); }
.menu__lang a { border-bottom: 1px solid var(--acc-soft); padding-bottom: 2px; }

/* ---- HUD ---------------------------------------------------------------- */
.hud {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  --hc: #8b7cff8c; --hi: 14px;
  opacity: 0; transition: opacity 1.2s .4s;
}
body:not(.is-loading) .hud { opacity: 1; }
.hud__corner { position: absolute; width: 26px; height: 26px; border: 0 solid var(--hc); }
.hud__corner--tl { top: var(--hi); left: var(--hi); border-top-width: 1px; border-left-width: 1px; }
.hud__corner--tr { top: var(--hi); right: var(--hi); border-top-width: 1px; border-right-width: 1px; }
.hud__corner--bl { bottom: var(--hi); left: var(--hi); border-bottom-width: 1px; border-left-width: 1px; }
.hud__corner--br { bottom: var(--hi); right: var(--hi); border-bottom-width: 1px; border-right-width: 1px; }
.hud__cross {
  position: absolute; left: var(--x); top: var(--y);
  width: 11px; height: 11px; margin: -5px 0 0 -5px; opacity: .4;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 1px 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 100% 1px no-repeat;
}
.hud__cross--a { --x: 33.3%; --y: 22%; }
.hud__cross--b { --x: 66.6%; --y: 22%; }
.hud__cross--c { --x: 33.3%; --y: 78%; }
.hud__cross--d { --x: 66.6%; --y: 78%; }
.hud__read {
  position: absolute; bottom: calc(var(--hi) + 2px);
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: .12em; color: #ece9f68c; white-space: nowrap;
}
.hud__read b { color: var(--ink); font-weight: 500; }
.hud__read--l { left: calc(var(--hi) + 36px); }
.hud__read--r { right: calc(var(--hi) + 36px); }
.hud__dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 8px var(--gold); animation: blink 1.6s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hud__bar {
  position: absolute; top: 50%; right: calc(var(--hi) + 4px);
  width: 1px; height: 22vh; margin-top: -11vh; background: #ece9f61f;
}
.hud__bar span {
  position: absolute; top: 0; left: -1px; width: 3px; height: 100%;
  background: var(--acc); box-shadow: 0 0 10px var(--acc);
  transform-origin: top; transform: scaleY(var(--p, 0));
}

.curtain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: var(--bg);
  --r: 160vmax;
  -webkit-mask: radial-gradient(circle at var(--cx, 50%) var(--cy, 50%), transparent var(--r), #000 calc(var(--r) + 1px));
  mask: radial-gradient(circle at var(--cx, 50%) var(--cy, 50%), transparent var(--r), #000 calc(var(--r) + 1px));
  transition: --r .75s var(--ease-io);
}
.curtain.is-closing { --r: 0px; pointer-events: auto; }

/* ---- testo -------------------------------------------------------------- */
.label {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 1.5em; color: var(--ink);
}
.label::before {
  content: ""; flex: none; width: 9px; height: 9px;
  background:
    linear-gradient(var(--acc), var(--acc)) center / 1px 100% no-repeat,
    linear-gradient(var(--acc), var(--acc)) center / 100% 1px no-repeat;
}
.label.is-typing::after {
  content: ""; width: 7px; height: 1em; background: var(--acc);
  animation: blink 1s step-end infinite;
}

.title {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(2rem, 3.6vw + .5rem, 6.6rem);
  line-height: 1.04; letter-spacing: .01em; text-transform: uppercase;
  overflow-wrap: break-word;
}
.title em { font-style: normal; color: var(--acc); text-shadow: 0 0 28px #8b7cff59; }
.title .line { display: block; overflow: hidden; margin: -.06em 0 -.08em; padding: .06em 0 .08em; }
.title .line__in {
  display: inline-block; transform: translateY(108%);
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * .11s);
}
.title.is-in .line__in { transform: none; }

.body { max-width: 36ch; color: #ece9f6d1; font-size: clamp(16px, .55vw + 11px, 21px); line-height: 1.6; }
.body a { color: var(--acc); border-bottom: 1px solid var(--acc-soft); }
.body a:hover { color: var(--ink); border-color: var(--ink); }

[data-fade], [data-type] {
  opacity: 0; transform: translateY(18px); filter: blur(6px);
  transition: opacity 1s ease, transform 1.2s var(--ease-out), filter 1s ease;
  transition-delay: .25s;
}
[data-fade].is-in, [data-type].is-in { opacity: 1; transform: none; filter: none; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tags li {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 2px;
  background: #07070d4d; color: #ece9f6db; font-size: 11px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.link { padding-bottom: 3px; border-bottom: 1px solid var(--acc-soft); transition: color .3s, border-color .3s; }
.link:hover { color: var(--acc); border-color: var(--acc); }

/* ---- sezioni ------------------------------------------------------------ */
.hero {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  height: 100svh; min-height: 560px;
  padding: 0 var(--gutter) clamp(36px, 8svh, 96px);
}
.hero .label { margin-bottom: clamp(16px, 2.4svh, 28px); }
.title--hero { max-width: 24ch; font-size: clamp(2.1rem, 4.3vw + .4rem, 8.4rem); }
.hero > *, .block__text { opacity: calc(1 - var(--leave, 0)); }

.scroll-hint {
  position: absolute; right: var(--gutter); bottom: clamp(36px, 8svh, 96px);
  display: flex; align-items: center; gap: 12px; color: var(--muted);
}
.scroll-hint span { position: relative; width: 1px; height: 46px; background: var(--line); overflow: hidden; }
.scroll-hint span::after {
  content: ""; position: absolute; inset: 0; background: var(--acc);
  transform: translateY(-100%); animation: drip 2.2s var(--ease-io) infinite;
}
@keyframes drip { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

.block { position: relative; height: 215svh; }
.block__text {
  position: sticky; top: 0;
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(18px, 2.6svh, 30px);
  height: 100svh; max-width: min(52vw, 1200px);
  padding: var(--header-h) var(--gutter) 0;
}
.block--wide { height: auto; min-height: 160svh; padding: 30svh 0 22svh; }
.block--wide .block__text { position: relative; height: auto; padding-top: 0; }

.steps {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 28px);
  margin-top: clamp(48px, 9svh, 120px); padding: 0 var(--gutter);
}
.steps li {
  position: relative; overflow: hidden; padding: 26px 24px 30px; border-radius: 4px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #14142499, #07070d80);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
}
.steps li::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px; opacity: .7;
  background: linear-gradient(90deg, transparent, var(--acc), transparent);
}
.steps .mono { color: var(--acc); }
.steps h3 {
  margin: 14px 0 18px; font-family: var(--f-display); font-weight: 400;
  font-size: clamp(22px, 1.2vw + 8px, 34px); letter-spacing: .02em; text-transform: uppercase;
}
.steps p { padding: 9px 0; border-top: 1px solid #ece9f614; color: #ece9f6bd; font-size: clamp(14px, .3vw + 10px, 17px); }

.teaser {
  position: relative; display: grid; gap: clamp(40px, 7svh, 90px);
  min-height: 150svh; padding: 26svh var(--gutter) 18svh;
}
.teaser__head { display: grid; gap: clamp(16px, 2.4svh, 28px); max-width: 46rem; }
.teaser__cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 32px); perspective: 1400px; }
.tcard { display: grid; gap: 10px; transform-style: preserve-3d; transition: transform .7s var(--ease-out); }
.tcard:first-child { transform: rotateY(9deg) translateZ(-20px); }
.tcard:nth-child(3) { transform: rotateY(-9deg) translateZ(-20px); }
.tcard:hover { transform: translateY(-8px) rotateY(0); }
.tcard__img {
  position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10;
  border: 1px solid var(--acc-soft); border-radius: 4px; background: #121220;
  box-shadow: 0 30px 80px -30px #000000d9, 0 0 60px -20px #8b7cff4d;
}
.tcard__img img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 1.2s var(--ease-out); }
.tcard:hover .tcard__img img { transform: scale(1.04); }
.tcard__meta { margin-top: 6px; color: var(--acc); font-size: 11px; }
.tcard__title { font-family: var(--f-display); font-weight: 600; font-size: clamp(20px, 1vw + 10px, 34px); line-height: 1; text-transform: uppercase; }
.teaser__all { justify-self: start; }

.steps li::after, .tcard__img::after {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  background:
    var(--corner) top left / 16px 1px, var(--corner) top left / 1px 16px,
    var(--corner) top right / 16px 1px, var(--corner) top right / 1px 16px,
    var(--corner) bottom left / 16px 1px, var(--corner) bottom left / 1px 16px,
    var(--corner) bottom right / 16px 1px, var(--corner) bottom right / 1px 16px;
  background-repeat: no-repeat;
}
.tcard__img::after { inset: 0; }

.cta {
  position: relative; display: flex; flex-direction: column;
  justify-content: flex-end; align-items: center; gap: 22px;
  min-height: 115svh; padding: 0 var(--gutter) 16svh; text-align: center;
}
.title--cta { font-size: clamp(3rem, 9vw, 12.5rem); line-height: 1; }
.cta .body { max-width: 30ch; }
.cta__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px 30px; margin-top: 10px; }

/* ---- pieno pagina ------------------------------------------------------- */
.page {
  position: relative; display: grid; gap: clamp(18px, 2.4svh, 28px);
  padding: calc(var(--header-h) + 12svh) var(--gutter) 10svh;
  max-width: 54rem;
}
.page .body { max-width: 44ch; }
.section { position: relative; padding: 8svh var(--gutter) 10svh; }
.section__head { display: grid; gap: clamp(14px, 2svh, 24px); max-width: 44rem; margin-bottom: clamp(36px, 6svh, 72px); }

.facts { display: grid; max-width: 36rem; margin-top: 10px; }
.facts div { display: grid; grid-template-columns: 8rem 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--acc); padding-top: 3px; }
.facts dd { margin: 0; font-size: clamp(15px, .35vw + 11px, 19px); }

.portrait { border: 1px solid var(--line); border-radius: 4px; max-width: 420px; }

/* ---- contatti ----------------------------------------------------------- */
.contact {
  position: relative; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: start; gap: clamp(32px, 5vw, 120px);
  min-height: 100svh; padding: calc(var(--header-h) + 7svh) var(--gutter) 12svh;
}
.contact__intro { position: sticky; top: calc(var(--header-h) + 7svh); display: flex; flex-direction: column; gap: clamp(18px, 2.4svh, 28px); }
.contact .title { font-size: clamp(2.2rem, 4.2vw + .4rem, 7.2rem); }
.contact__panel {
  position: relative; padding: clamp(22px, 2.6vw, 48px); border-radius: 6px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #1414246b, #07070d57);
  -webkit-backdrop-filter: blur(12px) saturate(1.35); backdrop-filter: blur(12px) saturate(1.35);
  box-shadow: 0 40px 120px -40px #000000b3;
}
.contact__panel::before {
  content: ""; position: absolute; inset: 0 18% auto; height: 1px; opacity: .8;
  background: linear-gradient(90deg, transparent, var(--acc), transparent);
}
.form { display: grid; gap: 26px; transition: opacity .45s ease, transform .45s var(--ease-out); }
.form.is-leaving { opacity: 0; transform: translateY(-14px); }
.form__group { margin: 0; padding: 0; border: 0; min-width: 0; }
.form__group legend, .field > span {
  display: block; margin-bottom: 12px; padding: 0;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: #ece9f6db;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px; background: #07070d4d; font-size: 15px;
  transition: background .3s, color .3s, border-color .3s, transform .3s var(--ease-out);
}
.chip:hover span { border-color: var(--acc-soft); }
.chip input:checked + span { background: var(--acc); border-color: var(--acc); color: #0b0a14; transform: translateY(-1px); }
.chip input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 3px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: block; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 3px;
  background: #07070d80; color: var(--ink); font: inherit; font-size: 16px;
  transition: border-color .3s, background .3s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--acc); background: #07070dcc; }
.field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__send { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; }
.form__note { color: var(--muted); font-size: 12.5px; }
.form__out { padding: 16px 18px; border: 1px solid var(--acc-soft); border-radius: 3px; background: #8b7cff14; font-size: 15px; }
.form__out[data-kind="ko"] { border-color: #ff7a7a8c; background: #ff7a7a14; }

/* ---- domande ------------------------------------------------------------ */
.faq { display: grid; gap: 0; max-width: 54rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 0; cursor: pointer; list-style: none;
  font-family: var(--f-display); font-size: clamp(17px, .8vw + 11px, 26px); font-weight: 500; text-transform: uppercase;
  transition: color .3s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--acc); }
.faq summary::after {
  content: ""; flex: none; width: 13px; height: 13px;
  background: linear-gradient(var(--acc), var(--acc)) center / 100% 1px no-repeat,
              linear-gradient(var(--acc), var(--acc)) center / 1px 100% no-repeat;
  transition: transform .4s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); background-size: 100% 1px, 1px 0; }
.faq p { padding: 0 0 24px; max-width: 60ch; color: #ece9f6c7; }

/* ---- piede -------------------------------------------------------------- */
.footer {
  position: relative; z-index: 2;
  padding: 44px var(--gutter) calc(26px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: linear-gradient(#07070d8c, #07070deb);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.footer__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px 40px; padding-bottom: 30px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.footer__nav a { white-space: nowrap; }
.footer__nav a:hover, .footer__bottom a:hover { color: var(--acc); }
.footer__mail {
  font-family: var(--f-body); font-size: clamp(18px, 1.2vw + 8px, 28px); font-weight: 300;
  padding-bottom: 2px; border-bottom: 1px solid var(--acc-soft); transition: color .3s;
}
.footer__mail:hover { color: var(--acc); }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 28px;
  padding-top: 22px; border-top: 1px solid #ece9f614; color: var(--muted); font-size: 11px;
}
.footer__links { display: inline-flex; gap: 22px; }

/* ---- misure ------------------------------------------------------------- */
@media (min-width: 641px) and (max-width: 1100px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .contact { grid-template-columns: 1fr; }
  .contact__intro { position: relative; top: 0; }
}
@media (max-width: 900px) {
  :root { --header-h: 72px; }
  .nav { display: none; }
  .header { grid-template-columns: 1fr auto auto; gap: 10px; }
  .header__end { display: none; }
  .sound--mobile { display: inline-flex; justify-content: center; justify-self: end; width: 44px; }
  .burger { display: block; }
  .hud { --hi: 8px; }
  .hud__cross, .hud__read--r, .hud__bar { display: none; }
  .hud__read--l { left: calc(var(--hi) + 32px); bottom: calc(var(--hi) + env(safe-area-inset-bottom)); }
  /* Su schermo stretto la figura sta in alto e il testo va sotto. Lasciando
     il testo centrato i due si sovrappongono a meta' altezza, e li' le
     particelle sono il doppio di quelle del profilo. */
  .block__text {
    max-width: none;
    justify-content: flex-end;
    padding-bottom: clamp(26px, 9svh, 90px);
  }
  .block--wide .block__text { padding-bottom: 0; }
  .teaser__cards { grid-template-columns: 1fr; }
  .tcard:nth-child(n) { transform: none; }
  .form__row { grid-template-columns: 1fr; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .block__text { gap: 12px; max-width: 58vw; }
  .block__text .title { font-size: clamp(1.8rem, 4.4vw, 3rem); }
  .body { font-size: 14px; }
  .tags { display: none; }
}
@media (min-width: 2000px) {
  .mono, .nav { font-size: 14px; }
  .logo__word { font-size: 18px; }
  .logo__mark { width: 20px; height: 26px; }
  .pill { height: 50px; font-size: 13.5px; }
  .pill--solid { height: 60px; font-size: 14.5px; }
  .tags li { padding: 9px 18px; font-size: 13px; }
  .hud__read { font-size: 12px; }
  .hud__corner { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .title .line__in { transform: none; }
  [data-fade], [data-type] { opacity: 1; transform: none; filter: none; }
}

/* ---- intestata di pagina ------------------------------------------------ */
.page-hero {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  gap: clamp(16px, 2.4svh, 28px);
  min-height: 100svh; padding: var(--header-h) var(--gutter) clamp(40px, 9svh, 110px);
}
.page-hero .title { max-width: 18ch; font-size: clamp(2.2rem, 4.4vw + .4rem, 8rem); }
.page-hero .body { max-width: 44ch; }
.page-hero > * { opacity: calc(1 - var(--leave, 0)); }
.page-hero .portrait { margin-top: 8px; width: clamp(140px, 22vw, 260px); }

/* ---- il carosello dei lavori -------------------------------------------
   La sezione e' alta quanto servono le schede: e' lo scorrimento della pagina
   a far girare il mazzo, non un timer. Cosi' rotella, dito, barra, Tab e
   trascinamento scrivono tutti sullo stesso numero. */
.gallery { position: relative; --per: 58svh; height: calc(100svh + var(--n, 6) * var(--per)); }
.gallery__sticky {
  position: sticky; top: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  height: 100svh;
  padding: calc(var(--header-h) + clamp(84px, 13svh, 190px)) 0 clamp(84px, 11svh, 150px);
}
.gallery__head {
  position: absolute; z-index: 20; pointer-events: none;
  top: calc(var(--header-h) + clamp(8px, 2svh, 28px)); left: var(--gutter); right: var(--gutter);
  display: grid; grid-template-columns: 1fr; gap: 6px clamp(16px, 2vw, 40px); align-items: end;
}
.gallery__head::before {
  content: ""; position: absolute; inset: -70px -120px -70px -90px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, #07070db8, #07070d61 60%, transparent);
}
.gallery__title {
  font-family: var(--f-display); font-weight: 600; line-height: 1; text-transform: uppercase;
  font-size: clamp(2rem, 3.2vw + .6rem, 6.2rem);
}
.gallery__title em { font-style: normal; color: var(--acc); }
.gallery__lead { max-width: 46ch; color: #ece9f6b8; font-size: clamp(13px, .35vw + 9px, 17px); }

.gallery__stage {
  --cw: clamp(260px, min(33vw, calc((100svh - var(--header-h) - 300px) / .85)), 820px);
  position: relative; height: calc(var(--cw) * .85);
  perspective: 1500px; perspective-origin: 50% 40%; transform-style: preserve-3d;
  cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none;
}
.gallery__stage.is-dragging { cursor: grabbing; }
.gallery__stage:focus-visible { outline: none; }
.gallery__stage:focus-visible .work.is-active .work__img { outline: 2px solid var(--acc); outline-offset: 4px; }

.work {
  position: absolute; top: 0; left: 50%;
  width: var(--cw); margin-left: calc(var(--cw) / -2);
  transform-style: preserve-3d; will-change: transform, opacity;
}
.work__open { display: block; color: inherit; cursor: inherit; }
.work.is-active .work__open { cursor: pointer; }
.work__img {
  position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 4px;
  border: 1px solid rgba(139, 124, 255, calc(.55 - var(--dim, 0) * .4));
}
/* L'ombra sfocata costa un ridisegno a ogni fotogramma mentre la scheda si
   muove: la tengo sulle tre davanti, dove si vede. */
.work.is-near .work__img {
  box-shadow: 0 30px 70px -28px #000000d9, 0 0 60px -14px rgba(139, 124, 255, calc(.3 - var(--dim, 0) * .28));
  -webkit-box-reflect: below 12px linear-gradient(transparent 68%, #00000038);
}
.work__img img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transition: transform 1.2s var(--ease-out);
  -webkit-user-drag: none;
}
/* Le schede lontane si spengono con un velo sopra, non con un filtro. Un
   filter su un'immagine dentro una trasformazione 3D viene ricalcolato a ogni
   fotogramma: erano cinque immagini e la meta' dei fotogrammi. Un velo e' un
   colore composto, e non costa niente. */
.work__img::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(115deg, #ffffff1a, transparent 32% 70%, #8b7cff14),
    linear-gradient(rgba(7, 7, 13, calc(var(--dim, 0) * .66)), rgba(7, 7, 13, calc(var(--dim, 0) * .66)));
}
.work__img::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    var(--corner) top left / 18px 1px, var(--corner) top left / 1px 18px,
    var(--corner) top right / 18px 1px, var(--corner) top right / 1px 18px,
    var(--corner) bottom left / 18px 1px, var(--corner) bottom left / 1px 18px,
    var(--corner) bottom right / 18px 1px, var(--corner) bottom right / 1px 18px;
  background-repeat: no-repeat;
}
.work.is-active .work__open:hover .work__img img { transform: scale(1.035); }
.work__cap {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 14px;
  margin-top: 18px; opacity: calc(1 - var(--fade, 0)); transition: opacity .3s;
}
.work__num { color: var(--acc); }
.work__title {
  font-family: var(--f-display); font-weight: 600; line-height: 1; text-transform: uppercase;
  font-size: clamp(22px, 1.4vw + 10px, 40px);
}
.work__cap .work__meta { grid-column: 2; color: var(--muted); font-size: 11px; }

.gallery__ui {
  position: absolute; left: 0; right: 0; bottom: clamp(18px, 5svh, 56px);
  display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none;
}
.gallery__count { font-size: 13px; }
.gallery__count span { color: var(--acc); }
.gallery__ticks { display: flex; gap: 5px; }
.gallery__ticks span {
  width: 11px; height: 2px; background: var(--line);
  transition: background .4s ease, width .4s var(--ease-out);
}
.gallery__ticks span.is-on { width: 30px; background: var(--acc); }
.gallery__hint { color: var(--muted); font-size: 10.5px; }

/* ---- referenze e testo lungo -------------------------------------------- */
.refs { display: flex; flex-wrap: wrap; gap: 8px; max-width: 70rem; margin-bottom: 34px; }
.refs li {
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 2px;
  background: #07070d4d; color: #ece9f6cf; font-size: 11px;
}
.legal { max-width: 58rem; }
.legal__body { display: grid; gap: 10px; margin-top: 18px; }
.legal__body h2 {
  margin-top: 26px; color: var(--ink);
  font-family: var(--f-display); font-weight: 600; text-transform: uppercase;
  font-size: clamp(18px, .8vw + 12px, 28px);
}
.legal__body p { max-width: 62ch; color: #ece9f6c7; }
.legal__body a { color: var(--acc); border-bottom: 1px solid var(--acc-soft); }

/* ---- modulo: i pezzi che mancavano -------------------------------------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.field select {
  width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 3px;
  background-color: #07070d80; color: var(--ink); font: inherit; font-size: 16px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%;
  background-repeat: no-repeat; background-size: 6px 6px;
  transition: border-color .3s, box-shadow .3s, background-color .3s;
}
.field select option { background: var(--bg-2); color: var(--ink); }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--acc); outline: none; box-shadow: 0 0 0 4px #8b7cff29;
}
.consent { display: flex; align-items: flex-start; gap: 12px; color: #ece9f6c7; font-size: 14px; line-height: 1.5; }
.consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--acc); }
.consent a { border-bottom: 1px solid var(--acc-soft); }
.is-invalid legend, .is-invalid > span, .consent.is-invalid { color: #ff9d80; }
.is-invalid input, .is-invalid textarea, .is-invalid select { border-color: #ff9d8066; }
.form__end { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.form__send { font-family: inherit; }
.form__send:disabled { opacity: .7; cursor: progress; }
.form__status { color: var(--muted); font-size: 11.5px; }
.form__status.is-error { color: #ff9d80; }
.done {
  display: grid; justify-items: start; gap: 22px; padding: clamp(10px, 3svh, 40px) 0;
  opacity: 0; transform: translateY(16px);
  transition: opacity .8s ease, transform 1s var(--ease-out);
}
.done.is-in { opacity: 1; transform: none; }
.done:focus { outline: none; }
.done .title { font-size: clamp(3rem, 6vw, 8rem); }

/* ---- entrare e uscire da una pagina -------------------------------------
   Il contenuto arretra e si sfoca mentre il sipario si chiude sul punto che
   hai premuto: la pagina si allontana invece di sparire. All'arrivo fa la
   strada al contrario. La scena 3D resta dove sta: e' lei a tenere il filo
   fra una pagina e l'altra, e infatti non la tocca nessuna di queste regole. */
main, .footer {
  transition: opacity .62s var(--ease-io), transform .78s var(--ease-io), filter .55s ease;
}
body.is-loading main { opacity: 0; transform: translateY(18px) scale(.995); }
body.is-loading .footer { opacity: 0; }
html.is-arrived main, html.is-arrived .footer { opacity: 1; transform: none; }
.header { transition: opacity .5s var(--ease-io), transform .55s var(--ease-io); }
html.is-leaving main, html.is-leaving .footer {
  opacity: 0; transform: translateY(-28px) scale(.982); filter: blur(7px);
}
html.is-leaving .header { opacity: 0; transform: translateY(-18px); }
html.is-leaving .hud { opacity: 0; }

@media (max-width: 900px) {
  .gallery { --per: 46svh; }
  .gallery__sticky {
    justify-content: flex-start;
    padding: calc(var(--header-h) + clamp(6px, 1.6svh, 18px)) 0 clamp(64px, 9svh, 110px);
  }
  .gallery__head { position: relative; inset: auto; flex: none; margin: 0 var(--gutter); }
  .gallery__stage {
    --cw: min(84vw, 460px, calc(40svh * 1.6));
    flex: auto; height: auto; min-height: 0; overflow: hidden;
    perspective: 1200px; perspective-origin: 50%;
    -webkit-mask-image: linear-gradient(transparent, #000 14% 86%, transparent);
    mask-image: linear-gradient(transparent, #000 14% 86%, transparent);
  }
  .work { top: 50%; margin-top: calc(var(--cw) * -.4); }
  .work__img { -webkit-box-reflect: none; }
  .page-hero .title, .contact .title, .legal .title { font-size: clamp(1.9rem, min(9vw, 4.6svh), 3.8rem); }
  .page-hero { min-height: 92svh; }
}

@media (min-width: 2000px) {
  .field input, .field textarea, .field select { padding: 18px 20px; font-size: 19px; }
  .consent { font-size: 17px; }
  .consent input { width: 24px; height: 24px; }
  .form__status { font-size: 14px; }
  .gallery__hint, .work__cap .work__meta { font-size: 13px; }
  .refs li { padding: 10px 18px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  body.is-loading main, body.is-loading .footer { opacity: 1; transform: none; }
  html.is-leaving main, html.is-leaving .footer { filter: none; transform: none; }
}

/* ---- ritratto e testo affiancati --------------------------------------- */
.duo {
  display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: clamp(28px, 5vw, 96px); align-items: center;
  padding: 0 var(--gutter);
}
.duo__text { display: grid; gap: clamp(16px, 2.2svh, 26px); }
.duo__text .body { max-width: 46ch; }
.duo__text .facts { margin-top: 6px; }

.shot { position: relative; margin: 0; }
.shot img {
  display: block; width: 100%; aspect-ratio: 4 / 5;
  object-fit: cover; object-position: center 16%;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg-2);
}
.shot::before {
  content: ""; position: absolute; inset: -18px -14px 20px; z-index: -1;
  background: radial-gradient(60% 55% at 50% 45%, #8b7cff2b, transparent 72%);
  filter: blur(14px);
}
.shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    var(--corner) top left / 20px 1px, var(--corner) top left / 1px 20px,
    var(--corner) top right / 20px 1px, var(--corner) top right / 1px 20px,
    var(--corner) bottom left / 20px 1px, var(--corner) bottom left / 1px 20px,
    var(--corner) bottom right / 20px 1px, var(--corner) bottom right / 1px 20px;
  background-repeat: no-repeat;
}
.shot figcaption { margin-top: 14px; color: var(--muted); }

/* ---- certificati --------------------------------------------------------
   Il documento e' chiaro e il sito e' nero: invece di buttarlo dentro cosi'
   com'e', lo tengo in una cornice sua, inclinata appena, come una carta
   appoggiata. Cliccarla porta alla verifica, che e' l'unica cosa che conta. */
.certs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(390px, 100%), 1fr)); gap: clamp(18px, 2.4vw, 42px); }
.cert {
  display: grid; grid-template-rows: auto 1fr; gap: 0; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(160deg, #14142477, #07070d55);
  transition: border-color .45s, transform .55s var(--ease-out), box-shadow .45s;
}
.cert:hover { transform: translateY(-5px); border-color: var(--acc-soft); box-shadow: 0 30px 80px -40px #000, 0 0 50px -24px #8b7cff66; }
.cert__shot {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 1200 / 927; background: #eceef3;
}
.cert__shot img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transition: transform 1.1s var(--ease-out);
}
.cert:hover .cert__shot img { transform: scale(1.025); }
.cert__shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 70%, #07070d26);
  border-bottom: 1px solid var(--line);
}
.cert__body { display: grid; gap: 9px; padding: 22px clamp(18px, 2vw, 28px) 26px; align-content: start; }
.cert__who { color: var(--acc); font-size: 10.5px; }
.cert h3 {
  font-family: var(--f-display); font-weight: 600; text-transform: uppercase; line-height: 1.08;
  font-size: clamp(19px, .8vw + 12px, 29px);
}
.cert p { color: #ece9f6b8; font-size: 14px; }
.cert .link { justify-self: start; margin-top: 4px; }

@media (max-width: 900px) {
  .duo { grid-template-columns: 1fr; gap: clamp(22px, 5svh, 40px); }
  .shot { max-width: 320px; }
  .shot::before { inset: -12px -10px 14px; }
  .certs { grid-template-columns: 1fr; }
  .cert__body { padding: 18px 18px 22px; }
  .refs { margin-bottom: 26px; }
}

/* ---- la fascia della scena ---------------------------------------------
   Dove la figura sta di lato, il contenuto si ferma prima. Senza questo il
   testo lungo arriva sotto al drago e diventa illeggibile: la scena non puo'
   costare la lettura. Sotto i 1100 px la figura e' gia' in alto e al centro,
   quindi non serve togliere niente. */
@media (min-width: 1100px) {
  .section { padding-right: max(var(--gutter), 25vw); }
  .duo { max-width: min(1180px, 74vw); }
  .block--wide .faq { max-width: min(900px, 60vw); }
  .legal { padding-right: max(var(--gutter), 26vw); }
}

/* ---- il carosello delle testimonianze ----------------------------------
   Stesso meccanismo dei lavori, ma le schede sono verticali: sono video
   ripresi col telefono, e un 9:16 dentro una cornice 16:10 sarebbe tutto
   bordo nero. Qui la scheda e' alta, la didascalia sta sotto, e il tocco fa
   partire il video dentro la cornice. */
.gallery--voci { --per: 52svh; }
.gallery--voci .gallery__stage {
  --cw: clamp(176px, min(19vw, calc((100svh - var(--header-h) - 330px) * 0.5)), 330px);
  height: calc(var(--cw) * 1.78 + 132px);
  perspective: 1700px;
}
.gallery--voci .work__img { aspect-ratio: 9 / 16; }
/* Il riflesso raddoppia il disegno di ogni scheda. Su schede verticali, che
   sono alte, si paga il doppio: lo tengo solo su quella davanti. */
.gallery--voci .work.is-near .work__img { -webkit-box-reflect: none; }
.gallery--voci .work.is-active .work__img {
  -webkit-box-reflect: below 10px linear-gradient(transparent 72%, #00000030);
}
.gallery--voci .work:not(.is-active) .work__play { opacity: .3; }
.gallery--voci .work__cap { margin-top: 14px; grid-template-columns: auto 1fr; }
.gallery--voci .work__title { font-size: clamp(17px, .7vw + 9px, 26px); }

.work__lead {
  grid-column: 2; margin-top: 6px; max-width: 32ch;
  color: #ece9f6bd; font-size: clamp(12.5px, .22vw + 10px, 15px); line-height: 1.5;
}

/* il triangolo di avvio, al centro della cornice */
.work__play {
  position: absolute; left: 50%; top: 50%; z-index: 2; pointer-events: none;
  width: 58px; height: 58px; margin: -29px 0 0 -29px;
  border: 1px solid var(--acc-soft); background-color: #07070db8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238b7cff'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 22px;
  /* Niente backdrop-filter qui. Dietro c'e' una scena che si ridisegna a ogni
     fotogramma, e una sfocatura dello sfondo va rifatta ogni volta: cinque di
     questi tasti dimezzavano i fotogrammi della pagina, da 57 a 26. Sopra una
     fotografia un nero semitrasparente rende uguale e non costa niente. */
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: border-color .4s, transform .5s var(--ease-out), opacity .3s;
}
.work.is-active .work__open:hover .work__play { border-color: var(--acc); transform: scale(1.08); }
.voice__play.is-live .work__play { opacity: 0; }
.work__img.voice__play iframe {
  position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; border: 0;
}

@media (max-width: 900px) {
  .gallery--voci { --per: 42svh; }
  .gallery--voci .gallery__stage {
    --cw: min(58vw, 290px, calc(38svh * 0.56));
    height: auto;
  }
  .gallery--voci .work__lead { display: none; }
}

/* ---- verticale ----------------------------------------------------------
   Il telefono tenuto dritto non e' uno schermo piccolo: e' uno schermo di
   un'altra forma. La figura sta in alto, il testo le scorre sotto, e i titoli
   vanno misurati anche sull'altezza — non solo sulla larghezza — altrimenti
   tre parole si mangiano mezzo schermo.

   La soglia e' il rapporto fra i lati, non i pixel: e' la stessa che usa
   world.js per decidere dove mettere la figura, quindi layout e scena
   cambiano idea nello stesso momento. */
@media (max-aspect-ratio: 19/20) {
  :root {
    --gutter: clamp(18px, 5.4vw, 40px);
    --bottom: calc(env(safe-area-inset-bottom) + clamp(46px, 7.5svh, 80px));
    --below-shape: 46svh;
  }

  /* Il velo. In verticale il testo passa per forza sopra alla figura: invece
     di spegnere la figura dappertutto, scurisco il fondo dello schermo, che
     e' dove c'e' da leggere. Sta fra la scena (z 0) e il contenuto (z 2). */
  body::before {
    content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(transparent 40%, #07070d29 50%, #07070d80 66%, #07070dcc 84%, #07070df0 100%);
  }
  body.is-loading::before { display: none; }

  .title { font-size: clamp(1.6rem, min(7.4vw, 3.9svh), 3.2rem); line-height: 1.05; }
  .title--hero { max-width: none; font-size: clamp(1.95rem, min(9.2vw, 4.8svh), 4.2rem); }
  .title--cta { font-size: clamp(2.3rem, min(12vw, 6.4svh), 5.4rem); }
  .page-hero .title, .contact .title, .legal .title { font-size: clamp(1.9rem, min(9vw, 4.6svh), 3.8rem); }
  .gallery__title { font-size: clamp(1.7rem, min(7.6vw, 4svh), 3.2rem); }
  .title em { text-shadow: none; }

  .hero, .page-hero { padding-bottom: var(--bottom); }
  .cta { padding-bottom: calc(var(--bottom) + 4svh); }
  .scroll-hint { display: none; }

  .block { height: 180svh; }
  .block__text {
    max-width: none; justify-content: flex-end;
    gap: clamp(12px, 1.8svh, 20px);
    padding: 0 var(--gutter) var(--bottom);
  }
  .block--wide { height: auto; min-height: 100svh; padding: var(--below-shape) 0 10svh; }
  .block--wide .block__text { padding: 0 var(--gutter); }
  .section { padding: var(--below-shape) var(--gutter) 10svh; }
  .page { padding-top: var(--below-shape); }
  /* Il modulo comincia sotto alla figura, che qui e' piu' piccola delle
     altre: 46svh sarebbero mezzo schermo di nero prima del titolo. */
  .contact { padding-top: 30svh; }
  .contact__intro { gap: clamp(14px, 2svh, 22px); }

  /* I quattro passi del metodo.
     In quattro colonne su un telefono ogni scheda e' larga ottanta pixel e
     non si legge niente. In colonna sarebbero quattro schermate di scatole
     tutte uguali. Cosi' invece ogni passo e' una riga: numero e nome a
     sinistra, le tre cose che succedono a destra. Ci stanno tutti e quattro
     insieme, che e' il punto — sono un percorso, e un percorso si guarda
     intero. */
  .steps {
    grid-template-columns: 1fr;
    gap: clamp(6px, 1.1svh, 10px);
    margin-top: clamp(16px, 2.6svh, 28px);
  }
  .steps li {
    display: grid; grid-template-columns: 38% 1fr; align-items: start;
    gap: 0 12px; padding: clamp(10px, 1.5svh, 14px) 14px;
  }
  .steps .mono { grid-area: 1 / 1; font-size: 10px; }
  .steps h3 { grid-area: 2 / 1 / span 2; margin: 4px 0 0; font-size: clamp(15px, 4.4vw, 20px); }
  .steps p {
    grid-column: 2; border-top: 0; padding: 1px 0;
    font-size: clamp(11.5px, 3.2vw, 13.5px); line-height: 1.4;
  }
}

/* ---- la scheda aperta ---------------------------------------------------
   Mentre un video suona, tutto il resto si toglie di mezzo: titolo della
   sezione, contatore, didascalie. Restano il video e lo spazio intorno. */
.gallery.is-playing .gallery__head,
.gallery.is-playing .gallery__ui { opacity: 0; transition: opacity .45s ease; }
.gallery__head, .gallery__ui { transition: opacity .6s ease; }
.work.is-playing .work__cap { opacity: 0; }
.work.is-playing .work__img { border-color: var(--acc); }
.work.is-playing .work__img::before,
.work.is-playing .work__img::after { opacity: 0; transition: opacity .3s; }

/* ---- caroselli in verticale ---------------------------------------------
   In orizzontale il contatore galleggia sopra al palco e va bene: c'e' aria.
   In verticale l'aria non c'e', e galleggiando finisce sopra alle schede. Qui
   torna nel flusso, sotto al palco, dove non copre niente. */
@media (max-aspect-ratio: 19/20) {
  .gallery__sticky { justify-content: flex-start; gap: 10px; }
  .gallery__ui { position: relative; inset: auto; margin-top: 10px; padding-bottom: env(safe-area-inset-bottom); }
  .gallery__head::before { inset: -50px -60px -40px -50px; background: radial-gradient(closest-side, #07070deb, #07070da8 62%, transparent); }
  .gallery__lead { font-size: 13px; }
  .gallery--voci .gallery__stage {
    --cw: min(54vw, 260px, calc(34svh * 0.56));
    /* meno sfumatura ai bordi: col palco corto, il 14% di prima si mangiava
       la didascalia */
    -webkit-mask-image: linear-gradient(transparent, #000 6% 94%, transparent);
    mask-image: linear-gradient(transparent, #000 6% 94%, transparent);
  }
  /* La scheda si centra sulla propria altezza vera — immagine piu' didascalia
     — non su una frazione della larghezza. Con la frazione il nome della
     persona finiva sotto il bordo del palco, tagliato via. */
  .gallery--voci .work { margin-top: calc((var(--cw) * 1.78 + 58px) / -2); }
  .gallery--voci .work__cap { margin-top: 10px; }
  .gallery--voci .work__title { font-size: clamp(15px, 4.2vw, 19px); }
  .work__cap .work__meta { font-size: 10px; }
}
