/* The garage reviews that build themselves as you scroll. Colours in :root (the Playground palette). */
:root {
  --fondo: #f4f1ec;
  --carta: #ffffff;
  --carta-bassa: #faf8f5;
  --inchiostro: #1d1b18;
  --secondario: #77716a;
  --spento: #e7e2db;
  --bordo: rgba(29, 27, 24, 0.08);
  --accento: #e39a2d;
  --accento-scuro: #b9741a;
}

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

.corsa { position: relative; height: 320vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2vh, 16px);
  padding: clamp(6px, 2vh, 28px) 10px;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 45%, rgba(227, 154, 45, 0.08), transparent 70%),
    var(--fondo);
}

.pannello {
  position: relative;
  container-type: inline-size;
  width: min(640px, 94vw, 138vh);
  padding: 5cqw 5.4cqw 5.4cqw;
  border-radius: 4.4cqw;
  background: linear-gradient(180deg, var(--carta), var(--carta-bassa));
  box-shadow:
    0 0 0 1px var(--bordo),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(29, 27, 24, 0.05),
    0 8px 24px -8px rgba(29, 27, 24, 0.1),
    0 40px 80px -30px rgba(29, 27, 24, 0.18);
  overflow: hidden;
}
/* the light that sweeps the panel once the average is complete */
.pannello__luce {
  position: absolute;
  inset: -20% auto -20% 0;
  width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 238, 210, 0.35), transparent);
  transform: translateX(-160%) skewX(-12deg);
  pointer-events: none;
  opacity: 0;
}

.testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
  margin-bottom: 4cqw;
}
.marchio {
  display: inline-flex;
  align-items: center;
  gap: 1.6cqw;
  font-size: max(11px, 2.6cqw);
  font-weight: 640;
  letter-spacing: -0.01em;
}
.marchio em { font-style: normal; font-weight: 450; color: var(--secondario); }
.marchio svg {
  width: max(16px, 3.6cqw);
  height: max(16px, 3.6cqw);
  fill: none;
  stroke: var(--inchiostro);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.testa__nota {
  font-size: max(9.5px, 1.9cqw);
  color: var(--secondario);
  padding: 0.8cqw 1.8cqw;
  border-radius: 99px;
  background: rgba(29, 27, 24, 0.04);
  box-shadow: inset 0 0 0 1px var(--bordo);
  white-space: nowrap;
}

/* the average and the distribution */
.voto {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6cqw;
}
.voto__grande { display: grid; justify-items: start; gap: 1.2cqw; }
.voto__numero {
  font-size: max(36px, 11cqw);
  line-height: 0.9;
  font-weight: 700;
  font-stretch: 92%;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.stelle { display: flex; gap: 0.6cqw; }
.stella { width: max(14px, 3.3cqw); height: max(14px, 3.3cqw); overflow: visible; }
.stella__fondo { fill: var(--spento); }
.stella__pieno { fill: var(--accento); }
.stella__tratto {
  fill: none;
  stroke: var(--accento-scuro);
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.voto__base {
  font-size: max(9.5px, 1.9cqw);
  color: var(--secondario);
  font-variant-numeric: tabular-nums;
}

.barre { list-style: none; display: grid; gap: 1.1cqw; }
.barra {
  display: grid;
  grid-template-columns: 2.6cqw 1fr 5cqw;
  align-items: center;
  gap: 1.6cqw;
  font-size: max(9px, 1.8cqw);
  color: var(--secondario);
  font-variant-numeric: tabular-nums;
}
.barra__n { text-align: right; }
.barra__pct { text-align: right; }
.barra__pista {
  position: relative;
  height: max(5px, 1.1cqw);
  border-radius: 99px;
  background: var(--spento);
  overflow: hidden;
}
.barra__pieno {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accento-scuro), var(--accento));
  transform-origin: 0 50%;
  transform: scaleX(0);
}
/* the small bright cap riding on the end of each bar */
.barra__pieno::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 14%;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 222, 0.7));
  border-radius: inherit;
}

