/* ==========================================================================
   SignLater Design 2.0 — Article instrument page (production)
   Article as instrument: sticky TOC + progress, live mini-calculator,
   scroll-staged fact reveals, Second Number pull-quotes, pattern explorer,
   fee waterfall, methodology cards, conclusion instrument.
   ========================================================================== */

/* ---------- Progress bar ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--amber); z-index: 200; }

/* ---------- Sticky TOC ---------- */
.tocbar { position: sticky; top: 57px; z-index: 90; background: rgba(253,253,251,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline); }
.tocbar-in { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s-6);
  display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; }
.tocbar-in::-webkit-scrollbar { display: none; }
.tocbar a { flex: none; padding: 13px 14px; font-size: var(--fs-small); font-weight: var(--fw-bold);
  color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent;
  white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.tocbar a.active { color: var(--ink); border-bottom-color: var(--amber); }
.tocbar a.run { color: var(--ink); }

/* ---------- Article hero ---------- */
.ahero { background: var(--paper-warm); border-bottom: 1px solid var(--hairline); }
.ahero-in { max-width: 800px; margin: 0 auto; padding: var(--s-16) var(--s-6) var(--s-12); }
.ahero .kick { font-size: 12px; font-weight: var(--fw-bold); letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-4); }
.ahero h1 { font-size: clamp(34px, 5vw, 56px); letter-spacing: -.03em; line-height: 1.08;
  margin: 0 0 var(--s-5); }
.ahero h1 .a { color: var(--amber); } /* one headline word invoking the reveal concept */
.ahero .stand { font-size: var(--fs-lead); color: var(--muted); line-height: 1.6; max-width: 640px; }
.byline { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-7); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: var(--fw-bold); }
.meta-row { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); margin-top: var(--s-5);
  font-size: var(--fs-small); color: var(--faint); }

/* ---------- Article body ---------- */
.article-body { max-width: 800px; margin: 0 auto; padding: var(--s-12) var(--s-6); }
.article-body .sec { margin-bottom: var(--s-16); scroll-margin-top: 130px; }
.article-body p.body { font-size: 17.5px; line-height: 1.75; color: var(--ink); margin: 0 0 var(--s-5); }
.article-body p.body .tlabel { margin-left: var(--s-2); vertical-align: 1px; }
.eyebrow { font-size: 12px; font-weight: var(--fw-bold); letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s-4); }
.sec h2 { font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.02em; line-height: 1.2;
  margin: 0 0 var(--s-5); }
.sec h2 .a { color: var(--amber); }

/* ---------- Fact staging (quoted → true → gap) ---------- */
.factstage { border: 1px solid var(--hairline); border-radius: var(--r-8);
  background: var(--paper); padding: var(--s-8); margin: var(--s-8) 0; }
.fact-row { display: flex; align-items: center; gap: var(--s-6); flex-wrap: wrap; }
.fact { flex: 1 1 200px; opacity: 0; transform: translateY(14px);
  transition: opacity .7s var(--ease), transform .7s var(--ease); }
.fact.in { opacity: 1; transform: none; }
.fact .fl { font-size: 11px; font-weight: var(--fw-bold); letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-2); }
.fact .fv { font-size: clamp(38px, 5vw, 56px); font-weight: var(--fw-black);
  letter-spacing: -.03em; line-height: 1; }
.fact.true .fv { color: var(--amber); }
.fact .fd { font-size: var(--fs-small); color: var(--muted); margin-top: var(--s-2); }
.fact-arrow { font-size: 28px; color: var(--faint); opacity: 0; transition: opacity .7s var(--ease) .3s; }
.fact-arrow.in { opacity: 1; }
.gapline { margin-top: var(--s-6); padding: var(--s-5) var(--s-6); background: var(--amber-wash);
  border-radius: var(--r-6); font-size: var(--fs-body); opacity: 0; transform: translateY(10px);
  transition: opacity .7s var(--ease), transform .7s var(--ease); }
.gapline.in { opacity: 1; transform: none; }
.gapline b { color: var(--amber); }

/* ---------- Mini instrument (embedded calculator) ---------- */
.mini-inst { border: 1px solid var(--hairline); border-radius: var(--r-8);
  background: var(--paper); overflow: hidden; margin: var(--s-8) 0; }
.mini-inst-head { display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-4) var(--s-6); border-bottom: 1px solid var(--hairline);
  background: var(--field1); }
.mini-inst-head .mt { font-size: 12px; font-weight: var(--fw-bold); letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); }
.mi-grid { display: grid; grid-template-columns: 1fr 1fr; }
.mi-controls { padding: var(--s-6); border-right: 1px solid var(--hairline); }
.mi-result { padding: var(--s-6); background: var(--paper-warm); }
.mi-result .rl { font-size: 11px; font-weight: var(--fw-bold); letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); }
.mi-result .rv-big { font-size: clamp(44px, 6vw, 64px); font-weight: var(--fw-black);
  color: var(--amber); letter-spacing: -.03em; line-height: 1; margin: var(--s-2) 0; }
.mi-result .delta-pill { display: inline-block; background: var(--amber-wash);
  border: 1px solid var(--amber-pale); color: var(--amber); font-weight: var(--fw-bold);
  font-size: var(--fs-small); border-radius: var(--r-6); padding: 6px 12px; }
.mi-break { margin-top: var(--s-5); font-size: var(--fs-small); color: var(--muted); }
.mi-break .row { display: flex; justify-content: space-between; padding: 5px 0;
  border-bottom: 1px dashed var(--hairline); }
