/* ══════════════════════════════════════════════════════════════════════
   RAN-00 DOCUMENT LAYER
   Loaded on top of style.css. Long-form reading surface only — it does
   not touch the canvas, only the scrim that sits between it and the type.
   ═════════════════════════════════════════════════════════════════════ */

.doc-body { }

/* The reactive field stays exactly as built. This holds it back so a
   3,000-word document is actually readable on top of it. */
.doc-scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(2,2,3,0.55) 0%, rgba(2,2,3,0.86) 34%, rgba(2,2,3,0.90) 100%);
}
@media (max-width: 1024px) {
  .doc-scrim { background: rgba(2,2,3,0.88); }
}

/* ─── HEADER ──────────────────────────────────────────────────────────── */
.doc-header { padding: 32px 0; }
.doc-header .logo-img { width: 46px; height: 46px; }

/* ─── LAYOUT ──────────────────────────────────────────────────────────── */
.doc-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 64px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 5vw 180px;
}

/* ─── CONTENTS RAIL ───────────────────────────────────────────────────── */
.doc-nav {
  position: sticky;
  top: 120px;
  align-self: start;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 24px;
}
.doc-nav::-webkit-scrollbar { display: none; }

.doc-back {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: 48px;
  transition: color 0.2s;
}
.doc-back:hover { color: var(--text); }

.doc-nav-title {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
}
#doc-toc { display: flex; flex-direction: column; }
#doc-toc a {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  padding: 7px 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-dim);
  transition: color 0.2s var(--ease);
}
#doc-toc a span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; padding-top: 2px; }
#doc-toc a:hover { color: var(--text-muted); }
#doc-toc a.current { color: var(--text); }
#doc-toc a.current span { color: var(--st-stated); }

/* ─── DOCUMENT COLUMN ─────────────────────────────────────────────────── */
.doc { max-width: 720px; padding-top: 96px; }

/* Masthead */
.doc-masthead { padding-bottom: var(--f6); border-bottom: 1px solid rgba(255,255,255,0.18); }
.doc-id {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--st-stated);
  margin-bottom: 26px;
}
.doc-title .w { display: block; }
.doc-title .w-b { margin-left: var(--f4); }
.doc-title {
  font-family: var(--display);
  font-size: clamp(52px, 7.5vw, 104px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: var(--track-display);
  text-transform: uppercase;
  margin-bottom: 36px;
}
.doc-standfirst {
  margin-left: var(--f4);
  font-family: var(--display);
  font-size: clamp(21px, 2.5vw, 30px);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: var(--track-head);
  color: var(--text);
  max-width: 640px;
  margin-bottom: 28px;
  text-wrap: balance;
}

.doc-kicker {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 0 var(--f6) var(--f4);
}

.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--f3) var(--f5); margin-bottom: var(--f5); }
.dm { display: flex; flex-direction: column; gap: 8px; }
.dm-k { font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; color: var(--text-dim); }
.dm-v { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--text-muted); line-height: 1.4; }

.doc-notice {
  border: 1px solid rgba(244,184,212,0.3);
  border-radius: var(--r-box);
  background: rgba(244,184,212,0.03);
  padding: var(--f4);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}
.doc-notice a { color: var(--st-stated); border-bottom: 1px solid rgba(201,184,244,0.35); }
.doc-notice p + p { margin-top: 14px; }

/* ─── ABSTRACT ────────────────────────────────────────────────────────── */
.doc-abstract { max-width: 640px; margin: 0 0 var(--f6) var(--f4); }
.doc-abstract p {
  font-size: 16.5px;
  line-height: 1.68;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.doc-abstract p:last-child { margin-bottom: 0; }
.doc-abstract strong { color: var(--text); font-weight: 500; }
.doc-em {
  font-style: normal;
  color: var(--st-removed);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
}

/* ─── DERIVATION FLOW ─────────────────────────────────────────────────── */
.doc-flow { margin: var(--f5) 0; display: flex; flex-direction: column; gap: var(--f1); }
.fl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--f2);
  padding: var(--f3) var(--f4);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.025);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
}
.fl-k { color: var(--text); }
.fl-v { color: var(--st-stated); }
.fl-a { color: var(--text-dim); }

