@import url('./line-detail.css');
/* Chapter I only: the funnel, the trajectory chart, the seven kinds of work and their pop-ups.
   Everything else comes from /assets/essay.css. The area colours match the essays' chips. */

/* area chips and tiles */
.tarea { display: block; font-size: var(--t-s); font-weight: 500; color: var(--muted); margin-bottom: 4px; }

/* the trajectory chart */
.tch { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto 28px; column-gap: 10px; margin-top: 36px; color: var(--green); }
.tya { position: relative; }
.tya span { position: absolute; right: 0; transform: translateY(-50%); font-size: var(--t-s); color: var(--muted); line-height: 1; }
.tpa { position: relative; aspect-ratio: 2.3; }
.tpa svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tgl { position: absolute; left: 0; right: 0; height: 1px; background: var(--wash); }
.thl { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--grey); }
.tdot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--grey); }
.tdot.b { width: 13px; height: 13px; background: var(--green); z-index: 2; }
.tlab { position: absolute; white-space: nowrap; font-size: var(--t-s); font-weight: 500; color: var(--green); line-height: 1.2; z-index: 3; }
.thlab { position: absolute; white-space: nowrap; font-size: var(--t-s); color: var(--muted); line-height: 1.2; }
.txa { position: relative; }
.txa span { position: absolute; top: 8px; transform: translateX(-50%); font-size: var(--t-s); color: var(--muted); white-space: nowrap; }

