/* ============ FOR BUILDERS — page-scoped styles ============ */

/* Section rhythm — mostly continuous warm paper, one deliberate dark act-break */
.fb-section { padding: 96px 0; position: relative; overflow-x: clip; }
.fb-section + .fb-section { border-top: 1px solid var(--rule); }

/* Default: warm paper for all layers. */
#shape, #l1, #l3, #d1, #d2 { background: var(--paper); }

/* L4 is just another section now — no dark act-break. Unified vocabulary. */

.fb-hero {
  padding: 56px 0 72px;
  background:
    radial-gradient(900px 500px at 90% -10%, var(--blue-soft) 0%, transparent 60%),
    radial-gradient(700px 400px at 5% 30%, var(--terra-soft) 0%, transparent 55%),
    var(--paper);
  border-top: none;
}
.fb-hero .eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 22px;
  display: flex; gap: 14px; align-items: center;
}
.fb-hero .eyebrow .b {
  width: 22px; height: 1px; background: var(--terracotta);
}
.fb-hero h1 {
  font-size: 64px; line-height: 1.04;
  font-weight: 500; letter-spacing: -0.025em;
  margin: 0 0 26px;
  max-width: 940px;
}
.fb-hero h1 em { font-style: normal; color: var(--blue); font-weight: 500; }
.fb-hero h1 .dim { color: var(--ink-faint); font-weight: 400; }
.fb-hero .lede {
  font-size: 20px; line-height: 1.55;
  color: var(--ink-dim);
  margin: 0 0 32px;
  max-width: 760px;
}
.fb-hero .lede strong { color: var(--ink); font-weight: 500; }

.fb-hero .meta-row {
  display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 12.5px;
}
.fb-hero .meta-row .tag {
  display: inline-flex; align-items: center; gap: 8px;
}
.fb-hero .meta-row .tag .d {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(94,140,96,0.2);
}

@media (max-width: 820px) {
  .fb-hero h1 { font-size: 40px; }
  .fb-hero .lede { font-size: 17px; }
}

/* -- Section scaffolding (reuses .sec-kicker + .sec-title + .sec-sub) -- */

.fb-section .sec-kicker { color: var(--blue); }

/* ===================================================================
   UNIFIED CARD VOCABULARY
   One shape for every opinion/rule/heuristic/note/gotcha.
   Only the chip label changes. No per-variant backgrounds, no tints.
   =================================================================== */
.opinion {
  display: block;
  padding: 28px 0;
  border-top: 1px solid var(--rule-2);
  position: relative;
}
.opinion > * { min-width: 0; }
.opinion:first-child { border-top: none; }

/* The chip: mono, letter-spaced, colored dot. Sits above the body inline. */
.opinion .label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.opinion .label::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-top: 0;
  flex-shrink: 0;
}
/* Chip color == type. These are the ONLY types. */
.opinion .label.rule       { color: var(--terracotta); }
.opinion .label.opinion    { color: var(--ink); }
.opinion .label.heuristic  { color: var(--sage); }
.opinion .label.gotcha     { color: var(--mustard); }
.opinion .label.note       { color: var(--blue); }
.opinion .label.example    { color: var(--ink-faint); }

/* Body */
.opinion h4 {
  margin: 0 0 10px;
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.28;
}
.opinion p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 15.5px; line-height: 1.6;
}
.opinion p + p { margin-top: 12px; }
.opinion ul {
  margin: 10px 0 12px;
  padding: 0;
  list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
.opinion ul li {
  position: relative;
  padding-left: 20px;
  color: var(--ink-dim);
  font-size: 15.5px;
  line-height: 1.55;
}
.opinion ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: 10px;
  width: 8px; height: 1px;
  background: var(--terracotta);
}
.opinion p + p { margin-top: 10px; }
.opinion p strong { color: var(--ink); font-weight: 500; }
.opinion p code,
.opinion h4 code {
  font-family: var(--mono); font-size: 13.5px;
  background: var(--paper-2); padding: 1px 6px;
  border-radius: 4px; color: var(--ink);
}

/* .rule is still a semantic modifier on the wrapper — but now it JUST means
   "this is the headline opinion of the layer." No black box. Heavier title only. */
.opinion.rule h4 {
  font-size: 28px;
  letter-spacing: -0.015em;
  line-height: 1.18;
}

/* Backwards-compat: these modifiers previously re-skinned the card. Neutralize them.
   They still render fine because the chip class now drives color. */
.opinion.heuristic,
.opinion.gotcha {
  border-radius: 0;
  padding: 28px 0;
  margin: 0;
  background: transparent;
  border-top: 1px solid var(--rule-2);
}

@media (max-width: 820px) {
  .opinion { padding: 22px 0; }
  .opinion .label { margin-bottom: 10px; }
  .opinion.rule h4 { font-size: 22px; }
}

/* ===================================================================
   UNIFIED DIAGRAM CONTAINERS — .stack-diagram + .mini-diagram
   Shared: white bg, 1px rule, 12px radius, same padding & caption.
   No per-figure shadow/background variation.
   =================================================================== */
.stack-diagram {
  margin: 28px 0;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 28px 28px 22px;
  position: relative;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.stack-diagram .diagram-caption {
  position: static;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap;
}
.stack-diagram .diagram-caption .n { color: var(--terracotta); }
.stack-diagram svg { width: 100%; height: auto; display: block; }
.stack-mobile-map { display: none; }
.stack-mobile-flow {
  display: grid;
  gap: 8px;
}
.stack-mobile-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 15px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule-2);
  border-radius: 8px;
  background: var(--paper);
}
.stack-mobile-row.warm {
  background: #FBEFE6;
  border-color: #E8D2BF;
  border-left-color: var(--terracotta);
}
.stack-mobile-row.blue {
  background: #E1E9FF;
  border-color: #B9C9FF;
  border-left-color: var(--blue);
}
.stack-mobile-row.soft {
  background: var(--paper-2);
  border-left-color: var(--ink-faint);
}
.stack-mobile-row .idx {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
  padding-top: 2px;
}
.stack-mobile-row h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
}
.stack-mobile-row p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-dim);
}
.stack-mobile-row code {
  font-family: var(--mono);
  color: var(--blue-ink);
  background: rgba(43,92,255,0.08);
  padding: 1px 4px;
  border-radius: 3px;
}
.stack-mobile-arrow {
  height: 16px;
  position: relative;
}
.stack-mobile-arrow::before {
  content: "";
  position: absolute;
  left: 25px;
  top: -1px;
  bottom: -1px;
  width: 1px;
  background: var(--rule-2);
}
.stack-mobile-arrow::after {
  content: "";
  position: absolute;
  left: 21px;
  bottom: -2px;
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--rule-2);
  border-bottom: 1px solid var(--rule-2);
  transform: rotate(45deg);
  background: var(--paper);
}
.stack-mobile-rail {
  margin-top: 16px;
  padding: 14px 15px;
  border: 1px dashed var(--rule-2);
  border-radius: 8px;
  background: var(--paper);
}
.stack-mobile-rail .k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 10px;
}
.stack-mobile-rail ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 7px;
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.45;
}
.stack-mobile-rail li {
  display: flex;
  gap: 8px;
}
.stack-mobile-rail li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terracotta);
  margin-top: 7px;
  flex: 0 0 auto;
}

