/* ==========================================================================
   s7electric projects: informatic stylesheet
   Every rule is scoped under .s7, so it will not touch the rest of your page.
   Theme: follows the visitor's light/dark setting. Force one with
   <section class="s7" data-theme="light"> or data-theme="dark".
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,500..900&family=Public+Sans:wght@400;500;600&display=swap");

/* ---------- Tokens ---------- */
.s7 {
  --paper: #edf0f2;
  --ink: #16202b;
  --muted: #54616d;
  --rule: #c2cad2;
  --spark: #ffd426;

  /* One color per language, reused in the bar, legend and every row. */
  --c: #2f5ddb;
  --java: #c9440c;
  --go: #0b7a75;
  --cpp: #8a37b3;

  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --text: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  .s7:not([data-theme="light"]) {
    --paper: #111820;
    --ink: #e9eef2;
    --muted: #9eabb7;
    --rule: #2d3945;
  }
}
.s7[data-theme="dark"] {
  --paper: #111820;
  --ink: #e9eef2;
  --muted: #9eabb7;
  --rule: #2d3945;
}

/* Language hooks: any element with data-lang gets --lang. */
.s7 [data-lang="c"]    { --lang: var(--c); }
.s7 [data-lang="java"] { --lang: var(--java); }
.s7 [data-lang="go"]   { --lang: var(--go); }
.s7 [data-lang="cpp"]  { --lang: var(--cpp); }

/* ---------- Base ---------- */
.s7,
.s7 *,
.s7 *::before,
.s7 *::after {
  box-sizing: border-box;
}

.s7 {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 2.5rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.55;
  border-top: 0.5rem solid var(--spark);
}

:where(.s7) :where(h2, h3, h4, p, dl, dd, ul, ol) {
  margin: 0;
  padding: 0;
}

:where(.s7) :where(ul, ol) {
  list-style: none;
}

.s7 a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.s7 a:hover {
  text-decoration-thickness: 3px;
}

.s7 a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

/* Standalone page only. Delete the class on <body> when you embed the section. */
body.s7-standalone {
  margin: 0;
  background: #edf0f2;
}
@media (prefers-color-scheme: dark) {
  body.s7-standalone {
    background: #111820;
  }
}

/* ---------- Header ---------- */
.s7-head {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 2rem 3rem;
  align-items: end;
  padding: 2.5rem 0 2.25rem;
}

.s7-name {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 70%;
  font-size: clamp(2.75rem, 8vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.s7-handle {
  margin-top: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.s7-bio {
  max-width: 34rem;
  margin-top: 1rem;
}

.s7-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
}

.s7-facts > div {
  display: flex;
  flex-direction: column-reverse;   /* number first, label second */
  border-top: 2px solid var(--ink);
  padding-top: 0.5rem;
}

.s7-facts dd {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 75%;
  font-size: 2.75rem;
  line-height: 1;
}

.s7-facts dt {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.3;
}

/* ---------- Shared headings and captions ---------- */
.s7-h {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 80%;
  font-size: 1.5rem;
  line-height: 1.2;
}

.s7-note {
  color: var(--muted);
  font-size: 0.875rem;
}

/* ---------- Language bar ---------- */
.s7-langsec {
  padding-bottom: 2.75rem;
}

.s7-bar {
  display: flex;
  gap: 3px;
  height: 4.5rem;
  margin-top: 1rem;
}

.s7-bar span {
  flex: var(--n) 1 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  background: var(--lang);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 75%;
  font-size: 1.75rem;
  line-height: 1;
  /* The page's one moment of motion: the bar draws in from the left. */
  animation: s7-draw 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

.s7-bar small {
  font-family: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  opacity: 0.85;
}

@keyframes s7-draw {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

.s7-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1rem 1.25rem;
  margin-top: 0.75rem;
}

.s7-legend li {
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--lang);
  padding-top: 0.4rem;
}

.s7-legend b {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 80%;
}

.s7-legend span {
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

/* ---------- Project rows ---------- */
.s7-projhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-bottom: 0.75rem;
}

.s7-projects {
  border-top: 2px solid var(--ink);
}

.s7-proj {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) 15rem;
  gap: 1rem 1.75rem;
  align-items: start;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.s7-tag {
  display: grid;
  place-items: center;
  width: 5.5rem;
  aspect-ratio: 1;
  background: var(--lang);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 75%;
  font-size: 1.75rem;
  line-height: 1;
}

.s7-body h4 {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 80%;
  font-size: 1.6rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.s7-body p {
  max-width: 38rem;
  margin-top: 0.4rem;
}

/* Small fact table on the right of each row. */
.s7-meta > div {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  line-height: 1.35;
}

.s7-meta > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.s7-meta dt {
  color: var(--muted);
}

.s7-meta dd {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Commits: a bar scaled to the largest repository (--w is a percentage). */
.s7-track {
  flex: 1 1 auto;
  min-width: 2rem;
  height: 0.7rem;
  border: 1.5px solid var(--ink);
}

.s7-track i {
  display: block;
  height: 100%;
  width: calc(var(--w) * 1%);
  min-width: 3px;
  background: var(--lang);
}

.s7-num {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 75%;
  font-size: 1.1rem;
  line-height: 1;
}

/* ---------- Footer ---------- */
.s7-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--ink);
}

.s7-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-weight: 600;
}

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .s7-head {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 1.75rem;
  }

  .s7-proj {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.75rem 1.25rem;
  }

  .s7-tag {
    width: 4.5rem;
    font-size: 1.4rem;
  }

  .s7-meta {
    grid-column: 1 / -1;
  }

  .s7-bar {
    height: 3.75rem;
  }

  .s7-bar span {
    padding: 0.4rem 0.5rem;
    font-size: 1.35rem;
  }

  /* Narrow segments have no room for the count; the legend below covers it. */
  .s7-bar small {
    display: none;
  }
}

@media (max-width: 420px) {
  .s7-facts dd {
    font-size: 2.25rem;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .s7-bar span {
    animation: none;
  }
}
