/* interesting repos. Colour lives in the covers and the active category (--h);
   the interface itself stays ink on ground. */
:root {
  --h: 250;
  --bg: #07080b;
  --bg-2: #101217;
  --bg-3: #181b22;
  --ink: #f5f6f8;
  --ink-2: #a9adb9;
  --ink-3: #7b8090;
  --line: rgb(255 255 255 / 0.09);
  --line-2: rgb(255 255 255 / 0.16);
  --hue-ink: oklch(0.8 0.15 var(--h));
  --gain: #52e38a;
  --star: #ffc53d;
  --code-bg: #000;
  --shadow: 0 18px 40px -18px rgb(0 0 0 / 0.7);
  --sans: "Mona Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gut: 16px;
  --r: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}
@media (min-width: 720px) { :root { --gut: 32px; } }
@media (min-width: 1200px) { :root { --gut: max(48px, calc((100vw - 1440px) / 2 + 48px)); } }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f4f6; --bg-2: #ffffff; --bg-3: #e8eaee;
    --ink: #0b0c10; --ink-2: #4a4e5a; --ink-3: #62666f;
    --line: rgb(0 0 0 / 0.09); --line-2: rgb(0 0 0 / 0.18);
    --hue-ink: oklch(0.47 0.2 var(--h));
    --gain: #0f8a43; --star: #b07800; --code-bg: #0b0c10;
    --shadow: 0 18px 36px -20px rgb(20 24 40 / 0.45);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f3f4f6; --bg-2: #ffffff; --bg-3: #e8eaee;
  --ink: #0b0c10; --ink-2: #4a4e5a; --ink-3: #62666f;
  --line: rgb(0 0 0 / 0.09); --line-2: rgb(0 0 0 / 0.18);
  --hue-ink: oklch(0.47 0.2 var(--h));
  --gain: #0f8a43; --star: #b07800; --code-bg: #0b0c10;
  --shadow: 0 18px 36px -20px rgb(20 24 40 / 0.45);
  color-scheme: light;
}

/* Base and browser surfaces */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-2) transparent; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans); font-stretch: 100%;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
::selection { background: oklch(0.75 0.17 var(--h) / 0.45); color: var(--ink); }
input, select, button { font: inherit; color: inherit; caret-color: var(--hue-ink); }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
img { display: block; max-width: 100%; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--hue-ink); outline-offset: 3px; border-radius: 6px; }
.i { width: 1em; height: 1em; fill: currentColor; flex: none; }
kbd { font: 500 0.72rem/1 var(--mono); color: var(--ink-3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.cover { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--r); background: var(--bg-3); }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px var(--gut); background: var(--bg);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.bar.scrolled { border-bottom-color: var(--line); }
.logo { text-decoration: none; margin-right: auto; display: inline-flex; align-items: center; gap: 8px; }
.mark { width: 1.55em; height: auto; flex: none; overflow: visible; }
.logo .mark { width: 30px; }
.logo-word { font-weight: 850; font-stretch: 125%; font-size: 1.08rem; letter-spacing: -0.03em; white-space: nowrap; }
.bar-nav { display: flex; align-items: center; gap: 4px; }
.bar-nav a { text-decoration: none; color: var(--ink-2); padding: 8px 10px; border-radius: 999px; font-size: 0.92rem; font-weight: 500; }
.bar-nav a:hover { color: var(--ink); background: var(--bg-3); }
.bar-search {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin-left: 6px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 8px 7px 12px; color: var(--ink-2); font-size: 0.92rem;
}
.bar-search:hover { border-color: var(--line-2); color: var(--ink); }
.theme { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: none; cursor: pointer; color: var(--ink-2); }
.theme:hover { color: var(--ink); border-color: var(--line-2); }
@media (max-width: 640px) {
  .bar-nav a[href="/all-repos/"], .bar-search-text, .bar-search kbd { display: none; }
  .logo .mark { width: 26px; }
  .logo { gap: 6px; }
  .bar-search { padding: 9px; }
}

@media (max-width: 420px) { .bar-nav a[href="/categories/"] { display: none; } }

/* Home hero: the wordmark is the loud thing */
.hero { padding: clamp(20px, 5vw, 64px) var(--gut) clamp(28px, 4vw, 48px); }
.wordmark {
  font-weight: 900; font-stretch: 125%; letter-spacing: -0.04em; line-height: 0.8;
  font-size: clamp(3.1rem, 14.6vw, 13rem); display: flex; flex-direction: column;
  margin-left: -0.04em;
}
.wm-line:last-child { align-self: flex-end; margin-top: 0.02em; }
.hero-foot { display: grid; gap: 22px; margin-top: clamp(22px, 3.4vw, 44px); }
@media (min-width: 900px) { .hero-foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto; align-items: center; gap: 32px; } }
.pitch { font-size: clamp(1.08rem, 1.5vw, 1.28rem); line-height: 1.45; color: var(--ink-2); max-width: 34ch; }
.hero-search {
  display: flex; align-items: center; gap: 12px; padding: 0 12px 0 18px; height: 60px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px; cursor: text;
  box-shadow: var(--shadow); transition: border-color 0.2s, box-shadow 0.3s var(--ease);
}
.hero-search:focus-within { border-color: var(--hue-ink); }
.hero-search .i { width: 20px; height: 20px; color: var(--ink-3); }
.hero-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 1.1rem; height: 100%; }
.hero-search input::placeholder { color: var(--ink-3); }
.live { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; color: var(--ink-3); font-size: 0.92rem; }
.live b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.live-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gain); margin-right: 8px; vertical-align: 1px; }

