@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Source+Serif+4:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap');

:root {
  --bg: #fefefe;
  --text: #1a1a1a;
  --text-light: #4a4a4a;
  --text-muted: #8a8a8a;
  --accent: #1a1a1a;
  --border: #e8e8e8;
  --hover: #f5f5f5;
  --selection: #f0f0f0;
  --link-underline-thickness: 0.75px;
  --content-column-max: 640px;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  --code-bg: #ececec;
  --code-inline-size: 0.9em;
  --code-block-size: 13px;
  --trace-log-link: #3f6f3a;
  --trace-log-link-hover: #325c2e;
  --trace-log-paper: var(--bg);
  --paper-dot: rgba(67, 77, 69, 0.13);
  --paper-dot-radius: 0.72px;
  --paper-dot-fade-radius: 0.9px;
  --paper-dot-spacing: 18px;
  --paper-dot-offset: 9px;
  --trace-log-dot: var(--paper-dot);
  --corner-shadow-width: clamp(180px, 28vw, 380px);
  --corner-shadow-opacity: 0.5;
  --corner-shadow-width-scroll: clamp(170px, 26vw, 340px);
  --corner-shadow-opacity-scroll: 0.48;
  --corner-shadow-vertical-bleed: clamp(42px, 5vw, 78px);
  --corner-shadow-side-bleed: clamp(10px, 1.6vw, 18px);
  --corner-shadow-edge-overscan: 0px;
  /* Trace log body + site nav (same scale at each breakpoint) */
  --site-nav-reading-size: 15px;
}

@media (max-width: 768px) {
  :root {
    --site-nav-reading-size: 16px;
  }
}

@media (max-width: 420px) {
  :root {
    --site-nav-reading-size: 15px;
  }
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--selection);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 1.45;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  background-color: var(--trace-log-paper);
  background-image: radial-gradient(circle at center, var(--trace-log-dot) var(--paper-dot-radius), transparent var(--paper-dot-fade-radius));
  background-size: var(--paper-dot-spacing) var(--paper-dot-spacing);
  background-position: var(--paper-dot-offset) var(--paper-dot-offset);
}

body.page-all::before,
body.page-all::after,
body.page-episode::after,
body.page-equilibrium::after,
body.page-trace-logs::after,
body.page-private-trace-logs::after {
  content: '';
  position: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 0;
}

body.page-all::before {
  width: calc(var(--corner-shadow-width) + var(--corner-shadow-vertical-bleed) + var(--corner-shadow-edge-overscan));
  aspect-ratio: 640 / 800;
  opacity: var(--corner-shadow-opacity);
  top: calc(-1 * (var(--corner-shadow-vertical-bleed) + var(--corner-shadow-edge-overscan)));
  left: calc(-1 * var(--corner-shadow-side-bleed));
  background-image: url('assets/backgrounds/site/shadow-top-left-sitebg.png');
  background-image: image-set(
    url('assets/backgrounds/site/shadow-top-left-sitebg.webp') type('image/webp') 1x,
    url('assets/backgrounds/site/shadow-top-left-sitebg.png') type('image/png') 1x
  );
}

body.page-all::after {
  width: calc(var(--corner-shadow-width) + var(--corner-shadow-vertical-bleed) + var(--corner-shadow-edge-overscan));
  aspect-ratio: 640 / 840;
  opacity: var(--corner-shadow-opacity);
  right: calc(-1 * var(--corner-shadow-side-bleed));
  bottom: calc(-1 * (var(--corner-shadow-vertical-bleed) + var(--corner-shadow-edge-overscan)));
  background-image: url('assets/backgrounds/site/shadow-bottom-right-sitebg.png');
  background-image: image-set(
    url('assets/backgrounds/site/shadow-bottom-right-sitebg.webp') type('image/webp') 1x,
    url('assets/backgrounds/site/shadow-bottom-right-sitebg.png') type('image/png') 1x
  );
}

body.page-episode::after {
  width: calc(var(--corner-shadow-width-scroll) + var(--corner-shadow-vertical-bleed) + var(--corner-shadow-edge-overscan));
  aspect-ratio: 500 / 740;
  opacity: var(--corner-shadow-opacity-scroll);
  top: calc(-1 * (var(--corner-shadow-vertical-bleed) + var(--corner-shadow-edge-overscan)));
  right: calc(-1 * var(--corner-shadow-side-bleed));
  background-image: url('assets/backgrounds/site/shadow-top-right-sitebg.png');
  background-image: image-set(
    url('assets/backgrounds/site/shadow-top-right-sitebg.webp') type('image/webp') 1x,
    url('assets/backgrounds/site/shadow-top-right-sitebg.png') type('image/png') 1x
  );
}

body.page-equilibrium::after,
body.page-trace-logs::after,
body.page-private-trace-logs::after {
  width: calc(var(--corner-shadow-width-scroll) + var(--corner-shadow-vertical-bleed) + var(--corner-shadow-edge-overscan));
  aspect-ratio: 600 / 800;
  opacity: var(--corner-shadow-opacity-scroll);
  left: calc(-1 * var(--corner-shadow-side-bleed));
  bottom: calc(-1 * (var(--corner-shadow-vertical-bleed) + var(--corner-shadow-edge-overscan)));
  background-image: url('assets/backgrounds/site/shadow-bottom-left-sitebg.png');
  background-image: image-set(
    url('assets/backgrounds/site/shadow-bottom-left-sitebg.webp') type('image/webp') 1x,
    url('assets/backgrounds/site/shadow-bottom-left-sitebg.png') type('image/png') 1x
  );
}

