:root {
  --bg: #0a0b0a;
  --line: #1b1e1a;
  --fg: #c4c7c0;
  --fg-bright: #e8eae4;
  --dim: #6a6e64;
  --accent-h: 135;
  --accent-c: 0.06;
  --accent-l: 0.66;
  --accent: oklch(var(--accent-l) var(--accent-c) var(--accent-h));
  --font: 'JetBrains Mono', ui-monospace, monospace;
  --maxw: 680px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg); }
body {
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}
::selection { background: oklch(var(--accent-l) var(--accent-c) var(--accent-h) / 0.3); color: var(--fg-bright); }
a { color: inherit; text-decoration: none; }
.ac { color: var(--accent); }
.dim { color: var(--dim); }

.cursor {
  display: inline-block; width: 0.55em; height: 1.05em; background: var(--accent);
  margin-left: 4px; transform: translateY(2px);
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.glitch { position: relative; display: inline-block; }
.glitch.on { animation: gl-base .32s steps(2, end) both; }
.glitch.on::before, .glitch.on::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0; width: 100%;
  background: var(--bg); color: inherit; overflow: hidden; pointer-events: none;
}
.glitch.on::before { text-shadow: 2px 0 #c0392b; animation: gl-a .32s steps(2, end) both; }
.glitch.on::after  { text-shadow: -2px 0 var(--accent); animation: gl-b .32s steps(2, end) both; }
@keyframes gl-base {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-1px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-2px, 0); }
  80% { transform: translate(1px, 1px); }
}
@keyframes gl-a {
  0%   { clip-path: inset(15% 0 60% 0); transform: translate(-3px, -1px); }
  25%  { clip-path: inset(70% 0 12% 0); transform: translate(3px, 1px); }
  50%  { clip-path: inset(40% 0 38% 0); transform: translate(-2px, 1px); }
  75%  { clip-path: inset(8% 0 80% 0);  transform: translate(3px, -1px); }
  100% { clip-path: inset(55% 0 28% 0); transform: translate(0); }
}
@keyframes gl-b {
  0%   { clip-path: inset(62% 0 18% 0); transform: translate(3px, 1px); }
  25%  { clip-path: inset(10% 0 72% 0); transform: translate(-3px, -1px); }
  50%  { clip-path: inset(45% 0 33% 0); transform: translate(2px, 1px); }
  75%  { clip-path: inset(82% 0 4% 0);  transform: translate(-3px, 1px); }
  100% { clip-path: inset(25% 0 50% 0); transform: translate(0); }
}

.bgfx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; opacity: 0; }
.bgfx.on { animation: bgfx-flicker .32s steps(4, end) both; }
@keyframes bgfx-flicker {
  0%, 100% { opacity: 0; }
  12% { opacity: 1; }
  40% { opacity: .55; }
  68% { opacity: 1; }
  88% { opacity: .7; }
}
.bgfx-static {
  position: absolute; inset: -10%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
  background-size: 140px 140px; mix-blend-mode: screen; opacity: 0;
}
.bgfx.on .bgfx-static { animation: bgfx-static .32s steps(5, end) both; }
@keyframes bgfx-static {
  0%, 100% { opacity: 0; background-position: 0 0; }
  18% { opacity: .26; background-position: 26px -18px; }
  48% { opacity: .14; background-position: -30px 20px; }
  78% { opacity: .21; background-position: 20px 14px; }
}
.bgfx-scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px,
    oklch(var(--accent-l) var(--accent-c) var(--accent-h) / 0.14) 2px 3px, transparent 3px 4px);
  mix-blend-mode: screen; opacity: 0;
}
.bgfx.on .bgfx-scan { animation: bgfx-scan .32s steps(6, end) both; }
@keyframes bgfx-scan {
  0%, 100% { opacity: 0; transform: translateY(0); }
  20% { opacity: 1; transform: translateY(-7px); }
  55% { opacity: .8; transform: translateY(5px); }
  85% { opacity: 1; transform: translateY(-3px); }
}

