.reading-stats {
  display:flex;
  flex-wrap:wrap;
  gap:12px 28px;
  padding:18px 0;
  border-bottom:1px solid var(--line);
  font:12px "Courier New",monospace;
  color:var(--muted)
}
.reading-stats strong {
  font-size:20px;
  color:var(--ink)
}
.note-heading {
  padding:28px 0;
  border-bottom:1px solid var(--line)
}
.note-source {
  margin:18px 0
}
.note-dates {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  margin:20px 0 10px
}
.note-dates dt {
  font:10px "Courier New",monospace;
  color:var(--muted);
  text-transform:uppercase
}
.note-dates dd {
  margin:8px 0 0;
  font-size:13px
}
.timing-note {
  font-size:11px;
  color:var(--muted)
}
.markdown-body {
  max-width:960px;
  line-height:1.95;
  padding:12px 0 30px;
  overflow-wrap:anywhere
}
.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4 {
  scroll-margin-top:28px;
  margin:30px 0 16px;
  line-height:1.55
}
.markdown-body h2 {
  font-size:25px;
  padding-bottom:12px;
  border-bottom:1px solid var(--line)
}
.markdown-body h3 {
  font-size:21px
}
.markdown-body h4 {
  font-size:17px
}
.markdown-body p,.markdown-body li {
  font-size:15px
}
.markdown-body ul,.markdown-body ol {
  padding-left:26px
}
.markdown-body li {
  margin:8px 0
}
.markdown-body img {
  display:block;
  max-width:100%;
  height:auto;
  margin:24px auto;
  background:#fff;
  cursor:zoom-in;
  border:1px solid var(--line)
}
.markdown-body img:focus-visible {
  outline:2px solid var(--accent)
}
.markdown-body table {
  display:block;
  overflow-x:auto;
  border-collapse:collapse;
  width:100%;
  font-size:14px
}
.markdown-body td,.markdown-body th {
  padding:8px 12px;
  border:1px solid var(--line)
}
.markdown-body pre {
  padding:16px;
  overflow-x:auto;
  background:color-mix(in srgb,var(--ink) 6%,transparent);
  border:1px solid var(--line)
}
.markdown-body code {
  font-size:.9em
}
.markdown-body blockquote {
  font-family:inherit;
  font-style:normal;
  font-size:15px
}
.math-display {
  display:block;
  overflow-x:auto;
  padding:12px 0
}
mjx-container[display="true"] {
  overflow-x:auto;
  max-width:100%
}
.toc .sticky {
  max-height:calc(100vh - 48px);
  overflow-y:auto
}
.toc nav a {
  line-height:1.6
}
.toc nav a.active {
  color:var(--accent)
}
.toc-level-3 {
  padding-left:10px
}
.toc-level-4 {
  padding-left:20px
}
.library .sticky {
  max-height:calc(100vh - 48px);
  overflow-y:auto;
  padding-right:4px
}
.paper-links a {
  font-size:13px
}
#image-viewer {
  max-width:96vw;
  max-height:94vh;
  padding:48px 16px 16px;
  border:1px solid var(--line);
  background:var(--paper);
  color:var(--ink)
}
#image-viewer::backdrop {
  background:#000b
}
#full-image {
  display:block;
  max-width:88vw;
  height:auto;
  background:white
}
#close-image {
  position:absolute;
  top:10px;
  right:14px
}
.reading-content {
  min-height:900px
}
@media(max-width:760px) {
  .note-dates {
    grid-template-columns:1fr;
    gap:12px
  }
  .note-dates dd {
    margin-top:4px
  }
  .markdown-body p,.markdown-body li {
    font-size:14px
  }
  .library .sticky {
    max-height:none;
    overflow:visible
  }
  .markdown-body {
    max-width:100%
  }
}
.reading-content .note-heading {
  padding-top:0
}
.reading-content .paper-title {
  margin-top:14px
}
/* The collection is the default route;
 individual notes are opened explicitly. */