.site-header,
main.container {
  position: relative;
  z-index: 1;
}

@media (max-width: 700px) {
  body.page-all::before,
  body.page-all::after,
  body.page-episode::after,
  body.page-equilibrium::after,
  body.page-trace-logs::after,
  body.page-private-trace-logs::after {
    content: none;
  }
}

.container {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
}

main.container {
  padding-top: 40px;
  padding-bottom: 44px;
}

/* Slightly tighter main padding when global site header is present */
body:has(> .site-header) > main.container {
  padding-top: 28px;
}

/* Individual entry/poem pages: extra space below header before title */
body:has(> .site-header) > main.container > article.all-entry:first-child {
  margin-top: 20px;
}

/* Header */
.site-header {
  padding: 44px 0 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.site-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.2;
  text-align: center;
  text-transform: lowercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.site-title-brace {
  display: inline-flex;
  flex-shrink: 0;
}

.site-title-brace svg {
  height: 1.1em;
  width: auto;
}

.site-title a,
.site-title-home {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
}

.site-title-home:hover {
  opacity: 0.88;
}

.site-nav {
  margin-top: 12px;
  font-family: var(--font-sans);
  font-size: var(--site-nav-reading-size);
  font-weight: 300;
  text-align: center;
  color: var(--text-light);
}

.site-nav-link {
  color: var(--text-light);
  text-decoration: none;
  border-bottom: none;
}

.site-nav-link:hover {
  color: var(--text);
}

.site-nav-current {
  color: var(--text);
  font-weight: 300;
  padding: 0 0.06em 0.02em;
  margin: 0 -0.06em;
  background-image: linear-gradient(
    to bottom,
    transparent 0,
    transparent 48%,
    color-mix(in srgb, var(--selection) 72%, var(--text-muted) 14%) 48%,
    color-mix(in srgb, var(--selection) 72%, var(--text-muted) 14%) 76%,
    transparent 76%,
    transparent 100%
  );
  background-size: 100% 1.18em;
  background-position: 0 0.15em;
  background-repeat: no-repeat;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.site-nav-sep {
  margin: 0 0.4em;
}

.site-nav-number {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text-muted);
  letter-spacing: 0;
}

.back-link {
  color: var(--text-light);
  font-size: 0.9em;
  font-weight: 300;
  text-decoration: none;
  border-bottom: none;
}

.back-link:hover {
  color: var(--text);
}

.site-subtitle {
  margin: 12px 0 32px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-style: normal;
  text-align: center;
}

.site-subtitle a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-subtitle a:hover {
  color: var(--text-light);
  border-bottom-color: var(--text-muted);
}

/* Article Pages */
.article {
  max-width: 640px;
  margin: 0 auto;
}

.article h1,
.article-title {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--text);
}

.article .meta {
  color: var(--text-muted);
  margin: 0 0 36px;
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.article-location {
  color: var(--text-light);
  margin: 0.85em 0 0;
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.3px;
}

.location-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  margin-top: -2.5px;
  color: var(--text-muted);
  opacity: 0.6;
  vertical-align: middle;
}

.location-icon svg {
  display: block;
}

/* Front index list layout (align with article column width) */
.front-index {
  max-width: var(--content-column-max);
  margin-left: auto;
  margin-right: auto;
}

.front-index-divider {
  margin: 0 0 28px;
  color: var(--text-light);
  font-size: 20px;
  line-height: 1;
}

.front-index-section {
  margin: 0 0 30px;
}

