/* ============================================
   RESPLANET — Livello "Awwwards"
   1. Lente "negativo" sul titolo della hero
   2. Specchio liquido sotto "specchi digitali"
   3. Anello 3D dei lavori
   4. "100%" che si decodifica come codice
   ============================================ */

/* ---------- 1. LENTE ---------- */
.hero-titolo-wrap { position: relative; }
.hero-lente {
  position: absolute !important;
  inset: 0;
  margin: 0 !important;
  pointer-events: none;
  color: var(--black);
  background: var(--accent);
  clip-path: circle(var(--r, 0px) at var(--lx, 50%) var(--ly, 50%));
  -webkit-clip-path: circle(var(--r, 0px) at var(--lx, 50%) var(--ly, 50%));
  will-change: clip-path;
  z-index: 2;
}
.hero-lente .hl.accent { color: var(--black); }
/* dentro la lente le lettere si "stampano" in rilievo */
.hero-lente .hl { text-shadow: 2px 2px 0 rgba(8,8,8,.18); }
.cur.cur--lente { opacity: 0; }

/* ---------- 2. SPECCHIO LIQUIDO ---------- */
.s-manifesto__body { position: relative; }
.specchio {
  position: absolute;
  left: 0;
  pointer-events: auto;
  touch-action: pan-y;
  display: block;
}
.specchio-linea {
  position: absolute;
  left: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(200,255,0,.55) 20%, rgba(240,237,230,.35) 60%, transparent);
  box-shadow: 0 0 18px rgba(200,255,0,.35);
}

/* ---------- 3. ANELLO 3D DEI LAVORI ---------- */
.anello {
  --w: clamp(250px, 30vw, 470px);
  position: relative;
  width: 100%;
  height: calc(var(--w) * .62 + clamp(120px, 14vw, 220px));
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.anello.trascino { cursor: grabbing; }
.anello__scena {
  position: absolute; inset: 0;
  perspective: 1500px;
  perspective-origin: 50% 40%;
}
.anello__ruota {
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.anello__card {
  position: absolute;
  left: calc(var(--w) / -2);
  top: calc(var(--w) * -.31);
  width: var(--w);
  height: calc(var(--w) * .62);
  display: block;
  background: #050505;
  border: 1px solid rgba(200,255,0,.22);
  text-decoration: none;
  overflow: hidden;
  backface-visibility: visible;
  transition: border-color .35s, box-shadow .35s;
}
.anello__card img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  pointer-events: none;
  filter: brightness(1.25) contrast(1.05) saturate(.95);
  transition: transform .6s cubic-bezier(.16,1,.3,1), filter .4s;
}
.anello__nome {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 18px 12px;
  font-family: var(--display);
  font-size: clamp(18px, 1.8vw, 28px);
  line-height: 1;
  letter-spacing: .01em;
  color: var(--white);
  text-transform: uppercase;
  background: linear-gradient(to top, rgba(8,8,8,.92), transparent);
  transform: translateY(101%);
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}
.anello__nome em { color: var(--accent); font-style: italic; }
.anello__card:hover,
.anello__card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 60px -10px rgba(200,255,0,.55); }
.anello__card:hover img { transform: scale(1.04); filter: brightness(1.4) contrast(1.05); }
.anello__card:hover .anello__nome,
.anello__card:focus-visible .anello__nome,
.anello__card.davanti .anello__nome { transform: translateY(0); }
.anello__hint {
  position: absolute; left: 0; right: 0; bottom: 6px;
  text-align: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: .35em;
  text-transform: uppercase;
  color: rgba(200,255,0,.55);
  pointer-events: none;
}
.anello .tape-fade { z-index: 2; }
@media (max-width: 767px) {
  .anello { --w: clamp(220px, 68vw, 340px); }
  .anello .tape-fade { width: 40px; }
}

/* ---------- 4. "100%" IN CODICE ---------- */
.big-num.decodifica { font-variant-numeric: tabular-nums; min-width: 4.2ch; }
.big-num .glifo { color: rgba(200,255,0,.45); font-family: var(--mono); font-size: .62em; vertical-align: .22em; }
.big-label .riga { display: block; white-space: pre; }
.big-label .caret {
  display: inline-block; width: .6em; height: 1.05em;
  margin-left: 2px; vertical-align: -.18em;
  background: var(--accent);
  animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .anello__card img, .anello__nome { transition: none; }
}