/* One orchestrated load moment: the wordmark widens into place */
@media (prefers-reduced-motion: no-preference) {
  .wordmark .wm-line { animation: widen 1.25s var(--ease) both; }
  .wordmark .wm-line:last-child { animation-delay: 0.08s; }
  @keyframes widen { from { font-stretch: 75%; font-weight: 300; letter-spacing: 0.02em; opacity: 0.2; } }
}

/* Rails */
.rail { padding: clamp(18px, 3vw, 34px) 0; }
.rail-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 0 var(--gut) 16px; }
.rail-head h2 { font-size: clamp(1.35rem, 2.4vw, 2rem); font-stretch: 112%; letter-spacing: -0.03em; line-height: 1.1; }
.rail-sub { color: var(--ink-3); font-size: 0.95rem; margin-top: 4px; }
.rail-ctl { display: flex; align-items: center; gap: 6px; flex: none; }
.rail-more { font-size: 0.92rem; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 999px; }
.rail-more:hover { color: var(--ink); background: var(--bg-3); }
.rail-btn { display: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; place-items: center; color: var(--ink-2); }
.rail-btn:hover { color: var(--ink); border-color: var(--line-2); }
.rail-btn:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) and (min-width: 720px) { .rail-btn { display: grid; } }
.track {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 70vw, 300px); gap: 18px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gut);
  padding: 8px var(--gut) 16px; scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