/* Shared section label (index categories, scroll TOC, etc.) */
.section-label,
.front-index-heading {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.front-index-subheading {
  margin: 0 0 8px;
  color: var(--text-light);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
}

.front-index-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.front-index-list li {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.2;
}

.front-index-list a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.front-index-list a:hover {
  color: var(--text-light);
  opacity: 0.92;
}

.front-index-unlinked {
  color: var(--text);
}

.front-index-unlinked::after,
.front-index-private-dot {
  content: '';
  display: inline-block;
  width: 0.35em;
  height: 0.35em;
  border: 0.75px solid var(--text-muted);
  border-radius: 50%;
}

.front-index-unlinked::after {
  margin-left: 0.45em;
  vertical-align: 0.04em;
  opacity: 0.72;
}

.front-index-private-key {
  margin-left: 0.8em;
  color: var(--text-muted);
}

.front-index-private-dot {
  margin-right: 0.32em;
  vertical-align: 0.02em;
}

.front-index-archive-list li {
  font-size: 17px;
}

.front-index-archive-number {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-weight: 300;
  letter-spacing: 0;
  margin-right: 0.35em;
}

/* Continuous scroll page (all entries) */
.all-entries {
  padding-bottom: 2em;
}

.private-entry-status {
  margin-left: 0.65em;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.58em;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  vertical-align: middle;
}

.all-toc-list .private-entry-status {
  font-size: 0.72em;
}

.all-toc-list .all-toc-private,
.all-entry-redacted .all-entry-title {
  color: var(--text-muted);
}

.redacted-copy {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82em;
  letter-spacing: 0.02em;
}

.all-toc {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

body.page-episode .all-toc,
body.page-equilibrium .all-toc,
body.page-prose .all-toc {
  margin-bottom: 96px;
  padding-bottom: 0;
  border-bottom: none;
}

.all-toc-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.all-toc-title {
  color: var(--text);
  margin-bottom: 0;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
}

.all-toc-title::after {
  content: '';
  display: block;
  width: min(260px, 58vw);
  height: 1px;
  margin-top: 12px;
  background: var(--text);
  opacity: 0.72;
}

.all-toc-meta {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  text-align: right;
  white-space: nowrap;
}

.all-toc-meta a {
  color: var(--text-light);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s ease;
}

.all-toc-meta a:hover {
  color: var(--text);
}

.all-toc-meta-sep {
  color: var(--text-muted);
  margin: 0 0.35em;
}

.all-toc-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 18px;
  line-height: 1.42;
  color: var(--text);
}

.all-toc-list a {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.all-toc-list a:hover {
  color: var(--text-light);
  opacity: 0.92;
}

.all-toc-sectioned {
  column-count: 1;
  font-size: 16px;
}

.all-toc-section-item {
  break-inside: avoid;
  margin: 0 0 24px;
  page-break-inside: avoid;
}

.all-toc-section-item:last-child {
  margin-bottom: 0;
}

.all-toc-section-link {
  display: inline-block;
  margin-bottom: 5px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text);
}

.all-section-number {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.86em;
  letter-spacing: 0;
}

.all-toc-sublist {
  margin: 0;
  padding-left: 28px;
  list-style: none;
}

.all-toc-sublist li {
  margin-bottom: 2px;
}

.all-entry-group {
  margin-bottom: 88px;
  scroll-margin-top: 24px;
}

.all-entry-group + .all-entry-group {
  margin-top: 74px;
  padding-top: 50px;
  border-top: 1px solid var(--border);
}

.all-entry-group-title {
  margin: 0 0 42px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
}

.all-entry-group-title::after {
  content: '';
  display: block;
  width: min(260px, 58%);
  height: 1px;
  margin-top: 12px;
  background: var(--text);
  opacity: 0.72;
}

.all-entries p.copy-break-after-toc {
  margin: 0;
  padding: 0;
  line-height: 0;
  font-size: 0;
}

.all-entries .aside-note {
  display: none;
}

.all-entry {
  margin-bottom: 48px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 20px;
}

.all-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Entry page only: less space above "Back to all entries" so it matches space below */
main.container article.all-entry:only-of-type {
  margin-bottom: 1em;
  padding-bottom: 1.4em;
}

.back-link-block {
  margin-top: 0.6em;
  margin-bottom: 0.6em;
}

.all-entry-title {
  font-size: 26px;
  font-weight: 300;
  margin-bottom: 28px;
  letter-spacing: -0.3px;
}

.all-entry-title a {
  color: var(--text);
  text-decoration: none;
  border-bottom: none;
}

.all-entry-title a:hover {
  text-decoration: none;
}

/* Back to top (all page only) */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  z-index: 10;
  text-decoration: none;
}

.back-to-top:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.article .content {
  padding-top: 0;
  padding-bottom: 16px;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 300;
  color: var(--text);
}

.article .content strong,
.article .content b {
  font-weight: 500;
}

.article .content p {
  margin: 0 0 0.8em;
}

/* Paragraph + br for copy-paste: adds line break between title and poem when pasted as plain text */
.article .content p.copy-break {
  margin: 0 0 0.35em 0;
  padding: 0;
  line-height: 0;
  font-size: 0;
}

/* Line break after each poem (for copy-paste) */
.article .content p.copy-break-after-poem {
  margin: 0;
  padding: 0;
  line-height: 0;
  font-size: 0;
}

.article .content .text-right {
  display: block;
  text-align: right;
  padding-right: 50%;
}

.article .content .line-with-right {
  display: block;
  text-align: left;
  padding-right: 50%;
}

.article .content .text-right-inline {
  float: right;
}

.article .content section {
  margin: 0;
}

/* Related poems (frontmatter related:); below poem, above location */
.entry-related {
  margin-top: 1.35em;
  padding-top: 1.25em;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: var(--site-nav-reading-size, 15px);
  font-weight: 300;
  line-height: 1.45;
  color: var(--text);
}

.entry-related-title {
  margin: 0 0 0.65em;
}

.entry-related-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.entry-related-list li {
  margin: 0 0 0.35em;
}

