/* ============================================================
   ScopeFlow — the BOOK LAYOUT: a contents rail on the left, pages
   on the right.

   Loaded by user-guide.html and every guide/*.html chapter page,
   and ALSO by features.html and every features/*.html page, whose
   navigation is deliberately the same component (director,
   13 Sep 2026). The rail, .book, the .chapter rhythm, .pn and
   <kbd> are therefore SHARED — a change here moves both sections,
   which is the point. The video player rules below (.player,
   .marks) are used by the guide only.

   GENERATED PAGES: edit scripts/website/guide-chapters.json +
   build-guide.mjs, or features.json + build-features.mjs — never
   the HTML.
   ============================================================ */

/* ---- guide-specific ---- */

.gtop{ padding-block:clamp(44px,6vw,76px) clamp(24px,3vw,36px); }
.gtop h1{
  font-family:var(--display); font-weight:800;
  font-size:clamp(32px,5.4vw,56px); line-height:1.04; letter-spacing:-.03em;
  margin:14px 0 0; max-width:18ch;
}
.gtop .meta{
  margin-top:18px; display:flex; flex-wrap:wrap; gap:8px 18px;
  font-family:var(--mono); font-size:11.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-soft);
}
.gtop .meta b{ color:var(--navy); font-weight:600; }

/* The book: a contents rail on the left, chapters on the right. */
.book{
  display:grid; grid-template-columns:272px minmax(0,1fr);
  gap:clamp(28px,4vw,64px); align-items:start;
  padding-block:clamp(20px,3vw,36px) clamp(56px,7vw,96px);
}
@media (max-width:960px){ .book{ grid-template-columns:1fr; } }

.rail{ position:sticky; top:76px; max-height:calc(100vh - 92px); overflow:auto; padding-right:6px; }
@media (max-width:960px){ .rail{ position:static; max-height:none; } }
.rail__head{
  display:flex; align-items:baseline; justify-content:space-between;
  padding:0 0 10px; border-bottom:1px solid var(--ink);
  font-family:var(--display); font-weight:800; font-size:15px; letter-spacing:-.01em;
}
.rail__head span{ font-family:var(--mono); font-size:10.5px; font-weight:500; letter-spacing:.14em; text-transform:uppercase; color:var(--ink-soft); }
@media (min-width:961px){ .rail__head span{ display:none; } }
.rail__group{ margin-top:16px; }
.rail__group > b{
  display:block; font-family:var(--mono); font-size:10.5px; font-weight:500;
  letter-spacing:.14em; text-transform:uppercase; color:var(--ink-soft); padding:0 0 6px 12px;
}
.rail ol{ list-style:none; margin:0; padding:0; }
.rail li a{
  position:relative; display:grid; grid-template-columns:26px 1fr; gap:8px; align-items:baseline;
  padding:7px 8px 7px 12px; border-radius:3px; text-decoration:none; color:var(--ink);
  font-size:14px; line-height:1.35; transition:background .15s ease, color .15s ease;
}
.rail li a b{ font-family:var(--mono); font-size:11px; font-weight:500; color:var(--ink-soft); }
.rail li a:hover{ background:rgba(33,145,251,.07); }
.rail li a::before{
  content:""; position:absolute; left:0; top:6px; bottom:6px; width:3px; border-radius:2px;
  background:transparent; transition:background .15s ease;
}
.rail li a.is-active{ color:var(--navy); font-weight:600; background:rgba(33,145,251,.08); }
.rail li a.is-active::before{ background:var(--cta); }
.rail li a .len{ grid-column:2; font-family:var(--mono); font-size:10.5px; color:var(--ink-soft); font-weight:400; margin-top:-2px; }
.rail li a .soon{ grid-column:2; font-family:var(--mono); font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-soft); }

/* On narrow screens the rail becomes a collapsible contents block. */
.rail details summary{ cursor:pointer; list-style:none; }
.rail details summary::-webkit-details-marker{ display:none; }
@media (min-width:961px){
  .rail details > summary{ pointer-events:none; }
  .rail details:not([open]) > *:not(summary){ display:block; }
}

/* Chapters */
.chapters{ display:flex; flex-direction:column; gap:0; min-width:0; }
.chapter{
  padding-block:clamp(34px,4.5vw,56px);
  border-top:1px solid var(--rule);
  scroll-margin-top:84px;
}
.chapter:first-child{ border-top:0; padding-top:8px; }
.chapter__n{
  font-family:var(--mono); font-size:11.5px; letter-spacing:.16em;
  text-transform:uppercase; color:var(--ink-soft);
}
.chapter h2{
  font-family:var(--display); font-weight:800;
  font-size:clamp(24px,3vw,34px); letter-spacing:-.02em; line-height:1.1;
  margin:10px 0 0;
}
.chapter__why{ margin-top:12px; color:var(--ink-soft); font-size:16px; line-height:1.6; max-width:62ch; }

