/* ============ CAPTAIN — ledger.css ============ */
/* The complete record, as typography. Same styles serve the END INDEX that
   closes the film and READ MODE from the header. */

.lg-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(60px, 12vh, 140px) clamp(24px, 6vw, 80px) clamp(60px, 12vh, 120px);
}

.lg-title {
  display: flex; align-items: baseline; gap: 16px;
  padding-bottom: 20px; margin-bottom: clamp(40px, 7vh, 80px);
  border-bottom: 1px solid var(--line);
}
.lg-title i { font-style: normal; font-size: 9px; letter-spacing: .3em; color: var(--amber); }
.lg-title b { font-weight: 400; font-size: 9px; letter-spacing: .3em; color: var(--cyan); }

.lg-sec { margin-bottom: clamp(48px, 8vh, 96px); }
.lg-head { position: relative; }
.lg-num {
  position: absolute; inset-inline-start: -46px; top: 4px;
  font-size: 9px; letter-spacing: .2em; color: var(--dim); opacity: .6;
}
.lg-tag { display: block; font-size: 8.5px; letter-spacing: .28em; color: var(--amber); margin-bottom: 12px; }
.lg-h {
  font-size: clamp(24px, 3.6vw, 44px); font-weight: 700; line-height: 1.1;
  letter-spacing: .01em; margin-bottom: 14px; color: var(--text);
}
.lg-body {
  font-size: clamp(14px, 1.15vw, 16.5px); line-height: 1.7;
  color: var(--text); opacity: .78; max-width: 62ch;
}

/* label / value rows — same language as the in-film reveal */
.lg-rows {
  margin-top: 28px;
  display: grid; grid-template-columns: minmax(110px, 170px) 1fr;
  gap: 0;
}
.lg-rows dt {
  font-size: 8.5px; letter-spacing: .22em; color: var(--amber);
  padding: 13px 0; opacity: .85;
  border-top: 1px solid rgba(127,216,255,.12);
}
.lg-rows dd {
  font-size: clamp(13.5px, 1.05vw, 15.5px); line-height: 1.5;
  color: var(--text); opacity: .92;
  padding: 12px 0; margin: 0;
  border-top: 1px solid rgba(127,216,255,.12);
}

.lg-foot {
  margin-top: clamp(50px, 9vh, 100px);
  padding-top: 34px; border-top: 1px solid var(--line);
}
.lg-foot .ov-ctas { justify-content: flex-start; margin-top: 0; }
.lg-copy { margin-top: 40px; font-size: 9px; letter-spacing: .3em; color: var(--dim); opacity: .6; }

html[lang="fa"] .lg-inner { text-align: right; }
html[lang="fa"] .lg-body, html[lang="fa"] .lg-rows dd { line-height: 1.95; }
html[lang="fa"] .lg-num { inset-inline-start: auto; inset-inline-end: -46px; }
html[lang="fa"] .lg-h { letter-spacing: 0; line-height: 1.35; }

@media (max-width: 820px) {
  .lg-rows { grid-template-columns: 1fr; }
  .lg-rows dt { padding-bottom: 2px; border-top: 1px solid rgba(127,216,255,.12); }
  .lg-rows dd { padding-top: 4px; border-top: none; }
  .lg-num { position: static; display: block; margin-bottom: 6px; }
  html[lang="fa"] .lg-num { inset-inline-end: auto; }
}

/* ---------- END INDEX (closes the film) ---------- */
#endindex {
  position: relative; z-index: 20;
  background: linear-gradient(180deg, rgba(5,6,14,.65), var(--ink) 22%, var(--ink));
  min-height: 100vh;
}
body.at-index #rail, body.at-index #telemetry { opacity: 0; pointer-events: none; }
body.reduced #endindex { background: var(--ink); }

/* ---------- READ MODE (header toggle) ---------- */
#readmode {
  position: fixed; inset: 0; z-index: 70;
  background: var(--ink);
  overflow-y: auto; overscroll-behavior: contain;
  animation: rm-in .5s cubic-bezier(.22,1,.36,1) both;
}
@keyframes rm-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
body.reading #stage, body.reading #rail, body.reading #telemetry, body.reading #tracks, body.reading #endindex {
  visibility: hidden;
}
body.reading { overflow: hidden; }
#read-toggle[aria-pressed="true"] { color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  #readmode { animation: none; }
}