.entry-related-list a {
  color: var(--text);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.entry-related-list a:hover {
  color: var(--text-light);
  opacity: 0.92;
}

/* Entry page: collapsible trace logs section (closed by default) */
.entry-trace-logs {
  margin-top: 1.35em;
  padding-top: 1.1em;
  border-top: 1px solid var(--border);
}

.entry-trace-logs-summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.entry-trace-logs-summary::-webkit-details-marker,
.entry-trace-logs-summary::marker {
  display: none;
}

.entry-trace-logs-summary::before {
  content: '▸';
  display: inline-flex;
  align-items: center;
  margin-right: 0.52em;
  font-size: 0.74em;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.entry-trace-logs[open] .entry-trace-logs-summary::before {
  transform: rotate(90deg);
}

.entry-trace-logs .entry-thread {
  margin-top: 0.8em;
  padding-top: 0;
  border-top: none;
}

/* Entry thread: dated notes (entry pages only, when not empty); sans like comment UI */
.entry-thread {
  margin-top: 1.35em;
  padding-top: 1.25em;
  border-top: 1px solid var(--border);
  scroll-margin-top: 0.85em;
  position: relative;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--text-muted);
}

.thread-title {
  margin: 0 0 0.9em;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.thread-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.article.trace-logs .thread-list {
  font-family: var(--font-sans);
}

.thread-title,
.thread-filter-panel {
  position: relative;
  z-index: 3;
}

.article.trace-logs .entry-thread {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.thread-filter-panel {
  margin: 0 0 0.85em;
  padding: 0;
}

.thread-filter-group + .thread-filter-group {
  margin-top: 0.45em;
}

.thread-filter-label {
  margin: 0 0 0.18em;
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.thread-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38em;
  margin-top: 0.15em;
}

.thread-filter-button {
  appearance: none;
  padding: 0.18em 0.52em;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.038);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.thread-filter-button {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thread-filter-count {
  margin-left: 0.18em;
  color: var(--text-muted);
  opacity: 0.85;
}

.thread-filter-button:hover {
  color: var(--text);
}

.thread-filter-button:hover {
  background: rgba(0, 0, 0, 0.06);
}

.thread-filter-button.is-active {
  color: var(--text);
  background: rgba(0, 0, 0, 0.12);
}

.thread-filter-button.is-active .thread-filter-count {
  color: var(--text-light);
}

.thread-item {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  padding: calc(0.4em + 4px) 0.7em 0.4em;
  border: 1px solid var(--border);
  border-radius: 4px;
  scroll-margin-top: 1rem;
  transition: border-color 0.2s ease;
}

.thread-item:hover {
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme-scope].facet-filter-active .thread-item.facet-dim > .trace-log-thumb-wrap,
[data-theme-scope].facet-filter-active .thread-item.facet-dim > .trace-log-main > .trace-log-details > :not(.trace-log-replies) {
  opacity: 0.32;
}

[data-theme-scope].facet-filter-active .thread-item.facet-match > .trace-log-thumb-wrap,
[data-theme-scope].facet-filter-active .thread-item.facet-match > .trace-log-main > .trace-log-details > :not(.trace-log-replies) {
  opacity: 1;
}

.thread-item.facet-match {
  border-color: var(--border);
  background: rgba(0, 0, 0, 0.032);
}

/* Trace logs: optional thumb right of log */
.trace-log-with-thumb {
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 1em;
}

.trace-log-thumb-wrap {
  flex-shrink: 0;
}

.trace-log-thumb {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.08);
  animation: trace-log-thumb-fade 0.4s ease-out;
}

/* Trace logs page only: clipped thumbnail photos. Entry pages keep the simpler circular thumb. */
.article.trace-logs .thread-item {
  background: rgba(255, 255, 255, 0.8);
}

.article.trace-logs .thread-item.facet-match {
  background: rgba(255, 255, 255, 0.88);
}

.article.trace-logs .trace-log-with-thumb {
  gap: 0.95em;
}

.article.trace-logs .trace-log-with-thumb:has(.trace-log-details:not([open])) .trace-log-thumb-wrap {
  display: none;
}

.article.trace-logs .trace-log-thumb-wrap {
  --photo-rotate: -2deg;
  --tape-x: 58%;
  --tape-width: 42px;
  --tape-rotate: 7deg;
  --photo-filter: sepia(0.18) saturate(0.82) contrast(1.04) brightness(0.98);
  --photo-grain-opacity: 0.16;
  position: relative;
  flex: 0 0 104px;
  width: 104px;
  margin-top: -12px;
  padding-top: 8px;
  overflow: visible;
}

.article.trace-logs .trace-log-thumb-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--tape-x);
  width: var(--tape-width);
  height: 16px;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(239, 226, 197, 0.82), rgba(230, 214, 183, 0.58));
  transform: translateX(-50%) rotate(var(--tape-rotate));
  box-shadow: 0 1px 2px rgba(84, 72, 51, 0.08);
  z-index: 3;
  pointer-events: none;
}

.article.trace-logs .trace-log-thumb-wrap::after {
  content: none;
}

.article.trace-logs .trace-log-thumb-wrap picture {
  display: block;
  position: relative;
  z-index: 1;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: transparent;
  transform: rotate(var(--photo-rotate));
  transform-origin: var(--tape-x) 4px;
  box-shadow: 0 1px 2px rgba(43, 35, 24, 0.18), 0 4px 7px rgba(43, 35, 24, 0.18);
  animation: trace-log-thumb-fade 0.4s ease-out;
}

.article.trace-logs .trace-log-thumb-wrap picture::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 248, 232, 0.2) 0.6px, transparent 1px),
    radial-gradient(circle at 72% 68%, rgba(88, 67, 42, 0.18) 0.7px, transparent 1.05px),
    radial-gradient(circle at 40% 80%, rgba(255, 251, 240, 0.16) 0.5px, transparent 0.95px),
    linear-gradient(180deg, rgba(247, 232, 205, 0.1), rgba(102, 79, 49, 0.08));
  background-size: 9px 9px, 11px 11px, 7px 7px, 100% 100%;
  background-position: 0 0, 2px 4px, 1px 3px, 0 0;
  mix-blend-mode: multiply;
  opacity: var(--photo-grain-opacity);
  pointer-events: none;
}

.article.trace-logs .trace-log-thumb {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0;
  object-fit: cover;
  object-position: center;
  box-shadow: none;
  filter: var(--photo-filter);
}

.article.trace-logs .thread-item.trace-log-with-thumb:nth-child(3n + 1) .trace-log-thumb-wrap {
  --photo-rotate: -2.2deg;
  --tape-x: 56%;
  --tape-width: 38px;
  --tape-rotate: 8deg;
}