@media (min-width: 1200px) {
  .track { margin: 0 var(--gut); padding-left: 0; padding-right: 0; scroll-padding: 0;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
  .track.at-end { -webkit-mask-image: none; mask-image: none; }
}
.track:has(.tile.big) { grid-auto-columns: clamp(260px, 84vw, 380px); }
@media (min-width: 720px) { .track { grid-auto-columns: clamp(240px, 21vw, 300px); } .track:has(.tile.big) { grid-auto-columns: clamp(320px, 31vw, 440px); } }

/* Tiles: cover first, name set big, numbers last */
.tile { display: flex; flex-direction: column; gap: 4px; text-decoration: none; scroll-snap-align: start; min-width: 0; }
.tile-art { display: block; position: relative; margin-bottom: 10px; perspective: 700px; }
.tile .cover {
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
@media (hover: hover) {
  .tile:hover .cover { transform: translateY(-6px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); box-shadow: 0 22px 34px -16px oklch(0.45 0.18 var(--h) / 0.7); }
}
.tile-name { font-weight: 750; font-size: 1.06rem; line-height: 1.3; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.tile.big .tile-name { font-size: 1.32rem; font-stretch: 112%; letter-spacing: -0.03em; }
.tile-tag { color: var(--ink-2); font-size: 0.9rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 0.85rem; }
.stars { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stars .i { color: var(--star); }
.gain { display: inline-flex; align-items: center; gap: 2px; color: var(--gain); font-weight: 700; font-variant-numeric: tabular-nums; }
.gain .i { width: 0.9em; height: 0.9em; }

/* Every repo */
.all-cta { display: flex; flex-wrap: wrap; gap: 10px; padding: clamp(28px, 4vw, 48px) var(--gut) clamp(40px, 6vw, 72px); }
.all-page .all { padding-top: 8px; }
.all { padding: clamp(36px, 6vw, 80px) var(--gut) 40px; scroll-margin-top: 64px; }
.all-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.all-head h2 { font-size: clamp(2.2rem, 6vw, 4.6rem); font-stretch: 125%; font-weight: 900; letter-spacing: -0.04em; line-height: 0.9; }
.all-ctl { display: flex; gap: 8px; }
.all-ctl select { background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 0.92rem; cursor: pointer; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .all .chips { flex-wrap: wrap; } }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line); background: var(--bg-2); border-radius: 999px; padding: 7px 14px; font-size: 0.9rem; color: var(--ink-2);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: oklch(0.7 0.17 var(--h)); }
.chip span { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip:hover { color: var(--ink); border-color: var(--line-2); }
.chip[aria-pressed="true"], .chip[aria-current] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] span, .chip[aria-current] span { color: color-mix(in oklab, var(--bg) 65%, var(--ink)); }
.count { color: var(--ink-3); padding: 12px 0 8px; font-size: 0.92rem; }
.count b { color: var(--ink); }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row-link {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 12px 8px; border-bottom: 1px solid var(--line); text-decoration: none;
  transition: background 0.2s;
}
@media (min-width: 900px) { .row-link { grid-template-columns: 56px minmax(0, 1fr) 210px 130px; } }
.row-link:hover { background: var(--bg-2); }
.row-cover { border-radius: 10px; aspect-ratio: 1; }
.row-text { display: flex; flex-direction: column; min-width: 0; }
.row-name { font-weight: 750; font-size: 1.08rem; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.row-owner { color: var(--ink-3); font-weight: 450; }
.row-tag { color: var(--ink-2); font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-cat { display: none; color: var(--ink-3); font-size: 0.88rem; }
@media (min-width: 900px) { .row-cat { display: block; } }
.row-num { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 0.88rem; }
.empty { padding: 32px 0; color: var(--ink-2); }

/* Repo page */
.repo { position: relative; isolation: isolate; }
.repo-hero { display: grid; gap: clamp(24px, 4vw, 56px); padding: clamp(24px, 5vw, 72px) var(--gut) clamp(32px, 4vw, 56px); --col: calc(100vw - 2 * var(--gut)); }
@media (min-width: 900px) { .repo-hero { grid-template-columns: clamp(340px, 44vw, 620px) minmax(0, 1fr); align-items: end; --col: calc(100vw - 2 * var(--gut) - clamp(340px, 44vw, 620px) - 56px); } }
.repo-art { max-width: 660px; margin: 0; }
.repo-art figcaption { margin-top: 10px; color: var(--ink-3); font-size: 0.8rem; }

.hero-cover { box-shadow: 0 40px 70px -30px oklch(0.35 0.2 var(--h) / 0.85); view-transition-name: hero-cover; }
.cat-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 11px 1px 9px; color: var(--hue-ink); font-weight: 650; text-decoration: none; }
.cat-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cat-pill:hover { background: var(--bg-3); }
.repo-owner { margin-top: 0; color: var(--ink-2); font-size: clamp(1rem, 1.6vw, 1.25rem); font-weight: 500; }
.repo-name {
  font-weight: 900; font-stretch: 125%; letter-spacing: -0.04em; line-height: 0.88; overflow-wrap: anywhere;
  font-size: clamp(2.2rem, calc(var(--col) / (var(--len) * 0.74)), 8.5rem); margin-top: 4px;
}
.repo-tagline { margin-top: 18px; font-size: clamp(1.15rem, 1.9vw, 1.5rem); line-height: 1.35; max-width: 40ch; font-weight: 500; }
.facts { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--ink-2); font-size: 0.95rem; }
.facts li { display: inline-flex; align-items: center; gap: 6px; }
.facts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.facts .i { color: var(--star); }
.facts .fact-gain, .facts .fact-gain b, .facts .fact-gain .i { color: var(--gain); }
.lvl { border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 10px; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; cursor: pointer;
  font-weight: 650; font-size: 0.98rem; text-decoration: none; background: var(--ink); color: var(--bg); border: 1px solid var(--ink);
  transition: transform 0.2s var(--ease), background 0.2s, color 0.2s;
}
.btn:hover { background: var(--hue-ink); border-color: var(--hue-ink); color: var(--bg); }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--bg-3); color: var(--ink); border-color: var(--line-2); }
.btn .out { width: 0.78em; height: 0.78em; opacity: 0.7; }

