/* Home page: one line, one thread. Loads after tokens.css and site.css. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.home { min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1100px 600px at 80% -10%, rgba(244, 227, 181, 0.07), transparent 60%), var(--bg); }
.thread-main { flex: 1; width: min(100% - 2.5rem, 1120px); margin: 0 auto; padding: clamp(3rem, 10vh, 7rem) 0 3rem; }
.thread-title { font: 500 clamp(2.1rem, 5.5vw, 3.8rem)/1.1 var(--serif); color: var(--ink); margin: 0; letter-spacing: -0.01em; }
.thread-sub { color: var(--muted); margin: 0.9rem 0 0; max-width: 56ch; }
.thread { margin-top: clamp(2.5rem, 8vh, 5rem); }
.thread-hint { color: var(--muted); font-size: 0.92rem; margin: 0 0 1.25rem; }

/* No-JS view: a quiet vertical thread with every knot shown. */
.knots { list-style: none; margin: 0; padding: 0 0 0 1.6rem; border-left: 2px solid rgba(95, 211, 160, 0.55); }
.knot { position: relative; margin: 0 0 1rem; }
.knot::before { content: ""; position: absolute; left: calc(-1.6rem - 7px); top: 0.35rem; width: 12px; height: 12px; border-radius: 50%;
  background: var(--vine); box-shadow: 0 0 0 4px var(--bg), 0 0 14px rgba(95, 211, 160, 0.5); }
.knot a { color: var(--ink); text-decoration: none; }
.knot a:hover .k-line, .knot a:focus-visible .k-line { text-decoration: underline; text-underline-offset: 3px; }
.k-year { display: inline-block; min-width: 3.2rem; font: 600 0.85rem var(--mono); color: var(--human); }
.knot.untied::before { background: transparent; border: 2px solid var(--human); box-shadow: 0 0 0 4px var(--bg); }
.thread-more { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 3rem; font-size: 0.92rem; }
.thread-more a { color: var(--muted); }
.thread-more a:hover { color: var(--ink); }

/* With JS: a thread you pull. */
.js .thread-hint::after { content: " Drag the bright end, or use the arrow keys."; }
.js .stage { position: relative; height: 13rem; --pull: 2%; touch-action: pan-y; }
.js .strand { position: absolute; left: 0; right: 0; top: 50%; height: 2px; }
.js .strand-pulled { position: absolute; left: 0; top: 0; height: 2px; width: var(--pull); border-radius: 2px;
  background: linear-gradient(90deg, rgba(95, 211, 160, 0.15), var(--vine) 40%, var(--human));
  box-shadow: 0 0 12px rgba(244, 227, 181, 0.35); }
.js .knots { position: absolute; inset: 0; padding: 0; border: 0; }
.js .knot { position: absolute; left: var(--at); top: 50%; margin: 0; width: 0; height: 0; visibility: hidden; opacity: 0;
  transition: opacity var(--cu-duration-base) var(--cu-ease); }
.js .knot.tied { visibility: visible; opacity: 1; }
.js .knot::before { left: -8px; top: -8px; width: 16px; height: 16px; }
.js .knot a { position: absolute; left: -1.4rem; top: -1.4rem; width: 2.8rem; height: 2.8rem; border-radius: 50%; }
.js .knot a:focus-visible { outline: 2px solid var(--human); outline-offset: 2px; }
.js .knot .k-line { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js .knot .k-year { position: absolute; left: 50%; transform: translateX(-50%); min-width: 0; top: -1.6rem; color: var(--muted); }
.js .knot:nth-child(even) .k-year { top: 3rem; }
.js .knot.tied:hover .k-year, .js .knot a:focus-visible .k-year { color: var(--human); }
.js .knot.untied { transition-duration: 900ms; }
.js .knot.untied .k-year { color: var(--human); opacity: 0; transition: opacity var(--cu-duration-base) var(--cu-ease); }
.js .knot.untied:hover .k-year, .js .knot.untied a:focus-visible .k-year { opacity: 1; }
.js .past-now .strand-pulled { background: linear-gradient(90deg, rgba(95, 211, 160, 0.15), var(--vine) 40%, var(--human) 88%, rgba(244, 227, 181, 0.2)); }

.pull { position: absolute; top: 50%; left: var(--pull); transform: translate(0.9rem, -50%); z-index: 2;
  height: 2.6rem; padding: 0 1rem; border-radius: 999px; border: 1px solid rgba(244, 227, 181, 0.6);
  background: radial-gradient(circle at 30% 30%, #243a2f, #0e2019); color: var(--human); font: 600 0.82rem var(--mono);
  cursor: grab; touch-action: none; box-shadow: 0 0 18px rgba(244, 227, 181, 0.25), 0 8px 20px -10px #000; }
.pull:active { cursor: grabbing; }
.pull:focus-visible { outline: 2px solid var(--human); outline-offset: 3px; }
.pull::after { content: " \2192"; }
.past-now .pull { opacity: 0.55; }

.caption { min-height: 4.5rem; margin: 1rem 0 0; display: grid; gap: 0.3rem; max-width: 60ch; }
.c-year { font: 600 0.85rem var(--mono); color: var(--human); }
.c-line { font: 400 clamp(1.1rem, 2.2vw, 1.35rem)/1.4 var(--serif); color: var(--ink); }
.c-go { font-size: 0.9rem; color: var(--vine); justify-self: start; }

/* Phones: the thread runs down the page and each knot keeps its line beside it. */
.js .stage.vertical { height: 62rem; }
.js .vertical .strand { left: 1rem; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
.js .vertical .strand-pulled { width: 2px; height: var(--pull); background: linear-gradient(180deg, rgba(95, 211, 160, 0.15), var(--vine) 40%, var(--human)); }
.js .vertical .knot { left: 1rem; top: var(--at); }
.js .vertical .knot a { width: calc(100vw - 5rem); height: auto; min-height: 2.6rem; left: -1.3rem; top: -0.8rem; border-radius: 8px; padding-left: 2.9rem; }
.js .vertical .knot .k-year, .js .vertical .knot:nth-child(even) .k-year { position: static; transform: none; display: block; color: var(--human); }
.js .vertical .knot .k-line { position: static; width: auto; height: auto; clip: auto; white-space: normal; font-size: 0.92rem; color: var(--ink); }
.js .vertical .knot.untied .k-year { opacity: 0; }
.js .vertical .pull { left: 1rem; top: var(--pull); transform: translate(-50%, 1.4rem); width: 1.8rem; height: 1.8rem; padding: 0; font-size: 0; }
.js .vertical .pull::after { content: "\2193"; font-size: 1rem; }
.js .vertical ~ .caption { display: none; }

/* Reduced motion: no animation, the whole thread is shown. */
@media (prefers-reduced-motion: reduce) {
  .js .knot, .js .knot .k-year, .pull { transition: none; }
  .js .still .pull { display: none; }
}