.article.trace-logs .thread-item.trace-log-with-thumb:nth-child(3n + 2) .trace-log-thumb-wrap {
  --photo-rotate: 1.7deg;
  --tape-x: 53%;
  --tape-width: 46px;
  --tape-rotate: -6deg;
}

.article.trace-logs .thread-item.trace-log-with-thumb:nth-child(3n) .trace-log-thumb-wrap {
  --photo-rotate: -0.9deg;
  --tape-x: 60%;
  --tape-width: 34px;
  --tape-rotate: 5deg;
}

@keyframes trace-log-thumb-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.trace-log-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

/* Collapsible trace log (details/summary) */
.trace-log-details {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.trace-log-details-with-controls .trace-log-summary {
  padding-right: 4rem;
}

.trace-log-controls {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  z-index: 1;
}

.trace-log-artifact-link {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.03);
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  z-index: 1;
}

.trace-log-controls .trace-log-artifact-link {
  position: static;
}

.trace-log-artifact-link:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

.trace-log-artifact-link::after {
  display: none;
}

.trace-log-artifact-icon {
  width: 0.9rem;
  height: 0.9rem;
  transform: rotate(-4deg);
}

.trace-log-summary {
  display: flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.trace-log-summary::-webkit-details-marker,
.trace-log-summary::marker {
  display: none;
}

.trace-log-summary::before {
  content: '▾';
  display: inline-flex;
  align-items: center;
  margin-right: 0.5em;
  font-size: 0.7em;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.trace-log-details:not([open]) .trace-log-summary::before {
  transform: rotate(-90deg);
}

/* Nested replies: arrow indicator, no box */
.trace-log-replies {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin-top: 0.5em;
  margin-left: 1.5em;
}

.trace-log-replies .thread-item.trace-log-reply {
  border: none;
  border-radius: 0;
  padding: 0;
  margin-left: 0;
  background: none;
  box-shadow: none;
}

.trace-log-replies .thread-item.trace-log-reply:hover {
  border-color: transparent;
}

.trace-log-replies .thread-item.trace-log-reply.facet-match {
  background: none;
}

.trace-log-replies .thread-item.trace-log-reply.facet-match .trace-log-main {
  padding: 0.28em 0.45em 0.34em;
  margin: -0.28em -0.45em -0.34em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.032);
}

/* Date as small heading for each comment */
.thread-date {
  font-size: 0.62em;
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0.85;
  margin-bottom: 0.2em;
}

/* Entry page: date at bottom of poem (same style as thread dates) */
.entry-date-wrap {
  margin: 0.5em 0;
  padding: 0;
  font-size: 1.05rem;
}

.entry-date-wrap .thread-date {
  display: block;
}

.thread-body {
  color: var(--text-light);
  line-height: 1.35;
  font-size: 0.92em;
}

/* Trace logs page + entry trace logs: body copy (sans), sized for comfortable reading */
.article.trace-logs .thread-body,
.entry-trace-logs .thread-body {
  color: var(--text);
  line-height: 1.55;
  font-size: var(--site-nav-reading-size);
}

.thread-body p {
  margin: 0 0 0.25em;
}

.thread-body p:last-child {
  margin-bottom: 0;
}

.thread-body .aside-note,
.article .content .aside-note {
  margin: 0.1em 0 0.35em;
  font-size: 0.82em;
  font-style: italic;
  text-align: right;
  color: var(--text-muted);
}

.thread-body strong {
  color: inherit;
  font-weight: 500;
}

.thread-item-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45em 0.55em;
  line-height: 1;
}

.thread-item-header .thread-date {
  margin-bottom: 0;
  line-height: 1;
}

/* Keeps "re:" tight to the following poem title(s); outer .thread-item-header gap still separates date / refs / music */
.commit-entry-refs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
}

.commit-entry-refs .commit-entry-arrow {
  margin-inline-end: 0.22em;
}

/* Trace logs page + entry trace logs: date + re: row ~2px larger than default 0.62em */
.article.trace-logs .thread-date,
.article.trace-logs .commit-entry-arrow,
.article.trace-logs .commit-entry-sep,
.article.trace-logs .trace-log-series-meta,
.article.trace-logs .trace-log-music-meta,
.entry-trace-logs .thread-date,
.entry-trace-logs .commit-entry-arrow,
.entry-trace-logs .commit-entry-sep,
.entry-trace-logs .trace-log-series-meta,
.entry-trace-logs .trace-log-music-meta {
  font-size: calc(0.62em + 2px);
}

.commit-entry-arrow {
  font-size: 0.62em;
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0.85;
  line-height: 1;
}

.commit-entry-sep {
  font-size: 0.62em;
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0.85;
  line-height: 1;
  font-style: normal;
}

.commit-entry-link {
  font-size: 0.62em;
  font-family: var(--font-sans);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0.85;
  text-decoration: none;
  line-height: 1;
}

.commit-entry-link:hover {
  color: var(--text);
}

.trace-log-series-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  font-size: 0.62em;
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0.9;
  line-height: 1;
}

.trace-log-series-prefix {
  text-transform: lowercase;
}

.trace-log-music-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.18em;
  font-size: 0.62em;
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0.9;
  line-height: 1;
}

.trace-log-music-inline-icon {
  width: 0.92em;
  height: 0.92em;
  flex-shrink: 0;
}

.trace-log-music-meta-link {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
  font-style: italic;
}

.trace-log-music-meta-link:hover {
  color: var(--text);
}

.trace-log-sources {
  margin-top: 0.2em;
}

.trace-log-source-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.22em;
}