.stack-legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 24px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.stack-legend .lg { display: flex; align-items: center; gap: 8px; }
.stack-legend .sw {
  width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0;
  border: 1px solid var(--rule);
}
@media (max-width: 820px) {
  .stack-legend { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .stack-diagram {
    padding: 22px 20px 18px;
    overflow-x: visible;
  }
  .stack-diagram .diagram-caption {
    white-space: normal;
    line-height: 1.45;
  }
  .stack-diagram .stack-desktop-svg {
    display: none;
  }
  .stack-mobile-map {
    display: block;
  }
  .stack-legend {
    display: none;
  }
  .stack-mobile-row {
    grid-template-columns: 44px 1fr;
    gap: 10px;
    padding: 12px;
  }
  .stack-mobile-row h3 {
    font-size: 15px;
  }
  .stack-mobile-row p,
  .stack-mobile-rail ul {
    font-size: 12.5px;
  }
  .stack-mobile-arrow {
    height: 12px;
  }
  .stack-mobile-rail {
    margin-top: 12px;
    padding: 12px;
  }
}

/* -- Layer section header: L# anchors the gutter -- */
.fb-section .sec-head {
  grid-template-columns: 120px 1fr;
  gap: 32px;
  margin-bottom: 48px;
  padding-top: 16px;
  border-top: 2px solid var(--ink);
  position: relative;
}
.fb-section .sec-head > *,
.access-lanes > *,
.alert-feed > * {
  min-width: 0;
}
.fb-section .sec-head .layer-gutter {
  font-family: var(--mono);
  font-size: 56px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0;
  padding-top: 4px;
}
.fb-section .sec-head .layer-gutter .l {
  color: var(--terracotta);
  font-weight: 500;
  font-size: 56px;
}
.fb-section .sec-head .layer-body { padding-top: 8px; }
.fb-section .sec-head .sec-kicker {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--terracotta);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.fb-section .sec-head .sec-kicker .num { display: none; }
.fb-section .sec-head .sec-title {
  font-size: 40px;
  line-height: 1.12;
  margin: 0 0 14px;
  max-width: none;
}
.fb-section .sec-head .sec-sub {
  font-size: 17px;
  color: var(--ink-dim);
  max-width: none;
}

/* Optional: "layer opinion" — a one-sentence stance under the sub */
.fb-section .sec-head .layer-stance {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: baseline;
}
.fb-section .sec-head .layer-stance .k {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--terracotta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.fb-section .sec-head .layer-stance p {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 500;
  max-width: none;
  text-wrap: balance;
}
.fb-section .sec-head .layer-stance p em { font-style: normal; color: var(--blue); font-weight: 500; }

@media (max-width: 820px) {
  .fb-section .sec-head {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .fb-section .sec-head .layer-gutter { font-size: 72px; }
  .fb-section .sec-head .layer-gutter .l { font-size: 54px; }
  .fb-section .sec-head .sec-title { font-size: 28px; }
  .fb-section .sec-head .layer-stance { grid-template-columns: 1fr; gap: 8px; }
}

/* (old .layer-head removed — merged into .fb-section .sec-head) */

/* -- Sub-divider used inside a layer section that has two visible halves
   (e.g., L3 Model = Storage + Transform). Renders as a horizontal rule
   plus a smaller header that re-anchors the reader without starting a new
   section. -- */
.fb-section .layer-subdivider {
  margin: 64px 0 28px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: start;
}
.fb-section .layer-subdivider .lsd-rule {
  border-top: 2px solid var(--terracotta);
  margin-top: 14px;
  height: 0;
}
.fb-section .layer-subdivider .lsd-body {
  display: block;
}
.fb-section .layer-subdivider .lsd-kicker {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--terracotta);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.fb-section .layer-subdivider .lsd-title {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.15;
  color: var(--ink);
  font-weight: 600;
  text-wrap: balance;
}
.fb-section .layer-subdivider .lsd-title em { font-style: normal; color: var(--blue); font-weight: 600; }
.fb-section .layer-subdivider .lsd-sub {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: none;
}
.fb-section .layer-subdivider .lsd-stance {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: baseline;
}
.fb-section .layer-subdivider .lsd-stance .k {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--terracotta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.fb-section .layer-subdivider .lsd-stance p {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 500;
  max-width: none;
}
.fb-section .layer-subdivider .lsd-stance p em { font-style: normal; color: var(--blue); font-weight: 500; }

@media (max-width: 820px) {
  .fb-section .layer-subdivider { grid-template-columns: 1fr; gap: 12px; }
  .fb-section .layer-subdivider .lsd-rule { display: none; }
  .fb-section .layer-subdivider .lsd-title { font-size: 24px; }
  .fb-section .layer-subdivider .lsd-stance { grid-template-columns: 1fr; gap: 8px; }
}

/* -- Code block -- */
.snippet {
  margin: 18px 0 0;
  background: #1A1D21;
  color: #E8E3D2;
  border-radius: 10px;
  padding: 18px 22px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  border: 1px solid #2B2F33;
}
.snippet .cm { color: #8E949B; }
.snippet .kw { color: #E8B057; }
.snippet .st { color: #9AC4A2; }
.snippet .fn { color: #7FA6FF; }
.snippet .nm { color: #E8E3D2; }
.snippet .tbl { color: #E0917B; }
.snippet .hl { background: rgba(43,92,255,0.18); padding: 0 2px; border-radius: 2px; }

.snippet-caption {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 14px 0 0;
  display: flex; align-items: center; gap: 10px;
}
.snippet-caption .arrow { color: var(--terracotta); }

/* -- Rhythm / weekly table -- */
.rhythm {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}
.rhythm .cell {
  padding: 26px 24px;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 10px;
  min-height: 220px;
}
.rhythm .cell:last-child { border-right: none; }
.rhythm .wk {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.rhythm .cell h5 {
  margin: 0;
  font-size: 17px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.rhythm .cell ul {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 12px;
  font-size: 13.5px;
  color: var(--ink-dim);
}
.rhythm .cell li {
  padding-left: 14px;
  position: relative;
  line-height: 1.55;
}
.rhythm .cell li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 1px; background: var(--rule-2);
}
@media (max-width: 820px) {
  .rhythm { grid-template-columns: 1fr; }
  .rhythm .cell { border-right: none; border-bottom: 1px solid var(--rule); min-height: 0; }
  .rhythm .cell:last-child { border-bottom: none; }
}

/* -- What we don't do -- */
.dont-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 10px;
}
.dont-list .d-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px 22px;
}
.dont-list .x {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.dont-list .x::before {
  content: '✕';
  font-size: 12px;
  color: var(--terracotta);
}
.dont-list h5 {
  margin: 0 0 6px;
  font-size: 16px; font-weight: 500;
  color: var(--ink);
}
.dont-list p {
  margin: 0; font-size: 14px; color: var(--ink-dim); line-height: 1.5;
}
@media (max-width: 820px) { .dont-list { grid-template-columns: 1fr; } }

/* "We do build" variant — affirmative card */
.dont-list .d-card.do {
  background: white;
  border: 1px solid var(--blue);
}
.dont-list .d-card.do .x { color: var(--blue); }
.dont-list .d-card.do .x::before {
  content: '✓';
  color: var(--blue);
  font-size: 13px;
}

/* AWS aside card (sits just under the don't-list section-head) */
.aws-aside {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 22px 26px;
  margin-bottom: 28px;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 20px 50px -50px rgba(20,22,24,0.2);
}
.aws-aside .lg {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  display: flex; align-items: center; gap: 10px;
}
.aws-aside .lg svg { width: 44px; height: 26px; }
.aws-aside .text {
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.55;
}
.aws-aside .text strong { font-weight: 500; color: var(--ink); }
.aws-aside .text em { font-style: normal; color: var(--ink-dim); }
.aws-aside .rt {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-align: right;
  white-space: nowrap;
}
@media (max-width: 820px) {
  .aws-aside { grid-template-columns: 1fr; gap: 12px; }
  .aws-aside .rt { text-align: left; }
}

/* -- Closing CTA -- */
.fb-close {
  background:
    radial-gradient(700px 400px at 80% 30%, var(--blue-soft) 0%, transparent 60%),
    radial-gradient(500px 300px at 10% 90%, var(--terra-soft) 0%, transparent 55%),
    var(--paper-2);
  border-top: 1px solid var(--rule);
}
.fb-close .wrap { max-width: 980px; }
.fb-close h2 {
  font-size: 44px; line-height: 1.1;
  font-weight: 500; letter-spacing: -0.02em;
  margin: 0 0 16px; max-width: 780px;
}
.fb-close h2 em { font-style: normal; color: var(--blue); font-weight: 500; }
.fb-close p.lede {
  font-size: 19px; color: var(--ink-dim);
  max-width: 680px;
  margin: 0 0 36px;
}
.fb-close .two-paths {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}
.fb-close .path {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 28px 28px 26px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.fb-close .path .k {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.fb-close .path.youtube .k { color: var(--blue); }
.fb-close .path h4 {
  margin: 0;
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.fb-close .path p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 15px; line-height: 1.55;
}
.fb-close .path .btn {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
}
.fb-close .path.youtube .btn {
  background: #FF0033; color: white;
}
.fb-close .path .btn:hover { text-decoration: none; opacity: 0.92; }
.fb-close .path .btn .yt {
  width: 18px; height: 14px;
  background: white;
  border-radius: 3px;
  position: relative;
}
.fb-close .path .btn .yt::after {
  content: '';
  position: absolute;
  left: 6px; top: 3px;
  width: 0; height: 0;
  border-left: 6px solid #FF0033;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
@media (max-width: 820px) {
  .fb-close h2 { font-size: 30px; }
  .fb-close .two-paths { grid-template-columns: 1fr; }
}

/* -- Back link -- */
.fb-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 28px;
  white-space: nowrap;
}
.fb-back:hover { color: var(--ink); text-decoration: none; }
.fb-back .arr { display: inline-block; transform: translateY(-1px); }

/* -- Footer -- */
.fb-footer {
  padding: 32px 0 56px;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 13px;
  font-family: var(--mono);
}
.fb-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.fb-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.fb-footer-brand .brand-mark { width: 48px; }
.fb-footer-brand .brand-name { font-size: 18px; }
.fb-footer-brand .org {
  font-size: 8.5px;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ===================================================================
   ASIDE — now just a shorthand opinion card.
   Same grid as .opinion. No background tint. Label color = type.
   .aside       → blue "Note"
   .aside.warm  → terracotta "Pitfall" / "Anti-pattern"
   =================================================================== */
.aside {
  display: block;
  padding: 28px 0;
  border-top: 1px solid var(--rule-2);
  margin: 0;
  background: none;
  border-left: none;
  border-radius: 0;
  font-size: 15.5px;
  color: var(--ink-dim);
  line-height: 1.6;
  max-width: none;
}
.aside .lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.aside .lbl::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-top: 0;
  flex-shrink: 0;
}
.aside.warm {
  background: none;
  border-left: none;
}
.aside.warm .lbl { color: var(--terracotta); }

/* The body of .aside */
.aside .aside-body {
  padding-top: 0;
}
.aside .aside-body code {
  font-family: var(--mono); font-size: 13.5px;
  background: var(--paper-2); padding: 1px 6px;
  border-radius: 4px; color: var(--ink);
}
.aside .aside-body strong { color: var(--ink); font-weight: 500; }

@media (max-width: 820px) {
  .aside { padding: 22px 0; }
  .aside .lbl { margin-bottom: 10px; }
}

/* -- Principle bar (top of page, before layers) -- */
.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: 36px;
  background: var(--paper-2);
}
.principles .p {
  padding: 24px 28px;
  border-right: 1px solid var(--rule);
  min-width: 0;
}
.principles .p:last-child { border-right: none; }
.principles .p .k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 10px;
}
.principles .p h4 {
  margin: 0 0 6px;
  font-size: 17px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.principles .p p {
  margin: 0;
  font-size: 14px; color: var(--ink-dim); line-height: 1.5;
}
/* Mini-diagram — same language as stack-diagram */
.mini-diagram {
  margin: 28px 0;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 28px 28px 22px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mini-diagram .mcap {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap;
}
.mini-diagram .mcap .n { color: var(--terracotta); }
.mini-diagram svg { width: 100%; height: auto; display: block; }
.mini-diagram .mfoot {
  display: flex; justify-content: flex-start; gap: 24px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--rule-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.mini-diagram .mfoot .tag { display: inline-flex; align-items: center; gap: 8px; }
.mini-diagram .mfoot .sw { width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--rule); }

@media (max-width: 820px) {
  .principles { grid-template-columns: 1fr; }
  .principles .p {
    padding: 20px 22px;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .principles .p:last-child { border-bottom: none; }
  .mini-diagram {
    padding: 22px 20px 18px;
  }
  .mini-diagram .mcap {
    white-space: normal;
    line-height: 1.45;
  }
  .mini-diagram svg {
    min-width: 640px;
  }
  .mini-diagram.tool-flow svg {
    min-width: 720px;
  }
}

/* ==== Mobile scroll affordances for horizontally-scrolling content ==== */
@media (max-width: 720px) {
  /* Right-edge fade signals "more content this way" on touch devices that hide scrollbars. */
  .mini-diagram svg,
  .gov-matrix,
  .snippet {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), rgba(0,0,0,0.15) 100%);
            mask-image: linear-gradient(to right, #000 calc(100% - 28px), rgba(0,0,0,0.15) 100%);
  }
  .mini-diagram::after,
  .snippet::after,
  .gov-matrix::after {
    content: '› swipe';
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 2;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    pointer-events: none;
    opacity: 0.7;
  }
  .mini-diagram,
  .snippet,
  .gov-matrix {
    position: relative;
  }
  .snippet::after { color: rgba(232,227,210,0.5); }
  .snippet { font-size: 11.5px; padding: 16px 18px; }
}

/* Big pull-quote divider */
.fb-quote {
  padding: 72px 0 80px;
  background:
    radial-gradient(600px 300px at 20% 50%, var(--terra-soft) 0%, transparent 60%),
    radial-gradient(500px 280px at 80% 50%, var(--blue-soft) 0%, transparent 60%),
    var(--paper);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.fb-quote .qk {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 18px;
  display: inline-flex; gap: 12px; align-items: center;
}
.fb-quote .qk .b { width: 22px; height: 1px; background: var(--terracotta); }
.fb-quote blockquote {
  font-size: 36px; line-height: 1.25;
  font-weight: 500; letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 auto;
  max-width: 880px;
}
.fb-quote blockquote em { font-style: normal; color: var(--blue); }
.fb-quote .attrib {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}
@media (max-width: 820px) {
  .fb-quote blockquote { font-size: 24px; }
}

/* Dark variant — full-bleed dark band, gives the playbook a heartbeat between L3 and L4 */
.fb-quote--dark {
  background: #0B0D0F;
  color: var(--paper);
  border-top: 1px solid #0B0D0F;
  border-bottom: 1px solid #0B0D0F;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.fb-quote--dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 540px at 18% -10%, rgba(43,92,255,0.22), transparent 60%),
    radial-gradient(820px 480px at 88% 105%, rgba(193,98,68,0.18), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.fb-quote--dark::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(to right, rgba(247,244,236,0.035) 0 1px, transparent 1px 100px),
    repeating-linear-gradient(to bottom, rgba(247,244,236,0.025) 0 1px, transparent 1px 100px);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}
.fb-quote--dark > .wrap { position: relative; z-index: 1; }
.fb-quote--dark .qk { color: var(--terra-soft); }
.fb-quote--dark .qk .b { background: var(--terra-soft); }
.fb-quote--dark blockquote { color: #fff; }
.fb-quote--dark blockquote em {
  background: linear-gradient(90deg, var(--terra-soft), #FFD9C9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  /* Italic slants extend past the line-box; without these, the trailing letter
     of any wrapped line gets clipped by background-clip:text. box-decoration-break
     makes every wrapped line-fragment carry its own padding so each line-end is
     covered. */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-right: 0.12em;
  margin-right: -0.12em;
}
.fb-quote--dark .attrib { color: rgba(247,244,236,0.55); }

/* =============== HERO LAYER FRAME =============== */
/* Visual representation of the framework: five sequential build layers
   wrapped by two cross-cutting discipline ribbons. The discipline rows
   intentionally don't have arrows between themselves and the build row —
   they thread through every build layer, they don't follow the build row. */
.fb-hero-flow {
  margin: 22px 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(200, 107, 75, 0.35);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(6px);
}

/* Discipline ribbons (top + bottom) — full-width, terracotta-tinted, dashed
   bottom/top border to signal "threads through the layers below/above". */
.fb-hero-flow .fhf-discipline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(200, 107, 75, 0.08);
  color: var(--ink);
  text-decoration: none;
  font-size: 12.5px;
  flex-wrap: wrap;
  transition: background 160ms ease;
}
.fb-hero-flow .fhf-discipline:hover {
  background: rgba(200, 107, 75, 0.16);
}
.fb-hero-flow .fhf-discipline--top {
  border-bottom: 1px dashed rgba(200, 107, 75, 0.45);
}
.fb-hero-flow .fhf-discipline--bottom {
  border-top: 1px dashed rgba(200, 107, 75, 0.45);
}
.fb-hero-flow .fhf-d-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(200, 107, 75, 0.18);
  color: var(--terracotta);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.10em;
}
.fb-hero-flow .fhf-d-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.fb-hero-flow .fhf-d-meta {
  font-size: 12px;
  color: var(--ink-soft);
  flex: 1 1 auto;
  min-width: 200px;
}
.fb-hero-flow .fhf-d-arrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--terracotta);
  opacity: 0.7;
  transition: transform 160ms ease, opacity 160ms ease;
}
.fb-hero-flow .fhf-discipline:hover .fhf-d-arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* Build layer row — five pills with arrows between them. */
.fb-hero-flow .fhf-build {
  list-style: none;
  margin: 0;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  background: rgba(255,255,255,0.55);
}
.fb-hero-flow .fhf-build li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fb-hero-flow .fhf-build li:not(:last-child)::after {
  content: '→';
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-faint);
  margin-left: 6px;
}
.fb-hero-flow .fhf-build a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20,22,24,0.04);
  border: 1px solid rgba(20,22,24,0.08);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.fb-hero-flow .fhf-build a:hover {
  background: rgba(43,92,255,0.08);
  border-color: rgba(43,92,255,0.30);
  transform: translateY(-1px);
}
.fb-hero-flow .fhf-n {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.10em;
  color: var(--blue);
  font-weight: 600;
}
.fb-hero-flow .fhf-name {
  font-size: 13px;
  letter-spacing: -0.005em;
}

@media (max-width: 720px) {
  .fb-hero-flow .fhf-discipline {
    padding: 8px 12px;
    gap: 8px;
  }
  .fb-hero-flow .fhf-d-meta { font-size: 11.5px; min-width: 100%; order: 99; }
  .fb-hero-flow .fhf-build { padding: 10px 12px; gap: 6px; }
  .fb-hero-flow .fhf-build li:not(:last-child)::after { margin-left: 4px; }
  .fb-hero-flow .fhf-build a { padding: 5px 10px; font-size: 12px; }
}

/* "What we deliberately skip ↓" link in the hero meta-row */
.fb-hero .meta-row .fb-hero-skip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--terracotta);
  text-decoration: none;
  border-bottom: 1px dashed rgba(193,98,68,0.4);
  padding-bottom: 1px;
  transition: color 160ms ease, border-color 160ms ease;
}
.fb-hero .meta-row .fb-hero-skip:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.fb-hero .meta-row .fb-hero-skip strong { color: inherit; font-weight: 600; }
@media (max-width: 720px) {
  .fb-hero .meta-row .fb-hero-skip { margin-left: 0; }
}

/* =============== STICKY LEFT-RAIL TOC =============== */
.fb-toc {
  display: none;
  position: fixed;
  /* Sit just left of the centered .wrap (max-width 1180px), with a 20px gap.
     At 1500vw this puts left=24px (TOC abuts the inner edge); at wider viewports
     it grows leftward in step with the wrap, preserving a clean gap. */
  left: max(24px, calc((100vw - 1180px) / 2 - 200px));
  top: 50%;
  transform: translateY(-50%);
  width: 168px;
  z-index: 40;
  font-family: var(--mono);
}
.fb-toc-k {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
  padding-left: 12px;
}
.fb-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}
.fb-toc li { margin: 0; }
.fb-toc a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ink-faint);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
  letter-spacing: 0.02em;
  text-transform: none;
}
.fb-toc a:hover {
  color: var(--ink);
  background: rgba(20,22,24,0.02);
}
.fb-toc a.is-active {
  color: var(--blue-ink);
  border-left-color: var(--blue);
  font-weight: 500;
}
.fb-toc .fb-toc-n {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.06em;
  flex: 0 0 auto;
}
.fb-toc a.is-active .fb-toc-n { color: var(--blue-ink); }

/* Only show when the viewport is wide enough that the TOC + 20px gap fits
   left of the wrap without overlapping content text. */
@media (min-width: 1500px) {
  .fb-toc { display: block; }
}

/* When a dark section is behind the TOC, invert text/border colors so it stays
   readable. Toggled by app.js on scroll. */
.fb-toc,
.fb-toc-k,
.fb-toc a,
.fb-toc ol,
.fb-toc .fb-toc-n {
  transition: color 220ms ease, border-color 220ms ease, background 220ms ease;
}
.fb-toc.is-on-dark .fb-toc-k { color: rgba(247,244,236,0.55); }
.fb-toc.is-on-dark ol { border-left-color: rgba(247,244,236,0.16); }
.fb-toc.is-on-dark a { color: rgba(247,244,236,0.62); }
.fb-toc.is-on-dark a:hover {
  color: #fff;
  background: rgba(247,244,236,0.06);
}
.fb-toc.is-on-dark a.is-active {
  color: var(--terra-soft);
  border-left-color: var(--terra-soft);
}
.fb-toc.is-on-dark .fb-toc-n { color: var(--terra-soft); }
.fb-toc.is-on-dark a.is-active .fb-toc-n { color: var(--terra-soft); }

/* =============== PER-LAYER RHYTHM COMPONENTS =============== */

/* TL;DR — sits at the top of every layer, gives a skim-anchor */
.fb-tldr {
  margin: 0 0 36px;
  padding: 22px 26px;
  background: rgba(43,92,255,0.04);
  border: 1px solid rgba(43,92,255,0.18);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  align-items: start;
}
.fb-tldr-k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue-ink);
  font-weight: 600;
  padding-top: 4px;
}
.fb-tldr-body p {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 10px;
}
.fb-tldr-body p:last-child { margin-bottom: 0; }
.fb-tldr-body p strong { color: var(--ink); font-weight: 600; }
.fb-tldr-body ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.fb-tldr-body li {
  position: relative;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}
.fb-tldr-body li::before {
  content: '';
  position: absolute;
  left: 0; top: 10px;
  width: 10px; height: 1px;
  background: var(--blue);
}
.fb-tldr-body li strong { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) {
  .fb-tldr { grid-template-columns: 1fr; gap: 10px; padding: 18px 20px; }
}

/* War-story callout — italic anecdote with a terracotta scar */
.fb-war {
  margin: 28px 0 24px;
  padding: 18px 22px;
  background: rgba(193,98,68,0.04);
  border-left: 3px solid var(--terracotta);
  border-radius: 0 12px 12px 0;
  position: relative;
}
.fb-war-k {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 600;
  margin-bottom: 8px;
}
.fb-war p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  font-style: italic;
  max-width: 720px;
}
.fb-war p strong {
  font-style: normal;
  color: var(--ink);
  font-weight: 600;
}

/* "X vs Y" comparison table */
.fb-vs {
  margin: 28px 0;
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.fb-vs-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.fb-vs-head > div {
  padding: 16px 20px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fb-vs-head > div:first-child { border-right: 1px solid var(--rule); }
.fb-vs-head .vs-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(20,22,24,0.05);
}
.fb-vs-head > div.vs-pick .vs-tag {
  color: var(--blue-ink);
  background: rgba(43,92,255,0.10);
}
.fb-vs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule);
}
.fb-vs-row:last-child { border-bottom: 0; }
.fb-vs-row > div {
  padding: 12px 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-dim);
}
.fb-vs-row > div:first-child { border-right: 1px solid var(--rule); }
.fb-vs-row > div strong { color: var(--ink); font-weight: 600; }
@media (max-width: 720px) {
  .fb-vs-head, .fb-vs-row { grid-template-columns: 1fr; }
  .fb-vs-head > div:first-child,
  .fb-vs-row > div:first-child { border-right: 0; border-bottom: 1px solid var(--rule); }
}

