/* ==========================================================================
   LTHY · Page compositions: hero, index, post, about, 404
   ========================================================================== */

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  position: relative;
  padding-block: clamp(3rem, 10vw, 7rem) clamp(2.5rem, 6vw, 4.5rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, .95fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__title {
  font-size: var(--fs-display);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 720;
  margin-block: 1rem .9rem;
}
.hero__title span { display: block; }
.hero__title .line-2 { color: var(--ink-dim); font-size: .58em; letter-spacing: -.02em; font-weight: 560; margin-top: .5rem; }

.hero__lead {
  font-size: var(--fs-lead);
  color: var(--ink-dim);
  max-width: 46ch;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.2rem, 4vw, 2.8rem);
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}
.stat__num {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  display: block;
  margin-top: .15rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .08em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* --- Portrait --------------------------------------------------------- */
.portrait { position: relative; display: grid; place-items: center; aspect-ratio: 1; }


.portrait__disc {
  position: relative;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-hi);
  background:
    radial-gradient(circle at 34% 28%, color-mix(in oklab, var(--c-red) 42%, transparent), transparent 58%),
    radial-gradient(circle at 70% 74%, color-mix(in oklab, var(--c-gold) 46%, transparent), transparent 60%),
    var(--surface-solid);
  display: grid;
  place-items: center;
  border: 2px solid var(--border-hi);
  box-shadow: var(--shadow-card);
}
.portrait__disc img, .portrait__disc svg { width: 100%; height: 100%; }

.portrait__badge {
  position: absolute;
  bottom: 8%;
  right: 2%;
  padding: .45rem .85rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border-hi);
  background: color-mix(in oklab, var(--bg) 76%, transparent);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  box-shadow: var(--shadow-card);
}
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-gold);
}

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .portrait { max-width: 300px; margin-inline: auto; order: -1; }
}

/* ==========================================================================
   Section headings & toolbar
   ========================================================================== */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.6rem, 4vw, 2.4rem);
}
.section-head h2 { font-size: var(--fs-h2); }
.section-head p { color: var(--ink-faint); font-size: var(--fs-sm); margin-top: .4rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1.6rem;
  padding: .75rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.search-field {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1 1 220px;
  padding: .5rem .85rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.search-field:focus-within {
  border-color: color-mix(in oklab, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 14%, transparent);
}
.search-field svg { width: 16px; height: 16px; stroke: var(--ink-faint); fill: none; stroke-width: 1.9; stroke-linecap: round; flex: none; }
.search-field input { flex: 1; border: 0; outline: none; background: transparent; font-size: var(--fs-sm); min-width: 0; }
.search-field input::placeholder { color: var(--ink-faint); }

.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; }

.result-count { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-faint); }

.empty-note {
  grid-column: 1 / -1;
  padding: 3.5rem 1rem;
  text-align: center;
  color: var(--ink-faint);
  border: 1px dashed var(--border-hi);
  border-radius: var(--r-lg);
}

/* ==========================================================================
   About page
   ========================================================================== */

.about-hero { padding-block: clamp(2.5rem, 7vw, 4.5rem) 1rem; }
.about-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (max-width: 780px) { .about-hero__grid { grid-template-columns: 1fr; } }

/* --- Social links ----------------------------------------------------- */
.social { display: flex; flex-wrap: wrap; gap: .6rem; }
.social a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .95rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--ink-dim);
  transition: color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.social a:hover {
  color: var(--ink);
  border-color: color-mix(in oklab, var(--accent) 55%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 0 28px -10px var(--accent);
}
.social svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   Post page
   ========================================================================== */

.post-head { padding-block: clamp(2rem, 6vw, 3.6rem) 1.4rem; }
.post-head__cover {
  height: clamp(120px, 22vw, 220px);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--cover);
  filter: saturate(135%);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.8rem;
}
.post-head__cover.cover--image { height: clamp(200px, 30vw, 400px); background: none; }

.post-head__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, color-mix(in oklab, var(--bg) 88%, transparent), transparent 70%);
}

.post-head h1 { font-size: var(--fs-h1); margin-block: .7rem .9rem; }
.post-head__meta { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; color: var(--ink-faint); font-size: var(--fs-sm); }

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
@media (max-width: 1020px) { .post-layout { grid-template-columns: 1fr; } }

