/* /devlog/<slug> — one post: a narrow column, big type, and a fuse that burns as you read. (content agent) */

body.page-post { --ink-accent: var(--molten); --quote-bg: color-mix(in srgb, var(--molten) 10%, var(--panel)); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body.page-post { --ink-accent: #A8480A; --quote-bg: #FFF0CF; }
  :root:not([data-theme="dark"]) body.page-post .kicker,
  :root:not([data-theme="dark"]) body.page-post .kicker a { color: var(--ink-accent); }
  :root:not([data-theme="dark"]) body.page-post .draft-tag { color: #7A4E00; background: rgba(255, 194, 61, .28); border-color: rgba(160, 105, 0, .55); }
}

/* ── the fuse ─────────────────────────────────────────────────────────── */
.fuse { display: none; }
html.js .fuse {
  display: block; position: fixed; left: 0; right: 0; top: var(--head-h); height: 22px; z-index: 49; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 2px solid color-mix(in srgb, var(--line) 70%, transparent);
  --x: 0px;
}
.fuse-track { position: absolute; left: 12px; right: 44px; top: 7px; height: 7px; }
.fuse-burnt { /* the ash left behind */
  position: absolute; left: 0; right: 0; top: 3px; height: 2px;
  background: repeating-linear-gradient(90deg, rgba(120, 120, 135, .7) 0 5px, transparent 5px 9px);
}
.fuse-rope {
  position: absolute; inset: 0; border-radius: 99px;
  background:
    repeating-linear-gradient(118deg, #D9B176 0 4px, #A97B42 4px 7px, #C79A5E 7px 9px);
  box-shadow: 0 0 0 2px var(--outline), 0 3px 0 2px rgba(0, 0, 0, .18);
  clip-path: inset(-4px -4px -4px var(--x));
}
.fuse-flame {
  position: absolute; left: 0; top: -10px; width: 30px; height: 36px;
  transform: translateX(var(--x)); will-change: transform;
}
.fuse-flame svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 6px rgba(255, 150, 40, .9)); }
.fuse-flame .flame { transform-box: fill-box; transform-origin: 50% 90%; animation: flicker .5s ease-in-out infinite alternate; }
@keyframes flicker { 0% { transform: scale(.92, 1.05) rotate(-4deg); } 100% { transform: scale(1.06, .94) rotate(4deg); } }
.fuse.is-cold .fuse-flame { opacity: 0; transition: opacity .3s; }
.fuse-rocket { position: absolute; right: 12px; top: -9px; width: 16px; height: 30px; transition: opacity .3s; }
.fuse-rocket svg { width: 100%; height: 100%; overflow: visible; }
.fuse-rocket .rocket { transform-box: fill-box; transform-origin: 50% 100%; }
.fuse.is-close .fuse-rocket .rocket { animation: rocket-jitter .12s linear infinite alternate; }
@keyframes rocket-jitter { from { transform: translateX(-.6px) rotate(-2deg); } to { transform: translateX(.6px) rotate(2deg); } }
.fuse.is-launched .fuse-rocket { animation: rocket-go .9s cubic-bezier(.5, 0, .9, .4) forwards; }
@keyframes rocket-go { 0% { transform: translateY(0) scale(1); } 20% { transform: translateY(4px) scale(1.1, .85); } 100% { transform: translateY(-140px) scale(.8, 1.3); opacity: 0; } }
.fuse.is-launched .fuse-flame { opacity: 0; }
html.calm .fuse-flame .flame { animation: none; }

/* ── the article ──────────────────────────────────────────────────────── */
.post { padding-top: clamp(48px, 8vw, 104px); padding-bottom: clamp(56px, 9vw, 120px); max-width: 720px; }
.post-head { margin-bottom: clamp(24px, 4vw, 44px); }
.post-head .kicker a { color: inherit; text-decoration: none; }
.post-head .kicker a:hover { text-decoration: underline; }
.post-title { font-size: clamp(2.4rem, 1.7rem + 3.2vw, 4rem); margin-bottom: .3em; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4em .6em; color: var(--fg-muted); font-weight: 700; margin-bottom: 1.2em; }
.post-sum {
  font-size: var(--step-1); line-height: 1.5; color: var(--fg-muted); margin: 0;
  padding-bottom: clamp(20px, 3vw, 32px); border-bottom: 3px dashed var(--line);
}

.post-body { font-size: clamp(1.1rem, 1.02rem + .35vw, 1.25rem); line-height: 1.75; }
.post-body > * { margin-top: 0; margin-bottom: 1.1em; }
.post-body h2 { font-size: var(--step-3); margin-top: 1.7em; margin-bottom: .5em; scroll-margin-top: calc(var(--head-h) + 40px); }
.post-body h3 { font-size: var(--step-2); margin-top: 1.5em; margin-bottom: .4em; }
.post-body h4, .post-body h5, .post-body h6 { font-size: var(--step-1); margin-top: 1.4em; margin-bottom: .3em; }
.post-body a { font-weight: 700; }
.post-body strong { font-weight: 800; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li { margin-bottom: .45em; padding-left: .2em; }
.post-body li > p { margin: 0 0 .4em; }
.post-body li > ul, .post-body li > ol { margin-top: .4em; }
.post-body li::marker { color: var(--accent); font-family: var(--font-display); font-weight: 700; }
.post-body blockquote {
  position: relative; margin: 1.6em 0; padding: 1em 1.3em 1em 1.5em;
  background: var(--quote-bg); border: var(--stroke) solid var(--outline); border-left-width: 10px; border-left-color: var(--molten);
  border-radius: var(--r); box-shadow: 0 5px 0 rgba(0, 0, 0, .18);
}
.post-body blockquote > :last-child { margin-bottom: 0; }
.post-body blockquote p { margin: 0 0 .7em; }
.post-body pre {
  margin: 1.4em 0; padding: 1.1em 1.3em; overflow-x: auto;
  background: #0D1120; color: #FFF3DF; border: var(--stroke) solid var(--outline); border-radius: var(--r);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .25), inset 0 0 0 2px rgba(255, 255, 255, .05);
  font-size: .82em; line-height: 1.6; tab-size: 2;
}
.post-body pre code { background: none; padding: 0; font-size: 1em; color: inherit; border-radius: 0; }
.post-body :not(pre) > code { font-size: .86em; }
.post-body figure { margin: 2em 0; text-align: center; }
.post-body figure img {
  margin-inline: auto; border-radius: var(--r); max-height: 520px; width: auto;
}
.post-body figure img[src$=".svg"] {
  width: min(100%, 300px); padding: 24px; background: #151B2E; border: var(--stroke) solid var(--outline); border-radius: var(--r-lg);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .25);
}
.post-body figcaption { margin-top: .8em; font-size: var(--step--1); color: var(--fg-muted); font-style: italic; }
.post-body hr { border-top: 3px dashed var(--line); margin: 2.4em 0; }
.post-body img { border-radius: var(--r-sm); }

/* ── the end ──────────────────────────────────────────────────────────── */
.post-foot { margin-top: clamp(32px, 5vw, 56px); padding-top: clamp(24px, 4vw, 36px); border-top: 3px dashed var(--line); }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 1em; padding: 0; }
.post-tags li { font: 700 .85rem/1 var(--font-body); color: var(--fg-muted); background: var(--panel-2); border: 2px solid var(--line); padding: .4em .7em; border-radius: 99px; }
.post-sign { font: 500 var(--step-0)/1.4 var(--font-display); color: var(--fg-muted); margin-bottom: 2em; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 1.6em; }
.pn {
  display: flex; flex-direction: column; gap: .4em; padding: 16px 20px; text-decoration: none; color: var(--fg);
  background: var(--panel); border: var(--stroke) solid var(--outline); border-radius: var(--r-lg);
  box-shadow: 0 5px 0 rgba(0, 0, 0, .25); transition: transform .3s var(--spring), box-shadow .3s var(--spring);
}
.pn:hover { color: var(--fg); transform: translateY(-4px) rotate(-1deg); box-shadow: 0 9px 0 rgba(0, 0, 0, .2); }
.pn-newer { text-align: right; align-items: flex-end; }
.pn-newer:hover { transform: translateY(-4px) rotate(1deg); }
.pn-none { visibility: hidden; }
.pn-k { display: inline-flex; align-items: center; gap: .4em; font: 700 .78rem/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-accent); }
.pn-k svg { width: 1.2em; height: 1.2em; }
.pn-older .pn-k svg { transform: scaleX(-1); }
.pn-t { font: 600 var(--step-1)/1.2 var(--font-display); }
.post-back { margin: 0; }
@media (max-width: 560px) {
  .post-nav { grid-template-columns: 1fr; }
  .pn-none { display: none; }
  .pn-newer { text-align: left; align-items: flex-start; }
}

@media print {
  .fuse { display: none !important; }
}
