:root {
  color-scheme: dark;
  --bg: #101614;
  --surface: #18211e;
  --surface-strong: #202c27;
  --text: #f4f8f5;
  --muted: #a7b5ad;
  --line: rgb(214 245 225 / 14%);
  --accent: #7bf1ae;
  --accent-ink: #0d291a;
  --warm: #ffc57b;
  --display: "Avenir Next", "SF Pro Display", "Segoe UI", sans-serif;
  --text-font: Inter, "SF Pro Text", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 90% 0%, rgb(123 241 174 / 9%), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: var(--text-font);
  -webkit-font-smoothing: antialiased;
}
button, input { color: inherit; font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.shell { width: min(calc(100% - 40px), 1180px); margin-inline: auto; }
.hero { border-bottom: 1px solid var(--line); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 64px;
  align-items: end;
  padding-block: 84px 44px;
}
.eyebrow {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
}
h1, h2, h3 { font-family: var(--display); }
h1 {
  margin: 10px 0 0;
  font-size: clamp(48px, 9vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.065em;
}
.hero-copy {
  max-width: 700px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
}
.facts { margin: 0; border-block: 1px solid var(--line); }
.facts div { padding: 16px 0; }
.facts div + div { border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); font: 700 10px/1 var(--mono); letter-spacing: 0.12em; }
.facts dd { margin: 7px 0 0; font: 600 14px/1.4 var(--mono); overflow-wrap: anywhere; }

.catalog { padding-block: 52px 88px; }
.catalog-tools {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 440px);
  gap: 32px;
  align-items: end;
}
.catalog-tools h2 { margin: 8px 0 0; font-size: 30px; letter-spacing: -0.035em; }
.search { position: relative; display: block; }
.search input {
  width: 100%;
  height: 48px;
  padding: 0 54px 0 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--surface);
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(123 241 174 / 13%); }
.search kbd {
  position: absolute;
  top: 50%;
  right: 13px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-family: var(--mono);
  transform: translateY(-50%);
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.filter {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}
.filter span { font: 700 10px/1 var(--mono); }
.filter[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.catalog-status { margin: 18px 0 0; color: var(--muted); font: 12px/1.4 var(--mono); }

.catalog-section { margin-top: 54px; }
.catalog-section > header {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.section-number { color: var(--warm); font: 700 13px/1.5 var(--mono); }
.catalog-section h2 { margin: 5px 0 0; font-size: 25px; letter-spacing: -0.03em; }
.section-desc { max-width: 700px; margin: 7px 0 0; color: var(--muted); line-height: 1.5; }
.section-count { color: var(--muted); font: 12px/1.5 var(--mono); }
.page-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.page-card {
  display: block;
  min-height: 170px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}
.page-card:hover { border-color: rgb(123 241 174 / 55%); background: var(--surface-strong); transform: translateY(-2px); }
.page-card.pinned { background: linear-gradient(145deg, rgb(123 241 174 / 10%), var(--surface) 56%); }
.page-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font: 11px/1.4 var(--mono); }
.page-meta span { color: var(--accent); font-weight: 700; }
.page-meta code { overflow: hidden; text-overflow: ellipsis; }
.page-card h3 { margin: 30px 0 0; font-size: 20px; letter-spacing: -0.025em; }
.page-card p { margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.empty { margin-top: 48px; padding: 38px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; }
.empty h2 { margin: 10px 0 0; }
.empty p:not(.eyebrow) { color: var(--muted); }
.empty button { padding: 9px 13px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.error { border-color: rgb(255 118 118 / 55%); }
footer { border-top: 1px solid var(--line); color: var(--muted); font: 11px/1.5 var(--mono); }
.footer-row { display: flex; justify-content: space-between; gap: 20px; padding-block: 22px; }

@media (max-width: 760px) {
  .hero-grid, .catalog-tools { grid-template-columns: 1fr; }
  .hero-grid { gap: 38px; padding-top: 64px; }
  .page-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .shell { width: min(calc(100% - 28px), 1180px); }
  .hero-grid { padding-block: 50px 34px; }
  .catalog { padding-block: 40px 68px; }
  .catalog-section > header { grid-template-columns: 30px 1fr; }
  .section-count { display: none; }
  .page-card { min-height: 150px; padding: 18px; }
  .footer-row { flex-direction: column; }
}
