/* Sezione «Dietro il pupazzo» (Chi siamo). Il raggio della lente è una proprietà animabile. */
@property --r { syntax: "<length>"; inherits: true; initial-value: 0px; }

.bht { padding: 12vh 0 4vh; }
.bht-head { display: grid; gap: 18px; max-width: 760px; margin-bottom: 44px; }
.bht-head p { margin: 0; }
.bht-hint { color: var(--bh-muted, rgba(255,255,255,.62)); font-size: 14px; }
.bht-hint-touch { display: none; }
@media (hover: none) { .bht-hint-hover { display: none; } .bht-hint-touch { display: inline; } }

.bht-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; }
.bht-grid[data-count="1"] { grid-template-columns: minmax(0, 340px); }
.bht-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 340px)); }
.bht-grid[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.bhs main .bht-grid { padding: 0; } body.bhs main .bht-grid li { margin: 0; padding: 0; } body.bhs main .bht-grid li::before { display: none; }
.bht-card { position: relative; display: grid; align-content: start; gap: 14px; container-type: inline-size; } /* cqw = larghezza della scheda */

.bht-media {
  --x: 50%; --y: 42%; --r: 0px;
  position: relative; aspect-ratio: 1; overflow: hidden; isolation: isolate;
  border-radius: var(--bh-r-s, 18px); background: #bfbcc0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 24px 60px -30px rgba(0,0,0,.8);
  transition: --r .5s cubic-bezier(.16,1,.3,1), box-shadow .4s, transform .25s ease-out;
  transform-style: preserve-3d; will-change: transform;
}
.bht-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bht-reveal {
  position: absolute; inset: 0; z-index: 1;
  -webkit-mask: radial-gradient(circle var(--r) at var(--x) var(--y), #000 62%, transparent 100%);
          mask: radial-gradient(circle var(--r) at var(--x) var(--y), #000 62%, transparent 100%);
}
.bht-lens {
  position: absolute; z-index: 2; left: var(--x); top: var(--y); width: calc(var(--r) * 2); height: calc(var(--r) * 2);
  border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; opacity: 0; transition: opacity .3s;
  box-shadow: 0 0 40px 10px rgba(20,10,40,.18);
}
.bht-toggle { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: inherit; background: none; cursor: crosshair; }
.bht-toggle:focus-visible { outline: 2px solid #c4b5fd; outline-offset: -4px; }
.bht-tag { position: absolute; z-index: 4; top: 10px; left: 10px; padding: 3px 9px; border-radius: 99px; background: #f2a93b; color: #1a1208; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; pointer-events: none; }

/* mouse: lente sul puntatore */
@media (hover: hover) {
  .bht-media:hover { --r: 42cqw; box-shadow: 0 0 0 1px rgba(196,181,253,.5), 0 30px 70px -28px rgba(124,58,237,.75); }
  .bht-media:hover .bht-lens { opacity: 1; }
}
/* foto intera: clic, tocco, Invio; senza JavaScript basta il focus sul pulsante */
.bht-media.is-open, html:not(.bh-js) .bht-media:focus-within { --r: 150cqw; }
.bht-media.is-open .bht-lens, html:not(.bh-js) .bht-media:focus-within .bht-lens { opacity: 0; }

.bht-name { display: grid; gap: 3px; margin: 0; }
body .bht .bht-name a { color: inherit; font-weight: 700; font-size: 17px; text-decoration: none; }
body .bht .bht-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bht-name span { color: var(--bh-muted, rgba(255,255,255,.62)); font-size: 14px; }

@media (max-width: 980px) { .bht-grid, .bht-grid[data-count="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (max-width: 980px) { .bht-grid[data-count="1"] { grid-template-columns: minmax(0, 300px); } }
@media (max-width: 640px) { body .bht .bht-name a { font-size: 15px; } .bht-name span { font-size: 13px; } }
/* WebGL attivo: il canvas sostituisce le immagini e la lente CSS */
.bht-canvas { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; display: block; }
.bht-gl .bht-reveal, .bht-gl .bht-lens { display: none; }
@media (prefers-reduced-motion: reduce) {
  .bht-media, .bht-lens { transition: none; }
}