.mi-break .row:last-child { border-bottom: none; }
.mi-note { font-size: var(--fs-caption); color: var(--faint); margin-top: var(--s-4); }

/* ---------- Pull quote (Second Number) ---------- */
.pullquote { border-left: 3px solid var(--amber); padding: var(--s-2) 0 var(--s-2) var(--s-7);
  margin: var(--s-10) 0; }
.pullquote .pq-num { font-size: clamp(52px, 8vw, 84px); font-weight: var(--fw-black);
  color: var(--amber); letter-spacing: -.03em; line-height: 1; }
.pullquote .pq-cap { font-size: var(--fs-body); color: var(--muted); margin-top: var(--s-3);
  max-width: 560px; line-height: 1.6; }

/* ---------- Pattern comparison ---------- */
.pat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4);
  margin: var(--s-8) 0; }
.pat-card { border: 1px solid var(--hairline); border-radius: var(--r-8); padding: var(--s-6);
  background: var(--paper); }
.pat-card .pn { font-weight: var(--fw-bold); margin-bottom: var(--s-1); }
.pat-card .pd { font-size: var(--fs-small); color: var(--muted); margin-bottom: var(--s-4); }
.pat-card .pr { font-size: 26px; font-weight: var(--fw-black); letter-spacing: -.02em; }
.pat-card.hl .pr { color: var(--amber); }
.pat-card.hl { border-color: var(--amber-pale); background: var(--amber-wash); }

/* ---------- Explorer ---------- */
.explorer { border: 1px solid var(--hairline); border-radius: var(--r-8);
  background: var(--paper); padding: var(--s-7); margin: var(--s-8) 0; }
.explorer .ex-top { display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-4); }
.explorer .ex-read { font-size: 30px; font-weight: var(--fw-black); color: var(--amber);
  letter-spacing: -.02em; }
.explorer svg { width: 100%; height: auto; display: block; }

/* ---------- Waterfall wrap ---------- */
.wf-wrap { border: 1px solid var(--hairline); border-radius: var(--r-8);
  background: var(--paper); padding: var(--s-7); margin: var(--s-8) 0; }
.wf-wrap svg { width: 100%; height: auto; display: block; }

/* ---------- Article body tables ---------- */
.article-content table { width: 100%; border-collapse: collapse; margin: var(--s-6) 0;
  font-size: var(--fs-small); line-height: 1.55; }
.article-content th { text-align: left; font-weight: var(--fw-bold); color: var(--ink);
  background: var(--field1); border: 1px solid var(--hairline); padding: 12px 14px;
  white-space: nowrap; }
.article-content td { border: 1px solid var(--hairline); padding: 12px 14px;
  vertical-align: top; }
.article-content tr:nth-child(even) td { background: color-mix(in srgb, var(--field1) 40%, transparent); }
@media (max-width: 640px) {
  .article-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .article-content th, .article-content td { min-width: 120px; }
}

/* ---------- Methodology cards ---------- */
.meth-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4);
  margin: var(--s-8) 0; }
.meth-card { border: 1px solid var(--hairline); border-radius: var(--r-8);
  padding: var(--s-6); background: var(--paper); }
.meth-card .mf { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px;
  background: var(--field1); border-radius: var(--r-3); padding: var(--s-3) var(--s-4);
  margin: var(--s-3) 0; overflow-x: auto; white-space: nowrap; }
.meth-card .md { font-size: var(--fs-small); color: var(--muted); line-height: 1.6; }

/* ---------- Conclusion instrument ---------- */
.conclusion { background: var(--inkbg); color: #F5F2E9; border-radius: var(--r-8);
  padding: var(--s-10) var(--s-8); margin: var(--s-8) 0; text-align: center; }
.conclusion h2 { color: #F5F2E9; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.02em;
  margin: 0 0 var(--s-4); }
.conclusion h2 .a { color: var(--amber-on-dark); }
.conclusion p { color: #B9B9B0; max-width: 560px; margin: 0 auto var(--s-7); line-height: 1.65; }
.conclusion .btn-row { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.btn-amberdark { background: #F5F2E9; color: #161614; border-color: #F5F2E9; }
/* Amber law: CTAs are never amber. This class keeps its name for compat but renders ink-on-cream. */
.btn-ghostdark { background: transparent; color: #F5F2E9; border-color: #4A4A44; }

/* ---------- Related decisions ---------- */
.rel-list { border-top: 1px solid var(--hairline); margin-top: var(--s-6); }
.rel-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-5);
  padding: var(--s-5) var(--s-2); border-bottom: 1px solid var(--hairline);
  text-decoration: none; color: inherit; min-height: 44px; }
.rel-row .rn { font-weight: var(--fw-bold); display: block; margin-bottom: 2px; }
.rel-row .rr { font-size: var(--fs-small); color: var(--muted); display: block; }
.rel-row .ra { color: var(--amber); font-size: 20px; flex: none; }

/* ---------- Trust strip ---------- */
.trust-strip { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-8); }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .mi-grid { grid-template-columns: 1fr; }
  .mi-controls { border-right: none; border-bottom: 1px solid var(--hairline); }
  .pat-grid, .meth-grid { grid-template-columns: 1fr; }
  .tocbar { top: 53px; }
  .fact-row { flex-direction: column; align-items: stretch; }
  .fact-arrow { transform: rotate(90deg); align-self: center; }
  .article-body { padding: var(--s-8) var(--s-5); }
}
