:root {
  --muro: #1a2133;         /* the showroom wall */
  --muro-alto: #29334c;    /* the top of the wall, under the ceiling */
  --pavimento: #0f131d;    /* the polished floor */
  --luce: #fff1d6;         /* the warm ceiling lights */
  --pedana: #2b3346;       /* the turntable's top */
  --metallo: #a3adbf;      /* the turntable's rim and the trims */
  --anello: #ffb23f;       /* the light that runs around the turntable */
  --racing: #d8232c;       /* paint: Racing Red */
  --glacier: #e6ecf1;      /* paint: Glacier */
  --midnight: #1f3266;     /* paint: Midnight */
  --sage: #8ea68a;         /* paint: Sage */
  --saffron: #f2a12e;      /* paint: Saffron */
  --pinza: #ff5a3c;        /* the brake calipers and the button */
  --testo: #f6f0e6;        /* the text */
  --testo-2: #9ea8bd;      /* the quieter text */
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

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

p, h1 { margin: 0; }

button { font: inherit; color: inherit; }

/* ---------------------------------------------------------------- the stage */
.palco {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--pavimento);
  overflow: hidden;
}

.testata {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: clamp(10px, 2.6vh, 26px) clamp(16px, 4vw, 52px) 0;
}

.marchio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(16px, min(2.2vw, 3.6vh), 26px);
  font-weight: 800;
  font-variation-settings: 'wdth' 88;
  letter-spacing: -0.01em;
}

.marchio svg { width: 1.05em; height: 1.05em; }
.marchio svg path { fill: var(--anello); }

.sotto {
  font-size: clamp(10px, min(1.2vw, 2.2vh), 13px);
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--testo-2);
}

.scena-box {
  position: relative;
  min-height: 0;
}

.scena {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.titolo {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  font-size: clamp(20px, min(3vw, 5vh), 40px);
  line-height: 1;
  font-weight: 800;
  font-variation-settings: 'wdth' 80;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.titolo__frase {
  font-size: 0.5em;
  font-weight: 350;
  font-variation-settings: 'wdth' 100;
  letter-spacing: 0;
  color: var(--testo-2);
}

/* ---------------------------------------------------------------- the panel under the car */
.pannello {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(6px, 1.6vh, 14px);
  padding: 0 clamp(16px, 4vw, 52px) clamp(12px, 3vh, 30px);
}

.riga {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 2vw, 20px);
}

.scelta, .prezzo {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  white-space: nowrap;
  min-width: 0;
}

.scelta__cosa, .prezzo__da, .nota {
  font-size: clamp(10px, min(1.15vw, 2.1vh), 13px);
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--testo-2);
}

.scelta__nome {
  display: inline-block;
  font-size: clamp(16px, min(2.2vw, 3.8vh), 26px);
  font-weight: 750;
  font-variation-settings: 'wdth' 90;
}

.prezzo__cifra {
  font-size: clamp(16px, min(2.2vw, 3.8vh), 26px);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wdth' 90;
}

.riga--scelte { justify-content: flex-start; }
.riga--scelte .scelta { min-width: 9.5em; }

.vernici, .cerchi {
  display: flex;
  gap: clamp(6px, 1vw, 12px);
}

.divisore {
  width: 1px;
  align-self: stretch;
  background: color-mix(in srgb, var(--testo-2) 40%, transparent);
}

/* a paint chip: a small lacquered square with the light on it */
.vernice {
  position: relative;
  width: clamp(26px, min(3.4vw, 6vh), 42px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(to bottom, transparent 55%, rgba(0, 0, 0, 0.32)),
    var(--chip);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 4px 10px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.34, 1.8, 0.5, 1);
}

.vernice::after, .cerchio::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 13px;
  border: 1.5px solid var(--anello);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.25s ease, transform 0.5s cubic-bezier(0.34, 1.8, 0.5, 1);
}

.vernice[aria-checked='true']::after, .cerchio[aria-checked='true']::after { opacity: 1; transform: scale(1); }

.cerchio {
  position: relative;
  width: clamp(26px, min(3.4vw, 6vh), 42px);
  aspect-ratio: 1;
  padding: 3px;
  border: 0;
  border-radius: 50%;
  background: #12161f;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.34, 1.8, 0.5, 1);
}

.cerchio::after { border-radius: 50%; }
.cerchio svg { width: 100%; height: 100%; display: block; }

.vernice:focus-visible, .cerchio:focus-visible { outline: 2px solid var(--testo); outline-offset: 7px; }

@media (hover: hover) {
  .vernice:hover, .cerchio:hover { transform: translateY(-3px) scale(1.06); }
}

.vernice:active, .cerchio:active { transform: scale(0.92); transition-duration: 0.12s; }

.entra .vernice, .entra .cerchio { transition: none; }

/* the button: a pill that swells, the word widens */
.tasto {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.85em 1.4em 0.85em 1.6em;
  color: #1b0f0b;
  text-decoration: none;
  font-size: clamp(12px, min(1.4vw, 2.4vh), 16px);
  font-weight: 800;
  white-space: nowrap;
  isolation: isolate;
}

.tasto::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--pinza), white 18%), var(--pinza));
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--pinza) 70%, transparent);
  transition: transform 0.6s cubic-bezier(0.34, 1.9, 0.5, 1);
}

.tasto__testo {
  display: inline-block;
  font-variation-settings: 'wdth' 92;
  transition: font-variation-settings 0.55s cubic-bezier(0.34, 1.7, 0.5, 1);
}

.tasto__freccia {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.5s cubic-bezier(0.34, 1.8, 0.5, 1);
}

.tasto:focus-visible { outline: 2px solid var(--testo); outline-offset: 6px; border-radius: 999px; }

@media (hover: hover) {
  .tasto:hover::before { transform: scale(1.06, 1.14); }
  .tasto:hover .tasto__testo { font-variation-settings: 'wdth' 115; }
  .tasto:hover .tasto__freccia { transform: translateX(3px); }
}

.tasto:active::before { transform: scale(0.95); transition-duration: 0.12s; }

/* ---------------------------------------------------------------- narrow and short screens */
@media (max-width: 640px) {
  .titolo__frase { display: none; }
  .riga--scelte { flex-wrap: wrap; row-gap: 6px; }
  .riga--scelte .scelta { min-width: 0; width: 100%; }
  .riga--scelte { justify-content: space-between; }
  .nota { display: none; }
  .riga--azione { justify-content: stretch; }
  .tasto { flex: 1; justify-content: center; padding-block: 0.75em; }
}

@media (max-height: 520px) {
  .titolo__frase { font-size: clamp(22px, 7vh, 40px); }
  .sotto { display: none; }
  .pannello { gap: 6px; }
  .vernice, .cerchio { width: clamp(22px, 7vh, 30px); }
  .tasto { padding-block: 0.6em; }
}

@media (max-width: 380px) {
  .vernici, .cerchi { gap: 5px; }
  .vernice, .cerchio { width: 25px; }
}
