/* ============================================================
   fonluc.net — stile
   Colori e caratteri si cambiano qui sotto in :root
   ============================================================ */
:root {
  --bg: #0e0e0d;
  --bg-soft: #181816;
  --text: #ece9e3;
  --muted: #8f8b83;
  --accent: #c9a96e;
  --line: rgba(236, 233, 227, .14);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --header-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
[data-href], .photo { cursor: pointer; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Intestazione e menu ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 0 clamp(16px, 4vw, 56px);
  background: rgba(14, 14, 13, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  background-origin: border-box;
  transition: background .4s, border-color .4s;
}
.is-home .site-header {
  position: fixed; left: 0; right: 0;
  background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,0));
  backdrop-filter: none;
  border-bottom: 0;
}
.is-home .site-header.is-scrolled {
  background: rgba(14, 14, 13, .92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.brand-logo { height: 64px; width: auto; display: block; }

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .25rem 2rem;
}
.site-nav a {
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(236, 233, 227, .78);
  padding: .4rem 0; position: relative;
  transition: color .25s;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* voce "Fotografie" con il pannello delle gallerie */
.nav-foto-btn {
  display: inline-flex; align-items: center; gap: 7px; position: relative;
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 300;
  color: rgba(236, 233, 227, .78); padding: .4rem 0; transition: color .25s;
}
.nav-foto-btn svg { width: 10px; height: 7px; fill: none; stroke: currentColor; stroke-width: 1.4; transition: transform .3s; }
.nav-foto-btn::after {
  content: ""; position: absolute; left: 0; right: 17px; bottom: 0;
  height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.nav-foto-btn:hover, .nav-foto.is-open .nav-foto-btn, .nav-foto.is-current .nav-foto-btn { color: var(--text); }
.nav-foto.is-current .nav-foto-btn::after, .nav-foto.is-open .nav-foto-btn::after { transform: scaleX(1); }
.nav-foto.is-open .nav-foto-btn svg { transform: rotate(180deg); }
/* pannello "vetrina": largo quanto la pagina, miniature grandi (fino a 6 per fila, poi va a capo) */
.nav-panel {
  position: absolute; top: calc(100% - 4px); left: clamp(16px, 4vw, 56px); right: clamp(16px, 4vw, 56px); z-index: 60;
  padding: 18px; background: rgba(14, 14, 13, .95);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .25s, transform .25s, visibility 0s .25s;
}
.nav-foto.is-open .nav-panel { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .25s; }
.site-nav .nav-panel ul { display: grid; grid-template-columns: repeat(var(--colv, 6), 1fr); gap: 14px; }
.site-nav .np-item {
  display: grid; grid-template-columns: 1fr; row-gap: 2px;
  padding: 6px; text-transform: none; letter-spacing: normal; font-size: 1rem;
  color: var(--text); transition: background .25s;
}
.site-nav .np-item::after { display: none; }
.site-nav .np-item:hover, .site-nav .np-item:focus { background: rgba(236, 233, 227, .06); }
.np-item img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 6px; opacity: .85; transition: opacity .25s; }
.np-item:hover img { opacity: 1; }
.np-title { font-family: var(--serif); font-size: 1.15rem; line-height: 1.15; }
.np-count { font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.np-item[aria-current="page"] .np-title { color: var(--accent); }
.site-nav .np-all {
  display: block; margin: 10px 7px 2px; padding-top: 12px; border-top: 1px solid var(--line);
  text-align: right; font-size: .64rem; color: var(--accent);
}
.site-nav .np-all::after { display: none; }

.menu-toggle { display: none; width: 32px; height: 32px; position: relative; }
.menu-toggle span {
  position: absolute; left: 4px; right: 4px; height: 1px; background: var(--text);
  transition: transform .3s, top .3s;
}
.menu-toggle span:first-child { top: 12px; }
.menu-toggle span:last-child { top: 20px; }
.menu-open .menu-toggle span:first-child { top: 16px; transform: rotate(45deg); }
.menu-open .menu-toggle span:last-child { top: 16px; transform: rotate(-45deg); }

@media (max-width: 820px) {
  :root { --header-h: 68px; }
  .brand-logo { height: 51px; }
  .menu-toggle { display: block; z-index: 2; }
  .site-nav {
    position: fixed; inset: 0; height: 100vh; height: 100dvh;
    background: linear-gradient(180deg, rgba(8, 8, 7, .97) 0%, rgba(14, 14, 13, .9) 55%, rgba(20, 16, 14, .82) 100%);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .3s;
  }
  .site-nav ul { flex-direction: column; align-items: center; gap: 1.6rem; }
  .site-nav a { font-family: var(--serif); font-size: 1.8rem; letter-spacing: .02em; text-transform: none; }
  .menu-open .site-nav { opacity: 1; pointer-events: auto; }
  .site-nav { overflow-y: auto; padding: 80px 0 40px; }
  .site-nav > ul { margin: auto; }
  /* "Fotografie" diventa un titolo e sotto ci sono le gallerie */
  .nav-foto { display: flex; flex-direction: column; align-items: center; }
  .nav-foto-btn { font-family: var(--serif); font-size: 1.8rem; letter-spacing: .02em; text-transform: none; cursor: default; padding: .2rem 0; }
  .nav-foto-btn svg { display: none; }
  .nav-foto-btn::after { right: 0; }
  .nav-panel, .nav-foto.is-open .nav-panel {
    position: static; opacity: 1; visibility: visible; transform: none; transition: none;
    padding: 0; margin-top: .7rem; background: none; border: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .site-nav .nav-panel ul { grid-template-columns: none; justify-items: center; gap: .35rem; }
  .site-nav .np-item { grid-template-columns: 38px auto; column-gap: 12px; align-items: center; padding: 4px 10px; font-family: var(--sans); }
  .np-item img { width: 38px; height: 27px; aspect-ratio: auto; margin: 0; }
  .np-title { font-size: 1.25rem; }
  .np-count { display: none; }
  .site-nav .np-all { display: none; }
  /* l'effetto sfocato della barra non deve "chiudere" il menu dentro la barra */
  .menu-open .site-header { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .menu-open { overflow: hidden; }
}

/* ---------- Slideshow home ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 480px; overflow: hidden; background: #000;
  --fade: 2.5s;   /* durata della dissolvenza (impostata da script.js) */
  --zoom: 6s;     /* durata dello zoom lento su ogni foto */
}
.slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity var(--fade) ease-in-out, transform var(--fade) cubic-bezier(.45,0,.2,1),
              clip-path var(--fade) cubic-bezier(.65,0,.35,1), filter var(--fade) ease-out;
}
/* Punto di partenza di ogni tipo di dissolvenza (la foto entrante) */
.slide.fx-fade   { opacity: 0; }
.slide.fx-zoom   { opacity: 0; transform: scale(1.18); }
.slide.fx-blur   { opacity: 0; filter: blur(28px); transform: scale(1.04); }
.slide.fx-slide  { opacity: 1; transform: translateX(100%); }
.slide.fx-wipe   { opacity: 1; clip-path: inset(0 100% 0 0); }
.slide.fx-mosaic, .slide.fx-blinds { opacity: 1; transition: none; }   /* animati da script.js */
.slide.fx-diag   { opacity: 1; clip-path: polygon(0 0, 0 0, 0 0); }
.slide.fx-pixel  { opacity: 0; transition: opacity calc(var(--fade) * .3) ease-out; }   /* quadretti disegnati da script.js */
.slide.fx-circle { opacity: 1; clip-path: circle(0% at 50% 50%); }
/* Foto visibile */
.slide.is-active { opacity: 1; z-index: 1; transform: none; filter: none; }
.slide.is-active.fx-wipe   { clip-path: inset(0 0 0 0); }
.slide.is-active.fx-circle { clip-path: circle(75% at 50% 50%); }
.slide.is-active.fx-diag   { clip-path: polygon(0 0, 200% 0, 0 200%); }
/* Foto uscente: resta piena e ferma sotto la nuova */
.slide.is-leaving { opacity: 1; z-index: 0; transition: none; }
.slide img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.06);
  transition: transform var(--zoom) linear;
  will-change: transform;
}
.slide.is-active img, .slide.is-leaving img { transform: scale(1); }
/* Foto verticali: intere al centro, con bande laterali sfocate della foto stessa */
.slide.is-verticale img { position: relative; z-index: 1; object-fit: contain; }
.slide.is-verticale .slide-bg { display: block; }
/* Schermo in verticale (smartphone): le foto orizzontali intere, con bande sopra e sotto */
@media (orientation: portrait) {
  .slide.is-orizzontale img { position: relative; z-index: 1; object-fit: contain; }
  .slide.is-orizzontale .slide-bg { display: block; }
}
.slide-bg {
  display: none;
  position: absolute; inset: -60px;
  background-size: cover; background-position: center;
  filter: blur(24px) brightness(.55) saturate(1.1);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(0,0,0,.45) 100%),
              linear-gradient(transparent 60%, rgba(0,0,0,.55));
}
.hero-caption {
  position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%);
  z-index: 2; text-align: center;
}
.hero-logo {
  width: clamp(216px, 39.6vw, 558px); height: auto; margin: 0 auto;
  opacity: .4; filter: drop-shadow(0 2px 16px rgba(0,0,0,.55));
  -webkit-user-select: none; user-select: none; pointer-events: none;
}
@media (max-width: 600px) { .hero-logo { width: 70vw; } }
/* Smartphone in verticale: firma sulla parte bassa della foto (che sta al centro dello schermo) */
@media (orientation: portrait) and (max-width: 820px) {
  .hero-caption { bottom: calc(50% - 30vw); }
  .hero-logo { width: 58vw; }
}
.hero-caption p {
  margin: .6rem 0 0; font-size: .75rem; letter-spacing: .5em; text-transform: uppercase;
  color: rgba(236, 233, 227, .8);
}
.hero-arrow {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  font-size: 3rem; line-height: 1; padding: 1rem;
  color: rgba(255,255,255,.55); transition: color .2s;
}
.hero-arrow:hover { color: #fff; }
.hero-arrow.prev { left: clamp(4px, 2vw, 24px); }
.hero-arrow.next { right: clamp(4px, 2vw, 24px); }
.hero-dots {
  position: absolute; left: 0; right: 0; bottom: 7%; z-index: 3;
  display: flex; justify-content: center; gap: 10px;
}
.hero-dots button {
  width: 26px; height: 2px; padding: 0; background: rgba(255,255,255,.35); transition: background .3s, width .3s;
}
.hero-dots button.is-active { background: #fff; width: 44px; }
.scroll-hint {
  position: absolute; bottom: 2.2%; left: 50%; z-index: 3;
  width: 1px; height: 36px; background: rgba(255,255,255,.5);
  animation: hint 2.2s ease-in-out infinite;
}
@keyframes hint { 0%,100% { opacity: .2; transform: translateY(-6px); } 50% { opacity: 1; transform: translateY(0); } }
/* freccia con scritta "Gallerie" che porta alle anteprime (su tutti gli schermi) */
.scroll-hint {
  bottom: 6%; width: auto; height: auto; background: none; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 14px;
  color: rgba(236, 233, 227, .75); animation: none; transition: color .3s;
}
.scroll-hint span { display: block; font-size: .62rem; letter-spacing: .35em; text-transform: uppercase; padding-left: .35em; }
.scroll-hint svg {
  display: block; width: 26px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round; animation: freccia 2s ease-in-out infinite;
}
.scroll-hint:hover, .scroll-hint:focus { color: #fff; }
.hero-dots { bottom: 14%; }
/* smartphone in verticale: linee e freccia più in alto */
@media (orientation: portrait) and (max-width: 820px) {
  .hero-dots { bottom: 16%; }
  .scroll-hint { bottom: 8%; }
}
/* smartphone in orizzontale: la foto sta tutta nello schermo, firma e freccia visibili */
@media (orientation: landscape) and (max-height: 500px) {
  .hero { min-height: 0; }
  .hero-logo { width: min(39.6vw, 60vh); }
  .hero-caption { bottom: 31%; }
  .hero-dots { bottom: 20%; }
  .scroll-hint { bottom: 4%; gap: 4px; }
}
@keyframes freccia { 0%, 100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(6px); opacity: 1; } }
.hero-empty {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted);
}
.hero-empty code { color: var(--accent); }

/* ---------- Intro con logo ----------
   Effetto scelto in index.php con data-effetto="vetro" | "esplode" | "angoli" | "lati" | "ruota"
   Tempi: entrata 2,2 s + logo fermo 1 s + dissolvenza 0,8 s            */
.intro {
  position: fixed; inset: 0; z-index: 200;
  background: #000; display: grid; place-items: center; overflow: hidden;
  perspective: 1400px; cursor: pointer;
  animation: introOut .8s ease 3.2s forwards;
}
.intro-logo { position: relative; width: min(100vw, 150vh); aspect-ratio: 3 / 2; }
.intro-logo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  animation-duration: 2.2s; animation-fill-mode: both;
  animation-timing-function: cubic-bezier(.2, .7, .2, 1);
  -webkit-user-select: none; user-select: none; pointer-events: none;
}
/* 4 angoli */
[data-effetto="angoli"] .p1 { clip-path: inset(0 calc(50% - 1px) calc(50% - 1px) 0); animation-name: daAltoSx; }
[data-effetto="angoli"] .p2 { clip-path: inset(0 0 calc(50% - 1px) calc(50% - 1px)); animation-name: daAltoDx; }
[data-effetto="angoli"] .p3 { clip-path: inset(calc(50% - 1px) calc(50% - 1px) 0 0); animation-name: daBassoSx; }
[data-effetto="angoli"] .p4 { clip-path: inset(calc(50% - 1px) 0 0 calc(50% - 1px)); animation-name: daBassoDx; }
@keyframes daAltoSx  { from { opacity: 0; transform: translate(-70vw, -70vh) rotate(-14deg); } 25% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes daAltoDx  { from { opacity: 0; transform: translate( 70vw, -70vh) rotate( 14deg); } 25% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes daBassoSx { from { opacity: 0; transform: translate(-70vw,  70vh) rotate( 14deg); } 25% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes daBassoDx { from { opacity: 0; transform: translate( 70vw,  70vh) rotate(-14deg); } 25% { opacity: 1; } to { opacity: 1; transform: none; } }
/* 2 metà da destra e sinistra */
[data-effetto="lati"] .p1 { clip-path: inset(0 calc(50% - 1px) 0 0); animation-name: daSx; }
[data-effetto="lati"] .p2 { clip-path: inset(0 0 0 calc(50% - 1px)); animation-name: daDx; }
[data-effetto="lati"] .p3, [data-effetto="lati"] .p4 { display: none; }
@keyframes daSx { from { opacity: 0; transform: translateX(-80vw); } 25% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes daDx { from { opacity: 0; transform: translateX( 80vw); } 25% { opacity: 1; } to { opacity: 1; transform: none; } }
/* rotazione (prima versione) */
[data-effetto="ruota"] .p1 { animation-name: introLogo; animation-timing-function: cubic-bezier(.45, 0, .25, 1); }
[data-effetto="ruota"] .p2, [data-effetto="ruota"] .p3, [data-effetto="ruota"] .p4 { display: none; }
@keyframes introLogo {
  0%   { opacity: 0; transform: rotateY(-200deg) rotateZ(-8deg) scale(.22); }
  15%  { opacity: 1; }
  100% { opacity: 1; transform: rotateY(0) rotateZ(0) scale(1); }
}
/* esplode: il logo compare, poi si divide in 4 verso gli angoli svanendo,
   mentre il fondo nero sfuma e appare la prima foto dello slideshow */
.intro[data-effetto="esplode"] { animation: introSfondo 3.4s ease 1.9s forwards; }
@keyframes introSfondo { to { background-color: transparent; visibility: hidden; } }
[data-effetto="esplode"] .intro-logo { perspective: 2800px; }
[data-effetto="esplode"] .intro-logo img { animation-duration: 5.4s; animation-timing-function: linear; }
/* ogni pezzo ruota attorno al proprio centro */
[data-effetto="esplode"] .p1 { transform-origin: 25% 25%; }
[data-effetto="esplode"] .p2 { transform-origin: 75% 25%; }
[data-effetto="esplode"] .p3 { transform-origin: 25% 75%; }
[data-effetto="esplode"] .p4 { transform-origin: 75% 75%; }
[data-effetto="esplode"] .p1 { clip-path: inset(0 calc(50% - 1px) calc(50% - 1px) 0); animation-name: versoAltoSx; }
[data-effetto="esplode"] .p2 { clip-path: inset(0 0 calc(50% - 1px) calc(50% - 1px)); animation-name: versoAltoDx; }
[data-effetto="esplode"] .p3 { clip-path: inset(calc(50% - 1px) calc(50% - 1px) 0 0); animation-name: versoBassoSx; }
[data-effetto="esplode"] .p4 { clip-path: inset(calc(50% - 1px) 0 0 calc(50% - 1px)); animation-name: versoBassoDx; }
@keyframes versoAltoSx {
  0%  { opacity: 0; transform: scale(.94); animation-timing-function: ease-out; }
  14% { opacity: 1; transform: none; }
  35% { opacity: 1; transform: none; animation-timing-function: cubic-bezier(.45, .05, .55, .95); }
  86% { opacity: 1; }
  100%{ opacity: 0; transform: translate(-30vw, -32vh) rotateY(-200deg) rotate(-10deg) scale(1.08); }
}
@keyframes versoAltoDx {
  0%  { opacity: 0; transform: scale(.94); animation-timing-function: ease-out; }
  14% { opacity: 1; transform: none; }
  35% { opacity: 1; transform: none; animation-timing-function: cubic-bezier(.45, .05, .55, .95); }
  86% { opacity: 1; }
  100%{ opacity: 0; transform: translate(30vw, -32vh) rotateY(200deg) rotate(10deg) scale(1.08); }
}
@keyframes versoBassoSx {
  0%  { opacity: 0; transform: scale(.94); animation-timing-function: ease-out; }
  14% { opacity: 1; transform: none; }
  35% { opacity: 1; transform: none; animation-timing-function: cubic-bezier(.45, .05, .55, .95); }
  86% { opacity: 1; }
  100%{ opacity: 0; transform: translate(-30vw, 32vh) rotateY(-200deg) rotate(10deg) scale(1.08); }
}
@keyframes versoBassoDx {
  0%  { opacity: 0; transform: scale(.94); animation-timing-function: ease-out; }
  14% { opacity: 1; transform: none; }
  35% { opacity: 1; transform: none; animation-timing-function: cubic-bezier(.45, .05, .55, .95); }
  86% { opacity: 1; }
  100%{ opacity: 0; transform: translate(30vw, 32vh) rotateY(200deg) rotate(-10deg) scale(1.08); }
}
/* vetro: il logo compare, arriva il colpo, si crepa ed esplode in mille pezzi come un cristallo;
   i frammenti sono disegnati da script.js (funzione vetro) */
.intro[data-effetto="vetro"] { animation: none; }
[data-effetto="vetro"] .p1 { animation-name: vetroIn; animation-duration: .6s; }
[data-effetto="vetro"] .p2, [data-effetto="vetro"] .p3, [data-effetto="vetro"] .p4 { display: none; }
@keyframes vetroIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.vetro { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }
.vetro.is-on { visibility: visible; }
.vetro-tela { position: absolute; inset: 0; width: 100%; height: 100%; }
.vetro-flash {
  position: absolute; width: 240px; height: 240px; margin: -120px 0 0 -120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .35) 18%, transparent 60%);
  opacity: 0;
}
@keyframes introOut { to { opacity: 0; visibility: hidden; } }
.no-intro .intro, .intro.is-done { display: none; }

/* ---------- Indice gallerie in home ---------- */
.gallery-index { scroll-margin-top: var(--header-h); padding: clamp(56px, 9vw, 120px) clamp(16px, 4vw, 56px); }
.gallery-index h2, .gallery-head h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1;
  margin: 0 0 clamp(28px, 4vw, 48px); text-align: center;
}
.cards {
  display: grid; gap: clamp(12px, 2vw, 24px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  max-width: 1500px; margin: 0 auto;
}
.card { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-soft); }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1), opacity .6s; opacity: .85; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, rgba(0,0,0,.7)); }
.card:hover img { transform: scale(1.05); opacity: 1; }
.card-title, .card-count { position: absolute; left: 24px; z-index: 1; }
.card-title { bottom: 44px; font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; }
.card-count { bottom: 22px; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(236,233,227,.7); }
.card-num { display: none; }
/* smartphone (verticale e orizzontale): anteprime più basse, così si vede che sotto ce n'è un'altra, e numero 01 / 04 */
@media (orientation: portrait) and (max-width: 820px), (orientation: landscape) and (max-height: 500px) {
  .cards { gap: 14px; }
  .card { aspect-ratio: 3 / 2; }
  .card-title { bottom: 38px; font-size: 1.6rem; }
  .card-count { bottom: 18px; }
  .card-num {
    display: block; position: absolute; top: 14px; right: 16px; z-index: 1;
    font-size: .66rem; letter-spacing: .2em; color: rgba(236, 233, 227, .85);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
  }
}
/* smartphone in orizzontale: tre anteprime per riga e titolo più vicino */
@media (orientation: landscape) and (max-height: 500px) {
  .gallery-index { padding-top: 28px; }
  .gallery-index h2 { font-size: 2rem; margin-bottom: 18px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .card-title { font-size: 1.3rem; bottom: 34px; left: 16px; }
  .card-count { left: 16px; bottom: 14px; }
  .card-num { top: 10px; right: 12px; }
}

/* ---------- Pagina galleria ---------- */
.gallery-page { padding: clamp(40px, 6vw, 80px) clamp(16px, 3vw, 40px) 80px; }
.gallery-head { text-align: center; max-width: 720px; margin: 0 auto clamp(32px, 5vw, 60px); }
.gallery-head h1 { margin-bottom: .6rem; }
.gallery-desc { color: rgba(236,233,227,.8); margin: 0 0 1rem; }
.gallery-count { font-size: .7rem; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); margin: 0; }

