/* Akinwale Notes — public site styles. Tokens from pen.dev design. */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-muted: #FAFAFA;
  --portrait-bg: #F4F4F0;
  --avatar-bg: #E5E5E0;
  --text: #111111;
  --muted: #787875;
  --border: #EFEFEA;
  --code-bg: #FAFAFA;
  --code-header: #A1A1AA;
  --note-text: #20388F;
  --radius: 4px;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
html[data-theme="dark"] {
  --bg: #0E0E0E;
  --surface: #141414;
  --surface-muted: #141414;
  --portrait-bg: #141414;
  --avatar-bg: #2A2A2A;
  --text: #F3F3F0;
  --muted: #8A8A86;
  --border: #222222;
  --code-bg: #141414;
  --code-header: #8A8A86;
  --note-text: #A9B8F0;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; }
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--text); color: var(--bg);
  padding: 8px 14px; z-index: 100; border-radius: 0 0 var(--radius) 0;
  font-size: 13px;
}
.skip-link:focus { left: 0; }

.wrap { max-width: 1188px; margin: 0 auto; padding: 0 24px; width: 100%; }
.reading { max-width: 680px; margin: 0 auto; width: 100%; }

/* ---------- Nav ---------- */
.site-nav { border-bottom: 1px solid var(--border); height: 64px; }
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.wordmark { font-family: var(--font-serif); font-size: 18px; font-weight: 500; letter-spacing: -0.2px; text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { font-size: 13px; color: var(--muted); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text); font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.icon-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius); padding: 0;
}
.icon-btn:hover { color: var(--text); background: var(--surface-muted); }
.icon-btn svg { width: 15px; height: 15px; }
html[data-theme="dark"] .only-light { display: none; }
html:not([data-theme="dark"]) .only-dark { display: none; }

/* ---------- Hero ---------- */
.page-main { flex: 1; }
.page-main .wrap { padding-top: 56px; padding-bottom: 72px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 48px; min-height: 340px; }
.hero-copy { max-width: 640px; }
.hero-copy h1 { font-family: var(--font-serif); font-weight: 500; font-size: 44px; line-height: 1.12; letter-spacing: -0.8px; margin-bottom: 16px; }
.hero-copy p { color: var(--muted); font-size: 16px; line-height: 1.65; max-width: 600px; }
.portrait { width: 260px; height: 320px; flex-shrink: 0; border-radius: var(--radius); overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait-placeholder {
  width: 100%; height: 100%; background: var(--portrait-bg);
  border: 1px dashed var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center;
  color: var(--muted);
}
.portrait-placeholder svg { width: 24px; height: 24px; }
.portrait-placeholder span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.6px; }

/* ---------- Articles list ---------- */
.articles-section { margin-top: 64px; }
.section-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.4px;
  color: var(--muted); text-transform: uppercase; margin-bottom: 8px;
}
.article-row {
  display: block; text-decoration: none; padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.article-row:first-of-type { border-top: none; }
.article-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.article-meta span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.4px; color: var(--muted); text-transform: uppercase; }
.article-meta .meta-right { letter-spacing: 0.2px; white-space: nowrap; }
.article-row-title { font-family: var(--font-serif); font-weight: 500; font-size: 20px; letter-spacing: -0.2px; margin-bottom: 6px; }
.article-row p { color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ---------- Empty state ---------- */
.empty-state { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 48px 0; }
.empty-state svg { width: 20px; height: 20px; color: var(--muted); margin-bottom: 10px; }
.empty-state h2 { font-family: var(--font-serif); font-weight: 500; font-size: 26px; letter-spacing: -0.3px; margin-bottom: 10px; }
.empty-state p { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 520px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; margin-top: 72px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; padding-top: 0; padding-bottom: 0; }
.footer-identity { display: flex; align-items: center; gap: 12px; }
.footer-identity strong { font-family: var(--font-serif); font-weight: 500; font-size: 14px; }
.footer-identity span { color: var(--muted); font-size: 12px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); font-size: 12px; text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ---------- Article page ---------- */
.article-head { padding: 56px 0 32px; }
.article-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.4px; color: var(--muted); text-transform: uppercase; margin-bottom: 14px; }
.article-head h1 { font-family: var(--font-serif); font-weight: 500; font-size: 40px; line-height: 1.15; letter-spacing: -0.8px; margin-bottom: 14px; }
.article-summary { color: var(--muted); font-size: 16px; line-height: 1.6; margin-bottom: 14px; }
.article-byline { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3px; }
.article-byline .by-author { color: var(--text); }
.article-byline span { color: var(--muted); text-transform: uppercase; }

