:root {
  --bg: #FFFFFF; --ink: #16203D; --muted: #5A6478; --rule: #E3E8F0; --accent: #1D5BFF; --code-bg: #F5F7FB;
  --signal: #B4400B; --code-key: #0B6E8A; --code-string: #0F7A52;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #10162A; --ink: #E8ECF4; --muted: #A2ACC0; --rule: #26304D; --accent: #82A8FF; --code-bg: #172040; --signal: #FFAD73; --code-key: #7FD4EC; --code-string: #6FD3A4; }
}
:root[data-theme="dark"] { --bg: #10162A; --ink: #E8ECF4; --muted: #A2ACC0; --rule: #26304D; --accent: #82A8FF; --code-bg: #172040; --signal: #FFAD73; --code-key: #7FD4EC; --code-string: #6FD3A4; }
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.wrap { width: min(680px, 100% - 2.5rem); margin-inline: auto; }

/* Header */
.site-head { padding: 2.5rem 0 1.25rem; border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem 1.5rem; flex-wrap: wrap; }
.name { font-size: 1.15rem; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-head nav { display: flex; gap: 1.25rem; }
.site-head nav a { color: var(--muted); text-decoration: none; font-size: .98rem; }
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: var(--ink); }
.site-head nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }

main { padding: 3rem 0 4rem; }
h1 { font-size: 2rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 1.25rem; text-wrap: balance; }
h2 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; margin: 3rem 0 1rem; }
p { margin: 0 0 1.15rem; }
.muted { color: var(--muted); }

/* Post list */
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.posts li:last-child { border-bottom: 1px solid var(--rule); }
.posts a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 1.08rem; line-height: 1.4; }
.posts a:hover { color: var(--accent); }
.posts .row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.posts .mins { color: var(--muted); font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.posts .dek { color: var(--muted); font-size: .97rem; margin: .3rem 0 0; }
.more { display: inline-block; margin-top: 1.25rem; }

/* About */
.split { margin: 1.25rem 0 1.5rem; }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 3px; }
.bar span:first-child { flex: 2; background: var(--accent); }
.bar span:last-child { flex: 1; background: color-mix(in srgb, var(--accent) 40%, var(--bg)); }
.legend { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; color: var(--muted); margin-top: .5rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.5rem; margin: 0; }
dl.facts dt { font-weight: 600; }
dl.facts dd { margin: 0; color: var(--muted); }
@media (max-width: 560px) { dl.facts { grid-template-columns: 1fr; gap: .1rem; } dl.facts dd { margin-bottom: .8rem; } }

/* Post */
.back { font-size: .95rem; display: inline-block; margin-bottom: 1.75rem; }
.meta { color: var(--muted); font-size: .92rem; margin: -.5rem 0 1.5rem; }
.dek-lead { font-size: 1.15rem; color: var(--muted); margin-bottom: 2.25rem; }
article h2 { margin-top: 2.5rem; }
figure { margin: 1.75rem 0; }
figcaption { color: var(--muted); font-size: .88rem; margin-top: .5rem; }
pre.code {
  margin: 0; background: var(--code-bg); border-radius: 8px; padding: 1rem 1.15rem;
  overflow-x: auto; font-family: var(--mono); font-size: .8rem; line-height: 1.65;
}
.pn { display: flex; justify-content: space-between; gap: 1.5rem; border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1.5rem; }
.pn a { text-decoration: none; color: var(--ink); max-width: 48%; }
.pn a:hover strong { color: var(--accent); }
.pn small { display: block; color: var(--muted); font-size: .85rem; }
.pn strong { font-weight: 500; }
.pn .next { margin-left: auto; text-align: right; }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; font-size: .9rem; color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.site-foot a { color: var(--muted); }
[hidden] { display: none !important; }
.site-head nav { align-items: center; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-left: .25rem;
  border: 1px solid var(--rule); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); }
:root[data-theme="dark"] .i-moon, :root:not([data-theme="dark"]) .i-sun { display: none; }
body, .site-head, .site-foot, .posts li, pre.code { transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
@media (prefers-reduced-motion: reduce) { body, .site-head, .site-foot, .posts li, pre.code { transition: none; } }

/* Bolder layer: display hero, eyebrow, featured card, syntax colors */
.eyebrow { font-family: var(--mono); font-size: .8rem; letter-spacing: .02em; color: var(--signal); margin: 0 0 1rem; }
h1.display { font-size: clamp(2.5rem, 7vw, 3.6rem); line-height: 1.04; letter-spacing: -0.035em; margin-bottom: 1.75rem; }
h1.display .hl { color: var(--accent); }
.feature {
  display: block; position: relative; margin: 0 0 2rem; padding: 1.6rem 1.5rem 1.4rem;
  border: 1px solid var(--rule); border-radius: 8px; overflow: hidden;
  color: var(--ink); text-decoration: none; transition: border-color .2s ease, transform .2s ease;
}
.feature::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--accent) 0 66.6%, var(--bg) 66.6% calc(66.6% + 3px), var(--signal) calc(66.6% + 3px) 100%);
}
.feature:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature .kicker { display: block; font-family: var(--mono); font-size: .78rem; color: var(--signal); margin-bottom: .5rem; }
.feature .f-title { display: block; font-size: 1.45rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; text-wrap: balance; }
.feature:hover .f-title { color: var(--accent); }
.feature .f-dek { display: block; color: var(--muted); margin-top: .6rem; }
.feature .f-go { display: inline-block; margin-top: .9rem; font-size: .92rem; color: var(--accent); }
.feature .f-go::after { content: "\2192"; display: inline-block; margin-left: .3em; transition: transform .2s ease; }
.feature:hover .f-go::after { transform: translateX(3px); }
pre.code .t-com { color: var(--muted); }
pre.code .t-str { color: var(--code-string); }
pre.code .t-key { color: var(--code-key); }
pre.code .t-kw { color: var(--accent); }
pre.code .t-num { color: var(--signal); }
@media (prefers-reduced-motion: reduce) { .feature, .feature .f-go::after { transition: none; } .feature:hover { transform: none; } }
