/* Verity — writing system. Consumed by every post + the writing index.
   Shell + palette come from style.css; this file owns the post layout, byline,
   table-of-contents rail, pull-quotes, and the diagram vocabulary (.fig-*),
   which is the signature element: every post should carry a diagram that looks
   like it came out of the product, not a stock image. */

/* ---------- shared: back link + eyebrow ---------- */
.post-back { font-family: var(--mono); font-size: var(--fs-small); color: var(--dim); text-decoration: none; letter-spacing: .02em; }
.post-back:hover { color: var(--green); }
.post-eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: var(--fs-eyebrow); text-transform: uppercase; letter-spacing: .14em; color: var(--dim); margin-bottom: 18px; }
.post-eyebrow .tick { color: var(--green); }
.post-eyebrow .rule { flex: 1; height: 1px; background: var(--border); }

/* ---------- article page ---------- */
.post { padding: 56px 0 88px; }
.post .wrap { max-width: 1000px; }
.post-head { max-width: 44rem; margin: 26px 0 8px; }
.post-head h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.08; font-weight: 700; letter-spacing: -.03em; color: var(--text); text-wrap: balance; max-width: 20ch; }
.post-byline { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: var(--fs-small); color: var(--dim); margin-top: 22px; }
.post-byline .avatar { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border); flex: none; background: var(--panel2); }
.post-byline .who { color: var(--text); }

/* ---------- two-column body + sticky rail ---------- */
.post-cols { display: grid; grid-template-columns: minmax(0, 1fr) 218px; gap: 60px; align-items: start; margin-top: 44px; }
.post-rail { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 28px; font-family: var(--mono); }
.rail-label { font-size: var(--fs-eyebrow); text-transform: uppercase; letter-spacing: .13em; color: var(--dim); margin-bottom: 12px; }
.post-toc a { display: block; font-size: 13px; color: var(--dim); text-decoration: none; padding: 6px 0 6px 13px; border-left: 1px solid var(--border); line-height: 1.35; transition: color .12s ease, border-color .12s ease; }
.post-toc a:hover { color: var(--green); border-left-color: var(--green); }
.rail-cta { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--green); text-decoration: none; border: 1px solid var(--border); border-radius: var(--r-control); padding: 10px 14px; background: var(--panel); }
.rail-cta:hover { border-color: var(--green); }
.rail-cta .arr { transition: transform .15s ease; }
.rail-cta:hover .arr { transform: translateX(2px); }

/* ---------- prose ---------- */
.prose { max-width: 40rem; }
.prose p { font-family: var(--sans); font-size: 15.5px; line-height: 1.72; color: var(--dim); margin: 0 0 1.15em; }
.prose p.lede { font-size: 17px; color: var(--text); }
.prose strong { color: var(--text); font-weight: 600; }
.prose h2 { font-family: var(--mono); font-size: 17px; letter-spacing: -.01em; color: var(--text); font-weight: 600; margin: 2.1em 0 .7em; display: flex; align-items: baseline; gap: 9px; }
.prose h2::before { content: "\25B8"; color: var(--green); font-size: .8em; }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-control); padding: 1px 6px; color: var(--green); }
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose .pullquote { font-family: var(--sans); font-size: clamp(20px, 2.5vw, 25px); line-height: 1.32; font-weight: 500; letter-spacing: -.012em; color: var(--text); margin: 1.5em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--green); }

/* ---------- diagram vocabulary (the signature element) ----------
   <figure class="fig">
     <div class="fig-flow">
       <div class="fig-node ok"><div class="lab">..</div><div class="body">..</div><div class="acl"><span class="d"></span> ..</div></div>
       <div class="fig-arrow"><span class="op">verb</span><span class="ln">&#8594;</span></div>
       ... more nodes/arrows ...
     </div>
     <figcaption>one honest line.</figcaption>
   </figure>
   node states: ok (green) / warn (amber) / bad (red) — semantic, matching the product. */
