/* Self-hosted fonts (SIL OFL 1.1): Inter and JetBrains Mono, Latin subset, variable weight. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/inter.woff2") format("woff2"); 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: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2"); 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; }

:root,
:root[data-theme="dark"] {
  --bg: #0E1116; --fg: #E6E8EB; --body: #C7CDD4; --muted: #9AA3AE;
  --line: #232A33; --line2: #1B2129; --panel: #151A21; --border: #3A434F;
  --accent: #60A5FA; --on-accent: #0E1116;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #FAFAF7; --fg: #14181D; --body: #39414B; --muted: #5B6470;
  --line: #E2E4E7; --line2: #ECEEF0; --panel: #F0F1F2; --border: #C9CDD2;
  --accent: #1D4ED8; --on-accent: #FFFFFF;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
input, textarea, button { font: inherit; }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 560px) { .wrap { padding: 0 20px; } }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; padding: 10px 14px; background: var(--accent); color: var(--on-accent); border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* header */
.site-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.brand { font-size: 15px; font-weight: 500; text-decoration: none; padding: 12px 0; }
.brand span, .caret { color: var(--accent); }
.caret { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.nav a { padding: 12px 14px; text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.nav a.cta { padding: 12px 18px; color: var(--on-accent); background: var(--accent); border-radius: 6px; font-weight: 700; }
.theme-toggle { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--fg); cursor: pointer; }
.theme-toggle .moon { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: block; }
@media (max-width: 560px) { .nav a { padding: 12px 8px; } .nav a.cta { padding: 12px 14px; } }

/* sections */
section { border-top: 1px solid var(--line); padding: 40px 0 56px; }
.hero { border-top: 0; padding: 88px 0 72px; }
.prompt { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.hero h1 { margin: 0; font-size: clamp(40px, 6.5vw, 80px); line-height: 1.02; font-weight: 700; letter-spacing: -0.03em; }
.lede { margin: 20px 0 0; font-size: clamp(19px, 2.2vw, 26px); line-height: 1.4; color: var(--body); max-width: 720px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; margin: 44px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stats div { padding: 20px 22px; background: var(--bg); }
.stats dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stats dd { margin: 8px 0 0; font-size: 22px; font-weight: 600; }
.label { font-size: 14px; color: var(--accent); margin: 0; font-weight: 400; text-transform: lowercase; }
.label::before { content: "// "; }
.intro { margin: 4px 0 24px; font-size: 16px; color: var(--muted); }

.rows { list-style: none; margin: 28px 0 0; padding: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 22px 0; border-bottom: 1px solid var(--line2); }
.rows > .row:last-child { border-bottom: 0; }
.row .when { flex: 1 1 160px; font-size: 14px; color: var(--muted); padding-top: 4px; }
.row .what { flex: 999 1 560px; min-width: 0; }
.row h3 { margin: 0; font-size: 20px; font-weight: 600; }
.row h3 .org { color: var(--muted); font-weight: 400; }
.row p { margin: 8px 0 0; color: var(--body); font-size: 16px; line-height: 1.55; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--body); }
.chips li { padding: 8px 12px; background: var(--panel); border-radius: 6px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; gap: 12px; padding: 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
a.card:hover { border-color: var(--border); }
.card .kicker, .card .stack { font-size: 13px; color: var(--muted); }
.card .name { font-size: 22px; font-weight: 600; color: var(--fg); margin: 0; }
.card p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--body); }
.card .stack { margin-top: auto; padding-top: 8px; }

.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-head a { font-size: 14px; color: var(--muted); padding: 12px 0; }
.posts { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line2); }
.posts li { border-top: 1px solid var(--line2); }
.posts a { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 22px 0; text-decoration: none; }
.posts .when { flex: 1 1 160px; font-size: 14px; color: var(--muted); }
.posts .what { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.posts .t { font-size: 20px; font-weight: 600; color: var(--fg); }
.posts a:hover .t { color: var(--accent); }
.posts .m { font-size: 15px; color: var(--muted); }
.empty { padding: 22px 0; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); color: var(--muted); font-size: 15px; }

/* talk */
.talk { display: flex; flex-wrap: wrap; gap: 40px; padding: 56px 0 88px; }
.talk .copy { flex: 1 1 300px; min-width: 0; }
.talk h2 { margin: 12px 0 0; font-size: clamp(32px, 4.5vw, 52px); font-weight: 600; letter-spacing: -0.02em; }
.talk .copy p { margin: 14px 0 0; font-size: 17px; line-height: 1.55; color: var(--body); max-width: 360px; }
.talk form { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field textarea { padding: 0 14px; height: 48px; background: var(--panel); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; font-size: 16px; }
.field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.form-foot a { font-size: 14px; color: var(--muted); padding: 12px 0; }
.btn { height: 48px; padding: 0 22px; background: var(--accent); color: var(--on-accent); border: none; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.status { margin: 0; font-size: 14px; min-height: 1.4em; color: var(--muted); }
.status.ok { color: var(--accent); }
.status.err { color: #F87171; }
:root[data-theme="light"] .status.err { color: #B91C1C; }

.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 10; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--panel); color: var(--fg); border: 1px solid var(--border); border-radius: 50%; text-decoration: none; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: var(--muted); }

/* article */
.article { max-width: 720px; margin: 0 auto; padding: 72px 32px 96px; }
@media (max-width: 560px) { .article { padding: 48px 20px 72px; } }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); }
.meta .topic { color: var(--accent); }
.article h1 { margin: 18px 0 0; font-size: clamp(34px, 5vw, 52px); line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; }
.article .summary { margin: 20px 0 0; font-size: 21px; line-height: 1.5; color: var(--body); }
.byline { display: flex; align-items: center; gap: 14px; margin-top: 32px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--body); }
.byline .n { font-size: 15px; font-weight: 600; }
.byline .r { font-size: 14px; color: var(--muted); }
.prose { margin-top: 40px; font-size: 18px; line-height: 1.75; color: var(--body); }
.prose > * { margin: 0 0 24px; }
.prose h2 { margin-top: 40px; font-size: 26px; font-weight: 600; color: var(--fg); letter-spacing: -0.01em; line-height: 1.3; }
.prose h3 { margin-top: 32px; font-size: 21px; font-weight: 600; color: var(--fg); }
.prose a { color: var(--accent); }
.prose strong { color: var(--fg); }
.prose pre { padding: 20px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; line-height: 1.6; overflow-x: auto; }
.prose code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.88em; }
.prose :not(pre) > code { padding: 2px 6px; background: var(--panel); border-radius: 4px; }
.prose blockquote { padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); font-size: 22px; line-height: 1.5; color: var(--fg); }
.prose blockquote p { margin: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 6px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); }
.after { margin-top: 56px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.after .q { font-size: 17px; font-weight: 600; }
.page-title { margin: 12px 0 0; font-size: clamp(34px, 5vw, 52px); font-weight: 600; letter-spacing: -0.025em; }
.notfound { padding: 120px 0; }
