/* The product changelog on scroll. Colours in :root (the Playground palette). */
:root {
  --fondo: #ffffff;
  --scheda: #ffffff;
  --grigio: #f4f4f5;
  --inchiostro: #0b0b0f;
  --secondario: #71717a;
  --tenue: #a1a1aa;
  --linea: #e4e4e7;
  --bordo: rgba(10, 10, 20, 0.08);
  --accento: #2563eb;
  --accento-tenue: #dbeafe;
  --nuovo: #2563eb;
  --migliorato: #7c3aed;
  --corretto: #059669;
  --scuro: #18181b;
  --ombra: 0 1px 2px rgba(10, 10, 20, 0.04), 0 18px 40px -22px rgba(10, 10, 20, 0.22);
}

* { 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;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.corsa { position: relative; height: 420vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3.6vh, 34px);
  padding: clamp(12px, 4vh, 40px) clamp(14px, 4vw, 48px);
  overflow: hidden;
}

.testa { text-align: center; }
.testa__nota {
  font-size: clamp(11px, 1.7vh, 13px);
  font-weight: 560;
  color: var(--accento);
  margin-bottom: 6px;
}
.testa__titolo {
  font-size: clamp(19px, min(4.2vw, 5.4vh), 42px);
  font-weight: 640;
  font-stretch: 105%;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.testa__titolo span { color: var(--secondario); }

.corpo {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: clamp(96px, 16vw, 150px) 1fr;
  gap: clamp(14px, 3vw, 36px);
  align-items: stretch;
}

/* ---------- the version rail ---------- */
.binario {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 0 6px 18px;
}
.binario__linea {
  position: absolute;
  left: 4px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--linea);
  overflow: hidden;
}
.binario__pieno {
  position: absolute;
  inset: 0;
  background: var(--accento);
  transform-origin: 50% 0;
  transform: scaleY(0);
}
/* the current version is marked by a short bar that slides along the line, not by a dot */
.binario__segno {
  position: absolute;
  left: 2px;
  top: 0;
  width: 5px;
  height: 22px;
  border-radius: 3px;
  background: var(--accento);
  box-shadow: 0 0 0 3px var(--fondo);
}
.versione {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: 8px;
  text-align: left;
  color: var(--tenue);
  transition: color 0.3s, background-color 0.3s;
}
.versione::before {
  /* a small tick where the version meets the line */
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 7px;
  height: 1px;
  background: var(--linea);
}
.versione__nome {
  font-size: clamp(13px, 2vh, 16px);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  font-stretch: 104%;
}
.versione__data { font-size: clamp(11px, 1.6vh, 12.5px); font-weight: 450; }
.versione.e-attiva { color: var(--inchiostro); }
.versione.e-attiva .versione__data { color: var(--secondario); }
.versione:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
@media (hover: hover) {
  .versione:hover { background: var(--grigio); color: var(--inchiostro); }
}