/* ─── DOCUMENT STACK ──────────────────────────────────────────────────── */
.doc-stack { display: flex; flex-direction: column; margin: 20px 0 16px; }
.ds-row { padding: var(--f3) 0; border-top: 1px solid var(--rule); }
.doc-stack .ds-row:last-child { border-bottom: 1px solid var(--rule); }
.ds-k {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--track-meta);
  color: var(--text);
  margin-bottom: 10px;
}
.ds-row p { font-size: 14.5px; line-height: 1.6; color: var(--text-muted); }

/* Sections */
.doc-sec { padding: var(--f7) 0; border-bottom: 1px solid var(--rule); scroll-margin-top: var(--f6); }
/* Golden flow, gentler here: padding rather than margin, so the section
   rules stay aligned full width and only the reading matter drifts. */
.doc-sec:nth-of-type(5n+2) { padding-left: var(--f2); }
.doc-sec:nth-of-type(5n+3) { padding-left: var(--f4); }
.doc-sec:nth-of-type(5n+4) { padding-left: var(--f3); }
.doc-sec:nth-of-type(5n+5) { padding-left: var(--f1); }

.doc-sec-num {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--st-stated);
  margin-bottom: 22px;
}
.doc-sec h2 {
  font-family: var(--display);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: var(--track-head);
  margin-bottom: var(--f5);
  max-width: 640px;
  text-wrap: balance;
}
.doc-sec h3 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--st-stated);
  margin: 52px 0 20px;
}
.doc-sec p {
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: -0.003em;
  color: var(--text-muted);
  margin-bottom: var(--f3);
  max-width: 68ch;
}
.doc-sec p:last-child { margin-bottom: 0; }
.doc-sec p.lead { font-size: clamp(18px, 1.9vw, 22px); line-height: 1.52; color: var(--text); letter-spacing: -0.018em; font-weight: 400; }
.doc-sec strong { color: var(--text); font-weight: 500; }
.doc-sec a:not(.tag) { color: var(--st-stated); border-bottom: 1px solid rgba(201,184,244,0.3); transition: border-color 0.2s, color 0.2s; }
.doc-sec a:not(.tag):hover { color: var(--text); border-bottom-color: var(--text); }

/* A pulled statement — the load-bearing sentence of a section */
.doc-sec p.pull {
  font-family: var(--display);
  font-size: clamp(19px, 2.2vw, 26px);
  font-weight: 400;
  line-height: 1.32;
  letter-spacing: var(--track-head);
  color: var(--text);
  border-left: 2px solid rgba(255,255,255,0.22);
  padding-left: 26px;
  margin: 48px 0;
  text-wrap: balance;
}

/* Lists */
.doc-list { margin: 8px 0 28px 0; padding-left: 22px; }
.doc-list li { font-size: 17px; line-height: 1.65; color: var(--text-muted); margin-bottom: 12px; }
.doc-list li::marker { color: var(--text-dim); }
/* Statement lists read as lines, not bullets. */
.doc-list.plain { list-style: none; padding-left: 0; }
.doc-list.plain li {
  padding: 9px 0 9px 22px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: relative;
  font-size: 16px;
}
.doc-list.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 19px;
  width: 10px;
  height: 1px;
  background: var(--text-dim);
}

/* Definitions and the hard constraint */
.doc-def {
  margin: var(--f5) 0;
  padding: var(--f4) var(--f5);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-box);
  background: rgba(255,255,255,0.02);
}
.doc-def .def-k {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--st-stated);
  margin-bottom: 14px;
}
.doc-def p { font-size: clamp(17px, 1.8vw, 20px); line-height: 1.5; letter-spacing: -0.015em; color: var(--text); margin-bottom: 0; font-weight: 400; }
.doc-def-hard { border-color: rgba(168,230,207,0.45); }
.doc-def-hard .def-k { color: var(--st-verified); }
.doc-def-hard p { font-family: var(--display); font-size: clamp(19px, 2.1vw, 25px); font-weight: 400; line-height: 1.3; letter-spacing: var(--track-head); }