.masonry { columns: 3 340px; column-gap: clamp(8px, 1.2vw, 16px); max-width: 1700px; margin: 0 auto; }
.photo {
  display: block; margin-bottom: clamp(8px, 1.2vw, 16px); break-inside: avoid;
  overflow: hidden; background: var(--bg-soft); cursor: zoom-in;
}
.photo img { width: 100%; height: auto; transition: transform .8s cubic-bezier(.2,.7,.2,1), opacity .5s; opacity: 0; }
.photo img.is-loaded { opacity: 1; }
.photo:hover img { transform: scale(1.03); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 8, 7, .97);
  display: flex; align-items: center; justify-content: center;
  animation: fade .3s;
}
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lightbox figure { margin: 0; max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; transition: opacity .25s; }
.lightbox img.is-loading { opacity: .2; }
.lightbox figcaption { margin-top: 14px; font-size: .72rem; letter-spacing: .2em; color: var(--muted); text-align: center; }
/* Dati di scatto sotto la foto ingrandita */
.lb-exif { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: .35rem 0; margin-top: .7rem; letter-spacing: .06em; font-size: .74rem; }
.lb-exif > span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); opacity: .7; margin: 0 .85em; vertical-align: middle; }
.lb-cam  { color: var(--text); font-weight: 400; }
.lb-lens { color: rgba(236, 233, 227, .72); }
.lb-tec  { color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-data { font-family: var(--serif); font-style: italic; font-size: .95rem; letter-spacing: .02em; color: var(--accent); }
@media (max-width: 760px) {   /* su telefono: macchina e obiettivo sopra, dati e data sotto */
  .lb-exif { font-size: .68rem; }
  .lb-exif > span + span::before { margin: 0 .6em; }
  .lb-exif:has(.lb-tec)::before { content: ""; flex-basis: 100%; order: 1; }
  .lb-cam, .lb-lens { order: 0; }
  .lb-tec, .lb-data { order: 2; }
  .lb-exif > .lb-tec::before { display: none; }
}
.lb-close { position: absolute; top: 12px; right: 18px; font-size: 2.4rem; line-height: 1; padding: .4rem; color: rgba(255,255,255,.7); }
.lb-arrow { position: absolute; top: 50%; transform: translateY(-50%); font-size: 3.2rem; padding: 1rem; color: rgba(255,255,255,.55); }
.lb-arrow:hover, .lb-close:hover { color: #fff; }
.lb-arrow.prev { left: 0; }
.lb-arrow.next { right: 0; }
@media (max-width: 600px) {   /* su telefono: frecce piccole sui lati, su un cerchio scuro */
  .lb-arrow {
    width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem; line-height: 1; color: rgba(255, 255, 255, .9);
    background: rgba(0, 0, 0, .38); border-radius: 50%; backdrop-filter: blur(4px);
  }
  .lb-arrow.prev { left: 8px; }
  .lb-arrow.next { right: 8px; }
}

/* ---------- Instagram ---------- */
.ig img { width: 18px; height: 18px; display: block; opacity: .75; transition: opacity .25s; }
.ig:hover img, .ig:focus img { opacity: 1; }
.site-nav .nav-ig a { display: flex; align-items: center; gap: .6rem; }
.site-nav .nav-ig a::after { display: none; }
.site-nav .nav-ig span { display: none; }
.site-nav .nav-ig { position: relative; display: flex; align-items: center; padding-left: 2rem; }
.site-nav .nav-ig::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 16px; transform: translateY(-50%); background: rgba(236, 233, 227, .3); }
.site-footer .ig { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); transition: color .25s; }
.site-footer .ig:hover { color: var(--text); }
.site-footer .ig img { width: 15px; height: 15px; }
@media (max-width: 820px) {
  .site-nav .nav-ig { margin-top: .8rem; padding-left: 0; }
  .site-nav .nav-ig::before { left: 50%; top: -1.2rem; width: 40px; height: 1px; transform: translateX(-50%); }
  .site-nav .nav-ig img { width: 26px; height: 26px; }
  .site-nav .nav-ig span { display: inline; font-size: 1.2rem; color: rgba(236, 233, 227, .75); }
}

