/* ======================================================
   RAIN INK TATTOO — FOGLIO DI STILE (versione scura, dalla 6.0)
   Colori e componenti della home scura: fondo nero, testo avorio, rosso neon,
   navbar 3D sospesa, pulsanti in rilievo che si abbassano quando si premono.
   ====================================================== */

/* ---------- Variabili e reset ---------- */
:root {
  --bg: #0a0a0c;          /* fondo */
  --bg2: #121216;         /* sezioni alternate e riquadri */
  --card: #16161b;        /* campi e schede */
  --line: #24242b;        /* fili e bordi */
  --txt: #ebe3d2;         /* testo principale, avorio */
  --mute: #9a958c;        /* testo secondario */
  --red: #d6342c;         /* rosso del marchio */
  --red2: #ff5a4a;        /* rosso neon, per testi e dettagli sul nero */
  --paper: #efe6d3;       /* carta dei disegni */
  --cta-top: #d93a30; --cta-bot: #b8261f;   /* pulsante rosso: bianco sopra, contrasto ≥ 4,5 */
  --ease: cubic-bezier(.23, 1, .32, 1);
  --head: 'Inter Tight', Inter, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --body: Inter, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --r: 18px;
  --top: 104px;           /* spazio sotto la navbar sospesa */
  /* nomi usati da js/cookie.js */
  --inchiostro: #121216; --carta: #ebe3d2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--top); background: var(--bg); -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  font: 400 1.0625rem/1.6 var(--body); color: var(--txt); background: var(--bg);
  overflow-x: clip; -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh;
}
main { flex: 1 0 auto; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red2); outline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--red); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { left: 16px; }

/* ---------- Tipografia ---------- */
h1, h2, h3 { font-family: var(--head); color: var(--txt); text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 7vw, 6rem); font-weight: 800; letter-spacing: -.04em; line-height: .98; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.8rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.04; margin-bottom: 1.1rem; }
h3 { font-size: clamp(1.25rem, 1.8vw, 1.55rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
p { max-width: 62ch; color: var(--mute); }
p + p { margin-top: 1rem; }
strong { color: var(--txt); font-weight: 600; }
.eyebrow { display: block; font: 500 .92rem/1.4 var(--body); color: var(--red2); margin-bottom: .7rem; }

/* ---------- Layout ---------- */
.wrap { width: min(1180px, 100% - 2 * clamp(16px, 4vw, 48px)); margin-inline: auto; }
section { padding: clamp(5rem, 10vw, 7.5rem) 0; }
.alt { background: linear-gradient(180deg, transparent, var(--bg2) 12%, var(--bg2) 88%, transparent); }
/* Home: ogni sezione dopo la prima schermata si apre con un filo rosso al neon (proposta 16) */
.home-page main > section:not(.hero) { background:
  linear-gradient(90deg, transparent, rgba(255, 90, 74, .7), transparent) top / 100% 1px no-repeat,
  radial-gradient(ellipse 50% 80px at 50% 0, rgba(255, 90, 74, .12), transparent) top / 100% 160px no-repeat,
  var(--bg); }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem 4rem; flex-wrap: wrap; margin-bottom: 3rem; }
.sec-head h2 { margin: 0; }
.sec-head > p { max-width: 40ch; }

/* ---------- Pulsanti e link ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .8rem 1.35rem; border: 0; border-radius: 12px; cursor: pointer;
  font: 600 .95rem/1.2 var(--body); color: #fff; text-align: center;
  background: linear-gradient(180deg, var(--cta-top), var(--cta-bot));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 5px 0 #6e140f, 0 16px 26px -8px rgba(0, 0, 0, .7);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 1px 0 #6e140f, 0 6px 12px -4px rgba(0, 0, 0, .6); }
.btn.ghost { color: var(--txt); background: linear-gradient(180deg, #24242a, #16161a); box-shadow: 0 0 0 1px var(--line) inset, 0 5px 0 #050506; }
.btn.ghost:active { box-shadow: 0 0 0 1px var(--line) inset, 0 1px 0 #050506; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn svg { flex: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 7px 0 #6e140f, 0 20px 30px -8px rgba(0, 0, 0, .75); }
  .btn.ghost:hover { box-shadow: 0 0 0 1px #34343d inset, 0 7px 0 #050506; }
}
.btns { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

.link { display: inline-flex; align-items: center; gap: .25rem; font-weight: 500; color: var(--red2); }
.link::after { content: '›'; font-size: 1.25em; line-height: 1; transition: transform 200ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration: underline; text-underline-offset: 4px; }
  .link:hover::after { transform: translateX(3px); }
}

/* ======================================================
   NAVBAR: lastra sospesa ferma (niente inclinazione col mouse), luce rossa che corre
   lungo il contorno avanti e indietro, voci e lucchetto che si sollevano e ingrandiscono al passaggio.
   Sotto i 1020 px: panino e pannello che scende.
   ====================================================== */
.nav3d { position: fixed; top: 14px; left: 0; right: 0; z-index: 50; perspective: 1200px; pointer-events: none; }
.nav3d .slab {
  pointer-events: auto; position: relative; width: min(1180px, 100% - 24px); margin-inline: auto;
  display: flex; align-items: center; gap: 20px; padding: 10px 18px 10px 20px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(32, 32, 38, .96), rgba(14, 14, 18, .96));
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 -1px 0 rgba(0, 0, 0, .6) inset, 0 6px 0 #050506, 0 30px 60px -10px rgba(0, 0, 0, .8);
  transform-style: preserve-3d;
  transition: padding .25s var(--ease);
}
.nav3d.small .slab { padding-block: 6px; }
.nav-giro { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.nav-giro rect { fill: none; stroke-linecap: round; stroke-dasharray: 90 910; animation: nav-giro 9s ease-in-out infinite alternate; }
.nav-giro .luce { stroke: #ff6a5a; stroke-width: 1.6; }
.nav-giro .alone { stroke: rgba(255, 60, 45, .55); stroke-width: 7; filter: blur(5px); }
@keyframes nav-giro { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -1000; } }
.nav3d .logo { display: flex; align-items: center; flex: none; transform: translateZ(30px); }
.nav3d .logo img { height: 38px; width: auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); }
.links { display: flex; gap: 4px; list-style: none; margin-left: auto; transform-style: preserve-3d; }
.links a { position: relative; display: block; padding: 10px 13px; font-size: 14px; font-weight: 500; color: var(--mute); white-space: nowrap;
  border-radius: 11px; transform-style: preserve-3d; transform: translateZ(10px);
  transition: transform 220ms var(--ease), color 200ms ease, background-color 200ms ease, box-shadow 220ms var(--ease); }
