/* ============================================================
 *  个人主页 · 样式（浅色 / 磨砂 / 便签）
 * ============================================================ */

:root {
  --paper: #ffffff;
  --cream: #fbfbf8;
  --ink: #17202c;
  --muted: rgba(23, 32, 44, 0.62);
  --dim: rgba(23, 32, 44, 0.42);
  --line: rgba(23, 32, 44, 0.1);
  --accent: #4a9ecf;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(23, 32, 44, 0.06);
  font-size: 0.9em;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 4vw, 48px);
  transition: background 0.45s ease, backdrop-filter 0.45s ease,
    border-color 0.45s ease, padding 0.45s ease, box-shadow 0.45s ease;
  border-bottom: 1px solid transparent;
}

.topbar.is-solid {
  padding: 12px clamp(20px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom-color: rgba(23, 32, 44, 0.07);
  box-shadow: 0 4px 18px rgba(30, 50, 80, 0.05);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

/* 左上角的标记：映凡照仙 / 一条线 / 不凡的小萌新 */
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  color: var(--ink);
  transition: opacity 0.25s ease;
}

.brand:hover {
  opacity: 0.66;
}

.brand-main {
  font-size: clamp(15px, 1.5vw, 17px);
  font-weight: 600;
  letter-spacing: 0.3em;
  line-height: 1.1;
}

.brand-rule {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(23, 32, 44, 0.34),
    rgba(23, 32, 44, 0.08)
  );
}

.brand-sub {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: rgba(23, 32, 44, 0.55);
}

.nav {
  display: flex;
  gap: 24px;
}

.nav a {
  position: relative;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: rgba(23, 32, 44, 0.62);
  transition: color 0.25s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nav a:hover {
  color: var(--ink);
}

.nav a:hover::after {
  transform: scaleX(1);
}

/* ---------------- 首屏 ---------------- */

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 130px 24px 190px;
  overflow: hidden;
}

/* 图片只铺在这一段里，滚过去就没了 */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #eef3f7;
}

.bg-layer {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.06);
  will-change: opacity, transform;
}

/* 整体调亮：薄白纱 + 底部化进白纸 */
.bg-tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.24) 34%,
    rgba(255, 255, 255, 0.5) 76%,
    rgba(255, 255, 255, 0.96) 100%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  will-change: transform, opacity;
}

/* 淡白色磨砂卡片 */
.glass {
  position: relative;
  padding: clamp(32px, 5vw, 54px) clamp(26px, 4.4vw, 54px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0.64)
  );
  box-shadow: 0 30px 80px rgba(30, 50, 80, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(23, 32, 44, 0.04);
  backdrop-filter: blur(32px) saturate(1.12) brightness(1.06);
  -webkit-backdrop-filter: blur(32px) saturate(1.12) brightness(1.06);
  text-align: center;
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 11px;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  color: rgba(23, 32, 44, 0.42);
}

.hero-name {
  margin: 0;
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  line-height: 1.18;
  color: #101823;
}

.quote {
  margin: 22px auto 0;
  max-width: 24em;
  min-height: 1.9em;
  font-size: clamp(14px, 1.7vw, 16px);
  letter-spacing: 0.12em;
  line-height: 1.9;
  color: rgba(23, 32, 44, 0.68);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.quote.is-out {
  opacity: 0;
  transform: translateY(-6px);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.12em;
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1),
    background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.btn-primary {
  background: #101823;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(16, 24, 35, 0.22);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: #1d2a3a;
  box-shadow: 0 18px 40px rgba(16, 24, 35, 0.28);
}

/* 滚动的提示 */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 168px;
  z-index: 4;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(23, 32, 44, 0.42);
  transition: color 0.3s ease;
}

.scroll-hint:hover {
  color: var(--ink);
}

.scroll-text {
  font-size: 11px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
}

.scroll-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: dotDrop 2.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes dotDrop {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

/* ---------------- 波浪过渡 ---------------- */

.wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 3;
  height: clamp(90px, 14vh, 150px);
  pointer-events: none;
  overflow: hidden;
}

.wave svg {
  position: absolute;
  left: 0;
  bottom: 0;
  display: block;
  width: 200%;
  height: 100%;
  will-change: transform;
}

.wave-back {
  animation: waveDrift 19s linear infinite;
}