/* The player frame — the same drafting-sheet language as the landing page. */
.player{
  margin-top:22px; border:1px solid var(--rule); background:#fff; border-radius:3px;
  box-shadow:0 1px 0 rgba(21,32,41,.04), 0 14px 34px -22px rgba(21,32,41,.3);
  overflow:hidden;
}
.player__bar{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:9px 13px; border-bottom:1px solid var(--rule-faint);
  background:var(--paper-deep);
  font-family:var(--mono); font-size:10.5px; letter-spacing:.08em;
  text-transform:uppercase; color:var(--ink-soft);
}
.player__bar b{ color:var(--navy); font-weight:600; }
/* The box is sized from the first paint, so a video, its poster or the
   "recording in progress" card can arrive later without moving anything
   below it — the page must not jump as thirteen players load. */
.player__box{ position:relative; width:100%; aspect-ratio:16/10; background:#0C2E5A; }
.player__box video{ position:absolute; inset:0; width:100%; height:100%; display:block; background:#0C2E5A; }
.player__box .player__soon{ position:absolute; inset:0; aspect-ratio:auto; }
.player__foot{ min-height:36px; border-top:1px solid var(--rule-faint); }
.player__foot:empty{ border-top:0; }
.player__bar{ min-height:37px; }
.player__soon{
  aspect-ratio:16/10; display:grid; place-items:center; text-align:center; padding:24px;
  background:
    repeating-linear-gradient(to right, var(--rule-faint) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(to bottom, var(--rule-faint) 0 1px, transparent 1px 32px),
    var(--paper);
  color:var(--ink-soft); font-size:14.5px; line-height:1.55;
}
.player__soon b{ display:block; font-family:var(--display); font-weight:800; font-size:18px; color:var(--ink); letter-spacing:-.01em; margin-bottom:6px; }

/* Chapter markers under the video — click to seek. */
.marks{ margin:0; padding:8px 6px; list-style:none; border-top:1px solid var(--rule-faint); display:none; }
.marks.has{ display:block; }
.marks.has{ display:block; }
.marks li{ display:flex; gap:12px; align-items:baseline; }
.marks button{
  all:unset; cursor:pointer; display:flex; gap:12px; align-items:baseline; width:100%;
  padding:6px 8px; border-radius:3px; font-size:13.5px; line-height:1.45; color:var(--ink);
}
.marks button:hover{ background:rgba(33,145,251,.07); }
.marks button b{ font-family:var(--mono); font-size:11px; font-weight:500; color:var(--ink-soft); min-width:44px; }
.marks button.is-now{ color:var(--navy); font-weight:600; }
.marks__toggle{
  all:unset; cursor:pointer; display:block; width:100%; text-align:left; box-sizing:border-box; min-height:36px;
  padding:9px 13px;
  font-family:var(--mono); font-size:10.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-soft);
}
.marks__toggle:hover{ color:var(--navy); }

/* Written steps */
.chapter h3{
  margin:26px 0 0; font-family:var(--mono); font-size:11.5px; font-weight:500;
  letter-spacing:.14em; text-transform:uppercase; color:var(--ink-soft);
}
.steps{ margin:12px 0 0; padding:0; list-style:none; counter-reset:s; max-width:70ch; }
.steps li{
  counter-increment:s; position:relative; padding-left:34px; margin-bottom:10px;
  font-size:15px; line-height:1.6;
}
.steps li::before{
  content:counter(s); position:absolute; left:0; top:1px;
  width:22px; height:22px; border-radius:50%;
  border:1px solid var(--rule); background:#fff;
  font-family:var(--mono); font-size:11px; color:var(--ink-soft);
  display:grid; place-items:center;
}
.steps b{ font-weight:600; color:var(--ink); }
.gotcha{
  margin-top:20px; padding:14px 16px; max-width:70ch;
  border-left:2px solid var(--cta); background:rgba(33,145,251,.06);
  font-size:14.5px; line-height:1.6;
}
.gotcha > b:first-child{ font-family:var(--mono); font-size:11px; letter-spacing:.1em;
  text-transform:uppercase; color:var(--navy); display:block; margin-bottom:5px; }
.gotcha b{ font-weight:600; color:var(--ink); }
kbd{
  font-family:var(--mono); font-size:12px; padding:1px 6px; border:1px solid var(--rule);
  border-bottom-width:2px; border-radius:4px; background:#fff; color:var(--ink);
}

/* ---- one page per chapter (build-guide.mjs) ---- */
.gtop--chapter{ padding-block:clamp(22px,3vw,34px) 0; }
.gtop--chapter .eyebrow a{ color:inherit; text-decoration:none; border-bottom:1px solid var(--rule); }
.gtop--chapter .eyebrow a:hover{ color:var(--navy); border-color:var(--navy); }
.chapter:first-child{ padding-top:8px; }
.pn{
  margin-top:34px; padding-top:22px; border-top:1px solid var(--rule);
  display:grid; grid-template-columns:1fr 1fr; gap:18px;
}
.pn__a{ display:flex; flex-direction:column; gap:4px; text-decoration:none; color:var(--ink); min-width:0; }
.pn__a span{ font-family:var(--mono); font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--ink-soft); }
.pn__a b{ font-family:var(--display); font-weight:800; font-size:17px; letter-spacing:-.01em; line-height:1.2; }
.pn__a:hover b{ color:var(--navy); }
.pn__a--next{ text-align:right; align-items:flex-end; }