.links a[aria-current], .links a:focus-visible { color: var(--txt); background: linear-gradient(180deg, #2a2a31, #18181d);
  transform: translateZ(24px) translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .1) inset, 0 4px 0 #050506, 0 14px 24px -6px rgba(0, 0, 0, .9); }
.links a[aria-current]::before { content: ""; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--red2); }
@media (hover: hover) and (pointer: fine) {
  .links a:hover { color: var(--txt); background: linear-gradient(180deg, #303038, #1a1a20);
    transform: translateZ(24px) translateY(-4px) scale(1.1); box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 6px 0 #050506, 0 18px 28px -6px rgba(0, 0, 0, .95); }
}
.burger { display: none; margin-left: auto; width: 46px; height: 46px; border-radius: 12px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #2a2a31, #17171c); box-shadow: 0 1px 0 rgba(255, 255, 255, .1) inset, 0 4px 0 #050506; transform: translateZ(30px); }
.burger span { display: block; width: 20px; height: 2px; margin: 5px auto; background: var(--txt); border-radius: 2px; transition: transform 200ms var(--ease), opacity 150ms ease; }
.nav3d.open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav3d.open .burger span:nth-child(2) { opacity: 0; }
.nav3d.open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1020px) {
  .burger { display: block; }
  .links { position: absolute; top: calc(100% + 14px); left: 0; right: 0; flex-direction: column; gap: 8px; padding: 12px;
    max-height: calc(100svh - 110px); overflow-y: auto;
    border-radius: 18px; background: rgba(14, 14, 18, .97); border: 1px solid rgba(255, 255, 255, .07);
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, .9);
    visibility: hidden; opacity: 0; transform: rotateX(-12deg) scale(.97); transform-origin: top right;
    transition: opacity 200ms var(--ease), transform 220ms var(--ease), visibility 0s 220ms; }
  .nav3d.open .links { visibility: visible; opacity: 1; transform: none; transition: opacity 200ms var(--ease), transform 220ms var(--ease); }
  .links li { transform: rotateX(-40deg); transform-origin: top; opacity: 0; transition: transform 220ms var(--ease), opacity 200ms var(--ease); }
  .nav3d.open .links li { transform: none; opacity: 1; }
  .nav3d.open .links li:nth-child(2) { transition-delay: 25ms; }
  .nav3d.open .links li:nth-child(3) { transition-delay: 50ms; }
  .nav3d.open .links li:nth-child(4) { transition-delay: 70ms; }
  .nav3d.open .links li:nth-child(5) { transition-delay: 90ms; }
  .nav3d.open .links li:nth-child(6) { transition-delay: 110ms; }
  .nav3d.open .links li:nth-child(7) { transition-delay: 130ms; }
  .links a, .links a[aria-current], .links a:hover { padding: 14px 16px; font-size: 17px; background: #16161b; color: var(--txt); transform: none; box-shadow: none; }
  .links a[aria-current]::before { left: 0; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; }
}

/* ======================================================
   COMPARSA ALLO SCORRIMENTO: sale di poco e si accende, uno dopo l'altro
   ====================================================== */
.js .rv { opacity: 0; transform: translateY(16px); transition: opacity 500ms var(--ease) var(--rv-d, 0s), transform 500ms var(--ease) var(--rv-d, 0s); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- Immagini ---------- */
.ph { position: relative; display: block; overflow: hidden; background: var(--paper); border-radius: 14px; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .9); }
.ph img { width: 100%; height: 100%; object-fit: cover; }

/* ======================================================
   PAGINE INTERNE: intestazione con alone rosso
   ====================================================== */
.page-hero { position: relative; padding: calc(var(--top) + 3.5rem) 0 3.5rem; text-align: center; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; left: 50%; top: -180px; width: min(900px, 120vw); height: 520px; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, rgba(214, 52, 44, .26), transparent 65%); }
.page-hero .wrap { position: relative; }
.page-hero h1 { margin-bottom: 1.1rem; }
.page-hero p { margin: 0 auto; font-size: 1.2rem; line-height: 1.5; max-width: 46ch; }
.page-hero p a { color: var(--red2); white-space: nowrap; }
.page-hero + section, .page-hero + .wrap { padding-top: 1.5rem; }

/* Tatuaggi: uno stile per riga */
.style-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2.5rem, 6vw, 5.5rem); align-items: center; padding: 4.5rem 0; scroll-margin-top: var(--top); }
.style-row + .style-row { border-top: 1px solid var(--line); }
.style-row:nth-child(even) > .ph { order: 2; }
.style-row > .ph { aspect-ratio: 4 / 5; }
.specs { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: 2rem; }
.specs li { padding: 1rem 1.1rem; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; font-size: .95rem; color: var(--mute); }
.specs b { display: block; font-size: .8rem; font-weight: 600; color: var(--red2); margin-bottom: .2rem; }
.note { margin-top: 3rem; padding: 1.1rem 1.3rem; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; font-size: .92rem; color: var(--mute); max-width: none; }

