:root {
  color-scheme: dark light;
  --bg: #0d1117;
  --panel: #111821;
  --text: #e6edf3;
  --muted: #8b949e;
  --border: #30363d;
  --card-hover-border: #4a79ac;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --code-bg: #161b22;
  --good-bg: #16351f;
  --good-text: #7ee787;
  --work-bg: #3b2605;
  --work-text: #f2b84b;
  --limit-bg: #3a1417;
  --limit-text: #ff7b72;
  --paid-bg: #30363d;
  --paid-text: #c9d1d9;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #172033;
    --muted: #617084;
    --border: #d6dde8;
    --card-hover-border: #78a9e6;
    --accent: #0969da;
    --accent-hover: #064c9d;
    --code-bg: #eef2f7;
    --good-bg: #dcfce7;
    --good-text: #166534;
    --work-bg: #ffedd5;
    --work-text: #9a3412;
    --limit-bg: #fee2e2;
    --limit-text: #991b1b;
    --paid-bg: #e5e7eb;
    --paid-text: #374151;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0 auto;
  max-width: 820px;
  padding: 32px 20px;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

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

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 56px;
  color: var(--muted);
  font-size: 0.92rem;
}

.wordmark {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.site-header {
  margin: 24px 0 40px;
}

.site-header h1,
.entry-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 8vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.site-header p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.entry-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.badge.good-fit {
  background: var(--good-bg);
  color: var(--good-text);
}

.badge.needs-work {
  background: var(--work-bg);
  color: var(--work-text);
}

.badge.hardware-limit {
  background: var(--limit-bg);
  color: var(--limit-text);
}

.badge.reject-paid {
  background: var(--paid-bg);
  color: var(--paid-text);
}

.cards {
  display: grid;
  gap: 16px;
}

.card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  transition: border-color 140ms ease, transform 140ms ease;
}

.card:hover {
  border-color: var(--card-hover-border);
  transform: translateY(-2px);
}

.card-meta,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.card-meta time,
.source,
.source-link,
.empty {
  color: var(--muted);
}

.card h2 {
  margin: 12px 0 6px;
  font-size: 1.35rem;
  line-height: 1.25;
}

.card h2 a {
  color: var(--text);
  text-decoration: none;
}

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

.card p {
  margin: 0 0 16px;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

.source {
  margin: 0 0 16px;
}

article {
  margin-top: 28px;
}

article h2,
article h3 {
  margin-top: 32px;
  line-height: 1.25;
}

article p,
article ul,
article ol,
article table,
article pre {
  margin: 0 0 18px;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

code {
  padding: 0.15em 0.35em;
  border-radius: 5px;
  background: var(--code-bg);
  font-size: 0.92em;
}

pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
}

pre code {
  padding: 0;
  background: transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel);
}

tr:last-child td {
  border-bottom: 0;
}

footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 560px) {
  body {
    padding: 24px 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 40px;
  }
}
