/* ==========================================================================
   doc.css — the RevOps doc page.

   A doc is long-form reading. It used to be one 870px column of paragraphs at
   the left edge of a 1440px page: no way to see its shape, no way to move
   around it, and nothing to look at but text. This gives it a reading layout:

     hero      the title and lead beside a panel of facts, over a soft orchid
               aura and grid (the same motif as the hub's share cards)
     video     the walkthrough the doc was written around, first in the text
     text      a 680px column, with the contents in a rail that follows the
               reader and marks the section being read
     pieces    the shapes the docs repeat, drawn as what they are: definitions,
               formulas, numbered steps, hints, tables, collapsed transcripts
               (engine/lib/md.mjs decides which is which)

   Loaded by a doc (body.is-doc), after hub.css. A customer story is set on the
   same column, hero and rail, so it carries is-doc too and loads this sheet
   before its own (story.css). Colours, radii and type are the hub's own;
   nothing here introduces a new one.
   ========================================================================== */
body.is-doc{--doc-col:680px;--doc-rail:260px;--doc-label:#6F6F6F}

/* One column for the whole page: the hero, the text and the sections under it
   share a left and a right edge instead of each finding its own. It is the column
   the ported playbooks and studies use (ported-skin.css), so moving between a
   playbook and a doc does not move the page. */
body.is-doc header.hero > .wrap,
body.is-doc section > .wrap{max-width:1120px;padding-left:34px;padding-right:34px}

/* ---------- reading progress ---------- */
.docprog{position:fixed;inset:0 0 auto 0;height:3px;z-index:120;pointer-events:none}
.docprog span{display:block;height:100%;background:var(--ls-orchid);transform:scaleX(0);transform-origin:0 50%}

/* ---------- hero ---------- */
body.is-doc .dochero{position:relative;overflow:hidden;padding:76px 0 60px}
body.is-doc .dochero::before{content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(46% 110% at 96% -10%,rgba(219,132,201,.26),rgba(219,132,201,0) 68%),
             radial-gradient(34% 80% at 62% 118%,rgba(246,221,239,.7),rgba(246,221,239,0) 70%)}
body.is-doc .dochero::after{content:"";position:absolute;inset:0;pointer-events:none;
  background-image:linear-gradient(rgba(49,26,54,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(49,26,54,.05) 1px,transparent 1px);
  background-size:48px 48px;
  -webkit-mask-image:radial-gradient(ellipse 55% 95% at 88% 30%,#000 8%,transparent 72%);
          mask-image:radial-gradient(ellipse 55% 95% at 88% 30%,#000 8%,transparent 72%)}
body.is-doc .dochero > .wrap{position:relative;z-index:1}
.dochero__in{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:72px;align-items:end}
.doccrumb{display:inline-flex;align-items:center;gap:9px}
.doccrumb a{color:inherit;text-decoration:none;border-bottom:1px solid transparent;transition:border-color .2s}
.doccrumb a:hover{border-bottom-color:currentColor}
body.is-doc .dochero h1{max-width:17ch;margin-top:18px;text-wrap:balance}
body.is-doc .dochero .sub{max-width:58ch;margin-top:22px;font-size:19px;line-height:1.58;text-wrap:pretty}

/* A doc with a walkthrough says so under its lead, with how long it runs. */
.docwatch{display:inline-flex;align-items:center;gap:10px;margin-top:26px;font-size:15px;line-height:1.4;color:var(--ls-heading);
  text-decoration:none}
.docwatch__i{position:relative;flex:none;width:30px;height:30px;background:var(--ls-heading);border-radius:50%;transition:background-color .2s}
.docwatch__i::before{content:"";position:absolute;left:12px;top:9px;border-left:9px solid #fff;border-top:6px solid transparent;
  border-bottom:6px solid transparent}
.docwatch__d{color:var(--ls-dark-gray);font-variant-numeric:tabular-nums}
.docwatch:hover .docwatch__i{background:var(--ls-strong-purple)}
.docwatch:focus-visible{outline:2px solid var(--ls-strong-purple);outline-offset:4px}

.docfacts{padding:24px 26px 22px;background:rgba(255,255,255,.78);border:1px solid var(--ls-hairline);border-radius:2px;
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.docfacts__grid{display:grid;grid-template-columns:1fr 1fr;gap:18px 24px;margin:0}
.docfacts__grid dt{font-size:12px;line-height:1.4;letter-spacing:.08em;text-transform:uppercase;color:var(--doc-label)}
.docfacts__grid dd{margin:3px 0 0;font-size:21px;font-weight:500;line-height:1.25;letter-spacing:-.02em;color:var(--ls-heading);
  font-variant-numeric:tabular-nums}
.docfacts__note{margin:18px 0 0;padding-top:16px;border-top:1px solid var(--ls-hairline);font-size:14px;line-height:1.5;color:var(--ls-dark-gray)}
.docfacts__foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:16px}
.docfacts__foot .btn{margin-left:auto}

/* ---------- the text and its rail ---------- */
body.is-doc .docbody{padding:72px 0 96px}
.doc{display:grid;grid-template-columns:minmax(0,var(--doc-col)) var(--doc-rail);justify-content:space-between;column-gap:64px;align-items:start}
.doc--solo{grid-template-columns:minmax(0,var(--doc-col))}
body.is-doc .cbody{max-width:none;min-width:0}

.doc__rail{position:sticky;top:104px;min-width:0}
.doctoc{max-height:calc(100dvh - 136px);overflow-y:auto;padding:2px 0 2px 22px;border-left:1px solid var(--ls-hairline)}
.doctoc__l{display:block;margin-bottom:12px;font-size:12px;font-weight:500;letter-spacing:.14em;text-transform:uppercase;
  color:var(--doc-label);list-style:none}
.doctoc__l::-webkit-details-marker{display:none}
.doctoc ol{list-style:none;margin:0;padding:0}
.doctoc li{margin:0}
.doctoc a{position:relative;display:flex;gap:10px;padding:7px 0;font-size:14px;line-height:1.35;color:var(--ls-dark-gray);
  text-decoration:none;transition:color .2s}
.doctoc a:hover{color:var(--ls-heading)}
.doctoc a:focus-visible{outline:2px solid var(--ls-strong-purple);outline-offset:2px}
.doctoc__n{flex:none;width:18px;font-size:12px;line-height:19px;letter-spacing:.04em;color:var(--doc-label);font-variant-numeric:tabular-nums}
.doctoc ol ol{margin:0 0 4px 28px}
.doctoc ol ol a{padding:4px 0;font-size:13px}
.doctoc a.is-active{color:var(--ls-heading);font-weight:500}
.doctoc a.is-active::before{content:"";position:absolute;left:-23px;top:6px;bottom:6px;width:2px;background:var(--ls-orchid)}
.doctoc ol ol a.is-active::before{left:-51px}
.doctoc a.is-active .doctoc__n{color:var(--ls-strong-purple)}
/* Beside the text it is a fixed list, not something to fold away. */
@media(min-width:1024px){.doctoc__l{pointer-events:none}}

/* ---------- the walkthrough ---------- */
/* A picture and a link until it is pressed; then doc.js puts the player in its place,
   at the same size, so nothing under it moves. */
.docvideo{margin:0;scroll-margin-top:104px}
.docvideo__frame{position:relative;display:block;width:100%;aspect-ratio:16/9;overflow:hidden;background:var(--ls-heading);
  border:0;border-radius:2px}
/* The picture is 4:3 with the frame letterboxed inside it; covering 16:9 crops the bars. */
.docvideo__img{display:block;width:100%;height:100%;object-fit:cover;opacity:.9;transition:opacity .3s,transform .6s}
a.docvideo__frame::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(180deg,rgba(49,26,54,0) 55%,rgba(49,26,54,.55) 100%)}
.docvideo__play{position:absolute;left:50%;top:50%;z-index:1;width:76px;height:76px;margin:-38px 0 0 -38px;background:#fff;border-radius:50%;
  box-shadow:0 10px 30px rgba(49,26,54,.28);transition:transform .2s,background-color .2s}
.docvideo__play::before{content:"";position:absolute;left:31px;top:24px;border-left:20px solid var(--ls-heading);
  border-top:14px solid transparent;border-bottom:14px solid transparent}
.docvideo__dur{position:absolute;right:14px;bottom:14px;z-index:1;padding:4px 9px;background:rgba(49,26,54,.88);border-radius:2px;
  font-size:13px;line-height:1.4;color:#fff;font-variant-numeric:tabular-nums}
a.docvideo__frame:hover .docvideo__img{opacity:1;transform:scale(1.015)}
a.docvideo__frame:hover .docvideo__play{transform:scale(1.06);background:var(--ls-orchid-soft)}
a.docvideo__frame:focus-visible{outline:2px solid var(--ls-strong-purple);outline-offset:3px}
.docvideo__cap{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 16px;margin-top:12px;font-size:14px;line-height:1.4;
  color:var(--ls-dark-gray)}
.docvideo__l{font-size:12px;font-weight:500;letter-spacing:.14em;text-transform:uppercase;color:var(--ls-strong-purple)}
.docvideo__cap a{margin-left:auto;color:var(--ls-strong-purple);text-decoration:none}
.docvideo__cap a:hover{text-decoration:underline;text-underline-offset:3px}
.docvideo__cap a:focus-visible{outline:2px solid var(--ls-strong-purple);outline-offset:3px}

/* ---------- sections ---------- */
body.is-doc .csec{scroll-margin-top:104px}
body.is-doc .csec--h2{margin-top:0;padding-top:0}
body.is-doc .csec--h2:not(:first-child){margin-top:60px;padding-top:56px;border-top:1px solid var(--ls-hairline)}
body.is-doc .csec--h3{margin-top:40px}
body.is-doc .csec--h4{margin-top:30px}
.csec__n{display:block;margin-bottom:12px;font-size:12px;font-weight:500;line-height:1;letter-spacing:.16em;
  color:var(--ls-strong-purple);font-variant-numeric:tabular-nums}
/* A first section named after the doc: kept for the outline and for links, not drawn twice. */
body.is-doc .csec--echo > .csec__h,body.is-doc .csec--echo > .csec__n{position:absolute;width:1px;height:1px;margin:-1px;padding:0;
  overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body.is-doc .csec--h2 .csec__h{margin-bottom:20px;font-size:clamp(27px,1.2rem + 1.2vw,34px);font-weight:500;line-height:1.14;
  letter-spacing:-.028em;text-wrap:balance}
body.is-doc .csec--h3 .csec__h{margin-bottom:14px;font-size:22px;font-weight:500;line-height:1.25;letter-spacing:-.02em}
body.is-doc .csec--h4 .csec__h{margin-bottom:10px;font-size:18px;font-weight:600}

/* ---------- running text ---------- */
body.is-doc .csec__body{font-size:17px;line-height:1.72;color:var(--ls-dark-gray)}
body.is-doc .csec__body p{margin:0 0 18px;line-height:inherit;text-wrap:pretty}
body.is-doc .csec__body li{margin-bottom:9px;line-height:1.65}
body.is-doc .csec__body > :last-child{margin-bottom:0}
/* The column sets the measure here, so a paragraph and the card under it end on the same edge. */
body.is-doc .csec__body > :is(p,ul,ol,dl,blockquote,aside){max-width:none}
body.is-doc .csec__body strong{font-weight:600;color:var(--ls-heading)}
body.is-doc .csec__body ul{padding-left:20px}
body.is-doc .csec__body ul > li::marker{color:var(--ls-orchid)}
body.is-doc .csec__body p.md-label{margin:26px 0 10px;font-size:12px;font-weight:500;line-height:1.4;letter-spacing:.14em;
  text-transform:uppercase;color:var(--doc-label)}
body.is-doc .csec__body > p.md-label:first-child{margin-top:0}
body.is-doc .md-h{margin:30px 0 10px;font-size:18px}

/* The link to the service that does this work: a line of its own, not a stray sentence. */
body.is-doc .csec__body p.next-step,body.is-doc .cbody > p.next-step{margin:24px 0 0;padding:14px 18px;background:#fff;border:1px solid var(--ls-hairline);
  border-left:2px solid var(--ls-orchid);font-size:15.5px;line-height:1.55}

/* ---------- definitions: rows, or cards when every meaning is a short line ---------- */
body.is-doc .md-defs{margin:6px 0 26px;border-top:1px solid var(--ls-hairline)}
body.is-doc .md-def{display:grid;grid-template-columns:minmax(150px,30%) minmax(0,1fr);column-gap:28px;padding:14px 0;
  border-bottom:1px solid var(--ls-hairline)}
body.is-doc .md-def dt{font-weight:500;line-height:1.45;color:var(--ls-heading)}
body.is-doc .md-def dd{margin:0;line-height:1.62}
body.is-doc .md-defs--cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;border-top:0}
body.is-doc .md-defs--cards .md-def{position:relative;display:block;padding:18px 20px 19px;background:#fff;
  border:1px solid var(--ls-hairline);border-radius:2px;transition:border-color .2s}
body.is-doc .md-defs--cards .md-def::before{content:"";position:absolute;left:-1px;top:-1px;width:28px;height:2px;background:var(--ls-orchid)}
body.is-doc .md-defs--cards .md-def:hover{border-color:var(--ls-medium-purple)}
body.is-doc .md-defs--cards dt{margin-bottom:6px;font-size:16px}
body.is-doc .md-defs--cards dd{font-size:15px;line-height:1.55}
/* An odd one out takes the row rather than leaving a hole beside it. */
body.is-doc .md-defs--cards .md-def:last-child:nth-child(odd){grid-column:1/-1}

/* ---------- formula ---------- */
body.is-doc .md-formula{position:relative;overflow:hidden;margin:6px 0 26px;padding:22px 26px 24px;background:var(--ls-heading);
  border-radius:2px;color:#fff}
body.is-doc .md-formula::before{content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(60% 160% at 100% 0%,rgba(219,132,201,.34),rgba(219,132,201,0) 62%)}
body.is-doc .md-formula > *{position:relative}
body.is-doc .md-formula figcaption{margin-bottom:10px;font-size:12px;font-weight:500;letter-spacing:.16em;text-transform:uppercase;
  color:rgba(255,255,255,.66)}
.md-formula__eq{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;font-size:clamp(18px,1rem + .5vw,22px);
  line-height:1.4;letter-spacing:-.015em}
.md-formula__eq + .md-formula__eq{margin-top:10px}
.md-formula__lhs{font-weight:500;color:#F6DDEF}
.md-formula__op{color:var(--ls-orchid)}
.md-formula__rhs{color:#fff}

/* ---------- steps ---------- */
body.is-doc .csec__body ol.md-steps{list-style:none;margin:8px 0 26px;padding:0;counter-reset:md-step var(--from,0)}
body.is-doc .md-steps > li{position:relative;counter-increment:md-step;margin:0;padding:3px 0 20px 50px;line-height:1.62}
body.is-doc .md-steps > li::before{content:counter(md-step);position:absolute;left:0;top:0;display:grid;place-items:center;
  width:32px;height:32px;background:#fff;border:1px solid var(--ls-medium-purple);border-radius:50%;
  font-size:13px;font-weight:500;line-height:1;color:var(--ls-heading);font-variant-numeric:tabular-nums}
body.is-doc .md-steps > li::after{content:"";position:absolute;left:16px;top:38px;bottom:4px;width:1px;background:var(--ls-hairline)}
body.is-doc .md-steps > li:last-child{padding-bottom:0}
body.is-doc .md-steps > li:last-child::after{display:none}
body.is-doc .md-steps > li > ul,body.is-doc .md-steps > li > ol{margin-top:10px}

/* ---------- hint, quotation, code, table, collapsed block ---------- */
body.is-doc .md-callout{margin:6px 0 26px;padding:18px 22px 20px;background:rgba(246,221,239,.42);border-left:2px solid var(--ls-orchid)}
body.is-doc .csec__body p.md-callout__l{margin:0 0 6px;font-size:12px;font-weight:500;line-height:1.4;letter-spacing:.14em;
  text-transform:uppercase;color:var(--ls-strong-purple)}
body.is-doc .md-callout > :last-child{margin-bottom:0}
body.is-doc .md-quote{margin:6px 0 26px;padding:4px 0 4px 22px;background:none;border-left:2px solid var(--ls-orchid);
  font-size:19px;line-height:1.55;color:var(--ls-heading)}
body.is-doc .md-code{margin:6px 0 26px;padding:16px 18px;background:#fff}
body.is-doc .md-code code{font-size:14.5px}
body.is-doc .md-table{margin:6px 0 26px}
body.is-doc .md-table th{font-size:12px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--doc-label);
  border-bottom-color:var(--ls-heading)}
body.is-doc .md-table td{font-size:15.5px;line-height:1.55}
body.is-doc .md-table td:first-child{font-weight:500;color:var(--ls-heading)}
body.is-doc .md-details{margin:6px 0 26px;padding:0 20px;background:#fff}
body.is-doc .md-details > summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 0;list-style:none}
body.is-doc .md-details > summary::-webkit-details-marker{display:none}
body.is-doc .md-details > summary::after{content:"+";flex:none;font-size:22px;font-weight:300;line-height:1;color:var(--ls-strong-purple);
  transition:transform .2s}
body.is-doc .md-details[open] > summary::after{transform:rotate(45deg)}
body.is-doc .md-details > summary:focus-visible{outline:2px solid var(--ls-strong-purple);outline-offset:4px}
body.is-doc .ls-cards{margin:6px 0 26px}

/* ---------- below the desktop width: one column, the contents fold away ---------- */
@media(max-width:1023px){
  .dochero__in{grid-template-columns:minmax(0,1fr);gap:32px;align-items:start}
  .docfacts{max-width:520px}
  .doc{grid-template-columns:minmax(0,1fr);row-gap:28px}
  .doc__rail{position:static;order:-1;max-width:var(--doc-col)}
  .doctoc{max-height:none;padding:0;background:#fff;border:1px solid var(--ls-hairline);border-radius:2px}
  .doctoc__l{display:flex;align-items:center;justify-content:space-between;margin:0;padding:15px 16px;cursor:pointer}
  .doctoc__l::after{content:"+";font-size:20px;font-weight:300;line-height:1;letter-spacing:0;color:var(--ls-strong-purple);transition:transform .2s}
  .doctoc[open] > .doctoc__l::after{transform:rotate(45deg)}
  .doctoc[open] > .doctoc__l{border-bottom:1px solid var(--ls-hairline)}
  .doctoc__list{padding:8px 16px 12px}
  .doctoc a{padding:10px 0}
  .doctoc ol ol a{padding:8px 0}
  .doctoc a.is-active::before{display:none}
  body.is-doc .cbody{max-width:var(--doc-col)}
}
@media(max-width:640px){
  .docvideo__play{width:60px;height:60px;margin:-30px 0 0 -30px}
  .docvideo__play::before{left:24px;top:18px;border-left-width:17px;border-top-width:12px;border-bottom-width:12px}
  .docvideo__cap a{margin-left:0}
  body.is-doc header.hero > .wrap,
  body.is-doc section > .wrap{padding-left:20px;padding-right:20px}
  body.is-doc .dochero{padding:44px 0 40px}
  body.is-doc .dochero .sub{font-size:17px}
  body.is-doc .docbody{padding:40px 0 64px}
  body.is-doc .csec--h2:not(:first-child){margin-top:44px;padding-top:40px}
  body.is-doc .md-def{grid-template-columns:minmax(0,1fr);row-gap:4px}
  body.is-doc .md-defs--cards{grid-template-columns:minmax(0,1fr)}
  body.is-doc .md-formula{padding:18px 18px 20px}
  body.is-doc .md-steps > li{padding-left:44px}
}
@media(prefers-reduced-motion:reduce){
  .doctoc a,.doccrumb a,body.is-doc .md-defs--cards .md-def,body.is-doc .md-details > summary::after,.doctoc__l::after,
  .docwatch__i,.docvideo__img,.docvideo__play{transition:none}
}