/* Numbered obligations */
.doc-obligations { list-style: none; counter-reset: ob; margin-top: 8px; }
.doc-obligations > li {
  counter-increment: ob;
  display: grid;
  grid-template-columns: var(--f4) 1fr;
  gap: var(--f3);
  padding: var(--f4) 0;
  border-top: 1px solid var(--rule);
}
.doc-obligations > li:last-child { border-bottom: 1px solid var(--rule); }
.doc-obligations > li::before {
  content: counter(ob, decimal-leading-zero);
  grid-column: 1;
  grid-row: 1;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding-top: 4px;
}
/* The counter occupies column 1; every real child stacks in column 2.
   Without this the third grid item wraps under the 40px counter column. */
.doc-obligations > li > * { grid-column: 2; }
.doc-obligations .ob-k {
  display: block;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.35;
  letter-spacing: -0.015em;
}
.doc-obligations p { font-size: 15px; margin-bottom: 0; }

/* Limits + register reuse the landing-page components from style.css */
.doc-sec .limit-list { margin-top: var(--f5); }
.doc-sec .limit p { font-size: 15px; margin-bottom: 0; }
.doc-sec .register { margin-top: var(--f5); }

.doc-caveat {
  border: 1px solid rgba(168,212,244,0.26);
  border-radius: var(--r-box);
  background: rgba(168,212,244,0.03);
  padding: var(--f4) !important;
  font-size: 15px !important;
  margin-top: var(--f5) !important;
  max-width: none !important;
}

/* Colophon */
.doc-colophon { padding-top: 72px; display: flex; flex-direction: column; gap: 28px; }
.doc-colophon p { font-size: 14px; line-height: 1.65; color: var(--text-muted); }
.doc-colophon strong { color: var(--text); font-weight: 500; }
.doc-legal { color: var(--text-dim) !important; font-size: 12px !important; }
.doc-colophon-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.doc-colophon-links a { color: var(--text-muted); transition: color 0.2s; }
.doc-colophon-links a:hover { color: var(--text); }
.doc-colophon .f-issuer { padding-top: 8px; }
.doc-colophon .doc-nav-title { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.doc-colophon .doc-meta { margin-bottom: 0; }

/* ─── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .doc-layout { grid-template-columns: 1fr; gap: 0; padding: 0 24px 120px; }

  /* Contents collapses to a scrolling strip under the header */
  .doc-nav {
    position: static;
    max-height: none;
    padding-top: 96px;
    padding-bottom: 0;
  }
  .doc-back { margin-bottom: 32px; }
  #doc-toc {
    flex-direction: row;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 16px;
    scrollbar-width: none;
  }
  #doc-toc::-webkit-scrollbar { display: none; }
  #doc-toc a { grid-template-columns: auto; white-space: nowrap; padding: 0; font-size: 12px; }
  #doc-toc a span { display: none; }

  .doc { padding-top: 48px; max-width: 100%; }
  .doc-masthead { padding-bottom: 56px; }
  .doc-meta { grid-template-columns: 1fr; gap: 20px; }
  .doc-sec { padding: var(--f6) 0; }
  .doc-sec[class] { padding-left: 0; }
  .doc-def { padding: var(--f4); }
  .doc-kicker, .doc-abstract, .doc-standfirst { margin-left: 0; }
  .doc-title .w-b { margin-left: var(--f3); }
  .doc-obligations > li { grid-template-columns: 32px 1fr; gap: 14px; }
  .fl-row { gap: 10px; padding: 16px; font-size: 10px; }
  .doc-abstract p { font-size: 16px; }
}