.stage { min-height: 100vh; }
.home {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 38px; padding: 40px;
}
.home-social {
  display: flex; align-items: center; gap: 12px;
  color: var(--dim); font-size: 12.5px; letter-spacing: 0.04em;
  margin-top: -22px;
}
.home-social a { color: var(--dim); transition: color .15s; }
.home-social a:hover { color: var(--accent); }
.home-id { color: var(--dim); font-size: 13.5px; letter-spacing: 0.04em; }
.home-links { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.home-link {
  color: var(--fg-bright); font-size: 21px; letter-spacing: 0.01em;
  position: relative; padding: 2px 4px; transition: color .15s;
}
.home-link::before {
  content: "·"; color: var(--accent); opacity: 0;
  position: absolute; left: -16px; transition: opacity .15s;
}
.home-link:hover { color: var(--accent); }
.home-link:hover::before { opacity: 1; }

.page {
  max-width: 900px; margin: 0 auto;
  padding: 12vh 22px 18vh;
}
.back { color: var(--dim); font-size: 13px; display: inline-block; white-space: nowrap; margin-bottom: 44px; transition: color .15s; }
.back:hover { color: var(--accent); }
.page-h { color: var(--accent); font-size: 15px; font-weight: 500; letter-spacing: 0.06em; text-transform: lowercase; margin: 0 0 26px; }

.list { list-style: none; padding: 0; margin: 0; }
.row {
  display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: baseline;
  padding: 13px 0; cursor: pointer; border-bottom: 1px solid var(--line);
}
.list > li:first-child .row { border-top: 1px solid var(--line); }
.row-date { font-size: 13px; }
.row-title {
  color: var(--fg-bright); transition: color .15s;
  font-size: 14.5px; text-wrap: balance;
}
.row:hover .row-title { color: var(--accent); }

.page-post .post-p,
.page-post .post pre,
.page-post .post .codehilite,
.page-post .post ul,
.page-post .post ol { max-width: none; }

.post-h { color: var(--accent); font-size: 23px; font-weight: 700; line-height: 1.35; margin: 0 0 10px; text-wrap: balance; }
.post-meta { color: var(--accent); font-size: 13px; margin: 0 0 34px; }
.post-sub {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 30px 0 6px;
  scroll-margin-top: 24px;
}
.post .post-sub a { color: inherit; text-decoration: none; }
.post .post-sub a:hover { text-decoration: none; }
.post-sub-2 { font-size: 20px; }
.post-sub-3 { font-size: 16px; margin-top: 24px; }
.post-sub-4 { font-size: 14px; margin-top: 20px; }
.post-sub-5 { font-size: 13px; margin-top: 18px; }
.post-sub-6 { font-size: 12px; margin-top: 16px; }

.toc { border: 1px solid var(--line); border-radius: 4px; margin: 0 0 34px; background: #0c0e0c; }
.toc-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; cursor: pointer; font: inherit; color: var(--dim);
  padding: 10px 14px; text-align: left;
}
.toc.open .toc-head { border-bottom: 1px solid var(--line); }
.toc:not(.open) .toc-list { display: none; }
.toc-caret { color: var(--accent); width: 12px; font-size: 11px; }
.toc-label { color: var(--accent); letter-spacing: 0.06em; font-size: 13px; }
.toc-count { margin-left: auto; font-size: 12px; }
.toc-head:hover .toc-label { text-decoration: underline; text-underline-offset: 3px; }
.toc-list { list-style: none; margin: 0; padding: 8px 14px 12px; }
.toc-item { margin: 0; }
.toc-item a {
  display: flex; align-items: baseline; gap: 12px; padding: 5px 0;
  color: var(--fg); font-size: 13px; transition: color .12s;
}
.toc-num { color: var(--dim); font-size: 12px; min-width: 20px; }
.toc-item a:hover { color: var(--accent); }
.toc-item a:hover .toc-num { color: var(--accent); }
.toc-item-3 a { padding-left: 32px; font-size: 12.5px; }
.toc-item-4 a { padding-left: 52px; font-size: 12px; }
.toc-item-5 a { padding-left: 72px; font-size: 12px; }
.toc-item-6 a { padding-left: 92px; font-size: 11.5px; }
.post-p { font-size: 14px; line-height: 1.75; color: var(--fg); margin: 0 0 20px; text-wrap: pretty; max-width: 64ch; }
.post-p strong, .post strong, .post b { color: var(--accent); font-weight: 700; }

.post pre {
  background: #0c0e0c;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 22px;
  max-width: 64ch;
  font-size: 12.5px;
  line-height: 1.6;
}
.post pre code { color: var(--fg); background: none; padding: 0; font-size: inherit; }

.post .codehilite { margin: 0 0 22px; max-width: 64ch; }
.post .codehilite pre { margin: 0; max-width: none; }
.post .codehilite .c,  .post .codehilite .c1, .post .codehilite .cm,
.post .codehilite .ch, .post .codehilite .cs { color: var(--dim); font-style: italic; }
.post .codehilite .cp, .post .codehilite .cpf { color: var(--dim); }
.post .codehilite .k,  .post .codehilite .kc, .post .codehilite .kd,
.post .codehilite .kn, .post .codehilite .kp, .post .codehilite .kr { color: var(--accent); font-weight: 700; }
.post .codehilite .kt { color: var(--accent); }
.post .codehilite .nb, .post .codehilite .bp { color: var(--accent); }
.post .codehilite .nf, .post .codehilite .nc, .post .codehilite .nn { color: var(--fg-bright); }
.post .codehilite .nd, .post .codehilite .ni, .post .codehilite .ne { color: var(--fg-bright); }
.post .codehilite .s,  .post .codehilite .s1, .post .codehilite .s2,
.post .codehilite .sb, .post .codehilite .sc, .post .codehilite .sd,
.post .codehilite .se, .post .codehilite .sh, .post .codehilite .si,
.post .codehilite .sx, .post .codehilite .sr, .post .codehilite .ss { color: #b8c2a8; }
.post .codehilite .m,  .post .codehilite .mi, .post .codehilite .mf,
.post .codehilite .mh, .post .codehilite .mo, .post .codehilite .il { color: #c9a96a; }
.post .codehilite .o,  .post .codehilite .ow { color: var(--fg); }
.post .codehilite .p { color: var(--fg); }
.post .codehilite .err { color: #c0392b; }
.post code {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.92em;
}
.post img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0 22px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.post ul, .post ol { font-size: 14px; color: var(--fg); margin: 0 0 20px; padding-left: 22px; max-width: 64ch; }
.post a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 560px) {
  .row { grid-template-columns: 92px 1fr; gap: 12px; }
  .home-link { font-size: 19px; }
}
