/* Gioves — foglio di stile
   Idea: pietra d'Istria e acqua di laguna.
   Colori presi dalla città (pietra, laguna, rosso veneziano, oro delle cornici),
   un'unica famiglia di caratteri veneziana con il corsivo "aldino" per i titoli. */
:root {
  color-scheme: light dark;
  --bg: #e7e8e2;          /* pietra d'Istria */
  --bg-2: #dbe2de;        /* foschia di laguna */
  --card: #f3f3ee;        /* passe-partout */
  --ink: #1f2b30;
  --muted: #53636a;
  --line: rgb(31 43 48 / .16);
  --accent: #2f5f63;      /* verde laguna */
  --accent-ink: #f3f3ee;
  --gold: #7e5f2b;        /* oro brunito, per i testi */
  --rosso: #8e2f25;       /* rosso veneziano */
  --water: #2f5a5e;       /* fascia "acqua" (contatti e piè di pagina) */
  --on-water: #eef0ea;
  --on-water-muted: #bfd0cc;
  --wall: #2a1210;        /* parete della sala */
  --shadow: 0 1px 2px rgb(31 43 48 / .08), 0 18px 30px -18px rgb(31 43 48 / .4);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --radius: 2px;
  --wrap: min(1200px, 100% - 2rem);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1a1d;        /* laguna di notte */
    --bg-2: #132429;
    --card: #1a2b30;
    --ink: #e6e4dc;
    --muted: #9eaeae;
    --line: rgb(230 228 220 / .14);
    --accent: #8fc0bb;
    --accent-ink: #0e1a1d;
    --gold: #d2b26e;
    --rosso: #e0806f;
    --water: #0a2326;
    --on-water: #e6e4dc;
    --on-water-muted: #9fb8b4;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 20px 36px -18px rgb(0 0 0 / .75);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.125rem/1.7 var(--serif);
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.1; margin: 0; text-wrap: balance; }
h2 { font-style: italic; letter-spacing: -.01em; }
p { margin: 0 0 1rem; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: var(--wrap); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; }
.skip:focus { top: 1rem; }

/* titoletto sopra i titoli: corsivo, minuscolo, color oro */
.eyebrow { font: italic 400 1.15rem/1.35 var(--serif); color: var(--gold); margin: 0 0 .5rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.3) blur(12px);
  -webkit-backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: flex; align-items: baseline; gap: .75rem; color: var(--ink); text-decoration: none; }
/* il nome con la stessa grafia della firma dell'apertura */
.brand strong {
  font: 400 1.9rem/1 "Segoe Script", "Snell Roundhand", "Apple Chancery", "Brush Script MT", "Dancing Script", cursive;
  padding-bottom: .1em;
}
.brand span { font: italic 400 1rem/1 var(--serif); color: var(--muted); }
.nav { display: flex; gap: .2rem; }
.nav a {
  color: var(--ink); text-decoration: none; font-size: 1.05rem;
  padding: .4rem .7rem; background: linear-gradient(var(--accent), var(--accent)) no-repeat 50% 100% / 0 1px;
  transition: background-size .25s;
}
.nav a:hover { background-size: calc(100% - 1.4rem) 1px; }
@media (max-width: 640px) {
  .site-header .wrap { flex-wrap: wrap; justify-content: center; gap: 0; padding-block: .5rem .3rem; }
  .brand { width: 100%; justify-content: center; }
  .nav { width: 100%; justify-content: center; }
  .nav a { padding: .4rem .45rem; font-size: 1rem; white-space: nowrap; }
  html { scroll-padding-top: 6.5rem; }
  .sala-sticky { padding-top: 7rem; }
  .laguna-head { padding-top: 7rem; }
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3rem; padding: .7rem 1.4rem; border-radius: var(--radius);
  font: 600 1.02rem/1 var(--serif); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s, background .2s, color .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, var(--ink)); }
