@font-face {
  font-family: "Inter";
  src: url("inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark light;
  --bg: #000;
  --panel: #0e0e10;
  --line: #26262b;
  --text: #fff;
  --muted: #a1a1aa;
  --faint: #8a8a93;
  --button: #fff;
  --button-text: #000;
  --merged: #fff;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fff;
    --panel: #f6f6f7;
    --line: #e4e4e7;
    --text: #000;
    --muted: #52525b;
    --faint: #63636b;
    --button: #000;
    --button-text: #fff;
    --merged: #000;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
p a { text-decoration: underline; }
img { display: block; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.narrow > * { max-width: 680px; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  background: var(--button); color: var(--button-text);
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a {
  text-decoration: none; color: var(--muted); font-size: 15px;
  padding: 10px 12px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
nav a:hover { color: var(--text); background: var(--panel); }

/* Type */
.label {
  font-family: var(--mono); font-size: 12.5px; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--muted); margin: 0 0 12px;
}
h1 { font-size: clamp(44px, 8vw, 80px); line-height: 1.02; letter-spacing: -0.04em; margin: 0 0 18px; font-weight: 750; }
h2 { font-size: clamp(30px, 4.4vw, 42px); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; margin: 0; font-weight: 650; }
h3 a { text-decoration: none; }
h3 a:hover { text-decoration: underline; }
.lede { font-size: clamp(19px, 2.4vw, 23px); color: var(--muted); max-width: 640px; margin: 0 0 28px; letter-spacing: -0.01em; }
.section-lede { color: var(--muted); margin: 0 0 32px; max-width: 640px; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--button); color: var(--button-text);
  font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1px solid var(--button);
  transition: transform 0.4s cubic-bezier(.22,.61,.36,1), opacity 0.3s;
}
.button:hover { transform: scale(1.02); }
.button.secondary { background: transparent; color: var(--text); border-color: var(--line); }
.button.secondary:hover { border-color: var(--text); }

/* Hero */
.hero { padding-top: 96px; padding-bottom: 72px; }
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; margin-top: 56px; background: var(--line);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.stats div { background: var(--bg); padding: 20px 22px; }
.stats strong { display: block; font-size: 34px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 14px; }

/* Sections */
.section { padding-top: 72px; padding-bottom: 24px; border-top: 1px solid var(--line); margin-top: 48px; }
.section p { max-width: 680px; }

/* Project cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 24px; display: flex; flex-direction: column; gap: 4px;
  transition: transform 0.6s cubic-bezier(.22,.61,.36,1), border-color 0.3s;
}
.card:hover { transform: translateY(-3px); border-color: var(--faint); }
.card-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.icon { border-radius: 13px; flex: none; }
@media (prefers-color-scheme: dark) { .icon { outline: 1px solid var(--line); } }
.meta { margin: 2px 0 0; font-size: 13.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.card > p { color: var(--muted); font-size: 15.5px; margin: 0 0 18px; flex: 1; }
.card .actions { gap: 8px; }
.card .actions .button { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
.also { font-size: 14px; color: var(--faint); margin: 14px 0 0 !important; flex: none !important; }
.also a { text-decoration: underline; }

.more { margin-top: 40px; }
.more h3 { margin-bottom: 12px; }
.repo-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.repo-list li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.repo-list a { font-weight: 600; min-width: 200px; }
.repo-list span { color: var(--muted); flex: 1; min-width: 240px; }

/* Contributions */
.contribs { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.contrib { border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; min-width: 0; }
.contrib.wide { grid-column: 1 / -1; }
.contrib .note { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.contrib h3, .contrib li { overflow-wrap: anywhere; }
details summary {
  cursor: pointer; margin-top: 10px; padding: 10px 0; color: var(--muted); font-size: 15px;
  list-style: none; min-height: 44px; display: flex; align-items: center;
}
details summary::before { content: "+"; font-family: var(--mono); margin-right: 10px; }
details[open] summary::before { content: "\2212"; }
details summary:hover { color: var(--text); }
details ul { border-top: 1px solid var(--line); }
.pr { display: flex; flex-direction: column; }
.pr .repo { font-size: 13px; color: var(--faint); }
.contrib h3 { margin-bottom: 10px; }
.contrib ul { list-style: none; padding: 0; margin: 0; }
.contrib li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline;
  padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px;
}
.contrib li:first-child { border-top: 0; }
.contrib li a { text-decoration: none; }
.contrib li a:hover { text-decoration: underline; }
.contrib time { color: var(--faint); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  border-radius: 999px; padding: 2px 9px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.pill.merged { background: var(--merged); color: var(--bg); border-color: var(--merged); }

/* Footer */
.foot { color: var(--faint); font-size: 14px; padding-top: 48px; padding-bottom: 48px; margin-top: 72px; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  nav { display: none; }
  .hero { padding-top: 56px; }
  .contribs { grid-template-columns: 1fr; }
  .contrib li { grid-template-columns: auto 1fr; }
  .contrib time { display: none; }
  .cards { grid-template-columns: 1fr; }
}

/* ---------- Motion ----------
   Applied only when motion.js has added .motion to <html>, so the page is
   complete without JavaScript and for anyone who prefers reduced motion. */
:root {
  --spring: cubic-bezier(.16, 1, .3, 1);
  --glow: rgba(255, 255, 255, 0.07);
  --blob: rgba(255, 255, 255, 0.10);
}
@media (prefers-color-scheme: light) {
  :root { --glow: rgba(0, 0, 0, 0.045); --blob: rgba(0, 0, 0, 0.06); }
}
body { overflow-x: clip; }

/* Header lifts once you scroll */
.top { transition: background-color .5s var(--spring), border-color .5s var(--spring); }
.motion .top:not(.scrolled) { border-bottom-color: transparent; background: transparent; }
.motion .top-inner { transition: min-height .5s var(--spring); }
.motion .top.scrolled .top-inner { min-height: 54px; }

/* Nav pill that slides to the section in view */
nav { position: relative; }
nav a { position: relative; z-index: 1; transition: color .3s; }
nav a[aria-current] { color: var(--text); }
.nav-pill {
  position: absolute; top: 50%; left: 0; height: 36px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  width: var(--pw, 0); transform: translate(var(--px, 0), -50%);
  opacity: 0; transition: transform .6s var(--spring), width .6s var(--spring), opacity .3s;
}
.nav-pill.on { opacity: 1; }

/* Hero: a slow, fluid field of light behind the intro */
.hero { position: relative; isolation: isolate; }
.motion .hero::before, .motion .hero::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--blob), transparent);
  filter: blur(20px);
}
.motion .hero::before { top: -180px; right: -160px; animation: drift-a 22s ease-in-out infinite alternate; }
.motion .hero::after { top: 120px; left: -260px; width: 520px; height: 520px; animation: drift-b 26s ease-in-out infinite alternate; }
@keyframes drift-a {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-120px, 80px) scale(1.15); }
  100% { transform: translate(-40px, 180px) scale(.95); }
}
@keyframes drift-b {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(140px, -60px) scale(.9); }
  100% { transform: translate(60px, 90px) scale(1.1); }
}

