@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --paper: #fafaf8;
  --ink: #20211f;
  --muted: #70726d;
  --blue: #2852e3;
  --blue-deep: #1d3eb2;
  --line: #e4e5df;
  --wash: #f1f2ed;
  --tint: #eef1fd;
  --white: #fff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
}
::selection {
  background: #d9e1ff;
  color: #172d80;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a,
button {
  touch-action: manipulation;
}
button,
a {
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}
a:hover {
  color: var(--blue);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
header,
main,
footer {
  width: min(960px, calc(100% - 96px));
  margin-inline: auto;
}
main {
  min-height: 58vh;
}
main:focus {
  outline: none;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
h1 {
  font-size: clamp(34px, 4.5vw, 56px);
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -1.6px;
}
h2 {
  font-size: 25px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.6px;
}
h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.6;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 100;
  background: var(--ink);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
}
.skip-link:focus {
  top: 15px;
}
.header {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  view-transition-name: site-header;
}
.wordmark {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 38px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.7px;
  line-height: 1.2;
  padding: 10px 0;
}
.logo-dot {
  color: var(--blue);
  display: inline-block;
  transition: transform 320ms var(--ease);
}
.wordmark:hover .logo-dot {
  transform: translateY(-4px);
}
nav {
  display: flex;
  gap: 6px;
}
nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 15px;
  border-radius: 7px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
nav a:hover {
  background: var(--wash);
  color: var(--ink);
}
nav a[aria-current="page"] {
  color: var(--blue);
  background: var(--tint);
  font-weight: 550;
}
.hero {
  padding: 85px 0 80px;
}
.hero-greeting {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 10px;
}
.hero-title {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(52px, 8vw, 88px);
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0 0 30px -4px;
  animation: introduce 700ms var(--ease) both;
}
.accent-dot {
  color: var(--blue);
  letter-spacing: 0;
}
.hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 45px;
}
.hero-subtitle {
  font-size: clamp(19px, 2.5vw, 24px);
  line-height: 1.6;
  margin: 0 0 14px;
  letter-spacing: -0.4px;
}
.hero-description {
  color: var(--muted);
  max-width: 530px;
  font-size: 15px;
  line-height: 1.95;
  margin: 0;
}
.hero-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
  font-size: 14px;
  color: var(--blue);
  padding: 10px 0;
  border-bottom: 1px solid #bac7f6;
}
.hero-link span {
  font-size: 20px;
  transition: transform 250ms var(--ease);
}
.hero-link:hover span {
  transform: translate(3px, -3px);
}
.section {
  padding: 45px 0 55px;
  border-top: 1px solid var(--line);
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.section-heading h2 {
  margin: 0;
}
.section-heading p {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 0;
}
.heading-dot {
  color: var(--blue);
  font-family: "Bricolage Grotesque", sans-serif;
  margin-left: 2px;
}
.section-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-underline-offset: 6px;
}
.section-link:hover {
  text-decoration: underline;
  color: var(--blue);
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  background: var(--blue);
  color: white;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 23px;
  transition:
    background-color 200ms ease,
    transform 250ms var(--ease),
    box-shadow 250ms ease;
}
.button:hover {
  color: white;
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  box-shadow: 0 4px 14px #2852e319;
  transform: translateY(-2px);
}
.button:active {
  transform: translateY(0);
}
.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.secondary:hover {
  color: var(--blue);
  background: var(--tint);
  border-color: #bdc9f2;
  box-shadow: none;
}
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--blue);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: #c4ceee;
  text-underline-offset: 6px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.recent-life {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 23px;
}
.recent-life > .status {
  grid-column: 1 / -1;
}
.life-preview {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.preview-image {
  overflow: hidden;
  border-radius: 10px;
  background: var(--wash);
  margin-bottom: 18px;
}
.life-preview img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition:
    transform 600ms var(--ease),
    filter 400ms ease;
}
.life-preview:hover img {
  transform: scale(1.035);
  filter: saturate(1.05);
}
.life-preview time {
  font-size: 12px;
  color: var(--muted);
}
.life-preview p {
  font-size: 15px;
  line-height: 1.8;
  margin: 7px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.life-preview.text-only {
  background: var(--wash);
  padding: 25px;
  border-radius: 10px;
  min-height: 180px;
  justify-content: flex-end;
}
.home-notes .note-row:first-child {
  border-top: 0;
  padding-top: 6px;
}
.note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 25px 0;
  border-top: 1px solid var(--line);
}
.note-row h2,
.note-row h3 {
  font-size: 19px;
  margin: 4px 0 8px;
  transition: color 180ms ease;
}
.note-row p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.topic {
  font-size: 12px;
  color: var(--muted);
}
.read-label {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  transition: color 180ms ease;
}
.note-row:hover h2,
.note-row:hover h3,
.note-row:hover .read-label {
  color: var(--blue);
}
footer {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 28px 0 35px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  view-transition-name: site-footer;
}
.footer-wordmark {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 29px;
  font-style: italic;
  letter-spacing: -0.5px;
  font-weight: 400;
  color: var(--ink);
}
footer a:last-child {
  margin-left: auto;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.page-title {
  padding: 65px 0 36px;
}
.intro {
  color: var(--blue);
  font-size: 13px;
  font-weight: 550;
  margin: 0 0 17px;
}
.page-title h1 {
  margin-bottom: 20px;
}
.page-title p:last-child {
  color: var(--muted);
  max-width: 600px;
  font-size: 15px;
}
.page-title .intro {
  color: var(--blue);
}
.panel {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 28px;
  border-radius: 10px;
  margin-bottom: 24px;
}
.panel h2 {
  font-size: 21px;
  margin-bottom: 18px;
}
.empty-projects {
  padding: 45px;
  margin: 0 0 90px;
  background: transparent;
  border-style: dashed;
}
.empty-projects p {
  font-size: 15px;
  color: var(--muted);
}
.life-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}
.life-heading h1 {
  margin-bottom: 15px;
}
.life-heading .button {
  flex-shrink: 0;
}
.life-feed {
  max-width: 760px;
  margin: 0 auto 70px;
}
.life-entry {
  padding: 35px 0 45px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 28px;
  animation: entry-appear 450ms var(--ease) both;
}
.life-entry time {
  font-family: "Bricolage Grotesque", "PingFang SC", sans-serif;
  font-size: 13px;
  color: var(--muted);
}
.life-caption {
  margin: 15px 0 25px;
  line-height: 1.95;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.life-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.life-gallery.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.life-gallery.single {
  grid-template-columns: 1fr;
}
.life-gallery a {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--wash);
  cursor: zoom-in;
}
.life-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}
.life-gallery a:hover img {
  transform: scale(1.035);
}
.life-gallery.single img {
  aspect-ratio: auto;
  max-height: 680px;
  object-fit: contain;
}
.load-more {
  display: block;
  margin: -30px auto 70px;
}
.subtle {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.subtle:hover {
  background: var(--wash);
  color: var(--ink);
}
.field {
  margin-bottom: 20px;
}
.field label,
.search-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.field input,
.field textarea,
.search {
  display: block;
  width: 100%;
  border: 1px solid #d5d7cf;
  border-radius: 6px;
  padding: 11px 13px;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
}
.field input:focus,
.field textarea:focus,
.search:focus {
  border-color: var(--blue);
}
.field input[type="file"] {
  font-size: 13px;
}
.field input::file-selector-button {
  border: 0;
  background: var(--wash);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 4px;
  margin-right: 12px;
  cursor: pointer;
}
.field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.8;
}
.search {
  margin-bottom: 30px;
  min-height: 48px;
}
#notes {
  margin-bottom: 75px;
}
.status {
  font-size: 13px;
  color: var(--muted);
  min-height: 24px;
  white-space: pre-wrap;
  line-height: 1.85;
}
.status.error {
  color: #a22b36;
}
.login-copy {
  max-width: 520px;
  color: var(--muted);
  font-size: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.article {
  max-width: 720px;
  margin: 36px auto 90px;
}
.back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 40px;
}
.article h1 {
  font-size: clamp(28px, 3.7vw, 40px);
  letter-spacing: -0.8px;
  line-height: 1.55;
}
.article-lead {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 40px;
}
.article h2 {
  font-size: 23px;
  margin: 42px 0 18px;
}
.article p,
.article li {
  font-size: 16px;
  line-height: 2;
}
.article a:not(.back) {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.article ul {
  padding-left: 24px;
}
pre {
  overflow: auto;
  padding: 24px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.9;
}
code {
  font-family: "SFMono-Regular", Consolas, monospace;
}
.notice {
  border-left: 2px solid var(--blue);
  padding: 15px 20px;
  background: var(--tint);
  color: var(--muted);
  font-size: 14px;
}

@keyframes introduce {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes entry-appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: page-out 150ms ease both;
}
::view-transition-new(root) {
  animation: page-in 320ms var(--ease) both;
}
@keyframes page-out {
  to {
    opacity: 0;
    transform: translateY(-5px);
  }
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

@media (min-width: 800px) {
  .recent-life:has(.life-preview:only-child) {
    grid-template-columns: minmax(0, 1fr) 1fr;
  }
  .recent-life:has(.life-preview:only-child) .life-preview {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 5px 30px;
    grid-column: 1 / -1;
    align-items: start;
  }
  .recent-life:has(.life-preview:only-child) .preview-image {
    grid-row: 1 / 3;
    margin: 0;
  }
  .recent-life:has(.life-preview:only-child) .life-preview time {
    align-self: end;
  }
  .recent-life:has(.life-preview:only-child) .life-preview p {
    font-size: 20px;
    margin-top: 5px;
    -webkit-line-clamp: 5;
  }
  .recent-life:has(.life-preview.text-only:only-child) .life-preview {
    display: flex;
  }
}
@media (max-width: 800px) {
  header,
  main,
  footer {
    width: calc(100% - 56px);
  }
  .header {
    min-height: 95px;
    gap: 20px;
  }
  nav a {
    padding: 8px 11px;
  }
  .hero {
    padding: 65px 0;
  }
  .hero-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 24px;
  }
  .hero-title {
    letter-spacing: 0.025em;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .recent-life {
    gap: 16px;
  }
}
@media (max-width: 580px) {
  header,
  main,
  footer {
    width: calc(100% - 40px);
  }
  .header {
    flex-wrap: wrap;
    gap: 13px;
    padding: 25px 0 12px;
  }
  .wordmark {
    font-size: 35px;
  }
  nav {
    justify-content: space-between;
    width: 100%;
    gap: 0;
  }
  nav a {
    font-size: 13px;
    padding: 8px 10px;
  }
  .hero {
    padding: 50px 0 55px;
  }
  .hero-title {
    font-size: clamp(40px, 10.8vw, 62px);
    letter-spacing: 0.025em;
    margin: 0 0 24px -2px;
  }
  .hero-greeting {
    font-size: 15px;
    margin-bottom: 14px;
  }
  .hero-subtitle {
    font-size: 19px;
  }
  .hero-description {
    font-size: 14px;
  }
  .hero-link {
    font-size: 13px;
  }
  .section {
    padding: 32px 0 38px;
  }
  .section-heading {
    gap: 16px;
    margin-bottom: 24px;
  }
  .section-heading h2 {
    font-size: 23px;
  }
  .section-heading p {
    font-size: 12px;
  }
  .section-link {
    font-size: 12px;
  }
  .recent-life {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 14px;
  }
  .recent-life:has(.life-preview:only-child) {
    grid-template-columns: 1fr;
  }
  .recent-life:has(.life-preview:only-child) .life-preview img {
    aspect-ratio: 4 / 3;
  }
  .life-preview p {
    font-size: 14px;
  }
  .preview-image {
    border-radius: 8px;
    margin-bottom: 12px;
  }
  .note-row {
    padding: 23px 0;
  }
  .note-row h2,
  .note-row h3 {
    font-size: 17px;
  }
  .note-row p {
    font-size: 13px;
  }
  .read-label {
    display: none;
  }
  footer {
    flex-wrap: wrap;
    gap: 4px 18px;
    padding: 22px 0;
  }
  footer a:last-child {
    margin-left: 0;
    width: 100%;
  }
  .page-title {
    padding: 40px 0 25px;
  }
  .page-title h1 {
    font-size: 32px;
  }
  .page-title p:last-child {
    font-size: 14px;
  }
  .life-heading {
    align-items: flex-start;
  }
  .life-heading .button {
    margin-top: 32px;
    padding: 9px 15px;
  }
  .life-heading h1 {
    font-size: 29px;
  }
  .panel {
    padding: 21px;
  }
  .empty-projects {
    padding: 30px 24px;
  }
  .life-entry {
    padding: 25px 0 32px;
  }
  .life-gallery {
    gap: 6px;
  }
  .life-gallery a {
    border-radius: 5px;
  }
  .life-caption {
    font-size: 15px;
    margin: 12px 0 20px;
  }
  .article {
    margin-top: 20px;
  }
  .article h1 {
    font-size: 28px;
  }
  .article h2 {
    font-size: 21px;
  }
  .article p,
  .article li {
    font-size: 15px;
  }
  .article-lead {
    font-size: 16px;
  }
  .back {
    margin-bottom: 28px;
  }
  .calendar {
    gap: 4px;
  }
  .day {
    font-size: 12px;
  }
  pre {
    padding: 18px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
  .life-gallery a:hover img,
  .life-preview:hover img,
  .button:hover,
  .wordmark:hover .logo-dot,
  .hero-link:hover span {
    transform: none;
  }
}

/* Project index and long-form reading */
.project-index-heading { max-width: 760px; }
.heading-dot { color: var(--blue); }
.project-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 36px; }
.project-filter { border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; background: transparent; color: var(--muted); }
.project-filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.project-filter:hover { border-color: var(--blue); }
.project-card { padding: 38px 0 42px; border-top: 1px solid var(--line); }
.project-card-meta, .project-article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 13px; }
.project-tag { color: var(--blue); background: var(--tint); border-radius: 5px; padding: 3px 10px; font-size: 12px; letter-spacing: .02em; }
.project-card-title { display: inline-block; margin-top: 18px; }
.project-card-title h2 { font-size: clamp(26px, 4vw, 38px); line-height: 1.3; margin-bottom: 12px; letter-spacing: -.035em; }
.project-focus { margin-bottom: 9px; font-size: 18px; }
.project-description { max-width: 670px; color: var(--muted); margin-bottom: 18px; }
.project-stack { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; color: var(--muted); margin-bottom: 22px; }
.project-stack span + span::before { content: '/'; margin-right: 18px; color: #a7aaa1; }
.project-reader { width: min(1200px, calc(100% - 96px)); }
.project-breadcrumb { display: flex; gap: 12px; color: var(--muted); font-size: 13px; margin: 35px 0; }
.project-article-header { width: 100%; margin: 0 0 46px; max-width: 920px; }
.project-article-header h1 { font-size: clamp(30px, 4vw, 48px); margin: 20px 0; letter-spacing: -.035em; }
.project-article-header > p { max-width: 760px; color: var(--muted); font-size: 18px; }
.project-article-header .project-evidence { border-left: 2px solid var(--blue); padding-left: 16px; font-size: 13px; margin-top: 24px; }
.project-reading-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(32px, 5vw, 70px); align-items: start; }
.project-toc { position: sticky; top: 26px; max-height: calc(100dvh - 52px); overflow-y: auto; scrollbar-width: thin; font-size: 13px; padding-bottom: 20px; }
.project-toc summary { cursor: pointer; font-size: 12px; color: var(--muted); letter-spacing: .06em; padding: 10px 0; }
.project-toc nav { display: grid; gap: 3px; }
.project-toc nav a { display: block; white-space: normal; border-left: 1px solid var(--line); padding: 6px 12px; line-height: 1.6; }
.project-toc nav a[aria-current] { color: var(--blue); background: var(--tint); border-left-color: var(--blue); }
.section-toc { margin-top: 22px; }
.project-prose { min-width: 0; max-width: 820px; line-height: 1.95; overflow-wrap: anywhere; }
.project-prose > p:first-of-type { font-size: 18px; color: #41443d; }
.project-prose h2 { font-size: 25px; margin: 52px 0 20px; padding-top: 10px; scroll-margin-top: 25px; letter-spacing: -.02em; }
.project-prose h3 { font-size: 19px; margin: 32px 0 12px; }
.project-prose p, .project-prose ul, .project-prose ol { margin-bottom: 23px; }
.project-prose li { margin-bottom: 9px; }
.project-prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.project-prose strong { font-weight: 600; }
.project-prose :not(pre) > code { font-size: .87em; padding: 2px 5px; background: var(--wash); border-radius: 3px; }
.project-prose pre { max-width: 100%; overflow-x: auto; line-height: 1.7; }
.project-prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 26px 0; font-size: 14px; line-height: 1.8; }
.project-prose th, .project-prose td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; min-width: 120px; text-align: left; }
.project-prose th { background: var(--wash); font-weight: 600; }
.project-prose blockquote { margin: 26px 0; padding: 16px 22px; border-left: 2px solid var(--blue); background: var(--tint); }
.project-prose blockquote p:last-child { margin-bottom: 0; }
.project-workflow { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 20px 0; border-block: 1px solid var(--line); list-style-position: inside; font-size: 13px; color: var(--blue); }
.project-workflow li { margin: 0; }
.project-sources { margin-top: 48px; padding: 20px 0; border-block: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.project-sources summary { cursor: pointer; color: var(--ink); font-size: 14px; }
.project-sources p { margin: 16px 0; }
.project-sources ul { padding-left: 20px; margin-bottom: 0; }
.chapter-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 36px 0 70px; }
.project-prose .chapter-pagination a { white-space: normal; min-width: 0; display: grid; gap: 8px; text-decoration: none; color: var(--ink); }
.chapter-pagination a:last-child { text-align: right; }
.chapter-pagination span { color: var(--muted); font-size: 12px; }
.chapter-pagination strong { font-size: 15px; line-height: 1.6; }
.chapter-pagination a:hover strong { color: var(--blue); }
@media (max-width: 900px) {
  .project-reader { width: min(760px, calc(100% - 64px)); }
  .project-reading-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .project-toc { position: static; max-height: none; padding: 12px 20px; background: var(--wash); border-radius: 8px; }
  .project-toc .section-toc { margin-top: 8px; }
  .project-toc nav a { padding-block: 9px; }
}
@media (max-width: 560px) {
  .project-reader { width: calc(100% - 40px); }
  .project-article-header { margin-bottom: 28px; }
  .project-article-header > p { font-size: 16px; }
  .project-article-meta { gap: 8px 12px; font-size: 12px; }
  .project-prose { font-size: 15px; }
  .project-prose h2 { font-size: 22px; margin-top: 36px; }
  .project-prose > p:first-of-type { font-size: 16px; }
  .project-prose th, .project-prose td { padding: 12px; }
  .project-filter { padding: 8px 13px; font-size: 13px; }
  .project-card { padding-block: 30px; }
}

