:root {
  color-scheme: light;
  --paper: #fbf6e9;
  --surface: #fffcf4;
  --ink: #40312a;
  --muted: #68544a;
  --accent: #984f49;
  --accent-hover: #793933;
  --line: #e9d9c3;
  --serif: "Noto Serif SC", "Songti SC", SimSun, serif;
  --sans: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.75 var(--sans);
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.container { width: min(100% - 5rem, 72rem); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header-inner { min-height: 4.65rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font: 700 1.15rem/1.4 var(--serif);
  letter-spacing: .08em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  background: #f0dfd2;
  border-radius: .55rem;
}

.brand-mark span {
  width: .63rem;
  height: .9rem;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
}

.site-nav { display: flex; gap: 1.9rem; }

.site-nav a {
  padding-block: .55rem;
  color: var(--muted);
  font-size: .9rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover, .site-nav a[aria-current] { color: var(--accent); }

.site-nav a[aria-current] {
  text-decoration: underline;
  text-underline-offset: .5em;
  text-decoration-thickness: 2px;
}

#top { scroll-margin-top: 0; }
#posts, #about { scroll-margin-top: 6rem; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(1.75rem, 4vw, 4rem);
  margin-top: 2.8rem;
  padding: clamp(2rem, 4vw, 3.5rem);
  border: 1px solid #ead7b8;
  border-radius: .9rem;
  background: radial-gradient(ellipse at 15% 25%, #fff9e9 0, transparent 62%),
              repeating-linear-gradient(0deg, #906c3905 0 1px, transparent 1px 5px),
              #f9eed7;
}

.hero-theme {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 0 .85rem;
  color: #884c43;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .13em;
}

.hero-theme::before {
  width: 1.45rem;
  height: 1px;
  background: #b57968;
  content: "";
}

h1, h2 { font-family: var(--serif); }

h1 {
  margin: 0;
  font-size: clamp(3.4rem, 6vw, 5.55rem);
  font-weight: 800;
  letter-spacing: .045em;
  line-height: 1.22;
}

h1 span { color: var(--accent); }

.hero-intro {
  max-width: 25rem;
  margin: 1.25rem 0 1.8rem;
  color: var(--muted);
  font-size: 1.07rem;
  text-wrap: balance;
}

.hero-button {
  display: inline-block;
  padding: .7rem 1.6rem;
  border-radius: .4rem;
  background: var(--accent);
  box-shadow: 0 3px 0 #7b4039;
  color: #fffaf4;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-decoration: none;
}

.hero-button:hover { background: var(--accent-hover); }

.hero-art {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: .64rem .64rem 0;
  border: 1px solid #e8d6bf;
  border-radius: .5rem;
  background: var(--surface);
  box-shadow: 0 .65rem 1.7rem #61432b1c, 0 2px 4px #61432b0e;
}

.hero-art::after {
  position: absolute;
  top: -1px;
  right: 1.3rem;
  width: 1.04rem;
  height: 2.35rem;
  background: #b8756a;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
  content: "";
  pointer-events: none;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.58;
  object-fit: cover;
  object-position: 50% 35%;
  border-radius: .19rem;
  background: #fff8df;
  filter: sepia(.09) saturate(.93);
}

.hero-art figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: .55rem 0 .6rem;
  color: var(--muted);
  font: 600 .82rem/1.5 var(--serif);
  letter-spacing: .15em;
}

.hero-art figcaption span {
  width: .85rem;
  height: 1px;
  background: #cba892;
}

.journal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, .43fr);
  align-items: start;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  margin: 3.15rem 0 4rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: .62rem;
  margin: 0 0 1.1rem;
  font-size: 1.65rem;
  font-weight: 750;
  line-height: 1.4;
}

.section-title::before {
  flex: 0 0 .38rem;
  height: .38rem;
  margin-inline: .14rem;
  transform: rotate(45deg);
  background: #b77465;
  content: "";
}

.post-list { display: grid; gap: .8rem; }

.post {
  border: 1px solid var(--line);
  border-radius: .62rem;
  background: var(--surface);
}

.post summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 1.15rem;
  border-radius: inherit;
  list-style: none;
  cursor: pointer;
}

.post summary::-webkit-details-marker { display: none; }
.post summary:hover { background: #fcf4e7; }

.post-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  align-self: start;
  margin-top: .14rem;
  border-radius: .58rem;
  background: #f3e2d8;
  color: var(--accent);
  font-size: 1.65rem;
  line-height: 1;
}