/* Mini "you are here" stack indicator inside layer header */
.fb-mini-stack {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  row-gap: 8px;
  margin: 12px 0 0;
  align-items: center;
}
.fb-mini-stack span {
  width: 26px;
  height: 6px;
  border-radius: 2px;
  background: var(--rule-2);
  transition: background 200ms ease;
  flex: 0 0 auto;
}
.fb-mini-stack span.is-current {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(43,92,255,0.18);
  height: 8px;
  margin: -1px 0;
}
.fb-mini-stack-label {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  flex: 0 0 auto;
}
@media (max-width: 720px) {
  .fb-mini-stack-label { flex-basis: 100%; margin-left: 0; }
}

/* Color rhythm — even layers get a subtle cool tint, odd stay warm */
#l2, #l4 {
  background:
    linear-gradient(180deg, rgba(43,92,255,0.022) 0%, transparent 50%),
    var(--paper);
}

/* L7 — full-bleed dark band as the punchline */
#l5.fb-section--dark {
  background: #0B0D0F;
  color: var(--paper);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-top: 1px solid #0B0D0F;
}
#l5.fb-section--dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 540px at 18% -10%, rgba(43,92,255,0.22), transparent 60%),
    radial-gradient(820px 480px at 88% 105%, rgba(193,98,68,0.18), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
#l5.fb-section--dark::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(to right, rgba(247,244,236,0.03) 0 1px, transparent 1px 100px);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}
#l5.fb-section--dark > .wrap { position: relative; z-index: 1; }
#l5.fb-section--dark .sec-title { color: #fff; }
#l5.fb-section--dark .sec-title em {
  background: linear-gradient(90deg, var(--terra-soft), #FFD9C9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}
#l5.fb-section--dark .sec-sub { color: rgba(247,244,236,0.72); }
#l5.fb-section--dark .layer-gutter { color: rgba(247,244,236,0.18); }
#l5.fb-section--dark .layer-gutter .l { color: rgba(247,244,236,0.55); }
#l5.fb-section--dark .sec-kicker { color: var(--terra-soft); }
#l5.fb-section--dark .layer-stance .k { color: var(--terra-soft); }
#l5.fb-section--dark .layer-stance p { color: rgba(247,244,236,0.78); }
#l5.fb-section--dark .layer-stance p em { color: var(--terra-soft); }
#l5.fb-section--dark .opinion { border-top-color: rgba(247,244,236,0.10); }
#l5.fb-section--dark .opinion .label { color: rgba(247,244,236,0.55); }
#l5.fb-section--dark .opinion .label.rule { color: var(--terra-soft); }
#l5.fb-section--dark .opinion .label.heuristic { color: #B5E5C1; }
#l5.fb-section--dark .opinion .label.opinion { color: #fff; }
#l5.fb-section--dark .opinion h4 { color: #fff; }
#l5.fb-section--dark .opinion p,
#l5.fb-section--dark .opinion ul li { color: rgba(247,244,236,0.78); }
#l5.fb-section--dark .opinion p strong,
#l5.fb-section--dark .opinion ul li strong { color: #fff; }
#l5.fb-section--dark .opinion p code,
#l5.fb-section--dark .opinion h4 code {
  background: rgba(247,244,236,0.08);
  color: #fff;
  border: 1px solid rgba(247,244,236,0.10);
}
#l5.fb-section--dark .fb-tldr {
  background: rgba(43,92,255,0.10);
  border-color: rgba(43,92,255,0.30);
}
#l5.fb-section--dark .fb-tldr-k { color: #B9CCFF; }
#l5.fb-section--dark .fb-tldr-body p,
#l5.fb-section--dark .fb-tldr-body li { color: rgba(247,244,236,0.85); }
#l5.fb-section--dark .fb-tldr-body p strong,
#l5.fb-section--dark .fb-tldr-body li strong { color: #fff; }
#l5.fb-section--dark .fb-war {
  background: rgba(193,98,68,0.10);
  border-left-color: var(--terra-soft);
}
#l5.fb-section--dark .fb-war-k { color: var(--terra-soft); }
#l5.fb-section--dark .fb-war p { color: rgba(247,244,236,0.85); }
#l5.fb-section--dark .fb-war p strong { color: #fff; }
#l5.fb-section--dark .fb-mini-stack span { background: rgba(247,244,236,0.10); }
#l5.fb-section--dark .fb-mini-stack span.is-current {
  background: var(--terra-soft);
  box-shadow: 0 0 0 3px rgba(193,98,68,0.22);
}
#l5.fb-section--dark .fb-mini-stack-label { color: rgba(247,244,236,0.5); }
#l5.fb-section--dark .aside {
  background: rgba(247,244,236,0.04);
  border-color: rgba(247,244,236,0.10);
  color: rgba(247,244,236,0.78);
}
#l5.fb-section--dark .aside .lbl { color: var(--terra-soft); }
#l5.fb-section--dark .aside .aside-body strong { color: #fff; }

/* =============== PRESENTATION / COMPANION MODE =============== */
/* Triggered by ?l=N in the URL. Renders ONE layer pre-zoomed for video chapters. */
body.fb-presenting > nav.nav,
body.fb-presenting .fb-toc,
body.fb-presenting .fb-hero,
body.fb-presenting .email-gate,
body.fb-presenting .fb-footer { display: none !important; }
body.fb-presenting .fb-section,
body.fb-presenting .fb-quote,
body.fb-presenting .fb-close { display: none !important; }
body.fb-presenting .fb-section.is-presenting,
body.fb-presenting .fb-section.is-presenting .layer-stance { display: block !important; }
body.fb-presenting .fb-section.is-presenting .sec-head { display: grid !important; }
body.fb-presenting #locked-content { display: block !important; }

body.fb-presenting {
  background: var(--paper);
  padding-top: 0;
}
body.fb-presenting .fb-section.is-presenting {
  padding: 32px 0 56px;
  border-top: none;
  background: var(--paper);
}
body.fb-presenting .fb-section.is-presenting::before,
body.fb-presenting .fb-section.is-presenting::after { display: none; }

