:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --fg: #1f2328;
  --fg-muted: #57606a;
  --border: #d8dee4;
  --accent: #0b5fff;
  --max: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --bg-soft: #171b21;
    --fg: #e6e9ee;
    --fg-muted: #9aa4b2;
    --border: #262c35;
    --accent: #7aa2ff;
  }
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  padding: 2rem 1.25rem 4rem;
}

a { color: var(--accent); }

/* ---- header ---- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  max-width: 62rem;
  margin: 0 auto 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--fg);
  text-decoration: none;
}

.site-nav { display: flex; gap: 1.25rem; }
.site-nav a { text-decoration: none; color: var(--fg-muted); }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current] { color: var(--fg); font-weight: 600; }

main { max-width: 62rem; margin: 0 auto; }

/* ---- home ---- */

.hero { max-width: var(--max); margin-bottom: 3rem; }
.hero h1 { font-size: 2.25rem; line-height: 1.2; margin-bottom: 1rem; }
.hero p { margin-bottom: 1rem; }
.lede { font-size: 1.15rem; color: var(--fg-muted); }
.cta a { font-weight: 600; text-decoration: none; }
.cta a:hover { text-decoration: underline; }

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.card {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  text-decoration: none;
  color: inherit;
}

.card:hover { border-color: var(--accent); }
.card h2 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.card p { color: var(--fg-muted); font-size: 0.95rem; }

/* ---- section layout (programming) ---- */

.section-layout {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
  align-items: start;
}

@media (max-width: 44rem) {
  .section-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .section-nav { flex-direction: row; flex-wrap: wrap; }
}

.section-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: sticky;
  top: 2rem;
  font-size: 0.95rem;
}

.section-nav a { text-decoration: none; color: var(--fg-muted); }
.section-nav a:hover { color: var(--accent); }
.section-nav a[aria-current] { color: var(--fg); font-weight: 600; }

/* ---- prose ---- */

.prose { max-width: var(--max); }
.prose h1 { font-size: 1.9rem; line-height: 1.25; margin-bottom: 1rem; }
.prose h2 { font-size: 1.3rem; margin: 2.25rem 0 0.6rem; }
.prose h3 { font-size: 1.05rem; margin: 1.75rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin-bottom: 1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.35rem; }

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.25rem 0;
  color: var(--fg-muted);
}

.project-list { list-style: none; padding-left: 0; }
.project-list > li { margin-bottom: 1.75rem; }
.project-list h2 { margin-top: 0; }

code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}

pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code { background: none; border: 0; padding: 0; }

/* ---- footer ---- */

.site-footer {
  max-width: 62rem;
  margin: 4rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.9rem;
}