/* ============================================
   5. IL PORTALE — "Guarda i miei lavori"
   Anello di testo che gira, i lavori veri dentro il disco,
   centro lime magnetico, transizione di pagina al clic.
   ============================================ */
.portale {
  --d: clamp(176px, 15vw, 248px);
  position: relative;
  width: var(--d); height: var(--d);
  display: grid; place-items: center;
  text-decoration: none; color: var(--white);
  border-radius: 50%;
  translate: var(--mx, 0px) var(--my, 0px);
  transition: translate .6s cubic-bezier(.16,1,.3,1);
  -webkit-tap-highlight-color: transparent;
}
.portale:focus-visible { outline: 2px solid var(--accent); outline-offset: 10px; }
/* alone */
.portale::before {
  content: ""; position: absolute; inset: -18%; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(200,255,0,.22), rgba(200,255,0,.06) 60%, transparent 76%);
  transition: transform .6s cubic-bezier(.16,1,.3,1), opacity .4s;
  opacity: .8;
}
.portale:hover::before { transform: scale(1.18); opacity: 1; }

/* anello di testo */
.portale__anello {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible;
  animation: portaleGiro 16s linear infinite;
  will-change: transform;
}
.portale__anello text {
  font-family: var(--mono); font-weight: 700; font-size: 12.5px; letter-spacing: .02em;
  fill: var(--white); text-transform: uppercase;
}
.portale__stella { fill: var(--accent); }
@keyframes portaleGiro { to { transform: rotate(360deg); } }

/* disco con i lavori */
.portale__disco {
  position: absolute; inset: 19%;
  border-radius: 50%; overflow: hidden;
  background: #0d0d0d;
  box-shadow: 0 0 0 1px rgba(200,255,0,.4), 0 18px 50px -14px rgba(0,0,0,.9), 0 0 50px -12px rgba(200,255,0,.45);
  transform: scale(.94);
  transition: transform .7s cubic-bezier(.16,1,.3,1), box-shadow .5s;
}
.portale__disco img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  opacity: 0;
  filter: grayscale(1) brightness(.75) contrast(1.1);
  transform: scale(1.25);
  transition: opacity 1.1s ease, transform 4s cubic-bezier(.2,.6,.2,1), filter .6s;
}
.portale__disco img.attiva { opacity: 1; transform: scale(1.05); }
.portale__velo {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 30%, rgba(8,8,8,.55) 100%);
}
.portale:hover .portale__disco { transform: scale(1.04); box-shadow: 0 0 0 1px var(--accent), 0 22px 60px -14px rgba(0,0,0,.9), 0 0 80px -10px rgba(200,255,0,.6); }
.portale:hover .portale__disco img { filter: grayscale(0) brightness(1.15) contrast(1.05); }

/* centro lime con la freccia */
.portale__centro {
  position: relative; z-index: 2;
  width: 30%; height: 30%;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--black);
  box-shadow: 0 10px 30px -8px rgba(200,255,0,.6);
  translate: var(--cx, 0px) var(--cy, 0px);
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), translate .35s cubic-bezier(.16,1,.3,1);
}
.portale__centro i {
  font-style: normal; font-family: var(--display); font-size: calc(var(--d) * .13); line-height: 1;
  transition: transform .5s cubic-bezier(.34,1.56,.64,1);
}
.portale:hover .portale__centro { transform: scale(1.14); }
.portale:hover .portale__centro i { transform: rotate(45deg); }

/* ---- TRANSIZIONE DI PAGINA: il cerchio lime che riempie lo schermo ---- */
.transizione-portale {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--accent);
  display: grid; place-items: center;
  clip-path: circle(0px at var(--tx, 50%) var(--ty, 50%));
  -webkit-clip-path: circle(0px at var(--tx, 50%) var(--ty, 50%));
  pointer-events: all;
}
.transizione-portale span {
  font-family: var(--display); font-size: clamp(90px, 22vw, 340px); line-height: 1;
  color: var(--black); text-transform: uppercase; letter-spacing: -.01em;
  opacity: 0; transform: translateY(30px) scale(.96);
}

@media (max-width: 767px) {
  .portale { --d: clamp(160px, 46vw, 210px); }
  .portale__anello text { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .portale__anello { animation: none; }
  .portale__disco img { transition: opacity .3s; transform: none; }
}