/* Bigger typography in presentation mode — fits 1080p video frame */
body.fb-presenting .fb-section.is-presenting .sec-title { font-size: clamp(36px, 4vw, 56px); }
body.fb-presenting .fb-section.is-presenting .sec-sub { font-size: 19px; max-width: none; }
body.fb-presenting .fb-section.is-presenting .layer-gutter { font-size: clamp(96px, 12vw, 160px); }
body.fb-presenting .fb-section.is-presenting .opinion h4 { font-size: 26px; }
body.fb-presenting .fb-section.is-presenting .opinion p { font-size: 17px; }
body.fb-presenting .fb-section.is-presenting .fb-tldr { padding: 28px 32px; }
body.fb-presenting .fb-section.is-presenting .fb-tldr-body p,
body.fb-presenting .fb-section.is-presenting .fb-tldr-body li { font-size: 17px; }
body.fb-presenting .fb-section.is-presenting .fb-war p { font-size: 17px; }

/* The companion-mode top + bottom nav (built dynamically by JS) */
.fb-present-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 32px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.fb-present-nav--bottom {
  border-bottom: 0;
  border-top: 1px solid var(--rule);
  margin-top: 56px;
}
.fb-present-nav .pn-loc {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.fb-present-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.fb-present-nav a:hover {
  color: var(--ink);
  background: rgba(20,22,24,0.03);
  border-color: var(--rule);
}
.fb-present-nav .pn-back {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--blue-ink);
}
.fb-present-nav .pn-back:hover { color: var(--ink); }
.fb-present-nav .pn-prev,
.fb-present-nav .pn-next { font-size: 12px; }
.fb-present-nav .pn-disabled {
  opacity: 0.32;
  pointer-events: none;
}
.fb-present-nav .pn-spacer { flex: 1; }
@media (max-width: 720px) {
  .fb-present-nav { padding: 14px 22px; gap: 10px; }
  .fb-present-nav--bottom { margin-top: 36px; }
}

/* Loading state while we fetch the gated layer (L4–L7) */
body.fb-presenting .fb-loader {
  margin: 96px auto;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-faint);
}

/* =============== LEAD MAGNET · L1 SOURCE AUDIT TEMPLATE =============== */
/* A Getting Automated–branded download block: top blue bar with the pipe
   logo + product name, body with copy + bullets + soft email-gate form on
   the left, and a high-fidelity spreadsheet preview that fills in cells on
   scroll-into-view on the right. Brand-forward: Pipelines blue is the
   primary accent throughout; terracotta is the secondary "discipline"
   accent for cell encodings. */
.fb-lead-magnet {
  margin: 32px 0 40px;
  background: #fff;
  border: 1.5px solid var(--blue);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 1px 0 rgba(20, 22, 24, 0.04),
    0 32px 64px -32px rgba(43, 92, 255, 0.28),
    0 8px 24px -16px rgba(28, 59, 191, 0.10);
}

/* ----- top brand bar (Pipelines blue + pipe logo) ----- */
.fb-lead-magnet .lm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: linear-gradient(95deg, var(--blue) 0%, var(--blue-ink) 100%);
  color: #fff;
  flex-wrap: wrap;
  position: relative;
}
.fb-lead-magnet .lm-bar::after {
  /* subtle dot pattern overlay on the right end — brand texture */
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; width: 30%;
  background-image: radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 12px 12px;
  background-position: top right;
  opacity: 0.6;
  pointer-events: none;
}
.fb-lead-magnet .lm-bar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.fb-lead-magnet .lm-bar-mark {
  width: 52px;
  height: auto;
  display: block;
  flex-shrink: 0;
}
/* The pipe logo recolored for the dark blue bar */
.fb-lead-magnet .lm-bar-mark .pipe-body  { fill: #fff; }
.fb-lead-magnet .lm-bar-mark .pipe-end   { fill: rgba(255,255,255,0.55); }
.fb-lead-magnet .lm-bar-mark .pipe-mouth { fill: rgba(255,255,255,0.18); }
.fb-lead-magnet .lm-bar-mark .pipe-mouth-inner { fill: rgba(255,255,255,0.10); }
.fb-lead-magnet .lm-bar-mark .pipe-dot   { fill: var(--blue-ink); }
.fb-lead-magnet .lm-bar-name {
  font-size: 14px;
  letter-spacing: -0.005em;
  line-height: 1.2;
  color: #fff;
}
.fb-lead-magnet .lm-bar-name strong { font-weight: 700; }
.fb-lead-magnet .lm-bar-by {
  font-size: 11.5px;
  color: rgba(255,255,255,0.75);
  font-weight: 400;
  margin-left: 4px;
  letter-spacing: 0;
}
.fb-lead-magnet .lm-bar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}
.fb-lead-magnet .lm-bar-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  backdrop-filter: blur(4px);
}
.fb-lead-magnet .lm-bar-pill-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.18);
  animation: lmTagPulse 4.8s ease-in-out infinite;
}
@keyframes lmTagPulse {
  /* Slow, gentle — barely perceptible. Don't pull the eye. */
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,0.18); }
  50%      { box-shadow: 0 0 0 5px rgba(255,255,255,0.06); }
}
.fb-lead-magnet .lm-bar-spec {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.06em;
}

/* ----- body grid (copy + spreadsheet preview) ----- */
.fb-lead-magnet .lm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 36px;
  align-items: start;
  padding: 32px 32px 28px;
}

.fb-lead-magnet .lm-kicker {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue-ink);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.fb-lead-magnet .lm-title {
  margin: 0 0 14px;
  font-size: 32px;
  line-height: 1.08;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.fb-lead-magnet .lm-title em {
  font-style: normal;
  color: var(--blue);
  font-weight: 700;
}
.fb-lead-magnet .lm-lede {
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 540px;
}
.fb-lead-magnet .lm-lede strong {
  color: var(--ink);
  font-weight: 600;
}

.fb-lead-magnet .lm-inside {
  margin: 0 0 24px;
  padding: 18px 18px 14px;
  border-radius: 12px;
  background: var(--blue-soft);
  border: 1px solid rgba(43, 92, 255, 0.18);
}
.fb-lead-magnet .lm-inside-k {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--blue-ink);
  margin-bottom: 10px;
}
.fb-lead-magnet .lm-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: lm-list;
}
.fb-lead-magnet .lm-bullets li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.fb-lead-magnet .lm-bullet-num {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: #fff;
  background: var(--blue);
  padding: 4px 7px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.2;
  min-width: 28px;
  text-align: center;
}
.fb-lead-magnet .lm-bullet-text strong {
  color: var(--ink);
  font-weight: 600;
}

.fb-lead-magnet .lm-form {
  display: flex;
  gap: 10px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.fb-lead-magnet .lm-form input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1.5px solid rgba(20, 22, 24, 0.16);
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.fb-lead-magnet .lm-form input[type="email"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(43, 92, 255, 0.16);
}
.fb-lead-magnet .lm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 13px 22px;
  background: var(--blue);
  font-weight: 600;
}
.fb-lead-magnet .lm-btn:hover {
  background: var(--blue-ink);
}
.fb-lead-magnet .lm-btn .arrow {
  font-family: var(--mono);
  transition: transform 200ms ease;
  font-weight: 700;
}
.fb-lead-magnet .lm-btn:hover .arrow {
  transform: translateY(2px);
}
.fb-lead-magnet .lm-status {
  margin: 0 0 10px;
  min-height: 1.4em;
  font-size: 13px;
  color: var(--ink-soft);
}
.fb-lead-magnet .lm-status.is-ok {
  color: var(--blue-ink);
  font-weight: 600;
}
.fb-lead-magnet .lm-status.is-err {
  color: var(--terracotta);
  font-weight: 500;
}
.fb-lead-magnet .lm-fine {
  margin: 0;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.45;
}

