:root {
  --carta: #f6f4ef;
  --inchiostro: #16141d;
  --grigio: #6e6a78;
  --riga: #e4e0d8;
  --bianco: #ffffff;
  --accento: #4b3bff;
  --accento-chiaro: #7a6dff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.palco {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 3vh 4vw;
}

.visore {
  /* as wide as the screen allows, but never taller than the page: the bar takes about 64 px */
  --w: min(88vw, 780px, calc((100vh - 13vh - 64px) * 16 / 9));
  width: var(--w);
  display: grid;
  gap: clamp(10px, 2.2vh, 18px);
}

.schermo {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: clamp(8px, 1.8cqw, 14px);
  background: var(--bianco);
  overflow: hidden;
  container-type: inline-size;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(22, 20, 29, .06),
    0 1px 2px rgba(22, 20, 29, .05),
    0 8px 20px -6px rgba(22, 20, 29, .10),
    0 30px 60px -24px rgba(40, 30, 120, .22);
}
.schermo::after {
  /* the bevel of the screen: a hair of light along the top edge */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(22, 20, 29, .04);
  z-index: 3;
}

/* ---- the slide ---- */
.slide {
  position: absolute;
  inset: 0;
  padding: 6.4cqw 7cqw 5.4cqw;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.slide .testa {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: max(9px, 1.55cqw);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--grigio);
  font-weight: 560;
  font-stretch: 110%;
}
.slide .testa > .maschera { flex: 1; }
.slide .testa b { color: var(--accento); font-weight: 650; }
.maschera { overflow: hidden; padding-bottom: .08em; }
.slide .titolo {
  align-self: center;
  font-size: 7.4cqw;
  line-height: .98;
  font-weight: 640;
  letter-spacing: -.025em;
  max-width: 15ch;
  font-variation-settings: "wdth" 100;
}
.slide .titolo .maschera { display: block; }
.slide .titolo span.parola { display: inline-block; }
.slide .titolo em { font-style: normal; color: var(--accento); }
.slide .piede {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 4cqw;
  border-top: 1px solid var(--riga);
  padding-top: 2.2cqw;
  font-size: max(9px, 1.6cqw);
  color: var(--grigio);
}
.slide .dato { display: grid; gap: .5cqw; }
.slide .dato strong {
  font-size: 3.4cqw;
  color: var(--inchiostro);
  font-weight: 620;
  letter-spacing: -.02em;
  line-height: 1;
}
.slide .colonne { display: flex; align-items: flex-end; gap: .9cqw; height: 6cqw; }
.slide .colonne i {
  display: block;
  width: 1.6cqw;
  border-radius: .4cqw .4cqw 0 0;
  background: var(--riga);
  transform-origin: 50% 100%;
}
.slide .colonne i:last-child { background: var(--accento); }

/* ---- the veil ---- */
.velo {
  position: absolute;
  inset: -1px;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--accento-chiaro) 0%, rgba(122, 109, 255, 0) 60%),
    var(--accento);
  --rx: 100%;
  --ry: 0px;
  --py: 100%;
  -webkit-mask-image: radial-gradient(var(--rx) var(--ry) at 50% var(--py), #000 calc(100% - 1.5px), transparent 100%);
  mask-image: radial-gradient(var(--rx) var(--ry) at 50% var(--py), #000 calc(100% - 1.5px), transparent 100%);
  visibility: hidden;
}
.velo-luce {
  /* a fine grain so the indigo is not a flat plate */
  position: absolute;
  inset: 0;
  opacity: .16;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
.velo-nome {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--bianco);
  font-size: 2.2cqw;
  font-weight: 560;
  font-stretch: 118%;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: 0;
}

/* ---- the bar under the screen ---- */
.barra {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.tasto {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--bianco);
  color: var(--inchiostro);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgba(22, 20, 29, .08), 0 2px 6px -2px rgba(22, 20, 29, .12);
  -webkit-tap-highlight-color: transparent;
}
.tasto svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.tasto.avanti { background: var(--inchiostro); color: var(--bianco); }
.tasto:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
@media (hover: hover) {
  .tasto:hover { box-shadow: 0 0 0 1px rgba(22, 20, 29, .14), 0 6px 14px -4px rgba(22, 20, 29, .2); }
  .tasto.avanti:hover { background: var(--accento); }
}

.centro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.nome {
  position: relative;
  height: 1.3em;
  overflow: hidden;
  font-size: 14px;
  font-weight: 560;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.nome span { position: absolute; left: 0; top: 0; }
.nome small { color: var(--grigio); font-weight: 450; font-size: inherit; margin-left: .5em; }

.miniature {
  position: relative;
  display: flex;
  gap: 6px;
  flex: none;
}
.mini {
  position: relative;
  width: 30px;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  border: 0;
  background: var(--bianco);
  box-shadow: 0 0 0 1px rgba(22, 20, 29, .1);
  cursor: pointer;
  padding: 3px 4px;
  display: grid;
  align-content: center;
  gap: 2px;
  overflow: hidden;
}
.mini i { display: block; height: 2px; border-radius: 1px; background: var(--riga); }
.mini i:first-child { width: 70%; background: #cfcad8; }
.mini i:last-child { width: 45%; }
.mini .tempo {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accento);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.anello {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 36px;
  height: calc(30px * 9 / 16 + 6px);
  border-radius: 5px;
  box-shadow: 0 0 0 1.5px var(--accento);
  pointer-events: none;
}

@media (max-width: 480px) {
  .barra { gap: 8px; }
  .tasto { width: 34px; height: 34px; }
  .tasto svg { width: 16px; height: 16px; }
  .nome { font-size: 12px; }
  .nome small { display: none; }
  .mini { width: 22px; padding: 2px 3px; }
  .miniature { gap: 4px; }
  .anello { width: 28px; height: calc(22px * 9 / 16 + 6px); }
}
