/* the paper: its name, where it comes from, the idea, then three facts and the telling's words */
.paper { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
h1 { font: 500 var(--t-h1)/1.1 var(--serif); letter-spacing: -.015em; text-wrap: balance; }
.phead { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
.cite { display: flex; flex-wrap: wrap; gap: 2px var(--s5); font: var(--t-sm)/1.5 var(--sans); color: var(--soft); }
.idea { font: var(--t-xl)/1.5 var(--serif); max-width: var(--measure); text-wrap: pretty; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--s4) var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); }
.facts div { display: grid; gap: var(--s1); align-content: start; }
.facts dd { font-size: var(--t-sm); line-height: 1.55; }
.words { display: grid; gap: var(--s2); }

/* a result's own page: its scenes, each with its point */
.start { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); justify-items: start; }
.toc { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.toc button { display: grid; grid-template-columns: var(--s5) minmax(0, 1fr); gap: 2px var(--s2); width: 100%; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.toc .n { grid-row: span 2; font: 500 var(--t-xs)/27px var(--mono); color: var(--soft); }
.toc .t { font: 500 var(--t-lg)/1.5 var(--serif); }
.toc .d { font-size: var(--t-sm); line-height: 1.5; color: var(--soft); max-width: var(--measure); }
.toc button:hover .t { text-decoration: underline; text-underline-offset: 3px; }

/* the scene */
.scene { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
#scene { scroll-margin-top: 64px; }      /* the sticky bar is 56px; a jump to the scene stops with its title just below it */
.oc { flex: none; }
/* the scene's head: the title with its switches at the far end, then the point and the cast */
.scene-head { display: grid; gap: var(--s3); min-width: 0; }
.stitle { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s5); }
.stitle h2 { flex: 1 1 auto; min-width: 0; }
h2 { font: 500 var(--t-h2)/1.15 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
/* the point: a standfirst under the title, larger than the text after it; its label is for screen readers only */
.point { font: var(--t-xl)/1.45 var(--serif); max-width: var(--measure); text-wrap: pretty; }
.point .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cast, .rule { font: var(--t-md)/1.55 var(--sans); color: var(--soft); max-width: var(--measure); }
.nd { display: inline-block; font: 600 .76em/1.3 var(--mono); font-style: normal; border: 1.2px solid currentColor; border-radius: 2px; padding: 0 3px; margin: 0 1px; vertical-align: .08em; }
/* what the scene is based on: the concept and its paper, as two labelled lines */
.basis { display: grid; gap: 2px; font: var(--t-sm)/1.5 var(--sans); }
.basis > div { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: var(--s2); align-items: baseline; }
.basis dd { max-width: var(--measure); } .basis dd:has(.arc) { max-width: none; }
.basis dd span { display: block; }
.basis cite { font-style: italic; }
/* the thread through a result's scenes: one phrase per scene with arrows between, this scene's in full ink, then where it all lands */
.arc { display: block; margin: 0; padding: 0; list-style: none; color: var(--soft); }
.arc li { display: inline; }
.arc li + li::before { content: "\2192"; margin: 0 .45em; }
.arc button { display: inline; font: inherit; color: inherit; text-align: left; }
.arc button:hover { text-decoration: underline; text-underline-offset: 3px; }
.arc button[aria-current] { color: var(--ink); font-weight: 600; }
.arc .fin { font-style: italic; }
/* what the scenes add up to */
.sum { display: grid; gap: var(--s3); width: 100%; }
.end .sum { margin-top: var(--s3); padding-top: var(--s4); border-top: 1px solid var(--line); }
.sum .label { font: 500 var(--t-xs)/1.35 var(--mono); }
.sum ul { display: grid; gap: var(--s2); margin: 0; padding: 0; list-style: none; max-width: var(--measure); }
.sum li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 0 var(--s2); align-items: baseline; }
.sum li button { justify-self: start; text-align: left; font: 500 var(--t-md)/1.45 var(--serif); }
.sum li button:hover { text-decoration: underline; text-underline-offset: 3px; }
.sum li span { grid-column: 2; font: var(--t-sm)/1.5 var(--sans); color: var(--soft); }
.sum .together { font: var(--t-lg)/1.5 var(--serif); max-width: var(--measure); text-wrap: pretty; }
.sum .together .label { display: block; margin-bottom: var(--s1); }
.ctl { display: flex; max-width: 100%; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; }
.btn.sm { padding: 9px 14px; font-size: var(--t-sm); font-weight: 500; border-width: 1px; border-color: var(--line); background: var(--room); }

/* the scene at a glance: one dot per step */
.strip { display: grid; gap: var(--s3); padding: var(--s4); background: var(--room); border-radius: 12px; }
.sgs { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); }
.sg { display: grid; gap: var(--s2); align-content: start; }
.dots { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0 9px; }
.sd { position: relative; flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; text-align: center; font: 600 var(--t-xs)/1 var(--mono); border: 1.5px solid var(--soft); color: var(--soft); }
.sd.t { border: 2px dotted var(--ink); color: var(--ink); }
.sd.p { background: var(--ink); border-color: var(--ink); color: var(--room); }
.sd.on { box-shadow: 0 0 0 2px var(--room), 0 0 0 4px var(--out); }
.sd.r::before, .sd.s::after { content: ""; position: absolute; top: 50%; width: 8px; height: 2px; margin-top: -1px; background: var(--ink); }
.sd.r::before { right: calc(100% + 2px); } .sd.s::after { left: calc(100% + 2px); }
button.sd:hover { outline: 2px solid var(--node); outline-offset: 2px; }
.skey { display: flex; flex-wrap: wrap; gap: 6px 18px; font: var(--t-xs)/1.4 var(--sans); color: var(--soft); }
.skey span { display: inline-flex; align-items: center; gap: 7px; }
.skey .sd { width: 12px; height: 12px; }
.skey .sd.r { margin-left: 10px; } .skey .sd.s { margin-right: 10px; }
@media (prefers-reduced-motion: no-preference) { .core.hit { animation: hit 1.4s ease; } @keyframes hit { from { background: var(--node-wash); } } }

/* two scenes side by side */
.cmp { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--s5); align-items: start; }
.col { display: grid; gap: var(--s3); min-width: 0; align-content: start; }
.col h3 { font: 500 var(--t-xl)/1.2 var(--serif); display: flex; gap: var(--s2); align-items: center; }
.col .point { font-size: var(--t-md); }
.cmpnote { font: var(--t-lg)/1.5 var(--serif); max-width: var(--measure); }
.dv { display: inline-block; margin-bottom: var(--s2); font: 600 var(--t-xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border-radius: 3px; background: var(--ink); color: var(--room); }
.tlw { container-type: inline-size; min-width: 0; }

/* the map */
.map { display: grid; gap: var(--s6); }
.map .intro, .map .sect { display: grid; gap: var(--s4); justify-items: start; }
.map .intro { gap: var(--s5); }
.map .sect > * { width: 100%; }
.mapbox { overflow-x: auto; background: var(--room); border-radius: 12px; padding: var(--s4); }
.mapbox svg { display: block; width: 100%; min-width: 680px; height: auto; }
.mn { cursor: pointer; }
.mn rect { fill: var(--ground); stroke: var(--line); stroke-width: 1.5; }
.mn:hover rect, .mn:focus-visible rect { fill: var(--node-wash); stroke: var(--node); }
.mn .n1 { font: 600 17px var(--serif); fill: var(--ink); } .mn .n2 { font: 13px var(--mono); fill: var(--soft); }
.me { stroke: var(--soft); stroke-width: 1.5; fill: none; } .mh { fill: var(--soft); }
.ml { font: 14px var(--sans); fill: var(--soft); }

/* the introduction: running text in the narrating serif, under the map's own section frame */
.about .sect { gap: var(--s3); }
.about .sect h2 { font: 500 var(--t-h2)/1.2 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.about .sect > p:not(.label), .about .guide, .about .fork p:not(.label) { font: var(--t-lg)/1.6 var(--serif); max-width: var(--measure); text-wrap: pretty; }
.about .customs { margin-block: var(--s2); padding: var(--s4); background: var(--room); border-radius: 12px; }
.about .ctl { display: flex; flex-wrap: wrap; gap: var(--s3); }
.about a { color: var(--node); text-decoration: underline; text-underline-offset: 3px; }
.about a:hover { color: var(--ink); }
.about cite { font-style: italic; }
.about .hero { width: 100%; display: grid; gap: var(--s2); }
.about .hero img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--room); }
.about .hero figcaption { font: var(--t-sm)/1.5 var(--sans); color: var(--soft); }
.about .guide { margin: 0; padding-left: 1.4em; display: grid; gap: var(--s3); }
.about .guide b { font-weight: 500; }
.about .sys { max-width: var(--measure); }
.about .fork { display: grid; gap: var(--s3); padding: var(--s5); border: 1.5px dashed var(--line); border-radius: 12px; }
/* the drawer's last entry: the tool that works across results */
.more { display: grid; gap: 1px; }
.more > .label { padding: 0 var(--s2) var(--s2); }

.about .skins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-block: var(--s2); }
.about .skins figure { margin: 0; display: grid; gap: var(--s1); align-content: start; }
.about .skins img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--room); }
.about .skins figcaption { font: var(--t-sm)/1.4 var(--sans); color: var(--soft); }
/* the link to the repository: in the drawer, and at the foot of the introduction */
.more > .label ~ .label { margin-top: var(--s4); }
.pl.ext { color: inherit; text-decoration: none; }
.about .src { font: var(--t-sm)/1.6 var(--sans); color: var(--soft); max-width: var(--measure); }
/* four cards go two by two, never three and an orphan */
.customs:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
