:root {
  color-scheme: light;
  --bg: #f7f5ed;
  --surface: #fffdf5;
  --ink: #242923;
  --muted: #555d56;
  --line: #c9ccc0;
  --accent: #234e6a;
  --wash: #e7ebea;
  --shadow: light-dark(#deded0, #151a1c);
  --green: #24765f;
  --blue: #365da7;
  --violet: #6947a7;
  --pink: #a73e69;
  --font: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

:root[data-palette="lilac"] { --bg: #faf9fe; --line: #e2deee; --accent: #5942a3; --wash: #eee8ff; }
:root[data-palette="mint"] { --bg: #f6fbf8; --line: #d8e7df; --accent: #176d56; --wash: #dff3e9; }
:root[data-palette="peach"] { --bg: #fff9f6; --line: #eeded7; --accent: #a34738; --wash: #ffe8de; }

@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) { color-scheme: dark; }
}
:root[data-mode="dark"] { color-scheme: dark; }

:root {
  --page: light-dark(var(--bg), #191824);
  --panel: light-dark(var(--surface), #242332);
  --text: light-dark(var(--ink), #eeedf6);
  --secondary: light-dark(var(--muted), #b9b5ca);
  --border: light-dark(var(--line), #39364d);
  --highlight: light-dark(var(--accent), #a5c8e1);
  --tint: light-dark(var(--wash), #352c50);
}
:root[data-palette="lilac"] { --highlight: light-dark(var(--accent), #c6b6ff); }
:root[data-palette="mint"] {
  --page: light-dark(var(--bg), #151e1c);
  --panel: light-dark(var(--surface), #202c28);
  --border: light-dark(var(--line), #35473e);
  --highlight: light-dark(var(--accent), #94dfbf);
  --tint: light-dark(var(--wash), #26463a);
}
:root[data-palette="peach"] {
  --page: light-dark(var(--bg), #221a1c);
  --panel: light-dark(var(--surface), #2d2226);
  --border: light-dark(var(--line), #4d383e);
  --highlight: light-dark(var(--accent), #ffbcab);
  --tint: light-dark(var(--wash), #503136);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--page); font: 16px/1.7 var(--font); }
a { color: inherit; text-underline-offset: .24em; }
a:hover { color: var(--highlight); }
:focus-visible { outline: 2px solid var(--highlight); outline-offset: 4px; }
.wrap { width: min(1056px, calc(100% - 96px)); margin-inline: auto; }
.skip { position: fixed; z-index: 2; top: -8rem; left: 1rem; padding: .5rem 1rem; background: var(--panel); }
.skip:focus { top: 1rem; }
.masthead, .footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.masthead { min-height: 94px; border-bottom: 1px solid var(--border); font-size: 14px; }
.masthead a, .footer a { text-decoration: none; }
.profile, nav { display: flex; align-items: center; flex-wrap: wrap; }
.profile { gap: 10px; font-weight: 700; }
nav { justify-content: flex-end; gap: 5px clamp(14px, 3vw, 30px); }
nav a { padding-block: 8px; }
[aria-current="page"] { color: var(--highlight); text-decoration: underline !important; }
.social { display: inline-grid; place-items: center; width: 32px; height: 32px; color: var(--secondary); }
.social svg { width: 17px; height: 17px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 29%);
  align-items: center;
  gap: clamp(32px, 7vw, 100px);
  padding: 70px 14px 84px 0;
}
.byline { margin: 0 0 18px; color: var(--secondary); font-size: 14px; letter-spacing: .12em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.27; font-family: var(--serif); }
.hero h1 { font-size: clamp(47px, 6.5vw, 86px); line-height: 1.14; letter-spacing: .015em; }
.hero h1 span { color: var(--highlight); }
.lede { margin: 22px 0; color: var(--secondary); }
.entry { display: inline-flex; gap: 1.4rem; padding: .5rem 0 .25rem; color: var(--highlight); border-bottom: 1px solid; font-weight: 650; text-decoration: none; }
.entry:hover { border-bottom-width: 2px; margin-bottom: -1px; }
.photo { margin: 0; padding: 10px; border: 1px solid var(--border); background: var(--panel); box-shadow: 5px 6px 0 var(--shadow); transform: rotate(2deg); }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 4.5; object-fit: cover; }
.photo figcaption { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: 8px 2px 0; font: 14px var(--serif); }
.photo figcaption span { color: var(--secondary); font: 11px var(--mono); letter-spacing: .09em; }
.timeline { border-top: 1px solid var(--border); padding-top: 25px; }
.timeline > h2 { font-size: 25px; }
.year { margin-top: 26px; }
.year-label { color: var(--secondary); font: 14px/1.5 var(--mono); margin-bottom: 12px; }
.feed { list-style: none; margin: 0 0 0 67px; padding: 0; border-left: 1px solid var(--border); }
.feed-row { position: relative; padding: 0 0 26px 23px; }
.feed-row::before {
  content: "";
  position: absolute;
  top: 10px;
  left: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--highlight);
  box-shadow: 0 0 0 4px var(--page);
}
.feed-row > time { position: absolute; top: 6px; right: calc(100% + 14px); }
time { color: var(--secondary); font: 12px/1.4 var(--mono); white-space: nowrap; }
.category { color: var(--highlight); background: var(--tint); border-radius: 4px; padding: 2px 7px; font-size: 12px; }
.category[data-color="green"] { color: light-dark(var(--green), #a6e3c4); }
.category[data-color="blue"] { color: light-dark(var(--blue), #b4ccff); }
.category[data-color="violet"] { color: light-dark(var(--violet), #d4beff); }
.category[data-color="pink"] { color: light-dark(var(--pink), #ffb1ce); }
.feed-entry h3, .feed-entry h4 { font-size: 19px; margin-top: 7px; }
.feed-entry h3 a, .feed-entry h4 a { text-decoration: none; }
.feed-entry h3 a:hover, .feed-entry h4 a:hover { text-decoration: underline; }
.feed-entry p { color: var(--secondary); margin: 5px 0 0; }
.draft, .empty { color: var(--secondary); font-size: 14px; }
.directory { margin-top: 32px; }
.directory-entry { padding: 24px 0; border-top: 1px solid var(--border); }
.directory-entry:last-child { border-bottom: 1px solid var(--border); }
.directory-entry h2 { font-size: clamp(24px, 4vw, 33px); }
.directory-entry h2 a { text-decoration: none; }
.directory-entry h2 a:hover { text-decoration: underline; }
.directory-entry > p { max-width: 66ch; margin: 8px 0; }
.directory-entry img { max-width: 100%; height: auto; }
.reading, .archive { padding-block: 45px; }
.reading { max-width: 690px; margin-inline: auto; }
.reading h1, .archive h1 { font-size: clamp(33px, 6vw, 55px); margin-top: 14px; }
.back { color: var(--highlight); text-decoration: none; font-size: 14px; }
.back:hover { text-decoration: underline; }
.entry-meta { margin: 10px 0 0; color: var(--secondary); font-size: 14px; }
.prose { margin-top: 24px; line-height: 1.85; overflow-wrap: anywhere; }
.prose h2, .prose h3 { margin-top: 1.65em; }
.prose a { color: var(--highlight); }
.prose img { max-width: 100%; height: auto; }
.prose pre { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; overflow-x: auto; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.prose :is(td, th) { padding: .35rem .6rem; border: 1px solid var(--border); }
.prose blockquote { margin-inline: 0; border-left: 3px solid var(--border); padding-left: 15px; color: var(--secondary); }
.footer { border-top: 1px solid var(--border); margin-top: 24px; padding-block: 16px 24px; color: var(--secondary); font-size: 13px; }
.appearance { position: relative; }
.appearance summary { cursor: pointer; list-style: none; padding: 4px 0 4px 10px; }
.appearance summary::-webkit-details-marker { display: none; }
.appearance summary:hover { color: var(--highlight); }
.appearance-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 1;
  width: min(250px, calc(100vw - 32px));
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}
.appearance fieldset { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 10px; }
.appearance legend { margin-bottom: 4px; }
.appearance input { accent-color: var(--highlight); vertical-align: middle; margin: 0; }
.mode select { margin-left: 6px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 3px; }

@media (max-width: 680px) {
  .wrap { width: calc(100% - 32px); }
  .masthead { min-height: 62px; align-items: baseline; padding-block: 10px; }
  nav { gap: 0 12px; }
  .profile { gap: 5px; }
  .profile > a:first-child { white-space: nowrap; }
  .social { width: 25px; }
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 44px 0 46px; }
  .photo { width: min(72%, 270px); margin-left: 7px; }
  .feed { margin-left: 52px; }
  .feed-row { padding-left: 16px; }
  .feed-row > time { right: calc(100% + 9px); }
}
