/* The profile card of a developer: one card alone on white, a single emerald accent in four strengths. */
:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: #e6e8ec;
  --tinta: #f3f5f6;          /* the empty squares, the stats, the avatar */
  --testo: #101414;
  --testo-2: #586064;
  --testo-3: #9aa1a5;
  --accento: #0f9d6f;        /* the single accent: Following, the squares, the languages */
  --l1: #c6ecd9;
  --l2: #7fd3ad;
  --l3: #2fb383;
  --l4: #0b7d58;
  --ombra: 16, 24, 22;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(10px, min(3.6vw, 3.05vh), 17px); }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }

.stage { height: 100vh; display: grid; place-items: center; padding: 2vh 4vw; }

/* the card: a body, a 1px edge that catches light at the top, three soft shadows */
.card {
  position: relative;
  width: min(22.5em, 92vw);
  padding: 1.25em 1.35em 1.05em;
  border-radius: 1.5em;
  background: var(--carta);
  box-shadow:
    0 1px 1px rgba(var(--ombra), .05),
    0 6px 14px -6px rgba(var(--ombra), .10),
    0 24px 48px -24px rgba(var(--ombra), .22);
  isolation: isolate;
  overflow: clip;
}
.card__edge {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  padding: 1px;
  background: linear-gradient(180deg, rgba(15, 157, 111, .3), var(--bordo) 22%, var(--bordo) 80%, #dde0e4);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.card__glow {
  position: absolute; top: 0; left: 0; width: 38%; height: 1px; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(15, 157, 111, .9), transparent);
  opacity: 0;
}

