/* Chancelings — document pages.
   Ivory ledger paper on the same felt, with a sticky contents column. */

:root {
  --baize:      #03100f;
  --paper:      #f3e8cf;
  --paper-edge: #dfcda3;
  --ink:        #16241f;
  --ink-soft:   #4b5a53;
  --brass:      #d9b45c;
  --brass-dark: #8a6f2e;
  --enamel:     #b8452f;

  --display: Georgia, "Times New Roman", "Songti SC", serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; background: var(--baize); color: #f5ecd8;
  font: 16px/1.7 var(--body); -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 520px at 82% -6%, rgba(217, 180, 92, 0.09), transparent 60%),
    repeating-linear-gradient(122deg, rgba(255, 255, 255, 0.014) 0 2px, transparent 2px 5px);
}
img { max-width: 100%; display: block; }

/* ── masthead (matches the home page) ───────────────────────────────────── */

.masthead {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px clamp(16px, 4vw, 34px);
  background: rgba(3, 16, 15, 0.94);
  border-bottom: 1px solid rgba(217, 180, 92, 0.26);
}
.crest { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin-right: auto; }
.crest__mark {
  width: 34px; height: 34px; flex: none; border-radius: 9px; position: relative;
  background: linear-gradient(180deg, #14413a, #071e1a);
  border: 1px solid rgba(217, 180, 92, 0.55);
}
.crest__mark::before {
  content: ""; position: absolute; inset: 6px; background: var(--brass);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.crest__mark::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  margin: -4px 0 0 -4px; border-radius: 50%; background: var(--enamel);
}
.crest__text { display: flex; flex-direction: column; line-height: 1.05; }
.crest__text b { font: 700 15px/1.1 var(--display); }
.crest__text i {
  font: 400 10px/1.4 var(--mono); font-style: normal; letter-spacing: 0.24em;
  color: var(--brass); text-transform: uppercase;
}

.desk { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.desk a {
  text-decoration: none; font-size: 13px; padding: 9px 12px; border-radius: 8px;
  color: rgba(245, 236, 216, 0.78); white-space: nowrap;
}
.desk a:hover { background: rgba(217, 180, 92, 0.14); color: #f5ecd8; }
.desk a.is-here { color: var(--brass); background: rgba(217, 180, 92, 0.12); }

@media (max-width: 760px) {
  .desk { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .crest { margin-right: 0; }
}

/* ── title block ────────────────────────────────────────────────────────── */

.docHead {
  max-width: 1120px; margin: 0 auto;
  padding: clamp(38px, 6vw, 64px) clamp(18px, 4vw, 40px) clamp(22px, 3vw, 34px);
}
.docHead .tag {
  display: inline-block; font: 400 10px/1.6 var(--mono); letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--brass);
  border: 1px solid rgba(217, 180, 92, 0.4); border-radius: 20px; padding: 4px 14px; margin-bottom: 18px;
}
.docHead h1 { font: 400 clamp(30px, 5vw, 50px)/1.1 var(--display); margin: 0 0 12px; }
.docHead .meta { margin: 0; font: 400 12px/1.6 var(--mono); letter-spacing: 0.1em; color: rgba(245, 236, 216, 0.5); }

/* ── two columns: contents + sheet ──────────────────────────────────────── */

.docBody {
  max-width: 1120px; margin: 0 auto clamp(50px, 7vw, 90px);
  padding: 0 clamp(18px, 4vw, 40px);
  display: grid; grid-template-columns: 218px minmax(0, 1fr); gap: clamp(20px, 3vw, 44px);
  align-items: start;
}

.toc { position: sticky; top: 96px; }
.toc h2 {
  font: 400 10px/1.6 var(--mono); letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brass); margin: 0 0 12px;
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; border-left: 1px solid rgba(217, 180, 92, 0.24); }
.toc li { counter-increment: t; }
.toc a {
  display: block; text-decoration: none; padding: 7px 0 7px 14px; margin-left: -1px;
  border-left: 2px solid transparent; font-size: 13.5px; color: rgba(245, 236, 216, 0.58);
}
.toc a::before { content: counter(t, decimal-leading-zero) "  "; font-family: var(--mono); font-size: 10px; color: rgba(217, 180, 92, 0.65); }
.toc a:hover { color: #f5ecd8; }

.sheet {
  background: var(--paper); color: var(--ink); border-radius: 8px;
  padding: clamp(24px, 4vw, 52px);
  border-top: 5px solid var(--brass-dark);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.4);
}
.sheet section { padding-bottom: 4px; }
.sheet section + section { margin-top: 34px; padding-top: 30px; border-top: 1px solid rgba(22, 36, 31, 0.14); }
.sheet h2 {
  font: 400 clamp(21px, 2.6vw, 27px)/1.25 var(--display); margin: 0 0 14px; color: var(--ink);
}
.sheet h3 { font: 600 15px/1.4 var(--body); margin: 22px 0 8px; }
.sheet p { margin: 0 0 14px; color: #2c3a34; }
.sheet ul, .sheet ol { margin: 0 0 16px; padding-left: 22px; color: #2c3a34; }
.sheet li { margin-bottom: 7px; }
.sheet a { color: var(--enamel); }
.sheet strong { color: var(--ink); }

.lead {
  font-size: 17px; line-height: 1.65; color: #22322c;
  border-left: 3px solid var(--brass-dark); padding: 2px 0 2px 16px; margin-bottom: 20px;
}

.note {
  background: rgba(184, 69, 47, 0.08); border-left: 3px solid var(--enamel);
  padding: 14px 16px; margin: 0 0 18px; font-size: 14.5px; color: #4a2a22;
}
.note b { color: #8c3520; }

.plain { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14.5px; }
.plain th, .plain td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(22, 36, 31, 0.14); vertical-align: top; }
.plain thead th {
  font: 400 10px/1.6 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(22, 36, 31, 0.6); border-bottom: 1.5px solid rgba(22, 36, 31, 0.4);
}
.plain tbody tr:nth-child(even) { background: rgba(22, 36, 31, 0.04); }
.wrap { overflow-x: auto; }

/* The registered entity, on every document that names it. Set apart from the
   prose because a reviewer looks for it as a block, not as a sentence. */
.entity {
  margin: 0 0 18px; padding: 12px 16px;
  background: rgba(22, 36, 31, 0.05);
  border-left: 3px solid var(--brass-dark);
  font-style: normal; font-size: 14px; line-height: 1.7; color: #2c3a34;
}
.entity a { color: var(--enamel); }

.stamp {
  margin-top: 34px; padding-top: 20px; border-top: 1px dashed rgba(22, 36, 31, 0.3);
  font: 400 11px/1.8 var(--mono); letter-spacing: 0.08em; color: rgba(22, 36, 31, 0.55);
}

@media (max-width: 900px) {
  .docBody { grid-template-columns: 1fr; }
  .toc { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 6px; border-left: 0; }
  .toc a { border: 1px solid rgba(217, 180, 92, 0.3); border-radius: 20px; padding: 6px 12px; margin: 0; }
}

/* ── foot ───────────────────────────────────────────────────────────────── */

.docFoot {
  border-top: 1px solid rgba(217, 180, 92, 0.22); background: rgba(0, 0, 0, 0.24);
  padding: 30px clamp(18px, 4vw, 40px);
}
.docFoot__inner {
  max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 14px 26px;
  align-items: center; justify-content: space-between;
}
.docFoot a { color: rgba(245, 236, 216, 0.7); font-size: 14px; text-decoration: none; margin-right: 18px; }
.docFoot a:hover { color: #f5ecd8; text-decoration: underline; }
.docFoot p { margin: 0; font-size: 12.5px; color: rgba(245, 236, 216, 0.45); max-width: 62ch; }
