/* Toser blog: the listing, post pages, and the one reusable side-panel mock.
   Tokens, type, buttons and the marker come from base.css. No new fonts. Mobile first. */

/* ---------- Listing (hosting/blog.html) ---------- */
.cluster-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.cluster-filter .chip {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-2); font-size: 13.5px; line-height: 1.2;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.cluster-filter .chip:hover { color: var(--text); background: rgba(255,255,255,.04); }
.cluster-filter .chip[aria-pressed="true"] { background: var(--marker); border-color: transparent; color: var(--marker-ink); font-weight: 600; }

.post-cluster-section + .post-cluster-section { margin-top: 44px; }
.post-cluster-title {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.post-cluster-count {
  font-family: var(--mono); font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-2); text-transform: none; letter-spacing: 0;
}
.post-cluster { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--marker); }
.post-card article { transition: border-color .25s var(--ease), transform .25s var(--ease); }
.post-card article:hover { border-color: var(--border-strong); }
.post-title { margin-top: 8px; font-family: var(--font); font-size: 1.15rem; font-weight: 560; line-height: 1.3; letter-spacing: -.01em; }
.post-title a { color: var(--text); }
.post-title a:hover { text-decoration: underline; text-decoration-color: var(--marker-line); text-underline-offset: 4px; }
.post-excerpt { margin-top: 8px; font-size: 14.5px; color: var(--text-2); }
.post-meta { margin-top: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.post-featured {
  position: relative; padding: 22px; border: 1px solid var(--marker-line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: 0 1px 0 rgba(255,255,255,.035) inset;
}
@media (min-width: 768px) { .post-featured { padding: 30px; } }
.post-featured-title {
  margin-top: 10px; font-family: var(--display); font-size: clamp(1.4rem, 4.6vw, 2rem);
  line-height: 1.08; letter-spacing: -.025em; text-wrap: balance;
}
.post-featured-title a { color: var(--text); }
.post-featured-title a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--marker-line); text-underline-offset: 5px; }
.post-featured .post-excerpt { font-size: 15.5px; max-width: 60ch; }
.post-more { display: inline-block; margin-top: 14px; font-size: 14px; }
.post-cluster-section .post-list { margin-top: 0; }
.post-cluster-section .post-list > .post-card:only-child { grid-column: 1 / -1; }
.post-cluster-section .post-featured + .post-list { margin-top: 16px; }
.post-cluster-section .post-list:empty { display: none; }
/* 50 posts: one compact pillar card per cluster, then denser supporting cards. */
.post-cluster-section .post-featured { padding: 18px 20px; }
.post-cluster-section .post-featured-title { margin-top: 8px; font-size: clamp(1.25rem, 3.4vw, 1.55rem); }
.post-cluster-section .post-featured .post-excerpt {
  margin-top: 6px; font-size: 14.5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-cluster-section .post-card article { padding: 18px; }
.post-cluster-section .post-title { font-size: 1.03rem; }
.post-cluster-section .post-excerpt {
  font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-cluster-section .post-meta { margin-top: 9px; }
.post-cluster-section .post-more { margin-top: 10px; }

/* ---------- Post page: hero, breadcrumb, byline ---------- */
.crumb { margin-bottom: 20px; }
.crumb ol {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; padding: 0; list-style: none;
  font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--text); }
.crumb li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--border-strong); }
.crumb li[aria-current="page"] { color: var(--text-2); max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-hero .display { max-width: 22ch; }
.post-hero .eyebrow { margin-bottom: 2px; }
.byline { margin-top: 16px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.byline b { color: var(--text); font-weight: 600; }
.byline time { color: var(--text-2); }

/* ---------- Post page: reading progress ---------- */
.post-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; }
.post-progress i { display: block; height: 100%; width: 100%; background: var(--marker); transform: scaleX(0); transform-origin: 0 50%; }
.no-js .post-progress { display: none; }

/* ---------- Post page: article ---------- */
/* The TOC is wrapped because a sticky grid item is constrained by the grid container in Chrome, not by
   its row: without the stretched wrapper it stays stuck over the full-width mock below the article. */
.post-toc-col { min-width: 0; align-self: stretch; }
.post-toc { padding-top: 2px; }
.post-article { padding-top: 2px; }
.post-body { margin-top: 8px; }
.post-body h2.h2 { margin-top: 44px; font-family: var(--display); font-size: clamp(1.5rem, 4.6vw, 1.95rem); line-height: 1.1; letter-spacing: -.025em; }
.post-body h3, .post-body h4 { margin-top: 30px; }
.post-body > *:first-child { margin-top: 0; }
.post-body blockquote.callout { margin: 20px 0 0; padding: 14px 16px; }
.post-body .table-wrap { margin-top: 18px; overflow-x: auto; }
.post-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.post-table th, .post-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.post-table th { color: var(--text); font-weight: 600; font-family: var(--font); }
.post-table td { color: var(--text-2); }
.post-body pre.code {
  margin: 18px 0 0; padding: 14px 16px; overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface);
}
.post-body pre.code code { display: block; padding: 0; border: 0; background: none; color: var(--text-2); font-size: 13px; line-height: 1.6; }

