:root {
  --bg: #050505;
  --fg: #ddd8c9;
  --accent: #a40000;
  --dim: #8c867c;
  --link: #8cb3ff;
  --rail: #0c0c0c;
}

* { box-sizing: border-box; }

html {
  background:
    linear-gradient(rgba(255,255,255,.02), rgba(255,255,255,0)),
    repeating-linear-gradient(0deg, rgba(110, 0, 0, .05) 0 1px, transparent 1px 3px),
    #050505;
}

body {
  margin: 0;
  color: var(--fg);
  font-family: "Courier New", Courier, monospace;
  line-height: 1.45;
  background-image:
    radial-gradient(rgba(180, 0, 0, .06) 1px, transparent 1px),
    radial-gradient(rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 7px 7px, 3px 3px;
  background-position: 0 0, 13px 9px;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
  opacity: .16;
}

.container {
  position: relative;
  max-width: 930px;
  margin: 18px auto 40px;
  padding: 16px 18px 28px;
  border-left: 2px solid #262626;
  border-right: 1px dashed #222;
  border-top: 1px solid #1d1d1d;
  border-bottom: 1px solid #1d1d1d;
  background: rgba(8, 8, 8, .93);
  box-shadow: 0 0 0 1px rgba(80,0,0,.15), 0 0 25px rgba(0,0,0,.35);
}

header {
  margin-bottom: 12px;
}

.blinkbar {
  display: inline-block;
  margin: 0 0 10px;
  padding: 2px 8px;
  color: #ffb6b6;
  background: #260000;
  border: 1px dotted #5f1d1d;
  font-size: .82rem;
  letter-spacing: .6px;
}

h1 {
  margin: 2px 0 0;
  color: var(--accent);
  letter-spacing: 2px;
  text-shadow: 1px 0 0 #fff1;
}

.sub {
  color: var(--dim);
  font-size: .92rem;
  margin: 4px 0 3px;
}

.tiny-note, .micro, .stamp {
  color: #8f8a82;
  font-size: .82rem;
}

hr {
  border: 0;
  border-top: 1px dashed #2c2c2c;
  margin: 10px 0 12px;
}

h2, h3 {
  color: #f0ece4;
}

h2 {
  margin-top: 0;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
}

a:hover {
  color: #fff;
}

/* companion render block — cascade-block variant, no longer hero-locked */
.companion-figure {
  margin: 0;
  border: 1px solid #333;
  background: #090909;
  padding: 6px;
}

.companion-figure img {
  display: block;
  width: 100%;
  height: auto;
  filter: contrast(1.08) brightness(.94);
}

.companion-copy p {
  margin: 0 0 10px;
}

/* wanted block — cascade-block variant, preserves poster aesthetic */
.cascade-wanted {
  background: rgba(20, 16, 12, .88);
  color: var(--fg);
  border: 1px dashed #4c4032 !important;
  box-shadow: 0 0 0 1px rgba(80,40,20,.18);
}

.cascade-wanted h3 {
  margin: 0 0 8px;
  color: #efe4d1;
  text-align: left;
  font-size: 1.08rem;
  letter-spacing: .3px;
  text-transform: none;
}

.wanted-figure {
  margin: 0 0 10px;
  padding: 6px;
  border: 1px solid #4b4034;
  background: #0a0a0a;
}

.wanted-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #2b241d;
  filter: contrast(1.05) saturate(.85);
}

.wanted-copy,
.wanted-notes {
  margin: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: .92rem;
  line-height: 1.45;
  color: #ddd8c9;
}

.wanted-copy p,
.wanted-notes p,
.wanted-notes li {
  margin: 0 0 9px;
}

.dossier-block {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed #4c4032;
  font-family: "Courier New", Courier, monospace;
  font-size: .9rem;
  line-height: 1.4;
}

.dossier-block h4 {
  margin: 8px 0 6px;
  color: #efe4d1;
  font-size: .92rem;
  letter-spacing: .3px;
  text-transform: none;
}

.dossier-block p {
  margin: 0 0 7px;
}

.post, .links {
  clear: both;
  border: 1px dashed #313131;
  padding: 12px 13px;
  margin: 14px 0;
  background: rgba(12,12,12,.82);
}

.post {
  width: calc(100% - 4px);
}

.post-skew-1 {
  margin-left: 2px;
  border-left: 3px solid #4a1111;
}

.post-skew-2 {
  margin-left: 18px;
  width: calc(100% - 22px);
  border-right: 2px dotted #5b5b5b;
}

.post-skew-3 {
  margin-left: 7px;
  width: calc(100% - 10px);
  background: rgba(10,10,10,.7);
}

.messy-links {
  border-style: solid dashed dashed solid;
}

.messy-links li:nth-child(odd) {
  margin-left: 6px;
}

/* ── CASCADING POST BLOCKS ─────────────────────────────────────────────── */
/* Used by branch_publish.py for all future posts.                          */
/* Existing posts were hand-assigned on initial conversion.                 */

.cascade-block {
  clear: both;
  position: relative;
  padding: 12px 14px;
  margin: 18px 0;
  border: 1px dashed #313131;
  background: rgba(12,12,12,.82);
}

.cascade-block h2 {
  margin-top: 0;
}

/* Rich card — inline content, full teaser or body visible */
.cascade-rich {
  border-left: 3px solid #4a1111;
}

