:root {
  --bg: #faf9f6;
  --bg-raised: #ffffff;
  --text: #1c1f24;
  --text-muted: #5c6270;
  --border: #e6e3da;
  --accent: #0d6e63;
  --accent-ink: #ffffff;
  --pill-bg: #eef2f0;
  --max: 760px;
  --max-wide: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1214;
    --bg-raised: #171b1e;
    --text: #e7e6e1;
    --text-muted: #9aa0a6;
    --border: #2a2f33;
    --accent: #4fd1c1;
    --accent-ink: #06201c;
    --pill-bg: #1e2427;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-size: 17px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}
.brand { display: inline-flex; }
.brand img {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 50%;
}
.brand:hover { text-decoration: none; opacity: 0.85; }

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.site-header nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.site-header nav a:hover { color: var(--text); text-decoration: none; }
.site-header nav a.active { color: var(--accent); }

main {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* Hero / About */
.hero { max-width: var(--max); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 0 0.75rem;
}
.hero h1 {
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
.hero .role {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}
.tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
  list-style: none;
  padding: 0;
}
.pill {
  display: inline-block;
  background: var(--pill-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.tagline-signature { margin-top: 2rem; }

.prose p { margin: 0 0 1.25rem; }
.prose { max-width: var(--max); }

.cta { margin-top: 1rem; }
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
}
.button:hover { text-decoration: none; opacity: 0.9; }

/* Article prose */
article.prose h1 {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
}
article.prose h2, article.prose h3 {
  font-size: 1.25rem;
  margin: 2.2rem 0 0.9rem;
  letter-spacing: -0.01em;
}
article.prose h2:first-child, article.prose h3:first-child { margin-top: 0; }
article.prose strong { font-weight: 650; }
article.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
article.prose ol, article.prose ul { padding-left: 1.3rem; }
article.prose li { margin: 0 0 0.5rem; }

/* References list, following the References heading */
article.prose h2 + ol,
article.prose h2 + ul {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.reading-time {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.toc {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin: 0 0 2.5rem;
  max-width: var(--max);
}
.toc-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0 0 0.4rem; font-size: 0.92rem; }
.toc li:last-child { margin-bottom: 0; }
.toc li.toc-h3 { padding-left: 1rem; }
.toc a { color: var(--text); }
.toc a:hover { color: var(--accent); }

.article-body p, .article-body li {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
}

.page-header { max-width: var(--max); margin-bottom: 2.5rem; }
.page-header h1 { font-size: 2rem; margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.page-header .subtitle { color: var(--text-muted); font-size: 1.1rem; margin: 0; }

/* Ideas listing */
.idea-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: var(--max);
  border-top: 1px solid var(--border);
}
.idea-card {
  border-bottom: 1px solid var(--border);
  padding: 1.6rem 0;
}
.idea-card a { color: var(--text); text-decoration: none; }
.idea-card .idea-title {
  font-size: 1.2rem;
  font-weight: 650;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.idea-card a:hover .idea-title { color: var(--accent); }
.idea-card .idea-excerpt {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.97rem;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}
.article-nav a { color: var(--text); font-weight: 600; }
.article-nav .nav-label {
  display: block;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}
.article-nav .next { text-align: right; margin-left: auto; }
.back-link { display: inline-block; margin-bottom: 1.5rem; font-size: 0.92rem; }

/* Technology page */
.tech-section { max-width: var(--max-wide); }
.tech-section h2 {
  font-size: 1.15rem;
  margin: 2.2rem 0 1rem;
}
.tech-section h2:first-child { margin-top: 0; }
.tech-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 2.5rem;
}
.tech-group h3 {
  font-size: 1rem;
  margin: 0 0 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}
.pill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Publications */
.pub-section { max-width: var(--max); }
.pub-section h2 { font-size: 1.15rem; margin: 2.5rem 0 1rem; }
.pub-section h2:first-child { margin-top: 0; }
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list li {
  margin: 0 0 1.1rem;
  padding-left: 1.4rem;
  text-indent: -1.4rem;
  font-size: 0.96rem;
  color: var(--text-muted);
}
.pub-list li strong { color: var(--text); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
}
.site-footer p { margin: 0 0 0.35rem; font-size: 0.9rem; }
.site-footer .muted { color: var(--text-muted); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  main { padding: 2rem 1.25rem 3rem; }
  .hero h1 { font-size: 1.9rem; }
  .tech-groups { grid-template-columns: 1fr; }
}
