:root {
  --paper: #fefefe;
  --ink: #1e1e1e;
  --gray-1: #dedede;
  --gray-2: #c4c4c4;
  --gray-3: #7a7a7a;
  --pink: #f386a1;
  --pink-hot: #ff4fd8;
  --magenta: #d45bb6;
  --sky: #d9f1ff;
  --teal: #09aea1;

  --display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max: 1240px;
  --gutter: 48px;
  --shadow: 4px 4px 0 var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: -0.04em; line-height: 0.92; }
.mono, code, pre, .win-bar, .kv th, .chip, .search, .sort, .stars, .links, .owner, .c-lang, .kicker, .footnote, .side-string, .no-results, thead th { font-family: var(--mono); }
code { font-size: 0.92em; background: var(--gray-1); padding: 0 4px; }
::selection { background: var(--pink); color: var(--ink); }

/* Window chrome */
.win { background: var(--paper); border: 1px solid var(--ink); box-shadow: var(--shadow); }
.win-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-bottom: 1px solid var(--ink);
}
.win-bar-r { color: var(--gray-2); text-transform: none; letter-spacing: 0; }

/* Crop-mark frames */
.frame { position: relative; }
.frame::before, .frame::after, .frame > .marks::before, .frame > .marks::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--ink);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}
.frame::before { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.frame::after { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.frame > .marks::before { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.frame > .marks::after { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }

/* Hero */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 34% 55% at 6% 30%, var(--pink-hot) 0%, rgba(255,79,216,0.55) 40%, rgba(255,79,216,0) 70%),
    radial-gradient(ellipse 40% 60% at 96% 28%, var(--pink-hot) 0%, rgba(255,79,216,0.5) 45%, rgba(255,79,216,0) 72%),
    radial-gradient(ellipse 60% 40% at 20% 100%, var(--pink) 0%, rgba(243,134,161,0) 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, var(--pink) 0%, rgba(243,134,161,0) 70%),
    linear-gradient(180deg, var(--sky) 0%, #eaf6ff 60%, var(--paper) 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(30,30,30,0.22) 0.9px, transparent 1.1px);
  background-size: 4px 4px;
  mix-blend-mode: multiply;
  opacity: 0.38;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(254,254,254,0) 0%, var(--paper) 100%);
  pointer-events: none;
}
.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 2;
}
.nav-mid { display: flex; }
.nav-item {
  display: inline-block;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  padding: 8px 12px;
  border-right: 1px solid var(--gray-1);
}
.nav-mid .nav-item:last-child { border-right: 0; }
.nav > .nav-item:last-child { border-right: 0; }
.nav-item:hover { background: var(--ink); color: var(--paper); }
.ticker {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100% - 32px));
  box-shadow: var(--shadow);
  animation: rise 0.5s ease-out both;
}
.ticker .win-bar { text-transform: none; letter-spacing: 0; font-size: 12px; }
.ticker-body {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  background: var(--gray-1);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
}
.ticker-body a { white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.ticker-body a:hover { color: var(--magenta); }
.side-string {
  position: absolute;
  left: 18px;
  bottom: 24px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(30,30,30,0.55);
  z-index: 1;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Title */
.title {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px var(--gutter) 88px;
  text-align: center;
}
.kicker {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ink);
  margin-bottom: 28px;
}
.dots { display: inline-block; width: 120px; border-bottom: 2px dotted var(--ink); height: 0; transform: translateY(2px); }
.title h1 { font-size: clamp(64px, 12vw, 168px); }
.sub {
  max-width: 640px;
  margin: 28px auto 0;
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink);
}
.big-links { display: flex; justify-content: center; gap: 48px; margin-top: 36px; flex-wrap: wrap; }
.big-links a {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.03em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.big-links a:hover { color: var(--magenta); }

/* Pink band */
.band { background: var(--pink); color: var(--ink); }
.band-inner { max-width: var(--max); margin: 0 auto; padding: 72px var(--gutter) 80px; }
.giant { font-size: clamp(48px, 8.4vw, 118px); }
.footnote { font-size: 11px; margin-top: 20px; text-transform: uppercase; letter-spacing: 0.04em; }
.footnote a { text-decoration: underline; }
.band-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px;
  margin-top: 56px;
  align-items: start;
}
.band .win { background: var(--paper); }
table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv th { text-align: left; font-weight: 500; color: var(--gray-3); padding: 9px 12px; width: 90px; vertical-align: top; border-bottom: 1px dotted var(--gray-2); }
.kv td { padding: 9px 12px 9px 0; border-bottom: 1px dotted var(--gray-2); font-family: var(--mono); line-height: 1.45; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.kv a { text-decoration: underline; text-underline-offset: 2px; }
.kv a:hover { color: var(--magenta); }
pre.code {
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
}
pre.code code { background: transparent; padding: 0; font-size: inherit; }
.c-k { color: var(--pink); }
.c-s { color: #b9e6a3; }
.c-n { color: var(--gray-2); }

/* Directory */
main.frame {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px var(--gutter) 96px;
  scroll-margin-top: 0;
}
.featured { margin-bottom: 40px; }
.feat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feat {
  padding: 14px 16px 16px;
  border-right: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
}
.feat:last-child { border-right: 0; }
.feat:hover { background: var(--pink); }
.feat-stars { font-family: var(--mono); font-size: 12px; }
.feat-name { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.03em; line-height: 1; word-break: break-word; }
.feat-desc { font-size: 13px; line-height: 1.45; color: var(--ink); }
.feat-owner { font-family: var(--mono); font-size: 11px; color: var(--gray-3); margin-top: auto; }
.feat:hover .feat-owner { color: var(--ink); }

.controls { position: sticky; top: 12px; z-index: 5; margin-bottom: 40px; }
.controls-body { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; background: var(--gray-1); }
.search { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; min-width: 220px; background: var(--paper); border: 1px solid var(--ink); padding: 0 10px; height: 36px; font-size: 13px; }
.prompt { color: var(--magenta); font-weight: 500; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; color: var(--ink); }
.search input::placeholder { color: var(--gray-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  padding: 7px 10px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
}
.chip:hover { background: var(--pink); }
.chip.is-active { background: var(--ink); color: var(--paper); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-left: auto; }
.sort select { font: inherit; font-size: 12px; padding: 7px 8px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }

.cat { margin-bottom: 40px; scroll-margin-top: 96px; }
.cat .blurb { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--ink); background: var(--paper); }
table.dir { width: 100%; border-collapse: collapse; }
.dir thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--gray-1);
  padding: 7px 12px;
  border-bottom: 1px solid var(--ink);
}
.dir tbody td { padding: 10px 12px; border-bottom: 1px dotted var(--gray-2); vertical-align: top; font-size: 14px; line-height: 1.45; }
.dir tbody tr:last-child td { border-bottom: 0; }
.dir tbody tr:hover td { background: var(--pink); }
.c-name { width: 24%; }
.c-name a { font-weight: 500; display: block; word-break: break-word; }
.c-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.owner { display: block; font-size: 11px; color: var(--gray-3); margin-top: 2px; }
.dir tbody tr:hover .owner, .dir tbody tr:hover .dim { color: var(--ink); }
.c-desc { color: var(--ink); }
.c-lang { width: 12%; font-size: 12px; white-space: nowrap; }
.c-stars { width: 9%; font-size: 12px; white-space: nowrap; text-align: right; }
.c-links { width: 16%; font-size: 12px; white-space: nowrap; text-align: right; }
.links a { text-decoration: none; }
.links a + a { margin-left: 4px; }
.links a:hover { color: var(--magenta); text-decoration: underline; text-underline-offset: 2px; }
.dim { color: var(--gray-2); }
.empty { padding: 12px; font-size: 13px; }
.no-results { padding: 24px 0; font-size: 13px; }