/* Portfolio: filtro a pillola con l'indicatore che scivola */
.filters-wrap { display: flex; justify-content: center; margin-bottom: 3rem; }
.filters { position: relative; display: inline-flex; max-width: 100%; padding: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { position: relative; z-index: 1; flex: none; min-height: 40px; background: none; border: 0; padding: .5rem 1.05rem; border-radius: 10px; font-size: .92rem; font-weight: 500; color: var(--mute); cursor: pointer; transition: color 200ms ease; }
.filters button[aria-pressed="true"] { color: var(--txt); }
@media (hover: hover) and (pointer: fine) { .filters button:hover { color: var(--txt); } }
.seg-thumb { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 10px; background: linear-gradient(180deg, #2c2c33, #1b1b20); box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 3px 0 #050506; transition: transform 350ms var(--ease), width 350ms var(--ease); }
.filters:not(.has-thumb) button[aria-pressed="true"] { background: #24242a; }

.works { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.8rem 1.4rem; }
.work button { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: zoom-in; }
.work .ph { aspect-ratio: 4 / 5; transition: transform 400ms var(--ease), box-shadow 400ms var(--ease), filter 900ms var(--ease); }
.work .ph img { transition: transform 700ms var(--ease); }
/* PARETE AL NEON: le foto si accendono una alla volta quando arrivano in vista, con il bagliore
   rosso della scritta Rain Ink; col mouse sopra la foto si ingrandisce e il neon si accende di più */
.work.acceso .ph, html:not(.js) .work .ph { box-shadow: 0 0 0 1px rgba(214, 52, 44, .75), 0 0 26px rgba(214, 52, 44, .4), 0 0 70px rgba(214, 52, 44, .15), 0 30px 60px -24px rgba(0, 0, 0, .9); }
.js .work:not(.acceso) .ph { filter: brightness(.25) saturate(0); box-shadow: 0 0 0 1px rgba(214, 52, 44, 0), 0 30px 60px -24px rgba(0, 0, 0, .9); }
@media (hover: hover) and (pointer: fine) {
  .work button:hover .ph { transform: scale(1.035); box-shadow: 0 0 0 2px #ff4a3d, 0 0 34px rgba(255, 74, 61, .7), 0 0 110px rgba(214, 52, 44, .35), 0 30px 60px -24px rgba(0, 0, 0, .9); }
  .work button:hover .ph img { transform: scale(1.14); }
}
/* il titolo sta dentro la foto, in basso, su una sfumatura scura (come i video della Home) */
.work { position: relative; }
.work .ph::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(transparent 58%, rgba(0, 0, 0, .82)); }
.work figcaption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem;
  padding: 0 1.1rem 1rem; font-size: .92rem; color: rgba(255, 255, 255, .78); text-shadow: 0 1px 6px #000; pointer-events: none; transition: transform 300ms var(--ease); }
.work figcaption b { color: #fff; font-weight: 600; }
.work figcaption { transform-origin: 50% 100%; }
@media (hover: hover) and (pointer: fine) { .work button:hover + figcaption { transform: scale(1.035); } }
.work.is-video button { cursor: pointer; }
/* pulsante play sulle copertine dei video */
.play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: rgba(10, 10, 12, .55); border: 1px solid rgba(255, 255, 255, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform 300ms var(--ease), background 300ms var(--ease); pointer-events: none; }
.play::after { content: ""; position: absolute; left: 26px; top: 21px; border-style: solid; border-width: 11px 0 11px 17px; border-color: transparent transparent transparent #fff; }
@media (hover: hover) { .work button:hover .play { transform: scale(1.1); background: rgba(10, 10, 12, .75); } }

/* VIDEO DELLA HOME: striscia orizzontale di video verticali */
.clips { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 24vw, 300px); gap: 1.2rem; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 1rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.clips:focus-visible { outline: 2px solid var(--txt); outline-offset: 6px; border-radius: 14px; }
.clip { scroll-snap-align: start; margin: 0; }
.clip video { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 14px; background: #000;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .9); }
.clip figcaption { padding-top: .8rem; font-size: .92rem; font-weight: 600; }
/* con JS: nastro largo quanto la pagina che scorre da solo (si ferma col mouse sopra o col tasto Tab) */
.clips.nastro { display: block; overflow: hidden; padding: 0 0 1rem; scroll-snap-type: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.clips-tr { display: flex; gap: 16px; width: max-content; padding-left: 16px; animation: nastro 50s linear infinite; will-change: transform; backface-visibility: hidden; }
.clips.nastro:hover .clips-tr, .clips.nastro:focus-within .clips-tr, .clips.fermo .clips-tr { animation-play-state: paused; }
@keyframes nastro { to { transform: translate3d(-50%, 0, 0); } }
.nastro .clip { position: relative; flex: none; width: clamp(180px, 19vw, 250px); cursor: pointer; border-radius: 14px; outline-offset: 4px; }
.nastro .clip video { display: none; position: absolute; left: 0; top: 0; height: 100%; box-shadow: none; }
.nastro .clip.va video { display: block; }
.clip-cop { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 14px; background: #000; -webkit-user-drag: none; }
.nastro .clip::after { content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  background: linear-gradient(transparent 55%, rgba(0, 0, 0, .85)); }
.nastro .clip figcaption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 0 1rem 1rem; font-size: .95rem; text-shadow: 0 1px 6px #000; }
.clip-pl { position: absolute; left: 50%; top: 50%; z-index: 1; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  background: rgba(10, 10, 12, .62); border: 1px solid rgba(255, 255, 255, .35);
  pointer-events: none; transition: opacity .3s; }
.clip-pl::after { content: ""; position: absolute; left: 23px; top: 18px; border-left: 16px solid #fff; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.clip.va .clip-pl { opacity: 0; }
@media (hover: hover) and (pointer: fine) { .nastro .clip { transition: transform .5s var(--ease); } .nastro .clip:hover { transform: scale(1.03); } }
@media (max-width: 640px) { .nastro .clip { width: 46vw; } }
@media (prefers-reduced-motion: reduce) {
  .clips.nastro { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .clip-copia { display: none; }
}

/* Foto a schermo intero (portfolio): vetro scuro, la foto si ingrandisce dalla miniatura */
.lb { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 4.5rem 6rem;
  background: rgba(5, 5, 7, .88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: fadeIn 280ms var(--ease); }
.lb.out { animation: fadeOut 250ms ease forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.lb figure { display: flex; flex-direction: column; align-items: center; max-height: 100%; }
.lb img, .lb video { max-height: calc(100vh - 11rem); max-height: calc(100dvh - 11rem); width: auto; border-radius: 14px; background: var(--paper); box-shadow: 0 60px 120px -20px rgba(0, 0, 0, .95); }
.lb video { max-width: 100%; background: #000; }
.lb [hidden] { display: none; }
.lb figcaption { padding-top: 1.1rem; font-weight: 600; text-align: center; }
.lb figcaption small { display: block; font-weight: 400; color: var(--mute); }

/* frecce tonde in rilievo (portfolio, ruota della home) */
.arrow, .lb button, .lb3d .lb-lente { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; color: var(--txt); font-size: 20px; line-height: 1;
  background: linear-gradient(180deg, #26262c, #141418); box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 5px 0 #050506;
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease); }
.arrow:active, .lb button:active, .lb3d .lb-lente:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 1px 0 #050506; }
@media (hover: hover) and (pointer: fine) {
  .arrow:hover, .lb button:hover, .lb3d .lb-lente:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 7px 0 #050506; }
}
.lb button { position: absolute; }
.lb .lb-x { top: 1.2rem; right: 1.2rem; }
/* interruttore «Lente» nella foto a schermo intero, sotto la didascalia (spento di partenza, la scelta resta ricordata) */
.lb .lb-lente, .lb3d .lb-lente { position: absolute; top: 1.2rem; left: 1.2rem; width: auto; height: 44px; padding: 0 14px 0 7px; border-radius: 999px; display: inline-flex; align-items: center; gap: 10px; font: 600 14px var(--body); }
.lb .lb-lente[hidden], .lb3d .lb-lente[hidden] { display: none; }
/* l'interruttore sta nella didascalia, subito sotto il numero (es. «03 / 09») */
.lb figcaption .lb-lente, .lb3d figcaption .lb-lente { position: static; margin-top: 1rem; letter-spacing: 0; }
.lb-lente i { position: relative; width: 44px; height: 26px; border-radius: 999px; background: #3a3a42; transition: background 200ms; }
.lb-lente i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 200ms var(--ease); }
.lb-lente[aria-checked="true"] i { background: var(--red); }
.lb-lente[aria-checked="true"] i::after { transform: translateX(18px); }
.lb figure { position: relative; }
.lb.lente-on img, .lb3d.lente-on img { cursor: none; touch-action: none; }
.lb-vetro { position: absolute; z-index: 2; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%; border: 3px solid #fff; pointer-events: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .7), 0 0 0 1px rgba(214, 52, 44, .6); background-repeat: no-repeat; opacity: 0; transition: opacity 150ms; }
.lb.lente-on .lb-vetro.su, .lb3d.lente-on .lb-vetro.su { opacity: 1; }
.lb-aiuto { margin-top: .6rem; font: 400 13px var(--body); color: rgba(255, 255, 255, .6); text-align: center; }
.lb-aiuto:empty { display: none; }
.lb3d .lb-aiuto { align-self: center; }
@media (max-width: 700px) { .lb-vetro { width: 160px; height: 160px; margin: -80px 0 0 -80px; } }
.lb .lb-p { left: 1.4rem; top: 50%; margin-top: -26px; }
.lb .lb-n { right: 1.4rem; top: 50%; margin-top: -26px; }

/* Studio: testo accanto all'immagine */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5.5rem); align-items: center; }
.split > .ph { aspect-ratio: 4 / 5; }
.split.rev > .ph { order: 2; }
.facts { list-style: none; margin-top: 2rem; }
.facts li { display: grid; grid-template-columns: 2.6rem 1fr; gap: 1rem; padding: 1.05rem 0; border-top: 1px solid var(--line); color: var(--mute); }
.facts li b { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--red2); }
.facts li strong { display: block; }

.hygiene { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.hygiene li { padding: 2rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); color: var(--mute); }
.hygiene h3 { margin-bottom: .6rem; }
.hygiene b { display: block; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--red2); margin-bottom: 1rem; }

.zones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; align-items: start; }
.zone { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 2rem; }
.zone h3 { margin-bottom: .8rem; }
.zone ul { list-style: none; }
.zone li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.zone li:last-child { border: 0; }
.zone li span:last-child { color: var(--mute); font-size: .92rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.care { list-style: none; counter-reset: c; margin: 1.6rem 0; }
.care li { counter-increment: c; position: relative; padding: .9rem 0 .9rem 2.8rem; border-top: 1px solid var(--line); color: var(--mute); }
.care li::before { content: counter(c, decimal-leading-zero); position: absolute; left: 0; top: .9rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--red2); }

/* Cura del tatuaggio: la linea si riempie scorrendo */
.timeline { position: relative; list-style: none; max-width: 900px; margin: 0 auto; padding-left: 3rem; }
.timeline::before, .timeline::after { content: ''; position: absolute; left: 7px; top: 0; width: 2px; border-radius: 2px; }
.timeline::before { bottom: 0; background: var(--line); }
.timeline::after { height: calc(var(--p, 1) * 100%); background: var(--red2); box-shadow: 0 0 12px rgba(255, 90, 74, .6); }
.timeline > li { position: relative; padding-bottom: 3.5rem; }
.timeline > li::before { content: ''; position: absolute; left: calc(-3rem + 1px); top: .3rem; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid #3a3a42; transition: background-color 300ms ease, border-color 300ms ease, transform 300ms var(--ease); }
.timeline > li.on::before { background: var(--red2); border-color: var(--red2); transform: scale(1.2); }
.timeline .when { font-size: .95rem; font-weight: 500; color: var(--red2); }
.timeline h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); margin: .3rem 0 .9rem; }
.timeline ul { list-style: none; margin-top: 1.1rem; display: grid; gap: .55rem; }
.timeline ul li { padding: .85rem 1.05rem; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; color: var(--mute); max-width: 70ch; }
.warn { max-width: 900px; margin: 0 auto; padding: 1.6rem 1.8rem; background: rgba(214, 52, 44, .1); border: 1px solid rgba(255, 90, 74, .3); border-radius: var(--r); }
.warn p { max-width: none; color: var(--txt); }
.guide-dl { display: flex; align-items: center; justify-content: center; gap: 1rem 1.4rem; flex-wrap: wrap; }
.guide-dl span { color: var(--mute); font-size: .95rem; }
.guide-dl + section { padding-top: 3.5rem; }

/* FAQ: risposte che si aprono morbide */
.faq { max-width: 860px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding: 1.5rem 0; cursor: pointer; font: 700 clamp(1.15rem, 2vw, 1.4rem)/1.25 var(--head); letter-spacing: -.02em; transition: color 200ms ease; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: linear-gradient(180deg, #26262c, #141418); font: 300 1.4rem/1 var(--body); color: var(--txt); transition: transform 300ms var(--ease), background 200ms ease; }
.faq details[open] summary::after { transform: rotate(45deg); background: linear-gradient(180deg, var(--cta-top), var(--cta-bot)); border-color: transparent; color: #fff; }
@media (hover: hover) and (pointer: fine) { .faq summary:hover { color: var(--red2); } }
.faq .ans { overflow: hidden; }
.faq .ans p { padding: 0 0 1.5rem; font-size: 1.05rem; }
.faq .ans a { color: var(--red2); }
.faq-cta { text-align: center; margin-top: 3rem; }

/* Modulo dei contatti */
.contact-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.c-list { list-style: none; border-top: 1px solid var(--line); }
.c-list li { display: grid; gap: .2rem; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.c-list small { font-size: .85rem; color: var(--mute); }
.c-list a { font-weight: 500; transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .c-list a:hover { color: var(--red2); } }
.form-s { display: grid; gap: 1.4rem; }
.form-s label { display: block; font: 500 .95rem/1.4 var(--body); color: var(--txt); }
.form-s input:not([type=checkbox]), .form-s textarea { display: block; width: 100%; margin-top: .5rem; padding: .9rem 1rem; background: var(--card); border: 1px solid #2e2e36; border-radius: 12px; color: var(--txt); transition: border-color 200ms ease, box-shadow 200ms ease; }
.form-s input:not([type=checkbox]) { height: 54px; }
.form-s textarea { min-height: 150px; resize: vertical; }
.form-s input:focus, .form-s textarea:focus { outline: none; border-color: var(--red2); box-shadow: 0 0 0 4px rgba(255, 90, 74, .18); }
.form-s .check { display: flex; gap: .8rem; align-items: flex-start; font-weight: 400; font-size: .92rem; line-height: 1.55; color: var(--mute); }
.check input { margin-top: .25rem; accent-color: var(--red); width: 18px; height: 18px; flex: none; }
.form-s .check a { color: var(--txt); text-decoration: underline; text-underline-offset: 3px; }
.form-s .btn { width: 100%; }
.form-msg { padding: 1rem 1.2rem; border-radius: 12px; background: rgba(214, 52, 44, .12); border: 1px solid rgba(255, 90, 74, .3); color: var(--txt); max-width: none; }

/* Finestra di conferma dell'invio */
.thanks { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(5, 5, 7, .8); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: fadeIn 250ms var(--ease); }
.thanks-box { max-width: 440px; padding: 2.6rem; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); text-align: center; box-shadow: 0 40px 80px rgba(0, 0, 0, .6); animation: popIn 300ms var(--ease); }
@keyframes popIn { from { opacity: 0; transform: scale(.95); } }
.thanks-box h2 { font-size: 2rem; margin-bottom: .8rem; }
.thanks-box p { margin: 0 auto 1.8rem; }

/* Privacy */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.6rem; margin: 2.4rem 0 .8rem; }
.legal ul { padding-left: 1.2rem; margin-top: .6rem; color: var(--mute); }
.legal a { color: var(--red2); }

/* ======================================================
   RIQUADRO «PRENOTA» (fine della home e delle pagine)
   ====================================================== */
.book { text-align: center; }
.book .box { position: relative; padding: clamp(3.5rem, 8vw, 5rem) 24px; border-radius: 24px; overflow: hidden; background: linear-gradient(180deg, #151518, #101013); border: 1px solid var(--line); }
.book .box::before { content: ""; position: absolute; left: 50%; top: -60%; width: 80%; height: 120%; transform: translateX(-50%); pointer-events: none; background: radial-gradient(ellipse at 50% 50%, rgba(214, 52, 44, .16), transparent 65%); }
.book .box > * { position: relative; }
.book h2 { font-size: clamp(2.2rem, 5.5vw, 4.4rem); margin: 0 0 1rem; }
.book p { max-width: 52ch; margin: 0 auto; }
.book .btns { justify-content: center; }

/* ======================================================
   HOME: PRIMA SCHERMATA (foto a tutto schermo, scritta «Rain Ink» grande in basso a sinistra)
   ====================================================== */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 620px; padding: 0; overflow: hidden; background: var(--bg); }
.hero-foto { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 55% 32%; filter: grayscale(1) contrast(1.1) brightness(.75);
  transform: translateX(4%) scale(1.08); } /* foto un po' spostata a destra (lo scale copre il bordo sinistro) */
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 45%, rgba(10, 10, 12, .95)), linear-gradient(180deg, rgba(10, 10, 12, .55), transparent 25%); }
.hero-testo { position: absolute; left: clamp(16px, 5vw, 80px); right: 16px; bottom: clamp(30px, 6vh, 70px); z-index: 2; }
.hero-scritta { margin: 0; font: 800 clamp(80px, 17vw, 300px)/.8 var(--head); letter-spacing: -.05em; text-transform: uppercase; color: var(--txt); }
.hero-sub { margin-top: 1.2rem; max-width: 90ch; padding-left: calc(clamp(80px, 17vw, 300px) * .035); /* allineata al bordo visibile di «RAIN INK» */ font: 500 clamp(14px, 1.4vw, 18px)/1.55 var(--body); letter-spacing: .02em; color: var(--mute); }
/* Home: scritta RAIN INK come insegna al neon che sfarfalla (la K è il «tubo difettoso») */
.hero::before{content:"";position:absolute;inset:0;pointer-events:none;z-index:1;
background:radial-gradient(50% 42% at 22% 60%,rgba(255,59,47,.26),transparent 70%);
animation:luce 7s infinite steps(1,end)}
.hero-scritta.neon{color:#ffe3de;
text-shadow:0 0 2px #fff,0 0 8px #ff8a7d,0 0 18px #ff4a3c,0 0 38px #e8322a,0 0 80px #d6342c,0 0 140px rgba(214,52,44,.6);
animation:insegna 7s infinite steps(1,end)}
.neon .nl{display:inline-block}
.hero .hero-sub{color:var(--txt);text-shadow:0 1px 2px rgba(10,10,12,.9),0 0 18px rgba(10,10,12,.85)}
.neon .guasta{animation:tubo 3.7s infinite steps(1,end) .9s}
@keyframes insegna{
0%,58%,61%,63%,67%,100%{color:#ffe3de;text-shadow:0 0 2px #fff,0 0 8px #ff8a7d,0 0 18px #ff4a3c,0 0 38px #e8322a,0 0 80px #d6342c,0 0 140px rgba(214,52,44,.6)}
59%,62%,65%{color:#4a1a16;text-shadow:0 0 4px rgba(214,52,44,.25)}
60%,64%,66%{color:#ffb3aa;text-shadow:0 0 6px #ff4a3c,0 0 20px rgba(214,52,44,.5)}}
@keyframes luce{0%,58%,61%,63%,67%,100%{opacity:1}59%,62%,65%{opacity:.15}60%,64%,66%{opacity:.55}}
@keyframes tubo{
0%,40%,44%,49%,100%{opacity:1}
41%,43%,46%{opacity:.18;text-shadow:none;color:#4a1a16}
42%,45%,47%{opacity:.75}}
@media (prefers-reduced-motion:reduce){.hero-scritta.neon,.neon .guasta,.hero::before{animation:none}}
/* in basso a destra: «Scorri verso il basso» con una linea rossa in cui scende una luce */
.hero-scorri { position: absolute; right: clamp(16px, 2.2vw, 44px); bottom: 0; z-index: 2; height: clamp(110px, 20vh, 200px); padding: 0 0 0 14px; overflow: hidden;
  font: 500 12px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: rgba(235, 227, 210, .75); text-decoration: none; transition: color .3s ease; }
.hero-scorri::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: rgba(255, 90, 74, .25); }
.hero-scorri::after { content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 45%; background: linear-gradient(transparent, #ff5a4a 60%, #ff5a4a);
  box-shadow: 0 0 10px rgba(255, 90, 74, .7); animation: scorriLuce 2.2s cubic-bezier(.65, 0, .35, 1) infinite; will-change: transform; }
@keyframes scorriLuce { from { transform: translateY(-100%); } to { transform: translateY(230%); } }
.hero-scorri:hover, .hero-scorri:focus-visible { color: #ff5a4a; }
@media (prefers-reduced-motion: reduce) { .hero-scorri::after { animation: none; height: 100%; opacity: .8; } }
@media (max-width: 700px) { .hero-scorri { display: none; } }
/* la frase sotto RAIN INK non passa mai sotto «Scorri verso il basso»: a destra resta libera la sua striscia */
@media (min-width: 701px) { .hero-testo { right: calc(clamp(16px, 2.2vw, 44px) + 230px); } }
/* schermi stretti e alti (tablet in verticale, telefono): la foto non è più ingrandita a tutta altezza
   (si vedeva solo la spalla di Matteo); è meno zoomata e inquadra viso, mani e braccio che sta tatuando,
   poi sfuma nel nero dove stanno la scritta e la frase */
@media (max-aspect-ratio: 13/10) {
  .hero-foto { bottom: auto; height: min(100%, max(60%, 100vw / 1.35)); transform: none; object-position: 75% 35%;
    -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
}

/* HOME: coverflow dei lavori (le foto le scrive scripts/genera_lavori.py; il movimento è in js/home.js) */
#lavori { overflow-x: clip; }  /* la ruota 3D esce ai lati: su iPhone allargava la pagina (spazio nero a destra) */
@supports not (overflow: clip) { #lavori { overflow-x: hidden; } }
.wheel { --w: clamp(260px, 34vw, 480px); position: relative; height: calc(var(--w) * 1.25 + 110px); perspective: 1400px; perspective-origin: 50% 40%;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; outline: none; }
.wheel.drag { cursor: grabbing; }
.wheel:focus-visible .face.front { box-shadow: 0 0 0 3px var(--red2), 0 40px 80px -20px rgba(0, 0, 0, .95); }
.ring3d { position: absolute; left: 50%; top: 0; width: var(--w); aspect-ratio: 4 / 5; margin-left: calc(var(--w) / -2); transform-style: preserve-3d; }
.face { position: absolute; inset: 0; border-radius: 14px; background: var(--paper); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .95); will-change: transform, opacity; }
.face img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
/* copia sfocata e velo scuro sopra la foto: cambia solo l'opacità (fluido, lo fa la scheda video) */
.face .sf { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; will-change: opacity; }
.face .ombra { position: absolute; inset: 0; border-radius: inherit; background: #000; opacity: 0; pointer-events: none; will-change: opacity; }
.face::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, rgba(255, 255, 255, .12), transparent 40%, transparent 70%, rgba(0, 0, 0, .18)); }
.face.front { cursor: zoom-in; transition: box-shadow .3s var(--ease); }
/* foto al centro: leggero contorno rosso col mouse sopra */
@media (hover: hover) and (pointer: fine) {
  .face.front:hover { box-shadow: 0 0 0 1.5px rgba(255, 90, 74, .8), 0 0 28px rgba(255, 90, 74, .28), 0 40px 80px -20px rgba(0, 0, 0, .95); }
}
.wheel::after { content: ""; position: absolute; left: 50%; bottom: 28px; width: calc(var(--w) * 1.8); height: 40px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .8), transparent 70%); pointer-events: none; }
.wbar { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 6px; }
.wname { min-width: 240px; text-align: center; }
.wname small { display: block; font: 500 13px var(--body); font-variant-numeric: tabular-nums; color: var(--mute); }
.wname b { display: block; font: 700 clamp(28px, 4vw, 44px)/1.1 var(--head); letter-spacing: -.02em; transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.wname.swap b { opacity: 0; transform: translateY(6px); }
.dots { display: flex; justify-content: center; margin-top: 12px; }
.dots button { width: 28px; height: 28px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.dots button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3a3a42; transition: transform 200ms var(--ease), background-color 200ms ease; }
.dots button[aria-current="true"]::before { background: var(--red2); transform: scale(1.35); }
.wheel-more { text-align: center; margin-top: 1.6rem; max-width: none; }

/* tutto schermo della ruota */
.lb3d { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; perspective: 1600px;
  background: rgba(5, 5, 7, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; visibility: hidden; transition: opacity 280ms var(--ease), visibility 0s 280ms; }
.lb3d.open { opacity: 1; visibility: visible; transition: opacity 280ms var(--ease); }
/* la foto prende la sua forma (niente strisce ai lati); titolo e numero fuori dalla foto, in alto a destra */
.lb3d figure { position: relative; display: flex; flex-direction: column; align-items: flex-end; margin: 0;
  transform: rotateY(-10deg) scale(.94); opacity: 0; transition: transform 280ms var(--ease), opacity 280ms var(--ease); }
.lb3d.open figure { transform: none; opacity: 1; }
.lb3d.slide figure { transition: transform 180ms var(--ease), opacity 180ms var(--ease); opacity: 0; transform: rotateY(var(--dir, 20deg)) scale(.96); }
.lb3d img { display: block; width: auto; height: auto; max-width: min(84vw, 1100px); max-height: calc(88svh - 64px); border-radius: 14px; box-shadow: 0 60px 120px -20px rgba(0, 0, 0, .95); }
.lb3d figcaption { order: -1; padding: 0 2px 12px; text-align: right; color: #fff; font: 700 22px/1.15 var(--head); letter-spacing: -.01em; }
.lb3d figcaption span { display: block; }
.lb3d figcaption small { display: block; margin-top: 4px; font: 500 13px var(--body); letter-spacing: 0; color: rgba(255, 255, 255, .7); }
.lb3d .arrow { position: absolute; top: 50%; margin-top: -26px; }
.lb3d .lprev { left: max(16px, 3vw); }
.lb3d .lnext { right: max(16px, 3vw); }
.lb3d .lclose { top: 16px; right: 16px; margin: 0; }

/* HOME: lo studio */
.about .wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2.5rem, 6vw, 60px); align-items: center; }
.studio-testo { color: #fff; max-width: 52ch; margin-top: 1.2rem; }
/* home, Lo studio: le foto «Dallo studio» in due colonne che scorrono piano in versi opposti (senza fermarsi) */
.studio-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; height: clamp(460px, 48vw, 660px); overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); }
.sc-col { display: flex; flex-direction: column; gap: 12px; }
.sc-col img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; }
.studio-cols.gira .sc-col { animation: scorriSu 45s linear infinite; will-change: transform; backface-visibility: hidden; }
/* fuori dallo schermo o sotto una foto ingrandita le animazioni si fermano: meno lavoro, niente scatti */
.clips.fuori .clips-tr, .studio-cols.fuori .sc-col, html.zoom .clips-tr, html.zoom .studio-cols .sc-col { animation-play-state: paused; }
.studio-cols.gira .sc-giu { animation-direction: reverse; }
@keyframes scorriSu { to { transform: translate3d(0, -50%, 0); } }
.about .frame { position: relative; border-radius: var(--r); padding: 40px; background: #0e0e11; border: 1px solid var(--line); box-shadow: 0 0 0 10px var(--bg2), 0 0 0 11px var(--line); }
.about .frame img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; }
.about .frame img[src$=".svg"] { filter: invert(1) hue-rotate(180deg) contrast(1.1); opacity: .9; }   /* i disegni in negativo; le foto restano come sono */
.steps { display: flex; flex-wrap: wrap; gap: 8px 0; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); list-style: none; counter-reset: s; }
.steps li { counter-increment: s; font-weight: 500; }
.steps li::before { content: counter(s); font: 500 13px var(--body); font-variant-numeric: tabular-nums; color: var(--mute); margin-right: 8px; }
.steps li:not(:last-child)::after { content: "→"; color: var(--mute); margin: 0 16px; }

/* HOME: dove siamo, con la mappa animata (js/mappa.js) */
.loc-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5rem); align-items: start; margin-bottom: 3rem; }
.loc-head p { font-size: 1.15rem; line-height: 1.55; max-width: 40ch; }
.loc-list { list-style: none; border-top: 1px solid var(--line); }
.loc-list li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; align-items: baseline; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.loc-list small { font-size: .85rem; color: var(--mute); }
.loc-list a { transition: color 200ms ease; }
.map-link { font-weight: 600; }
.map-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .95rem; }
.loc-list .map-actions a { color: var(--red2); font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .loc-list a:hover { color: var(--red2); } .map-actions a:hover { text-decoration: underline; text-underline-offset: 4px; } }

.map { position: relative; display: block; width: 100%; height: 600px; border-radius: var(--r); overflow: hidden; }
.map-anim { background: #03060c; box-shadow: 0 0 0 1px var(--line), 0 30px 70px -20px rgba(0, 0, 0, .8); }
.map-anim .map-canvas { position: absolute; inset: 0; }
.map-anim .maplibregl-ctrl-attrib { font-size: 10px; }
.map-ok { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; padding: 2rem; text-align: center; color: #e9edf3;
  background: radial-gradient(ellipse at 50% 40%, #1a1a20 0%, #050507 70%); }
.map-ok svg { color: var(--red2); filter: drop-shadow(0 0 10px rgba(255, 90, 74, .7)); }
.map-ok h3 { font: 700 clamp(1.4rem, 2.4vw, 2rem)/1.15 var(--head); color: #fff; }
.map-ok p { max-width: 42ch; font-size: .95rem; }
.map-ok .btn { margin-top: .4rem; }
.map-anim.is-ok .map-ok { opacity: 0; visibility: hidden; transition: opacity .6s, visibility 0s .6s; }
.map-replay { position: absolute; right: 16px; top: 16px; z-index: 2; font: 600 13px var(--body); color: var(--txt); background: rgba(18, 18, 22, .9); border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; cursor: pointer; }
.map-anim:not(.is-ok) .map-replay { display: none; }
/* leggera ombra ai bordi del riquadro della mappa */
.map-anim::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 80% 85% at 50% 50%, transparent 58%, rgba(3, 4, 8, .45) 100%); }
/* nomi delle aree durante la discesa (js/mappa.js): al centro e fermi; sopra il livello (Nazione, Regione…)
   in rosso, sotto il nome in avorio, con un'ombra scura morbida al posto della targhetta */
.map-nome { position: absolute; left: 50%; top: 50%; z-index: 2; pointer-events: none; opacity: 0; visibility: hidden;
  display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; white-space: nowrap;
  transform: translate(-50%, -50%); will-change: transform, opacity; }
.map-liv { font: 600 14px/1.2 var(--body); color: var(--red2); letter-spacing: .01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 12px rgba(0, 0, 0, .85); }
.map-tit { font: 700 36px/1 var(--head); color: var(--txt); letter-spacing: -.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 20px rgba(0, 0, 0, .7), 0 0 44px rgba(0, 0, 0, .45); }
@media (max-width: 640px) { .map-liv { font-size: 12px; } .map-tit { font-size: 26px; } }
.map-pin { position: relative; width: 22px; height: 22px; }
.map-pin-in { position: absolute; inset: 0; opacity: 0; transition: opacity .5s; }
.map-pin.is-on .map-pin-in { opacity: 1; }
.map-pin .dot { position: absolute; inset: 0; border-radius: 50%; background: var(--red); border: 3px solid #fff; box-shadow: 0 0 12px var(--red), 0 2px 8px rgba(0, 0, 0, .4); }
.map-pin .ring { position: absolute; inset: -14px; border-radius: 50%; border: 3px solid var(--red); opacity: 0; animation: mapRing 2s ease-out infinite; }
.map-pin .label { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); white-space: nowrap; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: rgba(12, 12, 15, .82); color: #fff; font: 700 20px/1.1 var(--head); letter-spacing: -.02em;
  padding: 12px 18px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .14); text-decoration: none;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .8); cursor: pointer; transition: background-color .25s, border-color .25s; }
.map-pin .label .ind { margin-top: 5px; font: 500 12.5px/1.4 var(--body); letter-spacing: 0; color: #c9c9cf; }
.map-pin .label:hover, .map-pin .label:focus-visible { background: rgba(20, 20, 24, .92); border-color: var(--red2); }
.map-pin .label::before, .map-pin .label::after { content: ''; position: absolute; left: 50%; top: 100%; border: solid transparent; }
.map-pin .label::before { margin-left: -8px; border-width: 8px; border-top-color: rgba(255, 255, 255, .14); }
.map-pin .label::after { margin-left: -7px; border-width: 7px; border-top-color: rgba(12, 12, 15, .82); }
.map-pin .label:hover::after, .map-pin .label:focus-visible::after { border-top-color: rgba(20, 20, 24, .92); }
.map-pin.is-far .map-pin-in { opacity: 0; }
.map-pin.is-far .label, .map-pin:not(.is-on) .label { pointer-events: none; }
@keyframes mapRing { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.4); opacity: 0; } }

/* ======================================================
   FOOTER: recapiti, social e note legali
   ====================================================== */
.foot { flex-shrink: 0; border-top: 1px solid var(--line); padding: 1rem 0; color: var(--mute); font-size: .8rem; }
/* come il footer di Olimp: una sola riga, © ed email, social, Privacy, Gestione cookie */
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 3rem; }
.foot-in a, .foot-in button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; transition: color .25s ease, text-shadow .25s ease, filter .25s ease; }
.foot-legal { text-decoration: underline; text-underline-offset: 3px; }
.foot-soc { display: flex; gap: 6px; }
.foot-soc a { display: grid; place-items: center; width: 40px; height: 40px; color: rgba(235, 227, 210, .4); transition: color .3s ease, transform .3s ease, filter .3s ease; }
.foot-soc svg { width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) {
  /* elementi cliccabili del footer: si illuminano di rosso */
  .foot-in a:hover, .foot-in button:hover { color: #ff5a4a; text-shadow: 0 0 12px rgba(255, 90, 74, .55); }
  .foot-soc a:hover { filter: drop-shadow(0 0 8px rgba(255, 90, 74, .6)); }
  .foot-soc a:hover { transform: translateY(-2px); }
}

/* ======================================================
   SCHERMI PIÙ PICCOLI
   ====================================================== */
@media (max-width: 1020px) {
  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hygiene { grid-template-columns: 1fr 1fr; }
  .loc-top { grid-template-columns: 1fr; gap: 2.4rem; }
  .map { height: 500px; }
  .foot-in { flex-direction: column; gap: .6rem; text-align: center; }
}
@media (max-width: 900px) {
  :root { --top: 92px; }
  .about .wrap, .split, .style-row, .contact-grid { grid-template-columns: 1fr; }
  .style-row:nth-child(even) > .ph, .split.rev > .ph { order: 0; }
  .style-row > .ph, .split > .ph { max-width: 460px; }
  .zones { grid-template-columns: 1fr; }
  .wheel { --w: min(68vw, 360px); }
  .map { height: 440px; }
  .loc-list li { grid-template-columns: 1fr; gap: .3rem; }
  .map-actions { grid-column: auto; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .works, .hygiene, .specs { grid-template-columns: 1fr; }
  .wname { min-width: 0; flex: 1; }
  .about .frame { padding: 22px; }
  .lb { padding: 4.5rem 1rem 6.5rem; }
  .lb img, .lb video { max-height: calc(100dvh - 17rem); }
  .lb .lb-p, .lb .lb-n { top: auto; bottom: 1.2rem; margin-top: 0; }
  .lb .lb-p { left: calc(50% - 64px); }
  .lb .lb-n { right: calc(50% - 64px); }
  .filters { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .filters.at-end { -webkit-mask-image: none; mask-image: none; }
}
/* Foto o video ingranditi: titolo grande, due righe di descrizione e numero */
.lb-desc { margin: .5rem auto 0; max-width: 46ch; font: 400 14px/1.5 var(--body); letter-spacing: 0; color: rgba(255, 255, 255, .75); }
.lb3d .lb-desc { margin-right: 0; }
.lb figcaption span, .lb3d figcaption span { font-size: 24px; }
/* su schermi larghi la foto resta al centro e la scritta sta fuori, a destra, in alto */
@media (min-width: 1100px) {
  .lb figure, .lb3d figure { position: relative; }
  .lb figcaption, .lb3d figcaption { position: absolute; left: 100%; top: 0; width: 280px; padding: 4px 0 0 28px; text-align: left; color: #fff;
    font: 700 clamp(28px, 2.3vw, 38px)/1.1 var(--head); letter-spacing: -.02em; }
  .lb figcaption span, .lb3d figcaption span { display: block; font-size: inherit; }
  .lb-desc, .lb3d .lb-desc { margin: .8rem 0 0; font-size: 15px; }
  .lb figcaption small, .lb3d figcaption small { display: block; margin-top: 1rem; font: 500 13px var(--body); letter-spacing: .04em; color: rgba(255, 255, 255, .55); }
  .lb img, .lb video { max-width: calc(100vw - 2 * 330px); }
  .lb3d img { max-width: min(calc(100vw - 2 * 330px), 1100px); max-height: 88svh; }
}
@media (max-width: 700px) {
  .lb3d .arrow { top: auto; bottom: 20px; margin: 0; }
  .lb3d .lclose { top: 16px; bottom: auto; }
  .lb3d img { max-width: 92vw; max-height: calc(100svh - 250px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-property: opacity, color, background-color !important; }
  .js .rv { transform: none; }
}

/* Lucchetto all'estrema destra della navbar: porta all'area riservata. Poco rilievo (translateZ 10px):
   con la prospettiva della navbar un rilievo alto lo spingeva fuori dal bordo destro */
/* quadratino rosso in rilievo (come era il pulsante «Contattaci»), lucchetto bianco */
.nav-lock { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #fff;
  background: linear-gradient(180deg, var(--cta-top), var(--cta-bot)); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 4px 0 #6e140f;
  transform: translateZ(10px); transition: transform 220ms var(--ease), color 200ms ease, box-shadow 220ms var(--ease); }
.nav-lock:active { transform: translateZ(10px) translateY(3px); }
@media (hover: hover) and (pointer: fine) { .nav-lock:hover { color: #fff; transform: translateZ(10px) translateY(-4px) scale(1.12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 6px 0 #6e140f, 0 18px 28px -6px rgba(0, 0, 0, .95); } }
@media (max-width: 1020px) { .nav-lock { width: 46px; height: 46px; } }
@media (max-width: 1020px) { .burger ~ .nav-lock { margin-left: -8px; } }

/* foto e video: niente trascinamento, selezione o «Salva immagine» con la pressione lunga (iPhone) */
img, video, canvas { -webkit-user-drag: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