/* ----- spreadsheet preview ----- */
.fb-lead-magnet .lm-anim {
  align-self: stretch;
  display: flex;
  align-items: stretch;
}
.fb-lead-magnet .lm-anim-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #FDFCF7;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--mono);
  box-shadow:
    0 4px 12px -6px rgba(28, 59, 191, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.fb-lead-magnet .lm-anim-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: #EFE9DA;
  border-bottom: 1px solid var(--rule);
}
.fb-lead-magnet .lm-anim-traffic {
  display: flex;
  gap: 6px;
  align-items: center;
}
.fb-lead-magnet .lm-anim-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.fb-lead-magnet .lm-anim-dot--r { background: #E16A5C; }
.fb-lead-magnet .lm-anim-dot--y { background: #E5C453; }
.fb-lead-magnet .lm-anim-dot--g { background: #6BB07F; }

.fb-lead-magnet .lm-anim-doc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: center;
  padding: 4px 12px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid rgba(20, 22, 24, 0.08);
}
.fb-lead-magnet .lm-anim-doc-mark {
  width: 22px;
  height: auto;
  display: block;
  flex-shrink: 0;
}
.fb-lead-magnet .lm-anim-doc-mark .pipe-body  { fill: var(--blue); }
.fb-lead-magnet .lm-anim-doc-mark .pipe-end   { fill: var(--blue-ink); }
.fb-lead-magnet .lm-anim-doc-mark .pipe-mouth { fill: var(--ink); }
.fb-lead-magnet .lm-anim-doc-mark .pipe-mouth-inner { fill: #0A0B0D; }
.fb-lead-magnet .lm-anim-doc-mark .pipe-dot   { fill: #fff; }
.fb-lead-magnet .lm-anim-doc-name {
  font-size: 11.5px;
  color: var(--ink);
  letter-spacing: 0.02em;
  font-weight: 600;
}
.fb-lead-magnet .lm-anim-zoom {
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

/* tab strip — six sheets, one active */
.fb-lead-magnet .lm-anim-tabs {
  display: flex;
  gap: 0;
  padding: 0 6px;
  background: #F5EFE0;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.fb-lead-magnet .lm-anim-tabs::-webkit-scrollbar { display: none; }
.fb-lead-magnet .lm-anim-tab {
  padding: 7px 11px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.fb-lead-magnet .lm-anim-tab--active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  background: #FDFCF7;
  font-weight: 700;
}

/* spreadsheet grid — 6 columns now (row-number gutter + 5 data columns) */
.fb-lead-magnet .lm-anim-grid {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1.4fr 0.85fr 0.95fr 0.85fr 0.6fr;
  gap: 0;
  background: var(--rule);
  border-top: 0;
}
.fb-lead-magnet .lm-anim-cell {
  background: #fff;
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--ink);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  min-height: 32px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(2px);
}
.fb-lead-magnet .lm-anim-cell--head {
  background: #EEF3FF;
  color: var(--blue-ink);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  opacity: 1;
  transform: none;
}
.fb-lead-magnet .lm-anim-cell--head-corner {
  background: #E6EDFF;
}
.fb-lead-magnet .lm-anim-cell--rownum {
  background: #F5EFE0;
  color: var(--ink-faint);
  font-size: 10.5px;
  text-align: center;
  font-weight: 600;
  opacity: 1;
  transform: none;
}
.fb-lead-magnet .lm-anim-cell--num {
  text-align: center;
}
.fb-lead-magnet .lm-anim-cell--blue {
  color: var(--blue);
  font-weight: 700;
  background: #F8FAFF;
}
.fb-lead-magnet .lm-anim-cell--terra {
  color: var(--terracotta);
  font-weight: 700;
  background: #FDF7F2;
}
.fb-lead-magnet .lm-anim-cell--gray {
  color: var(--ink-faint);
  font-weight: 700;
  background: #FAF8F2;
}
.fb-lead-magnet .lm-anim-cell--high {
  color: #C8513A;
  background: #FBEFE6;
  font-weight: 700;
  text-align: center;
}
.fb-lead-magnet .lm-anim-cell--med {
  color: #B58820;
  background: #FBF4DA;
  font-weight: 700;
  text-align: center;
}
.fb-lead-magnet .lm-anim-cell--low {
  color: #4A7B5A;
  background: #E8F2EA;
  font-weight: 700;
  text-align: center;
}

/* Cells fade in with per-cell delay when the frame enters the viewport. */
.fb-lead-magnet .lm-anim-frame.is-playing .lm-anim-cell:not(.lm-anim-cell--head):not(.lm-anim-cell--rownum) {
  animation: lmCellFill 240ms ease-out forwards;
  animation-delay: var(--d, 0s);
}
@keyframes lmCellFill {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}

/* Blue cursor — scans across each row as cells fill in. Six columns total,
   first is the row-number gutter; cursor starts at column 1.
   The cursor is hidden (opacity: 0) during the brief teleport between rows
   so it doesn't visibly streak diagonally back across the spreadsheet. */
.fb-lead-magnet .lm-anim-cursor {
  position: absolute;
  pointer-events: none;
  width: calc((100% - 32px) / 5);
  height: 32px;
  left: 32px;
  background: linear-gradient(90deg,
    rgba(43, 92, 255, 0.00) 0%,
    rgba(43, 92, 255, 0.12) 35%,
    rgba(43, 92, 255, 0.22) 50%,
    rgba(43, 92, 255, 0.12) 65%,
    rgba(43, 92, 255, 0.00) 100%);
  border-left: 1.5px solid var(--blue);
  border-right: 1.5px solid var(--blue);
  opacity: 0;
  transform: translate3d(0, 32px, 0);
}
.fb-lead-magnet .lm-anim-frame.is-playing .lm-anim-cursor {
  animation: lmCursorScan 5.4s linear forwards;
  animation-delay: 0.2s;
}
@keyframes lmCursorScan {
  /* Header offset 32px = top of row 1. Each row is 32px tall, so successive
     rows live at y = 32, 64, 96, 128, 160, 192. Cursor scans 0% → 400% (5 cols),
     then disappears (opacity 0) for 1% while it teleports to the next row,
     then reappears at the new row's column 0 to begin the next scan. */
  0%    { opacity: 0; transform: translate3d(0,    32px, 0); }
  3%    { opacity: 1; transform: translate3d(0,    32px, 0); }
  /* Row 1 → */
  15%   { opacity: 1; transform: translate3d(400%, 32px, 0); }
  16%   { opacity: 0; transform: translate3d(400%, 32px, 0); }
  /* teleport to row 2 (invisible) */
  17%   { opacity: 0; transform: translate3d(0,    64px, 0); }
  /* Row 2 → */
  18%   { opacity: 1; transform: translate3d(0,    64px, 0); }
  29%   { opacity: 1; transform: translate3d(400%, 64px, 0); }
  30%   { opacity: 0; transform: translate3d(400%, 64px, 0); }
  /* teleport to row 3 */
  31%   { opacity: 0; transform: translate3d(0,    96px, 0); }
  /* Row 3 → */
  32%   { opacity: 1; transform: translate3d(0,    96px, 0); }
  42%   { opacity: 1; transform: translate3d(400%, 96px, 0); }
  43%   { opacity: 0; transform: translate3d(400%, 96px, 0); }
  /* teleport to row 4 */
  44%   { opacity: 0; transform: translate3d(0,    128px, 0); }
  /* Row 4 → */
  45%   { opacity: 1; transform: translate3d(0,    128px, 0); }
  55%   { opacity: 1; transform: translate3d(400%, 128px, 0); }
  56%   { opacity: 0; transform: translate3d(400%, 128px, 0); }
  /* teleport to row 5 */
  57%   { opacity: 0; transform: translate3d(0,    160px, 0); }
  /* Row 5 → */
  58%   { opacity: 1; transform: translate3d(0,    160px, 0); }
  68%   { opacity: 1; transform: translate3d(400%, 160px, 0); }
  69%   { opacity: 0; transform: translate3d(400%, 160px, 0); }
  /* teleport to row 6 */
  70%   { opacity: 0; transform: translate3d(0,    192px, 0); }
  /* Row 6 → */
  71%   { opacity: 1; transform: translate3d(0,    192px, 0); }
  90%   { opacity: 1; transform: translate3d(400%, 192px, 0); }
  /* Fade out, stay at last position */
  100%  { opacity: 0; transform: translate3d(400%, 192px, 0); }
}

.fb-lead-magnet .lm-anim-statusbar {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  background: var(--blue-soft);
  border-top: 1px solid rgba(43, 92, 255, 0.18);
  font-family: var(--mono);
}
.fb-lead-magnet .lm-anim-status-k {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--blue-ink);
  letter-spacing: 0.14em;
  font-weight: 700;
}
.fb-lead-magnet .lm-anim-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6BB07F;
  box-shadow: 0 0 0 2px rgba(107, 176, 127, 0.20);
}
.fb-lead-magnet .lm-anim-status-tab {
  font-size: 10.5px;
  color: var(--blue);
  font-weight: 600;
}
.fb-lead-magnet .lm-anim-status-meta {
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .fb-lead-magnet .lm-anim-cell:not(.lm-anim-cell--head):not(.lm-anim-cell--rownum) {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .fb-lead-magnet .lm-bar-pill-dot { animation: none; }
  .fb-lead-magnet .lm-anim-cursor { display: none; }
}

@media (max-width: 1040px) {
  .fb-lead-magnet .lm-grid { grid-template-columns: 1fr; gap: 28px; padding: 28px 24px 24px; }
  .fb-lead-magnet .lm-title { font-size: 28px; }
}
@media (max-width: 720px) {
  .fb-lead-magnet { margin: 24px 0 32px; }
  .fb-lead-magnet .lm-bar { padding: 12px 18px; }
  .fb-lead-magnet .lm-bar-mark { width: 44px; }
  .fb-lead-magnet .lm-bar-name { font-size: 13px; }
  .fb-lead-magnet .lm-bar-by { display: block; margin-left: 0; }
  .fb-lead-magnet .lm-grid { padding: 24px 20px 22px; }
  .fb-lead-magnet .lm-title { font-size: 24px; }
  .fb-lead-magnet .lm-anim-cell { padding: 7px 8px; font-size: 11px; min-height: 30px; }
  .fb-lead-magnet .lm-anim-grid { grid-template-columns: 28px 1.2fr 0.8fr 0.85fr 0.7fr 0.55fr; }
  .fb-lead-magnet .lm-anim-cursor { width: calc((100% - 28px) / 5); left: 28px; height: 30px; }
  .fb-lead-magnet .lm-anim-status-meta { display: none; }
}

/* =============== EMAIL GATE (soft paywall) =============== */
.email-gate {
  padding: 56px 0 64px;
  position: relative;
  z-index: 5;
  background: var(--paper);
}
.email-gate-card {
  position: relative;
  margin: 0 auto;
  max-width: 720px;
  padding: 40px 44px 36px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 22px;
  border: 1px solid var(--ink);
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 32px 80px -32px rgba(20,22,24,0.5),
    0 12px 32px -16px rgba(20,22,24,0.32);
}
.email-gate-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(720px 360px at 0% 0%, rgba(43,92,255,0.22), transparent 60%),
    radial-gradient(560px 280px at 100% 100%, rgba(193,98,68,0.18), transparent 60%);
  pointer-events: none;
}
.email-gate-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(to right, rgba(247,244,236,0.04) 0 1px, transparent 1px 80px);
  opacity: 0.5;
  pointer-events: none;
}
.email-gate-card > * { position: relative; }

.email-gate .eg-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.email-gate .eg-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--terra-soft);
  color: #2B1810;
}
.email-gate .eg-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247,244,236,0.62);
}
.email-gate h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 14px;
}
.email-gate .eg-lede {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(247,244,236,0.82);
  margin: 0 0 22px;
}
.email-gate .eg-lede strong { color: #fff; font-weight: 600; }

.email-gate form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.email-gate input[type="email"] {
  flex: 1 1 260px;
  min-width: 0;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 15px;
  color: #fff;
  background: rgba(247,244,236,0.06);
  border: 1px solid rgba(247,244,236,0.18);
  border-radius: 12px;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.email-gate input[type="email"]::placeholder { color: rgba(247,244,236,0.42); }
.email-gate input[type="email"]:focus {
  border-color: var(--terra-soft);
  background: rgba(247,244,236,0.10);
}
.email-gate .btn-primary {
  flex: 0 0 auto;
  padding: 14px 24px;
  background: #fff;
  color: var(--ink);
  border: 1px solid #fff;
  border-radius: 12px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.email-gate .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -14px rgba(255,255,255,0.4);
}
.email-gate .btn-primary:disabled { opacity: 0.6; cursor: progress; }
.email-gate .btn-primary .arrow {
  transition: transform 200ms ease;
}
.email-gate .btn-primary:hover:not(:disabled) .arrow { transform: translateX(2px); }

.email-gate .eg-status {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.5;
  min-height: 1.5em;
  color: rgba(247,244,236,0.65);
}
.email-gate .eg-status[data-state="err"] { color: var(--terra-soft); }
.email-gate .eg-status[data-state="ok"]  { color: #B5E5C1; }
.email-gate .eg-fine {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(247,244,236,0.48);
}

/* Smooth collapse animation when unlocking */
.email-gate.is-unlocking { animation: eg-collapse 700ms ease forwards; }
@keyframes eg-collapse {
  to { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }
}

/* Locked content is no longer in the DOM until unlock — no CSS blur needed.
   When fetched + injected, sections fade in via the .is-revealing animation. */
#locked-content[data-locked-content] { min-height: 0; }
#locked-content.is-revealing > * {
  animation: lcReveal 600ms cubic-bezier(0.18, 0.71, 0.41, 1) both;
}
#locked-content.is-revealing > *:nth-child(1) { animation-delay: 0ms; }
#locked-content.is-revealing > *:nth-child(2) { animation-delay: 80ms; }
#locked-content.is-revealing > *:nth-child(3) { animation-delay: 160ms; }
#locked-content.is-revealing > *:nth-child(n+4) { animation-delay: 240ms; }
@keyframes lcReveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #locked-content.is-revealing > * { animation: none; }
}

@media (max-width: 720px) {
  .email-gate-card { padding: 32px 24px 28px; margin: 0 8px; }
  .email-gate form { flex-direction: column; }
  .email-gate .btn-primary { width: 100%; justify-content: center; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  body:not(.email-gate-unlocked) .email-gate ~ section,
  body:not(.email-gate-unlocked) .email-gate ~ aside { transition: none; }
  .email-gate.is-unlocking { animation: none; }
}

/* =============== CONCRETE ARTIFACTS PER LAYER =============== */
.fb-artifact {
  margin: 32px 0 0;
  border-radius: 14px;
  background: #0B0D0F;
  color: #E1E5EB;
  border: 1px solid rgba(20,22,24,0.92);
  overflow: hidden;
  box-shadow: 0 22px 48px -32px rgba(20,22,24,0.45);
}
.fb-art-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(247,244,236,0.04);
  border-bottom: 1px solid rgba(247,244,236,0.07);
  font-family: var(--mono);
  font-size: 12px;
}
.fb-art-tag {
  background: var(--terra-soft);
  color: #2B1810;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  flex: 0 0 auto;
}
.fb-art-name {
  color: #fff;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.fb-art-meta {
  color: rgba(247,244,236,0.55);
  font-size: 11px;
  margin-left: auto;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.fb-art-code {
  margin: 0;
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #C7CFD8;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
  background: #0B0D0F;
  tab-size: 2;
}
.fb-art-code .kw  { color: #9CC4FF; }
.fb-art-code .str { color: #E8C5A0; }
.fb-art-code .com { color: #6B7280; font-style: italic; }
.fb-art-code .fn  { color: #B5D8C8; }
.fb-art-code .num { color: #E8B5C5; }
.fb-art-code .typ { color: #C8B5E8; }
.fb-art-code .var { color: #fff; }
.fb-art-foot {
  padding: 12px 18px 14px;
  background: rgba(247,244,236,0.03);
  border-top: 1px solid rgba(247,244,236,0.07);
  font-family: var(--sans);
  font-size: 13px;
  color: rgba(247,244,236,0.74);
  line-height: 1.55;
}
.fb-art-foot strong { color: #fff; font-weight: 500; }
.fb-art-foot .k {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terra-soft);
  margin-right: 8px;
}
@media (max-width: 720px) {
  .fb-artifact { margin: 24px -22px 0; border-radius: 0; border-left: 0; border-right: 0; }
  .fb-art-code { font-size: 11.5px; padding: 14px 18px; }
}

/* =============== ENGINEER FAQ =============== */
.fb-faq {
  background:
    radial-gradient(700px 360px at 100% 0%, rgba(43,92,255,0.04), transparent 60%),
    var(--paper);
}
.fb-faq-list {
  margin: 8px 0 0;
  border-top: 1px solid var(--rule);
}
.fb-faq-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
}
.fb-faq-item h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.fb-faq-q-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 600;
  padding-top: 4px;
}
.fb-faq-body p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-dim);
}
.fb-faq-body p:last-child { margin-bottom: 0; }
.fb-faq-body p strong { color: var(--ink); font-weight: 600; }
.fb-faq-body code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--paper-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink);
}
@media (max-width: 720px) {
  .fb-faq-item { grid-template-columns: 1fr; gap: 8px; }
  .fb-faq-q-tag { padding-top: 0; }
}

/* =============== CLOSE-SECTION POLISH =============== */
.fb-close .path.path--primary {
  background: linear-gradient(160deg, rgba(43,92,255,0.06) 0%, transparent 80%), var(--paper);
  border-color: rgba(43,92,255,0.28);
}
.fb-close .path.path--primary .btn {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.fb-close .path.path--primary .btn:hover {
  background: var(--blue);
  border-color: var(--blue);
}
.fb-close-foot {
  margin: 32px auto 0;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-faint);
  max-width: 600px;
  padding-top: 24px;
  border-top: 1px dashed var(--rule-2);
}
.fb-close-foot a {
  color: var(--blue-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Four-tile observability card */
.obs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: white;
  margin: 28px 0 12px;
}
.obs-grid .tile {
  padding: 22px 20px;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 8px;
  min-height: 180px;
}
.obs-grid .tile:last-child { border-right: none; }
.obs-grid .tile .ic {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.obs-grid .tile.t1 .ic { background: var(--blue-soft);  color: var(--blue-ink); }
.obs-grid .tile.t2 .ic { background: #FBEFE6;            color: var(--terracotta); }
.obs-grid .tile.t3 .ic { background: #E8EDDF;            color: var(--sage); }
.obs-grid .tile.t4 .ic { background: #F8EED5;            color: var(--mustard); }
.obs-grid .tile h5 {
  margin: 0; font-size: 15px; font-weight: 500; color: var(--ink); letter-spacing: -0.005em;
}
.obs-grid .tile p {
  margin: 0; font-size: 13.5px; color: var(--ink-dim); line-height: 1.5;
}
.obs-grid .tile .ex {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  padding-top: 8px;
  border-top: 1px dashed var(--rule-2);
}
@media (max-width: 820px) {
  .obs-grid { grid-template-columns: repeat(2, 1fr); }
  .obs-grid .tile { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .obs-grid .tile:nth-child(2n) { border-right: none; }
  .obs-grid .tile:nth-last-child(-n+2) { border-bottom: none; }
}

/* Split diagram (two-up side-by-side in one card) */
.split-diagram {
  margin: 36px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.split-diagram .sd {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.split-diagram .sd.bad { background: var(--paper-2); }
.split-diagram .sd .sk {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.split-diagram .sd.bad  .sk { color: var(--terracotta); }
.split-diagram .sd.good .sk { color: var(--blue); }
.split-diagram .sd .sk .d { width: 7px; height: 7px; border-radius: 50%; }
.split-diagram .sd.bad  .sk .d { background: var(--terracotta); }
.split-diagram .sd.good .sk .d { background: var(--blue); }
.split-diagram .sd h5 {
  margin: 0; font-size: 16px; font-weight: 500; color: var(--ink);
}
.split-diagram .sd p {
  margin: 0; font-size: 13.5px; color: var(--ink-dim); line-height: 1.5;
}
.split-diagram .sd svg { width: 100%; height: auto; }
@media (max-width: 820px) {
  .split-diagram { grid-template-columns: 1fr; }
}

/* fb-decision and pull-quote deprecated — use .opinion + .diagram instead. */

/* ==== L2 warehouse scale ladder ==== */
.wh-ladder {
  margin: 32px 0 24px;
}
.wh-axis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 0 10px;
}
.wh-axis .tick { position: relative; padding-left: 4px; }
.wh-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}
.wh-bar .wh-seg { height: 100%; }
.wh-bar .s1 { background: #D7B96C; }
.wh-bar .s2 { background: #2B5CFF; }
.wh-bar .s3 { background: #C86B4B; }
.wh-bar .s4 { background: #141618; }

.wh-stages {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}
.wh-stages .wh-stage {
  border: 1px solid var(--rule);
  border-top-width: 3px;
  border-radius: 10px;
  padding: 18px 20px;
  background: var(--paper);
  display: flex; flex-direction: column; gap: 10px;
}
.wh-stages .wh-stage.s1 { border-top-color: #D7B96C; }
.wh-stages .wh-stage.s2 { border-top-color: var(--blue); background: #F2F6FF; }
.wh-stages .wh-stage.s3 { border-top-color: #C86B4B; }
.wh-stages .wh-stage .k {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
}
.wh-stages .wh-stage h5 {
  margin: 0;
  font-size: 17px; font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.wh-stages .wh-stage p {
  margin: 0; font-size: 13.5px; line-height: 1.55;
  color: var(--ink-dim);
}
.wh-stages .wh-stage .chips {
  display: flex; flex-wrap: wrap; gap: 5px;
  font-family: var(--mono); font-size: 11px;
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--rule-2);
}
.wh-stages .wh-stage .chips span {
  padding: 3px 8px; border-radius: 999px;
  background: white; border: 1px solid var(--rule);
  color: var(--ink);
}
@media (max-width: 820px) {
  .wh-stages { grid-template-columns: 1fr; }
  .wh-axis { display: none; }
  .wh-bar { display: none; }
}

/* ==== Explainers (teach-mode primitives) ==== */

/* Inline dotted-underline term with hover/tap definition */
.def {
  position: relative;
  border-bottom: 1px dotted var(--terracotta);
  cursor: help;
  color: inherit;
  padding-bottom: 1px;
}
.def[data-def]::after {
  content: attr(data-def);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  background: var(--ink);
  color: #F6EFDC;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 6px;
  width: max-content;
  max-width: 320px;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
  box-shadow: 0 6px 20px rgba(20,22,24,0.18);
}
.def[data-def]::before {
  content: "";
  position: absolute;
  left: 16px;
  top: calc(100% + 2px);
  z-index: 21;
  width: 10px; height: 10px;
  background: var(--ink);
  transform: rotate(45deg) translateY(-4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}
.def:hover::after,
.def:hover::before,
.def:focus::after,
.def:focus::before,
.def.open::after,
.def.open::before {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 560px) {
  .def[data-def]::after {
    left: 50%;
    width: min(82vw, 320px);
    max-width: 82vw;
    transform: translate(calc(-50% + var(--def-shift, 0px)), -4px);
  }
  .def[data-def]::before {
    left: 50%;
    transform: translateX(-50%) rotate(45deg) translateY(-4px);
  }
  .def:hover::after,
  .def:focus::after,
  .def.open::after {
    transform: translate(calc(-50% + var(--def-shift, 0px)), 0);
  }
}

/* Explainer card: a teaching block that sits BEFORE the opinions in a layer */
.explainer {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--terracotta);
  border-radius: 12px;
  padding: 28px 32px 30px;
  margin: 0 0 28px;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  align-items: start;
}
.explainer .ex-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  padding-top: 4px;
}
.explainer .ex-kicker .icn {
  display: block;
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-top: 6px;
  text-transform: none;
}
.explainer .ex-body h4 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
}
.explainer .ex-body p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}
.explainer .ex-body p:last-child { margin-bottom: 0; }
.explainer .ex-body p .analogy {
  background: #FFF6E6;
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ink);
}
.explainer .ex-body em { font-style: normal; color: var(--blue); font-weight: 500; }

/* Side-by-side metaphor figures inside an explainer */
.ex-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 20px;
}
.ex-compare .fig {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px 20px 16px;
}
.ex-compare .fig .ft {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}
.ex-compare .fig h5 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}
.ex-compare .fig p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-dim);
}
.ex-compare .fig svg { display: block; width: 100%; height: auto; margin: 10px 0; }
.ex-compare .fig.left .ft { color: #8E7014; }
.ex-compare .fig.right .ft { color: var(--blue); }

/* "When you want the other one" tail line */
.ex-when {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--paper-2);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  align-items: baseline;
}
.ex-when .k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
}

@media (max-width: 820px) {
  .explainer { grid-template-columns: 1fr; gap: 16px; padding: 22px; }
  .ex-compare { grid-template-columns: 1fr; }
  .ex-when { grid-template-columns: 1fr; gap: 4px; }
}

/* ==== L1 custom-first: single-column decision + fit lists ==== */
.fb-decision.single {
  display: block;
}
.fb-decision.single .vs { display: none; }
.fb-decision .side.solo {
  width: 100%;
}

.sd .fit-list {
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: 88px 1fr;
  column-gap: 14px;
  row-gap: 10px;
  align-items: start;
  font-size: 13px;
  line-height: 1.5;
}
.sd .fit-list dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 3px;
}
.sd .fit-list dd {
  margin: 0;
  color: var(--ink-dim);
}
.sd .fit-list dd code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(0,0,0,0.04);
  padding: 0 4px;
  border-radius: 3px;
  color: var(--ink);
}

/* ==== L4: Orchestration graduation ladder ==== */
.graduation {
  display: grid;
  grid-template-columns: 1fr 180px 1fr;
  gap: 0;
  margin: 36px 0 24px;
  align-items: stretch;
}
.graduation .stage {
  border-radius: 12px;
  padding: 26px 28px;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  min-height: 320px;
}
.graduation .stage.one {
  background: var(--paper-2);
}
.graduation .stage.two {
  background: linear-gradient(180deg, #EAF0FF 0%, #F2F6FF 100%);
  border-color: var(--blue);
}
.graduation .stage .kicker {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint);
  display: flex; align-items: center; gap: 10px;
}
.graduation .stage.two .kicker { color: var(--blue); }
.graduation .stage .kicker .n {
  font-weight: 600; font-size: 14px; letter-spacing: 0.02em;
}
.graduation .stage h4 {
  margin: 0;
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.graduation .stage .stack {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 4px 0 6px;
}
.graduation .stage .chip {
  font-family: var(--mono); font-size: 11px;
  background: white; border: 1px solid var(--rule);
  padding: 6px 10px; border-radius: 999px;
  color: var(--ink);
}
.graduation .stage.two .chip {
  background: white; border-color: var(--blue-soft); color: var(--blue);
}
.graduation .stage p {
  margin: 0;
  font-size: 14.5px; line-height: 1.55;
  color: var(--ink-dim);
}
.graduation .stage .fits {
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 70px 1fr; gap: 10px;
  font-size: 13px;
}
.graduation .stage .fits dt {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); padding-top: 2px;
}
.graduation .stage .fits dd { margin: 0; color: var(--ink); }
.graduation .stage.two .fits { border-top-color: rgba(43,92,255,0.18); }

.graduation .gate {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  position: relative;
  padding: 0 18px;
}
.graduation .gate .arrow {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-faint);
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
}
.graduation .gate .arrow::before,
.graduation .gate .arrow::after {
  content: ''; width: 14px; height: 1px; background: var(--rule);
}
.graduation .gate .triggers {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%;
}
.graduation .gate .trigger {
  font-size: 12px; color: var(--ink);
  background: white;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--terracotta);
  padding: 10px 12px;
  border-radius: 4px;
  line-height: 1.4;
}
.graduation .gate .trigger strong { font-weight: 500; }
.graduation .gate h6 {
  margin: 0 0 2px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--terracotta);
  text-align: center;
}
@media (max-width: 900px) {
  .graduation { grid-template-columns: 1fr; }
  .graduation .gate { padding: 14px 0; }
  .graduation .stage { min-height: 0; }
}

/* ==== L6: Columns governance matrix ==== */
.gov-matrix {
  margin: 32px 0 24px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
}
.gov-matrix .gm-head {
  display: grid;
  grid-template-columns: 28px minmax(200px, 1.4fr) 100px repeat(3, 1fr);
  gap: 0;
  padding: 14px 20px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
}
.gov-matrix .gm-head div { padding: 0 6px; }
.gov-matrix .gm-row {
  display: grid;
  grid-template-columns: 28px minmax(200px, 1.4fr) 100px repeat(3, 1fr);
  gap: 0;
  padding: 11px 20px;
  border-bottom: 1px solid var(--rule-2);
  align-items: center;
  font-size: 13.5px;
}
.gov-matrix .gm-row:last-child { border-bottom: none; }
.gov-matrix .gm-row > div { padding: 0 6px; }
.gov-matrix .gm-row .col {
  font-family: var(--mono); color: var(--ink);
  font-size: 13px;
}
.gov-matrix .gm-row .tag {
  display: inline-block;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-faint);
  border: 1px solid var(--rule);
}
.gov-matrix .gm-row .tag.pii { background: #FBEFE6; color: var(--terracotta); border-color: var(--terra-soft); }
.gov-matrix .gm-row .tag.pci { background: #FBEFE6; color: var(--terracotta); border-color: var(--terra-soft); }
.gov-matrix .gm-row .tag.ok  { background: #EAF2F0; color: var(--sage); border-color: #CBDDE5; }
.gov-matrix .gm-row .access {
  font-family: var(--mono); font-size: 11.5px;
  color: var(--ink);
}
.gov-matrix .gm-row .access.allow { color: var(--sage); }
.gov-matrix .gm-row .access.redact { color: var(--mustard); }
.gov-matrix .gm-row .access.deny { color: var(--terracotta); }
.gov-matrix .gm-row .access::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  margin-right: 7px; vertical-align: 1px;
  background: currentColor;
}
.gov-matrix .gm-icon {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-faint);
}
.gov-matrix .gm-foot {
  padding: 12px 20px;
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  display: flex; gap: 20px; flex-wrap: wrap;
}
.gov-matrix .gm-foot .k { color: var(--ink); }
@media (max-width: 820px) {
  .gov-matrix { overflow-x: auto; }
  .gov-matrix .gm-head, .gov-matrix .gm-row {
    grid-template-columns: 28px 180px 80px repeat(3, 110px);
    min-width: 680px;
  }
}

/* Access-scope lanes block */
.access-lanes {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  margin: 22px 0 14px;
  padding: 22px 0;
  border-top: 1px dashed var(--rule-2);
}
.access-lanes > .lbl {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--terracotta);
  padding-top: 6px;
  display: flex; align-items: flex-start; gap: 8px;
}
.access-lanes > .lbl::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--terracotta);
  margin-top: 5px; flex-shrink: 0;
}
.access-lanes .lanes {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.access-lanes .lane {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--paper);
  display: flex; flex-direction: column; gap: 8px;
}
.access-lanes .lane .r {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
}
.access-lanes .lane h5 {
  margin: 0;
  font-size: 16px; font-weight: 500; color: var(--ink);
}
.access-lanes .lane p {
  margin: 0; font-size: 13px; line-height: 1.5;
  color: var(--ink-dim);
}
.access-lanes .lane .tag-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding-top: 10px; border-top: 1px solid var(--rule-2);
  margin-top: 4px;
}
.access-lanes .lane .tag-row span {
  padding: 3px 0; border-radius: 0;
}
.access-lanes .lane .tag-row .y { color: var(--sage); background: none; }
.access-lanes .lane .tag-row .r { color: var(--terracotta); background: none; }
.access-lanes .lane .tag-row .m { color: var(--mustard); background: none; }
@media (max-width: 820px) {
  .access-lanes { grid-template-columns: 1fr; }
  .access-lanes .lanes { grid-template-columns: 1fr; }
}

