:root {
  --fondo: #09090b;
  --carta: #131316;
  --carta-alta: #18181c;
  --inchiostro: #ececf0;
  --grigio: #8b8b95;
  --grigio-scuro: #5b5b64;
  --linea: rgba(255, 255, 255, 0.07);
  --linea-forte: rgba(255, 255, 255, 0.12);
  --verde: #3ccf7a;
  --verde-rgb: 60, 207, 122;
  --rosso: #ff6b6b;
  --rosso-rgb: 255, 107, 107;
  --luce: #d8fbe6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.6vh, 28px) 12px;
  background:
    radial-gradient(60% 50% at 50% 100%, rgba(var(--verde-rgb), 0.06), transparent 70%),
    var(--fondo);
}

/* the review card: one panel of the made-up tool, with a hairline border and a soft shadow */
.card {
  --fs: clamp(9.6px, min(2.55vw, 2.3vh), 13.5px);
  position: relative;
  width: min(100%, 620px);
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 18px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 2px 0 rgba(255, 255, 255, 0.03) inset;
  padding: clamp(10px, 2.2vh, 20px) clamp(10px, 2.4vw, 20px);
  display: grid;
  gap: clamp(7px, 1.6vh, 14px);
}

/* a thin light that runs once around the border when the review is approved */
.card__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--a, 0deg), transparent 0deg, transparent 300deg, rgba(var(--verde-rgb), 0.9) 340deg, var(--luce) 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);
  opacity: 0;
  pointer-events: none;
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: calc(var(--fs) * 1.02);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.brand__mark {
  width: 1.45em;
  height: 1.45em;
  fill: none;
  stroke: var(--inchiostro);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.brand__mark circle { fill: var(--carta); }

.status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 2.1em;
  padding: 0 0.85em;
  border-radius: 999px;
  border: 1px solid var(--linea-forte);
  color: var(--grigio);
  font-weight: 560;
  overflow: hidden;
}

.status__word { display: inline-block; }

.pr { display: grid; gap: 4px; }

.pr__title {
  font-size: calc(var(--fs) * 1.55);
  line-height: 1.15;
  font-weight: 640;
  font-stretch: 96%;
  letter-spacing: -0.015em;
}

.pr__branches {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--grigio);
  font-size: calc(var(--fs) * 0.92);
}

.chip {
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: 0.95em;
  padding: 0.18em 0.55em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--linea);
  color: #c6c6cf;
}

.pr__into {
  width: 1.1em;
  height: 0.8em;
  fill: none;
  stroke: var(--grigio-scuro);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the changed file */
.file {
  border: 1px solid var(--linea);
  border-radius: 12px;
  overflow: hidden;
  background: #0f0f12;
}

.file__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.62em 0.85em;
  border-bottom: 1px solid var(--linea);
  background: var(--carta-alta);
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: calc(var(--fs) * 0.9);
  color: var(--grigio);
}

.file__path b { color: var(--inchiostro); font-weight: 560; }

