@font-face { font-family: "Mono"; src: url(/font/dmmono-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Gnezdo"; src: url(/font/gnezdo.woff) format("woff"); font-display: swap; }

:root {
  --fondo: #ffffff;
  --testo: #000000;
  --tenue: #9a9a9a;
  --velo: rgb(255 255 255 / .82);
  --vuoto-video: #f2f2f2;
  --campo: #f6f6f6;
  --margine: 16px;
  --piccolo: 11px;
  color-scheme: light;
}
/* Tema scuro: nero pieno, come il bianco pieno del tema chiaro */
:root[data-tema="dark"], .sempre-scura {
  --fondo: #000000;
  --testo: #f2f2f2;
  --tenue: #858585;
  --velo: rgb(0 0 0 / .86);
  --vuoto-video: #111111;
  --campo: #101010;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Niente zoom con il doppio tocco su tutto il sito: resta quello con due dita */
html { touch-action: manipulation; }
/* Nei giochi neanche quello, e niente selezione del testo tenendo premuto */
.con-gioco, .con-gioco body { touch-action: none; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.con-gioco a, .con-gioco button { touch-action: manipulation; }

body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mono", ui-monospace, monospace;
  font-size: var(--piccolo);
  line-height: 1.5;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: opacity .3s; }
a:hover { opacity: .5; }
img { display: block; max-width: 100%; height: auto; }
/* Tutte le immagini: non trascinabili e senza il menu "Salva immagine" (i clic passano a ciò che sta sotto) */
img { pointer-events: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-user-drag: none; }

/* Testata: menu piccoli ai lati, nome grande al centro */
.testata {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
  padding: 18px var(--margine) 0;
  position: relative; z-index: 10;
}
.testata nav a { margin-right: 24px; }
.testata nav:last-child { justify-self: end; }
.testata nav:last-child a { margin: 0 0 0 24px; }
.tema button {
  font: inherit; text-transform: inherit; color: inherit; background: none; border: 0;
  padding: 0; margin-left: 12px; cursor: pointer; opacity: .4;
}
.tema button:hover, .tema button[aria-pressed="true"] { opacity: 1; }
.tema button:focus:not(:focus-visible) { outline: none; }
/* Piccola sorpresa: passando sopra Dark o Light compare una frase, solo dove c'è il mouse */
.tema { position: relative; }
@media (hover: hover) {
  .tema button:hover::after {
    content: attr(data-frase); position: absolute; top: calc(100% + 6px); right: 0;
    white-space: nowrap; animation: compari .4s ease;
  }
}
.nome {
  font-size: clamp(24px, 3vw, 48px); line-height: 1;
}
.nome:hover { opacity: 1; }
/* Il nome è un disegno vettoriale (strumenti/nome.svg): misura in proporzione alla dimensione del testo */
.marchio { display: block; height: 1.44em; width: 5.076em; }

/* Home: una foto a tutto schermo sotto la testata */
.home .testata, .firma { color: #ffffff; }
.home .testata { position: fixed; inset: 0 0 auto 0; }
.copertina { position: relative; height: 100svh; background: #000; }
/* Apertura della home (la avvia uno script in genera.py): la foto passa dallo sfocato al fuoco, poi nome e menu */
.apertura .copertina img, .apertura .home .testata .nome, .apertura .home .testata nav, .apertura .firma { opacity: 0; }
.apertura.via .copertina img { animation: fuoco 3s cubic-bezier(.4, 0, .2, 1) both; will-change: filter, transform, opacity; }
.apertura.via .home .testata .nome { animation: emerge 1s ease-in-out .2s both; }
.apertura.via .home .testata nav, .apertura.via .firma { animation: emerge .6s ease-out 1.8s both; }
@keyframes fuoco {
  0% { opacity: 0; filter: blur(2vw); transform: scale(1.04); }
  25% { opacity: 1; }
  100% { opacity: 1; filter: blur(0); transform: scale(1); }
}
@keyframes emerge { from { opacity: 0; } to { opacity: 1; } }
.copertina > a { display: block; height: 100%; }
.copertina img { width: 100%; height: 100%; object-fit: cover; }
.copertina::after { content: ""; position: absolute; inset: 0; background: linear-gradient(#0008, #0000 30%, #0000 75%, #0008); pointer-events: none; }
.instagram { display: block; width: 14px; height: 14px; }
.instagram svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; }
.instagram .pieno { fill: currentColor; stroke: none; }
.firma {
  position: absolute; left: var(--margine); right: var(--margine); bottom: 16px; z-index: 1;
  display: flex; justify-content: space-between;
}

/* Work: elenco numerato, la copertina compare passando sopra un titolo */
.elenco { padding: 14vh var(--margine) 96px; }
.riga {
  display: grid; grid-template-columns: 1fr 2fr 1.2fr 1fr auto;
  padding: 8px 0; position: relative;
}
.riga:hover { opacity: 1; }
/* Presentazione di una raccolta di video: allineata alla colonna dei titoli (l'anno occupa 4 caratteri) */
.presentazione { margin: 0 0 56px calc((100% - 4ch) / 5.2); max-width: 520px; font-size: 13px; line-height: 1.7; }
.presentazione a { display: block; width: fit-content; margin-top: 12px; }
.riga span:nth-child(2) { padding-right: 16px; }
.anteprima {
  position: fixed; top: 50%; left: 50%; z-index: 5;
  width: min(47.6vw, 728px); max-height: 92svh; object-fit: contain; transform: translate(-50%, -50%);
  pointer-events: none; opacity: 0; transition: opacity .35s;
}
.anteprima.attiva { opacity: 1; }
.anteprima.verticale { width: min(40vw, 612px); }
/* Su computer i testi stanno sopra l'anteprima, sempre neri */
@media (min-width: 768px) {
  .elenco { position: relative; z-index: 6; }
}

.copyright { color: var(--tenue); max-width: 520px; margin-left: calc(100% / 3); }
.copyright a, .nota-modulo a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.nota-modulo { color: var(--tenue); text-transform: none; font-size: 11px; }
/* Privacy: stessa struttura di About, testo a destra senza rientro e in minuscolo */
.testo-legale { max-width: 640px; text-transform: none; font-size: 13px; line-height: 1.7; }
.testo-legale p + p { margin-top: .9em; }
.testo-legale a { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.testo-legale .aggiornato { color: var(--tenue); }
.pagina-privacy .blocco { margin-bottom: 48px; }

/* Modulo di contatto */
.modulo { display: grid; gap: 28px; max-width: 520px; }
.modulo label { display: grid; gap: 6px; }
.modulo input, .modulo textarea {
  font: inherit; font-size: 13px; text-transform: none; color: var(--testo);
  background: var(--campo); border: 0; border-radius: 0;
  padding: 6px 8px; outline: none; resize: vertical;
}
.modulo textarea { min-height: 120px; }
/* Tre puntini quadrati dove si comincia a scrivere: si riempiono di continuo finché il campo è vuoto e
   spariscono appena c'è del testo. Nel campo attivo si spostano appena per lasciare posto al cursore. */
.modulo label > input, .modulo label > textarea, .puntini { grid-row: 2; grid-column: 1; }
.puntini { display: flex; gap: 4px; align-self: start; height: calc(13px * 1.5); margin: 6px 0 0 8px; align-items: center; pointer-events: none; transition: transform .15s ease; }
.puntini i { width: 6px; height: 6px; box-shadow: inset 0 0 0 1px var(--testo); animation: puntino-1 1.6s steps(1) infinite; }
.puntini i:nth-child(2) { animation-name: puntino-2; }
.puntini i:nth-child(3) { animation-name: puntino-3; }
:is(input, textarea):not(:placeholder-shown) ~ .puntini { display: none; }
:is(input, textarea):focus ~ .puntini { transform: translateX(8px); }
@keyframes puntino-1 { 0%, 85% { background: var(--testo); } 85.01%, 100% { background: none; } }
@keyframes puntino-2 { 0%, 25% { background: none; } 25.01%, 85% { background: var(--testo); } 85.01%, 100% { background: none; } }
@keyframes puntino-3 { 0%, 50% { background: none; } 50.01%, 85% { background: var(--testo); } 85.01%, 100% { background: none; } }
@media (prefers-reduced-motion: reduce) {
  .puntini i { animation: none; background: var(--testo); }
}
.modulo .trappola { display: none; }
.modulo button {
  justify-self: start; font: inherit; text-transform: inherit; color: var(--fondo);
  background: var(--testo); border: 0; padding: 10px 22px; cursor: pointer; transition: opacity .3s;
}
.modulo button:hover { opacity: .7; }
.modulo button:disabled { opacity: .3; cursor: default; }
.esito { min-height: 1.5em; }

/* Pagina progetto: galleria a tutto schermo, una foto alla volta */
h1, h2 { font-size: inherit; font-weight: 400; }
.tenue { color: var(--tenue); }
.pagina-galleria { height: 100svh; display: flex; flex-direction: column; overflow: hidden; }
.galleria { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scena { flex: 1; min-height: 0; position: relative; margin: 32px var(--margine) 0; }
.scena img {
  position: absolute; inset: 0; margin: auto;
  width: auto; height: auto; max-width: 95%; max-height: 95%;
  border: 4px solid #000; opacity: 0; transition: opacity .45s ease;
}
.scena img.attiva { opacity: 1; }
.senza-bordo .scena img:not(.con-bordo) { border: 0; }
.zona { position: absolute; top: 0; bottom: 0; width: 50%; background: none; border: 0; z-index: 1; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.zona.prec { left: 0; cursor: w-resize; }
.zona.succ { right: 0; cursor: e-resize; }
.zona:focus, .barra button:focus:not(:focus-visible) { outline: none; }
/* Testo del progetto (tasto Info): foglio bianco sopra la galleria */
.info-progetto {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: var(--velo); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 24px var(--margine); animation: compari .4s ease;
}
.info-progetto[hidden] { display: none; }
.foglio { max-width: 560px; max-height: 100%; overflow-y: auto; }
.testa-info { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.racconto { text-transform: none; font-size: 13px; line-height: 1.75; }
.racconto p + p { margin-top: 1.1em; }
.nota-info { margin-top: 28px; }
.chiudi-info, .apri-info {
  font: inherit; text-transform: inherit; color: inherit; background: none; border: 0;
  padding: 0; cursor: pointer; transition: opacity .3s;
}
.apri-info { margin-left: 16px; }
.chiudi-info:hover, .apri-info:hover { opacity: .5; }
@keyframes compari { from { opacity: 0; } }

/* Griglia di tutte le foto (tasto All) */
.galleria.con-indice .scena { display: none; }
.galleria.con-indice .contatore { visibility: hidden; }
.indice {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid; gap: 16px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  padding: 32px var(--margine) 24px;
}
.indice[hidden] { display: none; }
.indice button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.indice .cella { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; }
.indice img { width: auto; height: auto; max-width: 100%; max-height: 100%; transition: opacity .3s; }
.indice .numero { display: block; padding-top: 4px; text-align: center; color: var(--tenue); }
.indice button:hover img { opacity: .6; }
.indice button.attuale .numero { color: var(--testo); }
.indice button:focus:not(:focus-visible) { outline: none; }

/* Alla prima e all'ultima foto il tasto per andare oltre si spegne */
.alla-prima .prec, .all-ultima .succ { pointer-events: none; }
.alla-prima .barra .prec, .all-ultima .barra .succ { opacity: .25; }

.barra {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 16px var(--margine);
}
.barra nav { justify-self: end; }
.barra button {
  font: inherit; text-transform: inherit; color: inherit; background: none; border: 0;
  cursor: pointer; margin-left: 24px; transition: opacity .3s;
}
.barra button:hover { opacity: .5; }

/* Video: pagina del film con crediti a sinistra, lettore e stills a destra */
.elenco-vuoto { padding: 14vh var(--margine) 96px; }
.vuoto { text-align: center; color: var(--tenue); }
/* Riga nascosta in fondo a Photo: compare col mouse, o toccando il fondo della pagina sul telefono */
.pagina-photo { min-height: 100svh; display: flex; flex-direction: column; }
.pagina-photo .elenco { padding-bottom: 24px; }
.segreto {
  margin-top: auto; min-height: 96px; padding: 0 var(--margine) calc(24px + env(safe-area-inset-bottom));
  display: flex; align-items: flex-end; position: relative; z-index: 6; -webkit-tap-highlight-color: transparent;
}
.segreto .riga { flex: 1; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.segreto.svelata .riga, .segreto:focus-within .riga { opacity: 1; pointer-events: auto; }
@media (hover: hover) { .segreto:hover .riga { opacity: 1; pointer-events: auto; } }
/* Sezione Private: finestre della password e dell'accordo */
.finestra {
  margin: auto; width: min(100% - 32px, 460px); max-height: calc(100svh - 32px); overflow: auto;
  padding: 32px; background: var(--fondo); color: var(--testo); border: 1px solid var(--testo);
}
.finestra [hidden] { display: none; }
.finestra::backdrop { background: rgba(0, 0, 0, .6); }
.finestra .modulo { max-width: none; gap: 24px; }
.finestra input { font-size: 16px; -webkit-text-security: disc; }
.finestra h2 { font: inherit; margin: 0 0 20px; }
.testo-accordo { font-size: 13px; line-height: 1.7; text-transform: none; }
.testo-accordo p { margin: 0 0 14px; }
.scelte { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.finestra .annulla { background: none; color: var(--testo); box-shadow: inset 0 0 0 1px var(--testo); }
.scheda { display: grid; grid-template-columns: 1fr 2fr; align-items: start; padding: 14vh var(--margine) 96px; }
.crediti { position: sticky; top: 24px; padding-right: 32px; }
.crediti dl { margin-top: 28px; }
.crediti dt { color: var(--tenue); margin-top: 14px; }
.indietro { display: block; width: fit-content; margin-top: 40px; }
/* Lettore non troppo alto: sotto, senza scorrere, si vede l'inizio degli stills (testata, margini e 140px di stills) */
.opera { width: 100%; max-width: calc((100svh - 14vh - 310px) * 16 / 9); }
.video { aspect-ratio: 16 / 9; background: var(--vuoto-video); }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.stills { margin-top: 48px; }
/* Griglia 16:9: uno still di altro formato resta intero, con bande nere ai lati */
.griglia-stills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.griglia-stills img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; }
.griglia-stills.uniformi img { aspect-ratio: auto; }

/* Pagina 404 */
.sempre-scura .tema { display: none; }
.pagina-404 { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; padding: var(--margine); }

/* Minigiochi di Carcosa (carcosa.js) */
.gioco-spirale .sfondo-disegnato { opacity: .42; }
.sfondo-disegnato { text-transform: none; will-change: transform; position: fixed; inset: 0; z-index: -1; transition: opacity 1.6s ease; }
.sfondo-disegnato img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.gioco .pagina-404 { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 20px; z-index: 5; pointer-events: none; }
.gioco .indizio { color: var(--tenue); margin-top: 4px; }
.risolta { visibility: hidden; }
.fine {
  position: fixed; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 6px; text-align: center; padding: calc(50svh + 46px) var(--margine) 0; animation: compari 1.6s ease; pointer-events: none;
}
.frase { max-width: min(92vw, 900px); font-family: "Gnezdo", "Mono", monospace; text-transform: none; font-size: clamp(15px, 1.5vw, 22px); line-height: 1.25; color: #fff; -webkit-text-stroke: .25px #fff; }
.fine { text-shadow: 0 0 3px #000, 0 0 9px #000, 0 0 20px rgb(0 0 0 / .9); }
.girando .fine { opacity: 0; transition: opacity .25s ease; }
.fine { transition: opacity .35s ease; }
.fine a { margin-top: 10px; pointer-events: auto; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.spirale-fine { position: absolute; left: 50%; top: 50svh; width: 64px; height: 64px; margin: -32px 0 0 -32px; }
/* Un velo scuro al centro: spirale e frase si leggono su qualsiasi sfondo */
.fine::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 62% 40% at 50% 58%, rgb(0 0 0 / .68), rgb(0 0 0 / .4) 55%, rgb(0 0 0 / 0)); }
.spirale-fine polyline { fill: none; stroke: currentColor; stroke-width: 1; stroke-dasharray: 1; animation: traccia 2.4s ease-out both; }
@keyframes traccia { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.campo { position: fixed; inset: 0; z-index: 1; overflow: hidden; touch-action: none; }
.buio {
  position: absolute; inset: 0; --x: 50%; --y: 50%; transition: opacity 1.6s ease; pointer-events: none;
  background: radial-gradient(circle var(--raggio, 115px) at var(--x) var(--y), rgb(0 0 0 / 0) 0, rgb(0 0 0 / .35) 45%, rgb(0 0 0 / .985) 100%);
}
.intreccio { --s: .7; position: absolute; width: 70px; height: 84px; transform: translate(-50%, -50%); perspective: 420px; color: #7f6d4d; }
.spenta { visibility: hidden; }
.corda { position: absolute; width: 1px; height: 62px; transform: translateY(-100%); background: linear-gradient(transparent, currentColor); }
.figura { position: absolute; left: 0; top: 0; width: 100px; height: 120px; transform-style: preserve-3d; animation: gira 8s ease-in-out infinite alternate; }
@keyframes gira { from { transform: scale3d(var(--s), var(--s), var(--s)) rotateY(-55deg); } to { transform: scale3d(var(--s), var(--s), var(--s)) rotateY(55deg); } }
.asta { position: absolute; width: 0; height: 0; transform-style: preserve-3d; transform-origin: 0 0; }
.lato {
  position: absolute; left: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; background-color: currentColor;
  background-image: repeating-linear-gradient(90deg, rgb(0 0 0 / .2) 0 2px, transparent 2px 7px, rgb(255 255 255 / .1) 7px 8px, transparent 8px 12px);
}
.lato.t1 { background-image: linear-gradient(rgb(0 0 0 / .3), rgb(0 0 0 / .3)), repeating-linear-gradient(90deg, rgb(0 0 0 / .2) 0 2px, transparent 2px 9px); }
.lato.t2 { background-image: linear-gradient(rgb(0 0 0 / .55), rgb(0 0 0 / .55)), repeating-linear-gradient(90deg, rgb(0 0 0 / .2) 0 2px, transparent 2px 9px); }
.legatura .lato { background-image: linear-gradient(rgb(0 0 0 / .35), rgb(0 0 0 / .35)), repeating-linear-gradient(90deg, rgb(0 0 0 / .6) 0 1.5px, transparent 1.5px 3px); }
.intreccio.trovato { z-index: 1; color: #c23a2c; animation: trovato .6s ease; }
@keyframes trovato { 50% { transform: translate(-50%, -50%) scale(1.25); } }
.luce .buio { opacity: 0; }
.gioco-torcia.luce .sfondo-disegnato { opacity: .5; }
.gioco-torcia.luce .intreccio { opacity: 0; transition: opacity 1.6s ease; }

.spirale {
  position: fixed; z-index: 1; left: 50%; top: 35%; transform: translate(-50%, -50%);
  width: min(78vw, 44svh); height: min(78vw, 44svh); touch-action: manipulation;
}
.anello { cursor: pointer; transform-origin: 200px 200px; transition: transform .4s ease; outline: none; }
.presa { fill: none; stroke: transparent; pointer-events: stroke; }
.confine { fill: none; stroke: rgb(255 255 255 / .16); stroke-width: 1; }
.tratto { fill: none; stroke: var(--testo); stroke-width: 2.5; stroke-linecap: round; }
.anello:hover .confine, .anello:focus-visible .confine { stroke: rgb(255 255 255 / .5); }
.luce .spirale { opacity: 0; transition: opacity 1.2s ease 1.4s; pointer-events: none; }

.gioco-lattina .indizio, .gioco-lattina .pagina-404 p { color: #f4efe6; }
.gioco-lattina .fine { color: #f4efe6; text-shadow: 0 0 8px rgb(0 0 0 / .6); }
.gioco-lattina:not(.luce), .gioco-lattina:not(.luce) * { cursor: none; }
.banco { position: fixed; inset: 0; z-index: 1; perspective: 1100px; touch-action: none; }
.perno, .gruppo, .pezzo, .faccia { transform-style: preserve-3d; }
.perno { position: absolute; left: 50%; top: 47%; width: 0; height: 0; will-change: transform; }
.gruppo { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.tappo { transition: transform 1.1s ease-in, opacity 1.1s ease-in; }
.faccia { position: absolute; left: 0; top: 0; transition: transform 1.3s cubic-bezier(.5, 0, .2, 1); }
.fronte, .retro { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.fronte { background-image: var(--etichetta); background-size: 400px 300px; }
.retro { transform: rotateY(180deg); }
.retro.incisa { background-image: var(--incisione), linear-gradient(#e4e7e9, #b8bdc1 45%, #d5d8db); background-size: 400px 300px, 100% 100%; background-repeat: no-repeat; }
.argento { background: linear-gradient(#e4e7e9, #b8bdc1 45%, #d5d8db); }
.ombra { position: absolute; inset: 0; background: #000; pointer-events: none; }
.disco { position: absolute; border-radius: 50%; background: radial-gradient(circle, #c6cacd 0 52%, #8f9498 53% 56%, #d3d6d8 57% 86%, #9a9ea2 88%); }
.linguetta { position: absolute; left: 35%; top: 40%; width: 30%; height: 20%; border-radius: 40% 40% 50% 50%; background: radial-gradient(circle at 50% 70%, #6d7175 0 22%, transparent 24%), #e8ebed; border: 1px solid #8f9498; }
.tacca { position: absolute; left: 0; right: 0; height: 2px; background: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 9px); opacity: 0; }
.tacca.sopra { top: 7px; }
.tacca.sotto { bottom: 7px; }
.tacca.pronta { opacity: .35; }
.tacca.vista { opacity: 1; }
.mirino { transform-style: preserve-3d; }
.segno { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; border: 1.5px dashed #111; background: rgb(255 255 255 / .55); }
.segno.fatto { opacity: .25; }
.segno.prossimo { border: 2px solid #fff; background: #d31f2d; box-shadow: 0 0 0 2px #111; animation: segno 1s ease-in-out infinite; }
@keyframes segno { 50% { box-shadow: 0 0 0 7px rgb(211 31 45 / .35); } }
.riga-taglio { position: absolute; left: -1px; top: 0; width: 0; border-left: 2px dashed #111; }
.gioco-lattina.luce .banco { cursor: grab; }
.gioco-lattina.luce .banco.presa { cursor: grabbing; }
.pezzo { position: absolute; transition: transform 1.3s cubic-bezier(.5, 0, .2, 1), opacity .9s ease-in; }
.guida { position: absolute; left: -200px; top: -150px; transform: translateZ(1.5px); pointer-events: none; overflow: visible; }
.guida path { fill: none; stroke: #000; stroke-width: 1.6; stroke-dasharray: 6 4; }
.coltello { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 30; pointer-events: none; perspective: 800px; }
.impugna { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; transform-origin: 0 0; transform: rotateZ(-40deg); }
.coltello.affonda .impugna { animation: affonda .22s ease-out; }
@keyframes affonda { 35% { transform: rotateZ(-40deg) translateX(-30px); } }
.strati { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; transform-origin: 0 0; }
.strato { position: absolute; background-size: 100% 100%; background-repeat: no-repeat; }
.luce .coltello { opacity: 0; transition: opacity .6s ease; }

/* Il gioco dell'identikit */
.gioco-identikit:not(.luce), .gioco-identikit:not(.luce) * { cursor: none; }
.foglio-identikit { position: fixed; z-index: 1; top: 76px; right: 7vw; height: calc(81svh - 76px); aspect-ratio: 600 / 760; transform: rotate(1.3deg); box-shadow: 0 2px 3px rgb(0 0 0 / .4), 10px 18px 40px rgb(0 0 0 / .5); touch-action: none; }
.foglio-identikit svg { display: block; width: 100%; height: 100%; }
.pezzo-volto { opacity: .14; transition: opacity .7s ease; }
.pezzo-volto.fatto { opacity: 1; }
.verde { fill: #6bb93a; stroke: #3b6d1f; stroke-width: 1.5; }
.sfregato { fill: none; stroke: #6bb93a; stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; opacity: .95; }
.ripasso { fill: none; stroke: #2a2730; stroke-width: 1.9; stroke-linecap: round; pointer-events: none; }
.guida-matita { fill: none; stroke: #1f5fbf; stroke-width: 1.6; stroke-dasharray: 4 4; pointer-events: none; }
.guida-matita.da-colorare { stroke: #3b8a1f; stroke-width: 2.2; animation: colora 1.1s ease-in-out infinite; }
@keyframes colora { 50% { opacity: .35; } }
.punta-guida { fill: #1f5fbf; stroke: #fff; stroke-width: 2; pointer-events: none; animation: punta 1s ease-in-out infinite; }
@keyframes punta { 50% { opacity: .45; } }
.timbro { opacity: 0; fill: none; stroke: #b3252b; stroke-width: 3; pointer-events: none; }
.timbro text { fill: #b3252b; stroke: none; }
.timbrato .timbro { opacity: .85; transition: opacity .15s ease .5s; }
.matita { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 30; pointer-events: none; }
.matita svg { position: absolute; left: -8px; top: 0; width: 16px; height: auto; transform-origin: 8px 0; transform: rotate(-32deg); transition: transform .12s ease; }
.matita.preme svg { transform: rotate(-32deg) scaleY(.96); }
.luce .matita { opacity: 0; transition: opacity .6s ease; }

/* About: tutto in uno schermo, spazi e campo del messaggio si adattano all'altezza disponibile */
.pagina-about { min-height: 100svh; display: flex; flex-direction: column; }
.pagina-about .info { flex: 1; display: flex; flex-direction: column; padding: clamp(14px, 7vh, 96px) var(--margine) clamp(10px, 2vh, 20px); }
.pagina-about .blocco { margin-bottom: clamp(14px, 4vh, 48px); }
/* Biografia e contatti al centro dello spazio tra il nome e l'avviso in fondo */
.pagina-about .blocco:nth-of-type(1) { margin-top: auto; }
.pagina-about .blocco:nth-of-type(2) { margin-bottom: auto; padding-bottom: clamp(8px, 2vh, 20px); }
.pagina-about .modulo { gap: clamp(8px, 1.8vh, 20px); align-content: start; }
.pagina-about .modulo textarea { min-height: clamp(44px, 14vh, 150px); resize: none; }
.pagina-about .modulo label { gap: 2px; }
.pagina-about .modulo input, .pagina-about .modulo textarea { padding: 4px 8px; }
.pagina-about .puntini { margin-top: 4px; }
.pagina-about .modulo button { padding: 7px 22px; }
.pagina-about .esito { min-height: 1.2em; }
/* Il ritratto: al centro passando sopra Biography, piccolo accanto al testo dove non c'è il mouse */
.ritratto { position: fixed; left: 50%; top: 50%; z-index: 5; width: auto; max-width: none; height: min(78svh, 720px); transform: translate(-50%, -50%); opacity: 0; transition: opacity .35s; }
.blocco h2:hover ~ .ritratto, .blocco .corpo:hover ~ .ritratto { opacity: 1; }
.pagina-about .blocco h2:first-child { width: fit-content; }
.pagina-about .testata { z-index: 6; }
.ritratto-piccolo { display: none; }
@media (hover: none), (max-width: 767px) {
  .ritratto { display: none; }
  .ritratto-piccolo { display: block; float: right; width: clamp(58px, 20vw, 92px); margin: 0 0 4px 12px; border: 3px solid #000; }
  .pagina-about .blocco .corpo { text-indent: 0; }
}
@media (max-width: 767px) and (max-height: 600px) {
  .pagina-about .modulo textarea { min-height: 44px; }
}

/* About: etichetta a sinistra, testo a destra, stesso font del resto del sito */
.info { padding: 22vh var(--margine) 96px; }
.blocco { display: grid; grid-template-columns: 1fr 2fr; margin-bottom: 72px; }
.blocco .corpo { text-indent: 4em; max-width: 720px; }
.blocco .contatti { text-indent: 0; }
.contatti a { display: block; width: fit-content; }

@media (max-width: 767px) {
  /* Nome e menu sulla stessa riga: il nome prende lo spazio che resta tra i due menu */
  .nome { font-size: min(5.5vw, 34px); }
  .testata nav { white-space: nowrap; }
  .testata nav a { margin-right: 12px; }
  .testata nav:last-child a { margin-left: 12px; }
  .testata nav a, .tema button { padding-block: 10px; }
  .tema button { margin: -10px 0 -10px 8px; }
  .copyright { margin-left: 0; }
  .presentazione { margin-left: 0; }
  .riga { grid-template-columns: 2.4em 1fr auto; row-gap: 4px; padding: 14px 0; }
  .riga .tipo, .riga .luogo { display: none; }
  .scena img { border-width: 3px; }
  .anteprima { display: none; }
  .buio { --raggio: 85px; }
  .foglio-identikit { top: 88px; right: auto; left: 50%; height: auto; width: min(90vw, calc((75svh - 88px) * 600 / 760)); transform: translateX(-50%) rotate(.6deg); }
  .intreccio { --s: .52; width: 52px; height: 62px; perspective: 320px; }
  .scena { margin: 16px 0 0; }
  .barra { grid-template-columns: 1fr auto; row-gap: 6px; }
  .barra h1 { grid-column: 1 / -1; }
  .barra nav button:first-child { margin-left: 0; }
  .indice { grid-template-columns: repeat(3, 1fr); gap: 24px 8px; }
  .blocco { grid-template-columns: 1fr; row-gap: 16px; }
  .pagina-about .blocco { row-gap: 4px; }
  .pagina-about .info { padding-top: clamp(10px, 3vh, 40px); }
  .blocco .corpo { text-indent: 2em; }
  .scheda { grid-template-columns: 1fr; row-gap: 32px; }
  .crediti { position: static; padding-right: 0; }
  .opera { max-width: none; }
}

/* Dark/Light come un interruttore, sul telefono e su computer solo con la finestra molto stretta:
   si legge solo la modalità attiva, toccandola si passa all'altra (stessa condizione in tema.js) */
@media (max-width: 480px), (max-width: 767px) and (hover: none) {
  .tema button { margin-left: 0; }
  :root:not([data-tema="dark"]) .tema [data-scelta="dark"], :root[data-tema="dark"] .tema [data-scelta="light"] { display: none; }
}
/* Nelle finestre strette la frase di Dark e Light finirebbe sopra il nome */
@media (max-width: 620px) { .tema button:hover::after { content: none; } }
