/* ---------- 首屏：可交互的波干涉场 ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: min(94svh, 920px);
  display: grid; align-content: end;
  padding-block: 110px clamp(40px, 8vh, 88px);
  overflow: clip; cursor: crosshair;

}
.waves {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  mask-image: linear-gradient(to bottom, #000 55%, transparent 98%);
}
.wordmark { margin: 0; font: 800 clamp(3.8rem, 16vw, 14rem)/.86 var(--f-display); letter-spacing: -0.06em; color: var(--ink); }
.letters { display: flex; }
.ch, .ch > span { display: inline-block; }
.wordmark-zh { margin: 14px 0 0; font-size: clamp(1.05rem, 2.2vw, 1.5rem); letter-spacing: .45em; font-weight: 500; }
@keyframes rise { from { translate: 0 .5em; opacity: 0; rotate: -8deg; } }
@keyframes scatter { to { translate: 0 var(--dy); rotate: var(--rot); opacity: 0; } }
[data-motion="on"] {
  .ch > span { animation: rise .9s var(--ease) both; animation-delay: calc(var(--i) * 70ms + .15s); }
  @supports (animation-timeline: scroll()) {
    .ch { animation: scatter linear both; animation-timeline: scroll(root); animation-range: 0 75vh; }
  }
}
.hero-foot {
  margin-top: clamp(24px, 4vh, 44px);
  display: grid; gap: 20px 40px; grid-template-columns: minmax(0, 34rem) minmax(0, 24rem);
  align-items: end; justify-content: space-between;
}
.lede {
  margin: 0; padding: 16px 20px; border-radius: 16px;
  background: color-mix(in oklab, var(--surface) 72%, transparent); backdrop-filter: blur(10px);
  font-size: 1.08rem; text-wrap: pretty;
}
.lede small { display: block; margin-top: 8px; color: var(--muted); font-size: .88rem; }
.latest {
  display: grid; gap: 4px; padding: 18px 22px; text-decoration: none;
  background: var(--surface); border-radius: 18px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -18px var(--glow);
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .25s var(--ease);
  position: relative; overflow: hidden;
}
.latest::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--holo); }
.latest small { color: var(--muted); font-size: .85rem; }
.latest b { font-weight: 650; line-height: 1.5; }

/* ---------- 主题跑马灯 ---------- */
.marquee { border-block: 1px solid var(--line); background: var(--surface); overflow: clip; padding-block: 14px; }
.marquee-track { display: flex; width: max-content; }
.marquee ul { display: flex; gap: 36px; padding: 0 18px; margin: 0; list-style: none; font: 600 clamp(1.1rem, 2.4vw, 1.6rem)/1.2 var(--f-display); letter-spacing: -0.02em; }
.marquee li { display: flex; align-items: center; gap: 36px; white-space: nowrap; }
.marquee li::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--holo); }
@keyframes marquee { to { transform: translateX(-50%); } }
[data-motion="on"] .marquee-track { animation: marquee 38s linear infinite; }
[data-motion="on"] .marquee:hover .marquee-track { animation-play-state: paused; }