.project-collections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 34px 0 60px; }
.collection-card { min-width: 0; }
.collection-link { display: block; }
.collection-art { overflow: hidden; aspect-ratio: 3 / 2; border-radius: 12px; background: #f0f1ed; }
.collection-art img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 450ms var(--ease); }
.collection-link:hover img { transform: scale(1.035); }
.collection-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 8px; }
.collection-caption h2 { font-size: 20px; letter-spacing: -.5px; line-height: 1.4; margin: 0; }
.collection-caption > span { color: var(--blue); }
.collection-link > p { color: var(--muted); font-size: 14px; line-height: 1.85; margin-bottom: 0; }
.collection-chapters { margin: 0 0 52px; }
.collection-chapters > h2 { margin-top: 0; }
.collection-chapters > a { display: block; border-top: 1px solid var(--line); padding: 18px 0; text-decoration: none; }
.collection-chapters h3 { display: flex; justify-content: space-between; gap: 18px; color: var(--ink); margin: 0 0 6px; font-size: 18px; }
.collection-chapters h3 span { color: var(--blue); }
.collection-chapters a:hover h3 { color: var(--blue); }
.collection-chapters a p { color: var(--muted); font-size: 14px; margin-bottom: 0; }
@media (max-width: 800px) { .project-collections { gap: 18px; } .collection-caption h2 { font-size: 18px; } }
@media (max-width: 650px) { .project-collections { grid-template-columns: 1fr; gap: 38px; } .collection-caption h2 { font-size: 23px; } }
@media (prefers-reduced-motion: reduce) { .collection-link:hover img { transform: none; } }

