/* ==========================================================================
   Languages: share of code per language (bar), repo count and examples.
   Values are visible as text, so the bars are never the only way to read them.
   ========================================================================== */

.langs { list-style: none; margin: 0; padding: 0; }
.lang {
  display: grid; grid-template-columns: 3fr 6fr 1fr 4fr; gap: var(--gutter); align-items: center;
  padding-block: 16px; border-bottom: 1px solid var(--line);
}
.lang-name { min-width: 0; display: flex; align-items: center; gap: 12px; font: 500 var(--step-1)/1.2 var(--f-display); letter-spacing: -.01em; }

/* language logos (Simple Icons, CC0): one colour, take the section accent on hover */
.lang-icon { width: 22px; height: 22px; flex: none; color: var(--ink-soft); transition: color .3s, transform .45s var(--ease); }
.lang:hover .lang-icon { color: var(--accent); transform: scale(1.12); }
.tools .tool-icon { width: 12px; height: 12px; flex: none; }
.langs-note .tools li { display: inline-flex; align-items: center; gap: 6px; }

/* bar: square at the baseline, 4px rounded data end */
.lang-track { position: relative; height: 10px; background: var(--line); border-radius: 0 4px 4px 0; }
.lang-fill {
  position: absolute; inset: 0 auto 0 0; width: var(--share); min-width: 3px;
  background: var(--lime); border-radius: 0 4px 4px 0; transform-origin: left;
}
.lang.in .lang-fill { animation: lang-grow 1.2s var(--ease) .15s both; }
@keyframes lang-grow { from { transform: scaleX(0); } }

.lang-pct { justify-self: end; font-variant-numeric: tabular-nums; }
.lang-repos { min-width: 0; color: var(--ink-soft); }
.lang-repos b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

.lang:hover .lang-fill { filter: brightness(1.15); }

.langs-note { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-top: 20px; color: var(--ink-soft); }
.langs-note p { margin: 0; max-width: 62ch; }
.langs-note .tools li { color: var(--ink-soft); }

/* hover detail */
.lang-tip {
  position: fixed; left: 0; top: 0; z-index: 35; pointer-events: none;
  padding: 8px 12px; border-radius: 6px; background: var(--ink); color: var(--paper);
  opacity: 0; transition: opacity .2s; white-space: nowrap;
}
.lang-tip.on { opacity: 1; }

@media (max-width: 720px) {
  .lang { grid-template-columns: 1fr auto; grid-template-areas: "name pct" "bar bar" "repos repos"; row-gap: 8px; }
  .lang-name { grid-area: name; }
  .lang-track { grid-area: bar; }
  .lang-pct { grid-area: pct; }
  .lang-repos { grid-area: repos; }
}
