/* ==========================================================================
   AI 导航 · ai.langcode.app
   Warm editorial palette + compact directory grid.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f7f4ed;
  --bg-elevated: #fffdf8;
  --surface: #fffdf8;
  --surface-2: #f0ebe0;
  --ink: #171512;
  --ink-soft: #3e3932;
  --muted: #746c60;
  --faint: #786f62;
  --line: #e4ddd0;
  --line-strong: #d2c8b6;
  --accent: #b8512c;
  --accent-strong: #8f3a1d;
  --accent-soft: #f6e4d9;
  --teal: #2f6f66;
  --shadow-sm: 0 1px 2px rgba(23, 21, 18, 0.05);
  --shadow-md: 0 18px 40px -20px rgba(23, 21, 18, 0.28);
  --shadow-lg: 0 30px 70px -30px rgba(23, 21, 18, 0.35);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --max: 1180px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: "New York", "Iowan Old Style", "Palatino Linotype", "Songti SC",
    "Noto Serif SC", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1012;
  --bg-elevated: #13181b;
  --surface: #151a1e;
  --surface-2: #1b2227;
  --ink: #f2eee6;
  --ink-soft: #d8d2c7;
  --muted: #9aa2a8;
  --faint: #8a949b;
  --line: #252d33;
  --line-strong: #354049;
  --accent: #ff8a5c;
  --accent-strong: #ffad89;
  --accent-soft: #2b1c15;
  --teal: #6fbcad;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 18px 40px -20px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 150px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(880px 520px at 10% -12%, rgba(184, 81, 44, 0.13), transparent 62%),
    radial-gradient(760px 480px at 96% -4%, rgba(47, 111, 102, 0.11), transparent 58%),
    linear-gradient(to bottom, transparent 0, var(--bg) 72%);
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(880px 520px at 10% -12%, rgba(255, 138, 92, 0.09), transparent 62%),
    radial-gradient(760px 480px at 96% -4%, rgba(111, 188, 173, 0.07), transparent 58%),
    linear-gradient(to bottom, transparent 0, var(--bg) 72%);
}

::selection {
  background: var(--accent);
  color: #fff8f2;
}

a {
  color: var(--accent-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent);
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
  color: var(--bg);
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.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;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.topbar.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -24px rgba(23, 21, 18, 0.5);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font: italic 700 15px/1 var(--serif);
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text b {
  font-size: 15px;
  font-weight: 680;
}

.brand-text small {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
}

.topnav a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.topnav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.topnav .nav-cta {
  color: var(--ink);
  font-weight: 600;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-left: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-soft);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-sun,
[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 64px 0 30px;
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 78% 70% at 50% 0%, #000 20%, transparent 76%);
  mask-image: radial-gradient(ellipse 78% 70% at 50% 0%, #000 20%, transparent 76%);
  opacity: 0.55;
}

.hero-inner {
  max-width: 940px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  padding: 5px 12px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--accent) 0 2px, transparent 2.5px),
    conic-gradient(from 0deg, var(--accent) 0 25%, transparent 0 50%, var(--accent) 0 75%, transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 0 6px, #000 6.5px);
  mask: radial-gradient(circle, transparent 0 6px, #000 6.5px);
  background-color: var(--accent-soft);
  animation: spin 14s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 6.4vw, 76px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.hero h1 em {
  position: relative;
  font-style: normal;
  color: var(--accent);
  white-space: nowrap;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 0.02em;
  height: 0.055em;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.3;
}

.lede {
  max-width: 52em;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.8;
}

.lede strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.only-desktop {
  display: inline;
}

/* Search ------------------------------------------------------------------ */

.search-form {
  position: relative;
  max-width: 660px;
  margin: 32px auto 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 14px 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md), inset 0 1px 0 color-mix(in srgb, #fff 55%, transparent);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

[data-theme="dark"] .search-box {
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent), var(--shadow-md);
}

.search-box > svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  color: var(--faint);
}

.search-box input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-box input::placeholder {
  color: var(--faint);
}

.search-box input:focus {
  outline: none;
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.kbd {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--faint);
  font: 600 11px/1 var(--mono);
}

.search-box:focus-within .kbd {
  opacity: 0;
}

.clear-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}

.clear-btn:hover {
  color: var(--ink);
}

.clear-btn[hidden] {
  display: none;
}

.popular {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--faint);
}

.popular span {
  letter-spacing: 0.03em;
}

.popular button {
  padding: 3px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  transition: background 0.15s ease, color 0.15s ease;
}

.popular button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 0;
  margin-top: 30px;
  color: var(--faint);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.hero-stats span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-stats span + span::before {
  content: "";
  width: 3px;
  height: 3px;
  margin: 0 13px;
  border-radius: 50%;
  background: var(--line-strong);
}

.hero-stats b {
  color: var(--ink-soft);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Filters
   -------------------------------------------------------------------------- */

.filterbar {
  position: sticky;
  top: 58px;
  z-index: 50;
  margin-top: 34px;
  padding: 10px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.filterbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.chips {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 34px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.chip span {
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chip.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.chip.is-active span {
  color: color-mix(in srgb, var(--bg) 62%, transparent);
}

.list-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 0 auto;
}

.toggle {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.toggle:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.toggle .dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

/* --------------------------------------------------------------------------
   Result line & sections
   -------------------------------------------------------------------------- */

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 26px 0 6px;
}

.result-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.result-line b {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.result-line .filtering {
  color: var(--accent-strong);
  font-weight: 600;
}

.reset-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.reset-link:hover {
  color: var(--ink);
}

.list-tools .reset-link {
  margin-left: 4px;
}

.reset-link[hidden] {
  display: none;
}

.cat-section {
  padding: 20px 0 26px;
  scroll-margin-top: 150px;
}

.cat-section[hidden] {
  display: none;
}

.cat-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}

.cat-index {
  color: var(--faint);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.08em;
  padding-top: 5px;
}

.cat-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.cat-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.cat-count {
  margin-left: auto;
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

/* --------------------------------------------------------------------------
   Site card
   -------------------------------------------------------------------------- */

.site-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-height: 118px;
  padding: 17px 38px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease,
    background 0.18s ease;
}

.site-card[hidden] {
  display: none;
}

.site-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand, var(--accent)) 38%, var(--line));
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.site-card:active {
  transform: translateY(0);
}

.logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand, var(--accent));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 6px 14px -6px color-mix(in srgb, var(--brand, var(--accent)) 60%, transparent);
  user-select: none;
}

