/* ============================================================
   FnExec — fnexec.com
   "The Countersign" — the site is the instrument.
   Paper #f8f6f1 · Ink #0a0e1a · Signature blue #2c46c4 · Rubric red #b0371c
   Newsreader (serif, variable opsz) · IBM Plex Mono · Inter (mark only)
   Accent governance:
     signature blue — links, the countersign line, focus rings. Nothing else.
     rubric red     — failure-record markers and §404. Nothing else.
   ============================================================ */

/* ---------- fonts (all self-hosted; no request leaves this domain) ---------- */
@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/newsreader-var.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/newsreader-italic-var.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('assets/fonts/plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --paper:    #f8f6f1;
  --stock:    #efece3;
  --ink:      #0a0e1a;
  --faded:    #5a5f6b;
  --hairline: #d8d3c8;
  --blue:     #2c46c4;
  --rubric:   #b0371c;
  --seal-hi:  #1f2533;
  --seal-lo:  #161a26;
  --footer-ink: #9ba1b3;   /* faded ink on the dark colophon — AA on #0a0e1a */

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --mono:  'IBM Plex Mono', 'Consolas', 'Courier New', monospace;
  --mark:  'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;

  --rail-w: 176px;
  --measure: 640px;
  --gap: 48px;
  --container: 1040px;
}

/* ---------- base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--paper); }

body {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--paper); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* the ledger grid: rail + measure, centered inside the container */
.ledger {
  display: grid;
  grid-template-columns: var(--rail-w) var(--measure);
  gap: 0 var(--gap);
  justify-content: center;
}
.ledger > .full { grid-column: 1 / -1; }

/* ---------- type scale ---------- */
h1 {
  font-size: clamp(40px, 8vw, 84px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
h2 {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.005em;
}
h1, h2 { text-wrap: balance; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.lead { font-weight: 500; }

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  font-weight: 400;
}
.mono-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---------- links: ink pooling ---------- */
a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-thickness 150ms ease-out;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- masthead ---------- */
.masthead {
  padding: 28px 0 24px;
}
.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .keycap { display: block; transition: transform 90ms ease-out; }
.brand:active .keycap { transform: translateY(1px); }
.brand .exec {
  font-family: var(--mark);
  font-weight: 500;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.doc-control {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--faded);
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.doc-control nav { display: flex; gap: 20px; }
.doc-control nav a {
  color: var(--ink);
  font-weight: 500;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease-out;
  padding: 6px 2px; /* 24px minimum touch target */
}
.doc-control nav a:hover { border-bottom-color: var(--ink); }

/* ---------- sections & rules ---------- */
.rule {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 0;
}
.numbered { padding: 64px 0 0; }
.numbered + .numbered { margin-top: 96px; }

/* ---------- clause rows (rail + body) ---------- */
.clause { display: contents; }
.rail {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--faded);
  text-align: right;
  padding-top: 7px; /* optically aligns mono cap-height to serif baseline */
  line-height: 1.5;
}
.rail .rubric-mark { color: var(--rubric); font-weight: 500; }
.body-cell { max-width: var(--measure); }
.clause + .clause .rail,
.clause + .clause .body-cell { margin-top: 32px; }

/* rail posting motion */
.rail {
  opacity: 1;
  transform: none;
}
.js .rail.unposted {
  opacity: 0;
  transform: translateY(4px);
}
.js .rail.posted {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}

/* ---------- title block ---------- */
.title-block { padding: 72px 0 0; }
.title-block .tagline {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 3vw, 30px);
  margin-top: 18px;
  color: var(--ink);
}
.title-block .dek {
  margin-top: 36px;
  font-size: 21px;
  line-height: 1.55;
  max-width: 34em;
}

/* ---------- exhibit block ---------- */
.exhibit {
  background: var(--stock);
  padding: 40px 40px 32px;
  margin-top: 40px;
}
.exhibit-dek {
  font-style: italic;
  font-size: 19px;
  margin-bottom: 32px;
}
.exhibit-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
}
.exhibit-col + .exhibit-col {
  border-left: 1px solid var(--hairline);
  padding-left: 48px;
}
.exhibit-col h3 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--faded);
  margin-bottom: 20px;
}
.exhibit-col h3 .rubric-mark { color: var(--rubric); }
.exhibit-item + .exhibit-item { margin-top: 22px; }
.exhibit-item .quote {
  font-size: 16.5px;
  line-height: 1.5;
}
.exhibit-item .source {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faded);
  margin-top: 6px;
}
.exhibit-item .source .rubric-mark { color: var(--rubric); font-weight: 500; }
.exhibit-foot {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}
.exhibit-foot a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---------- clauses of the offer ---------- */
.offer-clause { font-size: 21px; line-height: 1.55; }
.offer-clause.lead { font-weight: 500; }

/* ---------- terms ledger ---------- */
.terms {
  margin-top: 48px;
  display: grid;
  grid-template-columns: var(--rail-w) var(--measure);
  gap: 0 var(--gap);
  justify-content: center;
}
.terms .term { display: contents; }
.terms dt {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
  padding-top: 5px;
}
.terms dd { max-width: var(--measure); font-size: 19px; }
.terms .term + .term dt,
.terms .term + .term dd { margin-top: 24px; }