.fig { margin: 40px 0 6px; }
.fig-flow { display: flex; align-items: stretch; }
.fig-node { flex: 1; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--panel); padding: 15px 17px; position: relative; overflow: hidden; }
.fig-node::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border); }
.fig-node.ok::before { background: var(--green); }
.fig-node.warn::before { background: var(--amber); }
.fig-node.bad::before { background: var(--red); }
.fig-node .lab { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.fig-node .body { font-family: var(--sans); font-size: 13.5px; color: var(--text); margin: 7px 0 11px; line-height: 1.35; }
.fig-node .acl { font-family: var(--mono); font-size: 11.5px; color: var(--dim); display: flex; align-items: center; gap: 7px; }
.fig-node .acl .d { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--dim); }
.fig-node.ok .acl .d { background: var(--green); }
.fig-node.warn .acl .d { background: var(--amber); }
.fig-node.bad .acl .d { background: var(--red); }
.fig-arrow { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 13px; font-family: var(--mono); color: var(--dim); }
.fig-arrow .op { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2px; }
.fig-arrow .ln { font-size: 19px; line-height: 1; }
.fig figcaption { font-family: var(--mono); font-size: 12px; color: var(--dim); margin-top: 14px; }

/* .fig.stack — vertical flow (a scope / causal column). Use for step-chains and
   any diagram with 4+ nodes or long arrow labels, where a horizontal row would
   squeeze the nodes and clip their text. Nodes get full column width; the arrow
   label sits inline next to a downward connector. */
.fig.stack { max-width: 34rem; }
.fig.stack .fig-flow { flex-direction: column; align-items: stretch; }
.fig.stack .fig-arrow { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 8px 0 8px 18px; }
.fig.stack .fig-arrow .op { margin-bottom: 0; order: 2; }
.fig.stack .fig-arrow .ln { transform: rotate(90deg); display: inline-block; font-size: 16px; order: 1; }

/* ---------- article footer ---------- */
.post-foot { max-width: 40rem; margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--border); font-family: var(--sans); font-size: 14px; color: var(--dim); line-height: 1.6; }
.post-foot a { color: var(--accent); text-decoration: none; }
.post-foot a:hover { text-decoration: underline; }

/* ---------- writing index ---------- */
.writing { padding: 56px 0 88px; }
.writing .wrap { max-width: 1000px; }
.writing-head { max-width: 44rem; margin-bottom: 8px; }
.writing-head h1 { font-size: clamp(28px, 4.5vw, 40px); line-height: 1.08; font-weight: 700; letter-spacing: -.03em; color: var(--text); }
.writing-head .sub { font-family: var(--sans); font-size: 15px; color: var(--dim); margin-top: 12px; max-width: 56ch; }
.post-list { margin-top: 40px; }
.post-card { display: block; text-decoration: none; padding: 26px 0; border-top: 1px solid var(--border); }
.post-card:hover h2 { color: var(--green); }
.post-card .meta { font-family: var(--mono); font-size: var(--fs-small); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.post-card h2 { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--text); margin: 8px 0 8px; line-height: 1.2; }
.post-card .dek { font-family: var(--sans); font-size: 14.5px; color: var(--dim); line-height: 1.6; max-width: 64ch; }
.post-card-by { display: flex; align-items: center; gap: 9px; margin-top: 16px; font-family: var(--mono); font-size: var(--fs-small); color: var(--dim); }
.post-card-by img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); flex: none; }
.post-card-by .nm { color: var(--text); }
.post-card-by .go { color: var(--green); margin-left: auto; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .post-cols { grid-template-columns: 1fr; gap: 30px; }
  .post-rail { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px; }
  .post-toc { display: none; }
}
@media (max-width: 720px) {
  .fig-flow { flex-direction: column; }
  .fig-arrow { padding: 9px 0; flex-direction: row; gap: 9px; }
  .fig-arrow .ln { transform: rotate(90deg); display: inline-block; }
}
@media (max-width: 640px) { .prose p { font-size: 15px; } }

