:root {
  color-scheme: light dark;
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1f1d1a;
  --muted: #6b665f;
  --border: #e4e0da;
  --accent: #8c2f24;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --surface: #1f1e1c;
    --text: #ece9e4;
    --muted: #a39d94;
    --border: #34312d;
    --accent: #e08a7a;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 64rem;
  padding: 2.5rem 1rem 2rem;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  flex: none;
  border-radius: 12px;
}

h1 {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.2;
}

.intro {
  margin: 0.5rem 0 0.75rem;
  max-width: 44rem;
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-weight: 600;
}

.lead {
  margin: 1.75rem 0 0;
  color: var(--muted);
}

h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.25rem;
}

.count {
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.sites {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.site-title {
  font-weight: 600;
  text-decoration: none;
}

.site-title:hover,
.site-title:focus-visible {
  text-decoration: underline;
}

.site-meta {
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.site-meta a {
  color: inherit;
}

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

footer a {
  color: inherit;
}

@media (max-width: 30rem) {
  header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .logo {
    width: 48px;
    height: 48px;
  }
}