/* Footer */
.footer { background: var(--ink); color: var(--paper); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter) 56px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; font-size: 13px; line-height: 1.55; }
.footer .mono { font-size: 11px; letter-spacing: 0.06em; color: var(--gray-2); margin-bottom: 10px; }
.footer a { text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--pink); }
.footer code { background: rgba(255,255,255,0.12); color: var(--paper); }

/* Responsive */
@media (max-width: 1000px) {
  .band-grid { grid-template-columns: minmax(0, 1fr); }
  .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feat:nth-child(2n) { border-right: 0; }
  .feat:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .footer-inner { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; --shadow: 3px 3px 0 var(--ink); }
  .hero { min-height: 340px; }
  .nav-mid { display: none; }
  .nav-item { font-size: 15px; padding: 7px 10px; }
  .side-string { display: none; }
  .title { padding: 40px var(--gutter) 64px; }
  .title h1 { font-size: clamp(56px, 16vw, 96px); }
  .sub { font-size: 16px; }
  .big-links { gap: 24px; }
  .band-inner { padding: 56px var(--gutter) 64px; }
  .kv th { width: 76px; }
  .feat-grid { grid-template-columns: minmax(0, 1fr); }
  .feat { border-right: 0; border-bottom: 1px solid var(--ink); }
  .feat:last-child { border-bottom: 0; }
  .controls { position: static; }
  .sort { margin-left: 0; }
  .dir thead { display: none; }
  .dir, .dir tbody, .dir tr, .dir td { display: block; width: auto; }
  .dir tbody tr { padding: 10px 12px; border-bottom: 1px dotted var(--gray-2); }
  .dir tbody tr:hover { background: var(--pink); }
  .dir tbody td { padding: 2px 0; border: 0; }
  .c-lang, .c-stars, .c-links { display: inline-block !important; text-align: left; margin-right: 12px; }
  .c-desc { padding-bottom: 6px !important; }
}