/* who */
.who { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7em; }
.avatar {
  position: relative; width: 2.9em; height: 2.9em; border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 20%, #ffffff 0%, var(--tinta) 55%, #e3e8e6 100%);
  box-shadow: inset 0 0 0 1px rgba(var(--ombra), .08), 0 2px 6px -3px rgba(var(--ombra), .3);
  display: grid; place-items: center;
}
.avatar__ring { position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid var(--accento); opacity: 0; }
.avatar__txt { font-size: .95em; font-weight: 680; letter-spacing: -.01em; font-stretch: 92%; line-height: 1; color: var(--testo); }
.who__text { display: grid; min-width: 0; }
.who__name { font-size: 1.02em; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who__handle { font-size: .74em; color: var(--testo-2); font-weight: 520; margin-top: .1em; }

/* Follow: two faces stacked in the same place, each centred on its own; the width is fixed, so nothing hidden widens it */
.follow {
  position: relative; width: 7.4em; height: 2.3em; border-radius: 999px;
  background: var(--testo); color: #fff; font-size: .78em; font-weight: 620;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 14px -8px rgba(var(--ombra), .9);
  overflow: hidden;
  transition: background-color .35s, color .35s, box-shadow .35s;
}
.follow.is-on { background: #e9f7f0; color: var(--l4); box-shadow: inset 0 0 0 1px rgba(15, 157, 111, .35); }
@media (hover: hover) { .follow:hover { filter: brightness(1.12); } .follow.is-on:hover { filter: none; background: #dff3e9; } }
.follow:focus-visible, .link:focus-visible, .grid:focus-visible, .lang:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.follow__face { position: absolute; inset: 0; display: grid; place-items: center; white-space: nowrap; }
.follow__face--on { opacity: 0; }
.follow__group { display: inline-flex; align-items: center; gap: .35em; }
.follow svg { width: 1.05em; height: 1.05em; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.follow__face--on path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }

.bio { font-size: .8em; line-height: 1.45; color: var(--testo-2); margin-top: .8em; max-width: 26em; }

/* the three numbers */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4em; margin-top: .85em; }
.stat { background: var(--tinta); border-radius: .75em; padding: .5em .65em .55em; box-shadow: inset 0 0 0 1px rgba(var(--ombra), .04); }
.stat dt { font-size: .64em; color: var(--testo-2); font-weight: 560; }
.stat dd { font-size: .98em; font-weight: 660; letter-spacing: -.02em; margin-top: .1em; }
.num { display: inline-flex; font-variant-numeric: tabular-nums; }
.num .ch { display: inline-block; height: 1.25em; line-height: 1.25em; overflow: hidden; vertical-align: top; }
.num .col { display: block; }
.num .col span { display: block; height: 1.25em; text-align: center; }
.num .fix { display: inline-block; height: 1.25em; line-height: 1.25em; }

/* the contributions */
.contrib { position: relative; margin-top: .95em; }
.contrib__head { font-size: .72em; color: var(--testo-2); }
.contrib__head strong { color: var(--testo); font-weight: 650; }
.grid {
  --c: .58em; --g: .14em;
  display: grid; grid-auto-flow: column;
  grid-template-rows: repeat(7, var(--c)); grid-auto-columns: var(--c); gap: var(--g);
  margin-top: .5em; width: max-content; max-width: 100%; border-radius: .2em;
}
.cell { display: block; width: 100%; height: 100%; border-radius: .16em; background: var(--tinta); box-shadow: inset 0 0 0 1px rgba(var(--ombra), .04); position: relative; }
.cell b { position: absolute; inset: 0; border-radius: inherit; display: block; transform-origin: 50% 50%; }
.cell.l1 b { background: var(--l1); } .cell.l2 b { background: var(--l2); } .cell.l3 b { background: var(--l3); } .cell.l4 b { background: var(--l4); }
.cell.is-on { box-shadow: 0 0 0 1.5px var(--testo); z-index: 1; }
.months { position: relative; height: 1.1em; margin-top: .25em; font-size: .6em; color: var(--testo-3); }
.months span { position: absolute; top: 0; }
.legend { display: flex; align-items: center; gap: .22em; justify-content: flex-end; font-size: .6em; color: var(--testo-3); margin-top: .1em; }
.legend span { margin: 0 .25em; }
.legend i { width: .95em; height: .95em; border-radius: .25em; display: block; background: var(--tinta); }
.legend .l1 { background: var(--l1); } .legend .l2 { background: var(--l2); } .legend .l3 { background: var(--l3); } .legend .l4 { background: var(--l4); }

/* the tooltip over a square: its own box, centred over the square by its own width */
.tip {
  position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none;
  background: var(--testo); color: #fff; font-size: .66em; font-weight: 560; white-space: nowrap;
  padding: .45em .7em; border-radius: .6em;
  box-shadow: 0 8px 18px -8px rgba(var(--ombra), .6);
  opacity: 0;
}
.tip::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -.3em; width: .6em; height: .6em; margin-left: -.3em; background: inherit; transform: rotate(45deg); border-radius: .1em; }

/* the languages */
.langs { margin-top: .9em; }
.bar { display: flex; gap: .18em; height: .5em; border-radius: 999px; overflow: hidden; background: var(--tinta); }
.seg { height: 100%; border-radius: .1em; transform-origin: 0 50%; transition: filter .25s; }
.seg:first-child { border-radius: 999px .1em .1em 999px; }
.seg:last-child { border-radius: .1em 999px 999px .1em; }
.langs__list { display: flex; flex-wrap: wrap; gap: .25em .95em; margin-top: .55em; }
.lang { font-size: .7em; color: var(--testo-2); font-weight: 540; border-radius: .4em; transition: color .25s; cursor: default; }
.lang b { color: var(--testo); font-weight: 640; font-variant-numeric: tabular-nums; margin-left: .2em; }
.lang.is-on { color: var(--testo); }
.lang.is-on b { color: var(--l4); }

/* the link */
.link {
  display: inline-flex; align-items: center; gap: .35em; margin-top: .9em;
  font-size: .78em; font-weight: 600; color: var(--testo); text-decoration: none;
  padding: .35em .6em .35em 0; border-radius: .6em; transition: color .2s;
}
.link svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
@media (hover: hover) { .link:hover { color: var(--l4); } .link:hover svg { transform: translateX(3px); } }
.link.is-hot { color: var(--l4); }
.link.is-hot svg { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
  .follow, .link, .link svg, .lang, .seg { transition: none; }
}
