
.scheda {
  --oro: #c9a55a;
  --oro-scuro: #a37f2e;
  --notte: #0b0e15;
  --avorio: #f4f1ea;
  --testo: #121212;
  --blu: #2b3a8c;
  --blu-luce: #8ea2ff;
  --testo-tenue: #55524b;
  --oro-testo: #7d5f20;
  --avorio-tenue: rgba(244, 241, 234, .76);
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --t-micro: 12px;
  --t-scheda: clamp(14.5px, .2vw + 13.6px, 16px);
  --t-h3: clamp(32px, 1.8vw + 22px, 50px);
  --spazio-lettere: .14em;
  --molla: cubic-bezier(.2, .7, .2, 1);
  --rimbalzo: cubic-bezier(.3, 1.4, .5, 1);

  --alza: 0px;
  --m: 104px;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--s-8) clamp(var(--s-5), 2.6vw, 40px) var(--s-7);
  border-radius: 22px;
  color: var(--inchiostro);
  font-family: var(--font-testo);
  line-height: 1.5;
  isolation: isolate;
  box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .95), 0 2px 6px rgba(0, 0, 0, .5);
  transform: translateY(var(--alza));
  transition: transform .6s var(--molla);
}
.scheda:hover, .scheda:focus-within { --alza: -6px; }

:where(.scheda) .scheda-fondo { position: absolute; inset: 0; z-index: -1; border-radius: inherit; overflow: hidden; background: var(--faccia); }
:where(.scheda) .scheda-fondo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
:where(.scheda) .scheda-fondo .inciso { opacity: .5; -webkit-mask: radial-gradient(70% 62% at 50% 54%, transparent 45%, #000 100%); mask: radial-gradient(70% 62% at 50% 54%, transparent 45%, #000 100%); }

.scheda::before, .scheda::after { content: ""; position: absolute; pointer-events: none; z-index: 0; }
.scheda::before { inset: 10px; border: 1px solid var(--linea); border-radius: 15px; }
.scheda::after { inset: 15px; border: 1px solid var(--linea); border-radius: 11px; opacity: .45; }

:where(.scheda) .indice { position: absolute; left: 24px; top: 24px; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--accento); }
:where(.scheda) .indice b { font-family: var(--font-titoli); font-weight: var(--peso-titoli); font-size: 26px; line-height: 1; letter-spacing: .02em; }
:where(.scheda) .indice svg { display: block; width: 11px; height: 11px; fill: currentColor; }
:where(.scheda) .indice.giu { left: auto; top: auto; right: 24px; bottom: 24px; transform: rotate(180deg); }

:where(.scheda) .medaglione { display: grid; place-items: center; width: 100%; height: 140px; margin-bottom: var(--s-4); }
:where(.scheda) .medaglione > svg { display: block; width: var(--m); height: var(--m); fill: var(--accento); overflow: visible; }
:where(.scheda) .grado { margin: 0; font-size: var(--t-micro); font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--colore-grado); }
:where(.scheda) .nome { margin: var(--s-2) 0 0; font-family: var(--font-titoli); font-weight: var(--peso-titoli); font-size: var(--t-h3); line-height: 1; letter-spacing: -.02em; text-wrap: balance; }
:where(.scheda) .motto { margin: var(--s-3) 0 0; max-width: 24em; font-size: var(--t-scheda); line-height: 1.45; color: var(--tenue); text-wrap: balance; }
:where(.scheda) .fregio { width: min(78%, 240px); height: 20px; margin: var(--s-5) auto; color: var(--linea); background: linear-gradient(currentColor, currentColor) left center / calc(50% - 14px) 1px no-repeat, linear-gradient(currentColor, currentColor) right center / calc(50% - 14px) 1px no-repeat; }
:where(.scheda) .fregio.pronto { background: none; }
:where(.scheda) .fregio svg { display: block; width: 100%; height: 100%; overflow: visible; }

.livello-1:where(.scheda) { --faccia: var(--avorio); --faccia-piatta: var(--avorio); --linea: var(--oro-scuro); --accento: var(--oro-scuro); --colore-grado: var(--oro-testo); --inchiostro: var(--testo); --tenue: var(--testo-tenue); --anello: var(--blu); --m: 96px; }
.livello-1:where(.scheda)::after { display: none; }
.livello-2:where(.scheda) { --faccia: radial-gradient(90% 40% at 50% 0%, rgba(142, 162, 255, .16), rgba(142, 162, 255, 0) 70%), var(--avorio); --faccia-piatta: var(--avorio); --linea: var(--blu); --accento: var(--blu); --colore-grado: var(--blu); --inchiostro: var(--testo); --tenue: var(--testo-tenue); --anello: var(--blu); --m: 120px; box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .95), 0 0 0 1px rgba(142, 162, 255, .85), 0 0 70px -10px rgba(142, 162, 255, .45); }
.livello-3:where(.scheda) { --faccia: radial-gradient(80% 55% at 50% 30%, rgba(43, 58, 140, .75), rgba(43, 58, 140, .12) 70%, rgba(43, 58, 140, 0)), var(--notte); --faccia-piatta: var(--notte); --linea: var(--oro); --accento: var(--oro); --colore-grado: var(--oro); --inchiostro: var(--avorio); --tenue: var(--avorio-tenue); --anello: var(--blu-luce); --m: 140px; }
.livello-3:where(.scheda)::before { border-width: 1.5px; }
.livello-3:where(.scheda)::after { opacity: .7; }

:where(.scheda) .etichetta { position: absolute; z-index: 2; left: 50%; top: 0; display: inline-flex; align-items: center; gap: var(--s-2); margin: 0; padding: var(--s-2) var(--s-4); border-radius: 99px; background: var(--blu); color: var(--avorio); font-size: var(--t-micro); font-weight: 500; line-height: 1.5; letter-spacing: var(--spazio-lettere); text-transform: uppercase; white-space: nowrap; transform: translate(-50%, -50%); box-shadow: 0 0 0 1px rgba(142, 162, 255, .7), 0 8px 24px -8px rgba(43, 58, 140, .9); }
:where(.scheda) .etichetta svg { display: block; width: 11px; height: 11px; fill: var(--blu-luce); }

@media (prefers-reduced-motion: reduce) {
  .scheda { transition: none; }
}