/* Lean link card — minimal, just label + hyperlink */
.cascade-link {
  background: rgba(7,7,7,.55);
  border-style: solid dashed;
  border-color: #252525 #484848;
}

.cascade-link h2 {
  font-size: .97rem;
  color: #b8b2a5;
  margin: 0 0 5px;
  letter-spacing: .3px;
}

.cascade-link .lean-link {
  font-size: .9rem;
  display: block;
  margin-bottom: 4px;
}

/* Node card — junction page link; marks a branching point */
.cascade-node {
  border-style: dotted;
  border-color: #3a3a3a;
  background: rgba(6,6,6,.5);
}

.cascade-node::after {
  content: "→ node";
  position: absolute;
  top: 9px;
  right: 11px;
  color: #3d3a36;
  font-size: .78rem;
  letter-spacing: .4px;
}

/* ── STAGGER POSITIONS (cp-a … cp-g, cycles for new posts) ────────────── */

.cp-a {
  margin-left: 0;
  width: 93%;
}

.cp-b {
  margin-left: 26px;
  width: 76%;
  border-right: 2px dotted #5b5b5b;
  border-left-color: #2a2a2a;
}

.cp-c {
  margin-left: 9px;
  width: 88%;
  background: rgba(10,10,10,.7);
}

.cp-d {
  margin-left: 44px;
  width: 63%;
  border-left: 2px solid #2a1a1a;
  border-style: dashed dashed dashed solid;
}

.cp-e {
  margin-left: 16px;
  width: 82%;
}

.cp-f {
  margin-left: 0;
  width: 56%;
  border: 1px solid #252525;
  border-left: 3px solid #330000;
  background: rgba(14,8,8,.6);
}

.cp-g {
  margin-left: 36px;
  width: 73%;
  border-style: dashed;
  border-color: #3d3d3d;
}

/* ── ORIENTATION VARIANTS ─────────────────────────────────────────────── */
/* Applied via data-orientation attr; class added by branch_publish.py v2  */

/* Vertical (default): stacked image below text — no extra rules needed    */
.cascade-orient-vertical {
  /* inherits standard cascade-block layout */
}

/* Horizontal: image left, text right, side by side                        */
.cascade-orient-horizontal {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: nowrap;
}

.cascade-orient-horizontal .horiz-media {
  flex: 0 0 220px;
  max-width: 220px;
}

.cascade-orient-horizontal .horiz-media .evidence {
  margin: 0;
}

.cascade-orient-horizontal .horiz-text {
  flex: 1 1 auto;
  min-width: 0;
}

.cascade-orient-horizontal .horiz-text h2 {
  margin-top: 0;
}

/* Horizontal link/node cards keep lean layout — just add a left accent    */
.cascade-orient-horizontal.cascade-link,
.cascade-orient-horizontal.cascade-node {
  border-left: 3px solid #2a2a2a;
}

/* ── LINK CARD THUMBNAIL ──────────────────────────────────────────────── */
/* Rendered when the surface media roll hits on a link/convergence card.   */
/* Hard rule: if roll hits, media MUST be visibly shown on the card.       */
/* If roll misses, .link-thumb is never emitted — no image shown.          */

.link-thumb {
  margin: 0 0 10px;
  border: 1px dashed #3a3a3a;
  padding: 6px;
  background: #0a0a0a;
}

.link-thumb img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  object-position: center;
  border: 1px solid #1f1f1f;
  filter: contrast(1.05) brightness(.93);
}

@media (max-width: 580px) {
  .cascade-orient-horizontal {
    flex-direction: column;
  }
  .cascade-orient-horizontal .horiz-media {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
}

/* ── NODE PAGE STYLES ──────────────────────────────────────────────────── */
/* Applied on generated nodes/*.html pages                                  */

.node-shell {
  padding: 14px 16px;
  border: 1px dashed #2e2e2e;
  background: rgba(10,10,10,.75);
  margin: 16px 0;
}

.node-shell .node-label {
  color: #5a5650;
  font-size: .8rem;
  margin: 0 0 10px;
  letter-spacing: .5px;
}

.node-threads {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-top: 1px dashed #2c2c2c;
  background: rgba(6,6,6,.4);
}

.node-threads h4 {
  margin: 0 0 8px;
  color: #6a6560;
  font-size: .88rem;
  letter-spacing: .3px;
}

.node-threads ul {
  margin: 0;
  padding-left: 16px;
}

.node-threads li {
  margin: 0 0 6px;
  font-size: .92rem;
}

.branch-depth-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 0 5px;
  background: #181818;
  border: 1px dotted #333;
  color: #565250;
  font-size: .75rem;
  vertical-align: middle;
}

marquee {
  color: #ff4e4e;
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  padding: 6px 0;
  background: rgba(25, 0, 0, .22);
}

.evidence {
  margin: 14px 0;
  border: 1px dashed #3a3a3a;
  padding: 8px;
  background: #0a0a0a;
}

.evidence img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid #1f1f1f;
}

.evidence figcaption {
  margin-top: 6px;
  color: #9a9a9a;
  font-size: .85rem;
}

@media (max-width: 780px) {
  .post-skew-2,
  .post-skew-3,
  .post-skew-1 {
    width: 100%;
    margin-left: 0;
  }
}
