/* ======================================================================
   Ready-made blocks for posts and projects (src/Blocks, catalogue in BLOCKS.md).
   Each one is a real object: a ticket, a receipt, a postcard, a test run.
   They live in .prose, so the resets below undo prose's list and paragraph styles.
   ====================================================================== */

.prose .blk { margin-top: 1.8em; margin-bottom: 0.2em; }
/* Only margins are reset here; :where() keeps these rules weaker than any block's own class. */
:where(.prose .blk) :where(p, ul, ol, dl, dd, blockquote) { margin: 0; }
.prose .blk :is(ul, ol), .prose :is(ul, ol).blk { list-style: none; padding-left: 0; }
.prose .blk .blk-prose li + li { margin-top: 0.3em; }
.prose .blk blockquote { border-left: 0; padding: 0; color: inherit; }
.prose .blk blockquote::before { content: none; }
.prose .blk-quote blockquote { padding: 0; }
.prose .blk .testimonial { padding: 22px 24px 18px; }
.prose .blk .laurel { padding: 20px 0 0; }
.prose .blk a:hover { background: none; }

/* The case-study objects take their accent from the project type; in a post they pick their own. */
.prose .sheet-spec { --pt: var(--pen); }
.prose .sheet-lab { --pt: var(--project-lab); }
.prose .sheet-paper { --pt: var(--project-research); }
.prose .sheet-spec .facts--spec > div { padding: 10px 0; }
.prose .sheet-spec { margin-bottom: 28px; }
.prose .sheet-folder { margin-top: 3em; }
.prose .blk li + li { margin-top: 0; }
.prose .blk li::marker { content: none; }
.blk-prose > * + * { margin-top: 0.6em; }
.blk-prose ul { list-style: none; padding: 0; }
.blk-prose ul > li { position: relative; padding-left: 1.1em; }
.blk-prose ul > li::before { content: "–"; position: absolute; left: 0; color: var(--ink-3); }
.blk-prose ul > li + li { margin-top: 0.3em; }
.blk-code, .prose .blk pre.blk-code { margin: 0; padding: 12px 14px; font: 400 13px/1.6 var(--mono); background: var(--paper-2); background-image: none; border: 0; border-radius: 6px; overflow-x: auto; white-space: pre; }
.prose .blk pre { margin-top: 0; }
.blk-copy { height: 24px; padding: 0 9px; border-radius: 5px; font: 400 12px/1 var(--mono); color: var(--ink-3); }
.blk-copy:hover { color: var(--ink); background: var(--paper-2); }
.blk-copy.done { color: var(--pass); }
.ep-label { display: block; margin-bottom: 4px; font: 400 11.5px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.md-meta { display: flex; flex-wrap: wrap; gap: 2px 0; font-size: 14px; color: var(--ink-3); }
.md-dot { margin: 0 7px; opacity: 0.6; }
.md-note { margin-top: 12px; font-size: 15.5px; color: var(--ink-2); }
.d-add { color: var(--pass); }
.d-del { color: var(--margin); }

/* ---------- objects shared with case studies ---------- */
.prose .sheet-browser .browser-view { font-size: 15.5px; }
.prose .sheet-term .term-out { margin: 0; border: 0; background: none; border-radius: 0; }

/* ---------- code: endpoint, http, diff ---------- */
.blk-endpoint { border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); overflow: hidden; }
.ep-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.ep-method { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 5px; font: 700 12px/1 var(--mono); letter-spacing: 0.04em; color: #fff; background: #3b7d6e; }
.ep-method--post { background: #2652b8; } .ep-method--put, .ep-method--patch { background: #a8742a; } .ep-method--delete { background: #b5443a; }
.prose .ep-path { padding: 0; background: none; font-size: 15px; color: var(--ink); word-break: break-all; }
.ep-auth { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); }
.ep-auth .i { width: 13px; height: 13px; }
.ep-status { margin-left: auto; font: 600 13px/1 var(--mono); padding: 5px 8px; border-radius: 5px; background: var(--paper-2); }
.ep-status--2xx { color: var(--pass); } .ep-status--4xx, .ep-status--5xx { color: var(--margin); } .ep-status--3xx { color: var(--pen); }
.ep-desc { padding: 12px 16px 0; font-size: 15.5px; color: var(--ink-2); }
.ep-part { padding: 12px 16px 0; }
.ep-part:last-child { padding-bottom: 16px; }
.prose .blk-endpoint pre.blk-code, .prose .blk-http pre.blk-code { white-space: pre-wrap; word-break: break-word; }

.blk-http { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.http-pane { padding: 12px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); min-width: 0; }
.http-pane--2xx { border-top: 3px solid var(--pass); } .http-pane--4xx, .http-pane--5xx { border-top: 3px solid var(--margin); }

.blk-diff { border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); padding: 12px; }
.diff-title { margin-bottom: 8px; font: 400 12.5px/1 var(--mono); color: var(--ink-2); }
.diff-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.diff-split > div { min-width: 0; }
.diff-old .blk-code { background: color-mix(in srgb, var(--margin) 8%, var(--paper-2)); }
.diff-new .blk-code { background: color-mix(in srgb, var(--pass) 8%, var(--paper-2)); }
.diff-old .ep-label { color: var(--margin); } .diff-new .ep-label { color: var(--pass); }
.diff-unified span { display: block; margin: 0 -14px; padding: 0 14px; }
.diff-unified .d-add { background: color-mix(in srgb, var(--pass) 12%, transparent); color: inherit; }
.diff-unified .d-del { background: color-mix(in srgb, var(--margin) 12%, transparent); color: inherit; }

/* ---------- tests: a CI run ---------- */
.blk-tests { padding: 16px 18px; border: 1px solid var(--rule-2); border-left: 4px solid var(--pass); border-radius: 6px 10px 10px 6px; background: var(--card); }
.blk-tests.is-fail { border-left-color: var(--margin); }
.tests-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 400 13px/1.4 var(--mono); color: var(--ink-2); }
.tests-title { display: inline-flex; align-items: center; gap: 7px; }
.tests-time { color: var(--ink-3); }
.tests-bar { display: flex; height: 8px; margin-top: 12px; border-radius: 4px; overflow: hidden; background: var(--paper-2); }
.tests-bar i { display: block; }
.tests-bar .t-pass { background: var(--pass); } .tests-bar .t-fail { background: var(--margin); } .tests-bar .t-skip { background: var(--ink-3); opacity: 0.5; }
.tests-sum { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 14.5px; }
.tests-sum b { font-weight: 600; }
.tests-sum .t-pass { color: var(--pass); } .tests-sum .t-fail { color: var(--margin); } .tests-sum .t-skip { color: var(--ink-3); }
.tests-sum span { margin-left: auto; font: 600 20px/1 var(--hand); color: var(--ink-3); }
.tests-list { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--rule-2); display: grid; gap: 4px; }
.tests-list li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.tests-list .t-pass span { color: var(--pass); } .tests-list .t-fail span { color: var(--margin); } .tests-list .t-skip span { color: var(--ink-3); }
.tests-list code { padding: 0; background: none; font-size: 12.5px; color: var(--ink-2); }
.tests-list .t-fail code { color: var(--margin); }