.trace-log-source-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em;
  font-family: var(--font-sans);
  font-size: 0.74em;
  line-height: 1.45;
  color: var(--text-light);
}

.trace-log-source-kind {
  flex-shrink: 0;
  font-size: 0.8em;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.trace-log-source-link {
  color: var(--trace-log-link);
}

.trace-log-source-link:hover {
  color: var(--trace-log-link-hover);
}

.trace-log-source-text,
.trace-log-source-value,
.trace-log-source-quote {
  color: inherit;
}

.trace-log-source-author,
.trace-log-source-label {
  font-weight: 400;
}

/* Trace logs page + entry trace logs: forest green links (body + re: poem titles) */
.article.trace-logs .thread-body a:not(.has-note),
.entry-trace-logs .thread-body a:not(.has-note) {
  color: var(--trace-log-link);
}

.article.trace-logs .thread-body a:not(.has-note):hover,
.entry-trace-logs .thread-body a:not(.has-note):hover {
  color: var(--trace-log-link-hover);
  opacity: 1;
}

.article.trace-logs .commit-entry-link,
.entry-trace-logs .commit-entry-link {
  font-size: calc(0.62em + 2px);
  color: var(--trace-log-link);
  opacity: 1;
}

.article.trace-logs .commit-entry-link:hover,
.entry-trace-logs .commit-entry-link:hover {
  color: var(--trace-log-link-hover);
}

.article.trace-logs .trace-log-music-meta-link,
.entry-trace-logs .trace-log-music-meta-link {
  color: var(--trace-log-link);
}

.article.trace-logs .trace-log-music-meta-link:hover,
.entry-trace-logs .trace-log-music-meta-link:hover {
  color: var(--trace-log-link-hover);
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

a:hover {
  opacity: 0.85;
}

/* Article content: external links */
.article .content a {
  color: var(--text-light);
}

.article .content a:hover {
  color: var(--text);
}

/* Note triggers: light grey highlight (text that opens the note card). Also in Trace Logs (.entry-thread) and trace-logs page (.thread-body). */
.article .content .tooltip-note,
.article .content a.has-note,
.article .entry-thread .tooltip-note,
.article .thread-body .tooltip-note {
  position: relative;
  cursor: pointer;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.018);
  padding: 0.05em 0.12em;
  border-radius: 2px;
  color: var(--text-light);
  transition: color 0.2s ease, background 0.2s ease;
}

.article .content .tooltip-note:hover,
.article .content a.has-note:hover,
.article .entry-thread .tooltip-note:hover,
.article .thread-body .tooltip-note:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.article .content .tooltip-note .tooltip-bubble,
.article .entry-thread .tooltip-note .tooltip-bubble,
.article .thread-body .tooltip-note .tooltip-bubble {
  display: none;
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 6px;
  font-style: normal;
  width: max-content;
  max-width: min(320px, calc(100vw - 48px));
  box-sizing: border-box;
  padding: 10px 12px 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--text-light);
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
  white-space: normal;
  letter-spacing: 0.01em;
  line-height: 1.4;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  z-index: 2;
  pointer-events: none;
}

/* Note appears only on click (pinned), not on hover */
.article .content .tooltip-note.tooltip-pinned .tooltip-bubble,
.article .entry-thread .tooltip-note.tooltip-pinned .tooltip-bubble,
.article .thread-body .tooltip-note.tooltip-pinned .tooltip-bubble {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.article .content .tooltip-bubble a,
.article .entry-thread .tooltip-bubble a,
.article .thread-body .tooltip-bubble a {
  color: var(--text-light);
}

.article .content .tooltip-bubble a:hover,
.article .entry-thread .tooltip-bubble a:hover,
.article .thread-body .tooltip-bubble a:hover {
  color: var(--text);
}

.article .content .tooltip-bubble .tooltip-img,
.article .content .tooltip-bubble img,
.article .entry-thread .tooltip-bubble .tooltip-img,
.article .entry-thread .tooltip-bubble img,
.article .thread-body .tooltip-bubble .tooltip-img,
.article .thread-body .tooltip-bubble img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  margin: 10px 0 0;
}

.article .content .tooltip-bubble .tooltip-img:first-child,
.article .content .tooltip-bubble img:first-child,
.article .entry-thread .tooltip-bubble .tooltip-img:first-child,
.article .entry-thread .tooltip-bubble img:first-child,
.article .thread-body .tooltip-bubble .tooltip-img:first-child,
.article .thread-body .tooltip-bubble img:first-child {
  margin: 10px;
}

/* Image triggers: click-to-show image (standalone popup). Also in .thread-body (trace-logs). */
.article .content .image-trigger,
.article .thread-body .image-trigger,
.article .trace-log-sources .image-trigger {
  position: relative;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.018);
  padding: 0.05em 0.12em;
  border-radius: 2px;
  color: var(--text-light);
  transition: color 0.2s ease, background 0.2s ease;
}