.btn-ghost { background: transparent; color: var(--ink); border-color: color-mix(in srgb, var(--ink) 35%, transparent); }
.btn-ghost:hover { border-color: var(--ink); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3.5rem, 7vw, 5rem); position: relative; isolation: isolate; overflow: clip; }
.hero-paint { position: absolute; width: 0; height: 0; }
.blob {
  position: absolute; z-index: -1; border-radius: 50%; filter: url(#acquerello); opacity: .5; pointer-events: none;
  animation: drift 26s ease-in-out infinite alternate;
}
.blob-1 { width: 46vw; height: 40vw; max-width: 640px; max-height: 560px; right: -8vw; top: -6vw; background: radial-gradient(closest-side, #93b9b1, #93b9b100); }
.blob-2 { width: 34vw; height: 30vw; max-width: 480px; max-height: 420px; left: -10vw; bottom: -8vw; background: radial-gradient(closest-side, #d9c08a, #d9c08a00); animation-duration: 32s; animation-direction: alternate-reverse; }
.blob-3 { width: 22vw; height: 20vw; max-width: 300px; max-height: 280px; left: 36%; top: 6%; background: radial-gradient(closest-side, #c4867a, #c4867a00); opacity: .26; animation-duration: 38s; }
@keyframes drift { 50% { translate: 3vw 2vw; rotate: 12deg; scale: 1.08; } 100% { translate: -2vw 3vw; rotate: -8deg; } }
@media (prefers-color-scheme: dark) { .blob { opacity: .2; } .blob-3 { opacity: .1; } }

.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 5vw, 5rem); }
.hero h1 { font-size: clamp(3.4rem, 10vw, 7.5rem); line-height: 1; position: relative; }
.signature { display: block; width: min(100%, 540px); height: auto; overflow: visible; }
.signature text {
  font: 400 130px/1 "Segoe Script", "Snell Roundhand", "Apple Chancery", "Brush Script MT", "Dancing Script", cursive;
  fill: var(--ink); fill-opacity: 0; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: sign 2.6s .2s cubic-bezier(.6,.1,.3,1) forwards, ink .9s 2.2s ease-out forwards;
}
@keyframes sign { to { stroke-dashoffset: 0; } }
@keyframes ink { to { fill-opacity: 1; stroke-width: 0; } }
.stroke-under { display: block; width: min(92%, 500px); height: 26px; margin-top: -.2rem; overflow: visible; }
.stroke-under path {
  fill: none; stroke: #b08b45; stroke-width: 7; stroke-linecap: round; opacity: .85;
  stroke-dasharray: 520; stroke-dashoffset: 520; animation: sign 1.1s 2.3s ease-out forwards;
}
.hero h1 small { display: block; font: italic 400 clamp(1.15rem, 2.2vw, 1.45rem)/1.4 var(--serif); color: var(--muted); margin-top: .9rem; }
.hero blockquote {
  margin: 2rem 0 2.2rem; padding: 0;
  font: 400 clamp(1.25rem, 2.3vw, 1.55rem)/1.5 var(--serif); color: var(--ink); max-width: 30ch;
  text-indent: -.45em;
}
.hero blockquote::before { content: "«"; color: var(--gold); }
.hero blockquote::after { content: "»"; color: var(--gold); }
html[lang="en"] .hero blockquote::before { content: "“"; } html[lang="en"] .hero blockquote::after { content: "”"; }
html[lang="de"] .hero blockquote::before { content: "»"; } html[lang="de"] .hero blockquote::after { content: "«"; }
.hero-text > :not(h1) { animation: fadeUp .9s both cubic-bezier(.2,.7,.2,1); }
.hero-text > blockquote { animation-delay: 1.2s; }
.hero-text > .hero-actions { animation-delay: 1.5s; }
@keyframes fadeUp { from { opacity: 0; translate: 0 18px; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero-stage { display: grid; justify-items: center; animation: fadeUp 1.2s .3s both cubic-bezier(.2,.7,.2,1); }
.hero-art { position: relative; margin: 0; width: min(100%, 440px); perspective: 1100px; }
.tilt {
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 30%;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.tilt.is-tilting { transition: transform .08s linear; }
.gilded {
  position: relative; padding: clamp(10px, 1.6vw, 18px); border-radius: 3px;
  background: linear-gradient(135deg, #6d4e1c 0%, #e9d18a 18%, #a37a32 36%, #f4e2a6 52%, #8c6526 70%, #e2c579 86%, #5f4417 100%);
  box-shadow:
    inset 0 0 0 1px rgb(255 240 200 / .5), inset 0 0 0 4px rgb(80 55 15 / .35),
    0 30px 60px -20px rgb(20 25 30 / .55), 0 10px 20px -10px rgb(20 25 30 / .35);
  transform: translateZ(30px);
}
.gilded img { width: 100%; aspect-ratio: 1200 / 1367; object-fit: cover; box-shadow: 0 0 0 3px rgb(40 28 10 / .7); }
.glare {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle at var(--gx) var(--gy), rgb(255 255 255 / .75), transparent 55%);
}
.tilt.is-tilting .glare { opacity: 1; }
/* il quadro si specchia nell'acqua, come i palazzi nei canali */
.riflesso {
  position: relative; overflow: hidden; height: clamp(90px, 14vw, 170px); margin-top: 6px;
  filter: url(#onde);
  -webkit-mask-image: linear-gradient(rgb(0 0 0 / .55), transparent 92%);
  mask-image: linear-gradient(rgb(0 0 0 / .55), transparent 92%);
}
.riflesso .gilded { transform: scaleY(-1); box-shadow: none; }
.riflesso::after { /* velo d'acqua */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(color-mix(in srgb, #3f6f70 35%, transparent), color-mix(in srgb, var(--bg) 60%, transparent));
}
.hero-art figcaption { margin-top: .6rem; font-size: .98rem; line-height: 1.45; color: var(--muted); text-align: center; }
.hero-art figcaption em { font-size: 1.1rem; color: var(--ink); }
@media (hover: none), (pointer: coarse) {
  .tilt { animation: float 7s ease-in-out infinite; }
  @keyframes float { 0%, 100% { transform: rotateY(-7deg) rotateX(3deg); } 50% { transform: rotateY(7deg) rotateX(-2deg); } }
}
.scroll-cue { position: absolute; left: 50%; bottom: 1rem; translate: -50% 0; width: 2rem; height: 3rem; display: grid; justify-items: center; }
.scroll-cue::before { content: ""; width: 1px; height: 100%; background: color-mix(in srgb, var(--ink) 30%, transparent); }
.scroll-cue span { position: absolute; top: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: wheel 2.2s ease-in-out infinite; }
@keyframes wheel { 0% { translate: 0 0; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { translate: 0 2.7rem; opacity: 0; } }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-text { text-align: center; }
  .signature, .stroke-under { margin-inline: auto; }
  .hero-art { width: 74%; max-width: 360px; }
  .hero blockquote { margin: 1.4rem auto 1.8rem; text-indent: 0; }
  .hero-actions { justify-content: center; }
  .scroll-cue { display: none; }
}

/* ---------- Sala espositiva: parete rosso veneziano, pavimento alla veneziana ---------- */
.sala {
  position: relative; color: #efe6dc;
  background:
    radial-gradient(70% 55% at 50% 0%, rgb(255 226 180 / .12), transparent 70%),
    radial-gradient(120% 80% at 50% 100%, #3a1915, var(--wall));
}
.sala::before { /* fasci di luce dei faretti */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    conic-gradient(from 168deg at 22% -8%, transparent, rgb(255 236 200 / .07) 12deg, transparent 24deg),
    conic-gradient(from 168deg at 78% -8%, transparent, rgb(255 236 200 / .07) 12deg, transparent 24deg);
}
.sala-head { text-align: center; position: relative; }
.sala-head h2 { font-size: clamp(2.4rem, 5.5vw, 3.8rem); }
.sala-head p { color: #d4bfb3; margin: .6rem auto 0; max-width: 60ch; }
.sala-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); padding-top: clamp(4.5rem, 9vh, 6rem); padding-bottom: 14vh;
}
.sala.static .sala-sticky { position: relative; height: auto; padding-bottom: 3rem; }
.wall {
  --k: calc(min(40svh, 48vw) / 80); /* pixel per centimetro: un quadro alto 80 cm occupa il 40% dello schermo */
  position: relative; display: flex; align-items: center; min-height: 0; min-width: 0;
}
.wall-track {
  display: flex; align-items: center; gap: clamp(3rem, 7vw, 7rem);
  padding-inline: max(8vw, calc(50vw - 18vw)) 12vw; will-change: transform;
}
.sala.static .wall { overflow-x: auto; scroll-snap-type: x mandatory; padding-block: 2rem 1rem; scrollbar-width: thin; }
.sala.static .hung { scroll-snap-align: center; }
.hung {
  all: unset; position: relative; flex: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1.6rem;
}
/* faretto sopra ogni quadro */
.hung::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: 50%; top: -45%; width: 190%; height: 170%; translate: -50% 0;
  background: radial-gradient(50% 50% at 50% 38%, rgb(255 232 196 / .2), rgb(255 232 196 / .07) 45%, transparent 72%);
  transition: opacity .5s; opacity: .75;
}
.hung:hover::before, .hung:focus-visible::before { opacity: 1; }
.canvas {
  position: relative; z-index: 1; display: block;
  height: calc(var(--hcm) * var(--k));
  border: 5px solid #1e1712;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .06), 14px 22px 30px -10px rgb(0 0 0 / .75), 0 2px 4px rgb(0 0 0 / .5);
  transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s;
}
.canvas img { height: 100%; width: auto; max-width: none; }
.hung:hover .canvas, .hung:focus-visible .canvas { transform: translateY(-6px) scale(1.02); box-shadow: 0 0 0 1px rgb(255 255 255 / .08), 18px 32px 44px -12px rgb(0 0 0 / .85); }
.hung:focus-visible .canvas { outline: 2px solid #e9d18a; outline-offset: 6px; }
.plaque {
  position: relative; z-index: 1; background: #efeadf; color: #2a2a2a; padding: .45rem .85rem; border-radius: 1px;
  box-shadow: 0 2px 6px rgb(0 0 0 / .45); text-align: center; max-width: 16rem;
}
.plaque b { display: block; font: italic 400 1rem/1.25 var(--serif); }
.plaque small { display: block; font-size: .78rem; color: #5f5a52; margin-top: .15rem; }
.floor { /* terrazzo alla veneziana */
  position: absolute; left: 0; right: 0; bottom: 0; height: 14vh; pointer-events: none;
  background:
    radial-gradient(circle at 30% 40%, rgb(214 190 160 / .35) 0 1.5px, transparent 2.5px) 0 0 / 23px 19px,
    radial-gradient(circle at 70% 60%, rgb(160 60 45 / .45) 0 2px, transparent 3px) 0 0 / 37px 29px,
    radial-gradient(circle at 50% 50%, rgb(240 230 215 / .18) 0 1px, transparent 2px) 0 0 / 13px 11px,
    linear-gradient(#1d1310, #2e211c);
  border-top: 1px solid rgb(255 255 255 / .06);
  box-shadow: 0 -30px 60px rgb(0 0 0 / .35);
}
.walk-progress { position: absolute; left: 50%; bottom: 5vh; width: min(240px, 50vw); height: 2px; translate: -50% 0; background: rgb(255 255 255 / .14); overflow: hidden; }
.walk-progress span { display: block; height: 100%; width: 100%; background: #d2b26e; transform-origin: 0 50%; transform: scaleX(var(--wp, 0)); }
.sala.static .walk-progress, .sala.static .floor { display: none; }
.sala.static .sala-sticky { padding-bottom: 4rem; }
@media (max-width: 700px) {
  .wall { --k: calc(min(40svh, 68vw) / 80); }
  .wall-track { gap: 3rem; padding-inline: 15vw; }
  .plaque { max-width: 12rem; }
}
.divider { display: block; position: relative; width: 100%; height: clamp(28px, 4vw, 60px); margin-top: calc(-1 * clamp(28px, 4vw, 60px) + 1px); }
.divider path { fill: var(--bg); }
.divider-water { margin-top: 0; margin-bottom: -1px; }
.divider-water path { fill: var(--water); }

/* pennellata dietro ai titoli */
.brush-mark {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 40' preserveAspectRatio='none'%3E%3Cpath d='M4 22 C 40 8, 90 30, 150 18 S 250 8, 296 20 L 294 32 C 240 26, 180 38, 120 30 S 30 36, 6 32 Z' fill='%23c9a75f' fill-opacity='.45'/%3E%3C/svg%3E") no-repeat 0 92% / 0% 46%;
  transition: background-size 1.1s cubic-bezier(.6,.1,.3,1) .15s; padding-inline: .1em;
}
.brush-mark.in { background-size: 100% 46%; }

/* ---------- Sezioni ---------- */
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section-alt { background: var(--bg-2); position: relative; }
/* una linea d'acqua, come il livello della marea sulla pietra */
.section-alt::before {
  content: ""; position: absolute; left: 0; right: 0; top: -6px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath d='M0 6 C 15 1, 25 1, 40 6 S 65 11, 80 6 S 105 1, 120 6' fill='none' stroke='%232f5f63' stroke-opacity='.45' stroke-width='1.2'/%3E%3C/svg%3E") repeat-x 0 50% / 120px 12px;
}
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.2rem 2rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(2.6rem, 6vw, 4.2rem); }
.section-head p { color: var(--muted); max-width: 52ch; margin: .8rem 0 0; }

/* ---------- Filtri ---------- */
.filters { display: flex; gap: .2rem .4rem; flex-wrap: wrap; }
.filters button {
  font: 400 1.05rem/1 var(--serif); color: var(--muted); background: none;
  border: 0; border-bottom: 1px solid transparent; padding: .55rem .4rem .45rem; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--ink); font-style: italic; border-bottom-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 640px) {
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -1rem; padding-inline: 1rem; scroll-snap-type: x proximity; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; scroll-snap-align: start; }
}

/* ---------- Galleria: quadri con passe-partout e cartellino ---------- */
.gallery { columns: 3 300px; column-gap: clamp(1.5rem, 3.5vw, 3rem); }
.work { break-inside: avoid; margin: 0 0 clamp(2rem, 4vw, 3.2rem); }
.work[hidden] { display: none; }
.work button { all: unset; display: block; cursor: zoom-in; width: 100%; }
.work button:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.work {
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 0%;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.work.is-tilting { transition: transform .08s linear; }
.work .frame { position: relative; padding: clamp(12px, 1.6vw, 18px); background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow); transition: box-shadow .4s; }
.work.is-tilting .frame { box-shadow: 0 0 0 1px var(--line), 0 30px 50px -22px rgb(20 30 35 / .55); }
.work .frame img { width: 100%; box-shadow: 0 0 0 3px #2a1f16, 0 0 0 4px rgb(255 255 255 / .15); }
.work .frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle at var(--gx) var(--gy), rgb(255 255 255 / .35), transparent 50%);
}
.work.is-tilting .frame::after { opacity: 1; }
.work .info { padding: 1rem .15rem 0; }
.work .place { font-style: italic; font-size: 1rem; color: var(--gold); line-height: 1.3; }
.work h3 { font-size: 1.4rem; font-weight: 500; margin: .2rem 0 .1rem; }
.work .sub { font-style: italic; color: var(--muted); margin: 0; }
.work .meta { font-size: .95rem; color: var(--muted); margin: .45rem 0 0; display: flex; flex-wrap: wrap; gap: .2rem .9rem; align-items: baseline; }
.tag { display: inline-flex; align-items: baseline; gap: .4em; font-size: .95rem; }
.tag-series { font-style: italic; color: var(--accent); }
/* il bollino rosso delle gallerie: opera già venduta */
.tag-sold { color: var(--rosso); }
.tag-sold::before { content: ""; width: .62em; height: .62em; border-radius: 50%; background: var(--rosso); align-self: center; box-shadow: inset -1px -1px 2px rgb(0 0 0 / .25); }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .work, .reveal { animation: rise both cubic-bezier(.2,.7,.2,1); animation-timeline: view(); animation-range: entry 0% entry 55%; }
    @keyframes rise { from { opacity: 0; translate: 0 28px; } }
  }
}

/* ---------- Chi sono ---------- */
.about { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.about figure { margin: 0; padding: clamp(10px, 1.4vw, 16px); background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.about img { width: 100%; }
.about h2 { font-size: clamp(2.6rem, 6vw, 4.2rem); margin-bottom: .2rem; }
.about .role { font-size: 1.2rem; color: var(--gold); margin-bottom: 1.6rem; }
.about p { max-width: 60ch; }
.about .lead { font-size: 1.3rem; line-height: 1.6; }
.facts { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem 1.5rem; }
.facts li { border-top: 1px solid var(--line); padding-top: .8rem; }
.facts b { display: block; font: italic 400 1.45rem/1.2 var(--serif); }
.facts span { font-size: .98rem; color: var(--muted); }
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .about figure { max-width: 300px; margin-inline: auto; }
}

/* ---------- Mostre ---------- */
.events { list-style: none; margin: 0; padding: 0; display: grid; }
.event {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem 2rem; align-items: baseline;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.4rem 0;
}
.event .date { min-width: 5.5rem; line-height: 1; }
.event .date time { display: flex; flex-direction: column; }
.event .date b { font: italic 400 3.4rem/1 var(--serif); color: var(--accent); }
.event .date span { font-size: 1rem; color: var(--muted); margin-top: .3rem; }
.event h3 { font-size: 1.6rem; font-weight: 500; }
.event p { margin: .3rem 0 0; color: var(--muted); }
.event .status { font-style: italic; color: var(--muted); }
.event.upcoming .status { color: var(--accent); }
.event.upcoming .status::before { content: ""; display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: currentColor; margin-right: .45em; vertical-align: .08em; }
.events-note { color: var(--muted); margin-top: 1.2rem; max-width: 60ch; }
@media (max-width: 600px) {
  .event { grid-template-columns: auto 1fr; gap: .6rem 1.2rem; }
  .event .status { grid-column: 2; }
}

/* ---------- Contatti: la pagina finisce nell'acqua ---------- */
#contatti { background: var(--water); color: var(--on-water); padding-block: clamp(1.5rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4rem); }
.contact { text-align: center; padding-top: clamp(.5rem, 2vw, 1.5rem); }
.contact h2 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); margin-bottom: 1rem; }
.contact p { color: var(--on-water-muted); max-width: 46ch; margin-inline: auto; font-size: 1.2rem; }
.contact .btn { margin-top: 1.2rem; }
#contatti .btn-primary { background: var(--on-water); color: var(--water); }
#contatti .btn-primary:hover { background: #fff; }
#contatti :focus-visible { outline-color: var(--on-water); }
.email-out { display: block; margin-top: 1rem; font-size: 1.3rem; font-style: italic; min-height: 1.6em; }
.email-img { margin: 1rem auto 0; border-radius: 2px; }

/* ---------- Footer ---------- */
.site-footer { padding: 0 0 2.5rem; color: var(--on-water-muted); font-size: 1rem; background: var(--water); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; border-top: 1px solid rgb(255 255 255 / .16); padding-top: 1.6rem; }
.linklike { all: unset; cursor: pointer; color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.site-footer .linklike { color: var(--on-water); }
.linklike:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ---------- Dialog (lightbox e privacy) ---------- */
dialog { border: 0; padding: 0; color: var(--ink); }
dialog::backdrop { background: rgb(8 14 16 / .82); backdrop-filter: blur(6px); }
dialog[open] { animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  /* niente movimenti grandi o automatici; restano firma, pennellate e 3D al passaggio del mouse */
  .blob, .tilt, .scroll-cue span { animation: none !important; }
  .work, .reveal { animation: none !important; }
  html { scroll-behavior: auto; }
}

.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0;
  background: #0b1416; color: #e6e4dc;
  display: none; grid-template-columns: 1fr 380px; overscroll-behavior: contain;
}
.lightbox[open] { display: grid; }
.lb-stage { position: relative; display: grid; place-items: center; padding: 2.5rem 4.5rem; min-height: 0; touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: calc(100dvh - 5rem); width: auto; object-fit: contain; box-shadow: 0 20px 60px rgb(0 0 0 / .6); user-select: none; -webkit-user-drag: none; }
.lb-panel { background: #12201f; padding: 4rem 2rem 2rem; overflow-y: auto; display: flex; flex-direction: column; gap: .3rem; }
.lb-panel .place { font-style: italic; color: #d2b26e; font-size: 1.05rem; }
.lb-panel h2 { font-size: 2.1rem; }
.lb-panel .sub { font-style: italic; color: #b7c6c3; font-size: 1.2rem; margin: 0; }
.lb-panel .desc { color: #c9d3d1; margin-top: .6rem; }
.lb-panel dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 1.3rem 0; font-size: 1rem; }
.lb-panel dt { color: #8fa3a1; font-style: italic; }
.lb-panel dd { margin: 0; }
.lb-panel .btn { margin-top: auto; }
.lb-panel .btn-primary { background: #8fc0bb; color: #0b1416; }
.lb-count { color: #8fa3a1; font-size: .95rem; margin-top: 1rem; }
.icon-btn {
  position: absolute; z-index: 2; width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgb(255 255 255 / .1); color: #fff; border: 1px solid rgb(255 255 255 / .18);
  transition: background .2s;
}
.icon-btn:hover { background: rgb(255 255 255 / .22); }
.icon-btn svg { width: 1.4rem; height: 1.4rem; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; translate: 0 -50%; }
.lb-next { right: 1rem; top: 50%; translate: 0 -50%; }
@media (max-width: 900px) {
  .lightbox { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .lb-stage { padding: 3.75rem .75rem 1rem; }
  .lb-stage img { max-height: calc(62dvh - 4rem); }
  .lb-panel { padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); max-height: 38dvh; }
  .lb-panel h2 { font-size: 1.55rem; }
  .lb-panel dl { margin: .6rem 0; }
  .lb-prev, .lb-next { top: auto; bottom: 1rem; translate: none; width: 2.6rem; height: 2.6rem; }
  .lb-close { top: .6rem; right: .6rem; }
  .lb-prev { left: .6rem; } .lb-next { right: .6rem; }
  .lb-stage { padding-bottom: 4rem; }
}

.privacy { width: min(640px, 100% - 2rem); max-height: 85dvh; border-radius: var(--radius); background: var(--card); padding: 2.2rem 2rem 2rem; box-shadow: var(--shadow); }
.privacy h2 { font-size: 2.1rem; margin-bottom: 1rem; }
.privacy h3 { font-size: 1.25rem; font-weight: 500; margin: 1.4rem 0 .5rem; }
.privacy .icon-btn { top: .8rem; right: .8rem; background: var(--bg-2); color: var(--ink); border-color: var(--line); }

/* View transitions per i filtri */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

/* ---------- Scena: si entra nel quadro ---------- */
.zoom-scene { position: relative; height: 260vh; background: var(--bg); }
.zoom-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.zoom-frame {
  position: absolute; left: 50%; top: 50%; width: var(--fw, 100vw); height: var(--fh, 100vh);
  transform: translate(-50%, -50%) scale(var(--s, 1)); transform-origin: 50% 50%;
  box-shadow: 0 0 0 calc(14px / var(--s, 1)) #b8923f, 0 40px 80px -20px rgb(0 0 0 / .5);
  will-change: transform;
}
.zoom-frame img { width: 100%; height: 100%; object-fit: cover; }
.zoom-text {
  position: absolute; inset: auto 0 0 0; padding: 12vh 1.5rem 14vh; text-align: center; color: #f1eee6;
  background: linear-gradient(transparent, rgb(8 14 16 / .55) 30%, rgb(8 14 16 / .88) 70%);
  opacity: var(--t, 0); translate: 0 calc((1 - var(--t, 0)) * 40px);
}
.zoom-text .eyebrow { color: #e2c27a; }
.zoom-text h2 { font-size: clamp(2.4rem, 6.5vw, 5rem); }
.zoom-text p:last-child { color: #c9d3d1; margin: .6rem auto 0; max-width: 60ch; }
.zoom-fade { position: absolute; inset: 0; background: var(--wall); opacity: var(--f, 0); pointer-events: none; }

/* ---------- Scena: viaggio nella laguna ---------- */
.laguna-scene {
  position: relative; height: calc(var(--n) * 85vh + 100vh);
  background: linear-gradient(var(--bg), #dce6e2 12%, #cddcd8 55%, #dde5e1 92%, var(--bg));
}
@media (prefers-color-scheme: dark) {
  .laguna-scene { background: linear-gradient(var(--bg), #12262a 12%, #173036 55%, #112226 92%, var(--bg)); }
}
.laguna-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; perspective: 900px; perspective-origin: 50% 50%; }
.laguna-head { position: absolute; z-index: 5; top: 0; left: 0; right: 0; padding: clamp(4.5rem, 10vh, 6.5rem) 1rem 0; text-align: center; pointer-events: none; }
.laguna-head h2 { font-size: clamp(2.4rem, 5.5vw, 3.8rem); }
.laguna-stage { position: absolute; inset: 0; transform-style: preserve-3d; }
.layer {
  position: absolute; left: 50%; top: 56%; width: min(64vw, 960px); margin: 0;
  transform: translate(-50%, -50%) translate3d(var(--x, 0px), 0, var(--z, 0px));
  opacity: var(--o, 0); will-change: transform, opacity;
}
.layer img { width: 100%; border: clamp(5px, .8vw, 10px) solid #f4f4ef; box-shadow: 0 30px 60px -25px rgb(20 45 50 / .55); }
.laguna-caption {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: clamp(1.5rem, 6vh, 3.5rem); text-align: center; pointer-events: none;
}
.laguna-caption span { display: block; font-style: italic; font-size: 1.05rem; color: var(--gold); }
.laguna-caption b { font: italic 400 clamp(1.4rem, 3vw, 2rem)/1.3 var(--serif); }
.laguna-dots { position: absolute; z-index: 5; right: clamp(.8rem, 3vw, 2.5rem); top: 50%; translate: 0 -50%; list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.laguna-dots li { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); opacity: .2; transition: opacity .3s, scale .3s; }
.laguna-dots li.on { opacity: .8; scale: 1.5; }
.mist { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(120% 90% at 50% 55%, transparent 55%, color-mix(in srgb, #dce6e2 70%, transparent)); }
@media (prefers-color-scheme: dark) { .mist { background: radial-gradient(120% 90% at 50% 55%, transparent 55%, rgb(18 38 42 / .7)); } }
@media (max-width: 700px) {
  .layer { width: 90vw; top: 52%; }
  .laguna-scene { height: calc(var(--n) * 75vh + 100vh); }
  .laguna-dots { display: none; }
}

/* ---------- I quadri si colorano scorrendo ---------- */
.work .frame img {
  filter: grayscale(calc(1 - var(--paint, 1))) sepia(calc((1 - var(--paint, 1)) * .35)) contrast(calc(1 + (1 - var(--paint, 1)) * .25)) brightness(calc(1 + (1 - var(--paint, 1)) * .08));
}

/* ---------- Testo che compare parola per parola ---------- */
[data-words] .w { transition: opacity .25s linear; }

/* ---------- Lingue ---------- */
.langs { display: flex; gap: .1rem; }
.langs a {
  color: var(--muted); text-decoration: none; font: 400 .95rem/1 var(--serif); letter-spacing: .04em;
  padding: .4rem .4rem;
}
.langs a:hover { color: var(--ink); }
.langs a[aria-current="page"] { color: var(--ink); font-style: italic; box-shadow: inset 0 -1px 0 var(--accent); }
@media (max-width: 640px) {
  .site-header .wrap { justify-content: space-between; }
  .brand { width: auto; justify-content: flex-start; order: 1; }
  .langs { order: 2; }
  .nav { order: 3; }
  .langs a { padding: .3rem .35rem; font-size: .9rem; }
}
@media (max-width: 400px) { .brand span { display: none; } }

.lang-offer {
  position: fixed; z-index: 60; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); translate: -50% 0;
  width: min(560px, 100% - 2rem); display: flex; align-items: center; gap: .9rem;
  padding: .6rem .6rem .6rem 1.1rem; border-radius: var(--radius);
  background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: fadeUp .5s 1.5s both;
}
.lang-offer span { flex: 1; font-size: 1rem; font-style: italic; }
.lang-offer .btn { min-height: 2.4rem; padding: .5rem 1rem; }
.lang-offer .icon-btn { position: static; translate: none; width: 2.4rem; height: 2.4rem; background: var(--bg-2); color: var(--ink); border-color: var(--line); flex: none; }
@media (max-width: 480px) { .lang-offer { flex-wrap: wrap; } .lang-offer span { flex-basis: 100%; } }