/* ---------- tree ---------- */
.blk-tree { border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); padding: 14px 18px; }
.tree-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font: 600 14px/1 var(--sans); }
.prose .tree-body { margin: 0; padding: 0; background: none; border: 0; font: 400 13.5px/1.75 var(--mono); overflow-x: auto; }
.tree-guide { color: var(--rule-2); color: color-mix(in srgb, var(--ink-3) 55%, transparent); }
.tree-dir { color: var(--pen); font-weight: 600; }
.tree-note { color: var(--ink-3); font-style: italic; }
.tree-line.is-mark { background: var(--marker); }

/* ---------- database table ---------- */
.blk-db { width: fit-content; max-width: 100%; border: 1.5px solid var(--ink-2); border-radius: 8px; overflow: hidden; background: var(--card); }
.db-name { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--ink); color: var(--card); font: 600 14px/1 var(--mono); }
.db-name .i { width: 16px; height: 16px; }
.db-name em { font: italic 400 13px var(--serif); opacity: 0.7; }
.prose .db-cols { width: auto; min-width: 300px; font-size: 13.5px; }
.db-cols th, .db-cols td { padding: 7px 14px; border: 0; border-top: 1px solid var(--rule); text-align: left; vertical-align: baseline; }
.db-cols tr:first-child :is(th, td) { border-top: 0; }
.db-cols th { font: 600 13.5px var(--mono); white-space: nowrap; }
.db-type { font-family: var(--mono); color: var(--ink-3); white-space: nowrap; }
.db-tag { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px; font: 400 11.5px/1.5 var(--mono); background: var(--paper-2); color: var(--ink-2); }
.db-pk { background: #e8c25a; color: #3a2e05; }
.db-fk { background: color-mix(in srgb, var(--pen) 14%, transparent); color: var(--pen); }
.db-note { font-size: 12.5px; color: var(--ink-3); font-style: italic; }

/* ---------- bench ---------- */
.blk-bench { padding: 16px 18px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); }
.bench-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-weight: 600; font-size: 15px; }
.bench-title span { font: 400 12px var(--mono); color: var(--ink-3); }
.bench-rows { display: grid; gap: 8px; }
.bench-rows li { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; align-items: center; gap: 4px 12px; font-size: 14px; }
.bench-track { height: 14px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.bench-track i { display: block; height: 100%; background: var(--ink-3); border-radius: 3px; opacity: 0.55; }
.bench-rows .is-best .bench-track i { background: var(--pass); opacity: 1; }
.bench-val { font: 400 13px var(--mono); text-align: right; }
.bench-rows .is-best .bench-val { color: var(--pass); font-weight: 700; }
.bench-note { grid-column: 2 / -1; font: 600 18px/1 var(--hand); color: var(--pass); }

/* ---------- error ---------- */
.blk-error { border: 1px solid color-mix(in srgb, var(--margin) 40%, transparent); border-radius: 10px; overflow: hidden; background: var(--card); }
.err-head { display: flex; align-items: center; gap: 9px; padding: 10px 16px; background: color-mix(in srgb, var(--margin) 12%, var(--card)); color: var(--margin); font-weight: 600; font-size: 15px; }
.err-x { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--margin); color: var(--card); font-size: 12px; }
.prose .err-msg { margin: 0; padding: 14px 16px; border: 0; border-radius: 0; background: #1d1b18; background-image: none; color: #f3a99f; font: 400 13px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }
.err-part { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--rule); font-size: 15.5px; }
.err-part .hand { font-size: 22px; color: var(--margin); }
.err-part:last-child .hand { color: var(--pass); }

/* ---------- commit ---------- */
.blk-commit { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 14px 16px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); }
.commit-dot { width: 14px; height: 14px; margin-top: 4px; border: 3px solid var(--pen); border-radius: 50%; background: var(--card); box-shadow: 0 0 0 4px var(--card); }
.commit-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 400 12.5px var(--mono); color: var(--ink-3); }
.commit-meta code { padding: 0; background: none; color: var(--pen); font-size: 12.5px; }
.commit-branch { padding: 0 6px; border: 1px solid var(--rule-2); border-radius: 999px; }
.commit-subject { margin-top: 4px; font-weight: 600; font-size: 16px; }
.prose .commit-body { margin-top: 6px; padding: 0; border: 0; background: none; font: 400 13.5px/1.6 var(--mono); color: var(--ink-2); white-space: pre-wrap; }

/* ---------- ADR: a form ---------- */
.blk-adr { border: 1.5px solid var(--ink-2); border-radius: 4px; background: var(--card); }
.adr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 18px; border-bottom: 1.5px solid var(--ink-2); }
.adr-id { font: 700 13px var(--mono); color: var(--ink-3); }
.adr-title { flex: 1; font: 560 19px/1.3 var(--display); }
.adr-status { padding: 3px 9px; border: 1.5px solid currentColor; border-radius: 4px; font: 700 11.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--pass); rotate: -3deg; }
.adr-status--proposed { color: var(--pen); } .adr-status--superseded, .adr-status--rejected { color: var(--margin); }
.adr-date { padding: 6px 18px 0; font: 400 12px var(--mono); color: var(--ink-3); }
.adr-body > div { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 12px 18px; border-top: 1px dashed var(--rule-2); }
.adr-body > div:first-child { border-top: 0; }
.adr-body dt { font: 600 21px/1.2 var(--hand); color: var(--margin); }
.adr-body dd { font-size: 15.5px; }
.adr-body dd > * + * { margin-top: 0.5em; }

