:root {
  --max: 64rem;
  --bg: #fafaf7;
  --fg: #1a1a1a;
  --muted: #5a5a5a;
  --accent: #2a5d50;
  --accent-fg: #fff;
  --card: #fff;
  --border: #e5e5e0;
  --tag-bg: #eef0ec;
  --tag-fg: #2a5d50;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --fg: #ececec;
    --muted: #a0a4a8;
    --accent: #6fbfa8;
    --accent-fg: #0a0d0f;
    --card: #1c2025;
    --border: #2a2f35;
    --tag-bg: #232a2f;
    --tag-fg: #6fbfa8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--tag-bg);
  color: var(--tag-fg);
  padding: 0.05em 0.4em;
  border-radius: 3px;
}

.site-header,
main,
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  padding-top: 4rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0 0 0.5rem;
  line-height: 0;
}
.site-header h1 img {
  display: block;
  height: auto;
  width: clamp(12rem, 28vw, 18rem);
  max-width: 100%;
}
@media (prefers-color-scheme: dark) {
  .site-header h1 img { filter: invert(1); }
}

.tagline {
  font-size: 1.15rem;
  margin: 0 0 1.25rem;
  color: var(--fg);
}

.intro {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 42rem;
}

.site-header nav {
  display: flex;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--muted);
}

main { padding-top: 2.5rem; padding-bottom: 3rem; }

.group { margin-bottom: 3.5rem; }

.group-header { margin-bottom: 1.5rem; }
.group-header h2 {
  font-size: 1.5rem;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.group-header p { margin: 0; color: var(--muted); max-width: 42rem; }

.projects {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
}

.project {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.project header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: -0.01em;
  word-break: break-all;
}

.project header h3 a { color: var(--fg); }
.project header h3 a:hover { color: var(--accent); }

.project p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tags li {
  font-size: 0.78rem;
  background: var(--tag-bg);
  color: var(--tag-fg);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.links { font-size: 0.9rem; margin-top: auto; }

footer {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  padding-bottom: 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

footer p { margin: 0 0 0.5rem; }
footer .copy { margin-top: 1rem; }
.alt-domains code { font-size: 0.95em; }

/* About page */
.profile-header { padding-top: 2.5rem; }
.profile-header .back { margin: 0 0 1.5rem; font-size: 0.95rem; }
.profile-header h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.15;
}

main.profile {
  max-width: 42rem;
  padding-bottom: 4rem;
}

.profile .bio p {
  font-size: 1.05rem;
  margin: 0 0 1.1rem;
  color: var(--fg);
}

.profile .highlights {
  margin: 2rem 0;
  display: grid;
  gap: 0.75rem 1.5rem;
  grid-template-columns: max-content 1fr;
}
.profile .highlights > div { display: contents; }
.profile .highlights dt {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: center;
}
.profile .highlights dd { margin: 0; align-self: center; }

.profile-links {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  gap: 0.5rem 1.25rem;
  flex-wrap: wrap;
  font-size: 1rem;
}
.profile-links li::before { content: ""; }