.reading-overview .docs {
  grid-template-columns:220px minmax(0,1fr)
}
.reading-overview .toc {
  display:none
}
.overview-heading {
  padding:0 0 20px
}
.overview-heading h1 {
  font:700 38px/1.2 Georgia,serif;
  letter-spacing:-1px;
  margin:12px 0
}
.overview-heading>p {
  color:var(--muted);
  font-size:14px;
  margin-bottom:8px
}
.overview-heading .reading-stats {
  padding:14px 0
}
.collection-heading {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:16px;
  margin:18px 0
}
.collection-heading h2 {
  font-size:22px;
  margin:0
}
.collection-heading>span {
  font:11px "Courier New",monospace;
  color:var(--muted)
}
.note-cards {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  border-top:1px solid var(--line);
  border-left:1px solid var(--line)
}
.note-card {
  display:flex;
  flex-direction:column;
  min-height:180px;
  padding:24px;
  border-right:1px solid var(--line);
  border-bottom:1px solid var(--line);
  text-decoration:none;
  transition:background .15s
}
.note-card:hover {
  background:color-mix(in srgb,var(--accent) 5%,transparent);
  color:var(--ink)
}
.note-card h3 {
  display:flex;
  justify-content:space-between;
  gap:16px;
  font:700 24px/1.4 Georgia,serif;
  margin:14px 0
}
.note-card h3 span {
  color:var(--accent);
  font-size:18px
}
.note-card>p {
  color:var(--muted)
}
.note-card .tags:empty {
  display:none
}
.card-meta {
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
  margin-top:auto;
  padding-top:20px;
  font:11px "Courier New",monospace;
  color:var(--muted)
}
.back-library {
  display:inline-block;
  font:11px "Courier New",monospace;
  margin:0 0 18px;
  color:var(--muted)
}
.reading-overview .reading-content {
  min-height:calc(100vh - 180px)
}
@media(max-width:1050px) {
  .reading-overview .docs {
    grid-template-columns:200px minmax(0,1fr)
  }
}
@media(max-width:760px) {
  .reading-overview .docs {
    grid-template-columns:minmax(0,1fr)
  }
  .note-cards {
    grid-template-columns:minmax(0,1fr)
  }
  .note-card {
    min-height:150px;
    padding:20px
  }
  .overview-heading h1 {
    font-size:32px
  }
}
/* Reading progress, drawn as a scan line under the sticky masthead. */
.scan-progress {
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:2px;
  z-index:30;
  background:var(--accent);
  transform:scaleX(0);
  transform-origin:left;
  pointer-events:none
}
/* Placeholder while a note body is fetched. */
.scan-skeleton {
  position:relative;
  display:grid;
  gap:14px;
  padding:12px 0;
  overflow:hidden
}
.scan-skeleton span {
  height:12px;
  background:color-mix(in srgb,var(--ink) 8%,transparent)
}
.scan-skeleton span:nth-child(2) {
  width:86%
}
.scan-skeleton span:nth-child(3) {
  width:93%
}
.scan-skeleton span:nth-child(4) {
  width:60%
}
.scan-skeleton:after {
  content:"";
  position:absolute;
  left:0;
  right:0;
  height:2px;
  background:var(--accent);
  animation:scan 1.1s ease-in-out infinite alternate
}
@keyframes scan {
  from {
    top:0
  }
  to {
    top:100%
  }
}
/* TeX waits quietly until MathJax arrives. */
.markdown-body .arithmatex {
  color:var(--muted)
}
.markdown-body mjx-container {
  color:var(--ink)
}
/* Acquisition log */
.acq-log {
  margin:6px 0 26px;
  padding:16px 0 4px;
  border-bottom:1px solid var(--line)
}
.acq-log figcaption {
  display:flex;
  justify-content:space-between;
  gap:16px;
  font:10px "Courier New",monospace;
  letter-spacing:1.4px;
  color:var(--muted);
  margin-bottom:10px
}
.acq-log figcaption span:first-child {
  color:var(--accent)
}
.acq-axis,.acq-rows a {
  display:grid;
  grid-template-columns:110px minmax(0,1fr) 72px;
  gap:14px;
  align-items:center
}
.acq-ticks {
  position:relative;
  height:18px;
  border-bottom:1px solid var(--line)
}
.acq-ticks span {
  position:absolute;
  bottom:4px;
  transform:translateX(-50%);
  font:9px "Courier New",monospace;
  color:var(--muted);
  white-space:nowrap
}
.acq-ticks span:before {
  content:"";
  position:absolute;
  left:50%;
  bottom:-5px;
  height:4px;
  border-left:1px solid var(--line)
}
.acq-rows {
  list-style:none;
  margin:0;
  padding:4px 0 0
}
.acq-rows li {
  margin:0;
  font-size:12px
}
.acq-rows a {
  padding:3px 0;
  text-decoration:none
}
.acq-name {
  font:13px/1.4 Georgia,serif;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.acq-track {
  position:relative;
  height:14px;
  background:linear-gradient(var(--line),var(--line)) 0 50%/100% 1px no-repeat
}
.acq-bar {
  position:absolute;
  top:5px;
  height:4px;
  background:var(--accent);
  transform-origin:left;
  animation:pass .7s cubic-bezier(.2,.7,.2,1) both;
  animation-delay:calc(var(--i) * 60ms)
}
.acq-bar:before,.acq-bar:after {
  content:"";
  position:absolute;
  top:-3px;
  height:10px;
  border-left:1px solid var(--accent)
}
.acq-bar:before {
  left:0
}
.acq-bar:after {
  right:0
}
.acq-bar.live {
  background:repeating-linear-gradient(90deg,var(--accent) 0 5px,transparent 5px 8px)
}
@keyframes pass {
  from {
    transform:scaleX(0)
  }
}
.acq-span {
  white-space:nowrap;
  font:10px "Courier New",monospace;
  color:var(--muted);
  text-align:right
}
.acq-rows a:hover .acq-name,.acq-rows a.linked .acq-name {
  color:var(--accent)
}
.acq-rows a.linked .acq-bar {
  height:6px;
  top:4px
}
.acq-rows a.linked .acq-track {
  background-color:color-mix(in srgb,var(--accent) 7%,transparent)
}
/* Card hover: a sensor line sweeps across the entry. */
.note-card {
  position:relative;
  overflow:hidden
}
.note-card:after {
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  left:0;
  width:1px;
  background:var(--accent);
  box-shadow:0 0 14px 2px color-mix(in srgb,var(--accent) 40%,transparent);
  opacity:0;
  pointer-events:none
}
.note-card:hover:after,.note-card.linked:after {
  animation:sweep .65s cubic-bezier(.3,.6,.2,1) forwards
}
.note-card.linked {
  background:color-mix(in srgb,var(--accent) 5%,transparent)
}
@keyframes sweep {
  0% {
    left:0;
    opacity:1
  }
  100% {
    left:100%;
    opacity:0
  }
}
/* Zoomable figure viewer */
#image-viewer {
  width:96vw;
  height:94vh;
  max-width:none;
  max-height:none;
  padding:0;
  overflow:hidden
}
#image-viewer[open] {
  display:flex;
  flex-direction:column
}
.viewer-bar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:10px 14px;
  border-bottom:1px solid var(--line)
}
.viewer-caption {
  font:12px "Courier New",monospace;
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.viewer-tools {
  display:flex;
  align-items:center;
  gap:6px;
  flex-shrink:0
}
.viewer-zoom {
  font:11px "Courier New",monospace;
  min-width:44px;
  text-align:center
}
#close-image {
  position:static;
  margin-left:10px
}
.viewer-stage {
  flex:1;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  cursor:zoom-in;
  touch-action:none;
  background:repeating-conic-gradient(color-mix(in srgb,var(--ink) 4%,transparent) 0 25%,transparent 0 50%) 0 0/20px 20px
}
.viewer-stage.zoomed {
  cursor:grab
}
.viewer-stage.zoomed:active {
  cursor:grabbing
}
#full-image {
  max-width:calc(96vw - 32px);
  max-height:calc(94vh - 110px);
  width:auto;
  user-select:none;
  transform-origin:center;
  will-change:transform
}
.viewer-hint {
  margin:0;
  padding:6px 14px;
  font:10px "Courier New",monospace;
  color:var(--muted);
  border-top:1px solid var(--line)
}
@media(max-width:760px) {
  .acq-axis,.acq-rows a {
    grid-template-columns:76px minmax(0,1fr) 58px;
    gap:8px
  }
  .acq-ticks span:nth-child(even) {
    display:none
  }
  .acq-span {
    font-size:9px
  }
  .acq-log figcaption span:last-child {
    display:none
  }
  .viewer-hint {
    display:none
  }
}
@media(prefers-reduced-motion:reduce) {
  .acq-bar,.note-card:hover:after,.scan-skeleton:after {
    animation:none
  }
}
/* Frameless collection: entries read as a list, not a grid of boxes. */
.reading-stats,.note-heading,.acq-log {
  border-bottom:0
}
.note-cards {
  border:0;
  column-gap:48px
}
.note-card {
  min-height:0;
  padding:26px 0 30px;
  border:0;
  border-top:1px solid color-mix(in srgb,var(--line) 45%,transparent)
}
.note-card:hover,.note-card.linked {
  background:none
}
.note-card:hover h3,.note-card.linked h3 {
  color:var(--accent)
}
.note-card h3 {
  margin:10px 0 6px;
  transition:color .2s
}
.note-card h3 span {
  transition:transform .25s ease
}
.note-card:hover h3 span {
  transform:translate(3px,-3px)
}
.card-meta {
  padding-top:12px
}
.markdown-body h2 {
  border-bottom:0;
  padding-bottom:0
}
.markdown-body img {
  border:0
}
/* First view of the collection: entries arrive in sequence; a newly opened note's title is wiped in. */
.motion .note-cards.arrive .note-card {
  animation:card-in .7s cubic-bezier(.2,.7,.2,1) both;
  animation-delay:calc(var(--i,0) * 55ms + 150ms)
}
@keyframes card-in {
  from {
    opacity:0;
    transform:translateY(16px)
  }
}
.motion .note-article .paper-title,.motion .project-entry .paper-title {
  animation:wipe 1s cubic-bezier(.7,0,.2,1) both
}
@keyframes wipe {
  from {
    clip-path:inset(0 100% -10% 0)
  }
  to {
    clip-path:inset(0 0 -10% 0)
  }
}
.motion .overview-heading.arrive h1 {
  animation:wipe 1s cubic-bezier(.7,0,.2,1) .1s both
}