.file__icon {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: var(--grigio);
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.count {
  margin-left: auto;
  display: inline-flex;
  gap: 0.6em;
  font-weight: 600;
}

.count__add { color: var(--verde); display: inline-block; }
.count__del { color: var(--rosso); display: inline-block; }

.code {
  position: relative;
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: var(--fs);
  padding: 0.35em 0;
}

/* one line: old number, new number, sign, text; the wash is a child so GSAP can scale it */
.line {
  position: relative;
  display: grid;
  grid-template-columns: 2.2em 2.2em 1.5em 1fr;
  align-items: center;
  height: 1.78em;
  white-space: pre;
  overflow: hidden;
}

.line__wash {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
}

.line--del .line__wash { background: rgba(var(--rosso-rgb), 0.12); box-shadow: inset 2px 0 0 rgba(var(--rosso-rgb), 0.75); }
.line--add .line__wash { background: rgba(var(--verde-rgb), 0.11); box-shadow: inset 2px 0 0 rgba(var(--verde-rgb), 0.8); }

.line__n {
  position: relative;
  text-align: right;
  padding-right: 0.6em;
  color: var(--grigio-scuro);
  font-size: 0.86em;
  overflow: hidden;
}

.line__n span { display: inline-block; }

.line__sign {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
}

.line__sign svg {
  width: 0.72em;
  height: 0.72em;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0;
}

.line--del .line__sign svg { stroke: var(--rosso); }
.line--add .line__sign svg { stroke: var(--verde); }

.line__text {
  position: relative;
  color: #d9d9e0;
  overflow: hidden;
  text-overflow: clip;
}

.line__text .k { color: #c792ff; }
.line__text .f { color: #7fb8ff; }
.line__text .n { color: #f3b26b; }
.line__text .p { color: #8b8b95; }

.line--del .line__text { transition: color 0.4s; }
.line--del.is-marked .line__text { color: #b7a2a2; }

/* the small comment button in the gutter, shown on hover */
.line__add-comment {
  position: absolute;
  left: 3.2em;
  top: 50%;
  width: 1.45em;
  height: 1.45em;
  margin-top: -0.725em;
  border-radius: 5px;
  border: 0;
  background: #e8e8ee;
  display: grid;
  place-items: center;
  transform: scale(0);
  cursor: pointer;
  z-index: 2;
}

.line__add-comment svg {
  width: 0.8em;
  height: 0.8em;
  fill: none;
  stroke: #111114;
  stroke-width: 2;
  stroke-linecap: round;
}

@media (hover: hover) {
  .line:hover .line__add-comment { transform: scale(1); transition: transform 0.25s cubic-bezier(.34, 1.56, .64, 1); }
}

/* the comment thread that opens under a line */
.thread {
  height: 0;
  overflow: hidden;
  font-family: "Mona Sans Variable", system-ui, sans-serif;
}

.thread__box {
  margin: 0.4em 0.7em 0.5em 4.4em;
  padding: 0.6em 0.75em;
  border-radius: 10px;
  background: var(--carta-alta);
  border: 1px solid var(--linea-forte);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15em 0.6em;
  font-size: calc(var(--fs) * 0.98);
  line-height: 1.35;
}

.thread__box .avatar { grid-row: span 2; }

.thread__who { color: var(--grigio); font-size: 0.9em; }
.thread__who b { color: var(--inchiostro); font-weight: 600; }
.thread__text { color: #d4d4db; min-height: 1.35em; }
.thread__caret {
  display: inline-block;
  width: 1px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -0.15em;
  background: var(--inchiostro);
}

.avatar {
  width: 2.15em;
  height: 2.15em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #3a3a44, #24242b);
  border: 1px solid var(--linea-forte);
  color: #e9e9ef;
  font-size: 0.78em;
  font-weight: 640;
  letter-spacing: 0.02em;
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--fs);
}

.reviewer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--grigio);
  min-width: 0;
}

.reviewer .avatar { font-size: 0.86em; }
.reviewer b { color: var(--inchiostro); font-weight: 600; }
.reviewer__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the Approve button: green, with a shine that crosses it when it is pressed */
.approve {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 2.75em;
  padding: 0 1.25em;
  border-radius: 999px;
  border: 1px solid rgba(var(--verde-rgb), 0.55);
  background: linear-gradient(180deg, #43d884, #2fb867);
  color: #062312;
  font: inherit;
  font-weight: 640;
  font-size: calc(var(--fs) * 1.05);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 0 0 rgba(var(--verde-rgb), 0.35), 0 8px 22px -10px rgba(var(--verde-rgb), 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  white-space: nowrap;
}

.approve__shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 34%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  opacity: 0;
  pointer-events: none;
}

.approve__check {
  width: 0;
  height: 1.15em;
  fill: none;
  stroke: #062312;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.approve__label { position: relative; display: inline-block; }

/* an invisible frame as big as the panel fully open, centred like the panel: the preview frames this */
.frame {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  visibility: hidden;
}

.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #ffffff;
  stroke: #0b0b0d;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  opacity: 0;
  z-index: 10;
}

@media (max-width: 420px) {
  .pr__branches .chip:last-child, .pr__into { display: none; }
  .reviewer__text span { display: none; }
}