/* ---------- Contatti ---------- */
.contact-page { padding: clamp(48px, 8vw, 110px) clamp(16px, 4vw, 40px) 90px; min-height: calc(100vh - var(--header-h) - 80px); }
.contact-box { max-width: 560px; margin: 0 auto; text-align: center; }
.contact-box h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0 0 .8rem; letter-spacing: .02em; }
.contact-intro { color: rgba(236, 233, 227, .78); margin: 0 auto 2.4rem; max-width: 440px; }
.contact-form { text-align: left; display: grid; gap: 1.4rem; }
.contact-form .field span { display: block; font-size: .68rem; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); margin-bottom: .45rem; }
.contact-form input, .contact-form textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: rgba(236, 233, 227, .03); border: 0; border-bottom: 1px solid var(--line);
  padding: .7rem .2rem; outline: none; border-radius: 0; transition: border-color .3s, background .3s;
}
.contact-form textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.contact-form input:focus, .contact-form textarea:focus { border-bottom-color: var(--accent); background: rgba(236, 233, 227, .05); }
.contact-send {
  justify-self: center; margin-top: .6rem; padding: .9rem 2.4rem;
  font-size: .72rem; letter-spacing: .25em; text-transform: uppercase;
  border: 1px solid rgba(236, 233, 227, .35); transition: border-color .3s, color .3s, background .3s;
}
.contact-send:hover, .contact-send:focus { border-color: var(--accent); color: var(--accent); }
.contact-errors { border-left: 2px solid #c96e6e; background: rgba(201, 110, 110, .08); text-align: left; padding: .7rem 1rem; margin-bottom: 1.6rem; font-size: .9rem; }
.contact-errors p { margin: .2rem 0; }
.contact-alt { margin-top: 2.6rem; color: var(--muted); font-size: .85rem; display: flex; justify-content: center; align-items: center; gap: .7rem; flex-wrap: wrap; }
.contact-alt .ig { display: inline-flex; align-items: center; gap: 8px; color: rgba(236, 233, 227, .8); }
.contact-alt .ig:hover { color: var(--text); }
.contact-back a { font-size: .72rem; letter-spacing: .25em; text-transform: uppercase; color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Piè di pagina ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding: 28px clamp(16px, 4vw, 56px);
  border-top: 1px solid var(--line);
  font-size: .72rem; letter-spacing: .08em; color: var(--muted);
}

.site-footer .footer-privacy { color: var(--muted); transition: color .25s; }
.site-footer .footer-privacy:hover, .site-footer .footer-privacy:focus { color: var(--text); }

/* ---------- Avviso cookie ---------- */
.cookie-bar {
  position: fixed; left: 50%; bottom: 16px; z-index: 300;
  width: min(760px, calc(100% - 32px));
  display: flex; align-items: center; gap: 1rem 1.6rem;
  padding: 14px 18px 14px 22px;
  background: rgba(24, 24, 22, .96); border: 1px solid var(--line);
  backdrop-filter: blur(10px); box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
  font-size: .8rem; line-height: 1.5; color: rgba(236, 233, 227, .85);
  opacity: 0; transform: translate(-50%, 20px); transition: opacity .5s, transform .5s;
}
.cookie-bar.is-visible { opacity: 1; transform: translate(-50%, 0); }
.cookie-bar[hidden] { display: none; }
.cookie-bar p { margin: 0; flex: 1; }
.cookie-bar a { color: var(--accent); white-space: nowrap; }
.cookie-ok {
  flex: none; padding: .55rem 1.6rem;
  font-size: .7rem; letter-spacing: .25em; text-transform: uppercase;
  border: 1px solid rgba(236, 233, 227, .35); transition: border-color .3s, color .3s;
}
.cookie-ok:hover, .cookie-ok:focus { border-color: var(--accent); color: var(--accent); }
@media (max-width: 600px) {
  .cookie-bar { flex-direction: column; align-items: stretch; text-align: center; padding: 14px 16px; }
  .cookie-ok { align-self: center; }
}

/* ---------- Pagina Cookie e privacy ---------- */
.contact-privacy { margin: 1.6rem 0 0; font-size: .75rem; color: var(--muted); }
.contact-privacy a { color: var(--accent); }
.legal-page { padding: clamp(48px, 8vw, 100px) clamp(16px, 4vw, 40px) 90px; }
.legal-box { max-width: 720px; margin: 0 auto; }
.legal-box h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0 0 .3rem; letter-spacing: .02em; }
.legal-box h2 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin: 2.4rem 0 .5rem; }
.legal-box p, .legal-box li { color: rgba(236, 233, 227, .8); }
.legal-box ul { padding-left: 1.2rem; }
.legal-box li { margin: .3rem 0; }
.legal-box a { color: var(--accent); }
.legal-box strong { color: var(--text); font-weight: 500; }
.legal-updated { color: var(--muted); font-size: .78rem; letter-spacing: .08em; margin: 0 0 2rem; }

