:root {
  color-scheme: light;
  --background: #f8f7f3;
  --paper: #fffefa;
  --ink: #27221f;
  --muted: #655b56;
  --line: #e4ded6;
  --accent: #963c49;
  --accent-dark: #782d3a;
  --tint: #f5e8e5;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body { margin: 0; background: var(--background); color: var(--ink); font: 16px/1.7 var(--sans); }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
img, canvas { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
.shell { width: min(1144px, calc(100% - 88px)); margin-inline: auto; }
.skip { position: absolute; top: -5rem; z-index: 3; padding: .55rem .85rem; background: var(--paper); color: var(--accent); }
.skip:focus { top: .5rem; left: .5rem; }

.site-header { border-bottom: 1px solid var(--line); }
.topbar { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 700; white-space: nowrap; }
.brand-icon { display: grid; width: 33px; height: 33px; place-items: center; color: #fffdfa; background: var(--accent); border-radius: 50% 50% 50% 16%; font: 700 18px/1 var(--serif); padding-bottom: 1px; }
.nav { display: flex; gap: 30px; align-items: center; align-self: stretch; font-size: 14px; color: var(--muted); }
.nav a { display: flex; align-items: center; position: relative; white-space: nowrap; }
.nav a:hover, .nav [aria-current="page"] { color: var(--accent-dark); }
.nav [aria-current="page"]::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--accent); }

.hero { display: grid; grid-template-columns: 1.02fr 1fr; align-items: center; gap: 48px; padding-block: 64px 58px; }
.hero h1, .story-header h1 { font-family: var(--serif); font-weight: 750; line-height: 1.15; }
.hero h1 { margin-left: -.055em; font-size: clamp(39px, 5.3vw, 73px); letter-spacing: -.075em; }
.hero h1 span { display: block; }
.hero h1 .latin { display: inline; color: var(--accent-dark); font-family: Georgia, serif; font-weight: 600; letter-spacing: -.065em; }
.hero-description { max-width: 345px; margin-top: 23px; color: var(--muted); line-height: 1.85; }
.button-link { display: inline-flex; min-height: 44px; align-items: center; gap: 17px; padding: 0 17px; margin-top: 25px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 14px; }
.button-link:hover { background: var(--accent-dark); }
.button-link span { font-size: 17px; line-height: 1; }
.cover { position: relative; aspect-ratio: 1.52; overflow: hidden; border: 1px solid #dfb9bb; border-radius: 14px; background: #f0d9d5; }
.cover canvas { width: 100%; height: 100%; }

.journal { display: grid; grid-template-columns: minmax(0, 1fr) 275px; align-items: start; gap: clamp(32px, 5vw, 70px); padding-block: 4px 71px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.section-heading h2 { font: 750 29px/1.35 var(--serif); }
.section-heading p { color: var(--muted); font-size: 13px; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--line); }
.post-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 15px; padding-block: 19px 21px; }
.post-link:hover .post-title, .post-link:hover .post-arrow { color: var(--accent-dark); }
.post-meta, .story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 11px; color: var(--muted); font-size: 13px; }
.post-meta .category, .story-meta .category { color: var(--accent-dark); font-weight: 650; }
.post-title { display: block; margin-top: 5px; font: 750 21px/1.5 var(--serif); }
.post-description { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.post-arrow { color: #775e5d; font-size: 20px; padding-inline: 5px; }
.about-card { padding: 23px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.avatar { display: grid; width: 45px; height: 45px; place-items: center; background: var(--tint); border-radius: 50%; color: var(--accent-dark); font: 750 22px/1 var(--serif); }
.about-card h2 { margin-top: 13px; font: 750 21px/1.4 var(--serif); }
.about-card p { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.85; }
.text-link { display: inline-flex; gap: 8px; align-items: center; color: var(--accent-dark); font-size: 14px; font-weight: 650; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.about-card .text-link { margin-top: 15px; }

.story { max-width: 1080px; padding-block: 44px 78px; }
.story-header { max-width: 830px; margin: 22px 0 30px; padding-bottom: 27px; border-bottom: 1px solid var(--line); }
.story-header h1 { margin: 10px 0 13px; font-size: clamp(32px, 4.6vw, 53px); line-height: 1.28; overflow-wrap: anywhere; }
.story-description { color: var(--muted); font-size: 17px; }
.story-layout { display: grid; grid-template-columns: minmax(0, 740px) minmax(160px, 205px); align-items: start; column-gap: clamp(28px, 5vw, 72px); }
.contents { position: sticky; top: 25px; border-left: 1px solid var(--line); padding: 4px 0 4px 18px; }
.contents h2 { font-size: 14px; }
.contents ul { list-style: none; padding: 0; margin: 9px 0 0; }
.contents li + li { margin-top: 8px; }
.contents a { display: inline-block; color: var(--muted); font-size: 13px; line-height: 1.6; }
.contents a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.contents-mobile { display: none; }
.prose { min-width: 0; max-width: 740px; font-size: 17px; line-height: 1.95; overflow-wrap: anywhere; }
.prose p + p { margin-top: .9em; }
.prose h2, .prose h3 { font-family: var(--serif); line-height: 1.45; }
.prose h2 { margin: 1.65em 0 .5em; font-size: 1.53em; }
.prose h3 { margin: 1.4em 0 .5em; font-size: 1.23em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { margin-block: .8em; padding-left: 1.65em; }
.prose blockquote { margin: 1em 0; padding: .6em 1em; border-left: 3px solid var(--accent); background: var(--tint); }
.prose code { font-family: Consolas, "Liberation Mono", monospace; font-size: .9em; }
.prose :not(pre) > code { padding: .08em .3em; border-radius: 4px; background: var(--tint); }
.prose pre { overflow: auto; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); line-height: 1.7; }
.story-bottom { padding-top: 22px; margin-top: 34px; border-top: 1px solid var(--line); }
.about-page { max-width: 790px; min-height: 70vh; padding-block: 52px 78px; }
.about-page .story-header { margin-top: 14px; }
.about-page .avatar { width: 57px; height: 57px; font-size: 27px; }
.about-page .story-header h1 { margin-bottom: 9px; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 21px; color: var(--muted); font-size: 13px; }
.footer-inner a:hover { color: var(--accent-dark); }

@media (max-width: 1000px) {
  .shell { width: min(1144px, calc(100% - 56px)); }
  .hero { gap: 28px; }
  .journal { gap: 25px; grid-template-columns: minmax(0, 1fr) 230px; }
}

@media (max-width: 760px) {
  .shell { width: min(580px, calc(100% - 36px)); }
  .topbar { min-height: 62px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand-icon { width: 29px; height: 29px; font-size: 16px; }
  .nav { gap: 19px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-block: 36px 35px; }
  .hero h1 { font-size: clamp(39px, 8.6vw, 59px); }
  .hero-description { margin-top: 15px; }
  .button-link { margin-top: 17px; }
  .cover { aspect-ratio: 1.85; }
  .journal { grid-template-columns: 1fr; gap: 28px; padding-bottom: 42px; }
  .section-heading h2 { font-size: 26px; }
  .post-link { padding-block: 16px; gap: 7px; }
  .post-title { font-size: 19px; }
  .post-arrow { padding-inline: 0; }
  .story { padding-block: 28px 45px; }
  .story-layout { grid-template-columns: minmax(0, 1fr); }
  .story-header { margin-bottom: 19px; }
  .story-description, .prose { font-size: 16px; }
  .contents-desktop { display: none; }
  .contents-mobile { display: block; margin-bottom: 22px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
  .contents-mobile summary { cursor: pointer; font-weight: 650; font-size: 14px; }
  .contents-mobile .contents { position: static; margin-top: 8px; padding-block: 0; }
  .about-page { padding-block: 34px 51px; }
  .footer-inner { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
