:root {
  color-scheme: dark;
  --paper: #171719;
  --panel: #1f1e22;
  --ink: #e7e3de;
  --muted: #aaa5ad;
  --link: #c7b9e7;
  --line: #3b373f;
  --serif: Georgia, "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Inter", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); }
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: 4px; }
a:hover, .text-button:hover { color: #e7dafa; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; }
.shell { width: min(1040px, calc(100% - 64px)); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 65px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand { justify-self: start; color: var(--ink); text-decoration: none; font: 700 15px/1.3 var(--mono); letter-spacing: .04em; white-space: nowrap; }
nav, .header-actions { display: flex; align-items: center; gap: 24px; font-size: 14px; }
nav a[aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration-thickness: 2px; }
.header-actions { justify-content: flex-end; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; padding: 5px 12px; border-radius: 3px; font-size: 14px; font-weight: 650; white-space: nowrap; }
.button-primary { color: #201c2b; background: var(--link); }
.button-primary:hover { background: #dfcff5; }
.button-outline { background: transparent; color: var(--link); border-color: #686071; }
.button-outline:hover { background: var(--panel); }

.masthead { padding-block: clamp(46px, 7vw, 85px) 38px; border-bottom: 1px solid var(--line); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1, .reading-card h2 { font-family: var(--serif); }
h1 { font-size: clamp(46px, 7vw, 78px); font-weight: 700; letter-spacing: -.045em; }
.masthead p { margin: 14px 0 0; color: var(--muted); font-size: 14px; }

.archive, #discussion { scroll-margin-top: 24px; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.section-header h2 { font-size: 14px; font-weight: 700; }
.search { width: min(200px, 50%); }
.search input { padding: 5px 9px; margin: 0; font-size: 13px; }
.journal-layout { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 3fr); }
.journal-index { padding: 22px 24px 18px 0; }
.index-header, .discussion-header, .dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.index-header { padding-bottom: 9px; border-bottom: 1px dotted var(--line); }
.index-header h3, .drafts h3 { font-size: 13px; }
.index-header span, .discussion-header span, .meta, .muted { color: var(--muted); font-size: 13px; }
.index-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; color: var(--link); background: transparent; border: 0; border-bottom: 1px dotted var(--line); padding: 10px 8px; overflow-wrap: anywhere; }
.index-item strong { font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.index-item:hover, .index-item[aria-current="true"] { background: var(--panel); }
.index-item[aria-current="true"] { box-shadow: inset 2px 0 var(--link); }
.index-item small, .meta { color: var(--muted); font: 12px/1.6 var(--mono); }
.drafts { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.drafts h3 { margin-bottom: 7px; }
.journal-layout > div { min-width: 0; border-left: 1px solid var(--line); }
.reading-card { padding: clamp(25px, 4.5vw, 48px); min-height: 225px; }
.reading-card h2 { margin: 8px 0 19px; font-size: clamp(26px, 4vw, 40px); overflow-wrap: anywhere; }
.entry-body { margin: 0; max-width: 36em; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.95; }
.reading-card .button-row { margin-top: 24px; }
.discussion-card { border-top: 1px solid var(--line); padding: 22px clamp(25px, 4.5vw, 48px) 28px; }
.discussion-header h2 { font-size: 16px; }
.comment { border-top: 1px dotted var(--line); padding-block: 14px 3px; margin-top: 12px; }
.comment-name { font-weight: 700; overflow-wrap: anywhere; }
.comment p { margin: 7px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .text-button { font-size: 12px; }
.comment-form { margin-top: 16px; }
.comment-form label { display: block; }
.site-footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 27px; padding-block: 18px 32px; color: var(--muted); font-size: 13px; }

dialog { width: min(490px, calc(100% - 32px)); padding: 25px; border: 1px solid #625a6d; border-radius: 5px; background: var(--panel); color: var(--ink); box-shadow: 0 18px 55px #0007; }
dialog::backdrop { background: #0d0c10ba; }
#editor { width: min(650px, calc(100% - 32px)); }
.dialog-header { margin-bottom: 18px; }
.dialog-header h2 { font: 700 26px/1.2 var(--serif); }
.close-button { font-size: 24px; color: var(--muted); background: transparent; border: 0; border-radius: 3px; }
.close-button:hover { color: var(--ink); }
form label { font-size: 14px; font-weight: 600; }
input, textarea, select { display: block; width: 100%; margin: 4px 0 14px; padding: 8px 10px; border: 1px solid #5d5663; border-radius: 3px; color: var(--ink); background: #19181b; }
textarea { resize: vertical; }
.button-row, .account-links { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; }
.account-links { margin-top: 12px; }
.text-button { border: 0; padding: 3px 0; font-size: 14px; color: var(--link); background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.status { color: #ffb4aa; font-size: 14px; }
.sr-only { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }

@media (max-width: 720px) {
  .shell { width: calc(100% - 36px); }
  .header-inner { gap: 12px; min-height: 58px; }
  nav { gap: 15px; }
  .masthead { padding-block: 38px 27px; }
  .journal-layout { grid-template-columns: 1fr; }
  .journal-index { padding: 16px 0; }
  .journal-layout > div { border-left: 0; border-top: 1px solid var(--line); }
  .reading-card, .discussion-card { padding-inline: 0; }
}
@media (max-width: 490px) {
  .header-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 9px; padding-block: 10px; }
  nav { order: 3; width: 100%; border-top: 1px dotted var(--line); padding-top: 7px; }
  .header-actions .button { padding-inline: 9px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