.prose { max-width: 70ch; }

.prose > * + * { margin-top: 1.25rem; }

.prose h2 {
  font-size: var(--fs-h2);
  margin-top: 2.8rem;
  padding-top: .4rem;
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.prose h2::before {
  content: "";
  display: block;
  width: 42px; height: 3px;
  border-radius: 3px;
  background: var(--grad-brand);
  margin-bottom: .9rem;
}
.prose h3 { font-size: var(--fs-h3); margin-top: 2rem; scroll-margin-top: calc(var(--nav-h) + 1.5rem); }
.prose p { color: var(--ink-dim); }
.prose strong { color: var(--ink); font-weight: 640; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent) 38%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }

.prose ul, .prose ol { padding-left: 1.35rem; color: var(--ink-dim); }
.prose li + li { margin-top: .5rem; }
.prose li::marker { color: var(--accent); }

.prose code:not(pre code) {
  font-family: var(--font-mono);
  font-size: .875em;
  padding: .16em .45em;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  color: color-mix(in oklab, var(--accent) 72%, var(--ink));
  white-space: nowrap;
}

.prose blockquote {
  margin-block: 1.8rem;
  padding: 1.1rem 1.3rem 1.1rem 1.5rem;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  border-left: 3px solid transparent;
  background:
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 12%, transparent), transparent 70%),
    var(--surface);
  position: relative;
}
.prose blockquote::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--grad-brand);
}
.prose blockquote p { color: var(--ink); font-style: italic; }
.prose blockquote p + p { margin-top: .6rem; }

.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); overflow: hidden; border-radius: var(--r-sm); }
.prose th, .prose td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--border); }
.prose thead th { background: var(--surface-hi); font-weight: 620; }
.prose img { border-radius: var(--r-md); border: 1px solid var(--border); }

.prose hr { margin-block: 2.4rem; }

.post-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--border);
}

.post-nav { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.post-nav a {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.1rem 1.3rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform var(--dur), border-color var(--dur), box-shadow var(--dur);
}
.post-nav a:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--accent) 45%, transparent); box-shadow: 0 0 34px -14px var(--accent); }
.post-nav span:first-child { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-faint); letter-spacing: .08em; }
.post-nav span:last-child { font-weight: 600; font-size: .95rem; }

/* --- Table of contents ------------------------------------------------ */
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  padding: 1.1rem 1.2rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  max-height: calc(100svh - var(--nav-h) - 3rem);
  overflow-y: auto;
}
.toc__title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .8rem;
}
.toc__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.toc__list a {
  display: block;
  padding: .35rem .6rem;
  border-radius: var(--r-xs);
  font-size: var(--fs-sm);
  color: var(--ink-faint);
  border-left: 2px solid transparent;
  transition: color var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}
.toc__list a:hover { color: var(--ink); background: var(--surface-hi); }
.toc__list a.is-active { color: var(--accent); border-left-color: var(--accent); background: color-mix(in oklab, var(--accent) 10%, transparent); }
.toc__list .toc__sub a { padding-left: 1.3rem; font-size: var(--fs-xs); }

@media (max-width: 1020px) { .toc { display: none; } }

/* ==========================================================================
   404
   ========================================================================== */

.error-page {
  min-height: 70svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: clamp(3rem, 10vw, 6rem);
}
.error-code {
  font-size: clamp(5rem, 22vw, 12rem);
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1;
}
.error-page p { color: var(--ink-dim); max-width: 44ch; margin: 1rem auto 2rem; }
.error-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }

/* ==========================================================================
   立场 · the stance block
   ========================================================================== */

.stance {
  position: relative;
  overflow: hidden;
  padding: clamp(1.7rem, 4vw, 2.9rem);
  border-radius: var(--r-xl);
  border: 1px solid color-mix(in oklab, var(--c-gold) 32%, transparent);
  background:
    radial-gradient(ellipse 68% 122% at 6% 0%, color-mix(in oklab, var(--c-red) 44%, transparent), transparent 62%),
    radial-gradient(ellipse 62% 112% at 104% 106%, color-mix(in oklab, var(--c-gold) 20%, transparent), transparent 60%),
    color-mix(in oklab, var(--surface-solid) 84%, transparent);
  box-shadow: var(--shadow-pop);
}