.article .content .image-trigger:hover,
.article .thread-body .image-trigger:hover,
.article .trace-log-sources .image-trigger:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.article .content .image-trigger .image-popup,
.article .thread-body .image-trigger .image-popup,
.article .trace-log-sources .image-trigger .image-popup {
  display: block;
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  z-index: 2;
  pointer-events: none;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

.article .content .image-trigger.image-popup-pinned .image-popup,
.article .thread-body .image-trigger.image-popup-pinned .image-popup,
.article .trace-log-sources .image-trigger.image-popup-pinned .image-popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.article .content .image-trigger .image-popup img,
.article .thread-body .image-trigger .image-popup img,
.article .trace-log-sources .image-trigger .image-popup img {
  display: block;
  max-width: min(360px, calc(100vw - 48px));
  max-height: 70vh;
  width: auto;
  height: auto;
}

.article .content sup a {
  text-decoration: none;
  border-bottom: none;
}

.scripted-symbol {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.scripted-symbol-stack {
  display: inline-grid;
  grid-template-rows: 0.72em 0.72em;
  justify-items: start;
  line-height: 0.9;
  margin-left: 0.035em;
  transform: translateY(0.28em);
}

.scripted-symbol-stack sup,
.scripted-symbol-stack sub {
  position: static;
  vertical-align: baseline;
  font-size: 0.72em;
  line-height: 1;
}

.equation-note {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2em;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.equation-lead {
  display: inline-flex;
  align-items: baseline;
  gap: 0.18em;
  line-height: 1;
}

.equation-symbol {
  display: inline-block;
  font-size: 1em;
  line-height: 1;
}

.equation-fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: center;
  line-height: 1;
  transform: translateY(0.18em);
}

.equation-numerator {
  border-bottom: 1px solid currentColor;
  padding: 0 0.18em 0.1em;
}

.equation-denominator {
  padding-top: 0.06em;
}

.equation-denominator-term {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  white-space: nowrap;
}

.equation-denominator-scripts {
  display: inline-grid;
  grid-template-rows: 0.5em 0.5em;
  justify-items: start;
  line-height: 0.75;
  margin-left: 0.025em;
  transform: translateY(-0.18em);
}

.equation-denominator-scripts sup,
.equation-denominator-scripts sub {
  position: static;
  vertical-align: baseline;
  font-size: 0.72em;
  line-height: 1;
}

.equation-note sub {
  font-size: 0.72em;
}

.equation-note .tooltip-note {
  line-height: 1;
}

/* Content Styles */
.poem-with-footnotes {
  position: relative;
  margin-bottom: 1.5em;
}

.poem-content {
  max-width: 100%;
  position: relative;
}

.poem-content p {
  margin: 0 0 1.2em;
  line-height: 1.7;
  position: relative;
}

/* Keep ref inline so "¹" stays next to text; footnote sits to the right on same line */
.footnote-ref-wrap {
  position: relative;
  display: inline;
}

/* Superscript ref matches footnote styling (font and color) */
.article .content .footnote-ref-wrap sup,
.article .content .footnote-ref-wrap sup a {
  font-family: inherit;
  color: var(--text-muted);
  font-size: 0.75em;
  vertical-align: super;
  text-decoration: none;
  border-bottom: none;
}

.footnote-reference {
  padding-right: 220px;
}

.footnote-inline {
  position: absolute;
  left: 100%;
  margin-left: 0.5em;
  width: 200px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  font-style: italic;
  padding-left: 0;
  text-align: right;
}

/* After JS repositions: footnote is direct child of .poem-content, flush-right */
.poem-content > .footnote-inline {
  left: auto;
  margin-left: 0;
  right: 0;
  padding-left: 1em;
}

.poem-content p:has(.footnote-ref-wrap) {
  padding-right: 220px;
}

/* Tooltip/link triggers in inline footnotes match footnote text color (not darker) */
.article .content .footnote-inline a,
.article .content .footnote-inline .tooltip-note,
.article .content .footnote-inline a.has-note {
  color: inherit;
}

.article .content .footnote-inline .tooltip-bubble {
  text-align: left;
}

.article .content .footnote-inline a:hover,
.article .content .footnote-inline .tooltip-note:hover,
.article .content .footnote-inline a.has-note:hover {
  color: inherit;
}

/* Narrow viewport: footnote collapses to next line (below the ref), no side-by-side */
@media (max-width: 760px) {
  .footnote-reference {
    padding-right: 0;
  }

  .poem-content p:has(.footnote-ref-wrap) {
    padding-right: 0;
  }

  /* Keep ref inline so "¹" stays with preceding text; only footnote content goes to next line */
  .footnote-ref-wrap {
    display: inline;
  }

  .footnote-inline {
    position: static;
    width: 100%;
    margin-top: 1.1em;
    margin-bottom: 0;
    padding-left: 0;
    padding-top: 0;
    border-top: none;
    display: block;
    text-align: right;
  }
}

.indent-1 {
  display: inline;
  margin-left: 1em;
}

.indent-2 {
  display: inline;
  margin-left: 2em;
}

.indent-3 {
  display: inline;
  margin-left: 3em;
}

.indent-4 {
  display: inline;
  margin-left: 4em;
}

.indent-5 {
  display: inline;
  margin-left: 5em;
}

.indent-6 {
  display: inline;
  margin-left: 6em;
}

.indent-7 {
  display: inline;
  margin-left: 7em;
}

.indent-8 {
  display: inline;
  margin-left: 8em;
}

.chat-messages {
  margin-top: 1em;
}

.chat-message {
  margin-bottom: 1.5em;
}

.chat-date {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.3em;
  font-family: var(--font-sans);
  font-weight: 300;
}

.chat-text {
  margin: 0;
  line-height: 1.8;
}

/* Image Carousel */
.image-carousel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 2em;
}

.carousel-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  border-radius: 4px;
}

