/* ========== Mouse spotlight + parallax + thread + contact-end ========== */

:root {
  --mx: 50%;
  --my: 50%;
  --mx-offset: 0px;
  --my-offset: 0px;
}

/* ========== Spotlight (羽化柔和但亮区明显 — 仅 hero) ========== */
.spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: radial-gradient(
    circle 360px at var(--mx) var(--my),
    transparent 0%,
    transparent 38%,
    rgba(0, 0, 0, 0.42) 95%,
    rgba(0, 0, 0, 0.55) 100%
  );
  transition: opacity .55s cubic-bezier(.4, .1, .25, 1);
}
.spotlight.is-off {
  opacity: 0;
  pointer-events: none;
}

/* ========== Parallax — 仅 3 个元素，幅度小 ========== */
.hero__deco-1 {
  transform: rotate(-2deg)
    translate3d(
      calc(var(--mx-offset) * 0.07),
      calc(var(--my-offset) * 0.07),
      0
    );
  transition: transform 1s cubic-bezier(.2, .8, .25, 1);
}

.hero__deco-2 {
  transform: rotate(4deg)
    translate3d(
      calc(var(--mx-offset) * 0.09),
      calc(var(--my-offset) * 0.09),
      0
    );
  transition: transform 1s cubic-bezier(.2, .8, .25, 1);
}

.hero__log {
  transform: translate3d(
    calc(var(--mx-offset) * 0.06),
    calc(var(--my-offset) * 0.06),
    0
  );
  transition: transform 1s cubic-bezier(.2, .8, .25, 1);
}

.page { position: relative; z-index: 3; }

/* ========== Thread (红线 + 白点 — 跨整个文档高度，循环延伸) ========== */
body { position: relative; }

.thread {
  position: absolute;       /* 固定在文档顶/底，不是视口 */
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 1;               /* 默认在 .page (z 3) 之下 — 被内容遮挡，hero 段透明可见，关于页 panel 半透明可模糊穿透 */
}
.thread.is-top {
  z-index: 50;              /* 联系页区域：浮到顶层，连接底部白点不被 contact-end 不透明背景遮挡 */
}
.thread__svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.thread__path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(230, 57, 70, 0.5));
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;     /* 默认完全不可见，由 scroll JS 控制延伸 */
}

.thread__dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

/* 顶部白点：absolute 在 thread 容器内 */
.thread__dot--top {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* 底部白点：在联系页 inner 内（联系我文案上方） */
.thread__dot--bottom {
  position: relative;
  margin: 0 auto 44px;
  display: block;
  z-index: 5;
}

/* ========== Contact end ========== */
.contact-end {
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 60px 60px;
  overflow: hidden;
  border-top: 1px solid var(--border);
  z-index: 3;
}

.contact-end__bg {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-serif);
  font-size: clamp(180px, 32vw, 520px);
  color: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
  letter-spacing: -0.01em;
  font-weight: 400;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.contact-end__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 820px;
  width: 100%;
}
.contact-end__tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 36px;
  text-transform: uppercase;
}
.contact-end__tag .dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: blink 1.4s infinite;
}
.contact-end__title {
  font-family: var(--font-serif);
  font-size: clamp(44px, 6.5vw, 88px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 36px;
  font-style: italic;
}
.contact-end__email {
  display: block;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 16px;
  letter-spacing: 0.04em;
  margin-bottom: 36px;
  transition: opacity .25s;
}
.contact-end__email:hover { opacity: 0.7; }
.contact-end__cta {
  display: inline-block;
  padding: 18px 46px;
  border: 1px solid var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--text);
  text-transform: uppercase;
  transition: all .3s;
}
.contact-end__cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.contact-end__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 36px;
  margin-top: 80px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
}
.contact-end__links a {
  color: var(--accent);
  transition: opacity .25s;
}
.contact-end__links a:hover { opacity: 0.7; }
.contact-end__foot {
  margin-top: 72px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--text-faint);
  line-height: 2;
}

@media (max-width: 720px) {
  .contact-end { padding: 80px 20px 40px; }
  .contact-end__title { font-size: clamp(32px, 8vw, 54px); }
  .contact-end__links { gap: 18px; margin-top: 50px; }
  .thread__dot { width: 16px; height: 16px; }
  .spotlight {
    background: radial-gradient(
      circle 240px at var(--mx) var(--my),
      transparent 0%,
      transparent 38%,
      rgba(0, 0, 0, 0.4) 100%
    );
  }
}
