/* Navigation, introductory spread and the living topic map. */
html { scroll-padding-top: 110px; }
.site-chrome { position: sticky; top: 0; z-index: 20; width: 100%; margin: 0; background: var(--paper) url('/assets/paper-grain.svg') repeat; border: 0; border-bottom: 1px solid #c9c5b6; border-radius: 0; box-shadow: none; }
.site-chrome .site-header { display: grid; grid-template-columns: 1fr auto 1fr; width: min(calc(100% - 10rem), 1270px); min-height: 72px; padding: .6rem 0; border: 0; }
.brand-mark { width: 28px; height: 28px; border-radius: 2px; filter: saturate(.7); }
.filter-status { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .65rem; margin-top: .65rem; font-size: .875rem; color: var(--muted); }
#filter-description { min-width: 0; overflow-wrap: anywhere; }
#remove-tag { border: 0; background: #e7eddf; border-radius: 50%; width: 32px; height: 32px; line-height: 1; }
.intro { display: grid; grid-template-columns: minmax(310px, .8fr) minmax(0, 1.55fr); gap: 2.3rem; align-items: center; padding: 2.7rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.intro h1 { font-size: clamp(2.25rem, 3.8vw, 3.2rem); font-weight: 600; margin: 0; letter-spacing: .04em; white-space: nowrap; }
.intro-copy { display: block; min-width: 0; }
.intro-line { max-width: 24em; font-size: .98rem; line-height: 1.8; margin: .5rem 0 0; }
.intro .eyebrow { margin-bottom: .45rem; }
.site-stats { justify-content: flex-start; gap: .3rem 1.25rem; margin: 1.15rem 0 .15rem; }
.site-stats > div { display: flex; align-items: baseline; gap: .3rem; white-space: nowrap; }
.site-stats dt { order: 2; font-size: .82rem; }
.site-stats dd { order: 1; font-size: 1rem; margin: 0; }
.site-stats dd small { font-size: .75rem; }
.count-note { text-align: left; font-size: .78rem; }
.landscape { height: 168px; border-radius: 2px; }
.landscape img { filter: saturate(.73) contrast(.92) brightness(1.04); }
.topics { margin-top: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.topics .section-heading { align-items: center; border-bottom: 0; padding-bottom: .25rem; }
.topics .eyebrow { display: none; }
.graph-controls { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.graph-controls button { background: none; border: 1px solid transparent; padding: .25rem .6rem; border-radius: 16px; color: var(--muted); font-size: .84rem; white-space: nowrap; }
.graph-controls button[aria-pressed="true"] { background: #e5e7da; border-color: #b7bfae; color: var(--ink); }
.graph-hint { margin: .1rem 0 .25rem; font-size: .82rem; color: var(--muted); }
.topics.wide-graph .graph-hint { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#tag-graph { display: block; width: 100%; height: 250px; overflow: hidden; touch-action: pan-y; }
.graph-edges line { stroke: #8c9c81; opacity: .12; transition: opacity .18s; }
.graph-node, .graph-node .node-disc { cursor: grab; outline: none; touch-action: none; }
.graph-node:active, .graph-node:active .node-disc { cursor: grabbing; }
.node-disc { fill: #e9eee1; stroke: #9baa91; stroke-width: 1; transition: fill .18s, stroke .18s; }
.graph-node:nth-child(3n+2) .node-disc { fill: #e5eade; }
.graph-node:nth-child(3n) .node-disc { fill: #ebe9dd; }
.graph-node:nth-child(-n+3) .node-disc { fill: #c7cfbf; stroke: #899a83; }
.graph-node text { font-family: var(--sans); text-anchor: middle; pointer-events: none; }
.node-label { font-size: 14px; fill: var(--ink); }
.node-count { font-size: 10px; fill: var(--muted); }
#tag-graph.is-wide .node-label { font-size: 13px; transform: translateY(8px); }
#tag-graph.is-wide .node-count { display: none; }
.graph-node[aria-pressed="true"] .node-disc { fill: #527253; stroke: #355437; }
.graph-node[aria-pressed="true"] text { fill: #fffef4; }
.graph-node:focus-visible .node-disc { stroke: #284c2f; stroke-width: 3px; }
.has-highlight .graph-node:not(.is-related) { opacity: .36; }
.has-highlight .graph-edges line { opacity: .04; }
.has-highlight .graph-edges line.is-active { opacity: .72; stroke: #5d7657; }
.graph-node.is-active .node-disc { fill: #dce7d4; stroke: #406348; stroke-width: 2; }
.tag-list { display: flex; flex-wrap: wrap; gap: .7rem; padding: 1.6rem 0 2rem; }
.tag-list-link { display: inline-flex; gap: .7rem; align-items: center; padding: .35rem .8rem; border: 1px solid #d0ddc7; background: #eef2e7; border-radius: 20px; font-size: .9rem; overflow-wrap: anywhere; max-width: 100%; }
.tag-list-link span { font-size: .75rem; color: var(--muted); }
.tag-list-link[aria-pressed="true"] { background: #527253; border-color: #527253; color: #fffef4; }
.tag-list-link[aria-pressed="true"] span { color: #fffef4; }
.records { margin-top: 1.2rem; }
.back-to-graph { font-size: .8rem; color: var(--muted); }
.entry-top .entry-category { margin-top: 0; }
.article-toc { margin: 0 0 1.8rem; border-left: 1px solid var(--line); padding-left: 1rem; color: var(--muted); font-size: .88rem; }
.article-toc p { color: var(--ink); margin: 0 0 .4rem; }
.article-toc nav { display: grid; gap: .25rem; }
.article-toc a { overflow-wrap: anywhere; }
.article-toc .toc-level-4, .article-toc .toc-level-5, .article-toc .toc-level-6 { padding-left: .65rem; }
.article-toc-compact { display: none; }
@media screen and (max-width: 1000px) {
  .article-toc:not(.article-toc-compact) { display: none; }
  .article-toc-compact { display: block; }
  .article-toc-compact summary { cursor: pointer; color: var(--green); padding-block: .6rem; width: fit-content; }
  .article-toc-compact summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
  .article-toc-compact nav a { padding-block: .35rem; }
}
@media (max-width: 1100px) {
  .notebook-shell .wrap, .site-chrome .site-header { width: calc(100% - 4rem); }
}
@media (max-width: 900px) {
  .site-chrome .site-header { display: flex; justify-content: space-between; }
  .intro { display: block; padding-top: 2.2rem; }
  .intro-data { margin-top: 0; }
  .intro .landscape { height: 175px; margin-top: 1.65rem; }
  .site-stats { justify-content: flex-start; }
  .count-note { text-align: left; }
  .site-chrome .site-header { min-height: 58px; }
}
@media (max-width: 640px) {
  .site-chrome { top: 0; margin-top: 0; width: 100%; border-radius: 0; }
  html { scroll-padding-top: 120px; }
  .site-chrome .site-header nav { gap: 1rem; }
  .intro .landscape { height: 135px; }
  .topics { margin-top: 1.7rem; }
  .topics .section-heading { display: flex; flex-wrap: wrap; gap: .7rem; }
  .graph-controls { justify-content: flex-start; }
  #tag-graph { height: 430px; }
  .graph-hint { line-height: 1.7; }
  .site-stats { gap: .8rem 1.5rem; }
  .node-label { font-size: 12px; }
  .node-count { font-size: 9px; }
  .tag-list-link { min-height: 44px; padding: .5rem .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .graph-edges line, .node-disc { transition: none; }
}
@media print { .site-chrome, .graph-controls { display: none; } }

/* Four true navigation entries, with tag status confined to the homepage. */
.site-chrome .site-header nav { gap: 1.8rem; }
.site-chrome .site-header nav a { white-space: nowrap; }
.site-footer nav { display: flex; gap: 1.5rem; }
.section-listing { margin-top: 0; }
.listing-heading { padding: 3rem 0 1.5rem; border-bottom: 1px solid #bccfba; }
.listing-heading > div { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 1rem; align-items: baseline; }
.listing-heading > div > #list-summary { grid-column: 1 / -1; margin-top: .65rem; }

.listing-heading h1 { font: 500 clamp(1.9rem, 4vw, 2.7rem)/1.5 var(--serif); letter-spacing: .04em; margin: 0; }
.listing-intro { color: var(--muted); font-size: .95rem; margin: 0; }

#list-summary { font-size: .8rem; color: var(--muted); margin: .5rem 0 0; }
#records-title:focus { outline: none; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 2rem 0 0; padding-top: 1.2rem; font-size: .9rem; }
.page-numbers { display: flex; align-items: center; gap: .35rem; }
.page-number { display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: 7px; border: 1px solid transparent; }
.page-number[aria-current="page"] { background: #e7eddf; border-color: #b8cbb0; }
.pager-step { padding: .4rem .7rem; border: 1px solid #d0ddc7; border-radius: 7px; white-space: nowrap; }
.pager-step[aria-disabled] { color: #8c9985; border-color: #e2e7db; }
.page-indicator { display: none; color: var(--muted); white-space: nowrap; font-size: .8rem; }
.page-gap { color: var(--muted); }
@media (max-width: 640px) {
  .site-chrome .site-header { gap: .25rem; }
  .site-chrome .site-header nav { width: 100%; justify-content: space-between; gap: .6rem; margin-top: .3rem; }
  .listing-heading { padding-top: 2rem; }
  .page-numbers { display: none; }
  .page-indicator { display: inline; }
  .pagination { justify-content: space-between; gap: .45rem; font-size: .85rem; }
  .pager-step { padding-inline: .55rem; }
}

/* Dates stay secondary to titles, with room to wrap on small screens. */
.note-time { display: flex; flex-wrap: wrap; gap: .35rem 1rem; color: var(--muted); font-size: .84rem; margin-top: .6rem; line-height: 1.7; }
.note-time span { white-space: nowrap; }
.article-meta .note-time { margin: 0; }
.recent-records .section-heading { align-items: flex-start; }
.recent-records .more-notes { white-space: nowrap; padding-top: .2rem; }
@media (max-width: 400px) { .recent-records .section-heading { gap: .6rem; } .recent-records .more-notes { font-size: .8rem; } }

body { background: #edeef0; }
.notebook-shell {
  display: flex;
  flex-direction: column;
  width: min(calc(100% - 3rem), 1240px);
  min-height: calc(100vh - 3rem);
  margin: 1.5rem auto;
  background: #fff;
  border: 1px solid #d5d8d6;
}
.notebook-shell > .site-layout { flex: 1; }
.notebook-shell .site-chrome {
  width: 100%;
  margin: 0;
  top: 0;
  background: #e5ece3;
  border: 0;
  border-bottom: 1px solid #dfe2de;
}
.header-rss {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: .3rem;
  padding: .45rem 0;
  font: .875rem/1.4 var(--sans);
  color: #395744;
  white-space: nowrap;
}
.header-rss:hover { text-decoration: underline; text-underline-offset: .2rem; }
.header-rss svg { flex: none; }
@media (min-width: 901px) and (max-width: 1100px) {
  .site-header nav { grid-area: 1 / 2; }
  .header-rss { grid-area: 1 / 3; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .site-chrome .site-header { gap: .85rem; }
  .header-rss { order: 1; }
}
.notebook-shell .site-header nav a[aria-current] {
  color: var(--ink);
  text-decoration: none;
  box-shadow: inset 0 -1px #6f7a69;
}
.notebook-shell .site-footer { margin-top: 3rem; }
.notebook-shell .essay-entry { border-bottom: 1px solid #d4d0c3; }
.notebook-shell .section-heading,
.notebook-shell .listing-heading { border-bottom-color: #bcbba9; }
.notebook-shell .site-footer { border-top-color: #bcbba9; }
.entry-tags a { display: inline-block; padding: .04rem .45rem; border-radius: 999px; background: #e7e6da; }
.entry-tags a::before { content: none; }
.recent-records { margin-top: 2rem; }
.recent-records .essay-entry { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.85fr) minmax(0, 1fr) minmax(0, 120px); gap: 1.25rem; align-items: center; padding: .85rem .1rem; }
.recent-records .entry-top { display: flex; align-items: baseline; justify-content: flex-start; flex-wrap: wrap; gap: .15rem .7rem; }
.recent-records .entry-top h3 { font-size: 1.18rem; line-height: 1.45; }
.recent-records .entry-category { display: block; font-size: .72rem; margin: 0; white-space: nowrap; }
.recent-records .entry-excerpt { font-size: .96rem; line-height: 1.65; margin: 0; }
.recent-records .entry-tags { gap: .35rem; font-size: .82rem; }
.recent-records .note-time { margin: 0; justify-content: flex-end; text-align: right; font-size: .84rem; }
.recent-records .entry-category { display: none; }
.recent-records #list-summary { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.page-number[aria-current="page"] { background: #e7e6da; border-color: #bfc5b5; }
.pager-step { border-color: #c7cab9; }
@media (max-width: 900px) {
  .recent-records .essay-entry { display: block; padding: 1.15rem .1rem; }
  .recent-records .entry-excerpt { margin: .3rem 0 .55rem; }
  .recent-records .note-time { justify-content: flex-start; text-align: left; margin-top: .5rem; }
}
.sidebar-links, .sidebar-secondary, .interior-layout .site-sidebar { display: none; }
.skip-link { z-index: 30; }
@media screen and (min-width: 1101px) {
  .notebook-shell .site-chrome {
    background-image: url('/assets/header-grass.svg');
    background-position: center top;
    background-repeat: no-repeat;
    background-size: 100% 72px;
  }
  .notebook-shell .site-header { display: flex; }
  .notebook-shell .site-header nav { display: none; }
  .site-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    column-gap: clamp(1.75rem, 3vw, 2.5rem);
  }
  .site-sidebar {
    align-self: start;
    margin-top: 1.4rem;
    padding: 1rem .875rem .75rem;
    background: #f4f7f2;
    border-inline-end: 1px solid #dfe2de;
  }
  .interior-layout .site-sidebar {
    display: block;
    position: sticky;
    top: 88px;
    max-height: calc(100dvh - 88px - 1rem);
    overflow-y: auto;
  }
  .sidebar-explorer summary {
    cursor: pointer;
    padding: .4rem .6rem;
    border: 1px solid #d4ddd1;
    border-radius: 3px;
    color: var(--green);
    background: #fff;
    font-size: .88rem;
  }
  .sidebar-explorer[open] summary { margin-bottom: .65rem; }
  .sidebar-explorer .section-heading h2 { font-size: 1.05rem; }
  .sidebar-links { display: block; border-bottom: 1px solid #d4ddd1; margin-bottom: .7rem; padding-bottom: .65rem; }
  .sidebar-links h2 { font: 500 1.2rem/1.5 var(--serif); letter-spacing: .04em; margin: 0 0 .5rem; }
  .sidebar-links nav { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .4rem; }
  .sidebar-links nav a { display: block; padding: .24rem .45rem; font-size: .93rem; border-radius: 3px; }
  .sidebar-links nav a:hover, .sidebar-links nav a[aria-current] { background: #e2ebe0; color: var(--ink); }
  .sidebar-links nav a[aria-current] { font-weight: 600; box-shadow: inset 2px 0 #698670; }
  .sidebar-secondary { display: block; color: var(--muted); font-size: .8rem; margin: .7rem 0 0; padding-top: .5rem; border-top: 1px solid #d4ddd1; }
  .site-layout > main { min-width: 0; }
  .interior-layout .reading-main { padding-top: .5rem; }
  .home-layout {
    grid-template-rows: auto 1fr;
    grid-template-areas: "sidebar intro" "sidebar records";
  }
  .home-layout .site-sidebar { grid-area: sidebar; }
  .home-layout .intro { grid-area: intro; display: block; padding: 2rem 0 1.25rem; }
  .home-layout .intro h1 { white-space: normal; }
  .home-layout .landscape { height: clamp(112px, 11vw, 160px); margin-top: 1rem; }
  .site-sidebar .topics { margin: 0; padding: 0; border: 0; }
  .site-sidebar .topics .section-heading { display: block; }
  .site-sidebar .graph-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: .7rem 0 .4rem;
    border: 1px solid #d4ddd1;
    border-radius: 4px;
  }
  .site-sidebar .graph-controls button { border: 0; border-radius: 3px; }
  .site-sidebar .graph-controls button[aria-pressed="true"] { background: #dfe8dc; }
  .site-sidebar #tag-graph { --sidebar-graph-height: 325px; height: var(--sidebar-graph-height); }
  .site-sidebar .node-label { font-size: 13px; transform: translateY(4px); }
  .site-sidebar .node-count { display: none; }
  .site-sidebar .tag-list { display: grid; gap: 0; padding: .5rem 0 0; }
  .site-sidebar .tag-list-link {
    justify-content: space-between;
    padding: .45rem .5rem;
    border: 0;
    border-bottom: 1px solid #dfe2de;
    border-radius: 0;
    background: none;
  }
  .site-sidebar .tag-list-link:hover { background: #e9efe6; }
  .site-sidebar .tag-list-link[aria-pressed="true"] { background: #dfe8dc; color: var(--ink); }
  .site-sidebar .tag-list-link[aria-pressed="true"] span { color: var(--muted); }
  .site-sidebar .tag-list-link span { flex-shrink: 0; }
  .site-sidebar .tag-list-link span::after { content: ' 篇'; }
  .home-layout .recent-records { grid-area: records; align-self: start; margin-top: 1.3rem; }
  .home-layout .recent-records .essay-entry {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title date" "excerpt excerpt" "tags tags";
    gap: .3rem 1rem;
  }
  .home-layout .entry-top { grid-area: title; }
  .home-layout .entry-excerpt { grid-area: excerpt; }
  .home-layout .entry-tags { grid-area: tags; }
  .home-layout .note-time { grid-area: date; }
}
@media screen and (min-width: 1280px) {
  .home-layout .recent-records .essay-entry {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr) auto;
    grid-template-areas: "title excerpt date" "tags excerpt date";
    align-items: start;
  }
  .home-layout .entry-excerpt, .home-layout .note-time { padding-top: .15rem; }
}
@media (max-width: 640px) {
  .notebook-shell {
    width: calc(100% - .5rem);
    min-height: calc(100vh - .5rem);
    margin: .25rem auto;
    border-radius: 2px;
  }
  .notebook-shell .site-chrome { border-radius: 1px 1px 0 0; }
  .notebook-shell .wrap { width: calc(100% - 2rem); }
  .site-chrome .site-header { display: flex; position: relative; padding: .65rem 0; }
  .site-header nav { order: 1; }
  .header-rss .rss-label { display: none; }
}
@media screen and (max-width: 640px) {
  .site-header::before {
    content: "";
    position: absolute;
    inset-block-start: .4rem;
    inset-inline: 7.5rem 3.4rem;
    height: 2.5rem;
    background: url('/assets/header-grass.svg') center / 150% 100% no-repeat;
    mask-image: linear-gradient(to right, transparent, #000 24%, #000 76%, transparent);
    opacity: .58;
    pointer-events: none;
  }
}
@media print {
  .notebook-shell { width: 100%; min-height: 0; margin: 0; border: 0; box-shadow: none; }
}

@media (max-width: 400px) {
  .listing-heading > div, .intro-copy { column-gap: .7rem; }
  .listing-intro { font-size: .86rem; }
}
@media (max-width: 360px) {
  .intro-copy { column-gap: .55rem; }
  .intro-copy h1 { font-size: 1.95rem; }
  .intro-copy .intro-line { font-size: .82rem; }
}
