:root {
  --bg: #ffffff;
  --surface: #f5f5f5;
  --text: #111111;
  --text-muted: #555555;
  --accent: #0066cc;
  --tag-bg: #e8e8e8;
  --tag-text: #333333;
  --radius: 8px;
  --gap: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1e1e1e;
    --text: #eeeeee;
    --text-muted: #999999;
    --accent: #4d9fff;
    --tag-bg: #2a2a2a;
    --tag-text: #cccccc;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 2rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* Header */
header {
  margin-bottom: 3rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

header p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

nav a:hover {
  text-decoration: underline;
}

/* Filters */
#filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-tag {
  background: var(--surface);
  border: 1px solid var(--tag-bg);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  color: var(--text);
}

.filter-tag:hover {
  border-color: var(--accent);
}

.filter-tag--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Grid */
#project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 1.5rem;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.card--clickable {
  cursor: pointer;
}

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

.card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.card-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}

.card-links a:hover {
  text-decoration: underline;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* Error */
.error {
  color: #cc0000;
}