/* ---------- featured post: record panel, title-forward ---------- */
/* A full-width framed --panel record: a --panel2 mono header bar (the idiom no
   marketing template uses), a dominant mono title, a slim scope-trace chip row
   (the product cue, no heavy boxes), the dek, then the byline row. Tokens only,
   so the prefers-color-scheme light remap keeps working for free. */
.feature { margin-top: 40px; }
.feature-panel {
  display: block; text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--r-feature);
  background: var(--panel); overflow: hidden;
  transition: border-color .14s ease;
}
.feature-panel:hover { border-color: color-mix(in srgb, var(--green) 55%, var(--border)); }

/* header bar — the mono metadata row, like a returned record's header */
.feature-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; background: var(--panel2);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: var(--fs-eyebrow);
  letter-spacing: .12em; text-transform: uppercase; color: var(--dim);
}
.feature-bar .tick { color: var(--green); letter-spacing: 0; }
.feature-bar .kind { color: var(--text); }
.feature-bar .sep { width: 1px; align-self: stretch; background: var(--border); }
.feature-bar .field { display: inline-flex; align-items: baseline; gap: 7px; }
.feature-bar .field .k { color: var(--dim); }
.feature-bar .field .v { color: var(--text); letter-spacing: .04em; }
.feature-bar .pin { margin-left: auto; color: var(--dim); letter-spacing: .14em; }

/* body */
.feature-body { padding: 32px 24px 26px; }
.feature-title {
  font-family: var(--mono); font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 700; letter-spacing: -.025em; line-height: 1.14;
  color: var(--text); margin: 0; max-width: 22ch; text-wrap: balance;
  transition: color .14s ease;
}
.feature-panel:hover .feature-title { color: var(--green); }

/* scope-trace chip row — the leak as one slim mono line (source -> memory -> recall) */
.feature-scope {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  margin: 22px 0; font-family: var(--mono); font-size: 12.5px;
}
.feature-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 13px; border: 1px solid var(--border);
  border-radius: var(--r-control); background: var(--panel2);
}
.feature-chip .lab { color: var(--dim); text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; }
.feature-chip .d { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--dim); }
.feature-chip .val { color: var(--text); }
.feature-chip.ok .d { background: var(--green); }
.feature-chip.warn .d { background: var(--amber); }
.feature-chip.bad .d { background: var(--red); }
.feature-scope .arr { color: var(--dim); font-size: 15px; }

.feature-dek {
  font-family: var(--sans); font-size: 15px; line-height: 1.62;
  color: var(--dim); margin: 0; max-width: 66ch;
}

.feature-foot {
  display: flex; align-items: center; gap: 10px; margin-top: 26px;
  padding-top: 20px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: var(--fs-small); color: var(--dim);
}
.feature-foot img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); flex: none; }
.feature-foot .nm { color: var(--text); }
.feature-foot .when { margin-left: 12px; }
.feature-foot .go { margin-left: auto; color: var(--green); }
.feature-panel:hover .feature-foot .go .arr { display: inline-block; transform: translateX(2px); transition: transform .15s ease; }

/* quiet "More writing" divider — full width, so featured-then-list reads clearly at 6 posts */
.feature-more {
  margin: 48px 0 0;
  font-family: var(--mono); font-size: var(--fs-eyebrow);
  letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
  display: flex; align-items: center; gap: 12px;
}
.feature-more .rule { flex: 1; height: 1px; background: var(--border); }

/* upcoming-posts placeholder line (mono, quiet; no invented titles).
   Delete this .post-upcoming block once the first list post ships. */
.post-upcoming {
  margin-top: 26px; padding: 22px 0; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: var(--fs-small); color: var(--dim);
  letter-spacing: .04em; line-height: 1.5;
}

@media (max-width: 560px) {
  .feature-bar { flex-wrap: wrap; gap: 8px 12px; }
  .feature-bar .sep { display: none; }
  .feature-bar .pin { margin-left: 0; }
  .feature-scope .arr { display: none; }
  .feature-foot { flex-wrap: wrap; }
  .feature-foot .go { margin-left: 0; width: 100%; }
}
