/* ═══════════════════════════════════════════════
   MEMO SYSTEM — shared across all pages
   Site reads as a banker's working document:
   letterhead mark, running header, column rules,
   §XX.XX section refs, dot-leader pricing, signed
   footer.
═══════════════════════════════════════════════ */

/* — Running header: thin sticky band under topbar showing current section ref — */
.memo-runner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim, #9e8e58);
  background: rgba(10, 16, 32, 0.0);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
  transform: translateY(-100%);
}
.memo-runner.is-visible {
  transform: translateY(0);
  background: rgba(10, 16, 32, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border, #1e2a4a);
}
.memo-runner-ref { color: var(--gold, #c9a961); }
.memo-runner-meta {
  color: var(--cream-dim, #c8c4c0);
  opacity: 0.7;
}
@media (max-width: 720px) {
  .memo-runner { padding: 0.45rem 1.25rem; font-size: 0.55rem; letter-spacing: 0.18em; }
  .memo-runner-meta { display: none; }
}

/* — Column rules: faint hairlines flanking the main column, echoes a ledger page — */
.memo-rules {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 1080px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}
.memo-rules::before,
.memo-rules::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(201, 169, 97, 0.08) 12%,
    rgba(201, 169, 97, 0.08) 88%,
    transparent 100%
  );
}
.memo-rules::before { left: 0; }
.memo-rules::after  { right: 0; }
@media (max-width: 720px) { .memo-rules { display: none; } }

/* — Rail text: book-spine style label running vertically along the column rules — */
.memo-rules-rail-text {
  position: absolute;
  top: 50%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-dim, #9e8e58);
  opacity: 0.5;
  white-space: nowrap;
  writing-mode: vertical-rl;
  pointer-events: none;
}
.memo-rules-rail-text--left {
  left: -0.55rem;
  transform: translateY(-50%) rotate(180deg);
}
.memo-rules-rail-text--right {
  right: -0.55rem;
  transform: translateY(-50%);
}
@media (max-width: 1100px) {
  .memo-rules-rail-text { display: none; }
}

/* — Document marginalia: fixed metadata card pinned to the right margin.
   Acts like a binder side-tab — page reference, file date, classification.
   Persistent through scroll. Hides when the side margin gets too narrow. — */
.memo-margin-card {
  position: fixed;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
  width: 132px;
  padding: 0.95rem 0.9rem;
  border: 1px solid rgba(201, 169, 97, 0.22);
  border-radius: 2px;
  background: rgba(10, 16, 32, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-dim, #c8c4c0);
  line-height: 1.6;
  pointer-events: none;
  z-index: 50;
  opacity: 0.82;
}
.memo-margin-card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.memo-margin-card-key { color: var(--gold-dim, #9e8e58); }
.memo-margin-card-val { color: var(--cream, #faf8f4); }
.memo-margin-card-sep {
  height: 1px;
  background: rgba(201, 169, 97, 0.18);
  margin: 0.55rem 0;
}
@media (max-width: 1380px) {
  .memo-margin-card { display: none; }
}

/* — Page stamp: an inked-stamp mark in the opposite margin.
   Slightly rotated so it reads as pressed onto the page, not placed. — */
.memo-stamp {
  position: fixed;
  top: 50%;
  left: 1.5rem;
  transform: translateY(-50%) rotate(-2.5deg);
  width: 158px;
  padding: 0.7rem 0.95rem;
  border: 1.5px solid rgba(201, 169, 97, 0.5);
  border-radius: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold, #c9a961);
  line-height: 1.55;
  pointer-events: none;
  z-index: 50;
  opacity: 0.55;
}
.memo-stamp-head {
  color: var(--gold-bright, #e3c37a);
  font-weight: 500;
}
.memo-stamp-sep {
  display: block;
  border-top: 1px dashed rgba(201, 169, 97, 0.4);
  margin: 0.4rem 0;
}
.memo-stamp-foot {
  color: var(--cream-dim, #c8c4c0);
  font-size: 0.52rem;
  letter-spacing: 0.2em;
}
@media (max-width: 1280px) {
  .memo-stamp { display: none; }
}

/* — Letterhead mark: company name as a banker's letterhead band — */
.memo-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid rgba(201, 169, 97, 0.35);
  text-align: center;
}
.memo-mark-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold, #c9a961);
  text-indent: 0.32em;
}
.memo-mark-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-dim, #c8c4c0);
  opacity: 0.7;
  text-indent: 0.22em;
}
@media (max-width: 600px) {
  .memo-mark-name { font-size: 0.66rem; letter-spacing: 0.22em; }
  .memo-mark-meta { font-size: 0.52rem; letter-spacing: 0.16em; }
}

/* — Memo header: TO / FROM / RE / DATE table — */
.memo-header {
  margin: 0 0 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(201, 169, 97, 0.18);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  line-height: 1.5;
}
.memo-header-row {
  display: grid;
  grid-template-columns: 3.25rem 1fr 3.25rem 1fr;
  gap: 0.5rem 1rem;
  padding: 0.35rem 0;
}
.memo-header dt {
  color: var(--gold-dim, #9e8e58);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.62rem;
  padding-top: 0.15em;
}
.memo-header dd {
  margin: 0;
  color: var(--cream, #faf8f4);
  letter-spacing: 0.04em;
}
@media (max-width: 720px) {
  .memo-header-row { grid-template-columns: 3.25rem 1fr; gap: 0.4rem 0.85rem; }
}

/* — Section number: formal §00.00 ref — */
.section-num,
.hero-section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold, #c9a961);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
}
.section-num::before,
.hero-section-num::before {
  content: '';
  display: inline-block;
  width: 1.75rem;
  height: 1px;
  background: var(--gold, #c9a961);
  transform: translateY(-0.3em);
}
.section-num .num-ref,
.hero-section-num .num-ref {
  color: var(--gold, #c9a961);
  font-weight: 500;
}
.section-num .num-label,
.hero-section-num .num-label {
  color: var(--cream-dim, #c8c4c0);
  letter-spacing: 0.22em;
}
.hero-section-num { margin-bottom: 1.25rem; }

/* — Dot-leader pricing table (TOC style) — */
.memo-toc {
  margin: 0 0 var(--space-lg, 4rem);
  padding: 1.5rem 0;
  border-top: 1px solid rgba(201, 169, 97, 0.18);
  border-bottom: 1px solid rgba(201, 169, 97, 0.18);
}
.memo-toc-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.55rem 0;
  font-family: 'Archivo', sans-serif;
  color: var(--cream, #faf8f4);
  text-decoration: none;
  transition: color 0.2s;
}
.memo-toc-row:hover { color: var(--gold-bright, #e3c37a); }
.memo-toc-row + .memo-toc-row { border-top: 1px dashed rgba(201, 169, 97, 0.08); }
.memo-toc-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--gold-dim, #9e8e58);
  letter-spacing: 0.12em;
  min-width: 3.25rem;
  flex-shrink: 0;
}
.memo-toc-name {
  font-size: 1rem;
  font-weight: 500;
  flex-shrink: 0;
}
.memo-toc-name em {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--cream-dim, #c8c4c0);
  font-size: 0.95rem;
  margin-left: 0.4em;
}
.memo-toc-leader {
  flex: 1;
  border-bottom: 1px dotted rgba(201, 169, 97, 0.35);
  transform: translateY(-0.32em);
  min-width: 2rem;
}
.memo-toc-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gold, #c9a961);
  flex-shrink: 0;
  letter-spacing: 0.04em;
  text-align: right;
}
.memo-toc-price .sub {
  display: block;
  font-size: 0.6rem;
  color: var(--cream-dim, #c8c4c0);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 0.15rem;
  opacity: 0.7;
  text-align: right;
}
@media (max-width: 600px) {
  .memo-toc-row { flex-wrap: nowrap; gap: 0.5rem; align-items: baseline; }
  .memo-toc-num { min-width: 2.6rem; }
  .memo-toc-name {
    font-size: 0.95rem;
    flex-shrink: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .memo-toc-leader {
    flex: 1;
    min-width: 1.25rem;
    border: 0;
    transform: none;
    position: relative;
    align-self: center;
    height: 0.85em;
  }
  .memo-toc-leader::before {
    content: '·';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -55%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    line-height: 1;
    color: rgba(201, 169, 97, 0.55);
  }
  .memo-toc-price { margin-left: 0; }
}

/* — Signed footer block: memo-style sign-off above the existing footer-bottom — */
.memo-signoff {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border, #1e2a4a);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-dim, #c8c4c0);
}
.memo-signoff-line { display: flex; gap: 0.85rem; align-items: baseline; }
.memo-signoff-key {
  color: var(--gold-dim, #9e8e58);
  min-width: 5.5rem;
  opacity: 0.85;
}
.memo-signoff-val { color: var(--cream, #faf8f4); }
.memo-signoff-mark {
  margin-top: 0.5rem;
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--gold, #c9a961);
}
@media (max-width: 600px) {
  .memo-signoff-line { flex-direction: column; gap: 0.1rem; }
  .memo-signoff-key { min-width: 0; font-size: 0.6rem; }
}