/* ==== L5: live alert feed ==== */
.alert-feed {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  margin: 28px 0 16px;
  padding: 24px 0;
  border-top: 1px dashed var(--rule-2);
}
.alert-feed > .lbl {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mustard);
  padding-top: 6px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-feed > .lbl::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--mustard);
  margin-top: 5px; flex-shrink: 0;
}
.alert-feed .feed {
  background: #0F1114;
  color: var(--paper);
  border-radius: 10px;
  padding: 18px 22px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  max-width: 860px;
}
.alert-feed .feed .hd {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 10.5px; letter-spacing: 0.16em; color: rgba(247,244,236,0.5);
  text-transform: uppercase;
}
.alert-feed .feed .hd .ch { color: #8FB2FF; }
.alert-feed .feed .line { display: grid; grid-template-columns: 70px 14px 1fr; gap: 8px; padding: 4px 0; }
.alert-feed .feed .t { color: rgba(247,244,236,0.4); }
.alert-feed .feed .dot { width: 7px; height: 7px; border-radius: 50%; background: #C7A447; margin-top: 6px; }
.alert-feed .feed .dot.red { background: #D27151; }
.alert-feed .feed .dot.ok  { background: #6E8B6C; }
.alert-feed .feed .msg { color: rgba(247,244,236,0.92); }
.alert-feed .feed .msg strong { color: #FFE5B8; font-weight: 500; }
.alert-feed .feed .msg code {
  font-family: var(--mono);
  color: #8FB2FF; background: rgba(143,178,255,0.08);
  padding: 0 5px; border-radius: 3px;
}
@media (max-width: 820px) {
  .alert-feed { grid-template-columns: 1fr; }
}

/* =============================================================================
   PER-LAYER PAGES — chrome that wraps the extracted layer content
   ============================================================================= */
/* Body class set by build_layer_pages.py — separates per-layer page styling
   from the hub. .layer-page--build vs .layer-page--discipline differs only in
   accent color (blue for build layers, terracotta for cross-cutting). */

.layer-page main { display: block; }

/* ---- Breadcrumb ---- */
.layer-breadcrumb {
  background: rgba(255,255,255,0.55);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.layer-breadcrumb .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.layer-breadcrumb .lbc-back {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: color 160ms ease, transform 160ms ease;
}
.layer-breadcrumb .lbc-back:hover { color: var(--blue-ink); transform: translateX(-2px); }
.layer-breadcrumb .lbc-sep { color: var(--ink-faint); }
.layer-breadcrumb .lbc-here { color: var(--ink); font-weight: 600; letter-spacing: 0.06em; }
.layer-page--discipline .layer-breadcrumb .lbc-back { color: var(--terracotta); }
.layer-page--discipline .layer-breadcrumb .lbc-back:hover { color: #A0573D; }

/* ---- Hero strip (minimal positioning marker above section content) ---- */
.layer-hero-strip {
  background: var(--paper);
  padding: 22px 0;
}
.layer-hero-strip .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.layer-hero-strip .lhs-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.layer-hero-strip .lhs-kind {
  color: var(--blue);
  font-weight: 700;
  background: var(--blue-soft);
  padding: 4px 10px;
  border-radius: 4px;
}
.layer-page--discipline .layer-hero-strip .lhs-kind {
  color: var(--terracotta);
  background: rgba(200,107,75,0.10);
}
.layer-hero-strip .lhs-sep { color: var(--rule); }
.layer-hero-strip .lhs-pos,
.layer-hero-strip .lhs-read { color: var(--ink-dim); }

/* ---- Layer CTA strip (replaces the email gate) ---- */
.layer-cta {
  padding: 60px 0 40px;
  background: linear-gradient(180deg, var(--paper) 0%, #F1ECDF 100%);
}
.layer-cta .lct-card {
  background: #fff;
  border: 1.5px solid var(--blue);
  border-radius: 18px;
  padding: 36px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.85fr);
  gap: 32px;
  align-items: center;
  box-shadow:
    0 1px 0 rgba(20,22,24,0.04),
    0 24px 48px -28px rgba(43,92,255,0.20);
}
.layer-page--discipline .layer-cta .lct-card {
  border-color: var(--terracotta);
  box-shadow:
    0 1px 0 rgba(20,22,24,0.04),
    0 24px 48px -28px rgba(200,107,75,0.20);
}
.layer-cta .lct-kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--blue-ink);
  margin-bottom: 10px;
}
.layer-page--discipline .layer-cta .lct-kicker { color: var(--terracotta); }
.layer-cta .lct-title {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.12;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.layer-cta .lct-lede {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-dim);
}
.layer-cta .lct-lede strong { color: var(--ink); font-weight: 600; }
.layer-cta .lct-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.layer-cta .lct-actions .btn { justify-content: center; }
.layer-cta .lct-actions .btn-ghost {
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
}
.layer-cta .lct-actions .btn-ghost:hover {
  background: var(--blue-soft);
}
.layer-page--discipline .layer-cta .lct-actions .btn-primary { background: var(--terracotta); }
.layer-page--discipline .layer-cta .lct-actions .btn-primary:hover { background: #A0573D; }
.layer-page--discipline .layer-cta .lct-actions .btn-ghost {
  color: var(--terracotta);
  border-color: var(--terracotta);
}
.layer-page--discipline .layer-cta .lct-actions .btn-ghost:hover {
  background: rgba(200,107,75,0.08);
}

/* ---- Pager (prev / hub / next) ---- */
.layer-pager {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 28px 0 32px;
}
.layer-pager-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.layer-pager .lp-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 22px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  min-height: 76px;
  justify-content: center;
}
.layer-pager .lp-link:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(43,92,255,0.25);
}
.layer-page--discipline .layer-pager .lp-link:hover {
  border-color: var(--terracotta);
  box-shadow: 0 8px 20px -10px rgba(200,107,75,0.25);
}
.layer-pager .lp-prev { text-align: left; }
.layer-pager .lp-next { text-align: right; align-items: flex-end; }
.layer-pager .lp-k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.10em;
  color: var(--ink-faint);
  text-transform: uppercase;
  font-weight: 600;
}
.layer-pager .lp-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.layer-pager .lp-hub {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 22px;
  background: var(--blue);
  border: 1.5px solid var(--blue);
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  text-align: center;
  align-self: center;
  transition: background 160ms ease, transform 160ms ease;
  min-width: 200px;
}
.layer-pager .lp-hub:hover { background: var(--blue-ink); transform: translateY(-2px); }
.layer-page--discipline .layer-pager .lp-hub {
  background: var(--terracotta);
  border-color: var(--terracotta);
}
.layer-page--discipline .layer-pager .lp-hub:hover { background: #A0573D; }
.layer-pager .lp-hub-k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  font-weight: 700;
}
.layer-pager .lp-hub-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

@media (max-width: 760px) {
  .layer-cta { padding: 40px 0 28px; }
  .layer-cta .lct-card {
    grid-template-columns: 1fr;
    padding: 28px 24px;
    gap: 22px;
  }
  .layer-cta .lct-title { font-size: 24px; }
  .layer-pager-inner {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .layer-pager .lp-next { text-align: left; align-items: flex-start; }
  .layer-pager .lp-hub { min-width: 0; }
  .layer-hero-strip .wrap { padding-left: 16px; padding-right: 16px; }
  .layer-breadcrumb .wrap { padding-left: 16px; padding-right: 16px; }
}

/* =============================================================================
   HUB · LAYER CARDS — drill-in grid that replaces the inline L1-L3 sections
   ============================================================================= */
#layers { padding: 56px 0 72px; }

.layers-band { margin: 32px 0 24px; }
.layers-band + .layers-band { margin-top: 56px; }
.layers-band--discipline { /* keeps a subtle visual break */ }

.layers-band-k {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--rule);
}
.layers-band-k .lb-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #fff;
}
.layers-band-k .lb-tag--build      { background: var(--blue); }
.layers-band-k .lb-tag--discipline { background: var(--terracotta); }
.layers-band-k .lb-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* Grids — responsive */
.layer-cards {
  display: grid;
  gap: 18px;
}
.layer-cards--build {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.layer-cards--discipline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Card */
.layer-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 20px;
  background: #fff;
  border: 1.25px solid var(--rule);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  overflow: hidden;
}
.layer-card::before {
  /* color accent on the left edge */
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--blue);
  opacity: 0.85;
}
.layer-card--discipline::before { background: var(--terracotta); }
.layer-card--lake::before {
  background: linear-gradient(to bottom, var(--blue) 0%, var(--blue-ink) 100%);
  width: 5px;
}
.layer-card--payoff {
  background: linear-gradient(180deg, #FAFCFF 0%, #fff 60%);
}
.layer-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
  box-shadow:
    0 12px 28px -16px rgba(43,92,255,0.32),
    0 1px 0 rgba(20,22,24,0.04);
}
.layer-card--discipline:hover {
  border-color: var(--terracotta);
  box-shadow:
    0 12px 28px -16px rgba(200,107,75,0.32),
    0 1px 0 rgba(20,22,24,0.04);
}

.layer-card .lc-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.layer-card .lc-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue-ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
}
.layer-card--discipline .lc-num {
  background: rgba(200,107,75,0.12);
  color: var(--terracotta);
}
.layer-card .lc-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.layer-card .lc-tagline {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--blue);
  line-height: 1.35;
}
.layer-card .lc-tagline em {
  font-style: normal;
}
.layer-card--discipline .lc-tagline { color: var(--terracotta); }