/* ---------- countersign ---------- */
.countersign {
  background: var(--stock);
  padding: 48px 40px;
  margin-top: 40px;
}
.countersign .instruction {
  font-size: 21px;
  margin-bottom: 44px;
  max-width: 30em;
}
.sig-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.sig { display: flex; flex-direction: column; }
.sig .sig-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--faded);
  margin-bottom: 26px;
  flex-grow: 1;
}
.sig .line {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
  min-height: 44px;
  display: flex;
  align-items: flex-end;
}
.sig .name {
  font-style: italic;
  font-size: 26px;
  line-height: 1;
}
.sig .date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--faded);
  margin-top: 8px;
}

/* the blank line — the site's one conversion */
.sig-blank {
  display: block;
  border-bottom: 2px dotted #857c69; /* ≥3:1 on stock — the one conversion must be perceivable */
  padding-bottom: 6px;
  min-height: 44px;
  text-decoration: none;
  position: relative;
  transition: border-color 200ms ease-out;
}
.sig-blank:hover, .sig-blank:focus-visible {
  border-bottom: 2px solid var(--blue);
  text-decoration: none;
}
.sig-blank .caret {
  position: absolute;
  left: 0;
  bottom: 8px;
  width: 2px;
  height: 24px;
  background: var(--blue);
  opacity: 0;
}
.sig-blank:hover .caret, .sig-blank:focus-visible .caret {
  opacity: 1;
  animation: caret-blink 1.1s step-end infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.copy-row {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.copy-row .addr { color: var(--ink); user-select: all; }
.copy-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--blue);
  background: none;
  border: 1px solid var(--blue);
  border-radius: 2px;
  padding: 6px 12px; /* 24px minimum touch target */
  cursor: pointer;
}
.copy-btn:hover { background: var(--blue); color: var(--paper); }
.copy-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.countersign .closing {
  margin-top: 36px;
  font-style: italic;
  font-size: 17px;
}
.countersign .fine {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--faded);
}

/* ---------- memorandum (thesis page) ---------- */
.memo-title { font-size: clamp(34px, 5vw, 58px); }
.memo .body-cell p { font-size: 19px; }
.memo .body-cell p + p { margin-top: 24px; }
.sig-off { margin-top: 36px; }
.sig-off .name { font-style: italic; font-size: 26px; }
.sig-off .mono { color: var(--faded); }
.memo-head { margin-bottom: 8px; }
.memo-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faded);
  line-height: 2;
  margin-top: 28px;
}
.memo-meta strong { color: var(--ink); font-weight: 500; }
.memo p + p { margin-top: 26px; }
.name-exhibit {
  background: var(--stock);
  padding: 36px 40px;
  margin: 48px 0;
  display: flex;
  gap: 36px;
  align-items: center;
}
.name-exhibit .cap { flex-shrink: 0; }
.name-exhibit .cap .keycap { display: block; }
.name-exhibit p { font-size: 19px; }
.name-exhibit .aside {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--faded);
  text-transform: none;
}

/* ---------- colophon (the dark canon survives here) ---------- */
.colophon {
  background: var(--ink);
  color: var(--footer-ink);
  margin-top: 128px;
  padding: 72px 0 56px;
}
.colophon .tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: #f5f5f5;
  margin-top: 22px;
}
.colophon .accept {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 2;
  margin-top: 36px;
}
.colophon .legal {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  margin-top: 28px;
}
.colophon a { color: #f5f5f5; }
.colophon .exec {
  font-family: var(--mark);
  font-weight: 500;
  font-size: 21px;
  letter-spacing: -0.02em;
  color: #f5f5f5;
}
.colophon .brand { color: #f5f5f5; }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; padding-top: 96px; }
.notfound .code {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--rubric);
  font-weight: 500;
  text-transform: uppercase;
}
.notfound h1 { margin-top: 16px; }
.notfound p { margin-top: 24px; font-size: 21px; max-width: 30em; }

/* ---------- responsive: the rail folds to eyebrows ---------- */
@media (max-width: 719px) {
  .ledger { display: block; }
  .rail {
    text-align: left;
    padding-top: 0;
    margin-bottom: 8px;
  }
  .clause + .clause .rail { margin-top: 40px; }
  .clause + .clause .body-cell { margin-top: 0; }
  .exhibit { padding: 28px 24px; }
  .exhibit-cols { grid-template-columns: 1fr; gap: 32px 0; }
  .exhibit-col + .exhibit-col {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--hairline);
    padding-top: 32px;
  }
  .countersign { padding: 36px 24px; }
  .sig-cols { grid-template-columns: 1fr; gap: 40px; }
  .terms { display: block; margin-top: 40px; }
  .terms dt { text-align: left; padding-top: 0; margin-bottom: 6px; }
  .terms .term + .term dd { margin-top: 8px; }
  .name-exhibit { flex-direction: column; align-items: flex-start; gap: 24px; }
  .numbered + .numbered { margin-top: 64px; }
  .colophon { margin-top: 80px; }
}

/* ---------- reduced motion: paper holds still ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .rail.unposted { opacity: 1; transform: none; }
  .rail, a, .sig-blank, .brand .keycap { transition: none !important; }
  .sig-blank:hover .caret, .sig-blank:focus-visible .caret { animation: none; opacity: 1; }
}

/* ---------- print: the instrument survives the printer ---------- */
@media print {
  html, body { background: #fff; }
  .js .rail.unposted { opacity: 1 !important; transform: none !important; }
  .doc-control nav, .exhibit-foot, .copy-row, .colophon { display: none; }
  .exhibit, .countersign, .name-exhibit { background: #fff; border: 1px solid #999; }
  a { color: #000; text-decoration: none; }
  .sig-blank { border-bottom: 2px dotted #666; }
  body { font-size: 11pt; }
  h1 { font-size: 28pt; }
}
