/* ==========================================================================
   周天皓 · 个人主页
   视觉参考：Nomadic Tribe (2019.makemepulse.com) —— 层叠山脊、暮色暖调、留白、克制动效
   结构：1 变量  2 基础  3 顶栏  4 首屏  5 通用区块  6 介绍  7 模块  8 联系
        9 页脚  10 动效  11 响应式
   ========================================================================== */

/* ---------------------------------------------------------------- 1. 变量 */
:root {
  /* 纸与墨 */
  --paper:      #f7f2e9;
  --paper-alt:  #f3ebdc;
  --ink:        #241e17;
  --ink-soft:   #574d40;
  --muted:      #8d8071;
  --line:       #ddd0ba;

  /* 暮色 */
  --sun:        #eaa96d;
  --accent:     #b5613a;

  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC", sans-serif;
  --latin: Georgia, "Times New Roman", "Songti SC", serif;

  --wrap: 1100px;
  --topbar-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------- 2. 基础 */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 8px);
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.3; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
a:hover { color: var(--accent); }

img, svg { display: block; max-width: 100%; }

::selection { background: var(--sun); color: #241e17; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
}
.skip:focus { left: 0; color: var(--paper); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------------------------------------------------------------- 3. 顶栏 */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  background: rgba(247, 242, 233, 0.72);
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease);
}
.topbar.scrolled {
  background: rgba(247, 242, 233, 0.92);
  border-bottom-color: var(--line);
}

.topbar-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.sign {
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.nav {
  display: flex;
  gap: clamp(16px, 3vw, 34px);
}
.nav a {
  position: relative;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 4px 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav a:hover,
.nav a.active { color: var(--ink); }
.nav a:hover::after,
.nav a.active::after { transform: scaleX(1); }

/* ---------------------------------------------------------------- 4. 首屏 */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--topbar-h) + 40px) 0 0;
  overflow: hidden;
  background: linear-gradient(180deg,
    #fcf7ee 0%,
    #f8f2e8 38%,
    #f4e9d5 76%,
    #efdfc6 100%);
}

.hero-text {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  /* 略微上移，给底部的山脊留出呼吸 */
  transform: translateY(-5vh);
}

.kicker {
  font-family: var(--latin);
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--muted);
  text-indent: 0.42em;
}

.name {
  margin: 22px 0 0;
  font-size: clamp(3.1rem, 10.5vw, 7rem);
  font-weight: 300;
  letter-spacing: 0.16em;
  /* 抵消字间距在最后一个字后多出的空隙，保证视觉居中 */
  text-indent: 0.16em;
  color: var(--ink);
  line-height: 1.1;
}

.tagline {
  margin: 30px 0 0;
  font-size: 14px;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
}

/* 滚动提示：压在深色山脊上，横向排布，保证不会跑到浅色山脊上去 */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 3;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: rgba(252, 247, 238, 0.7);
}
.scroll-cue:hover { color: rgba(252, 247, 238, 0.98); }

.scroll-line {
  width: 44px;
  height: 1px;
  background: linear-gradient(to right, currentColor, transparent);
  animation: cue 2.6s var(--ease) infinite;
  transform-origin: left;
}
@keyframes cue {
  0%        { transform: scaleX(0.15); opacity: 0; }
  35%       { opacity: 1; }
  75%, 100% { transform: scaleX(1); opacity: 0; }
}

/* 层叠山脊 */
.scene {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: clamp(300px, 46vh, 470px);
  pointer-events: none;
}
.scene svg {
  width: 100%;
  height: 100%;
}
.scene g {
  will-change: transform;
}

/* ------------------------------------------------------------ 5. 通用区块 */
.section {
  padding: clamp(84px, 12vw, 150px) 0;
}
.section-alt {
  background: var(--paper-alt);
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(36px, 5vw, 60px);
}

.num {
  font-family: var(--latin);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.sec-head h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.85rem);
  letter-spacing: 0.12em;
  text-indent: 0.12em;
}

.sec-sub {
  margin-left: auto;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------------------------------------------------------------- 6. 介绍 */
.sec-body {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(36px, 7vw, 96px);
  align-items: start;
}

.prose p {
  font-size: 1.02rem;
  line-height: 2.05;
  color: var(--ink-soft);
  max-width: 44ch;
}
.prose p + p { margin-top: 1.15em; }

.facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.facts > div:last-child { border-bottom: 1px solid var(--line); }

.facts dt {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  white-space: nowrap;
}
.facts dd {
  font-size: 14px;
  color: var(--ink);
  text-align: right;
}
.facts dd a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}
.facts dd a:hover { border-color: var(--accent); }

/* ---------------------------------------------------------------- 7. 模块 */
.module {
  padding: 34px 0 38px;
  border-top: 1px solid var(--line);
}
.modules > .module:last-child {
  border-bottom: 1px solid var(--line);
}

.module-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.module-num {
  font-family: var(--latin);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.module-head h3 {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  letter-spacing: 0.1em;
  text-indent: 0.1em;
}

.chip {
  padding: 3px 11px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: 0.75;
}

/* 还没做的模块，标记弱化，不抢注意力 */
.chip.soon {
  color: var(--muted);
  opacity: 0.6;
}

.module-desc {
  margin-top: 16px;
  max-width: 52ch;
  font-size: 0.95rem;
  line-height: 1.95;
  color: var(--muted);
}

.more {
  margin-top: 30px;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  opacity: 0.8;
}

/* ---------------------------------------------------------------- 8. 联系 */
.contact-lead {
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.mail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-family: var(--latin);
  font-size: clamp(1.3rem, 3.6vw, 2.05rem);
  letter-spacing: 0.01em;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.mail:hover { color: var(--accent); border-color: var(--accent); }

.mail-arrow {
  font-size: 0.72em;
  transition: transform 0.4s var(--ease);
}
.mail:hover .mail-arrow { transform: translate(3px, -3px); }

/* 禁用 JS 时的提示 */
.mail-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- 9. 页脚 */
.footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 40px;
}
.footer-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--ink); }

/* --------------------------------------------------------------- 10. 动效 */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------- 11. 响应式 */
@media (max-width: 860px) {
  .sec-body { grid-template-columns: 1fr; }
  .prose p { max-width: none; }
  .sec-sub { display: none; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 22px; }
  .nav { gap: 18px; }
  .nav a { font-size: 12px; }
  .sign { font-size: 13px; }
  .tagline {
    font-size: 12.5px;
    line-height: 2;
    max-width: 24ch;
    margin-left: auto;
    margin-right: auto;
  }
  .hero-text { transform: translateY(-3vh); }
  .facts > div { padding: 13px 0; }
  .footer-inner { flex-direction: column; }
  .mail { font-size: 1.15rem; }
}

@media (max-width: 400px) {
  .nav { gap: 12px; }
  .nav a { letter-spacing: 0.04em; }
}

/* 尊重"减少动效"偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .scene g { transform: none !important; }
}
