:root {
  color-scheme: light;
  --bg: #f8f7f4;
  --ink: #46443f;
  --text: #55524c;
  --muted: #69665e;
  --line: #e1dfd9;
  --surface: #f0eeea;
  --control-size: 44px;
  --icon-size: 17px;
  --control-radius: 50%;
  --text-small: 14px;
  --text-body: 16px;
  --text-heading: 18px;
  --text-section: 20px;
  --text-title: 24px;
  --section-gap: 36px;
  --section-padding: 24px;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #111110;
  --ink: #cfcdc7;
  --text: #bbb9b3;
  --muted: #aaa79f;
  --line: #2c2b28;
  --surface: #1b1b19;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #111110;
    --ink: #cfcdc7;
    --text: #bbb9b3;
    --muted: #aaa79f;
    --line: #2c2b28;
    --surface: #1b1b19;
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 28px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: var(--text-body);
  line-height: 1.94;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
a {
  color: var(--ink);
  text-decoration: none;
  text-underline-offset: 0.22em;
}
a:hover {
  text-decoration: underline;
}
button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}
button,
summary {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}
main[tabindex='-1']:focus {
  outline: none;
}
::selection {
  background: var(--ink);
  color: var(--bg);
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 20;
  transform: translateY(-180%);
  padding: 8px 16px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  border-radius: 4px;
}
.skip-link:focus {
  transform: none;
}
.page {
  width: calc(100% - 44px);
  max-width: 634px;
  margin-inline: auto;
  padding: 104px 0 80px;
}
.overview-content {
  display: contents;
}
.identity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
}
.identity-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.identity-actions svg {
  display: block;
  width: var(--icon-size);
  height: var(--icon-size);
}
.identity-mark {
  width: 50px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: -0.08em;
  font-weight: 500;
  line-height: 1;
}
.identity-mark:hover {
  text-decoration: none;
  background: var(--surface);
}
.identity-actions a,
.theme-toggle {
  color: var(--muted);
  width: var(--control-size);
  height: var(--control-size);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  padding: 0;
  border-radius: var(--control-radius);
}
.identity-actions a:hover,
.theme-toggle:hover {
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}
.theme-toggle[data-next='light'] .moon,
.theme-toggle[data-next='dark'] .sun {
  display: none;
}
.intro-label {
  font-size: var(--text-small);
  line-height: 1.65;
  margin: 20px 0 28px;
  color: var(--muted);
}
.greeting {
  margin: 0 0 20px;
  font-size: var(--text-heading);
  line-height: 1.5;
}
.intro > p:not(.intro-label):not(.greeting) {
  margin: 0 0 20px;
}
.intro p:last-child {
  margin-bottom: 0;
}
.intro strong {
  color: var(--ink);
  font-weight: 400;
}
.page.page-home {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 24px;
  --section-gap: 20px;
  --section-padding: 12px;
}
.page-home > * {
  flex-shrink: 0;
}
.page-home .intro {
  line-height: 1.75;
}
.page-home .intro-label {
  margin: 14px 0 20px;
}
.page-home .intro > p:not(.intro-label) {
  margin-bottom: 16px;
}
.page-home .intro > p:last-child {
  margin-bottom: 0;
}
.page-home .section-label {
  display: flex;
  align-items: center;
  min-height: var(--control-size);
  margin-bottom: 8px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.page-home .section-heading .section-label {
  margin: 0;
}
.profile-section,
.next-note,
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--section-gap);
  padding-top: var(--section-padding);
}
.page-home .profile-section {
  border-top: 0;
}
.section-label {
  margin: 0 0 20px;
  font-size: var(--text-heading);
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink);
}
.row-meta {
  color: var(--muted);
  font-size: var(--text-small);
  white-space: nowrap;
  flex-shrink: 0;
}
.writing-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  white-space: normal;
}
.writing-list {
  list-style: none;
  margin: 0 -12px;
  padding: 0;
}
.item-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  min-height: var(--control-size);
  padding: 8px 0;
  line-height: 1.75;
}
.item-row:hover {
  text-decoration: none;
}
.item-row:hover .item-title {
  text-decoration: underline;
}
.item-title {
  min-width: 0;
}
.item-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'title meta' 'description description';
  gap: 2px 24px;
}
.item-preview .item-title {
  grid-area: title;
}
.item-preview .row-meta {
  grid-area: meta;
}
.item-description {
  grid-area: description;
  font-size: var(--text-small);
  line-height: 1.6;
  color: var(--muted);
}
.site-footer {
  font-size: var(--text-small);
  color: var(--muted);
}
.site-footer a {
  color: var(--muted);
  min-height: var(--control-size);
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}
.social-links {
  display: flex;
  gap: 4px;
}
.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.article-header {
  margin-top: 32px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-size);
  font-size: var(--text-small);
  color: var(--ink);
}
.article-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.article-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
}
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: var(--text-small);
}
.article-header h1 {
  font-size: var(--text-title);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.4;
  margin: 0 0 20px;
  color: var(--ink);
  text-wrap: balance;
}
.article-header .archive-title {
  margin-top: 24px;
}
.writing-header .archive-title {
  margin-bottom: 8px;
}
.archive-intro {
  margin: 0 0 28px;
}
.writing-header + .writing-list {
  display: grid;
  gap: 12px;
}
.article-summary {
  margin: 0 0 24px;
}
.contents {
  margin: 32px 0 36px;
  border-block: 1px solid var(--line);
  font-size: var(--text-small);
}
.contents summary {
  padding: 12px 0;
  min-height: var(--control-size);
  line-height: 20px;
  color: var(--ink);
}
.contents ol {
  list-style: none;
  padding: 0 0 16px;
  margin: 8px 0 0;
}
.contents a {
  display: block;
  padding: 10px 0;
  min-height: var(--control-size);
  line-height: 1.6;
  color: var(--text);
}
.contents .toc-sub {
  padding-left: 16px;
}
.prose {
  overflow-wrap: anywhere;
}
.prose > :first-child {
  margin-top: 0;
}
.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose .table-scroll {
  margin-block: 1.5em;
}
.prose h2 {
  color: var(--ink);
  font-size: var(--text-section);
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 2.5em 0 0.8em;
}
.prose h3 {
  color: var(--ink);
  font-size: var(--text-heading);
  line-height: 1.5;
  font-weight: 500;
  margin: 2em 0 0.8em;
}
.prose h4 {
  font-size: var(--text-body);
  color: var(--ink);
  font-weight: 500;
}
.prose strong {
  color: var(--ink);
  font-weight: 500;
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose li {
  margin-block: 0.45em;
}
.prose a {
  text-decoration: underline;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}
.prose blockquote {
  border-left: 1px solid var(--line);
  padding-left: 1.2em;
  margin-inline: 0;
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 16px;
  overflow: auto;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: normal;
}
.prose code {
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: 0.82em;
}
.prose :not(pre) > code {
  padding: 0.12em 0.3em;
  background: var(--surface);
}
.prose pre code {
  font-size: 1em;
  background: none;
  color: var(--ink);
}
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.prose table {
  border-collapse: collapse;
  min-width: max(100%, 480px);
  font-size: 13px;
  line-height: 1.65;
}
.prose th {
  color: var(--ink);
  text-align: left;
  font-weight: 500;
}
.prose td,
.prose th {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.next-note .section-label {
  margin-bottom: 12px;
}
@media (max-width: 700px) {
  .page {
    padding-top: 56px;
  }
  .footer-meta {
    flex-direction: column;
    gap: 4px;
  }
  .item-row {
    gap: 16px;
  }
  .item-preview {
    gap: 4px 16px;
  }
  .writing-list .item-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'title' 'description' 'meta';
    gap: 4px;
  }
}
@media (min-width: 701px) and (hover: hover) and (pointer: fine) {
  .overview-frame {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .overview-frame > .page-overview {
    flex: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 634px;
    max-width: none;
    min-height: 900px;
    margin: 0;
    padding-block: 24px;
  }
  .page-overview.overview-fitted {
    height: 900px;
  }
  .page-overview > .identity-row {
    flex: none;
  }
  .page-overview > #content {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }
  .overview-content {
    display: flow-root;
    flex: none;
    width: 634px;
  }
  .page-overview > .site-footer {
    flex: none;
    margin-top: 24px;
    padding-top: 16px;
  }
  .page-overview .footer-meta {
    min-height: 44px;
  }
  .page.page-home {
    --section-gap: 12px;
    --section-padding: 12px;
  }
  .page-home .intro {
    line-height: 1.65;
  }
  .page-home .intro-label {
    margin: 12px 0 16px;
  }
  .page-home .intro > p:not(.intro-label) {
    margin-bottom: 10px;
  }
  .page-home .intro > p:last-child {
    margin-bottom: 0;
  }
  .page-home .section-heading {
    margin-bottom: 4px;
  }
  .page-home .item-row {
    padding-block: 6px;
    line-height: 1.6;
  }
  .page-home .item-description {
    line-height: 1.5;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  html,
  html[data-theme] {
    color-scheme: light;
    --bg: #fff;
    --ink: #111;
    --text: #333;
    --muted: #555;
    --line: #ccc;
    --surface: #f5f5f5;
  }
  .theme-toggle,
  .skip-link {
    display: none !important;
  }
  .page {
    max-width: 634px;
    padding: 0;
  }
  .overview-frame {
    display: block;
    min-height: 0;
  }
  .page.page-overview {
    zoom: 1 !important;
    height: auto;
    min-height: 0;
    display: block;
    padding: 0;
  }
  .page-overview > #content {
    display: block;
  }
  .overview-content {
    display: contents;
    zoom: 1 !important;
  }
  .contents {
    display: none;
  }
  .prose pre,
  .table-scroll {
    overflow: visible;
    white-space: pre-wrap;
  }
  .prose table {
    min-width: 100%;
  }
}

/* Selected reading tools share Paper's quiet controls and neutral palette. */
.quiet-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: var(--text-small);
  line-height: 1.5;
}
.quiet-button:hover,
.quiet-button[aria-pressed='true'] {
  color: var(--ink);
  background: var(--surface);
}
.quiet-button:disabled {
  cursor: wait;
}
.quiet-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  border-color: transparent;
}
.quiet-link:hover {
  text-decoration: none;
}
.quiet-button kbd {
  margin-left: 8px;
  font: inherit;
  font-size: 11px;
  color: var(--muted);
}
.article-controls,
.footer-actions,
.resume-note,
.trail-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.article-controls {
  margin-left: auto;
}
.star-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.star-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.star-button[aria-pressed='true'] svg {
  fill: currentColor;
}
.star-count {
  min-width: 1ch;
  font-variant-numeric: tabular-nums;
}
.star-status {
  margin: 12px 0 0;
  font-size: var(--text-small);
  color: var(--muted);
}
.star-status:empty {
  display: none;
}
.footer-actions {
  gap: 16px;
}
.resume-note {
  margin-top: 20px;
}
.trail-controls {
  margin-bottom: 20px;
}
.trail-state {
  font-size: var(--text-small);
  color: var(--muted);
  flex-basis: auto;
  text-align: right;
  line-height: 1.4;
}
[data-trail-row] {
  position: relative;
  isolation: isolate;
  padding-inline: 12px;
  border-radius: 6px;
}
[data-trail-row]::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--read-progress, 0%);
  border-radius: inherit;
  background: var(--surface);
  opacity: 0.75;
  z-index: -1;
  pointer-events: none;
}
.page-home [data-trail-row]::after {
  content: none;
}
.empty-notes {
  font-size: 14px;
}
.quick-nav {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100svh - 48px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  overflow: auto;
}
.quick-nav::backdrop {
  background: rgb(0 0 0 / 0.45);
}
.quick-search {
  display: flex;
  align-items: center;
  gap: 8px;
}
.quick-nav input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 52px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
}
.quick-results {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.quick-results a,
.quick-results button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink);
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  text-decoration: none;
}
.quick-results a:hover,
.quick-results button:hover {
  background: var(--surface);
}
.quick-results small {
  color: var(--muted);
  font-size: 11px;
  flex-shrink: 0;
}
.quick-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 11px;
  color: var(--muted);
}
.quick-empty {
  font-size: 14px;
}
.prose {
  position: relative;
}
.morph-word {
  display: inline-block;
  transform-origin: left top;
}
.morph-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
}
.morph-ghost {
  position: absolute;
  white-space: pre;
  transform-origin: left top;
}
@media (max-width: 700px) {
  .footer-meta {
    align-items: flex-start;
  }
  .writing-meta {
    justify-content: flex-start;
  }
  .trail-state {
    text-align: left;
    flex-basis: auto;
  }
}
@media print {
  .article-nav button,
  .article-controls,
  .resume-note,
  .trail-controls,
  .star-status,
  .footer-actions,
  .quick-nav {
    display: none !important;
  }
}