/* Hero intro, staggered */
.motion .hero > * {
  opacity: 0; transform: translateY(22px); filter: blur(8px);
  transition: opacity 1s var(--spring), transform 1.1s var(--spring), filter 1s var(--spring);
  transition-delay: calc(var(--i, 0) * 90ms + 80ms);
}
.motion.ready .hero > * { opacity: 1; transform: none; filter: none; }
.motion .hero h1 { letter-spacing: -0.02em; transition-property: opacity, transform, filter, letter-spacing; }
.motion.ready .hero h1 { letter-spacing: -0.04em; }

/* Scroll reveals */
.motion .reveal {
  opacity: 0; transform: translateY(28px) scale(.985);
  transition: opacity .9s var(--spring), transform 1s var(--spring), border-color .3s, background-color .3s;
  transition-delay: var(--d, 0ms);
}
.motion .reveal.in { opacity: 1; transform: none; }
.motion .card.reveal.in:hover { transform: translateY(-4px); }

/* Pointer light on cards, contributions and stats */
.card, .contrib, .stats { position: relative; }
.motion .card::after, .motion .contrib::after, .motion .stats::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 65%);
  opacity: 0; transition: opacity .4s;
}
.motion .card:hover::after, .motion .contrib:hover::after, .motion .stats:hover::after { opacity: 1; }
.motion .card { transition: transform .7s var(--spring), border-color .3s, opacity .9s var(--spring); }
.motion .card.reveal { transition-delay: var(--d, 0ms); }
.contrib { transition: border-color .3s; }
.contrib:hover { border-color: var(--faint); }
.icon { transition: transform .7s var(--spring); }
.card:hover .icon { transform: rotate(-4deg) scale(1.06); }

/* Buttons: a gentle pull towards the pointer, and a press */
.motion .button {
  transform: translate(var(--tx, 0), var(--ty, 0));
  transition: transform .5s var(--spring), background-color .3s, color .3s, border-color .3s;
}
.motion .button:hover { transform: translate(var(--tx, 0), var(--ty, 0)) scale(1.03); }
.motion .button:active { transform: translate(var(--tx, 0), var(--ty, 0)) scale(.96); transition-duration: .15s; }
.button.secondary:hover { background: var(--panel); }

/* Repo list rows slide on hover */
.repo-list li { transition: padding .5s var(--spring), background-color .3s; border-radius: 10px; }
.motion .repo-list li:hover { padding-left: 10px; }

/* Smoothly open the "Show all" lists where the browser supports it */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .motion details::details-content {
    block-size: 0; overflow: clip; opacity: 0;
    transition: block-size .6s var(--spring), opacity .4s, content-visibility .6s allow-discrete;
  }
  .motion details[open]::details-content { block-size: auto; opacity: 1; }
}
details summary::before { display: inline-block; transition: transform .4s var(--spring); }
details[open] summary::before { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .button:hover, .card:hover, .card:hover .icon { transform: none; }
}