.wave-front {
  animation: waveDrift 13s linear infinite reverse;
}

.wave-back path {
  fill: rgba(255, 255, 255, 0.5);
}

.wave-front path {
  fill: #ffffff;
}

@keyframes waveDrift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* ---------------- 内容：便签 ---------------- */

.works {
  position: relative;
  z-index: 2;
  padding: clamp(46px, 7vw, 84px) 24px clamp(40px, 6vw, 76px);
  background: var(--paper);
}

.works-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 1080px;
  margin: 0 auto 44px;
  text-align: center;
}

.works-head h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: var(--ink);
}

.works-head p {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(236px, 268px));
  justify-content: center;
  gap: 34px 30px;
  max-width: 1080px;
  margin: 0 auto;
}

/* 入场动画挂在外层，便签自己负责角度 */
.note-cell {
  display: flex;
}

.note-cell:nth-child(3n + 1) .note {
  --tilt: -1.5deg;
}

.note-cell:nth-child(3n + 2) .note {
  --tilt: 1.1deg;
}

.note-cell:nth-child(3n + 3) .note {
  --tilt: -0.5deg;
}

/* 一张便签 */
.note {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 214px;
  padding: 30px 24px 26px;
  border-radius: 3px;
  background: #fffdf7;
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(30, 50, 80, 0.11),
    0 2px 6px rgba(30, 50, 80, 0.07);
  transform: rotate(var(--tilt, -1.2deg));
  transform-origin: center 20%;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.5s ease;
}

/* 顶上一条胶带 */
.note::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 74px;
  height: 22px;
  transform: translateX(-50%) rotate(-2deg);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.86),
    rgba(255, 255, 255, 0.5)
  );
  border-left: 1px solid rgba(255, 255, 255, 0.9);
  border-right: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 8px rgba(30, 50, 80, 0.08);
  border-radius: 1px;
  pointer-events: none;
}

/* 右下角的折角 */
.note::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  background: linear-gradient(
    135deg,
    rgba(23, 32, 44, 0.06) 50%,
    transparent 50%
  );
  border-radius: 0 0 3px 0;
  pointer-events: none;
}

.note:hover {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: 0 24px 44px rgba(30, 50, 80, 0.16),
    0 4px 10px rgba(30, 50, 80, 0.08);
}

.note-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.note-tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #4a9ecf) 14%, transparent);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--accent, #4a9ecf);
}

.note-arrow {
  font-size: 14px;
  color: rgba(23, 32, 44, 0.22);
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
    color 0.3s ease;
}

.note:hover .note-arrow {
  transform: translate(3px, -3px);
  color: rgba(23, 32, 44, 0.7);
}

.note h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.note p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.85;
  color: rgba(23, 32, 44, 0.6);
  white-space: pre-line;
}

/* ---------------- 关于 ---------------- */

.about {
  position: relative;
  z-index: 2;
  padding: 0 24px clamp(50px, 8vw, 90px);
  background: var(--paper);
}

.about-card {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(26px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfcfa;
}

.about-card h2 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.about-card p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--muted);
}

.about-note {
  margin-top: 16px !important;
  font-size: 12.5px !important;
  color: var(--dim) !important;
}

/* ---------------- 页脚 ---------------- */

.footer {
  position: relative;
  z-index: 2;
  padding: 0 24px 54px;
  background: var(--paper);
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(23, 32, 44, 0.3);
}

/* ---------------- 落叶 / 花瓣 ---------------- */

.petals {
  position: fixed;
  inset: 0;
  z-index: 30;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------------- 入场动画 ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.notes .reveal {
  transition-delay: var(--d, 0ms);
}

/* ---------------- 小屏 ---------------- */

@media (max-width: 640px) {
  .hero {
    padding: 120px 18px 170px;
  }

  .glass {
    border-radius: 20px;
  }

  .brand-main {
    font-size: 14.5px;
    letter-spacing: 0.24em;
  }

  .brand-sub {
    font-size: 10px;
  }

  .nav {
    gap: 16px;
  }

  .notes {
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 360px;
  }

  .note {
    min-height: 0;
  }

  .scroll-hint {
    bottom: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bg-layer {
    transition: none !important;
  }

  .wave-back,
  .wave-front {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-dot {
    animation: none;
  }

  .quote {
    transition: none;
  }
}