.block { padding-block: clamp(64px, 11vh, 120px); }
.sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.kicker { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- 标签筛选 + 文章列表 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.count { color: var(--muted); font-size: .9rem; margin: 0 0 12px; min-height: 1.5em; }
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.post { border-radius: 18px; }
.post a {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 8px 28px; align-items: baseline;
  padding: 22px; text-decoration: none; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s;
}
.post a::before {
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: 0; transition: opacity .3s;
  background: radial-gradient(380px circle at var(--px, 50%) var(--py, 50%), rgb(195 181 255 / .45), rgb(142 232 214 / .2) 40%, transparent 70%);
}
.post a > * { position: relative; }
.post a:hover, .post a:focus-visible { border-color: var(--lilac); }
.post a:hover::before, .post a:focus-visible::before { opacity: 1; }
.post time { color: var(--muted); font: 400 .85rem/1.6 var(--f-mono); }
.post h3 { margin: 0; font-size: clamp(1.12rem, 2vw, 1.35rem); font-weight: 650; line-height: 1.45; text-wrap: balance; }
.post p { margin: 6px 0 0; color: var(--muted); font-size: .98rem; max-width: 60ch; }
.more { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: end; }

/* ---------- 写作节奏：每月一列，文章是实心圆，短笔记是空心圆 ---------- */
.calendar { background: var(--surface); border-block: 1px solid var(--line); }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 24px 56px; align-items: start; }
.rhythm-readout { margin: 0 0 18px; min-height: 3.5em; font-weight: 600; text-wrap: pretty; }
.rhythm-readout small { display: block; font-weight: 400; color: var(--muted); }
.rhythm-wrap { overflow-x: auto; padding: 8px 6px 4px; }
.rhythm {
  list-style: none; margin: 0; padding: 0; min-width: 520px;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end;
}
.month-col { display: grid; justify-items: center; gap: 10px; }
.dots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; align-items: center; gap: 7px; min-height: 120px; justify-content: flex-start; }
.dot {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--accent);
  transition: scale .2s var(--ease), box-shadow .2s;
}
.dot.is-note { width: 13px; height: 13px; background: var(--surface); border-color: color-mix(in oklab, var(--accent) 70%, var(--mint)); }
.dot.draft { border-style: dashed; background: transparent; }
.dot:hover, .dot:focus-visible { scale: 1.35; box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent); }
.dot:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.dots:empty::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--line); }
.month-label { font-size: .8rem; color: var(--muted); white-space: nowrap; border-top: 1px solid var(--line); padding-top: 8px; width: 100%; text-align: center; }
.month-label b { display: block; font: 600 .72rem var(--f-mono); color: var(--ink); }
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.stats li { display: grid; gap: 2px; padding-left: 16px; border-left: 3px solid var(--lilac); }
.stats b { font: 600 1.4rem/1.2 var(--f-display); letter-spacing: -0.02em; }
.stats span { color: var(--muted); font-size: .92rem; }
@keyframes pop { from { scale: 0; opacity: 0; } }
[data-motion="on"] .rhythm.in .dot { animation: pop .5s var(--ease) both; animation-delay: calc(var(--m) * 45ms + var(--k) * 60ms); }
[data-motion="on"] .rhythm:not(.in) .dot { opacity: 0; }

/* ---------- 短笔记：纵向滚动驱动横向移动 ---------- */
.hs-sticky { padding-block: clamp(64px, 11vh, 120px); }
.track { display: flex; gap: 20px; padding: 4px var(--gutter) 16px; overflow-x: auto; scroll-snap-type: x mandatory; }
.card {
  flex: 0 0 min(340px, 82vw); scroll-snap-align: start;
  padding: 24px; border-radius: 22px; min-height: 230px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
}
.card:nth-child(5n+1) { background: var(--tint-mint); } .card:nth-child(5n+2) { background: var(--tint-sky); }
.card:nth-child(5n+3) { background: var(--tint-lilac); } .card:nth-child(5n+4) { background: var(--tint-pink); }
.card:nth-child(5n+5) { background: var(--tint-butter); }
.card time { font: .8rem var(--f-mono); color: var(--muted); }
.card b a { text-decoration: none; }
.card b a:hover { text-decoration: underline; text-underline-offset: 4px; }
.card p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.card :not(pre) > code { font-family: var(--f-mono); font-size: .92em; }
.card-more { text-decoration: none; justify-content: end; background: var(--ink) !important; color: var(--on-ink); border-color: var(--ink); }
.card-more p { color: var(--on-ink-muted); }
.card-more:hover b { text-decoration: underline; text-underline-offset: 4px; }
.card b { font-size: 1.15rem; line-height: 1.45; }
.card code { font-family: var(--f-mono); font-size: .92em; }
.card p { margin: 0; color: var(--muted); }
@keyframes pan { to { transform: translateX(calc(-100% + 100vw)); } }
@keyframes tilt { from { rotate: -4deg; } to { rotate: 4deg; } }
[data-motion="on"] {
  @supports ((animation-timeline: view()) and (animation-range: contain)) {
    .hscroll { view-timeline: --hs block; height: 280vh; }
    .hs-sticky { position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; overflow: clip; padding-block: 0; }
    .track { overflow: visible; width: max-content; scroll-snap-type: none; animation: pan linear both; animation-timeline: --hs; animation-range: contain 5% contain 95%; }
    .card { animation: tilt linear both; animation-timeline: --hs; }
  }
}

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px 64px; }
.about-grid p { margin: 0 0 1em; max-width: 60ch; text-wrap: pretty; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.stack li { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .95rem; }
.contact { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

@media (max-width: 760px) {
  .hero-foot, .cal-layout, .about-grid { grid-template-columns: 1fr; }
  .post a { grid-template-columns: 1fr; }
  .meta { justify-content: start; }
}