/* the funnel: one wide card; its title stays on screen while the steps scroll */
.ex-funnel { margin-left: calc((min(100vw - 32px, 1200px) - 100%) / -2); margin-right: calc((min(100vw - 32px, 1200px) - 100%) / -2); padding-bottom: 0; }
.ex-funnel figcaption { position: sticky; top: 45px; z-index: 3; background: var(--surface); margin: 0 -28px; padding: 14px 28px 10px; border-bottom: 1px solid var(--rule); max-width: none; }
.scrolly { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 36px; position: relative; }
.scrolly .graphic { position: sticky; top: 110px; height: calc(100vh - 120px); display: flex; flex-direction: column; justify-content: center; grid-column: 2; grid-row: 1; }
.scrolly .steps { grid-column: 1; grid-row: 1; padding: 24vh 0 36vh; }
.scrolly .layer { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .6s ease; }
.scrolly .layer.on { opacity: 1; pointer-events: auto; }
.scrolly .step { min-height: 76vh; display: flex; align-items: center; }
.scrolly .box { background: var(--surface); border: 1px solid var(--rule); padding: 16px 18px; transition: border-color .3s; }
.scrolly .step.active .box { border-color: var(--ink); }
.scrolly .box h3 { font-size: var(--t-body); font-weight: 500; line-height: 1.3; margin: 0 0 8px; }
.scrolly .box p { margin: 0; }
.plot { position: relative; width: min(100%, calc((100vh - 200px) * 1.5)); margin: 0 auto; container-type: inline-size; }
svg.dots { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
svg.dots .dt { transition: transform .9s ease, opacity .9s ease; cursor: pointer; }
svg.dots line.grid { stroke: var(--rule); stroke-width: 1; }
svg.dots line.lead { stroke: var(--ink-2); stroke-width: 1; }
svg.dots line.trail { stroke-dasharray: 3 3; }
svg.dots .zone.z2 { fill: #BFDDC9; }
svg.dots .zone.z1 { fill: #E1EEE5; }
/* labels scale with the chart (1000 chart units = 100cqw), so they keep their place */
.ov { position: absolute; inset: 0; pointer-events: none; }
.ov .tl { position: absolute; white-space: nowrap; line-height: 1; color: var(--ink); font-size: max(11px, 1.8cqw); }
.ov .lab, .ov .row { font-weight: 500; font-size: max(12px, 2cqw); }
.ov .nm2, .ov .ann.b { font-weight: 500; }
.ov .ann { font-size: max(11px, 1.65cqw); }
.ov .nm, .ov .nm2 { font-size: max(11px, 1.55cqw); }
.ov .lab2, .ov .axis { color: var(--muted); }
.ov .nm { color: var(--ink-2); }
.namesbtn { font: inherit; font-size: var(--t-s); border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2); padding: 4px 10px; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.namesbtn { margin-top: 8px; border-color: var(--ink); color: var(--ink); }
.namesbtn[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.hint { font-size: var(--t-s); color: var(--muted); margin-top: 8px; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: #fff; padding: 9px 11px; font-size: var(--t-s); line-height: 1.35; width: max-content; max-width: 290px; z-index: 50; }
.tip b { display: block; font-weight: 500; margin-bottom: 2px; }
.tip .v { display: block; margin-top: 5px; color: #cfcfce; }

/* the seven kinds of work */
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.scard { display: flex; flex-direction: column; gap: 10px; background: var(--bg); border-top: 3px solid var(--c); padding: 14px 16px 16px; color: var(--ink); text-decoration: none; }
.scard:hover { background: var(--wash); color: var(--ink); }
.sname { font-weight: 500; }
.slab { display: block; font-size: var(--t-s); color: var(--muted); }
.snow { color: var(--ink-2); }
.sft { font-weight: 500; color: var(--green); }
.sgo { margin-top: auto; font-size: var(--t-s); font-weight: 500; }
.scard:hover .sgo { color: var(--green); }

/* the pop-up */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); overflow: auto; background: var(--surface); border-left: 1px solid var(--ink); padding: 20px 28px 48px; z-index: 40; box-shadow: -12px 0 30px rgba(0, 0, 0, .12); font-size: var(--t-body); line-height: 1.5; }
.drawer .x { position: sticky; top: 0; float: right; margin: -8px -14px 0 0; border: 0; background: var(--surface); font-size: var(--t-l); line-height: 1; color: var(--ink-2); width: 44px; height: 44px; z-index: 2; cursor: pointer; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .18); z-index: 39; }
.md-area { font-size: var(--t-s); font-weight: 500; }
.md h2 { font-size: var(--t-l); font-weight: 500; line-height: 1.25; margin: 4px 0 2px; }
.md-head { font-size: var(--t-l); font-weight: 500; line-height: 1.25; color: var(--green); margin: 0 0 6px; }
.md-work { color: var(--muted); margin: 0 0 16px; }
.md h3 { font-size: var(--t-body); font-weight: 500; margin: 28px 0 10px; padding-top: 14px; border-top: 1px solid var(--ink); }
.md-chips { display: flex; flex-wrap: wrap; gap: 8px; font-size: var(--t-s); }
.md-chips span { background: var(--bg); padding: 6px 10px; }
.md-chips b { font-weight: 500; }
.md table { width: 100%; border-collapse: collapse; }
.md th, .md td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); }
.md thead th { font-size: var(--t-s); font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--ink); }
.md tbody th { font-weight: 500; width: 28%; }
.md td.un { color: var(--green); font-weight: 500; }
.md .ev { margin: 0 0 16px; }
.md .ev-t { font-weight: 500; }
.md .ev-s { display: block; font-size: var(--t-s); color: var(--muted); margin-bottom: 10px; }
.md .ev-note { font-size: var(--t-s); color: var(--muted); margin-top: 8px; }
.md .stat b, .md .nofix b { color: var(--green); font-weight: 500; font-size: var(--t-l); margin-right: 6px; }
.md .nofix { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.md .nofix b { color: var(--ink); }
.md .sup, .ld .ref { font-size: .65em; vertical-align: super; line-height: 0; color: var(--green); font-weight: 500; margin-left: 1px; }

@media (max-width: 900px) {
  .scrolly { display: block; }
  .scrolly .graphic { height: 52vh; top: 100px; z-index: 1; background: var(--surface); }
  .scrolly .steps { position: relative; z-index: 2; padding: 4vh 0 30vh; }
  .scrolly .step { min-height: 74vh; align-items: flex-end; }
  .plot { width: 100%; }
}
@media (max-width: 600px) {
  .ex-funnel figcaption { margin: 0 -16px; padding: 10px 16px 8px; }
  .drawer { padding: 16px 16px 40px; }
  .md table, .md tbody, .md tr, .md th, .md td { display: block; width: auto; }
  .md thead { display: none; }
  .md tr { border-bottom: 1px solid var(--rule); padding: 8px 0; }
  .md th, .md td { border: 0; padding: 2px 0; }
  .md td::before { content: attr(data-label) ": "; color: var(--muted); font-size: var(--t-s); }
}
@media (prefers-reduced-motion: reduce) { svg.dots .dt { transition: none; } }