.post-tldr {
  margin: 0 0 34px; padding: 18px 20px; border-radius: var(--r-lg);
  border: 1px solid var(--marker-line); background: var(--marker-soft);
}
.post-tldr p { color: var(--text); font-size: 16.5px; line-height: 1.6; }
.post-tldr .post-tldr-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--marker); margin-bottom: 7px; }

/* ---------- Post page: the mock section ----------
   The mock is a grid item of its own, not part of the article column: from 960px it spans the TOC and
   the article, so the panel gets the full document width. Everything after it stays in the article. */
.post-mock-section { grid-column: 1 / -1; min-width: 0; margin-top: 48px; }
.post-after { min-width: 0; max-width: 760px; }
@media (min-width: 960px) { .post-after { grid-column: 2; } }
.post-faq { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--border); }
.post-faq .h2 { margin-bottom: 6px; }
.post-faq .qa { margin-top: 18px; }

.post-related { margin-top: 56px; }
.post-related .h2 { margin-bottom: 16px; }
.related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.related-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
}
.related-list a { color: var(--text); font-weight: 560; font-size: 15px; }
.related-list a:hover { text-decoration: underline; text-decoration-color: var(--marker-line); text-underline-offset: 4px; }
.related-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* ---------- CTA ---------- */
.post-cta {
  margin-top: 56px; padding: 24px; border-radius: var(--r-xl); border: 1px solid var(--marker-line);
  background: var(--surface); box-shadow: 0 1px 0 rgba(255,255,255,.035) inset;
}
.post-cta--compact { margin-top: 40px; padding: 20px; background: var(--bg-2); }
.post-cta .post-cta-headline {
  font-family: var(--display); font-size: clamp(1.35rem, 4.2vw, 1.75rem); font-weight: 400;
  line-height: 1.1; letter-spacing: -.025em; color: var(--text); text-wrap: balance;
}
.post-cta--large .post-cta-headline { font-size: clamp(1.7rem, 5.6vw, 2.4rem); }
.post-cta .post-cta-value { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--text-2); max-width: 54ch; }
.post-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.post-cta-actions .btn { flex: 1 1 auto; }
@media (min-width: 560px) { .post-cta-actions .btn { flex: 0 0 auto; } }
.post-cta--compact .post-cta-actions .btn { min-height: 46px; padding: 0 18px; font-size: 14.5px; }
.post-cta .fineprint { margin-top: 14px; max-width: none; }

