:root {
  --bg: #0A0C10;
  --bg-2: #0E1117;
  --surface: #131821;
  --surface-2: #1A202B;
  --line: #242B37;
  --line-2: #323B4A;
  --text: #F2F4F7;
  --muted: #A3ABB8;
  --dim: #7F8999;
  --orange: #FF6B1A;
  --orange-2: #FF8C42;
  --orange-ink: #1A0B02;
  --glow: rgba(255, 107, 26, 0.32);
  --green: #3DDC97;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Archivo", system-ui, sans-serif; font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; left: 16px; top: 12px; width: auto; height: auto; clip: auto; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--orange); color: var(--orange-ink); font-weight: 700; text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 10px;
  font-weight: 650; font-size: 0.98rem; text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease; font-family: inherit;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--orange); color: var(--orange-ink); box-shadow: 0 8px 28px -10px var(--glow); }
.btn-primary:hover { background: var(--orange-2); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: rgba(255,255,255,0.02); }
.btn-ghost:hover { border-color: var(--orange); }
.btn-sm { padding: 9px 16px; font-size: 0.9rem; }

/* nav: no script needed, links wrap on small screens */
header.nav {
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 12, 16, 0.82); border-bottom: 1px solid rgba(36, 43, 55, 0.7);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--orange); color: var(--orange-ink); }
.logo-mark svg { width: 20px; height: 20px; }
.logo-text { line-height: 1.1; }
.logo-text b { display: block; font-stretch: 112%; font-weight: 800; letter-spacing: 0.02em; font-size: 1rem; }
.logo-text span { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 0.95rem; font-weight: 500; padding: 6px 0; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }
.nav-links a.btn { color: var(--orange-ink); padding: 9px 16px; white-space: nowrap; }
@media (max-width: 720px) {
  .logo-text span { display: none; }
  .nav-links { gap: 16px; }
  .nav-links .opt { display: none; }
  .nav-links a.btn svg { display: none; }
}

/* blog index */
.page-head { padding: 72px 0 40px; }
.eyebrow { font-family: var(--mono); color: var(--orange); font-size: 0.86rem; margin: 0 0 12px; }
.eyebrow b { color: var(--muted); font-weight: 400; }
h1.title { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; font-weight: 850; font-stretch: 108%; letter-spacing: -0.015em; margin: 0; }
.page-head p.sub { color: var(--muted); margin: 16px 0 0; max-width: 40em; font-size: 1.06rem; }
.posts { list-style: none; margin: 0 0 104px; padding: 0; display: grid; gap: 18px; }
.post-card { display: block; text-decoration: none; padding: 26px 26px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s; }
.post-card:hover { border-color: rgba(255, 107, 26, 0.55); transform: translateY(-2px); }
.post-card h2 { margin: 10px 0 0; font-size: 1.4rem; line-height: 1.25; font-weight: 750; }
.post-card p { color: var(--muted); margin: 10px 0 0; }
.post-card .more { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--orange); font-weight: 650; font-size: 0.92rem; }
.post-card .more svg { width: 15px; height: 15px; }
.meta { font-family: var(--mono); font-size: 0.8rem; color: var(--dim); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.meta .tagx { color: var(--orange-2); }

/* article */
.article-head { padding: 64px 0 36px; border-bottom: 1px solid var(--line); background:
  linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 56px 56px,
  linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 56px 56px; }
.article-head .inner, .article { max-width: 760px; margin: 0 auto; }
.back { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); text-decoration: none; font-size: 0.9rem; margin-bottom: 26px; }
.back:hover { color: var(--text); }
.article-head h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.08; font-weight: 850; font-stretch: 106%; letter-spacing: -0.015em; margin: 0 0 18px; }
.article-head .lede { color: var(--muted); font-size: 1.12rem; margin: 0 0 22px; }
.badge { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(61, 220, 151, 0.4); background: rgba(61, 220, 151, 0.1); color: var(--green); font-size: 0.86rem; font-weight: 600; margin-bottom: 22px; }
.badge svg { width: 16px; height: 16px; }
a.badge { text-decoration: none; transition: border-color .15s; } a.badge:hover { border-color: var(--green); }

