:root {
  --fondo: #000000;
  --pillola: #111113;
  --pillola-alta: #1f1f23;
  --pillola-bassa: #0a0a0c;
  --testo: #f2f3f5;
  --testo-spento: rgba(242, 243, 245, 0.46);
  --accento: #4fe3a6;
  --accento-rgb: 79, 227, 166;
  --mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, monospace;
}

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

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* the whole piece: the button, the copy key that lives inside it once Live, the log line under it */
.deploy {
  position: relative;
  width: 172px;
  height: 60px;
  margin-bottom: 34px;
}

.btn {
  position: absolute;
  left: 50%;
  top: 0;
  width: 172px;
  height: 60px;
  border-radius: 30px;
  color: var(--testo);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline: none;
  isolation: isolate;
  will-change: transform;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 30px;
  pointer-events: none;
  transition: box-shadow 0.25s ease;
}
.btn:focus-visible::after {
  box-shadow: 0 0 0 3px #000000, 0 0 0 5px rgba(var(--accento-rgb), 0.9);
}

/* the graphite body: a hairline that takes the light on top, a soft shadow and, once Live, a mint breath under it */
.btn__body {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  background: linear-gradient(180deg, var(--pillola-alta) 0%, var(--pillola) 60%, var(--pillola-bassa) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.7),
    0 14px 30px -14px rgba(var(--accento-rgb), calc(var(--alone, 0) * 0.6)),
    0 0 0 1px rgba(var(--accento-rgb), calc(var(--alone, 0) * 0.3)),
    0 18px 28px -18px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}
.btn__light {
  position: absolute;
  inset: 0;
  opacity: var(--luce, 0);
  background: radial-gradient(120px 60px at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.12), transparent 70%);
}

/* the three segments: together they are the pill, apart they are the pipeline */
.segs {
  position: absolute;
  inset: 0;
  display: flex;
  gap: var(--gap, 0px);
  opacity: 0;
  --ri: 0px;
}
.seg {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(180deg, var(--pillola-alta) 0%, var(--pillola) 60%, var(--pillola-bassa) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.7);
  border-radius: var(--ri);
  --p: 0;
  will-change: transform;
}
.seg:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(var(--accento-rgb), 0.95), transparent);
  box-shadow: 0 0 8px rgba(var(--accento-rgb), 0.6);
  opacity: var(--cut, 0);
}
.seg:first-child { border-radius: 30px var(--ri) var(--ri) 30px; }
.seg:last-child { border-radius: var(--ri) 30px 30px var(--ri); }

.seg__fill {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 55%),
    linear-gradient(90deg, rgba(var(--accento-rgb), 0.08), rgba(var(--accento-rgb), 0.3));
  box-shadow: inset 0 0 0 1px rgba(var(--accento-rgb), 0.22);
}
/* the leading edge of the fill: a thin line of mint light */
.seg__edge {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: calc(var(--p) * 100% - 2px);
  width: 2px;
  border-radius: 1px;
  background: rgba(var(--accento-rgb), 0.95);
  box-shadow: 0 0 10px 1px rgba(var(--accento-rgb), 0.45);
  opacity: var(--testa, 0);
}
.seg__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 46px;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: translateX(-60px) skewX(-14deg);
}

.seg__in {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 560;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.seg__name { color: var(--testo-spento); transition: color 0.3s ease; }
.seg.is-on .seg__name, .seg.is-done .seg__name { color: var(--testo); }
.seg__time {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 450;
  font-variant-numeric: tabular-nums;
  color: var(--testo-spento);
  opacity: 0;
}
.seg__icon {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}
.seg__ring { stroke: rgba(255, 255, 255, 0.16); }
.seg__spin { stroke: var(--accento); opacity: 0; transform-origin: 8px 8px; }
.seg__tick { stroke: var(--accento); stroke-dasharray: 10; stroke-dashoffset: 10; }

/* the two faces that are not the pipeline */
.face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  pointer-events: none;
}
.face--idle { gap: 10px; padding: 0 6px 0 10px; }
.face__label {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-stretch: 100%;
}
.arrow {
  position: relative;
  width: 18px;
  height: 18px;
  overflow: hidden;
}
.arrow svg {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--testo);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.arrow__b { transform: translateX(-18px); }

.face--live {
  justify-content: flex-start;
  gap: 10px;
  padding: 0 62px 0 20px;
  opacity: 0;
}
.globe { flex: none; width: 22px; height: 22px; overflow: visible; }
.globe__halo { fill: none; stroke: rgba(var(--accento-rgb), 0.18); stroke-width: 3.2; }
.globe__line {
  fill: none;
  stroke: var(--accento);
  stroke-width: 1.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(var(--accento-rgb), 0.55));
}
.face__live { font-size: 16px; font-weight: 620; color: var(--accento); }
.face__rule { flex: none; width: 1px; height: 18px; background: rgba(255, 255, 255, 0.14); transform-origin: 50% 50%; }
.face__url {
  flex: 1 1 auto;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 450;
  color: rgba(242, 243, 245, 0.8);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 16px), transparent);
}
.face__url span { display: inline-block; }
.is-narrow .face--live { gap: 8px; padding-left: 16px; padding-right: 58px; }
.is-narrow .face__url { font-size: 12px; }

/* the copy key: only there when the deploy is Live */
.copy {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  opacity: 0;
  visibility: hidden;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  z-index: 2;
}
.copy:focus-visible { box-shadow: 0 0 0 2px #000000, 0 0 0 4px rgba(var(--accento-rgb), 0.9); }
.copy svg {
  grid-area: 1 / 1;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--testo);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.copy__tick { stroke: var(--accento) !important; stroke-width: 1.8 !important; stroke-dasharray: 12; stroke-dashoffset: 12; }
@media (hover: hover) {
  .copy:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.06)); }
}

/* one line of log under the button: what the platform is doing right now */
.log {
  position: absolute;
  left: 50%;
  top: calc(100% + 16px);
  width: var(--logw, 300px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 18px;
  color: rgba(242, 243, 245, 0.5);
  opacity: 0;
  pointer-events: none;
}
.log__track { position: relative; flex: 1 1 auto; min-width: 0; height: 18px; overflow: hidden; }
.log__line { position: absolute; left: 0; top: 0; white-space: nowrap; }
.log__line b { font-weight: 500; color: rgba(var(--accento-rgb), 0.9); }
.log__clock { flex: none; font-variant-numeric: tabular-nums; color: rgba(242, 243, 245, 0.34); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -4px;
  fill: #ffffff;
  stroke: #111114;
  stroke-width: 1.4;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

@media (prefers-reduced-motion: reduce) {
  .ghost { display: none; }
}