.riga {
  display: block;
  height: 1px;
  margin: 4.4cqw 0 4cqw;
  background: var(--bordo);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* the review cards */
.card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.4cqw;
}
.recensione, .segnaposto { grid-column: calc(var(--i) + 1); grid-row: 1; }
/* the faint outlines waiting for the cards; each card lands on its own */
.segnaposto {
  border-radius: 2.6cqw;
  background:
    linear-gradient(var(--spento), var(--spento)) 2.6cqw 2.6cqw / 4.6cqw 4.6cqw no-repeat,
    linear-gradient(var(--spento), var(--spento)) 8.6cqw 3.2cqw / 40% 1.2cqw no-repeat,
    linear-gradient(var(--spento), var(--spento)) 2.6cqw 9.6cqw / 76% 1.2cqw no-repeat,
    linear-gradient(var(--spento), var(--spento)) 2.6cqw 12.6cqw / 60% 1.2cqw no-repeat,
    rgba(29, 27, 24, 0.018);
  box-shadow: inset 0 0 0 1px var(--bordo);
  opacity: 0.6;
  min-height: 18cqw;
}
.recensione {
  position: relative;
  display: grid;
  align-content: start;
  gap: 1.2cqw;
  padding: 2.6cqw;
  border-radius: 2.6cqw;
  background: var(--carta);
  box-shadow:
    0 0 0 1px var(--bordo),
    0 1px 2px rgba(29, 27, 24, 0.04),
    0 10px 22px -12px rgba(29, 27, 24, 0.16);
  opacity: 0;
}
.recensione__testa { display: flex; align-items: center; gap: 1.4cqw; }
.iniziali {
  flex: none;
  display: grid;
  place-items: center;
  width: max(22px, 4.6cqw);
  height: max(22px, 4.6cqw);
  border-radius: 50%;
  font-size: max(8.5px, 1.7cqw);
  font-weight: 650;
  color: var(--inchiostro);
  background: linear-gradient(140deg, #f6e3c3, #ecd0a6);
  box-shadow: inset 0 0 0 1px rgba(185, 116, 26, 0.18);
}
.recensione[style*="--i: 1"] .iniziali { background: linear-gradient(140deg, #e3e6dc, #cdd3c3); box-shadow: inset 0 0 0 1px rgba(60, 80, 50, 0.15); }
.recensione[style*="--i: 2"] .iniziali { background: linear-gradient(140deg, #e6e0ea, #d3c9da); box-shadow: inset 0 0 0 1px rgba(70, 50, 90, 0.14); }
.recensione__chi { display: grid; line-height: 1.2; min-width: 0; }
.recensione__nome { font-size: max(10px, 1.95cqw); font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recensione__data { font-size: max(8.5px, 1.6cqw); color: var(--secondario); }
.mini { display: flex; gap: 0.3cqw; }
.mini svg { width: max(9px, 1.8cqw); height: max(9px, 1.8cqw); fill: var(--accento); }
.recensione__testo {
  font-size: max(10px, 1.95cqw);
  line-height: 1.42;
  color: #3b3833;
  text-wrap: pretty;
}
.verificata {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.8cqw;
  margin-top: 0.4cqw;
  padding: 0.6cqw 1.6cqw 0.6cqw 1cqw;
  border-radius: 99px;
  font-size: max(8.5px, 1.6cqw);
  font-weight: 600;
  color: var(--accento-scuro);
  background: rgba(227, 154, 45, 0.1);
  box-shadow: inset 0 0 0 1px rgba(227, 154, 45, 0.25);
  opacity: 0;
}
.verificata svg { width: max(10px, 2cqw); height: max(10px, 2cqw); fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

@media (hover: hover) {
  .recensione { transition: box-shadow 0.35s ease; }
  .recensione:hover {
    box-shadow:
      0 0 0 1px rgba(227, 154, 45, 0.3),
      0 1px 2px rgba(29, 27, 24, 0.04),
      0 18px 30px -14px rgba(29, 27, 24, 0.24);
  }
}

.invito {
  font-size: 12px;
  color: var(--secondario);
  letter-spacing: 0.02em;
}

/* narrow panels (the phone): two cards stacked, a tighter header */
@media (max-width: 560px) {
  .pannello { padding: 4.6cqw 5cqw 5cqw; border-radius: 5cqw; }
  .testa { margin-bottom: 3.6cqw; }
  .marchio { font-size: max(12px, 4cqw); }
  .testa__nota { font-size: max(9.5px, 3cqw); padding: 1cqw 2.6cqw; }
  .voto { gap: 5cqw; }
  .voto__numero { font-size: max(34px, 15cqw); }
  .stella { width: max(13px, 4.6cqw); height: max(13px, 4.6cqw); }
  .voto__base { font-size: max(9.5px, 2.9cqw); }
  .barre { gap: 1.6cqw; }
  .barra { grid-template-columns: 3cqw 1fr 8cqw; font-size: max(9px, 2.8cqw); }
  .barra__pista { height: max(5px, 1.7cqw); }
  .riga { margin: 4cqw 0 3.6cqw; }
  .card { grid-template-columns: 1fr; gap: 2.6cqw; }
  .recensione { padding: 3cqw 3.4cqw; gap: 1.4cqw; border-radius: 3.6cqw; }
  .recensione, .segnaposto { grid-column: 1; grid-row: calc(var(--i) + 1); }
  .recensione[style*="--i: 2"], .segnaposto[style*="--i: 2"] { display: none; }
  .segnaposto { min-height: 22cqw; border-radius: 3.6cqw; background-size: 7cqw 7cqw, 40% 2cqw, 76% 2cqw, 0 0; background-position: 3.4cqw 3cqw, 12cqw 4.4cqw, 3.4cqw 13cqw, 0 0; }
  .recensione__testa { gap: 2.2cqw; }
  .iniziali { width: max(24px, 7cqw); height: max(24px, 7cqw); font-size: max(9px, 2.6cqw); }
  .recensione__nome { font-size: max(11px, 3.2cqw); }
  .recensione__data { font-size: max(9px, 2.6cqw); }
  .mini svg { width: max(9px, 2.7cqw); height: max(9px, 2.7cqw); }
  .mini { margin-left: auto; }
  .recensione__testo { font-size: max(10.5px, 3.1cqw); line-height: 1.38; }
  .verificata { font-size: max(9px, 2.6cqw); padding: 0.8cqw 2.4cqw 0.8cqw 1.6cqw; }
  .verificata svg { width: max(10px, 3cqw); height: max(10px, 3cqw); }
  .invito { font-size: 11px; }
}