/* Compact collection entries and a visible parent–chapter hierarchy. */
.collection-chapters > a { padding: 12px 0; }
.collection-chapters h3 { font-size: 16px; margin-bottom: 4px; line-height: 1.65; }
.collection-chapters a p { font-size: 13px; line-height: 1.75; }
.project-toc .chapter-nav { gap: 0; }
.project-toc nav a { border: 0; border-radius: 0; min-height: 0; }
.project-toc .chapter-overview { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; color: var(--ink); font-size: 14px; font-weight: 600; }
.chapter-overview span { font-size: 11px; font-weight: 400; color: var(--muted); }
.chapter-children { margin: 7px 0 0 6px; padding: 0 0 0 14px; border-left: 1px solid var(--line); list-style: none; }
.chapter-children li { margin: 0; }
.project-toc .chapter-children a { position: relative; padding: 7px 8px; font-size: 12px; line-height: 1.65; }
.project-toc .chapter-children a[aria-current="page"]::before { content: ''; position: absolute; left: -15px; top: 11px; bottom: 11px; width: 2px; background: var(--blue); }
.project-toc nav a[aria-current] { background: transparent; color: var(--blue); }
.project-toc nav a:hover { background: transparent; color: var(--blue); }
.project-toc .section-toc { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 12px; }
.project-toc .section-nav { gap: 0; }
.project-toc .section-nav a { font-size: 12px; padding: 5px 0; line-height: 1.65; }
.project-toc .section-nav .toc-child { padding-left: 14px; font-size: 11px; }
@media (max-width: 900px) { .project-toc .section-toc { margin-top: 10px; padding-top: 6px; } }

