/* The deploy that goes live as you scroll. Colours in :root (the Playground palette). */
:root {
  --fondo: #0b0c0f;
  --carta: #121419;
  --carta-alta: #181b21;
  --inchiostro: #f1f2f5;
  --secondario: #8c909a;
  --spento: #4b4f58;
  --bordo: rgba(255, 255, 255, 0.07);
  --bordo-luce: rgba(255, 255, 255, 0.15);
  --viola: #8f7cff;
  --menta: #5fe0aa;
}

* { 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: 340vh; }
.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(5px, 1.6vh, 16px);
  padding: clamp(8px, 2.4vh, 32px) clamp(10px, 4vw, 64px);
  overflow: hidden;
  text-align: center;
  isolation: isolate;
}
/* a fine grain over the ground */
.palco::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.05;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the soft glow behind the card: violet while it works, mint once it is live */
.alone { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.alone span {
  position: absolute;
  left: 50%;
  top: 58%;
  width: min(900px, 130vw, 150vh);
  aspect-ratio: 1.6;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(40px);
}
.alone__viola { background: radial-gradient(closest-side, rgba(143, 124, 255, 0.2), rgba(143, 124, 255, 0.05) 55%, transparent); }
.alone__menta { background: radial-gradient(closest-side, rgba(95, 224, 170, 0.18), rgba(95, 224, 170, 0.04) 55%, transparent); opacity: 0; }

.occhiello {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 9px;
  border: 1px solid var(--bordo);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  color: var(--secondario);
  font-size: clamp(9.5px, min(1.2vw, 2vh), 13px);
  font-weight: 520;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  white-space: nowrap;
}
.occhiello svg { width: 1.2em; height: 1.2em; fill: none; stroke: var(--viola); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.occhiello__sep { color: var(--spento); }

.titolo {
  font-size: clamp(18px, min(4.2vw, 5vh), 50px);
  line-height: 1.06;
  font-weight: 640;
  font-stretch: 92%;
  letter-spacing: -0.028em;
}
.titolo__due {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  height: 1.12em;
  color: var(--secondario);
  font-weight: 520;
}
.titolo__in { display: inline-block; white-space: nowrap; }

/* the deploy card: a figure for GSAP, its look in CSS */
.deploy {
  position: relative;
  width: min(680px, 100%, 104vh);
  font-size: clamp(9px, min(1.5vw, 2.3vh), 15px);
  background: linear-gradient(180deg, var(--carta-alta), var(--carta) 46%);
  border: 1px solid var(--bordo);
  border-radius: 1.3em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 24px 60px -24px rgba(0, 0, 0, 0.8),
    0 40px 90px -50px rgba(143, 124, 255, 0.35);
  padding: 1.1em 1.25em 1em;
  text-align: left;
}
/* the light that follows the pointer */
.deploy__luce {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.05), transparent 70%);
  transition: opacity 0.4s ease;
}
@media (hover: hover) {
  .deploy:hover .deploy__luce { opacity: 1; }
}
/* the light that runs once round the edge when the deploy is live (angle and opacity set by GSAP) */
.deploy__giro {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  opacity: var(--giro-o, 0);
  background: conic-gradient(from var(--a, 0deg), transparent 0deg, transparent 280deg, rgba(95, 224, 170, 0.15) 310deg, var(--menta) 352deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.testa { display: flex; align-items: center; justify-content: space-between; gap: 0.8em; }
.repo { display: inline-flex; align-items: center; gap: 0.5em; min-width: 0; }
.repo__segno { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: var(--secondario); stroke-width: 1.3; stroke-linecap: round; }
.repo__nome { font-weight: 620; font-size: 1.08em; letter-spacing: -0.005em; }
.ramo, .hash {
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 0.86em;
  padding: 0.18em 0.55em;
  border-radius: 0.5em;
  border: 1px solid var(--bordo);
  background: rgba(255, 255, 255, 0.03);
  color: var(--secondario);
  white-space: nowrap;
}
.ramo { color: #c8c0ff; border-color: rgba(143, 124, 255, 0.25); background: rgba(143, 124, 255, 0.08); }

.stato {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  flex: none;
  padding: 0.3em 0.75em 0.3em 0.55em;
  border-radius: 999px;
  border: 1px solid var(--bordo);
  background: rgba(255, 255, 255, 0.03);
  color: var(--secondario);
  font-weight: 560;
  font-size: 0.95em;
}
.stato svg { width: 1.15em; height: 1.15em; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.stato__traccia { stroke: rgba(255, 255, 255, 0.1); stroke-width: 1.6; }
.stato__arco { stroke: var(--viola); stroke-width: 1.6; stroke-dasharray: 9 40; }
.stato__spunta { display: none; stroke: var(--menta); stroke-width: 1.8; }
.stato__spunta path { stroke-dasharray: 12; stroke-dashoffset: 12; }
.stato__finestra { display: inline-block; overflow: hidden; height: 1.3em; line-height: 1.3em; white-space: nowrap; }
.stato__in { display: inline-block; }

.commit {
  margin-top: 0.5em;
  color: var(--inchiostro);
  font-size: 0.95em;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.commit__chi { color: var(--spento); margin-left: 0.4em; }

/* the four stages: equal columns, each node centred, the line to the next node drawn between centres */
.tappe {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 1.1em -0.4em 0;
}
.tappa {
  --nodo: 2.75em;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  text-align: center;
}
.nodo {
  position: relative;
  width: var(--nodo);
  height: var(--nodo);
  border-radius: 50%;
  border: 1px solid var(--bordo-luce);
  background: var(--carta);
  color: var(--spento);
  display: grid;
  place-items: center;
  z-index: 1;
}
.nodo::after {
  /* the halo under the active node (opacity set by GSAP through --luce) */
  content: '';
  position: absolute;
  inset: -0.55em;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(143, 124, 255, 0.35), transparent);
  opacity: var(--luce, 0);
  z-index: -1;
  pointer-events: none;
}
.nodo svg { position: absolute; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nodo__giro { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); opacity: 0; }
.nodo__giro circle { stroke: var(--viola); stroke-width: 1.6; stroke-dasharray: 26 120; }
.nodo__icona { width: 46%; height: 46%; stroke: currentColor; stroke-width: 1.4; }
.nodo__spunta { width: 50%; height: 50%; stroke: #0b0c0f; stroke-width: 2.1; }
.nodo__spunta path { stroke-dasharray: 15; stroke-dashoffset: 15; }

.tappa__nome { font-weight: 540; color: var(--spento); font-size: 1em; font-variation-settings: 'wdth' var(--w, 92); }
.tappa__dato {
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 0.8em;
  color: var(--spento);
  white-space: nowrap;
  margin-top: -0.15em;
}

.filo {
  position: absolute;
  top: calc(var(--nodo) / 2 - 1px);
  left: calc(50% + var(--nodo) / 2 + 0.35em);
  width: calc(100% - var(--nodo) - 0.7em);
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.filo__pieno {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(143, 124, 255, 0.55), var(--viola));
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.filo__lampo {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  opacity: 0;
}

/* the build log: a window of three lines, the inner list moved by a CSS variable that GSAP tweens */
.log {
  --riga: 1.75em;
  margin-top: 1em;
  height: calc(var(--riga) * 3 + 1em);
  padding: 0.5em 0.8em;
  border-radius: 0.8em;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--bordo);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset;
  overflow: hidden;
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 0.86em;
  -webkit-mask: linear-gradient(180deg, transparent 0, #000 0.55em, #000 calc(100% - 0.3em), transparent);
  mask: linear-gradient(180deg, transparent 0, #000 0.55em, #000 calc(100% - 0.3em), transparent);
}
.log__in { transform: translateY(calc(var(--su, 0) * -1 * var(--riga))); }
.riga {
  height: var(--riga);
  line-height: var(--riga);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #c9ccd4;
  opacity: 0;
}
.riga__ora { color: var(--spento); margin-right: 1.1em; }
.riga--fine { color: var(--menta); }

.regioni {
  display: flex;
  align-items: center;
  gap: 0.8em;
  margin-top: 0.95em;
  font-size: 0.9em;
}
.regioni__nome { color: var(--secondario); flex: none; }
.regioni__barre { flex: 1; display: flex; gap: 3px; height: 1.15em; align-items: stretch; }
.barra { flex: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.08); transform-origin: 50% 100%; }
.regioni__conto { color: var(--secondario); flex: none; min-width: 4.6em; text-align: right; }

.numeri {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0.95em;
  border-top: 1px solid var(--bordo);
  padding-top: 0.75em;
}
.numero { padding-left: 0.9em; border-left: 1px solid var(--bordo); }
.numero:first-child { padding-left: 0; border-left: 0; }
.numero dt { color: var(--secondario); font-size: 0.82em; white-space: nowrap; }
.numero dd { font-size: 1.5em; font-weight: 600; letter-spacing: -0.02em; margin-top: 0.1em; color: var(--spento); white-space: nowrap; }

.numero__riga { display: flex; align-items: center; gap: 0.35em; }
.curva { width: 2.4em; height: 0.75em; flex: none; overflow: visible; }
.curva path { fill: none; stroke: var(--menta); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; }
.piede {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8em;
  margin-top: 0.85em;
}
.url {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: 0.9em;
  color: var(--spento);
  min-width: 0;
  white-space: nowrap;
}
.url svg { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

/* the Visit pill: GSAP moves the link, the CSS swells the ground (the elastic pill of the site) */
.visita {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.5em 0.95em 0.5em 1.05em;
  color: #07110c;
  text-decoration: none;
  font-weight: 620;
  font-size: 0.98em;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.visita__fondo {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(180deg, #8af0c4, var(--menta));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 6px 18px -6px rgba(95, 224, 170, 0.6);
  transition: transform 0.55s cubic-bezier(0.34, 1.8, 0.5, 1);
}
.visita__testo { font-variation-settings: 'wdth' 100; transition: font-variation-settings 0.45s cubic-bezier(0.34, 1.6, 0.5, 1); }
.visita svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.45s cubic-bezier(0.34, 1.6, 0.5, 1); }
@media (hover: hover) {
  .visita:hover .visita__fondo { transform: scale(1.06, 1.1); }
  .visita:hover .visita__testo { font-variation-settings: 'wdth' 112; }
  .visita:hover svg { transform: translate(1px, -1px); }
}
.visita:active .visita__fondo { transform: scale(0.95); transition-duration: 0.12s; }

.piede-pagina {
  padding: 28px 16px 40px;
  text-align: center;
  font-size: 12px;
  color: var(--spento);
}

@media (max-width: 520px) {
  .commit__chi { display: none; }
  .hash { display: none; }
}
@media (max-height: 470px) {
  .commit { display: none; }
}
