@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --card: #ffffff;
  --ink: #18181b;
  --body: #3f3f46;
  --muted: #71717a;
  --rule: #e7e7e4;
  --chip: #f4f4f2;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --dark-card: #18181b;
  --dark-ink: #fafafa;
  --dark-body: #d4d4d8;
  --dark-rule: #27272a;
  --shadow: 0 8px 24px rgba(0, 0, 0, .06);
  --radius: 22px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
/* Set on <html> by the script in the page head: light unless the visitor
   picked dark with the toggle. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0c0e;
  --card: #17171a;
  --ink: #f4f4f5;
  --body: #c4c4cc;
  --muted: #8b8b94;
  --rule: #26262b;
  --chip: #1f1f23;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, .12);
  --dark-card: #f4f4f5;
  --dark-ink: #18181b;
  --dark-body: #3f3f46;
  --dark-rule: #e4e4e7;
  --shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 15px/1.6 "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; }

/* Navigation */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.nav .home { color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.nav .home img { width: 28px; height: 28px; border-radius: 8px; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 4px; background: var(--card); border: 1px solid var(--rule); border-radius: 999px; }
.nav ul a { display: block; padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: color .15s, background .15s; }
.nav ul a:hover { color: var(--ink); }
.nav ul a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.nav .end { display: flex; align-items: center; gap: 8px; }
.theme-toggle { width: 38px; height: 38px; flex: none; display: grid; place-items: center; padding: 0; cursor: pointer; color: var(--muted); background: var(--card); border: 1px solid var(--rule); border-radius: 999px; transition: color .15s; }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon, [data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* Bento grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(150px, auto); gap: 14px; }
.c { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden; min-width: 0; }
a.c { display: block; transition: transform .15s, box-shadow .15s; }
a.c:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.label { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; display: flex; justify-content: space-between; gap: 12px; }
.label a:hover { color: var(--ink); }

.hero { grid-column: span 4; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: center; padding: 36px; }
.hero-text { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; align-self: flex-start; font-weight: 500; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hero h1 { color: var(--ink); font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: -.035em; font-weight: 600; margin: 0 0 16px; max-width: 660px; }
.hero h1 a { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .12em; transition: color .15s; }
.hero h1 a:hover { color: var(--accent); }

/* Terminal that types the focus areas */
.term { align-self: flex-start; width: min(100%, 560px); background: #111113; border: 1px solid #27272a; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); font-family: var(--mono); }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #1c1c1f; border-bottom: 1px solid #27272a; }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 8px; font-size: 11.5px; color: #8b8b94; }
.term-line { margin: 0; padding: 14px 16px; min-height: 3.1em; font-size: 14.5px; line-height: 1.5; color: #e4e4e7; }
.term .prompt { color: #2dd4bf; font-weight: 600; }
.term .caret { display: inline-block; width: .55em; height: 1.1em; margin-left: 2px; vertical-align: -.18em; background: #2dd4bf; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero p { font-size: 17px; max-width: 580px; margin: 0; }

/* Circos figure: always on white, like a printed figure */
.figure { margin: 0; padding: 14px 14px 12px; background: #fff; border: 1px solid #e7e7e4; border-radius: 18px; }
.figure img { display: block; width: 100%; height: auto; }
.figure figcaption { margin-top: 8px; text-align: center; font-size: 13px; color: #52525b; }
.figure figcaption b { color: #18181b; font-weight: 600; }

.paper { grid-column: span 2; }
.paper h2 { color: var(--ink); font-size: 19px; line-height: 1.35; letter-spacing: -.01em; margin: 0 0 10px; font-weight: 600; }
.paper .v { font-size: 13px; color: var(--muted); }

.stat .big { display: block; color: var(--ink); font-size: 44px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 14px; }
.stat .pair { display: flex; gap: 22px; }
.stat .pair > div { min-width: 0; }

.focus { grid-column: span 2; background: var(--dark-card); color: var(--dark-body); border-color: var(--dark-card); display: flex; flex-direction: column; }
.focus .label { color: var(--muted); }
.focus ul { margin: 0; padding: 0; list-style: none; }
.focus li { padding: 11px 0; border-top: 1px solid var(--dark-rule); font-size: 15px; }
.focus li:first-child { border-top: 0; }
.focus li b { color: var(--dark-ink); font-weight: 500; }
.tools { margin: auto 0 0; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.tools span { font-family: var(--mono); font-size: 12px; color: var(--dark-ink); border: 1px solid var(--dark-rule); border-radius: 999px; padding: 3px 10px; }

.recent { grid-column: span 2; }
.recent ol { margin: 0; padding: 0; list-style: none; }
.recent li { border-top: 1px solid var(--rule); }
.recent li:first-child { border-top: 0; }
.recent li a { display: flex; gap: 14px; padding: 9px 0; font-size: 14px; color: var(--ink); line-height: 1.45; }
.recent li a:hover { color: var(--accent); }
.recent li .y { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.recent li .t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }

.post-card h2 { color: var(--ink); font-size: 17px; line-height: 1.35; margin: 0 0 6px; font-weight: 600; }
.post-card p { margin: 0; font-size: 14px; color: var(--muted); }

.contact { grid-column: span 2; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.contact .email { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 16px; font-weight: 500; font-size: 14px; max-width: 100%; overflow-wrap: anywhere; }
.contact .email:hover { opacity: .9; }
.pills { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pills a { border: 1px solid var(--rule); border-radius: 14px; padding: 12px 6px; text-align: center; font-size: 13px; font-weight: 500; color: var(--ink); background: var(--chip); transition: border-color .15s; }
.pills a:hover { border-color: var(--ink); }

.arrow { color: var(--muted); }

/* Inner pages */
.page-head { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 36px; margin-bottom: 14px; }
.page-head h1 { color: var(--ink); font-size: clamp(30px, 4vw, 42px); letter-spacing: -.03em; line-height: 1.1; margin: 0 0 10px; font-weight: 600; }
.page-head p { margin: 0; max-width: 680px; }
.page-head .tag + h1, .article .tag + h1 { margin-top: 18px; }
.not-found { text-align: center; }
.not-found img { display: block; width: 100%; max-width: 480px; margin: 0 auto 28px; border-radius: 16px; }
.not-found p { margin: 0 auto; }
.metrics { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 24px; }
.metrics b { display: block; color: var(--ink); font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metrics span { color: var(--muted); font-size: 13px; }
.note { font-size: 13px; color: var(--muted); margin-top: 16px !important; }
.note a, .prose a, .pub-meta a, .page-head p a { color: var(--accent); }
.note a:hover, .prose a:hover { text-decoration: underline; text-underline-offset: 3px; }

.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 36px 28px; margin-bottom: 14px; }
.year { display: grid; grid-template-columns: 72px 1fr; gap: 16px; border-top: 1px solid var(--rule); padding-top: 18px; margin-top: 18px; }
.year:first-of-type { border-top: 0; }
.year h2 { margin: 0; font-size: 15px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.year ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.pub-title { color: var(--ink); font-weight: 600; line-height: 1.45; font-size: 15.5px; }
a.pub-title:hover { color: var(--accent); }
.pub-authors { font-size: 14px; margin-top: 3px; }
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-meta { font-size: 13px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pub-meta i { color: var(--body); }
details.panel > summary { cursor: pointer; list-style: none; color: var(--ink); font-weight: 600; padding: 16px 0 4px; display: flex; justify-content: space-between; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; color: var(--muted); font-weight: 400; }
details.panel[open] > summary::after { content: "−"; }

.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.posts .c { padding: 28px; }
.posts time { font-size: 13px; color: var(--muted); }

/* Blog posts */
.article { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 48px 24px; }
.article > header, .prose { max-width: 720px; margin: 0 auto; }
.article > header { margin-bottom: 32px; }
.article h1 { color: var(--ink); font-size: clamp(30px, 4.4vw, 44px); line-height: 1.12; letter-spacing: -.03em; margin: 10px 0 12px; font-weight: 600; }
.article .meta { font-size: 14px; color: var(--muted); }
.prose { font-size: 17px; line-height: 1.75; overflow-wrap: break-word; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); letter-spacing: -.015em; line-height: 1.3; margin: 2em 0 .6em; font-weight: 600; }
.prose h2 { font-size: 26px; } .prose h3 { font-size: 21px; } .prose h4 { font-size: 18px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 1.2em; }
.prose img { display: block; margin: 1.6em auto; border-radius: 12px; }
.prose iframe { display: block; width: 100%; max-width: 100%; border: 1px solid var(--rule); border-radius: 12px; margin: 1.6em 0; background: #fff; }
.prose blockquote { border-left: 3px solid var(--accent); margin-left: 0; padding-left: 18px; color: var(--muted); }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--chip); border: 1px solid var(--rule); border-radius: 6px; padding: .1em .35em; }
.prose pre { font-family: var(--mono); font-size: 13.5px; line-height: 1.6; background: var(--chip); border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 6px 10px; text-align: left; }
.back { display: inline-block; margin-top: 40px; font-size: 14px; color: var(--accent); }

/* Rouge syntax colours (GitHub-like, both schemes) */
.highlight .c, .highlight .c1, .highlight .cm { color: #6a737d; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr { color: #d73a49; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sd { color: #032f62; }
.highlight .m, .highlight .mi, .highlight .mf { color: #005cc5; }
.highlight .nf, .highlight .nb { color: #6f42c1; }
.highlight .o, .highlight .ow { color: #d73a49; }
[data-theme="dark"] .highlight .k, [data-theme="dark"] .highlight .kd, [data-theme="dark"] .highlight .kn,
[data-theme="dark"] .highlight .kr, [data-theme="dark"] .highlight .o, [data-theme="dark"] .highlight .ow { color: #ff7b72; }
[data-theme="dark"] .highlight .s, [data-theme="dark"] .highlight .s1, [data-theme="dark"] .highlight .s2,
[data-theme="dark"] .highlight .sd { color: #a5d6ff; }
[data-theme="dark"] .highlight .m, [data-theme="dark"] .highlight .mi, [data-theme="dark"] .highlight .mf { color: #79c0ff; }
[data-theme="dark"] .highlight .nf, [data-theme="dark"] .highlight .nb { color: #d2a8ff; }
[data-theme="dark"] .highlight .c, [data-theme="dark"] .highlight .c1, [data-theme="dark"] .highlight .cm { color: #8b949e; }

.footer { margin-top: 28px; color: var(--muted); font-size: 13px; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; text-align: center; }
.footer a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .hero, .paper, .focus, .recent, .contact { grid-column: span 2; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 28px; }
  .hero .figure { width: min(100%, 340px); justify-self: center; }
  .stat .pair { flex-direction: column; gap: 10px; }
  .pills { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 20px 14px 40px; }
  .nav { flex-wrap: wrap; }
  .nav .end { display: contents; }
  .nav .theme-toggle { order: 2; }
  .nav nav { order: 3; width: 100%; }
  .nav ul { width: 100%; justify-content: space-between; }
  .nav ul a { padding: 6px 10px; }
  .stat .big { font-size: 36px; }
  .page-head, .panel { padding-left: 22px; padding-right: 22px; }
  .year { grid-template-columns: 1fr; gap: 8px; }
  .posts { grid-template-columns: 1fr; }
  .article { padding: 32px 18px; }
  .prose { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .term .caret { animation: none; }
  a.c { transition: none; }
  a.c:hover { transform: none; }
}