.repo-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding: 8px var(--gut) 24px; }
@media (min-width: 1000px) { .repo-body { grid-template-columns: minmax(0, 46rem) 320px; gap: clamp(56px, 6vw, 112px); justify-content: start; } }
.repo-main { display: flex; flex-direction: column; gap: 56px; max-width: 70ch; }
.repo-main h2, .repo-side h2 { font-size: 1.35rem; font-stretch: 112%; letter-spacing: -0.03em; margin-bottom: 16px; }
.lead p { color: var(--ink-2); }
.lead p + p { margin-top: 1em; }
.lead p:first-child { color: var(--ink); font-size: clamp(1.2rem, 1.8vw, 1.42rem); line-height: 1.5; font-weight: 450; }
.note { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; color: var(--ink-2); }
.feats { list-style: none; margin: 0; padding: 0; display: grid; }
.feats li { padding: 18px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
@media (min-width: 720px) { .feats li { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; } }
.feats h3 { font-size: 1.04rem; line-height: 1.35; font-weight: 700; letter-spacing: -0.01em; }
.feats p { color: var(--ink-2); }
.uses { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.uses li { position: relative; padding: 14px 18px 14px 48px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; }
.uses li::before { content: ""; position: absolute; left: 18px; top: 1.2em; width: 14px; height: 14px; border-radius: 0 0 0 14px; background: oklch(0.72 0.17 var(--h)); }
.start p { color: var(--ink-2); }
.repo :not(pre, .cmd) > code { font: 400 0.86em var(--mono); background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--ink); overflow-wrap: anywhere; }
.cmd { display: flex; align-items: center; gap: 10px; background: var(--code-bg); color: #e9ecf2; border-radius: 12px; padding: 6px 6px 6px 18px; margin-top: 12px; border: 1px solid var(--line); }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: pre; font: 400 0.9rem/1.6 var(--mono); padding: 8px 0; scrollbar-width: thin; }
.cmd code::before { content: "$ "; color: #8a8f9c; }
.cmd-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; background: #1c1f27; color: #e9ecf2; border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 0.82rem; font-weight: 600; }
.cmd-copy:hover { background: #2a2e39; }
.start .fine { margin-top: 14px; color: var(--ink-3); font-size: 0.88rem; }
.repo-side { display: flex; flex-direction: column; gap: 28px; }
@media (min-width: 1000px) { .repo-side { position: sticky; top: 84px; align-self: start; } }
.repo-side p { color: var(--ink-2); }
.kv { margin: 0; border-top: 1px solid var(--line); }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 0.85rem; color: var(--ink-2); }
.more-rail { padding-top: clamp(40px, 6vw, 72px); }

/* Category pages */
.cat-hero, .index-hero { position: relative; isolation: isolate; padding: clamp(16px, 3vw, 28px) var(--gut) clamp(28px, 4vw, 48px); overflow: hidden; }
.cat-chips { padding-top: 0; margin: 0 calc(-1 * var(--gut)); padding-left: var(--gut); padding-right: var(--gut); }
.cat-name {
  font-weight: 900; font-stretch: 125%; letter-spacing: -0.04em; line-height: 0.86; margin-top: clamp(28px, 5vw, 64px);
  font-size: clamp(2.7rem, 10.5vw, 10rem); overflow-wrap: anywhere;
}
.cat-blurb { margin-top: 20px; color: var(--ink-2); font-size: clamp(1.08rem, 1.6vw, 1.3rem); max-width: 52ch; }
.cat-blurb b, .cat-blurb a { color: var(--ink); }
.feature { padding: 8px var(--gut) clamp(32px, 5vw, 56px); }
.feature-link { display: grid; gap: 22px; text-decoration: none; align-items: center; }
@media (min-width: 720px) { .feature-link { grid-template-columns: clamp(320px, 46vw, 680px) minmax(0, 1fr); gap: 40px; } }
.feature-link .cover { box-shadow: 0 34px 60px -28px oklch(0.35 0.2 var(--h) / 0.8); transition: transform 0.5s var(--ease); }
.feature-link:hover .cover { transform: translateY(-6px); }
.feature-text { display: flex; flex-direction: column; gap: 12px; }
.feature-name { font-weight: 900; font-stretch: 125%; letter-spacing: -0.04em; line-height: 0.9; font-size: clamp(2.2rem, 5.6vw, 5rem); overflow-wrap: anywhere; }
.feature-tag { color: var(--ink-2); font-size: clamp(1.02rem, 1.4vw, 1.18rem); max-width: 54ch; }
.grid-wrap { padding: 0 var(--gut) clamp(40px, 6vw, 80px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 30px 18px; grid-auto-flow: dense; }
.grid .tile.big { grid-column: span 2; }
.grid .tile.big .tile-name { font-size: clamp(1.4rem, 2.4vw, 2.1rem); font-stretch: 118%; letter-spacing: -0.035em; line-height: 1.1; }
.tile-rank { color: var(--ink-3); font-weight: 600; font-stretch: 100%; margin-right: 0.4em; font-variant-numeric: tabular-nums; }
.tile-owner { color: var(--ink-3); font-weight: 450; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 40px 24px; } }
@media (max-width: 560px) { .grid .tile.big { grid-column: auto; grid-row: auto; } }

/* Category index: each category is a fanned hand of its covers */
.cat-index { list-style: none; margin: 0; padding: 0 var(--gut) 80px; display: grid; }
.cat-index a { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 20px 8px; border-top: 1px solid var(--line); text-decoration: none; }
@media (min-width: 720px) { .cat-index a { grid-template-columns: 300px minmax(0, 1fr) auto; gap: 36px; padding: 26px 12px; } }
.cat-index a:hover { background: var(--bg-2); }
.ci-stack { position: relative; aspect-ratio: 5 / 2; }
.ci-stack .cover { position: absolute; top: 4%; width: 72%; height: auto; border-radius: 8px; box-shadow: -8px 8px 20px -10px rgb(0 0 0 / 0.6); transition: transform 0.5s var(--ease); }
.ci-stack .cover:nth-child(1) { left: 0; z-index: 4; }
.ci-stack .cover:nth-child(2) { left: 8%; z-index: 3; transform: rotate(3deg); }
.ci-stack .cover:nth-child(3) { left: 16%; z-index: 2; transform: rotate(6deg); }
.ci-stack .cover:nth-child(4) { left: 24%; z-index: 1; transform: rotate(9deg); }
@media (hover: hover) {
  .cat-index a:hover .cover:nth-child(2) { transform: translateX(3%) rotate(5deg); }
  .cat-index a:hover .cover:nth-child(3) { transform: translateX(6%) rotate(9deg); }
  .cat-index a:hover .cover:nth-child(4) { transform: translateX(9%) rotate(13deg); }
}
.ci-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ci-name { font-weight: 850; font-stretch: 118%; letter-spacing: -0.035em; font-size: clamp(1.25rem, 3vw, 2.3rem); line-height: 1.05; }
.ci-blurb { color: var(--ink-2); font-size: 0.95rem; }
.ci-n { font-weight: 800; font-stretch: 125%; font-size: clamp(1.3rem, 3vw, 2.2rem); color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Facet pages and hubs */
.crumbs { color: var(--ink-3); font-size: 0.92rem; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.facet-page .index-hero .cat-name { font-size: clamp(2.4rem, 8vw, 7rem); }
.hub { list-style: none; margin: 0; padding: 0 var(--gut) 80px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.hub a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; background: var(--bg-2); }
.hub a:hover { border-color: var(--line-2); background: var(--bg-3); }
.hub-name { font-weight: 700; }
.hub-n { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tags a { color: inherit; text-decoration: none; }
.tags li:has(a):hover { border-color: var(--line-2); color: var(--ink); }
.kv dd a { color: var(--ink); text-decoration-color: var(--line-2); }

/* By role */
.role-pick { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; }
.role-pick select { font: inherit; font-weight: 650; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 9px 36px 9px 16px; cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.role-pick select:hover { border-color: var(--ink-3); }
.hero-foot .hero-role { grid-column: 1 / -1; }
@media (min-width: 900px) { .hero-foot .hero-role { grid-column: auto; } }
.role-switch { margin-top: 22px; }
.role-list { list-style: none; margin: 0; padding: 0 var(--gut) 72px; display: grid; gap: 4px; }
.role-item { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 18px; align-items: center; padding: 12px; border-radius: 16px; text-decoration: none; }
@media (min-width: 720px) { .role-item { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding: 14px; } }
.role-item:hover { background: var(--bg-2); }
.role-item .cover { border-radius: 12px; }
.role-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.role-name { font-weight: 800; font-stretch: 112%; font-size: clamp(1.15rem, 1.8vw, 1.45rem); letter-spacing: -0.02em; }
.role-why { color: var(--ink-2); font-size: clamp(0.95rem, 1.2vw, 1.05rem); max-width: 70ch; }
.role-item .row-cat { display: inline; }
.role-hub a { flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; }
.role-hub .hub-name { font-size: 1.1rem; }
.hub-who { color: var(--ink-2); font-size: 0.9rem; }
.works ul { margin-top: 0; }
.useful ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.useful li { display: grid; gap: 2px; }
.useful a { font-weight: 700; color: var(--ink); text-decoration: none; }
.useful a:hover { text-decoration: underline; }
.useful span { color: var(--ink-2); font-size: 0.92rem; }
.rail-for .tile-tag { -webkit-line-clamp: 3; }

/* Anything better? A full-width decision panel, tinted from the repo's category */
.better { padding: clamp(28px, 4vw, 48px) var(--gut) 0; }
.better-panel { border-radius: 26px; padding: clamp(20px, 3.2vw, 40px);
  background: color-mix(in oklab, oklch(0.62 0.16 var(--h)) 9%, var(--bg-2));
  border: 1px solid color-mix(in oklab, oklch(0.62 0.16 var(--h)) 30%, var(--line)); }
.better-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
.better-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--bg);
  background: oklch(0.72 0.15 var(--h)); }
.better-icon .i { width: 24px; height: 24px; }
.better h2 { font-size: clamp(1.45rem, 2.6vw, 2.2rem); font-stretch: 118%; letter-spacing: -0.035em; line-height: 1.08; margin: 4px 0 10px; }
.better-verdict { font-size: clamp(1.05rem, 1.45vw, 1.22rem); line-height: 1.55; color: var(--ink); max-width: 72ch; }
.alts { list-style: none; margin: clamp(20px, 2.6vw, 30px) 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .alts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.alt a { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: start; height: 100%; padding: 14px;
  border: 1px solid var(--line); border-radius: 18px; text-decoration: none; background: var(--bg); transition: border-color 0.2s, transform 0.3s var(--ease); }
@media (min-width: 720px) { .alt a { grid-template-columns: 148px minmax(0, 1fr); gap: 18px; padding: 16px; } }
.alt a:hover { border-color: var(--line-2); transform: translateY(-2px); }
.alt .cover { border-radius: 10px; }
.alt-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.alt-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.alt-name { font-weight: 800; font-size: 1.12rem; letter-spacing: -0.015em; }
.alt-rel { font-size: 0.76rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; border: 1px solid var(--line-2); color: var(--ink-2); }
.alt-better .alt-rel { color: var(--gain); border-color: color-mix(in oklab, var(--gain) 45%, transparent); }
.alt-companion .alt-rel { color: var(--hue-ink); }
.alt-when { color: var(--ink); line-height: 1.45; }
.alt-cost { color: var(--ink-3); font-size: 0.9rem; line-height: 1.45; }
.alt-upd { color: var(--ink-3); }

/* Command palette */
.palette { border: 0; padding: 0; background: none; width: min(680px, calc(100vw - 24px)); margin: max(10vh, 24px) auto auto; color: var(--ink); max-height: 76vh; overflow: visible; }
.palette::backdrop { background: rgb(4 5 8 / 0.62); backdrop-filter: blur(4px); }
.palette-box { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: 0 40px 90px -30px rgb(0 0 0 / 0.75); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh; }
.palette-field { display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 64px; border-bottom: 1px solid var(--line); flex: none; }
.palette-field .i { width: 20px; height: 20px; color: var(--ink-3); }
.palette-field input { flex: 1; border: 0; outline: 0; background: none; font-size: 1.15rem; min-width: 0; }
.palette-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.palette-list a { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px 10px; border-radius: 12px; text-decoration: none; }
.palette-list img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.palette-list .pn { font-weight: 700; display: block; }
.palette-list .pt { color: var(--ink-2); font-size: 0.88rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-list .pc { color: var(--ink-3); font-size: 0.82rem; white-space: nowrap; }
@media (max-width: 560px) { .palette-list .pc { display: none; } .palette-list a { grid-template-columns: 40px minmax(0, 1fr); } }
.palette-list [aria-selected="true"] a { background: var(--bg-3); }
.palette-empty { padding: 20px 12px; color: var(--ink-2); }
.palette-hint { border-top: 1px solid var(--line); padding: 10px 20px; color: var(--ink-3); font-size: 0.8rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .palette[open] .palette-box { animation: pop 0.32s var(--ease); }
  @keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }
}
@media (hover: none) { .palette-hint { display: none; } }

/* Footer: balanced columns, then a slim bar */
.foot { margin-top: clamp(48px, 7vw, 96px); border-top: 1px solid var(--line); color: var(--ink-2); }
.foot-grid { display: grid; gap: 36px 28px; padding: clamp(32px, 5vw, 56px) var(--gut) 40px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.foot-brand { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
@media (min-width: 1000px) { .foot-grid { grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); column-gap: clamp(24px, 3vw, 48px); } .foot-brand { grid-column: auto; } }
.foot-word { display: inline-flex; align-items: center; gap: 0.25em; font-weight: 900; font-stretch: 125%; letter-spacing: -0.04em;
  font-size: clamp(1.4rem, 1.75vw, 1.75rem); line-height: 0.95; text-decoration: none; color: var(--ink); white-space: nowrap; }
.foot-brand p { max-width: 34ch; }
.foot-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.88rem; color: var(--ink-3); }
.foot-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.foot-search { height: 40px; padding: 0 12px 0 14px; font-size: 0.9rem; margin-top: 4px; }
.foot-search kbd { margin-left: 4px; }
.foot-col h2 { font-size: 0.95rem; font-stretch: 112%; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 12px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-col a { color: var(--ink-2); text-decoration: none; font-size: 0.93rem; }
.foot-col a:hover { color: var(--ink); text-decoration: underline; }
.foot-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 24px; padding: 18px var(--gut) 32px; border-top: 1px solid var(--line);
  font-size: 0.82rem; color: var(--ink-3); }
.foot-note { flex: 1 1 380px; max-width: 72ch; }
.foot-adyog { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; max-width: 380px; }
.foot-adyog-by { font-size: 0.78rem; color: var(--ink-3); }
.foot-adyog-logo { display: block; color: var(--ink); line-height: 0; }
.foot-adyog-logo:hover { color: var(--hue-ink); }
.adyog-logo { width: 112px; height: auto; display: block; }
.foot-adyog p:not(.foot-adyog-by) { font-size: 0.88rem; color: var(--ink-2); line-height: 1.5; }
.foot-adyog-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; font-size: 0.85rem; }
.foot-adyog-links a { color: var(--ink-2); text-decoration: none; }
.foot-adyog-links a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 760px) { .foot-adyog { margin-left: 0; align-items: flex-start; text-align: left; } }
.foot-by a { color: var(--ink-2); text-decoration: none; }
.foot-by a:hover { color: var(--ink); text-decoration: underline; }

/* Motion. One authored moment (the home wordmark, then this week's covers printing in), continuity
   between pages and list states, and small confirmations. Durations: 150 feedback, 250 state, 450 views. */

/* This week's covers print in: each cover is wiped open left to right, in reading order. */
@media (prefers-reduced-motion: no-preference) {
  .rail-intro .tile { animation: tile-in 0.6s var(--ease) both; animation-delay: calc(0.55s + var(--i, 0) * 70ms); }
  .rail-intro .tile .cover { animation: print-in 0.75s var(--ease) both; animation-delay: calc(0.55s + var(--i, 0) * 70ms); }
  @keyframes tile-in { from { opacity: 0; transform: translateY(14px); } }
  @keyframes print-in { from { clip-path: inset(0 100% 0 0 round var(--r)); } to { clip-path: inset(0 0 0 0 round var(--r)); } }
}

/* List rows that come back into view after a filter change. */
@media (prefers-reduced-motion: no-preference) {
  .row.enter { animation: row-in 0.28s var(--ease) both; animation-delay: calc(min(var(--i, 0), 10) * 18ms); }
  @keyframes row-in { from { opacity: 0; transform: translateY(6px); } }
  .palette-list li { animation: row-in 0.22s var(--ease) both; animation-delay: calc(min(var(--i, 0), 8) * 22ms); }
}
@media (prefers-reduced-motion: reduce) {
  .row.enter { animation: fade-in 0.2s ease both; }
  @keyframes fade-in { from { opacity: 0; } }
}

/* The search dialog leaves as smoothly as it arrives. */
.palette { transition: opacity 0.16s ease, overlay 0.16s allow-discrete, display 0.16s allow-discrete; }
.palette:not([open]) { opacity: 0; }
@starting-style { .palette[open] { opacity: 0; } }

/* Copy and Share confirm with a tick that pops in. */
.done .i:first-child { animation: tick 0.3s var(--ease); }
@keyframes tick { from { transform: scale(0.4); opacity: 0; } }
.cmd-copy.done, .btn.done { color: var(--gain); }
.btn.done { border-color: var(--gain); }

/* Page-to-page motion: the clicked cover and name become the repo page's cover and name */
@view-transition { navigation: auto; }
.repo-name { view-transition-name: hero-name; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-group(hero-cover), ::view-transition-group(hero-name) { animation-duration: 0.5s; animation-timing-function: var(--ease); }
  ::view-transition-old(hero-name), ::view-transition-new(hero-name) { height: 100%; object-fit: none; object-position: left top; }
  ::view-transition-old(root) { animation: 0.18s ease both vt-out; }
  ::view-transition-new(root) { animation: 0.38s var(--ease) both vt-in; }
  @keyframes vt-out { to { opacity: 0; } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
  /* Theme switch: the new theme spreads in a circle from the toggle. */
  html.theme-switching::view-transition-old(root) { animation: none; }
  html.theme-switching::view-transition-new(root) { animation: theme-in 0.55s var(--ease) both; }
  @keyframes theme-in { from { clip-path: circle(0 at var(--tx, 100%) var(--ty, 0)); } to { clip-path: circle(150vmax at var(--tx, 100%) var(--ty, 0)); } }
  /* Filtering and sorting the full list: rows glide to their new places. */
  ::view-transition-group(*.row-vt) { animation-duration: 0.32s; animation-timing-function: var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