/* ---------- The reusable panel mock ---------- */
.post-mock { margin: 0; }
.mock-stage {
  position: relative; overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  background: var(--bg-2); box-shadow: 0 30px 70px -44px rgba(0, 0, 0, .95);
}
.mock-window { min-width: 0; }
.mock-chrome {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.mock-dots { display: inline-flex; gap: 5px; flex: none; }
.mock-dots i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #3B3B42; }
.mock-dots i:first-child { background: #4A3A32; }
.mock-chrome-title { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-body { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
@media (min-width: 720px) { .mock-body { grid-template-columns: minmax(0, 1.02fr) minmax(300px, .98fr); } }

/* Ticket side */
.mock-ticket { min-width: 0; padding: 16px; background: var(--bg-2); }
.mock-ticket-head { display: flex; align-items: center; gap: 8px; }
.mock-avatar {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 600;
}
.mock-customer { font-size: 13.5px; font-weight: 600; color: var(--text); }
.mock-ticket-id { margin-left: auto; font-size: 11px; color: var(--muted); }
.post-mock .mock-label { display: block; margin-top: 14px; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.post-mock .mock-bubble {
  margin-top: 6px; max-width: 94%; padding: 10px 12px; border-radius: 10px 10px 10px 3px;
  background: var(--surface-2); color: var(--text); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere;
}
.mock-reply-box {
  margin-top: 6px; min-height: 98px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 8px;
  color: var(--text); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere;
}
.post-mock .mock-reply-box p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text); }
.mock-reply-box:empty::before { content: "Reply box"; color: var(--muted); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }

/* Toser side panel: the hero .panel's visual language, scoped to the post */
.mock-panel {
  position: relative; min-width: 0; margin: 0 12px 12px; overflow: hidden; align-self: start;
  border: 1px solid var(--border-strong); border-radius: 12px; background: #121214;
}
@media (min-width: 720px) { .mock-panel { margin: 12px 12px 12px 0; } }
.mock-panel .panel-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 13px; border-bottom: 1px solid var(--border); }
.mock-panel .panel-logo { font-size: 19px; }
.mock-panel .panel-org { font-size: 11.5px; color: var(--muted); }
.mock-panel .panel-tabs { display: flex; gap: 4px; padding: 0 11px; border-bottom: 1px solid var(--border); }
.mock-panel .panel-tabs span {
  padding: 9px 7px; border-bottom: 2px solid transparent; font-size: 12px; color: var(--muted); white-space: nowrap;
}
.mock-panel .panel-tabs span.on { color: var(--text); border-bottom-color: var(--marker); }
.mock-query { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.mock-field {
  display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
}
.mock-field svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.mock-query-line { display: block; color: var(--text); font-size: 12.5px; line-height: 1.4; min-height: 1.4em; overflow-wrap: anywhere; transition: opacity .35s var(--ease); }
.mock-query--paste .mock-label { margin-top: 0; margin-bottom: 5px; }

.mock-thinking {
  display: flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px;
  font-size: 11px; color: var(--muted); opacity: 0; transition: opacity .3s var(--ease);
}
.mock-thinking.show { opacity: 1; }
.mock-thinking span { width: 4px; height: 4px; border-radius: 50%; background: var(--marker); animation: mock-blink 1s infinite; }
.mock-thinking span:nth-child(2) { animation-delay: .15s; }
.mock-thinking span:nth-child(3) { animation-delay: .3s; margin-right: 3px; }
@keyframes mock-blink { 50% { opacity: .2; } }

.mock-answer { margin: 8px 12px 12px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); }
.mock-panel .panel-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mock-panel .verified { font-family: var(--mono); font-size: 10px; color: var(--sage); opacity: 1; transition: opacity .4s var(--ease); }
.mock-panel .badge { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.post-mock .mock-policy { margin-top: 9px; font-family: var(--mono); font-size: 10.5px; line-height: 1.4; color: var(--text-2); }
.mock-policy { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.mock-policy .mono { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.mock-panel .panel-cites { display: grid; gap: 7px; margin-top: 9px; }
/* The cited clause is the hero's paper slip: dark ink on warm paper, with the orange dithered band
   behind it. The paper, not the panel, keeps the quote readable at every point of the sweep. */
.mock-clause {
  padding: 10px 11px; border: 1px solid rgba(42, 38, 32, .16); border-radius: 8px;
  background: #EEE8DD; color: #2A2620; box-shadow: 0 10px 24px -16px #000;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.mock-panel .clause-chip {
  max-width: 100%; font-size: 11px; white-space: normal; overflow-wrap: anywhere;
  color: #8A4A00; background: rgba(255, 122, 0, .16); border-color: rgba(178, 92, 10, .35);
}
.mock-ref {
  color: #8A4A00; background: none; padding: 0; border-radius: 0; margin-right: 5px;
  font-weight: 600;
}
.post-mock .mock-quote { margin-top: 6px; font-family: var(--serif); font-size: 14.5px; line-height: 1.45; color: #2A2620; }
/* The marker on the quoted clause. The default is the solid brand band, exactly the classic .mark, so a
   reader without JS (or when /panel/lib/glow.js fails to load) still sees the quote highlighted. blog.js
   hands the quote to that module; play() adds .hl-live, which removes this band so the dithered canvas
   is the only highlight. One element, one canvas, ink that stays dark at every point of the sweep. */
.mock-quote .q-mark {
  color: #14110C; padding: 0 .12em; margin: 0 -.06em; border-radius: .2em .5em .25em .45em;
  background-image: linear-gradient(100deg, transparent 0, var(--marker) 1.4%, var(--marker) 98.6%, transparent 100%);
  background-repeat: no-repeat; background-size: 100% 82%; background-position: 0 60%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.mock-quote .q-mark.hl-live { background: none; }
.mock-panel .panel-label { margin-top: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mock-reply-holder { display: grid; margin-top: 5px; }
/* The ghost reserves the reply's final box so nothing jumps when the text arrives. It must therefore
   match the visible reply's typography exactly, not inherit the article's 16px/1.7 paragraph — that
   mismatch was the blank strip under the suggested reply. */
.post-mock .mock-reply-ghost, .post-mock .mock-reply-text {
  grid-area: 1 / 1; margin: 0; color: var(--text); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere;
}
.mock-reply-ghost { visibility: hidden; }
.mock-panel .panel-actions { display: flex; gap: 6px; margin-top: 10px; }
.mock-panel .pa {
  flex: 1 1 auto; padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: 7px;
  text-align: center; font-size: 11.5px; font-weight: 550; white-space: nowrap;
}
.mock-panel .pa-copy { flex: 0 0 auto; }
.mock-panel .pa-insert { border-color: transparent; background: var(--marker); color: var(--marker-ink); }
.mock-panel .pa-insert.pulse { animation: mock-pulse 1.2s var(--ease) 2; }
@keyframes mock-pulse { 50% { box-shadow: 0 0 0 6px rgba(255,122,0,.18); } }

.mock-gap-state { margin-top: 10px; }
.post-mock .mock-gap-title { color: var(--redline); font-size: 13px; font-weight: 600; }
.post-mock .mock-gap-note { margin-top: 4px; font-size: 12px; color: var(--text-2); }

/* Caption + replay */
.mock-cap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px;
  margin-top: 12px; font-size: 13px; line-height: 1.55; color: var(--muted);
}
.mock-cap-text { flex: 1 1 260px; }
.mock-replay {
  flex: none; min-height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 7px;
  background: transparent; color: var(--text-2); font-size: 12px; transition: color .2s var(--ease), background .2s var(--ease);
}
.mock-replay:hover { color: var(--text); background: rgba(255,255,255,.04); }

/* Armed initial state: only when blog.js is running and motion is allowed.
   The default markup is the complete final state, so no-JS readers see everything.
   Reveal order: ticket message, query, thinking, then clause + confidence + policy together, then the
   verified tick, then the reply types and lands. The gap variant has no clause/reply: its answer card
   itself appears at the clause step, so its own low-confidence badge is never hidden separately. */
.post-mock.is-armed .mock-bubble { opacity: 0; transform: translateY(6px); }
.post-mock.is-armed .mock-query-line { opacity: 0; }
.post-mock.is-armed .mock-clause { opacity: 0; transform: translateY(8px); }
.post-mock.is-armed .mock-answer:not(.mock-answer--gap) .badge { opacity: 0; transform: translateY(4px); }
.post-mock.is-armed .mock-policy { opacity: 0; transform: translateY(4px); }
.post-mock.is-armed .verified { opacity: 0; }
.post-mock.is-armed .mock-answer--gap { opacity: 0; transform: translateY(8px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.post-mock.is-armed.step-clause .mock-answer--gap { opacity: 1; transform: none; }
.post-mock.is-armed .mock-bubble,
.post-mock.is-armed .mock-clause,
.post-mock.is-armed .mock-answer:not(.mock-answer--gap) .badge,
.post-mock.is-armed .mock-policy,
.post-mock.is-armed .verified { will-change: opacity, transform; }
.post-mock.is-armed.step-msg .mock-bubble { opacity: 1; transform: none; }
.post-mock.is-armed.step-query .mock-query-line { opacity: 1; }
.post-mock.is-armed.step-clause .mock-clause { opacity: 1; transform: none; }
.post-mock.is-armed.step-clause .mock-answer:not(.mock-answer--gap) .badge { opacity: 1; transform: none; }
.post-mock.is-armed.step-clause .mock-policy { opacity: 1; transform: none; }
.post-mock.is-armed.step-verified .verified { opacity: 1; }
.mock-bubble, .mock-clause, .verified, .mock-query-line { transition: opacity .35s var(--ease), transform .35s var(--ease); }

/* ---------- Phones ---------- */
@media (max-width: 479px) {
  .post-featured { padding: 18px; }
  .post-cta { padding: 18px; }
  .post-tldr { padding: 15px 16px; }
  .mock-ticket { padding: 13px; }
  .mock-panel { margin: 0 10px 10px; }
  .mock-answer { margin: 8px 10px 10px; }
  .mock-cap { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .mock-thinking span { animation: none; }
  .mock-panel .pa-insert.pulse { animation: none; }
  .post-mock.is-armed .mock-bubble,
  .post-mock.is-armed .mock-query-line,
  .post-mock.is-armed .mock-clause,
  .post-mock.is-armed .mock-policy,
  .post-mock.is-armed .mock-answer:not(.mock-answer--gap) .badge,
  .post-mock.is-armed .verified { opacity: 1; transform: none; }
}
