/* Design tokens. Change these to re-theme the whole site. */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --border: #e2e2dd;
  --accent: #e8590c;
  --accent-contrast: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 14px rgb(0 0 0 / 4%);
  --max-width: 1080px;

  --status-live: #2f9e44;
  --status-beta: #1c7ed6;
  --status-wip: #f08c00;
  --status-archived: #868e96;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131315;
    --surface: #1c1c1f;
    --text: #f2f2f3;
    --muted: #9a9aa2;
    --border: #2c2c31;
    --accent: #ff7a2f;
    --accent-contrast: #131315;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: inherit; }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 800;
}
.nav { display: flex; gap: 20px; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--text); }

/* Hero */
.hero { padding: 56px 0 28px; }
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.tagline { margin: 0; color: var(--muted); font-size: 1.1rem; }

/* Controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}
.search { flex: 1 1 240px; }
.search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.search input:focus-visible,
.chip:focus-visible,
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

/* Project cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 56px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-icon { font-size: 1.7rem; line-height: 1; }
.card h2 { margin: 0; font-size: 1.1rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; flex: 1; }
.card .arrow { color: var(--muted); }
.card:hover .arrow { color: var(--accent); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.badge::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--status-color, var(--muted));
}
.badge[data-status="live"] { --status-color: var(--status-live); }
.badge[data-status="beta"] { --status-color: var(--status-beta); }
.badge[data-status="wip"] { --status-color: var(--status-wip); }
.badge[data-status="archived"] { --status-color: var(--status-archived); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.75rem;
}

.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}