/* ---------- the release cards ---------- */
.pila {
  position: relative;
  height: min(54vh, 330px);
  min-height: 210px;
}
.uscita {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 2.6vh, 24px) clamp(14px, 2.4vw, 24px);
  background: var(--scheda);
  border: 1px solid var(--bordo);
  border-radius: 18px;
  box-shadow: var(--ombra);
  will-change: transform, opacity;
}
.uscita__testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: clamp(6px, 1.4vh, 12px);
}
.uscita__pillole { display: flex; gap: 6px; }
.pillola {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.pillola--new { color: var(--nuovo); background: #eaf1ff; }
.pillola--improved { color: var(--migliorato); background: #f1eafe; }
.pillola--fixed { color: var(--corretto); background: #e3f6ee; }
.pillola--api { color: var(--secondario); background: var(--grigio); }
.uscita__data {
  font-size: clamp(11px, 1.6vh, 12.5px);
  color: var(--tenue);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.uscita__titolo {
  font-size: clamp(16px, min(2.6vw, 3.4vh), 23px);
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.uscita__riga {
  margin-top: 6px;
  font-size: clamp(12px, 1.9vh, 14.5px);
  line-height: 1.45;
  color: var(--secondario);
  max-width: 46ch;
}
.pezzo {
  margin-top: auto;
  padding-top: clamp(8px, 1.8vh, 14px);
  display: flex;
  align-items: center;
  gap: 14px;
}

/* dark mode piece */
.schermo {
  flex: 1;
  height: clamp(56px, 11vh, 84px);
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: var(--grigio);
  border: 1px solid var(--bordo);
}
.schermo__lato { display: flex; flex-direction: column; gap: 5px; width: 22%; }
.schermo__lato i, .schermo__riga {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: #d4d4d8;
}
.schermo__lato i:nth-child(2) { width: 70%; }
.schermo__lato i:nth-child(3) { width: 85%; }
.schermo__corpo { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.schermo__riga--corta { width: 40%; }
.schermo__barre { flex: 1; display: flex; align-items: flex-end; gap: 5px; }
.schermo__barre b { flex: 1; border-radius: 3px 3px 1px 1px; background: #c7d2fe; height: 40%; }
.schermo__barre b:nth-child(2) { height: 65%; }
.schermo__barre b:nth-child(3) { height: 50%; }
.schermo__barre b:nth-child(4) { height: 85%; }
.schermo__barre b:nth-child(5) { height: 70%; }
.interruttore { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--secondario); }
.interruttore__binario {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #d4d4d8;
}
.interruttore__pomello {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* search piece */
.pezzo--cerca { flex-direction: column; align-items: stretch; gap: 6px; }
.cerca {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--bordo);
  background: var(--fondo);
  font-size: 13px;
}
.cerca__lente { width: 15px; height: 15px; fill: none; stroke: var(--tenue); stroke-width: 1.5; stroke-linecap: round; }
.cerca__cursore { width: 1px; height: 15px; background: var(--accento); margin-left: -6px; }
.cerca__tempo {
  margin-left: auto;
  font-size: 11px;
  color: var(--corretto);
  background: #e3f6ee;
  padding: 2px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.risultati { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.risultati li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12.5px;
}
.risultati li:first-child { background: var(--grigio); }
.risultati svg { width: 14px; height: 14px; fill: none; stroke: var(--secondario); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.risultati em { margin-left: auto; font-style: normal; color: var(--tenue); font-size: 11.5px; }

/* code piece */
.pezzo--codice { align-items: flex-end; justify-content: space-between; }
.codice {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--scuro);
  color: #e4e4e7;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: clamp(10.5px, 1.7vh, 12.5px);
  line-height: 1.6;
  overflow: hidden;
  white-space: pre;
}
.codice .k { color: #93c5fd; font-weight: 600; }
.codice .s { color: #c4b5fd; font-weight: 400; }
.codice .v { color: #86efac; font-weight: 400; }
.codice .riga { display: inline-block; }
.esito {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--corretto);
  background: #e3f6ee;
  padding: 4px 9px 4px 6px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.esito svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* chart piece */
.pezzo--grafico { flex-direction: column; align-items: stretch; gap: 4px; }
.grafico { width: 100%; height: clamp(44px, 9vh, 66px); overflow: visible; }
.grafico path { fill: none; stroke-linecap: round; }
.grafico__griglia { stroke: var(--linea); stroke-width: 1; stroke-dasharray: 3 4; }
.grafico__prima { stroke: #f87171; stroke-width: 2; }
.grafico__dopo { stroke: var(--corretto); stroke-width: 2; }
.grafico__nota { display: flex; justify-content: space-between; font-size: 12px; color: var(--secondario); }
.grafico__nota strong { color: var(--corretto); font-weight: 650; font-variant-numeric: tabular-nums; }

.piede { font-size: clamp(11px, 1.6vh, 12.5px); color: var(--tenue); }

@media (hover: hover) {
  .uscita { transition: box-shadow 0.35s; }
  .uscita:hover { box-shadow: 0 1px 2px rgba(10, 10, 20, 0.05), 0 26px 50px -24px rgba(10, 10, 20, 0.3); }
}

/* ---------- phone: one column, the rail becomes a row on top ---------- */
@media (max-width: 600px) {
  .corpo { grid-template-columns: 1fr; gap: 10px; }
  .binario {
    flex-direction: row;
    padding: 0 0 12px;
  }
  .binario__linea { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 1px; }
  .binario__pieno { transform-origin: 0 50%; transform: scaleX(0); }
  .binario__segno { top: auto; bottom: -2px; left: 0; width: 22px; height: 5px; }
  .versione { margin-left: 0; align-items: center; padding: 3px 6px; }
  .versione::before { left: 50%; top: auto; bottom: -9px; width: 1px; height: 6px; }
  .versione__data { display: none; }
  .pila { height: min(58vh, 300px); min-height: 0; }
  .uscita__riga { font-size: 12px; }
  .piede { display: none; }
}
@media (max-height: 460px) {
  .testa__nota, .piede { display: none; }
  .uscita__riga { display: none; }
}
