:root {
  --carta: #f6f5f1;
  --card: #fdfcfa;
  --inchiostro: #16181c;
  --grigio: #6b6f76;
  --tenue: #9a9ea5;
  --filo: rgba(22, 24, 28, 0.1);
  --filo-forte: rgba(22, 24, 28, 0.16);
  --accento: #1f8f55;
  --accento-chiaro: rgba(31, 143, 85, 0.12);
  --vuoto: #e7e6e1;
  /* the sober colours of the languages */
  --ts: #3d6c98;
  --rs: #b36848;
  --py: #c4a23c;
  --go: #4a9bb0;
  --sh: #74905a;
  --dk: #8a7aa8;
  --mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Mona Sans Variable", system-ui, sans-serif;
}

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

html, body { background: var(--carta); }

body {
  color: var(--inchiostro);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.corsa { position: relative; height: 380vh; height: 380lvh; }

.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3.2vh, 30px);
  padding: clamp(12px, 3vh, 32px) clamp(12px, 4vw, 40px);
  overflow: hidden;
}

/* ---- the head ---- */
.testa { width: min(860px, 100%); text-align: left; }

.testa__chi {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(10.5px, min(1.2vw, 1.8vh), 13px);
  font-weight: 560;
  margin-bottom: clamp(6px, 1.4vh, 14px);
}

.testa__sigla {
  display: grid;
  place-items: center;
  width: 2.1em;
  height: 2.1em;
  border-radius: 50%;
  background: var(--inchiostro);
  color: var(--carta);
  font-size: 0.82em;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1;
}

.testa__ruolo { color: var(--tenue); font-weight: 450; }

.testa__titolo {
  font-size: clamp(20px, min(4.6vw, 6.8vh), 56px);
  font-weight: 640;
  font-stretch: 92%;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.testa__titolo .parola { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.testa__titolo .parola > span { display: inline-block; transform-origin: 0% 100%; }

.testa__sotto {
  margin-top: clamp(4px, 1vh, 10px);
  color: var(--grigio);
  font-size: clamp(11px, min(1.3vw, 2vh), 15px);
}

/* ---- the pinned repositories ---- */
.griglia {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.8vh, 16px);
}

.repo {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2vh, 12px);
  padding: clamp(10px, 2vh, 18px) clamp(10px, 1.6vw, 20px) clamp(10px, 1.9vh, 16px);
  background: var(--card);
  border: 1px solid var(--filo);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(22, 24, 28, 0.04), 0 6px 18px -10px rgba(22, 24, 28, 0.18);
  outline: none;
  will-change: transform, opacity;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.repo:focus-visible { border-color: var(--accento); box-shadow: 0 0 0 3px var(--accento-chiaro); }

@media (hover: hover) and (pointer: fine) {
  .repo:hover { border-color: var(--filo-forte); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 2px 4px rgba(22, 24, 28, 0.05), 0 14px 28px -14px rgba(22, 24, 28, 0.28); }
  .repo:hover .repo__nome { color: var(--accento); }
}

.repo__testa { display: flex; align-items: center; gap: 8px; min-width: 0; }

.repo__libro {
  flex: none;
  width: clamp(12px, 1.9vh, 16px);
  height: clamp(12px, 1.9vh, 16px);
  fill: none;
  stroke: var(--grigio);
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.repo__nome {
  font-family: var(--mono);
  font-size: clamp(11px, min(1.3vw, 2vh), 15px);
  font-weight: 620;
  color: var(--inchiostro);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.repo__stato {
  flex: none;
  margin-left: auto;
  display: grid;
  place-items: center;
  height: 1.9em;
  padding: 0 0.75em;
  border: 1px solid var(--filo-forte);
  border-radius: 999px;
  font-size: clamp(9px, min(1vw, 1.5vh), 11px);
  font-weight: 560;
  color: var(--grigio);
  line-height: 1;
}

.repo__frase {
  font-size: clamp(11px, min(1.2vw, 1.9vh), 14px);
  line-height: 1.45;
  color: var(--grigio);
}

.repo__dati {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 18px);
  font-size: clamp(10px, min(1.1vw, 1.7vh), 12.5px);
  color: var(--grigio);
  white-space: nowrap;
}

.repo__lingua { display: inline-flex; align-items: center; gap: 6px; }
.repo__lingua i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

.repo__conto { display: inline-flex; align-items: center; gap: 4px; }

.repo__stella, .repo__fork { width: 1.15em; height: 1.15em; flex: none; overflow: visible; }
.repo__stella path { fill: transparent; stroke: var(--grigio); stroke-width: 1.2; stroke-linejoin: round; transform-box: fill-box; transform-origin: 50% 50%; }
.repo__fork { fill: none; stroke: var(--grigio); stroke-width: 1.2; stroke-linecap: round; }

/* the rolling digits */
.rulli { display: inline-flex; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; color: var(--inchiostro); font-weight: 560; }
.rullo { display: inline-block; height: 1.2em; overflow: hidden; line-height: 1.2em; }
.rullo > span { display: block; will-change: transform; }
.rullo > span > b { display: block; height: 1.2em; font-weight: inherit; text-align: center; }
.virgola { display: inline-block; line-height: 1.2em; }

/* the language bar */
.barra {
  margin-top: auto;
  display: flex;
  gap: 2px;
  height: clamp(4px, 0.7vh, 6px);
  border-radius: 999px;
  overflow: hidden;
  background: var(--vuoto);
}
.barra i { display: block; flex: var(--w) 0 0; background: var(--c); transform-origin: 0 50%; }

/* ---- the contribution graph ---- */
.contributi { width: min(860px, 100%); }
.contributi__conto { font-size: clamp(10px, min(1.1vw, 1.7vh), 12.5px); color: var(--grigio); margin-bottom: clamp(5px, 1vh, 10px); }
.contributi__conto span { color: var(--inchiostro); font-weight: 600; font-variant-numeric: tabular-nums; }
.contributi__griglia { display: block; width: 100%; height: auto; overflow: visible; }


/* the phone box and short screens: the cards keep only what fits */
@media (max-width: 600px), (max-height: 560px) {
  .repo__frase { display: none; }
  .repo__stato { display: none; }
  .testa__ruolo { display: none; }
}
@media (max-width: 420px) {
  .repo__lingua { display: none; }
  .repo__dati { gap: 10px; }
}
