/* Threads, questions and the shelf: the deeper pages. Used standalone and inside the story's sheet. */

.thread-article {
  --ink: #1b2430; --ink-soft: #4a5866; --red: #d2402a; --paper: #efe8d8; --sea: #6f8996;
  position: relative; max-width: 640px; margin: 0 auto; padding: 8px 28px 64px 52px;
  font-family: "Fraunces", Georgia, serif; font-size: 1.08rem; line-height: 1.62; color: var(--ink);
  font-variation-settings: "SOFT" 50;
}
/* the red thread, stitched down the margin */
.thread-article::before {
  content: ""; position: absolute; left: 22px; top: 0; bottom: 0; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--red) 0 9px, transparent 9px 15px);
  opacity: .75;
}
.thread-kicker { margin: 0 0 12px; font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.thread-article h1 { margin: 0 0 .25em; font-weight: 400; font-size: clamp(2.1rem, 5vw, 3.1rem); line-height: 1.02; letter-spacing: -.01em; font-variation-settings: "SOFT" 100, "WONK" 1; }
.thread-dek { margin: 0 0 1.6em; font-style: italic; font-size: 1.25rem; line-height: 1.35; color: var(--ink-soft); }
.thread-article h2 { margin: 2em 0 .5em; font-weight: 500; font-size: 1.45rem; line-height: 1.15; }
.thread-article h2 .when { display: block; margin-bottom: .3em; font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.thread-article p { margin: 0 0 1em; }
.thread-article a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; }
.thread-article a:hover { color: var(--red); }
.thread-article .hand { font-family: "Caveat", cursive; font-size: 1.5em; line-height: 1.1; color: var(--red); }

/* a big fact, drawn like a label on the map */
.fact { margin: 1.6em 0; padding: 14px 0 14px 18px; border-left: 2px solid var(--ink); }
.fact b { display: block; font-weight: 300; font-size: clamp(2.4rem, 6vw, 3.4rem); line-height: 1; letter-spacing: -.02em; }
.fact span { display: block; margin-top: .35em; font-family: "Caveat", cursive; font-size: 1.45rem; line-height: 1.1; color: var(--ink-soft); }

/* sidenotes: in the margin on wide screens, inline slips on narrow ones */
.side { display: block; margin: .2em 0 1.1em; padding: 10px 14px; background: rgba(255, 255, 255, .35); border-left: 2px solid var(--red); font-family: "Caveat", cursive; font-size: 1.3rem; line-height: 1.15; color: var(--ink-soft); transform: rotate(-.6deg); }
.side a { color: inherit; }

.thread-article blockquote { margin: 1.4em 0; padding: 0; font-style: italic; font-size: 1.35rem; line-height: 1.3; }
.thread-article blockquote footer { margin-top: .4em; font-style: normal; font-family: "Caveat", cursive; font-size: 1.25rem; color: var(--red); }

/* numbered sources, like footnotes in a field notebook */
.refs { margin: 2.6em 0 0; padding: 18px 0 0; border-top: 1px dashed rgba(27, 36, 48, .35); font-family: "IBM Plex Mono", monospace; font-size: 12px; line-height: 1.55; color: var(--ink-soft); }
.refs h2 { margin: 0 0 .8em; font-family: inherit; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.refs ol { margin: 0; padding-left: 1.6em; }
.refs li { margin-bottom: .5em; }
.refs a { color: var(--ink-soft); }
sup.ref a { font-family: "IBM Plex Mono", monospace; font-size: .62em; color: var(--red); text-decoration: none; padding: 0 1px; }

/* questions: each one a card you can open */
.qa { margin: 0; padding: 0; list-style: none; }
.qa details { margin: 0 0 10px; padding: 14px 16px; border: 1.5px solid var(--ink); border-radius: 3px 6px 4px 5px; background: rgba(255, 255, 255, .25); }
.qa details[open] { background: rgba(255, 255, 255, .5); }
.qa summary { cursor: pointer; list-style: none; font-weight: 500; font-size: 1.12rem; line-height: 1.3; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; float: right; margin-left: 12px; font-family: "Caveat", cursive; font-size: 1.6rem; line-height: .8; color: var(--red); transition: transform .25s; }
.qa details[open] summary::after { transform: rotate(45deg); }
.qa details > div { margin-top: .7em; }
.qa details > div p:last-child { margin-bottom: 0; }

/* the shelf: sources as book spines */
.shelf { display: flex; align-items: flex-end; gap: 4px; margin: 1.6em 0 0; padding: 0 6px; min-height: 240px; border-bottom: 6px solid var(--ink); overflow-x: auto; overflow-y: hidden; }
.spine {
  flex: 0 0 auto; position: relative; width: var(--w, 38px); height: var(--h, 200px); padding: 10px 0; border: 1.5px solid var(--ink); border-bottom: 0;
  border-radius: 3px 3px 0 0; background: var(--c, #e6dcc6); cursor: pointer; transition: transform .25s cubic-bezier(.3, .8, .3, 1.3);
  writing-mode: vertical-rl; transform-origin: bottom center; font: inherit; color: var(--ink);
}
.spine span { display: block; margin: 0 auto; max-height: calc(var(--h, 200px) - 26px); overflow: hidden; font-family: "IBM Plex Mono", monospace; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2; }
.spine:hover, .spine:focus-visible, .spine[aria-expanded="true"] { transform: translateY(-14px) rotate(-1.5deg); outline: none; }
.spine[aria-expanded="true"] { background: var(--red); color: var(--paper); border-color: var(--red); }
.spine-card { margin: 16px 0 0; padding: 16px 18px; border: 1.5px solid var(--ink); background: rgba(255, 255, 255, .45); min-height: 5em; }
.spine-card h3 { margin: 0 0 .3em; font-weight: 500; font-size: 1.15rem; line-height: 1.2; }
.spine-card p { margin: 0 0 .5em; font-size: .98rem; }
.spine-card .meta { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .05em; color: var(--ink-soft); }

/* more threads, and the way back */
.thread-more { margin: 2.8em 0 0; }
.thread-more h2 { font-family: "IBM Plex Mono", monospace; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; }
.thread-more ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.thread-more a { display: block; padding: 10px 14px; border: 1.5px dashed rgba(27, 36, 48, .45); text-decoration: none; transition: border-color .2s, transform .2s; }
.thread-more a:hover { border-color: var(--red); transform: translateX(4px); }
.thread-more a b { display: block; font-weight: 500; }
.thread-more a span { font-size: .92rem; color: var(--ink-soft); }
.thread-back { display: inline-block; margin-top: 2.2em; font-family: "Caveat", cursive; font-size: 1.7rem; color: var(--red) !important; text-decoration: none !important; }

/* ── standalone pages ── */
.page { margin: 0; min-height: 100vh; background: var(--paper, #efe8d8); color: #1b2430; }
.page { --paper: #efe8d8; }
.page-head {
  position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 12px 20px; background: linear-gradient(var(--paper) 75%, rgba(239, 232, 216, 0));
  font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .08em; color: #4a5866;
}
.page-head .t-big { text-align: left; } .page-head .t-little { text-align: right; }
.page-head b { color: #1b2430; font-weight: 500; }
.page-home { font-family: "Fraunces", Georgia, serif; font-size: 15px; letter-spacing: 0; color: #1b2430; text-decoration: none; text-align: center; }
.page-home i { display: block; font-family: "Caveat", cursive; font-style: normal; font-size: 15px; color: #d2402a; }
.page-line { position: fixed; top: 0; bottom: 0; left: 50%; width: 0; border-left: 2px dotted rgba(210, 64, 42, .35); pointer-events: none; z-index: 0; }
.page main { position: relative; z-index: 1; padding: 4vh 0 0; }
.page .thread-article { background: var(--paper); box-shadow: 0 0 0 40px var(--paper); }
.page-foot { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 20px 28px 60px 52px; font-family: "IBM Plex Mono", monospace; font-size: 11px; line-height: 1.6; color: #4a5866; }
.page-foot a { color: inherit; }
.crumbs { margin: 0 0 18px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .06em; color: #4a5866; }
.crumbs li + li::before { content: "→ "; color: #d2402a; }
.crumbs a { color: inherit; }
.begin { display: block; margin: 2.4em 0 0; padding: 20px 22px; border: 2px solid #1b2430; text-decoration: none; color: #1b2430; background: rgba(255, 255, 255, .4); transition: transform .25s; }
.begin:hover { transform: rotate(-.6deg) translateY(-2px); }
.begin b { display: block; font-weight: 400; font-size: 1.6rem; line-height: 1.1; }
.begin span { font-family: "Caveat", cursive; font-size: 1.35rem; color: #d2402a; }
@media (max-width: 600px) {
  .thread-article { padding: 4px 18px 48px 40px; }
  .thread-article::before { left: 16px; }
  .page-head { grid-template-columns: 1fr 1fr; } .page-home { grid-column: 1 / -1; grid-row: 1; }
  .page-foot { padding-left: 40px; }
}
