@font-face {
  font-family: "Noto Serif SC";
  src: url("noto-serif-sc-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ground: #e0dfd3;
  --paper: #f6efe1;
  --paper-warm: #f1e8d6;
  --ink: #332b24;
  --olive: #515943;
  --rule: #c9beaa;
  --accent: #843d49;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='162' height='162'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.76' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='.13'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.8 var(--sans); }
a { color: inherit; text-underline-offset: .24em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.frame { width: min(1140px, calc(100% - 2 * clamp(16px, 5.5vw, 82px))); margin-inline: auto; }
:where(#about, #sites, #writing) { scroll-margin-top: 24px; }

.skip-link {
  position: fixed;
  z-index: 2;
  top: 8px;
  left: 8px;
  padding: 6px 12px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.site-header {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--olive);
}

.masthead {
  font: 700 15px/1.4 var(--serif);
  letter-spacing: .14em;
  white-space: nowrap;
  text-decoration: none;
}
.site-header nav { display: flex; align-items: center; gap: clamp(14px, 3.2vw, 40px); }
.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.site-header a:hover { text-decoration: underline; }

.spread {
  display: grid;
  grid-template-columns: 53% 47%;
  min-height: 622px;
  box-shadow: 0 1px 0 #c8beaa, 0 3px 0 -1px #ae9f85, 0 10px 28px #55462b22;
}
.spread-page {
  min-width: 0;
  padding: clamp(34px, 5vw, 76px) clamp(25px, 4.7vw, 72px);
  background-image: var(--grain);
  background-blend-mode: multiply;
}
.opening {
  display: grid;
  align-content: center;
  gap: clamp(27px, 3.25vw, 47px);
  background-color: var(--paper);
  border-right: 1px solid #bdb098;
  box-shadow: inset -10px 0 18px -17px #725d3d90;
}
.opening h1 {
  margin: 0 0 19px -.046em;
  font: 400 clamp(74px, 9.45vw, 142px)/.86 Georgia, "Times New Roman", serif;
  letter-spacing: -.065em;
}
.opening-note p {
  max-width: 29em;
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.95;
}
.opening-note p + p { margin-top: 7px; }
.opening-note .identity { color: var(--olive); font-size: 13px; letter-spacing: .05em; }

.site-index h2 {
  margin: 0 0 9px;
  color: var(--olive);
  font: 700 12px/1.55 var(--serif);
  letter-spacing: .15em;
}
.site-index ol { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--rule); }
.site-index a {
  display: grid;
  grid-template-columns: 1.2em minmax(3em, .78fr) minmax(0, 2fr);
  align-items: baseline;
  gap: clamp(9px, 1.35vw, 19px);
  min-height: 51px;
  padding: 10px 3px;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.site-index strong { font: 700 clamp(20px, 2vw, 26px)/1.35 var(--serif); letter-spacing: .06em; }
.site-index .folio-number { color: var(--olive); font: 700 11px/1.4 var(--serif); }
.site-index a > span:last-child { color: var(--olive); font-size: 13px; overflow-wrap: anywhere; }
.site-index a:is(:hover, :focus-visible) strong { text-decoration: underline; }

.plate-page {
  display: grid;
  align-items: center;
  justify-items: center;
  background-color: var(--paper-warm);
  box-shadow: inset 10px 0 18px -17px #725d3d90;
}
.plate { width: min(100%, 350px); margin: 0; }
.plate img { display: block; width: 100%; height: auto; box-shadow: 0 0 0 1px #75604053, 1px 3px 6px #6e56292b; }
.plate figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 11px;
  color: var(--olive);
  font: 12px/1.65 var(--serif);
}
.plate figcaption a { text-decoration-color: #a2947e; }
.plate figcaption > span { font-family: Georgia, serif; }

.writing {
  width: min(100%, 880px);
  margin: clamp(50px, 7.5vw, 99px) auto 0;
}
.writing-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-bottom: 15px;
}
.writing h2 { margin: 0 0 3px; font: 700 clamp(27px, 3.1vw, 39px)/1.38 var(--serif); letter-spacing: -.025em; }
.writing-head p { margin: 0; color: var(--olive); font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 0 17px; }
.filters button {
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--olive);
  font: 13px/1.5 var(--sans);
  cursor: pointer;
}
.filters button:is(:hover, [aria-pressed="true"]) { color: var(--accent); }
.filters button[aria-pressed="true"] { border-color: currentColor; }

.entries { border-bottom: 1px solid #a8a692; }
.entries details { border-top: 1px solid #a8a692; }
.entries summary {
  display: grid;
  grid-template-columns: 5.6em minmax(0, 1fr) 16px;
  align-items: baseline;
  gap: 14px;
  padding: 17px 0;
  list-style: none;
  cursor: pointer;
}
.entries summary::-webkit-details-marker { display: none; }
.entries summary > span { color: var(--olive); font-size: 13px; }
.entries strong { font: 700 clamp(19px, 2.35vw, 25px)/1.5 var(--serif); }
.entries summary:hover strong { color: var(--accent); }
.entries i {
  width: 7px;
  height: 7px;
  justify-self: center;
  border: solid var(--olive);
  border-width: 0 1px 1px 0;
  transform: translateY(-3px) rotate(45deg);
}
.entries details[open] i { transform: rotate(225deg); }
.entries details p {
  max-width: 39em;
  margin: 0 20px 20px calc(5.6em + 14px);
  color: #494438;
  font-size: 15px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: clamp(45px, 6.3vw, 80px);
  padding: 14px 0 24px;
  border-top: 1px solid #a8a692;
  color: var(--olive);
  font-size: 12px;
}
.site-footer p { margin: 0; }
.site-footer > a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 760px) {
  .site-header { min-height: 61px; }
  .spread { grid-template-columns: 1fr; min-height: auto; }
  .opening { gap: 28px; border-right: 0; border-bottom: 1px solid #c6baa2; box-shadow: none; }
  .spread-page { padding-inline: clamp(19px, 6.3vw, 49px); }
  .opening h1 { margin-bottom: 17px; }
  .opening-note p { font-size: 14px; }
  .site-index a { min-height: 47px; }
  .plate-page { padding-block: 27px 23px; box-shadow: inset 0 10px 16px -17px #725d3d90; }
  .plate { width: min(100%, 302px); }
}

@media (max-width: 470px) {
  .masthead { font-size: 13px; letter-spacing: .09em; }
  .site-header nav { gap: 16px; }
  .writing-head { gap: 10px; margin-bottom: 10px; }
  .entries summary { grid-template-columns: 3.7em minmax(0, 1fr) 12px; gap: 7px; }
  .entries summary > span { font-size: 12px; }
  .entries details p { margin-left: 0; margin-right: 15px; }
  .site-footer p { flex-basis: 100%; }
}

.treehole.frame,
.treehole-header.frame { max-width: 680px; }

.treehole {
  margin-bottom: 36px;
  padding: clamp(25px, 6vw, 55px) clamp(18px, 6vw, 55px);
  background-color: var(--paper);
  background-image: var(--grain);
  background-blend-mode: multiply;
  box-shadow: 0 1px 0 #c8beaa, 0 3px 0 -1px #ae9f85, 0 10px 28px #55462b22;
}

.treehole h1 {
  margin: 0;
  font: 700 clamp(36px, 7vw, 52px)/1.3 var(--serif);
  letter-spacing: .07em;
}

.treehole .treehole-intro {
  margin: 12px 0 26px;
  color: var(--olive);
  font-size: 14px;
}

.treehole form {
  display: grid;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.treehole label {
  font: 700 16px/1.65 var(--serif);
}

.treehole select,
.treehole textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #a99e88;
  border-radius: 0;
  background-color: var(--paper-warm);
  color: var(--ink);
  font: inherit;
}

.treehole select {
  width: min(100%, 16em);
  margin-bottom: 12px;
}

.treehole textarea {
  min-height: 160px;
  resize: vertical;
}

.treehole .treehole-limit {
  margin: 0;
  color: var(--olive);
  font-size: 13px;
}

.treehole .treehole-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 10px;
}

.treehole button {
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid var(--olive);
  border-radius: 0;
  background-color: var(--olive);
  color: var(--paper);
  font: 700 16px/1.6 var(--serif);
  cursor: pointer;
}

.treehole button:hover:not(:disabled) { background-color: var(--accent); }
.treehole button:disabled { opacity: .7; cursor: default; }

.treehole .treehole-status {
  flex: 1 1 16em;
  margin: 0;
  color: var(--olive);
  font-size: 14px;
}

.treehole .treehole-status[data-error] { color: var(--accent); }

