/* Pages — page-specific layouts and content styles
   Hero, rules list. */

/* Hero section */
.hero {
  padding: var(--sp-11) 0 var(--sp-10);
}

/* Homepage hero text */
.hero-label {
  color: var(--grey-3);
  margin-bottom: var(--sp-7);
}

.hero-heading {
  font-family: var(--sans);
  font-weight: 200;
  font-size: min(8vw, 14vh);
  line-height: .94;
  letter-spacing: -.025em;
  color: var(--ink);
  /* 动画期间乱码字符宽度不定，禁止换行 */
  white-space: nowrap;
}

/* thinking 阶段：文字内部一层朦胧光带，由 JS 驱动从左到右匀速扫过
   亮度随省略号点数呼吸，两者同源，不会各走各的 */
.hero-heading--shine {
  background-image: linear-gradient(
    90deg,
    var(--ink) 32%,
    #5c5c5c 44%,
    #b0b0b0 50%,
    #5c5c5c 56%,
    var(--ink) 68%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* 行高保持不变（避免动画前后布局跳动）；
     仅扩展底部绘制区域让 g 下伸部不被 background-clip:text 裁剪，
     再用负 margin 抵消，保证占用空间与正常状态完全一致 */
  padding-bottom: 0.25em;
  margin-bottom: -0.25em;
}

.hero-desc {
  font-family: var(--sans);
  font-size: max(13px, 1vw);
  line-height: 1.6;
  color: var(--grey-3);
  font-weight: 300;
  max-width: 36ch;
  margin-top: var(--sp-6);
}

/* Homepage hero — unified full-width container */
.home-hero-split {
  background: var(--paper);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 80vh;
  margin-bottom: var(--sp-10);
  position: relative;
}

.home-hero-split canvas.ascii-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: .4;
  overflow: hidden;
  /* thinking 动画结束后淡入出现 */
  transition: opacity 1.4s ease;
}

.home-hero-split canvas.ascii-bg.is-hidden {
  opacity: 0;
}

.hero-content {
  grid-column: 1 / -1;
  color: var(--ink);
  padding: var(--sp-10) var(--sp-8);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.split-left-content {
  position: relative;
  z-index: 1;
}

.split-left-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding-top: var(--sp-6);
  border-top: 1px solid rgba(255,255,255,.22);
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rule-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-7);
  align-items: start;
  padding: var(--sp-6) 0;
  border-top: 1px solid var(--grey-2);
}

.rule-item.accent-bottom {
  border-bottom: 2px solid var(--ink);
}

.rule-num {
  font-family: var(--sans);
  font-weight: 200;
  font-size: min(4.4vw, 7.8vh);
  line-height: .9;
  color: var(--ink);
}

.rule-body h3 {
  font-family: var(--sans);
  font-weight: 400;
  font-size: max(18px, 1.8vw);
  line-height: 1.2;
  letter-spacing: -.015em;
  margin-bottom: var(--sp-3);
}

.rule-body p {
  font-family: var(--sans);
  font-size: max(12px, .92vw);
  line-height: 1.6;
  color: var(--grey-3);
  font-weight: 300;
}

@media (max-width: 768px) {
  .home-hero-split {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-content {
    padding: var(--sp-8) var(--sp-6);
    min-height: 55vh;
  }

  /* 移动端标题略放大并随屏宽缩放，避免解码动画时横向溢出 */
  .hero-heading {
    font-size: min(9vw, 13vh);
  }
}

/* 小屏手机：rule-item 改为上下结构，数字字号放大 */
@media (max-width: 480px) {
  .rule-item {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
    padding: var(--sp-5) 0;
  }

  .rule-num {
    font-size: min(7vw, 7vh);
  }
}

.hero h1 {
  margin-bottom: var(--sp-7);
}

.hero .lead {
  margin-bottom: var(--sp-8);
}

/* 404 page — 内容整块居中（不改字号，仅定位）。
   .not-found 高度 = 视口 - 固定 header 高度 - 160px；
   footer 顶部（dengjunyu.com 域名 + 副标题）因此露出在首屏内，
   而版权/备案那行 footer-meta 仍被推到首屏下方，用户看不到 */
.not-found {
  min-height: calc(100vh - (var(--sp-6) * 2 + 1.4rem) - 220px);
  /* 移动端地址栏收展导致 100vh 偏大，优先使用动态视口高度 */
  min-height: calc(100dvh - (var(--sp-6) * 2 + 1.4rem) - 220px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