.post-study .post-icon { background: #f5eacd; color: #815c37; }

.book-icon {
  position: relative;
  width: 1.3rem;
  height: .95rem;
  border: 1.5px solid currentColor;
  border-radius: .18rem;
}

.book-icon::after {
  position: absolute;
  left: 50%;
  height: 100%;
  border-left: 1.5px solid currentColor;
  content: "";
}

.post-heading { display: grid; gap: .18rem; }

.post-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--accent);
  font-size: .83rem;
  font-weight: 600;
}

.post-study .post-meta { color: #815c37; }

.sample {
  padding: 0 .4rem;
  border: 1px solid #e8d9c7;
  border-radius: .24rem;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.48;
}

.post-title { font: 720 1.27rem/1.4 var(--serif); }
.post-excerpt { color: var(--muted); font-size: .92rem; text-wrap: balance; }

.post-toggle {
  position: relative;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid #e8d8c6;
  border-radius: 50%;
  color: var(--accent);
}

.post-toggle::before, .post-toggle::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: .62rem;
  height: 1.5px;
  transform: translate(-50%, -50%);
  background: currentColor;
  content: "";
}

.post-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.post[open] .post-toggle::after { display: none; }

.post-body {
  margin: 0 1.2rem 1.2rem 4.15rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.post-body p { margin: 0 0 .6rem; }
.post-body p:last-child { margin: 0; }
.post-body code { background: #f5eadb; padding-inline: .23em; border-radius: .2rem; }

.about {
  position: relative;
  overflow: hidden;
  min-height: 13.4rem;
  padding: 1.45rem 1.55rem;
  border: 1px solid #ebdbbd;
  border-radius: .62rem;
  background: #f8efd9;
}

.about .section-title { margin-bottom: .85rem; font-size: 1.38rem; }
.about p { position: relative; margin: 0; color: var(--muted); line-height: 1.9; }

.about-bookmark {
  position: absolute;
  right: 1.35rem;
  bottom: -.45rem;
  width: 2rem;
  height: 3.5rem;
  transform: rotate(-13deg);
  background: #ad725323;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 79%, 0 100%);
  pointer-events: none;
}

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 4.3rem; color: var(--muted); font-size: .875rem; }
.footer-inner span { font: 650 .93rem var(--serif); }
.footer-inner a { text-underline-offset: .2em; }
.footer-inner a:hover { color: var(--accent); }

@media (max-width: 58rem) {
  .container { width: min(100% - 3rem, 72rem); }
  .hero { padding: 2rem; gap: 1.5rem; }
  h1 { font-size: clamp(2.65rem, 6.8vw, 4rem); }
  .journal { gap: 1.4rem; }
}

@media (max-width: 44rem) {
  .container { width: calc(100% - 2rem); }
  .site-header-inner { min-height: 3.85rem; gap: .55rem; }
  .brand { gap: .4rem; font-size: 1rem; letter-spacing: .025em; }
  .brand-mark { width: 1.55rem; height: 1.55rem; }
  .brand-mark span { width: .5rem; height: .73rem; }
  .site-nav { gap: clamp(.5rem, 2.6vw, 1.25rem); }
  .site-nav a { font-size: .875rem; }
  #posts, #about { scroll-margin-top: 4.7rem; }
  .hero { grid-template-columns: 1fr; margin-top: 1.3rem; padding: 1.65rem 1.15rem 1.15rem; }
  .hero-text { padding: .15rem .25rem; }
  h1 { font-size: clamp(2.85rem, 12vw, 4.6rem); }
  .hero-theme { margin-bottom: .6rem; }
  .hero-intro { margin: .85rem 0 1.15rem; font-size: 1rem; }
  .hero-art { padding: .45rem .45rem 0; }
  .hero-art img { aspect-ratio: 1.5; }
  .hero-art::after { right: .85rem; height: 1.85rem; }
  .journal { grid-template-columns: 1fr; margin: 2rem 0 2.4rem; gap: 1.55rem; }
  .section-title { margin-bottom: .8rem; font-size: 1.5rem; }
  .about { min-height: 0; padding: 1.2rem 1.15rem 1.4rem; }
}

@media (max-width: 28rem) {
  .post summary { gap: .65rem; padding: .85rem .72rem; }
  .post-icon { width: 2.25rem; height: 2.25rem; font-size: 1.35rem; }
  .post-title { font-size: 1.1rem; }
  .post-toggle { width: 1.5rem; height: 1.5rem; }
  .post-body { margin-inline: .9rem; }
}

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