:root {
  --fondo: #efede8;
  --fondo-luce: #f9f8f5;
  --testo: #1b1b1d;
  --testo-tenue: #7c7a76;
  --filo: rgba(20, 20, 22, 0.09);
  --montatura: #151517;
  --metallo: #d8d4cc;
  --accento: #d0632a;
  --smoke: #34383c;
  --amber: #b4691f;
  --sea: #1d5878;
  --rose: #b4646f;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--testo);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.palco {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  padding: clamp(12px, 3.6vh, 36px) 16px clamp(12px, 3.6vh, 32px);
  /* a soft daylight pool under the glasses */
  background: radial-gradient(55% 48% at 50% 52%, var(--fondo-luce), var(--fondo) 75%);
}

.testa {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.etichetta {
  font-size: clamp(13px, 1.9vh, 16px);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.sotto,
.nome-lente {
  font-size: clamp(11px, 1.6vh, 13px);
  color: var(--testo-tenue);
  display: inline-block;
  overflow: hidden;
  line-height: 1.3;
}

.rullo { display: inline-block; }

.scena {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  cursor: grab;
  touch-action: none;
}

.scena.presa { cursor: grabbing; }

.tela {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.ripiego {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  gap: 10px;
}

.ripiego span {
  width: min(22vw, 16vh);
  aspect-ratio: 1.3;
  border-radius: 40% 40% 46% 46%;
  border: 6px solid var(--montatura);
  background: var(--smoke);
}

.ripiego.acceso { display: flex; }

.piede {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.lenti {
  display: flex;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--filo);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 8px 24px -14px rgba(0, 0, 0, 0.25);
}

.campione {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

/* the lens swatch, in its own element so GSAP can press it without touching the ring: a tinted glass with a
   gradient from the top and a soft highlight */
.campione span {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background:
    radial-gradient(70% 50% at 35% 25%, rgba(255, 255, 255, 0.45), transparent 60%),
    linear-gradient(to bottom, var(--c), color-mix(in srgb, var(--c) 55%, #fff));
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* the mirror lens has a little rainbow sheen */
.campione.specchio span {
  background:
    radial-gradient(70% 50% at 35% 25%, rgba(255, 255, 255, 0.55), transparent 60%),
    linear-gradient(135deg, rgba(120, 220, 255, 0.5), transparent 45%, rgba(255, 170, 120, 0.35)),
    linear-gradient(to bottom, var(--c), color-mix(in srgb, var(--c) 60%, #fff));
}

.campione::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--accento);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.campione.attivo::after {
  opacity: 1;
  transform: scale(1);
}

.campione:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }

.puntatore {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.puntatore path {
  fill: #fff;
  stroke: #111;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .campione:hover span { transform: scale(1.08); transition: transform 0.25s; }
}