/* ---------- research: model, results, confusion, sparkline ---------- */
.blk-model { padding: 18px 20px; border: 1px solid var(--rule-2); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.model-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.model-glyph { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #ffd21e; color: #1d1b18; }
.model-glyph .m { width: 24px; height: 24px; }
.model-kicker { font: 400 11.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.model-name { font: 600 18px/1.25 var(--mono); word-break: break-all; }
.facts--model dt { font: 400 12.5px/1.6 var(--mono); }

.blk-results { overflow-x: auto; }
.prose .blk-results table { font-variant-numeric: tabular-nums; }
.blk-results caption { caption-side: bottom; padding-top: 8px; text-align: left; font-size: 13px; color: var(--ink-3); }
.blk-results th[scope="col"] { white-space: nowrap; }
.blk-results td { white-space: nowrap; }
.prose .blk-results tbody th { border-bottom: 1px solid var(--rule); }
.blk-results td.is-best { background: color-mix(in srgb, var(--pass) 10%, transparent); }
.res-dir { color: var(--ink-3); font-weight: 400; }
.res-tag { margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: var(--paper-2); font: 400 11px var(--mono); color: var(--ink-3); }
.blk-results tr.is-base { color: var(--ink-3); }
.res-delta { margin-left: 6px; font: 400 11.5px var(--mono); }
.res-delta.is-up { color: var(--pass); } .res-delta.is-down { color: var(--margin); }

.blk-confusion { overflow-x: auto; }
.prose .blk-confusion table { width: auto; border-collapse: separate; border-spacing: 3px; font: 400 14px var(--mono); }
.blk-confusion caption { caption-side: bottom; padding-top: 6px; font: 400 12px var(--sans); color: var(--ink-3); text-align: left; }
.blk-confusion th { padding: 4px 8px; border: 0; font: 400 12px var(--sans); color: var(--ink-3); background: none; }
.prose .blk-confusion td { vertical-align: middle; min-width: 52px; height: 44px; padding: 0; border: 0; border-radius: 5px; text-align: center; }
.blk-confusion td.is-diag { background: color-mix(in srgb, var(--pass) calc(var(--v) * 0.6), var(--paper-2)); }
.blk-confusion td.is-off { background: color-mix(in srgb, var(--margin) calc(var(--v) * 0.6), var(--paper-2)); }

.blk-spark { display: inline-flex; align-items: center; gap: 6px; vertical-align: -5px; }
.spark-svg { overflow: visible; }
.spark-svg polyline { fill: none; stroke: var(--pen); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-svg circle { fill: var(--pen); }
.spark-label { font-size: 0.85em; color: var(--ink-3); }
.blk-spark--large { display: block; padding: 14px 16px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); }
.blk-spark--large .spark-svg { width: 100%; height: auto; }
.spark-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 14px; color: var(--ink-2); }
.spark-range { font: 400 13px var(--mono); color: var(--ink-3); }
.spark-range b { color: var(--pen); }

/* ---------- chat with a model ---------- */
.blk-chat { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--rule-2); border-radius: 14px; background: var(--paper-2); }
.chat-top { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); }
.chat-msg { display: grid; gap: 3px; max-width: 86%; }
.chat-msg.is-me { justify-self: end; justify-items: end; }
.chat-who { font: 400 11.5px var(--mono); color: var(--ink-3); text-transform: lowercase; }
.chat-bubble { padding: 10px 14px; border-radius: 14px; font-size: 15.5px; line-height: 1.55; }
.chat-bubble > * + * { margin-top: 0.5em; }
.is-me .chat-bubble { background: var(--pen); color: #fff; border-bottom-right-radius: 4px; }
.is-me .chat-bubble code { background: rgb(255 255 255 / 0.18); color: inherit; }
.is-ai .chat-bubble { background: var(--card); border: 1px solid var(--rule); border-bottom-left-radius: 4px; }
[data-theme="dark"] .is-me .chat-bubble { background: #3557a8; }

/* ---------- prompt: an index card ---------- */
.blk-prompt { position: relative; padding: 16px 20px 18px; background: var(--card); border-radius: 3px; box-shadow: var(--shadow);
  background-image: linear-gradient(transparent 31px, color-mix(in srgb, var(--pen) 16%, transparent) 31px, color-mix(in srgb, var(--pen) 16%, transparent) 32px, transparent 32px), linear-gradient(90deg, transparent 0, transparent 100%);
  border-top: 3px solid color-mix(in srgb, var(--margin) 50%, transparent); }
.prompt-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-weight: 600; }
.prompt-title .hand { font-size: 22px; }
.prompt-part + .prompt-part { margin-top: 12px; }
.prompt-bar { display: flex; justify-content: space-between; align-items: center; }
.prompt-role { font: 400 11.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.prose .prompt-text { margin: 4px 0 0; padding: 10px 12px; border: 1px dashed var(--rule-2); border-radius: 6px; background: none; font: 400 13.5px/1.6 var(--mono); white-space: pre-wrap; }

/* ---------- hypothesis: a notebook page with a verdict stamp ---------- */
.blk-hypo { position: relative; padding: 16px 20px 56px 46px; border-radius: 4px; background-color: var(--card); box-shadow: var(--shadow);
  background-image: linear-gradient(90deg, transparent 32px, color-mix(in srgb, var(--margin) 45%, transparent) 32px, color-mix(in srgb, var(--margin) 45%, transparent) 33px, transparent 33px),
    repeating-linear-gradient(transparent 0 27px, var(--card-rule) 27px 28px); }
.hypo-date { font: 400 12px var(--mono); color: var(--ink-3); margin-bottom: 4px; }
.hypo-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 5px 0; font-size: 15.5px; }
.hypo-row .hand { font-size: 22px; color: var(--pen); }
.hypo-stamp { position: absolute; right: 18px; bottom: 14px; top: auto; rotate: -8deg; }
.hypo--right .hypo-stamp, .hypo--confirmed .hypo-stamp { color: var(--pass); border-color: var(--pass); outline-color: var(--pass); }
.hypo--wrong .hypo-stamp { color: var(--margin); border-color: var(--margin); outline-color: var(--margin); }
.hypo--mixed .hypo-stamp { color: #a8742a; border-color: #a8742a; outline-color: #a8742a; }

/* ---------- writing: tl;dr, timeline, steps, pros/cons, stats ---------- */
.blk-tldr { position: relative; padding: 16px 20px; border: 2px solid var(--ink); border-radius: 4px; box-shadow: 5px 5px 0 var(--ink); background: var(--card); }
.tldr-h { margin-bottom: 6px; font: 700 23px/1 var(--hand); color: var(--margin); }

.prose ol.blk-timeline { position: relative; display: grid; gap: 18px; padding-left: 28px; }
.blk-timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; border-left: 2px dotted var(--rule-2); }
.blk-timeline li { position: relative; }
.blk-timeline li::before { content: ""; position: absolute; left: -28px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--pen); }
.blk-timeline li:last-child::before { background: var(--pen); }
.tl-when { display: block; font: 400 12.5px/1.4 var(--mono); color: var(--ink-3); }
.tl-what { font: 560 18px/1.35 var(--display); }
.blk-timeline .blk-prose { margin-top: 4px; font-size: 15.5px; color: var(--ink-2); }

.blk-steps { counter-reset: step; display: grid; gap: 4px; }
.blk-steps li { counter-increment: step; position: relative; padding: 0 0 14px 48px; }
.blk-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--ink); border-radius: 50%; font: 700 14px var(--mono); background: var(--card); }
.blk-steps li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; border-left: 2px solid var(--rule-2); }
.blk-steps li.is-done::before { content: "✓"; background: var(--pass); border-color: var(--pass); color: var(--card); }
.step-h { padding-top: 4px; font-weight: 600; font-size: 16.5px; }
.blk-steps .blk-prose { margin-top: 4px; font-size: 15.5px; color: var(--ink-2); }

.blk-pc { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 14px; }
.blk-pc > div { padding: 14px 16px; border-radius: 8px; background: var(--card); border: 1px solid var(--rule-2); }
.pc-h { margin-bottom: 8px; font: 700 22px/1 var(--hand); }
.blk-pc > .pc-pro { border-top: 4px solid var(--pass); } .pc-pro .pc-h { color: var(--pass); }
.blk-pc > .pc-con { border-top: 4px solid var(--margin); } .pc-con .pc-h { color: var(--margin); }
.blk-pc > .pc-col { border-top: 4px solid var(--pen); } .pc-col .pc-h { color: var(--pen); }
.blk-pc .blk-prose { font-size: 15px; }
@media (max-width: 640px) { .blk-pc { grid-template-columns: 1fr; } }