.article { padding: 48px 0 40px; font-size: 1.06rem; line-height: 1.75; color: #D9DEE6; }
.article h2 { color: var(--text); font-size: 1.55rem; line-height: 1.25; font-weight: 780; margin: 48px 0 14px; letter-spacing: -0.01em; }
.article h2::before { content: "// "; font-family: var(--mono); color: var(--orange); font-size: 0.8em; font-weight: 600; }
.article h3 { color: var(--text); font-size: 1.15rem; margin: 30px 0 8px; font-weight: 720; }
.article p { margin: 0 0 18px; }
.article strong { color: var(--text); font-weight: 650; }
.article a { color: var(--orange-2); text-underline-offset: 3px; }
.article a.btn { text-decoration: none; }
.article a.btn-primary { color: var(--orange-ink); }
.article a.btn-ghost { color: var(--text); }
.article ul, .article ol { margin: 0 0 20px; padding-left: 22px; display: grid; gap: 8px; }
.article li::marker { color: var(--orange); }
.article code { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: #FFD3B5; }
.article pre { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; margin: 0 0 22px; padding: 16px 18px; background: #0B0E13; border: 1px solid var(--line-2); border-radius: 10px; overflow-x: auto; font-family: var(--mono); font-size: 0.8rem; line-height: 1.6; color: #E6E9EF; }
.article pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.qlabel { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0 6px; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.qlabel b { color: var(--orange-2); font-weight: 600; }
.qlabel a { color: var(--muted); }
.callout { border: 1px solid var(--line-2); border-left: 3px solid var(--orange); background: var(--surface); border-radius: 10px; padding: 16px 18px; margin: 26px 0; color: var(--muted); font-size: 0.98rem; }
.callout b { color: var(--text); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 26px 0 30px; }
@media (max-width: 640px) { .facts { grid-template-columns: minmax(0, 1fr); } }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.fact b { display: block; font-size: 1.25rem; font-weight: 850; font-stretch: 108%; color: var(--text); line-height: 1.15; }
.fact span { color: var(--muted); font-size: 0.88rem; }
table.map { width: 100%; border-collapse: collapse; margin: 10px 0 26px; font-size: 0.94rem; }
table.map th { text-align: left; font-family: var(--mono); font-size: 0.76rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
table.map td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.map td:first-child { color: var(--text); font-weight: 600; }
@media (max-width: 640px) { table.map, table.map tbody, table.map tr, table.map td { display: block; } table.map thead { display: none; } table.map tr { padding: 10px 0; border-bottom: 1px solid var(--line); } table.map td { border: 0; padding: 3px 0; } }
.end { margin: 46px 0 0; padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.end p { margin: 0; color: var(--muted); max-width: 30em; }
.end p b { color: var(--text); }
.end .acts { display: flex; gap: 10px; flex-wrap: wrap; }

footer.site { border-top: 1px solid var(--line); padding: 40px 0 48px; color: var(--muted); font-size: 0.88rem; margin-top: 40px; }
footer .f { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer nav a { text-decoration: none; }
footer nav a:hover { color: var(--text); }
.chain { list-style: none; padding: 0; margin: 14px 0 10px; }
.chain li { position: relative; margin: 0 0 18px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; }
.chain li.inferred { border-style: dashed; }
.chain li.hit { border-color: var(--orange); background: rgba(255, 107, 26, 0.08); }
.chain li:not(:last-child)::after { content: ""; position: absolute; left: 50%; bottom: -19px; width: 1px; height: 18px; background: var(--line-2); }
.chain li b { color: var(--text); }
.chain .st { margin-left: 10px; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.chain p { margin: 6px 0 6px; }
.chain .ttp { display: block; font-family: var(--mono); font-size: 0.76rem; color: var(--dim); }
.chain-key { font-size: 0.86rem; color: var(--muted); margin: 0 0 26px; }
table.map td code { overflow-wrap: anywhere; word-break: break-all; }
