:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --text: #171717;
  --text-muted: #737373;
  --border: #e5e5e5;
  --accent: #5b5bd6;
  --max-width: 960px;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --text: #ededed;
  --text-muted: #a3a3a3;
  --border: #262626;
  --accent: #8b8bff;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.65;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}

header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  font-size: 16px;
}

header nav {
  display: flex;
  gap: 22px;
  align-items: center;
}

header nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 15px;
  transition: color 0.15s;
}

header nav a:hover { color: var(--text); }

#theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}

#theme-toggle:hover { color: var(--text); }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 24px 80px;
}

h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 56px 0 18px;
}

h3 { font-size: 17px; font-weight: 500; margin-bottom: 4px; }

article h2 {
  text-transform: none;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 36px 0 12px;
}

p { margin-bottom: 16px; }

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

/* Landing */
.intro { padding-top: 24px; }
.lead { font-size: 18px; line-height: 1.6; margin-bottom: 32px; }
.primary-links { display: flex; flex-direction: column; gap: 8px; }
.primary-links a { font-size: 16px; }

/* Project list */
.subtitle { color: var(--text-muted); margin-bottom: 8px; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

.card {
  display: block;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-elevated);
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }

.card img {
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  object-position: left center;
  border-radius: 6px;
  margin-bottom: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.card-pitch {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.status-active { background: rgba(34,197,94,0.12); color: #22c55e; }
.status-maintained { background: rgba(59,130,246,0.12); color: #3b82f6; }
.status-paused { background: rgba(234,179,8,0.12); color: #eab308; }
.status-prototype { background: rgba(168,85,247,0.12); color: #a855f7; }
.status-archived { background: rgba(115,115,115,0.15); color: var(--text-muted); }

.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tags span {
  font-size: 11px;
  color: var(--text-muted);
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.footnote { margin-top: 56px; font-size: 14px; color: var(--text-muted); }

/* Project detail */
.back { font-size: 14px; margin-bottom: 16px; }
.back a { color: var(--text-muted); text-decoration: none; }
.back a:hover { color: var(--text); }

.pitch {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.project-meta {
  font-size: 14px;
  color: var(--text-muted);
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.project-meta strong { color: var(--text); font-weight: 500; }

article ul { margin: 0 0 16px 20px; }
article li { margin-bottom: 6px; }
article img {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: contain;
  background: var(--bg);
  margin: 24px auto;
  border-radius: 8px;
}

/* Footer */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 48px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}
footer p { margin-bottom: 6px; }
footer .now { font-style: italic; opacity: 0.85; margin-bottom: 14px; }
footer a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
footer a:hover { color: var(--text); }
footer .sep { margin: 0 6px; opacity: 0.5; }

/* Stack */
.stack-list {
  list-style: none;
  margin: 0 0 12px 0;
  padding: 0;
}
.stack-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  line-height: 1.5;
}
.stack-list li:last-child { border-bottom: none; }
.stack-list strong {
  color: var(--text);
  font-weight: 500;
  margin-right: 4px;
}

/* Cards without hero image — keep them visually coherent */
.card:not(:has(img)) {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card:not(:has(img)) .card-body {
  padding-top: 4px;
}