.blk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.blk-stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 14px 16px; border-radius: 8px; background: var(--card); border: 1px solid var(--rule-2); }
.blk-stats dd { font: 600 38px/1 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.blk-stats dt { margin-top: 6px; font-size: 14px; color: var(--ink-3); }
.stat-note { order: -1; margin-top: 4px; font: 600 18px/1.1 var(--hand); color: var(--pass); }

/* ---------- receipt: thermal paper with a torn edge ---------- */
.blk-receipt { display: flex; justify-content: center; }
.rc-paper { width: min(330px, 100%); padding: 22px 22px 30px; background: #fbf9f3; color: #2b2925; font: 400 13.5px/1.6 var(--mono); box-shadow: var(--shadow-lift); rotate: 0.6deg;
  -webkit-mask: radial-gradient(circle 7px at 50% 100%, transparent 6.5px, #000 7px) 0 0 / 16px 100% repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, radial-gradient(circle 6px at 50% 100%, transparent 5.5px, #000 6px) bottom / 14px 9px repeat-x; }
.rc-shop { text-align: center; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.rc-date { text-align: center; color: #7a756b; }
.rc-lines { margin-top: 12px; padding-top: 10px; border-top: 1.5px dashed #b8b2a4; }
.rc-lines > div { display: flex; gap: 8px; }
.rc-lines dt { flex: 1; overflow: hidden; white-space: nowrap; }
.rc-lines dt::after { content: " ................................................................"; color: #b8b2a4; }
.rc-lines dd { white-space: nowrap; }
.rc-total { margin-top: 8px; padding-top: 8px; border-top: 1.5px dashed #b8b2a4; font-weight: 700; font-size: 15px; }
.rc-total dt::after { content: none; }
.rc-foot { margin-top: 14px; text-align: center; color: #7a756b; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; }

/* ---------- phone ---------- */
.blk-phone { display: grid; justify-items: center; gap: 10px; }
.phone-body { position: relative; width: min(270px, 80%); padding: 12px; border-radius: 38px; background: #1d1b18; box-shadow: var(--shadow-lift), inset 0 0 0 2px #3a3631; }
.phone-body img { display: block; width: 100%; height: auto; border-radius: 27px; }
.phone-notch { position: absolute; top: 20px; left: 50%; translate: -50% 0; width: 70px; height: 20px; border-radius: 999px; background: #1d1b18; z-index: 1; }
.phone-cap { font: 600 19px/1.2 var(--hand); color: var(--ink-2); text-align: center; }

/* ---------- glossary ---------- */
.blk-gloss { padding: 14px 18px; border-radius: 6px; background: color-mix(in srgb, var(--pen) 5%, var(--card)); border: 1px solid color-mix(in srgb, var(--pen) 22%, transparent); }
.gloss-h .hand { font-size: 22px; color: var(--pen); }
.blk-gloss dl > div { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: 14px; padding: 7px 0; border-top: 1px dotted var(--rule-2); }
.blk-gloss dl > div:first-child { border-top: 0; }
.blk-gloss dt { font: 600 14px/1.5 var(--mono); color: var(--pen); }
.blk-gloss dd { font-size: 15.5px; }

/* ---------- flashcard ---------- */
.blk-flash { border-radius: 10px; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--rule-2); }
.blk-flash summary { display: grid; gap: 4px; padding: 18px 20px; cursor: pointer; list-style: none; }
.blk-flash summary::-webkit-details-marker { display: none; }
.flash-q { font: 560 19px/1.35 var(--display); }
.flash-q::before { content: var(--t-flashQ); color: var(--margin); }
.flash-hint { font: 600 17px/1 var(--hand); color: var(--ink-3); }
.blk-flash[open] .flash-hint { display: none; }
.flash-a { padding: 14px 20px 18px; border-top: 1px dashed var(--rule-2); font-size: 15.5px; }
.flash-a::before { content: var(--t-flashA); float: left; margin-right: 8px; font: 560 19px/1.35 var(--display); color: var(--pass); }

/* ---------- bug ticket ---------- */
.blk-ticket { border: 1px solid var(--rule-2); border-radius: 8px; background: var(--card); overflow: hidden; --sev: #a8742a; }
.sev--high, .sev--critical { --sev: var(--margin); } .sev--low { --sev: var(--ink-3); }
.tk-head { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-left: 5px solid var(--sev); background: var(--paper-2); font: 400 12.5px var(--mono); }
.tk-id { font-weight: 700; }
.tk-sev { padding: 1px 7px; border-radius: 4px; background: var(--sev); color: var(--card); text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; }
.tk-status { margin-left: auto; color: var(--pass); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11.5px; }
.tk-title { padding: 12px 16px 0 21px; font: 560 19px/1.3 var(--display); }
.tk-body { padding: 6px 16px 14px 21px; }
.tk-body > div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding-top: 8px; }
.tk-body dt { font: 400 11.5px/2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.tk-body dd { font-size: 15.5px; }

/* ---------- messages ---------- */
.blk-msgs { max-width: 420px; margin-inline: auto; border-radius: 16px; overflow: hidden; border: 1px solid var(--rule-2); background: #e9e2d6; }
[data-theme="dark"] .blk-msgs { background: #14120f; }
.msgs-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #2d5f52; color: #fff; font-weight: 600; font-size: 15px; }
.msgs-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgb(255 255 255 / 0.2); font-size: 14px; }
.msgs-list { display: grid; gap: 6px; padding: 14px 12px; }
.msg { position: relative; max-width: 80%; padding: 7px 10px 18px; border-radius: 10px; font-size: 15px; line-height: 1.45; box-shadow: 0 1px 1px rgb(0 0 0 / 0.08); }
.msg.is-them { justify-self: start; background: #fff; color: #1d1b18; border-top-left-radius: 2px; }
.msg.is-me { justify-self: end; background: #d4f5c4; color: #1d1b18; border-top-right-radius: 2px; }
[data-theme="dark"] .msg.is-them { background: #26231f; color: #ede6d9; } [data-theme="dark"] .msg.is-me { background: #1f4a3b; color: #ede6d9; }
.msg-time { position: absolute; right: 8px; bottom: 3px; font-size: 10.5px; opacity: 0.55; }
.msg.is-me .msg-time { color: #2a7fb8; opacity: 0.9; }

/* ---------- keys and quote ---------- */
.blk-keys { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.blk-keys > span { color: var(--ink-3); font-size: 0.8em; }
.prose kbd, .blk-keys kbd { display: inline-block; min-width: 1.8em; padding: 0.1em 0.45em; border: 1px solid var(--rule-2); border-bottom-width: 3px; border-radius: 5px; background: var(--card); font: 500 0.8em/1.5 var(--mono); text-align: center; }

.blk-quote { position: relative; padding: 8px 0 0 54px; }
.blk-quote::before { content: "“"; position: absolute; left: 0; top: -14px; font: 700 96px/1 var(--display); color: var(--margin); opacity: 0.8; }
.prose .blk-quote blockquote { padding: 0; border: 0; font: italic 400 clamp(21px, 2.6vw, 26px)/1.45 var(--serif); color: var(--ink); background: none; }
.quote-by { margin-top: 10px; font-size: 14.5px; color: var(--ink-3); }
.quote-by cite { font-style: italic; }

/* ======================================================================
   Media cards. A stand-in cover (.md-standin) is drawn from the title's hue
   when no image is given.
   ====================================================================== */
div.md-standin { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 12px; overflow: hidden; color: #fff;
  background: linear-gradient(160deg, hsl(var(--h) 45% 42%), hsl(calc(var(--h) + 40) 50% 22%)); }
.md-standin-t { font: 600 17px/1.15 var(--display); text-wrap: balance; }
.md-standin-s { font: 400 11px/1.3 var(--mono); opacity: 0.8; text-transform: uppercase; letter-spacing: 0.08em; }
.md-stars { display: inline-flex; gap: 1px; margin-top: 8px; font-size: 17px; line-height: 1; }
.md-stars i { font-style: normal; color: var(--rule-2); }
.md-stars i.on { color: #e8a723; }
.md-stars i.half { background: linear-gradient(90deg, #e8a723 50%, var(--rule-2) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* movie: a poster beside a cinema ticket */
.blk-movie { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 16px; border-radius: 12px; background: #1d1b18; color: #ede6d9; box-shadow: var(--shadow-lift); }
.mv-poster-wrap { position: relative; }
.mv-poster { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: 0 8px 20px -6px rgb(0 0 0 / 0.6); }
.mv-poster.md-standin { padding: 14px 12px; }
.mv-poster .md-standin-t { font-size: 20px; }
.mv-info { min-width: 0; padding-top: 2px; }
.mv-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mv-ticket { position: relative; padding: 3px 12px; background: hsl(var(--h) 60% 55%); color: #1d1b18; font: 700 11px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  -webkit-mask: radial-gradient(circle 4px at 0 50%, transparent 3.5px, #000 4px) left / 51% 100% no-repeat, radial-gradient(circle 4px at 100% 50%, transparent 3.5px, #000 4px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 4px at 0 50%, transparent 3.5px, #000 4px) left / 51% 100% no-repeat, radial-gradient(circle 4px at 100% 50%, transparent 3.5px, #000 4px) right / 51% 100% no-repeat; }
.mv-watched { font: 400 12px var(--mono); color: #9e968a; }
.mv-title { margin-top: 10px; font: italic 500 clamp(24px, 3.2vw, 30px)/1.1 var(--display); font-variation-settings: "SOFT" 100, "WONK" 1; }
.mv-title a { color: inherit; }
.blk-movie .md-meta { margin-top: 6px; color: #9e968a; }
.mv-credit { margin-top: 6px; font-size: 14.5px; }
.mv-credit span { font: 400 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #9e968a; }
.blk-movie .md-note { color: #d8d0c2; border-top: 1px solid rgb(255 255 255 / 0.1); padding-top: 10px; }
.blk-movie .md-stars i { color: rgb(255 255 255 / 0.18); }
.blk-movie .md-stars i.on { color: #f6c445; }

/* book: a cover on a shelf */
.blk-book { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: start; padding: 16px 18px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); }
.bk-cover-wrap { position: relative; }
.bk-cover { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 6px 6px 2px; box-shadow: inset 6px 0 8px -4px rgb(0 0 0 / 0.35), 4px 6px 14px -4px rgb(0 0 0 / 0.35); }
.bk-cover.md-standin { justify-content: space-between; padding: 14px 12px 12px 16px; }
.bk-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font: 400 11.5px var(--mono); background: var(--paper-2); color: var(--ink-2); }
.bk-status--reading { background: color-mix(in srgb, var(--pen) 14%, transparent); color: var(--pen); }
.bk-status--read { background: color-mix(in srgb, var(--pass) 14%, transparent); color: var(--pass); }
.bk-title { margin-top: 8px; font: 560 21px/1.25 var(--display); }
.bk-progress { position: relative; height: 6px; margin-top: 10px; border-radius: 3px; background: var(--paper-2); max-width: 240px; }
.bk-progress span { display: block; height: 100%; border-radius: 3px; background: var(--pen); }
.bk-progress em { position: absolute; right: -40px; top: -6px; font: 400 11.5px var(--mono); color: var(--ink-3); font-style: normal; }

/* album: a record sliding out of its sleeve */
.blk-album { display: grid; grid-template-columns: 190px 1fr; gap: 22px; align-items: center; padding: 18px; border-radius: 12px; background: linear-gradient(135deg, hsl(var(--h) 30% 92%), var(--card)); border: 1px solid var(--rule-2); }
[data-theme="dark"] .blk-album { background: linear-gradient(135deg, hsl(var(--h) 25% 18%), var(--card)); }
.al-deck { position: relative; width: 150px; height: 150px; }
.al-cover { position: relative; z-index: 1; display: block; width: 150px; height: 150px; object-fit: cover; border-radius: 3px; box-shadow: 4px 6px 16px -4px rgb(0 0 0 / 0.4); }
.al-vinyl { position: absolute; top: 5px; left: 36px; width: 140px; height: 140px; border-radius: 50%; background: repeating-radial-gradient(#151412 0 2px, #22201c 2px 4px); box-shadow: 0 4px 12px rgb(0 0 0 / 0.35); }
.al-label { position: absolute; inset: 50px; border-radius: 50%; background: hsl(var(--h) 60% 55%); }
.al-label::after { content: ""; position: absolute; inset: 17px; border-radius: 50%; background: #151412; }
@media (prefers-reduced-motion: no-preference) { .blk-album:hover .al-vinyl { animation: spin 3s linear infinite; } }
@keyframes spin { to { rotate: 360deg; } }
.al-now { font: 600 19px/1 var(--hand); color: hsl(var(--h) 50% 40%); }
[data-theme="dark"] .al-now { color: hsl(var(--h) 60% 70%); }
.al-title { margin-top: 4px; font: 560 22px/1.2 var(--display); }
.al-track { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); }

/* podcast: an episode with a waveform */
.blk-podcast { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start; padding: 16px; border: 1px solid var(--rule-2); border-radius: 12px; background: var(--card); }
.pc-cover { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.pc-cover.md-standin { padding: 8px; }
.pc-cover .md-standin-t { font-size: 13px; }
.pc-show { font: 400 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: hsl(var(--h) 45% 42%); }
[data-theme="dark"] .pc-show { color: hsl(var(--h) 55% 68%); }
.pc-ep { margin-top: 2px; font: 560 19px/1.3 var(--display); }
.pc-wave { display: flex; align-items: center; gap: 2px; height: 28px; margin: 10px 0 6px; }
.pc-wave i { flex: 1; min-height: 3px; border-radius: 2px; background: hsl(var(--h) 45% 50%); opacity: 0.7; }
.pc-wave i:nth-child(n + 18) { background: var(--rule-2); opacity: 1; }

/* place: a postcard, front and back */
.blk-postcard { display: grid; grid-template-columns: 1.1fr 1fr; background: #fbf8f1; color: #2b2925; border-radius: 4px; box-shadow: var(--shadow-lift); rotate: -0.5deg; overflow: hidden; }
[data-theme="dark"] .blk-postcard { background: #2b2824; color: #ede6d9; }
.post-front { position: relative; min-height: 200px; }
.post-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-photo.md-standin { justify-content: flex-start; height: 100%; }
.post-photo.md-standin .md-standin-t { display: none; }
.post-photo.md-standin .md-standin-s { display: none; }
.post-greet { position: absolute; left: 14px; bottom: 12px; right: 14px; color: #fff; font: 600 21px/1.1 var(--hand); text-shadow: 0 1px 6px rgb(0 0 0 / 0.5); }
.post-greet b { display: block; font: italic 600 30px/1.05 var(--display); }
.post-back { display: grid; grid-template-columns: 1fr 110px; gap: 14px; padding: 16px 18px; }
.post-msg { font: 500 21px/1.3 var(--hand); padding-right: 14px; border-right: 1px solid color-mix(in srgb, currentColor 20%, transparent); }
.post-addr { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.post-stamp { display: grid; place-items: center; width: 56px; height: 66px; border: 3px dotted color-mix(in srgb, currentColor 30%, transparent); background: hsl(var(--h) 45% 55%); color: #fff; }
.post-stamp .i { width: 26px; height: 26px; }
.post-mark { font: 400 11px var(--mono); padding: 6px; border: 1.5px solid color-mix(in srgb, currentColor 40%, transparent); border-radius: 50%; rotate: -12deg; text-align: center; opacity: 0.7; }
.post-addr p { width: 100%; padding-top: 4px; border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); font-size: 13px; text-align: left; }
@media (max-width: 640px) { .blk-postcard { grid-template-columns: 1fr; } .post-back { grid-template-columns: 1fr; } .post-msg { border-right: 0; padding-right: 0; } .post-addr { flex-direction: row; align-items: center; } }

/* certificate */
.blk-cert { padding: 10px; background: var(--card); border: 1px solid var(--rule-2); box-shadow: var(--shadow); }
.cert-inner { padding: 26px 24px 22px; border: 2px double color-mix(in srgb, #a8742a 60%, transparent); text-align: center; font-family: var(--serif); }
.cert-kicker { font: 400 11.5px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: #a8742a; }
.cert-title { margin-top: 8px; font: 560 clamp(22px, 3vw, 28px)/1.2 var(--display); }
.cert-to { margin-top: 10px; font: italic 400 19px var(--serif); color: var(--ink-2); }
.blk-cert .md-note { max-width: 32em; margin-inline: auto; }
.cert-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin-top: 18px; font-size: 14px; color: var(--ink-3); }
.cert-foot span:first-child { text-align: right; } .cert-foot span:last-child { text-align: left; }
.cert-seal { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle, #d9a440 55%, #b5852a 56%); color: #fff7e0; font-size: 22px; box-shadow: 0 0 0 4px color-mix(in srgb, #d9a440 30%, transparent); }
.cert-verify { margin-top: 12px; font: 400 12px var(--mono); }

/* event: a ticket with a perforated stub */
.blk-event { display: grid; grid-template-columns: 1fr 150px; border-radius: 10px; background: var(--card); border: 1px solid var(--rule-2); box-shadow: var(--shadow); overflow: hidden; }
.ev-main { padding: 16px 20px; border-left: 6px solid hsl(var(--h) 50% 50%); }
.ev-kind { font: 400 11px var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.ev-name { margin-top: 4px; font: 560 22px/1.2 var(--display); }
.ev-stub { position: relative; display: grid; align-content: center; gap: 8px; padding: 14px 16px; border-left: 2px dashed var(--rule-2); background: color-mix(in srgb, hsl(var(--h) 50% 50%) 8%, var(--card)); font-size: 14px; }
.ev-stub::before, .ev-stub::after { content: ""; position: absolute; left: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); }
.ev-stub::before { top: -11px; } .ev-stub::after { bottom: -11px; }
.ev-stub span { display: block; font: 400 10.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.ev-result { font: 600 16px var(--sans); color: var(--pass); }
.ev-no { font: 400 11px var(--mono); color: var(--ink-3); }
@media (max-width: 560px) { .blk-event { grid-template-columns: 1fr; } .ev-stub { border-left: 0; border-top: 2px dashed var(--rule-2); grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); } .ev-stub::before, .ev-stub::after { display: none; } }

/* app: a store listing */
.blk-app { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: start; padding: 16px; border: 1px solid var(--rule-2); border-radius: 14px; background: var(--card); }
.app-icon { display: block; width: 64px; height: 64px; border-radius: 15px; object-fit: cover; box-shadow: 0 2px 6px rgb(0 0 0 / 0.15); }
.app-icon--letter { display: grid; place-items: center; background: linear-gradient(145deg, hsl(var(--h) 60% 58%), hsl(calc(var(--h) + 30) 55% 40%)); color: #fff; font: 600 28px var(--display); }
.app-name { font-weight: 600; font-size: 17px; }
.blk-app .md-note { margin-top: 6px; font-size: 15px; }
.prose .app-get { text-decoration: none; }
.app-get { align-self: center; padding: 6px 16px; border-radius: 999px; background: var(--paper-2); font: 700 13px var(--sans); color: var(--pen); text-transform: uppercase; letter-spacing: 0.04em; }
.app-get:hover { background: var(--pen); color: var(--card); text-decoration: none; }

/* game: a cartridge */
.blk-game { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 16px; border-radius: 12px; background: linear-gradient(160deg, hsl(var(--h) 35% 20%), #15130f); color: #ede6d9; box-shadow: var(--shadow-lift); }
.gm-cart { padding: 10px 10px 18px; border-radius: 8px 8px 4px 4px; background: #3a3631; box-shadow: inset 0 -6px 0 #2a2723; clip-path: polygon(0 0, 100% 0, 100% 100%, 82% 100%, 82% 94%, 18% 94%, 18% 100%, 0 100%); }
.gm-cover { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.gm-press { font: 400 11px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: hsl(var(--h) 70% 70%); }
@media (prefers-reduced-motion: no-preference) { .gm-press { animation: blink 1.4s steps(1) infinite; } }
.gm-title { margin-top: 6px; font: 700 24px/1.15 var(--mono); letter-spacing: -0.02em; }
.gm-title a { color: inherit; }
.blk-game .md-meta { color: #9e968a; margin-top: 4px; }
.gm-hours { margin-top: 8px; font: 400 13px var(--mono); color: #c9c1b3; }
.blk-game .md-note { color: #d8d0c2; }
.blk-game .md-stars i { color: rgb(255 255 255 / 0.18); }
.blk-game .md-stars i.on { color: #f6c445; }

/* phones: media cards stack */
@media (max-width: 560px) {
  .blk-movie, .blk-book, .blk-game { grid-template-columns: 100px 1fr; gap: 14px; }
  .blk-album { grid-template-columns: 1fr; }
  .blk-app { grid-template-columns: 52px 1fr; }
  .app-icon { width: 52px; height: 52px; }
  .app-get { grid-column: 2; justify-self: start; }
  .err-part, .adr-body > div, .hypo-row, .tk-body > div { grid-template-columns: 1fr; gap: 2px; }
  .blk-hypo { padding-left: 40px; }
}

/* ======================================================================
   Social posts and comment threads. A neutral card in the house style with the
   network's colour as an accent, not a copy of its interface.
   ====================================================================== */
.blk .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.blk-social, .blk-comments { --so: var(--ink-2); }
.so--x, .so--threads, .so--devto, .so--github { --so: var(--ink); }
.so--bluesky { --so: #1185fe; } .so--mastodon { --so: #6364ff; } .so--facebook { --so: #1877f2; } .so--linkedin { --so: #0a66c2; }
.so--reddit { --so: #ff4500; } .so--instagram { --so: #d62976; } .so--youtube { --so: #ff0033; } .so--hackernews { --so: #ff6600; }
.so--discord { --so: #5865f2; } .so--stackoverflow { --so: #f48024; } .so--blog { --so: var(--pen); }
[data-theme="dark"] :is(.so--linkedin, .so--facebook) { --so: #5aa2ff; }

.blk-social { position: relative; max-width: 560px; margin-inline: auto; padding: 16px 18px; border: 1px solid var(--rule-2); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); font-size: 15.5px; }
.so-head { display: flex; align-items: center; gap: 10px; }
.so-avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.so-avatar--letter { display: grid; place-items: center; background: hsl(var(--h) 45% 50%); color: #fff; font: 600 17px var(--sans); }
.so-who { display: grid; min-width: 0; line-height: 1.3; }
.so-who b { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.so-sub, .so-role { font-size: 13.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-check { width: 16px; height: 16px; fill: var(--so); flex: none; }
.so--x .so-check, .so--threads .so-check { fill: #1d9bf0; }
.so-brand { margin-left: auto; color: var(--so); align-self: flex-start; }
.so-brand .m { width: 18px; height: 18px; }
.so-text { margin-top: 10px; line-height: 1.55; }
.so-text a { color: var(--so); }
.so--x .so-text a, .so--threads .so-text a { color: #1d9bf0; }
.so-media { display: block; width: 100%; height: auto; margin-top: 12px; border-radius: 12px; border: 1px solid var(--rule); }
.so-foot { margin-top: 10px; font-size: 13.5px; color: var(--ink-3); }
.so-date { color: inherit; text-decoration: none; }
.prose .blk-social a.so-date { color: var(--ink-3); text-decoration: none; }
.so-actions { display: flex; flex-wrap: wrap; gap: 6px 26px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 13.5px; color: var(--ink-3); }
.so-stat { display: inline-flex; align-items: center; gap: 6px; }
.so-stat .i { width: 17px; height: 17px; }
.so-save { margin-left: auto; }
/* facebook / linkedin */
.so-layout--feed { border-radius: 10px; }
.so-layout--feed .so-avatar { width: 46px; height: 46px; }
.so--linkedin .so-avatar { border-radius: 50%; }
.so-counts { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13.5px; color: var(--ink-3); }
.so-reacts { display: inline-flex; }
.so-reacts i { display: grid; place-items: center; width: 19px; height: 19px; margin-right: -5px; border: 2px solid var(--card); border-radius: 50%; font-size: 10px; font-style: normal; background: #1877f2; }
.so-reacts .r-love { background: #f33e58; color: #fff; }
.so-reacts + span { margin-left: 8px; }
.so-right { display: inline-flex; gap: 12px; margin-left: auto; }
.so-bar { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--rule); font-size: 14px; font-weight: 600; color: var(--ink-3); }
.so-bar span { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 0; }
.so-bar .i { width: 18px; height: 18px; }
/* reddit */
.so-layout--reddit { display: grid; grid-template-columns: 40px 1fr; gap: 10px; border-radius: 10px; }
.rd-votes { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; color: var(--ink-2); }
.rd-votes .i { width: 18px; height: 18px; color: var(--so); }
.rd-votes .rd-down { rotate: 180deg; color: var(--ink-3); }
.rd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-3); }
.rd-meta .so-brand { margin: 0; }
.rd-meta b { color: var(--ink); }
.rd-title { margin-top: 6px; font: 600 19px/1.3 var(--sans); }
.so-layout--reddit .so-actions { border-top: 0; padding-top: 0; }
/* instagram */
.so-layout--photo { padding: 0; overflow: hidden; border-radius: 10px; max-width: 470px; }
.so-layout--photo .so-head { padding: 12px 14px; }
.so-layout--photo .so-avatar { width: 34px; height: 34px; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px #d62976; }
.so-layout--photo .so-media { margin: 0; border: 0; border-radius: 0; aspect-ratio: 1; object-fit: cover; }
.so-media--empty { background: linear-gradient(135deg, hsl(var(--h) 55% 55%), hsl(calc(var(--h) + 60) 55% 40%)); }
.so-layout--photo .so-actions { margin: 0; padding: 10px 14px 0; border: 0; }
.so-layout--photo .so-text, .so-layout--photo .so-foot { padding: 0 14px; }
.so-layout--photo .so-foot { padding-bottom: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* comment threads */
.blk-comments { padding: 16px 18px; border: 1px solid var(--rule-2); border-radius: 12px; background: var(--card); }
.cm-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; font-size: 15px; }
.cm-top .m { color: var(--so); }
.cm-list { display: grid; gap: 14px; }
.cm { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.cm.d1 { margin-left: 44px; } .cm.d2 { margin-left: 88px; } .cm.d3, .cm.d4 { margin-left: 132px; }
.cm:is(.d1, .d2, .d3, .d4)::before { content: ""; position: absolute; left: -26px; top: -10px; width: 18px; height: 26px; border-left: 2px solid var(--rule-2); border-bottom: 2px solid var(--rule-2); border-bottom-left-radius: 10px; }
.cm-avatar { width: 34px; height: 34px; font-size: 14px; }
.cm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; }
.cm-head b { font-weight: 600; }
.cm-when { color: var(--ink-3); }
.cm-badge { padding: 0 7px; border-radius: 999px; background: var(--so); color: var(--card); font-size: 11.5px; font-weight: 600; }
.cm-pin, .cm-ok { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--ink-3); }
.cm-pin .i { width: 13px; height: 13px; }
.cm-ok { color: var(--pass); font-weight: 600; }
.cm-text { margin-top: 2px; font-size: 15px; line-height: 1.55; }
.cm-foot { display: flex; align-items: center; gap: 16px; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
.cm-score { display: inline-flex; align-items: center; gap: 4px; }
.cm-score .i { width: 14px; height: 14px; }
.cm-reply { font-weight: 600; }
.cm.is-accepted .cm-text { padding-left: 10px; border-left: 3px solid var(--pass); }
.so--youtube .cm-avatar, .so--facebook .cm-avatar { border-radius: 50%; }
.so--github .cm { grid-template-columns: 34px 1fr; }
.so--github .cm-main { border: 1px solid var(--rule-2); border-radius: 8px; overflow: hidden; }
.so--github .cm-head { padding: 8px 12px; background: var(--paper-2); border-bottom: 1px solid var(--rule-2); }
.so--github .cm-text, .so--github .cm-foot { padding: 0 12px; }
.so--github .cm-foot { padding-bottom: 8px; }
.so--github .cm-text { padding-top: 8px; }
.so--github .cm-badge { background: none; color: var(--ink-3); border: 1px solid var(--rule-2); font-weight: 500; }
.so--hackernews { background: color-mix(in srgb, #ff6600 5%, var(--card)); }
.so--hackernews .cm-avatar { display: none; }
.so--hackernews .cm { grid-template-columns: 1fr; }
.so--hackernews .cm-text { font-family: var(--mono); font-size: 13.5px; }
.so--facebook .cm-text { padding: 8px 12px; border-radius: 16px; background: var(--paper-2); width: fit-content; }
.so--facebook .cm-head { order: 0; }
@media (max-width: 560px) { .cm.d1 { margin-left: 22px; } .cm.d2 { margin-left: 44px; } .cm.d3, .cm.d4 { margin-left: 66px; } .cm:is(.d1, .d2, .d3, .d4)::before { left: -16px; width: 10px; } }

/* ======================================================================
   Embeds: a poster and a play button until pressed (site.js swaps in the iframe).
   ====================================================================== */
.blk-embed { margin-inline: 0; }
.embed-stage { position: relative; aspect-ratio: var(--ratio, 16 / 9); overflow: hidden; border-radius: 12px; background: #1d1b18; box-shadow: var(--shadow-lift); }
.embed-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prose .embed-go { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; color: #fff; text-decoration: none; background: linear-gradient(transparent 40%, rgb(0 0 0 / 0.55)); }
.prose .embed-go:hover { background: linear-gradient(rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.6)); }
.embed-play { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgb(255 255 255 / 0.92); color: #1d1b18; box-shadow: 0 6px 20px rgb(0 0 0 / 0.35); transition: transform 0.2s var(--ease); }
.embed-play .i { width: 28px; height: 28px; margin-left: 3px; stroke: none; }
.embed-go:hover .embed-play { transform: scale(1.08); }
.embed--youtube .embed-play { background: #ff0033; color: #fff; border-radius: 16px; width: 72px; height: 50px; }
.embed-label { max-width: 90%; font: 600 16px/1.3 var(--sans); text-align: center; text-shadow: 0 1px 6px rgb(0 0 0 / 0.6); }
.embed-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-top: 8px; font-size: 13.5px; color: var(--ink-3); }
.embed-via { font-size: 12px; }
.blk-embed.is-live .embed-via { visibility: hidden; }
.spotify-poster { display: flex; align-items: center; gap: 14px; padding: 0 90px 0 22px; background: linear-gradient(120deg, #1db954, #12432a); color: #fff; }
.spotify-poster .m { flex: none; width: 36px; height: 36px; }
.sp-text { display: grid; gap: 2px; min-width: 0; }
.sp-text b { font: 600 16px/1.25 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-text span { font: 400 11.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.prose .embed--spotify .embed-go { align-items: flex-end; justify-content: center; padding-right: 22px; background: none; }
.embed--spotify .embed-label { display: none; }
.embed--spotify .embed-play { width: 48px; height: 48px; background: #fff; }
.map-poster { background-color: #e6e1d3; background-image: linear-gradient(30deg, transparent 49%, rgb(255 255 255 / 0.7) 49% 51%, transparent 51%), linear-gradient(120deg, transparent 48.5%, rgb(245 215 122 / 0.8) 48.5% 51.5%, transparent 51.5%), linear-gradient(rgb(0 0 0 / 0.05) 1px, transparent 1px), linear-gradient(90deg, rgb(0 0 0 / 0.05) 1px, transparent 1px); background-size: 100% 100%, 100% 100%, 24px 24px, 24px 24px; }
[data-theme="dark"] .map-poster { background-color: #2a2824; }
.map-pin { position: absolute; left: 62%; top: 20%; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50% 50% 50% 0; rotate: -45deg; background: var(--margin); color: #fff; }
.map-pin .i { rotate: 45deg; width: 22px; height: 22px; }
.code-poster, .figma-poster, .frame-poster { display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px; padding: 18px 20px; background: #1d1b18; color: #9e968a; font: 400 14px var(--mono); }
.code-poster .m, .figma-poster .m { width: 30px; height: 30px; color: #ede6d9; }
.figma-poster { background: linear-gradient(135deg, #2c2c2c, #1e1e1e); }
.frame-poster { align-items: center; background: var(--paper-2); color: var(--ink-3); }
.blk-video video { display: block; width: 100%; border-radius: 12px; background: #000; box-shadow: var(--shadow-lift); }

.blk-audio { display: grid; grid-template-columns: 130px 1fr; gap: 18px; align-items: center; padding: 14px 16px; border: 1px solid var(--rule-2); border-radius: 12px; background: var(--card); }
.tape { position: relative; display: flex; justify-content: space-around; align-items: center; height: 80px; border-radius: 8px; background: linear-gradient(hsl(var(--h) 45% 55%) 0 40%, #2b2925 40% 75%, hsl(var(--h) 45% 55%) 75%); box-shadow: inset 0 0 0 3px rgb(0 0 0 / 0.15); }
.tape i { width: 30px; height: 30px; border-radius: 50%; background: repeating-conic-gradient(#ede6d9 0 30deg, #b9b0a1 30deg 60deg); border: 5px solid #fbf8f1; }
.audio-title { font: 560 18px/1.3 var(--display); }
.blk-audio audio { width: 100%; margin-top: 8px; height: 36px; }

.blk-pdf { border: 1px solid var(--rule-2); border-radius: 10px; overflow: hidden; background: var(--card); }
.pdf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--rule-2); background: var(--paper-2); font-size: 14px; }
.pdf-tag { padding: 2px 7px; border-radius: 4px; background: #c4302b; color: #fff; font: 700 11px var(--mono); }
.pdf-title { font-weight: 600; }
.pdf-pages { color: var(--ink-3); font-size: 13px; }
.prose .pdf-dl { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 5px 12px; border-radius: 999px; background: var(--ink); color: var(--card); font-size: 13px; text-decoration: none; }
.pdf-view { display: block; width: 100%; height: min(80vh, 760px); border: 0; background: #525659; }

.blk-repo { padding: 16px 18px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); }
.repo-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 17px; }
.prose .repo-name a { color: var(--pen); text-decoration: none; }
.repo-name a span { font-weight: 400; }
.repo-vis { padding: 0 8px; border: 1px solid var(--rule-2); border-radius: 999px; font-size: 12px; color: var(--ink-3); }
.repo-desc { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.repo-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.repo-topics span { padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--pen) 12%, transparent); color: var(--pen); font-size: 12px; font-weight: 500; }
.repo-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 12px; font-size: 13px; color: var(--ink-3); }
.repo-stats > span { display: inline-flex; align-items: center; gap: 5px; }
.repo-dot { width: 11px; height: 11px; border-radius: 50%; }
.repo-stats .i { width: 15px; height: 15px; }

.prose a.blk-linkcard { display: grid; grid-template-columns: 1fr 140px; overflow: hidden; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); color: var(--ink); text-decoration: none; transition: border-color 0.15s var(--ease), transform 0.2s var(--ease); }
.prose a.blk-linkcard:hover { background: var(--card); border-color: var(--ink-3); transform: translateY(-2px); }
.lc-text { display: grid; align-content: center; gap: 3px; padding: 14px 16px; min-width: 0; }
.lc-site { font: 400 12px var(--mono); color: var(--ink-3); }
.lc-title { font: 600 16.5px/1.3 var(--sans); }
.lc-desc { font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-url { font-size: 12.5px; color: var(--pen); }
.lc-img { width: 100%; height: 100%; object-fit: cover; }
.lc-img--none { display: grid; place-items: center; background: linear-gradient(135deg, hsl(var(--h) 40% 50%), hsl(calc(var(--h) + 40) 40% 30%)); color: #fff; }
.lc-img--none .i { width: 30px; height: 30px; }
@media (max-width: 560px) { .prose a.blk-linkcard { grid-template-columns: 1fr 90px; } .blk-audio { grid-template-columns: 90px 1fr; } .tape { height: 56px; } .tape i { width: 22px; height: 22px; border-width: 4px; } }
