:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #6a6862;
  --line: #e6e2d9;
  --accent: #0b6b45;
  --accent-ink: #ffffff;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111211;
    --surface: #181a18;
    --text: #ebeae5;
    --muted: #9b9a93;
    --line: #2a2c29;
    --accent: #5cc995;
    --accent-ink: #0c1a12;
  }
}

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

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

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

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 64px 20px 40px; }

.hero { display: flex; gap: 28px; align-items: center; }
.avatar {
  width: 120px; height: 120px; flex: none;
  border-radius: 50%; object-fit: cover;
  background: var(--line);
  box-shadow: 0 0 0 1px var(--line);
}
h1 {
  margin: 0 0 6px;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 44px; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em;
}
.tagline { margin: 0; color: var(--muted); font-size: 18px; }

.social { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; padding: 0; list-style: none; }
.social a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
  font-size: 15px; text-decoration: none;
  transition: border-color .15s ease;
}
.social a:hover { border-color: var(--text); }
.social svg { width: 16px; height: 16px; flex: none; }
.social a.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.social a.primary:hover { filter: brightness(1.08); }

section { margin-top: 60px; }
h2 {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}

.bio p { margin: 0 0 1em; }
.bio p:last-child { margin-bottom: 0; }

.articles { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.articles li { border-bottom: 1px solid var(--line); }
.articles a { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 14px 0; text-decoration: none; }
.articles .title { font-weight: 500; }
.articles a:hover .title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.articles .meta { flex: none; color: var(--muted); font-size: 14px; white-space: nowrap; }

.more { display: inline-block; margin-top: 18px; color: var(--accent); font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }

.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.card {
  display: flex; flex-direction: column; height: 100%;
  padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--text); transform: translateY(-2px); }
.card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card .name { font-weight: 600; font-size: 18px; }
.card .arrow { color: var(--muted); transition: transform .15s ease, color .15s ease; }
.card:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }
.card .domain { color: var(--accent); font-size: 14px; }
.card p { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

.contact p { margin: 0 0 18px; }

footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  margin-top: 64px; padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

.notfound { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.notfound p { color: var(--muted); }

@media (max-width: 600px) {
  .wrap { padding: 40px 16px 32px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 18px; }
  .avatar { width: 96px; height: 96px; }
  h1 { font-size: 36px; }
  section { margin-top: 48px; }
  .projects { grid-template-columns: 1fr; }
  .articles a { flex-direction: column; gap: 2px; }
}

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