:root {
  --bg: #f3f5f3;
  --surface: #fbfcfb;
  --surface-2: #e9ede9;
  --border: #d9dfda;
  --text: #1b201d;
  --text-2: #4e5852;
  --muted: #6f7a73;
  --accent: #2f6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e2efe7;
  --warn: #8a5a12;
  --warn-soft: #f5ead3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(27, 32, 29, 0.05), 0 8px 24px -16px rgba(27, 32, 29, 0.25);
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #121614;
  --surface: #181d1a;
  --surface-2: #1f2521;
  --border: #2b332e;
  --text: #e4e9e5;
  --text-2: #b2bbb5;
  --muted: #8a948d;
  --accent: #7cc39c;
  --accent-ink: #0f1a14;
  --accent-soft: #1e2f26;
  --warn: #e0b36a;
  --warn-soft: #3a2d15;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -16px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #121614;
    --surface: #181d1a;
    --surface-2: #1f2521;
    --border: #2b332e;
    --text: #e4e9e5;
    --text-2: #b2bbb5;
    --muted: #8a948d;
    --accent: #7cc39c;
    --accent-ink: #0f1a14;
    --accent-soft: #1e2f26;
    --warn: #e0b36a;
    --warn-soft: #3a2d15;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -16px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--border); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
p { margin: 0; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.5;
}
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
@media (max-width: 640px) { .wrap { width: calc(100% - 32px); } }
.muted { color: var(--muted); }
.lede { color: var(--text-2); font-size: 1.125rem; max-width: 60ch; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-block; position: relative; }
.brand-mark::after { content: ''; position: absolute; inset: 6px; border-radius: 3px; background: var(--accent-ink); opacity: 0.9; }
.site-nav { display: flex; align-items: center; gap: 20px; font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--text-2); }
.site-nav a:hover { color: var(--text); }
.theme-toggle { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); cursor: pointer; display: inline-grid; place-items: center; }
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .site-nav .optional { display: none; } .brand { font-size: 0.95rem; } .site-nav { gap: 14px; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; font-weight: 500; font-size: 0.95rem; text-decoration: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); white-space: nowrap; transition: transform 80ms ease, background-color 120ms ease; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn svg { width: 16px; height: 16px; }

/* Hero */
.hero { padding: 72px 0 48px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.hero h1 { max-width: 20ch; }
.hero .lede { margin-top: 18px; }
.ledger { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.ledger-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 0.95rem; }
.ledger-row:first-child { border-top: 0; }
.ledger-row .name { font-weight: 500; }
.ledger-row .alt { color: var(--muted); font-size: 0.875rem; }
.ledger-foot { padding: 10px 16px; background: var(--surface-2); color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--border); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 48px; } }

/* Status badge: text, not a dot */
.status { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.01em; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.status.ready { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.status.development { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

/* Sections */
section { padding: 48px 0; }
section + section { border-top: 1px solid var(--border); }
.section-head { margin-bottom: 24px; max-width: 65ch; }
.section-head p { margin-top: 8px; color: var(--text-2); }

/* Project rows */
.projects { display: grid; gap: 12px; }
.project {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) auto;
  gap: 24px;
  align-items: start;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, transform 80ms ease;
}
.project:hover { border-color: var(--accent); }
.project:active { transform: translateY(1px); }
.project .title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project .alt { color: var(--muted); margin-top: 4px; font-size: 0.95rem; }
.project .summary { color: var(--text-2); }
.project .meta { display: grid; gap: 10px; justify-items: end; text-align: right; font-size: 0.875rem; color: var(--muted); }
.avatars { display: flex; }
.avatars img { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -8px; background: var(--surface-2); }
.avatars img:first-child { margin-left: 0; }
@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; gap: 12px; }
  .project .meta { justify-items: start; text-align: left; grid-auto-flow: column; align-items: center; }
}

/* Status legend as definition rows */
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 32px; }
.legend div { padding: 14px 0; border-top: 1px solid var(--border); }
.legend .status { margin-bottom: 6px; }
.legend p { color: var(--text-2); font-size: 0.95rem; }

/* Two column prose blocks (principles, not planned) */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.split .card { padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.split ul { margin: 12px 0 0; padding-left: 18px; color: var(--text-2); }
.split li + li { margin-top: 8px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* Project page */
.page-head { padding: 56px 0 36px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; align-items: end; }
.page-head .crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 16px; }
.page-head .crumbs a { text-decoration: none; }
.page-head h1 { margin-top: 8px; }
.page-head .tagline { color: var(--text-2); font-size: 1.125rem; margin-top: 14px; max-width: 55ch; }
.facts { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; font-size: 0.95rem; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; text-align: right; }
.facts dd a { text-decoration: none; }
@media (max-width: 860px) { .page-head { grid-template-columns: 1fr; gap: 24px; padding-top: 36px; } }

.detail { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 48px; }
.detail h2 { margin-bottom: 14px; }
.detail .block + .block { margin-top: 40px; }
.detail ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.detail li + li { margin-top: 8px; }
.detail p + p { margin-top: 12px; }
.aside .block + .block { margin-top: 32px; }
.aside h3 { margin-bottom: 12px; }
.contrib { display: grid; gap: 10px; }
.contrib a { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-decoration: none; }
.contrib a:hover { border-color: var(--accent); }
.contrib img { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); }
.contrib .count { color: var(--muted); font-size: 0.875rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 0.82rem; color: var(--text-2); }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; gap: 36px; } }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0 48px; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
