/* Ordinary reading pages and a loose arrangement of threads on the homepage. */
:root {
  color-scheme: light;
  --background: #f6f3ee;
  --text: #47434a;
  --muted: #716b73;
  --link: #4e588b;
  --rule: #dcd7d4;
  background: var(--background);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

* { box-sizing: border-box; }
body { margin: 0; }
::selection { background: #dddde9; }
.page { max-width: 650px; margin: 54px auto 0; padding: 0 24px; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:visited { color: #746083; }
a:hover { color: #824b64; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  font: 12px/1.7 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
.site-name, .site-name:visited { color: var(--text); text-decoration: none; }
.site-name:hover { text-decoration: underline; }
nav { display: flex; gap: 21px; }
nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
main { padding-top: 34px; }
h1 { color: #484353; font-size: 29px; font-weight: 400; line-height: 1.35; letter-spacing: -.6px; margin: 0 0 26px; }
h2 { font-size: 18px; font-weight: 400; line-height: 1.45; margin: 32px 0 12px; }
p { margin: 0 0 19px; }
ul { margin: 0; padding-left: 20px; }
li { padding-left: 2px; margin-bottom: 5px; }
.description { color: var(--muted); font-size: 15px; }
.site-index { margin-top: 34px; }
.site-index h2 { margin-bottom: 11px; }
.small-note { color: var(--muted); font-size: 14px; }
.site-index .small-note { margin-top: 17px; }
.next-page { margin-top: 31px; font-size: 15px; }
.article-title { font-size: 35px; line-height: 1.25; margin-bottom: 10px; }
.article-back { font: 11px/1.7 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; margin-bottom: 24px; }
.article-subtitle { color: var(--muted); margin-bottom: 12px; }
.article-meta { color: var(--muted); font: 11px/1.7 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; margin-bottom: 31px; }
.article-body p { margin-bottom: 23px; }
.article-body sup { font-size: 10px; line-height: 0; }
.article-body sup a { text-decoration: none; padding: 0 2px; }
.article-body code { font-size: .85em; }
.article-body figure { margin: 32px 0; }
.article-body figure img, .article-body figure svg { display: block; max-width: 100%; height: auto; }
.article-body figcaption { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 10px; }
.sources { border-top: 1px solid var(--rule); margin-top: 34px; padding-top: 6px; }
.sources ol { padding-left: 24px; font-size: 13px; line-height: 1.6; }
.sources li { margin-bottom: 11px; overflow-wrap: anywhere; }
.sources .backref { text-decoration: none; margin-left: 5px; }
.post-list { list-style: none; padding: 0; }
.post-list li { margin: 0 0 28px; padding: 0; }
.post-list time { display: block; color: var(--muted); font: 11px/1.7 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; margin-top: 4px; }
.post-list p { margin: 5px 0 0; font-size: 15px; }
footer { display: flex; justify-content: space-between; gap: 18px; margin-top: 39px; padding: 16px 0 30px; border-top: 1px solid var(--rule); color: var(--muted); font: 10px/1.7 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.skip-link { position: absolute; top: -80px; left: 24px; padding: 6px 12px; background: var(--background); }
.skip-link:focus { top: 8px; }

.home-main { padding-top: 0; }
.home .skip-link { z-index: 10; }
.threads-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: var(--background);
  color: var(--text);
}
#thread-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y pinch-zoom;
  cursor: default;
  color: #514c50;
  user-select: none;
}
.threads-stage.near-thread #thread-art { cursor: grab; }
.threads-stage.is-pulling #thread-art { cursor: grabbing; }
.threads-stage.motion-paused #thread-art,
.threads-stage.motion-paused #thread-art:active { cursor: default; }
.thread-keepsakes {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
/* Small keepsakes lead to the interests they stand for. */
.thread-keepsake {
  position: absolute;
  display: block;
  left: clamp(46px, var(--charm-left), calc(100% - 46px));
  top: min(var(--charm-top), calc(100% - 200px));
  width: 64px;
  height: 64px;
  background-image: var(--charm-image, url('/assets/charms-atlas.png'));
  background-size: var(--charm-sheet, 300% 300%);
  background-position: var(--sprite-x) var(--sprite-y);
  background-repeat: no-repeat;
  transform: translate(calc(-1 * var(--anchor-x, 50%)), calc(-1 * var(--anchor-y, 8%))) rotate(var(--sway, 0deg));
  transform-origin: var(--anchor-x, 50%) var(--anchor-y, 8%);
  pointer-events: none;
  user-select: none;
}
.thread-keepsake[href] { pointer-events: auto; cursor: pointer; border-radius: 5px; }
.thread-keepsake[href]:hover, .thread-keepsake[href]:focus-visible { z-index: 3; }
.thread-keepsake[href]::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 5px;
  background: var(--background);
  color: var(--text);
  font: 10px/1.5 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.thread-keepsake[href]:hover::after, .thread-keepsake[href]:focus-visible::after { opacity: 1; }
#thread-globe::after, #thread-pen::after { left: 0; transform: none; }
#thread-books::after, #thread-rider::after { left: auto; right: 0; transform: none; }
.threads-stage .home-header {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  padding: 28px 40px;
  border: 0;
  font-size: 12px;
}
.home-header nav a { color: var(--text); text-decoration: none; }
.home-header nav a:hover { text-decoration: underline; }
.home-header .site-name, .home-header nav a { background: var(--background); box-shadow: 0 0 0 5px var(--background); }
.threads-caption {
  position: absolute;
  z-index: 2;
  bottom: 35px;
  left: 40px;
  max-width: calc(100% - 200px);
}
.threads-caption h1 { width: fit-content; font-size: 22px; line-height: 1.4; letter-spacing: -.3px; margin: 0 0 6px; background: var(--background); box-shadow: 0 0 0 5px var(--background); }
.threads-caption a { display: inline-block; color: var(--muted); font: 11px/1.8 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; text-decoration: none; background: var(--background); box-shadow: 0 0 0 4px var(--background); }
.threads-caption a:hover { text-decoration: underline; }
.threads-caption a span { display: inline-block; margin-left: 6px; }
.threads-controls {
  position: absolute;
  z-index: 2;
  right: 40px;
  bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--muted);
  font: 10px/1.8 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
.threads-stage:not(.is-ready) .threads-controls { visibility: hidden; }
.threads-controls button {
  margin: 0;
  padding: 3px 0;
  min-height: 25px;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.threads-controls button:hover { color: var(--text); }
.threads-controls button:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
.threads-controls button:disabled { cursor: default; text-decoration: none; }
.home-content { margin-top: 0; padding-top: 74px; }
#introduction { scroll-margin-top: 40px; }

@media (max-width: 600px) {
  .page { margin-top: 27px; padding: 0 23px; }
  header { gap: 16px; font-size: 11px; padding-bottom: 16px; }
  nav { gap: 17px; }
  main { padding-top: 29px; }
  h1 { font-size: 27px; margin-bottom: 24px; }
  .home-main { padding-top: 0; }
  .threads-stage { min-height: 420px; }
  .threads-stage .home-header { padding: 21px 22px; font-size: 11px; gap: 16px; }
  .threads-caption { left: 22px; bottom: 27px; max-width: calc(100% - 160px); }
  .threads-caption h1 { font-size: 18px; margin-bottom: 7px; }
  .threads-caption a { font-size: 10px; }
  .threads-controls { right: 22px; bottom: 25px; max-width: 110px; text-align: right; }
  .thread-keepsake { left: clamp(30px, var(--charm-left), calc(100% - 30px)); width: 40px; height: 40px; }
  .thread-keepsake { top: min(var(--charm-top), calc(100% - 160px)); }
  .home-content { margin-top: 0; padding-top: 49px; }
  #introduction { scroll-margin-top: 28px; }
  .article-title { font-size: 30px; margin-bottom: 10px; }
  footer { margin-top: 31px; }
}

@media (max-width: 360px) {
  .page { padding: 0 18px; }
  nav { gap: 13px; }
  .description { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  #thread-motion-hint { display: none; }
  #thread-art, #thread-art:active { cursor: default; }
}

@media print {
  :root { background: white; color: black; }
  .page { margin-top: 0; max-width: none; }
  nav, .skip-link { display: none; }
  .threads-stage { height: auto; min-height: 0; overflow: visible; background: none; }
  #thread-art, .thread-keepsakes, .threads-controls, .threads-caption a { display: none; }
  .threads-stage .home-header { position: static; padding: 0 0 22px; }
  .threads-caption { position: static; max-width: none; }
  .threads-caption h1 { font-size: 29px; }
  .home-content { padding-top: 24px; }
  footer { margin-top: 24px; }
}