.toc { display: none; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 0 8px; }
.toc-toggle {
  width: 100%; background: none; border: none; cursor: pointer; color: var(--text);
  display: flex; justify-content: space-between; align-items: center; padding: 14px 0;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.8px;
}
.toc-toggle svg { width: 16px; height: 16px; color: var(--muted); transition: transform 0.15s; }
.toc.open .toc-toggle svg { transform: rotate(180deg); }
.toc-list { list-style: none; padding: 0 0 14px; display: none; }
.toc.open .toc-list { display: block; }
.toc-list a { display: block; font-size: 13px; color: var(--muted); text-decoration: none; padding: 4px 0; }
.toc-list a:hover { color: var(--text); }
.toc-list .toc-h3 { padding-left: 16px; }

.prose-wrap { border-top: 1px solid var(--border); padding: 32px 0 64px; }
.prose { font-family: var(--font-serif); font-size: 18px; line-height: 1.75; }
.prose > * + * { margin-top: 22px; }
.prose p.lead { font-size: 18px; }
.prose h2 { font-size: 24px; font-weight: 500; letter-spacing: -0.3px; line-height: 1.3; scroll-margin-top: 24px; }
.prose h3 { font-size: 20px; font-weight: 500; scroll-margin-top: 24px; }
.prose a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li + li { margin-top: 6px; }
.prose blockquote { border-left: 2px solid var(--text); padding: 4px 0 4px 20px; font-style: italic; font-size: 19px; line-height: 1.6; }
.prose figure { margin: 0; }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); }
.prose figcaption { font-family: var(--font-sans); font-size: 12px; color: var(--muted); margin-top: 8px; }
.codeblock { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; font-family: var(--font-mono); }
.codeblock-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.codeblock-head .lang { font-size: 10px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--code-header); }
.copy-code-btn {
  background: none; border: none; cursor: pointer; color: var(--code-header);
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 11px; padding: 2px 4px;
}
.copy-code-btn:hover { color: var(--text); }
.copy-code-btn svg { width: 13px; height: 13px; }
.codeblock pre { margin: 0; overflow-x: auto; }
.codeblock code { font-size: 12px; line-height: 1.55; font-family: var(--font-mono); }
.callout { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; font-family: var(--font-sans); }
.callout svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--text); }
.callout strong { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.8px; margin-bottom: 5px; }
.callout p { font-size: 14px; line-height: 1.5; margin: 0; }
.callout.note p { color: var(--note-text); }
.prose table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); font-family: var(--font-sans); font-size: 13px; }
.prose th, .prose td { text-align: left; padding: 0 12px; height: 44px; border-bottom: 1px solid var(--border); }
.prose thead th { background: var(--code-bg); font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.prose tbody tr:last-child th, .prose tbody tr:last-child td { border-bottom: none; }

.article-actions { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; padding: 20px 0; margin-top: 8px; }
.btn-outline {
  background: none; border: 1px solid var(--border); border-radius: 3px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
  font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; font-family: var(--font-sans);
}
.btn-outline:hover { border-color: var(--text); }
.btn-outline svg { width: 15px; height: 15px; }
.btn-outline .btn-status { font-weight: 400; color: var(--muted); }

.author-bio { display: flex; gap: 18px; padding: 26px 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-bg); color: var(--muted); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-size: 15px; font-weight: 600; }
.author-bio h3 { font-family: var(--font-serif); font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.author-bio p { color: var(--muted); font-size: 14px; line-height: 1.5; font-family: var(--font-sans); }

.related { border-top: 1px solid var(--border); padding: 26px 0; }
.related h3 { font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: 0.4px; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.related a { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 600; font-family: var(--font-sans); }
.related a span:last-child { font-weight: 400; }
.prevnext { display: flex; justify-content: space-between; gap: 24px; padding: 20px 0; }
.prevnext a { color: var(--muted); font-size: 13px; line-height: 1.6; text-decoration: none; max-width: 45%; }
.prevnext a:hover { color: var(--text); }
.prevnext .next { text-align: right; margin-left: auto; }
.back-link { display: inline-block; color: var(--muted); font-size: 14px; text-decoration: none; margin-top: 8px; }
.back-link:hover { color: var(--text); }

/* ---------- Error pages ---------- */
.error-main { text-align: left; padding: 80px 0; }
.error-main h1 { font-family: var(--font-serif); font-size: 40px; font-weight: 500; margin-bottom: 12px; }
.error-main p { color: var(--muted); margin-bottom: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .portrait { display: none; }
  .hero { min-height: 0; }
  .page-main .wrap { padding-top: 48px; }
}
@media (max-width: 700px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .hero-copy h1 { font-size: 32px; line-height: 1; letter-spacing: -0.6px; }
  .hero-copy p { font-size: 15px; }
  .article-head { padding: 46px 0 28px; }
  .article-head h1 { font-size: 32px; line-height: 1.1; }
  .article-summary { font-size: 15px; }
  .toc { display: block; }
  .prose { font-size: 18px; }
  .prose blockquote { border-left-width: 3px; padding-left: 18px; }
  .prevnext a { max-width: 48%; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; gap: 12px; }
}