/* The current article outline belongs inside its chapter. */
.project-reading-grid { --toc-width: 180px; grid-template-columns: var(--toc-width) 12px minmax(0, 1fr); column-gap: 20px; }
.project-toc { min-width: 0; }
.project-toc .chapter-overview { font-size: 13px; }
.project-toc .chapter-overview span { font-size: 10px; }
.project-toc .section-nav { display: grid; gap: 0; list-style: none; padding: 1px 0 8px 10px; margin: 0 0 6px 2px; border-left: 1px solid var(--line); }
.project-toc .section-nav li { margin: 0; padding: 0; }
.project-toc .section-nav a { display: block; padding: 4px 2px; font-size: 11px; font-weight: 400; line-height: 1.65; color: var(--muted); }
.project-toc .section-nav a[aria-current="location"] { color: var(--blue); }
.project-toc .section-nav .toc-child { padding-left: 10px; font-size: 10px; }
.project-toc .chapter-children .section-nav { margin: 1px 0 9px 9px; padding-left: 10px; }
.toc-resizer { position: sticky; top: 26px; height: min(65vh, 600px); cursor: col-resize; touch-action: none; outline-offset: 1px; }
.toc-resizer::after { content: ''; position: absolute; top: 0; bottom: 0; left: 5px; width: 1px; background: var(--line); transition: background-color 150ms; }
.toc-resizer:hover::after, .toc-resizer:focus-visible::after, .resizing-toc .toc-resizer::after { width: 2px; background: var(--blue); }
.resizing-toc { user-select: none; cursor: col-resize; }
@media (max-width: 900px) {
  .project-reading-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .toc-resizer { display: none; }
}