/* Testo letto da Google e dai lettori di schermo ma non visibile */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Protezione foto ---------- */
.slide img, .card img, .photo img, .lightbox img {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-user-drag: none;
}

/* ---------- Modulo contatti dinamico (come sul sito di Beatrice, nei colori fonluc) ---------- */
.contact-form {
  position: relative; padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line); background: rgba(24, 24, 22, .55);
  transition: box-shadow .4s ease, border-color .4s ease, transform .45s cubic-bezier(.2, .7, .2, 1);
}
.contact-form:focus-within { border-color: rgba(201, 169, 110, .35); }
/* i campi entrano uno dopo l'altro */
.contact-form > :not(.hp):not([type="hidden"]) { position: relative; z-index: 1; animation: campoIn .6s cubic-bezier(.2, .7, .2, 1) both; }
.contact-form > :nth-child(4) { animation-delay: .07s; } .contact-form > :nth-child(5) { animation-delay: .14s; }
.contact-form > :nth-child(6) { animation-delay: .21s; } .contact-form > :nth-child(7) { animation-delay: .28s; }
.contact-form > :nth-child(8) { animation-delay: .35s; }
@keyframes campoIn { from { opacity: 0; transform: translateY(14px); } }
/* luce dorata che segue il cursore e modulo che si solleva */
.contact-form::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 30%), rgba(201, 169, 110, .13), transparent 60%);
  opacity: 0; transition: opacity .4s ease;
}
@media (hover: hover) {
  .contact-form:hover { transform: translateY(-6px); border-color: rgba(201, 169, 110, .35); box-shadow: 0 36px 60px -30px rgba(0, 0, 0, .85); }
  .contact-form:hover::before { opacity: 1; }
}
/* etichette che si accendono d'oro e ✓ sui campi compilati bene */
.contact-form .field span { transition: color .25s ease, transform .25s ease; }
.contact-form .field:focus-within span { color: var(--accent); transform: translateX(3px); }
.contact-form .field span::after {
  content: "✓"; display: inline-block; margin-left: .5rem; color: var(--accent); letter-spacing: 0;
  opacity: 0; transform: scale(.4); transition: opacity .3s ease, transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.contact-form .field.is-valid span::after { opacity: 1; transform: none; }
.contact-form input, .contact-form textarea { transition: border-color .3s, background .3s, box-shadow .3s; }
.contact-form input:hover:not(:focus), .contact-form textarea:hover:not(:focus) { border-bottom-color: rgba(201, 169, 110, .5); }
.contact-form input:focus, .contact-form textarea:focus { box-shadow: 0 12px 24px -16px rgba(201, 169, 110, .45); }
/* casella "Non sono un robot" */
.robot {
  display: inline-flex; align-items: center; gap: .85rem; justify-self: start;
  padding: .8rem 1.3rem .8rem 1rem; border: 1px solid var(--line); cursor: pointer; user-select: none;
  font-size: .85rem; letter-spacing: .06em; color: rgba(236, 233, 227, .85);
  transition: border-color .25s ease, background-color .25s ease;
}
.robot input, .consenso input {
  -webkit-appearance: none; appearance: none; display: inline-grid; place-content: center;
  width: 24px; height: 24px; margin: 0; background: transparent; cursor: pointer;
  border: 1.5px solid rgba(236, 233, 227, .45);
  transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.robot input::before, .consenso input::before {
  content: ""; width: 12px; height: 6px; border: solid var(--bg); border-width: 0 0 2.5px 2.5px;
  transform: translateY(-15%) rotate(-45deg) scale(0); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.robot input:checked, .consenso input:checked { background: var(--accent); border-color: var(--accent); animation: spunta .35s cubic-bezier(.3, 1.6, .5, 1); }
.robot input:checked::before, .consenso input:checked::before { transform: translateY(-15%) rotate(-45deg) scale(1); }
.robot:hover { border-color: rgba(201, 169, 110, .5); }
.robot:hover input, .consenso:hover input { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(201, 169, 110, .15); }
.robot:has(input:checked) { border-color: var(--accent); background: rgba(201, 169, 110, .08); }
.robot input:focus-visible, .consenso input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .robot:hover input, .consenso:hover input { transform: scale(1.2) rotate(-6deg); } }
@keyframes spunta { 40% { transform: scale(1.3); } }
/* consenso al trattamento dei dati: stessa casella, un po' più piccola */
.consenso { display: flex; align-items: flex-start; gap: .75rem; cursor: pointer; font-size: .8rem; line-height: 1.5; color: rgba(236, 233, 227, .8); }
.consenso a { color: var(--accent); }
.consenso input { width: 20px; height: 20px; flex: none; margin-top: .05rem; }
.consenso input::before { width: 10px; height: 5px; border-width: 0 0 2px 2px; }
/* pulsante: riflesso al passaggio del mouse, "respiro" dorato quando è tutto pronto */
.contact-send { position: relative; overflow: hidden; }
.contact-send::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(201, 169, 110, .35), transparent);
  transform: skewX(-20deg); transition: left .6s ease;
}
.contact-send:hover::after { left: 120%; }
.contact-form.is-ready .contact-send { border-color: var(--accent); color: var(--accent); animation: pronto 2.4s ease-in-out infinite; }
@keyframes pronto { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 169, 110, .4); } 50% { box-shadow: 0 0 0 9px rgba(201, 169, 110, 0); } }
.contact-send.is-sending { pointer-events: none; opacity: .7; animation: none; }
@media (prefers-reduced-motion: reduce) {
  .contact-form > *, .contact-form.is-ready .contact-send, .robot input:checked, .consenso input:checked { animation: none; }
  .contact-form:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .slide.is-active img, .scroll-hint, .scroll-hint svg { animation: none; }
  .slide img { transform: none; transition: none; }
}