.layer-card .lc-stance {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-dim);
  flex-grow: 1;
}

.layer-card .lc-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.layer-card .lc-bullets li {
  position: relative;
  padding-left: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-dim);
}
.layer-card .lc-bullets li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--blue);
  font-weight: 700;
}
.layer-card--discipline .lc-bullets li::before { color: var(--terracotta); }

.layer-card .lc-cta {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.layer-card .lc-cta .arr {
  transition: transform 200ms ease;
}
.layer-card:hover .lc-cta .arr {
  transform: translateX(3px);
}
.layer-card--discipline .lc-cta { color: var(--terracotta); }

/* Wider screens — the discipline cards span proportionally to suggest they
   wrap the build layers. */
@media (max-width: 1100px) {
  .layer-cards--build {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .layer-cards--build {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layer-cards--discipline {
    grid-template-columns: 1fr;
  }
  #layers { padding: 36px 0 48px; }
}
@media (max-width: 480px) {
  .layer-cards--build {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   CODE-BASED LEAD MAGNET — variant of .fb-lead-magnet for starter repos
   (e.g., D1 Trust starter on /for-builders/trust). Replaces the spreadsheet
   animation with a terminal-window mockup that types `make deploy` and
   shows the success output streaming in.
   ============================================================================= */

/* The action row: primary GitHub link + "or" + inline email form */
.fb-lead-magnet .lm-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  flex-wrap: wrap;
}
.fb-lead-magnet .lm-actions-or {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fb-lead-magnet .lm-form--inline {
  flex: 1 1 280px;
  min-width: 0;
  margin: 0;
}

/* ----- terminal frame ----- */
.fb-lead-magnet .lm-term {
  align-self: stretch;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0E1117;
  border: 1px solid #1F2630;
  border-radius: 12px;
  overflow: hidden;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  box-shadow:
    0 4px 12px -6px rgba(28, 59, 191, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

/* Top bar with traffic dots + title */
.fb-lead-magnet .lm-term-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 9px 14px;
  background: #1A1F2A;
  border-bottom: 1px solid #232A36;
}
.fb-lead-magnet .lm-term-title {
  text-align: center;
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.02em;
  font-weight: 500;
}
.fb-lead-magnet .lm-term-spacer { width: 56px; }    /* matches traffic-light width */

/* Body area */
.fb-lead-magnet .lm-term-body {
  padding: 14px 16px 16px;
  background: #0E1117;
  font-size: 12px;
  line-height: 1.55;
  color: #C7CCD6;
  /* Tight spacing to fit ~14 lines without scroll on desktop */
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 380px;
}

/* Each line — animated in via .is-playing on the parent */
.fb-lead-magnet .lm-term-line {
  opacity: 0;
  transform: translateY(2px);
  white-space: pre-wrap;
  word-break: break-all;
}
.fb-lead-magnet .lm-term .lm-term-line.lm-term-line--prompt { padding-top: 6px; }
.fb-lead-magnet .lm-term-line:first-child { padding-top: 0; }
.fb-lead-magnet .lm-term-line .lm-term-pr {
  color: #6BB07F;
  font-weight: 700;
  margin-right: 8px;
}
.fb-lead-magnet .lm-term-line .lm-term-cmd {
  color: #FFFFFF;
  font-weight: 500;
}
.fb-lead-magnet .lm-term-line--out {
  color: rgba(199,204,214,0.78);
  padding-left: 0;
}
.fb-lead-magnet .lm-term-line--ok {
  color: #7FD89F;
  font-weight: 500;
}
.fb-lead-magnet .lm-term-line--alert {
  color: #FFFFFF;
  font-weight: 600;
  background: linear-gradient(90deg, rgba(43,92,255,0.18) 0%, rgba(43,92,255,0.04) 100%);
  padding: 4px 8px;
  border-left: 2px solid var(--blue);
  margin: 4px -8px;
  border-radius: 0 4px 4px 0;
}
.fb-lead-magnet .lm-term-line--alert::before { content: ''; }
.fb-lead-magnet .lm-term-link {
  color: #7AA0FF;
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* Interactive prompt (slack-setup question) */
.fb-lead-magnet .lm-term-line .lm-term-q {
  color: #E5C453;
  font-weight: 700;
}
.fb-lead-magnet .lm-term-line .lm-term-mask {
  color: rgba(199,204,214,0.55);
  letter-spacing: 0.05em;
}

/* Final blinking cursor at the end (line stays visible, cursor blinks forever) */
.fb-lead-magnet .lm-term-cursor {
  display: inline-block;
  margin-left: 6px;
  color: #7FD89F;
  animation: lmTermCursorBlink 1s steps(2, start) infinite;
}
@keyframes lmTermCursorBlink {
  to { visibility: hidden; }
}

/* When the terminal enters viewport, lines fade in with their per-line delay */
.fb-lead-magnet .lm-term.is-playing .lm-term-line {
  animation: lmTermLineAppear 220ms ease-out forwards;
  animation-delay: var(--d, 0s);
}
@keyframes lmTermLineAppear {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}

/* Bottom status bar */
.fb-lead-magnet .lm-term-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 14px;
  background: var(--blue-soft);
  border-top: 1px solid rgba(43, 92, 255, 0.18);
}
.fb-lead-magnet .lm-term-status-k {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--blue-ink);
  letter-spacing: 0.14em;
  font-weight: 700;
  text-transform: uppercase;
}
.fb-lead-magnet .lm-term-status-meta {
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  text-align: right;
}

/* Reduced motion support — show all lines immediately + stop the cursor blink */
@media (prefers-reduced-motion: reduce) {
  .fb-lead-magnet .lm-term-line {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .fb-lead-magnet .lm-term-cursor { animation: none; }
}

/* Mobile — terminal becomes more compact but stays readable */
@media (max-width: 720px) {
  .fb-lead-magnet .lm-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .fb-lead-magnet .lm-actions-or { text-align: center; }
  .fb-lead-magnet .lm-term-body {
    font-size: 11px;
    padding: 12px 12px 14px;
    min-height: 320px;
  }
  .fb-lead-magnet .lm-term-bar { padding: 8px 12px; }
  .fb-lead-magnet .lm-term-title { font-size: 10.5px; }
}

/* =============================================================================
   DUAL-CTA pattern for code-based lead magnets
   Used on /for-builders/trust (Lakewatch) — engineers click GitHub, operators
   give email for the curated kit. Same brand chrome (blue bar at top) as the
   regular .fb-lead-magnet, with two side-by-side cards in the body.
   ============================================================================= */

/* Single-column lm-grid variant — used when there's no spreadsheet/terminal
   animation on the right and we want full-width copy area instead. */
.fb-lead-magnet .lm-grid--single {
  grid-template-columns: 1fr;
  gap: 0;
}

/* Two cards side-by-side, engineer left + curated right */
.fb-lead-magnet .lm-dual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 16px;
  margin: 6px 0 14px;
}
.fb-lead-magnet .lm-dual-card {
  background: #fff;
  border: 1.25px solid var(--rule);
  border-radius: 14px;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.fb-lead-magnet .lm-dual-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
}
.fb-lead-magnet .lm-dual-card--engineer::before { background: var(--blue); }
.fb-lead-magnet .lm-dual-card--curated::before  { background: var(--terracotta); }
.fb-lead-magnet .lm-dual-card:hover {
  box-shadow: 0 12px 24px -16px rgba(20, 22, 24, 0.16);
}
.fb-lead-magnet .lm-dual-card--engineer:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 24px -16px rgba(43, 92, 255, 0.28);
}
.fb-lead-magnet .lm-dual-card--curated:hover {
  border-color: var(--terracotta);
  box-shadow: 0 12px 24px -16px rgba(200, 107, 75, 0.28);
}

/* Card head — eyebrow on the left, "no email" / "email" tag on the right */
.fb-lead-magnet .lm-dual-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.fb-lead-magnet .lm-dual-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.fb-lead-magnet .lm-dual-card--engineer .lm-dual-eyebrow { color: var(--blue); }
.fb-lead-magnet .lm-dual-card--curated  .lm-dual-eyebrow { color: var(--terracotta); }
.fb-lead-magnet .lm-dual-cost {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.fb-lead-magnet .lm-dual-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.005em;
}
.fb-lead-magnet .lm-dual-title em { font-style: normal; font-weight: 700; }
.fb-lead-magnet .lm-dual-card--engineer .lm-dual-title em { color: var(--blue); }
.fb-lead-magnet .lm-dual-card--curated  .lm-dual-title em { color: var(--terracotta); }
.fb-lead-magnet .lm-dual-lede {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* Engineer card — repo metadata rows + button */
.fb-lead-magnet .lm-dual-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}
.fb-lead-magnet .lm-dual-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  line-height: 1.4;
  word-break: break-word;
}
.fb-lead-magnet .lm-dual-meta-icon {
  width: 12px;
  height: 12px;
  color: var(--ink-faint);
  flex-shrink: 0;
}
.fb-lead-magnet .lm-dual-meta-text { min-width: 0; flex: 1; }
.fb-lead-magnet .lm-dual-card--engineer .lm-dual-btn {
  background: var(--blue);
  color: #FFFFFF;
  border: 1.5px solid var(--blue);
  align-self: flex-start;
  margin-top: 4px;
}
.fb-lead-magnet .lm-dual-card--engineer .lm-dual-btn:hover {
  background: var(--blue-ink);
  border-color: var(--blue-ink);
}

/* Curated card — bullets + form */
/* Position the checkmark via padding + absolute so the bullet text stays as
   a single text flow — using grid with inline <strong> + sibling text nodes
   collapses each bullet to one word per line (each becomes a grid item). */
.fb-lead-magnet .lm-dual-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-lead-magnet .lm-dual-bullets li {
  position: relative;
  padding-left: 22px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}
.fb-lead-magnet .lm-dual-bullets li::before {
  content: '✓';
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--terracotta);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.45;
}
.fb-lead-magnet .lm-dual-bullets li strong { font-weight: 600; }
.fb-lead-magnet .lm-dual-form {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
  flex-wrap: wrap;
}
.fb-lead-magnet .lm-dual-form input[type="email"] {
  flex: 1 1 200px;
  min-width: 0;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1.5px solid rgba(20, 22, 24, 0.16);
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.fb-lead-magnet .lm-dual-form input[type="email"]:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(200, 107, 75, 0.16);
}
.fb-lead-magnet .lm-dual-card--curated .lm-dual-btn {
  background: var(--terracotta);
  color: #FFFFFF;
  border: 1.5px solid var(--terracotta);
  padding: 11px 18px;
  white-space: nowrap;
}
.fb-lead-magnet .lm-dual-card--curated .lm-dual-btn:hover {
  background: #A0573D;
  border-color: #A0573D;
}
.fb-lead-magnet .lm-dual-fine {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
  line-height: 1.4;
}

@media (max-width: 820px) {
  .fb-lead-magnet .lm-dual { grid-template-columns: 1fr; }
}

/* =============================================================================
   DIAGRAM LINKS — the 7 framework boxes in the SHAPE diagram are wrapped in
   SVG <a> tags pointing at their dedicated layer pages. These styles signal
   clickability without shifting layout (no transforms on SVG inner groups).
   ============================================================================= */
.stack-desktop-svg a.dlink {
  cursor: pointer;
  outline: none;
}
.stack-desktop-svg a.dlink rect {
  transition: stroke-width 180ms ease, filter 180ms ease;
}
.stack-desktop-svg a.dlink:hover rect,
.stack-desktop-svg a.dlink:focus-visible rect {
  stroke-width: 2.5;
  filter: drop-shadow(0 4px 12px rgba(43, 92, 255, 0.22));
}
/* Discipline ribbons (D1/D2) — terracotta-tinted hover shadow */
.stack-desktop-svg a.dlink[href$="/trust"]:hover rect,
.stack-desktop-svg a.dlink[href$="/trust"]:focus-visible rect,
.stack-desktop-svg a.dlink[href$="/identity-compliance"]:hover rect,
.stack-desktop-svg a.dlink[href$="/identity-compliance"]:focus-visible rect {
  filter: drop-shadow(0 4px 12px rgba(200, 107, 75, 0.28));
}
/* Focus-visible ring (keyboard nav) — subtle outline using a stroke change */
.stack-desktop-svg a.dlink:focus-visible {
  /* Browser default focus ring is invisible on SVG anchors; the rect stroke
     change above is the visible affordance. Keep this hook for future tuning. */
}

/* ============================================================ */
/* Bento — group small opinion/aside cards into a 2-up grid     */
/* Used to break up walls of stacked rule-separated cards.       */
/* Apply by wrapping 2 (or rarely 3) cards in <div class="fb-bento"> */
/* ============================================================ */
.fb-bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 28px 0;
  padding-top: 28px;
  border-top: 1px solid var(--rule-2);
}
.fb-bento--triple { grid-template-columns: 1fr 1fr 1fr; }

/* Cards inside a bento lose their own border-top/padding and gain card chrome */
.fb-bento > .opinion,
.fb-bento > .aside {
  margin: 0;
  padding: 22px 24px 24px;
  border: 1px solid var(--rule-2);
  border-left: 3px solid var(--rule-2);
  border-radius: 12px;
  background: var(--paper);
}

/* Colored left-edge accent matching the chip color */
.fb-bento > .opinion.rule       { border-left-color: var(--terracotta); }
.fb-bento > .opinion.heuristic  { border-left-color: var(--sage); }
.fb-bento > .opinion.gotcha     { border-left-color: var(--mustard); }
.fb-bento > .aside              { border-left-color: var(--blue); }
.fb-bento > .aside.warm         { border-left-color: var(--terracotta); }
/* Plain .opinion with .label.note → blue (matches the label) */
.fb-bento > .opinion:has(> .label.note) { border-left-color: var(--blue); }

/* Slight type tightening so half-width cards don't feel cramped */
.fb-bento > .opinion h4 { font-size: 19px; line-height: 1.3; }
.fb-bento > .opinion p,
.fb-bento > .aside .aside-body { font-size: 14.5px; line-height: 1.55; }
.fb-bento > .opinion .label,
.fb-bento > .aside .lbl { margin-bottom: 10px; }

/* Collapse to single column on narrow screens */
@media (max-width: 720px) {
  .fb-bento,
  .fb-bento--triple { grid-template-columns: 1fr; gap: 16px; }
}