.stance__watermark {
  position: absolute;
  top: -3.4rem;
  right: -2.6rem;
  width: clamp(180px, 24vw, 300px);
  color: var(--c-gold);
  opacity: .1;
  pointer-events: none;
  rotate: 14deg;
}
.stance__watermark svg { width: 100%; height: auto; fill: currentColor; }

.stance .eyebrow { color: var(--c-gold); }

.stance h2 { margin-block: .8rem .9rem; }

.stance__lead {
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  line-height: 1.6;
  font-weight: 640;
  letter-spacing: -.015em;
  color: var(--ink);
  max-width: 44ch;
}

.stance__body { margin-top: 1.3rem; max-width: 68ch; }
.stance__body p { color: color-mix(in oklab, var(--ink) 84%, transparent); }
.stance__body p + p { margin-top: .95rem; }

.stance__slogan { margin-top: 1.9rem; }


.stance--compact { padding-block: clamp(1.5rem, 3.5vw, 2.2rem); }
.stance--compact h2 { font-size: var(--fs-h2); }

.stance__pull {
  position: relative;
  margin-top: 1.5rem;
  padding-left: 1.2rem;
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  font-weight: 640;
  letter-spacing: -.01em;
  color: color-mix(in oklab, var(--c-gold) 72%, var(--ink));
}

.stance__pull::before {
  content: "";
  position: absolute;
  left: 0;
  top: .12em;
  bottom: .12em;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--c-star), var(--c-gold));
}

.stance__summary {
  margin-top: 1.3rem;
  max-width: 72ch;
  color: color-mix(in oklab, var(--ink) 84%, transparent);
}

.stance__outline {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1.6rem;
}

.stance__outline a.chip {
  font-family: var(--font-ui);
  text-decoration: none;
  transition: transform var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast);
}
.stance__outline a.chip:hover {
  transform: translateY(-2px);
  background: color-mix(in oklab, var(--tone) 24%, transparent);
  border-color: color-mix(in oklab, var(--tone) 60%, transparent);
}

/* ==========================================================================
   独立页面（content/pages）与书法体装饰
   ========================================================================== */

.page-rule {
  width: 68px;
  height: 4px;
  border-radius: 4px;
  background: var(--grad-brand);
  margin-bottom: 1.5rem;
}

.post-head--page h1 {
  font-size: clamp(2.3rem, 1.2rem + 4.6vw, 3.9rem);
  margin-block: .8rem 1rem;
}

.post-head--page .post-head__meta { margin-top: 1rem; }

/* 书法体只用在短而大的标题上 —— 子集没有正文字形，长句子会退化成混排。 */
.post-head--page h1,
.prose--brush h2,
.stance__title,
.stance__pull,
.slogan--brush {
  font-family: var(--font-brush);
  font-weight: 400;
  letter-spacing: .04em;
}

.prose--brush h2 { font-size: clamp(1.7rem, 1.2rem + 1.9vw, 2.35rem); }

.slogan--brush {
  font-size: 1.02rem;
  letter-spacing: .13em;
  padding-inline: 1rem;
}

.slogan--brush span { line-height: 1.5; }

/* ==========================================================================
   压在照片上的正文
   --------------------------------------------------------------------------
   背景是一张到处都有中间调的老照片，正文光靠压暗蒙版还是不够，得补一点投影。

   注意：标题是渐变文字（background-clip: text + color: transparent），对它用
   text-shadow 会在字形内部透出一团黑影 —— 所以标题只能用 drop-shadow。
   ========================================================================== */

.hero__title { filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .62)); }

.eyebrow,
.hero__title .line-2,
.hero__lead,
.stat__num,
.stat__label,
.section-head h2,
.section-head p {
  text-shadow: 0 1px 4px rgba(0, 0, 0, .62);
}

[data-theme="light"] .hero__title { filter: drop-shadow(0 2px 10px rgba(255, 255, 255, .75)); }

[data-theme="light"] .eyebrow,
[data-theme="light"] .hero__title .line-2,
[data-theme="light"] .hero__lead,
[data-theme="light"] .stat__num,
[data-theme="light"] .stat__label,
[data-theme="light"] .section-head h2,
[data-theme="light"] .section-head p {
  text-shadow: 0 1px 4px rgba(255, 255, 255, .88);
}