.carousel-slides {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.carousel-slide {
  position: relative;
  width: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  display: none;
}

.carousel-slide.active {
  opacity: 1;
  display: block;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.carousel-thumbnails {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.carousel-thumbnails .thumbnail {
  background: none;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.6;
  flex: 0 0 auto;
  width: 80px;
}

.carousel-thumbnails .thumbnail:hover {
  opacity: 0.9;
}

.carousel-thumbnails .thumbnail.active {
  border-color: var(--text);
  opacity: 1;
}

.carousel-thumbnails .thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

@media (max-width: 768px) {
  .carousel-thumbnails .thumbnail {
    width: 60px;
  }
}

.want-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.want-item {
  margin-bottom: 1.8em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid var(--border);
}

.want-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.want-meta {
  display: flex;
  gap: 1em;
  margin-bottom: 0.6em;
  font-size: 12px;
  color: var(--text-muted);
  font-style: normal;
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.want-added,
.want-completed {
  display: inline-block;
}

.want-text {
  display: inline-block;
  line-height: 1.8;
  font-size: 17px;
}

.want-item.completed .want-text {
  color: var(--text-muted);
  opacity: 0.6;
  position: relative;
}

.want-item.completed .want-text::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background-color: var(--text-muted);
  opacity: 0.4;
}

.want-comment {
  display: block;
  margin-top: 0.6em;
  font-size: 15px;
  color: var(--text-light);
  font-style: italic;
  line-height: 1.6;
}

.footnote {
  margin-top: 2.5em;
  padding-top: 1.5em;
  border-top: 1px solid var(--border);
  font-size: 15px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.7;
}

sup a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.7em;
  vertical-align: super;
  border-bottom: none;
}

sup a:hover {
  opacity: 0.7;
}

.footnote sup {
  font-size: 0.8em;
  margin-right: 0.3em;
}

/* Links and tooltip triggers in footnotes use same color as footnote text */
.footnote a,
.footnote .tooltip-note,
.footnote a.has-note {
  color: inherit;
}

.footnote a:hover,
.footnote .tooltip-note:hover,
.footnote a.has-note:hover {
  color: inherit;
}

.section-spacer {
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
  margin: 3em 0;
  letter-spacing: 0.5em;
  opacity: 0.4;
  font-weight: 300;
}

.font-mono {
  font-family: var(--font-mono);
  font-size: var(--code-inline-size);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
  padding: 0.1em 0.4em;
  background: var(--code-bg);
  border-radius: 4px;
}

.font-mono-block {
  display: block;
  line-height: 1.5;
  padding: 0.75em 0.85em;
  margin: 0.5em 0;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: var(--code-block-size);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
  background: var(--code-bg);
  border-radius: 4px;
  tab-size: 2;
}

code,
pre {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text);
  background: var(--code-bg);
  border-radius: 4px;
}

code {
  font-size: var(--code-inline-size);
  padding: 0.1em 0.4em;
}

pre {
  font-size: var(--code-block-size);
  line-height: 1.5;
  padding: 0.85em 1em;
  overflow: auto;
  tab-size: 2;
}

blockquote {
  margin: 0.5em 0;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  color: var(--text-light);
  font-style: italic;
}

/* Quotes in reading column: sans (body is serif), slightly smaller than body */
.article .content blockquote {
  font-family: var(--font-sans);
  font-size: 0.88em;
  line-height: 1.45;
}

/* Trace-log inline quotes (Markdown > …); serif (thread body is sans) */
.thread-body blockquote {
  margin: 0 0 0.3em;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--border);
  text-align: left;
  color: var(--text-muted);
  font-style: normal;
  font-size: 0.92em;
  line-height: 1.45;
  font-family: var(--font-serif);
}

.thread-body blockquote p {
  margin: 0;
}

/* Attributed quote: left-aligned, italic only where marked */
blockquote.attributed-quote {
  margin: 0 0 0.3em;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--border);
  text-align: left;
  color: var(--text-muted);
  font-style: normal;
}

blockquote.attributed-quote p {
  margin: 0;
}

blockquote.attributed-quote cite {
  display: block;
  margin: 0.35em 0 0;
  padding: 0;
  font-style: normal;
  font-size: inherit;
  color: var(--text-muted);
  opacity: 0.9;
  letter-spacing: 0.02em;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .site-header {
    padding: 48px 0 32px;
  }

  .site-title {
    font-size: 30px;
  }

  .article-title {
    font-size: 32px;
  }

  /* Scroll + entry poem titles stay a notch below generic article titles */
  .article-title.all-entry-title {
    font-size: 24px;
  }

  .article .content {
    font-size: 17px;
  }

  .article.trace-logs .trace-log-with-thumb {
    gap: 0.8em;
  }

  .article.trace-logs .trace-log-thumb-wrap {
    flex-basis: 92px;
    width: 92px;
    margin-top: -9px;
    padding-top: 7px;
  }

  .article.trace-logs .trace-log-thumb-wrap::before {
    top: 0;
    width: calc(var(--tape-width) * 0.8);
    height: 14px;
  }

  .entry-title {
    font-size: 20px;
  }

}

@media (max-width: 420px) {
  .article.trace-logs .trace-log-with-thumb {
    gap: 0.65em;
  }

  .article.trace-logs .trace-log-thumb-wrap {
    flex-basis: clamp(72px, 28vw, 92px);
    width: clamp(72px, 28vw, 92px);
    margin-top: -7px;
    padding-top: 6px;
  }

  .article.trace-logs .trace-log-thumb-wrap::before {
    width: calc(var(--tape-width) * 0.72);
    height: 11px;
  }
}