.logo.is-short {
  font-size: 16px;
}

.logo.is-long {
  font-size: 11px;
  letter-spacing: 0;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.card-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.005em;
  line-height: 1.35;
}

.card-desc {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.6;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 7px;
  margin-top: auto;
  padding-top: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border-radius: 5px;
  background: color-mix(in srgb, currentColor 11%, transparent);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-free {
  color: #157347;
}

.badge-freemium {
  color: #a15c07;
}

.badge-paid {
  color: #b02a4c;
}

.badge-open {
  color: #2563a8;
}

[data-theme="dark"] .badge-free {
  color: #5fd39b;
}

[data-theme="dark"] .badge-freemium {
  color: #f0b45a;
}

[data-theme="dark"] .badge-paid {
  color: #f4869f;
}

[data-theme="dark"] .badge-open {
  color: #7fb6f5;
}

.meta-sep {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--line-strong);
}

.access {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--faint);
  font-size: 10.5px;
  white-space: nowrap;
}

.access::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.access-cn {
  color: var(--teal);
}

.card-arrow {
  position: absolute;
  top: 15px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--faint);
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.site-card:hover .card-arrow {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Recently opened
   -------------------------------------------------------------------------- */

.recents {
  padding: 6px 0 24px;
}

.recents[hidden] {
  display: none;
}

.recents-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.recents-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.clear-recents {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 11.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.clear-recents:hover {
  color: var(--ink);
}

.recents-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.recent-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12.5px;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.recent-item:hover {
  border-color: var(--line-strong);
  background: var(--bg-elevated);
  color: var(--ink);
}

.recent-logo {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand, var(--accent));
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */

.empty {
  display: none;
  padding: 70px 24px 80px;
  text-align: center;
}

.empty.is-visible {
  display: block;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--faint);
  box-shadow: var(--shadow-sm);
}

.empty h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.empty p {
  margin: 0 auto 20px;
  max-width: 32em;
  color: var(--muted);
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  color: var(--bg);
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about {
  margin-top: 36px;
  padding: 46px 0 20px;
  border-top: 1px solid var(--line);
}

.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}

.about h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.about-lead {
  margin: 0;
  max-width: 30em;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
}

.about-lead + .about-lead {
  margin-top: 12px;
}

.criteria {
  display: grid;
  gap: 10px;
  margin: 0;
}

.criteria > div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.criteria dt {
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.criteria dd {
  margin: 0;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.65;
}

.about-note {
  margin-top: 22px;
  padding: 14px 16px;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.about-note a {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-foot {
  margin-top: 40px;
  padding: 40px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 36px;
  align-items: start;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 650;
}

.foot-brand .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 13px;
}

.foot-tagline {
  margin: 0;
  max-width: 30em;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.foot-col h3 {
  margin: 2px 0 10px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.foot-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.foot-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
}

.foot-col a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.foot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
}

.foot-bottom p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }

  .foot-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 128px;
  }

  .wrap,
  .topbar-inner,
  .filterbar-inner {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topnav a:not(.nav-cta) {
    display: none;
  }

  .hero {
    padding-top: 40px;
  }

  .hero h1 {
    font-size: clamp(38px, 10vw, 52px);
  }

  .lede {
    margin-top: 16px;
    font-size: 14.5px;
  }

  .only-desktop {
    display: none;
  }

  .search-form {
    margin-top: 24px;
  }

  .search-box {
    height: 54px;
    border-radius: 15px;
  }

  .kbd {
    display: none;
  }

  .hero-stats {
    gap: 4px 14px;
    margin-top: 22px;
    font-size: 11.5px;
  }

  .hero-stats span + span::before {
    display: none;
  }

  .filterbar {
    top: 58px;
    margin-top: 24px;
    padding: 8px 0;
  }

  .list-tools {
    justify-content: flex-start;
  }

  .toggle {
    height: 30px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  .results-head {
    padding-top: 18px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .site-card {
    min-height: 0;
    padding: 15px 34px 15px 14px;
  }

  .cat-head h2 {
    font-size: 22px;
  }

  .cat-head p {
    display: none;
  }

  .about {
    padding-top: 34px;
  }

  .foot-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 420px) {
  .brand-text small {
    display: none;
  }

  .popular {
    justify-content: flex-start;
  }

  .hero h1 {
    font-size: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --------------------------------------------------------------------------
   Noscript & 404
   -------------------------------------------------------------------------- */

.noscript-note {
  max-width: 44em;
  margin: 24px auto 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.not-found {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 760px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 64px 24px;
}

.not-found .brand {
  margin-bottom: clamp(40px, 9vh, 88px);
}

.not-found .eyebrow {
  margin-bottom: 18px;
}

.not-found h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.not-found h1 em {
  font-style: normal;
  color: var(--accent);
}

.not-found > p {
  max-width: 32em;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.site-card:focus-visible,
.recent-item:focus-visible {
  border-radius: var(--radius);
}
