/*
  芩川 · Xarles 个人网站 — 样式表
  风格：黑白极简 + 米黄点缀 + 建筑图纸编号感（对标参照 PPT）
  改配色：调下面 :root 里的颜色变量即可，全站统一生效。
*/

/* ============ 全局颜色 / 字体变量 ============ */
:root {
  --cream: #F5F1E8;        /* 奶油白背景 */
  --cream-deep: #DBD0B6;   /* 网格线颜色（比奶油底深一点，让网格更明显） */
  --ink: #1A1A1A;          /* 近黑：主文字、深色块 */
  --ink-soft: #4A4640;     /* 柔和深色：副文字 */
  --yellow: #ffffff;       /* 纯白强调色（原米黄 #E8D9B5 已改为纯白） */
  --marquee: #E8D9B5;      /* 米黄：专门留给走马灯横幅用 */
  --line: #1A1A1A;         /* 结构网格线颜色 */

  /* 字体：英文数字用 Inter，中文走系统黑体栈 */
  --font: "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

/* ============ 基础重置 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }   /* 锚点跳转平滑滚动 */

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ============ 顶部导航条（固定） ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 6vw;
  background: rgba(245, 241, 232, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink);
}
.nav__brand { font-weight: 800; letter-spacing: 0.02em; font-size: 15px; }
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  position: relative;
  padding-bottom: 2px;
}
/* 导航 hover：下方画一条线 */
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1.5px;
  background: var(--ink);
  transition: width 0.25s ease;
}
.nav__links a:hover::after { width: 100%; }

/* ============ Hero 开篇 ============ */
.hero {
  min-height: calc(100vh - 92px);  /* 高度 = 视口 - 走马灯高，使走马灯底部正好贴首屏底边（JS 会按实际走马灯高再校准） */
  padding: 100px 6vw 28px;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 60px;
  align-items: center;
  position: relative;
}
.hero__eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.hero__title {
  font-size: clamp(48px, 9vw, 120px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
}
.hero__title-en {
  font-size: clamp(28px, 5vw, 58px);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-top: 8px;
}
.hero__slogan {
  font-size: clamp(17px, 2.2vw, 24px);
  margin-top: 36px;
  max-width: 30ch;
  color: var(--ink-soft);
}
.hero__slogan strong { color: var(--ink); font-weight: 700; }
.hero__tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
}
.hero__tags li {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.hero__tags li:hover { background: var(--ink); color: var(--cream); }

/* 头像图框：模拟建筑制图的图框 + 图签 */
.hero__portrait { display: flex; justify-content: center; }
.frame {
  position: relative;
  border: 1.5px solid var(--ink);
  padding: 14px;
  background: var(--cream);
  max-width: 360px;
}
.frame img { display: block; width: 100%; height: auto; }
.frame figcaption {
  position: absolute;
  bottom: 14px; right: 14px;
  background: var(--ink);
  color: var(--cream);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 5px 10px;
}

/* 下滚提示：放在头像下方，宽度跟随头像并右对齐其右缘 */
/* 下滚提示：绝对定位，由 JS 动态对齐头像右缘与左侧标签行（见 script.js） */
.hero__scroll {
  position: absolute;
  top: 50%;
  right: 150px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}
.hero__scroll-arrow { animation: bounce 1.6s infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
/* 头像悬浮动画 */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ============ 通用 section 容器 ============ */
.section {
  position: relative;
  padding: 110px 6vw;
  border-top: 1px solid var(--ink);
}
/* 大号图纸编号：放在每个区左上角 */
.section__index {
  font-size: clamp(56px, 11vw, 150px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: transparent;            /* 透明填充：只保留描边的空心字效果 */
  -webkit-text-stroke: 1.5px var(--ink);
  margin-bottom: 8px;
}
.section__index--light { color: transparent; -webkit-text-stroke: 1.5px var(--cream); }
.section__head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 56px;
}
.section__title { font-size: clamp(30px, 5vw, 52px); font-weight: 800; letter-spacing: -0.01em; }
.section__title-en {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

/* ============ 01 关于我 ============ */
/* 黑底反白：和 05 联系页一样，用整块深色做分区分割，不全靠线条 */
.section--about { background: var(--ink); color: var(--cream); }
.section--about .section__title { color: var(--cream); }
.section--about .section__title-en { color: #9c958a; }
.section--about .section__index { color: transparent; -webkit-text-stroke: 1.5px var(--cream); }
.about__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
}
.about__lead p { font-size: clamp(16px, 1.9vw, 20px); margin-bottom: 22px; }
.about__lead strong { font-weight: 700; }
/* 右侧图签栏 */
.about__meta {
  border: 1.5px solid var(--ink);
  padding: 28px;
  align-self: start;
  background: var(--cream);
}
.about__meta dl { display: grid; grid-template-columns: auto 1fr; gap: 16px 22px; }
.about__meta dt {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  border-right: 1px solid var(--ink);
  padding-right: 16px;
}
.about__meta dd { font-size: 17px; font-weight: 600; color: var(--ink); }

/* ============ 02 我能做什么 ============ */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.card {
  padding: 40px 36px;
  border: 1.5px solid var(--ink);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}
.card:hover { transform: translateY(-6px); }
.card--dark { background: var(--ink); color: var(--cream); }
.card--cream { background: var(--yellow); color: var(--ink); }
.card__no {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  opacity: 0.6;
}
.card__title { font-size: 26px; font-weight: 800; margin: 14px 0 16px; }
.card__desc { font-size: 15px; line-height: 1.75; }

/* ============ 03 我的作品 ============ */
/* 黑底反白：与 01、05 一致，用深色块做分区 */
.section--works { background: var(--ink); color: var(--cream); }
.section--works .section__title { color: var(--cream); }
.section--works .section__title-en { color: #9c958a; }
.section--works .section__index { color: transparent; -webkit-text-stroke: 1.5px var(--cream); }
/* 横向滑动提示 */
.works__hint {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #9c958a;
  margin: -32px 0 28px;
}
/* 横向滚动轨道：网页特有的浏览方式，PPT 给不了 */
.works__track {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  padding-bottom: 24px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.works__track::-webkit-scrollbar { height: 6px; }
.works__track::-webkit-scrollbar-thumb { background: #4a4640; border-radius: 999px; }
.work {
  flex: 0 0 min(560px, 82vw);
  scroll-snap-align: start;
  border: 1.5px solid var(--cream);
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.work:hover { transform: translateY(-8px); background: var(--cream); color: var(--ink); }
.work:hover .work__tagline { color: var(--ink-soft); }
.work:hover .work__no { -webkit-text-stroke-color: var(--ink); }
.work:hover .work__role span { background: var(--ink); color: var(--cream); }
.work:hover .work__link { border-bottom-color: var(--ink); }
.work__no {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--cream);
  line-height: 1;
  margin-bottom: 18px;
  transition: -webkit-text-stroke-color 0.3s ease;
}
.work__title { font-size: clamp(26px, 4vw, 40px); font-weight: 800; }
.work__tagline {
  font-size: 15px;
  font-weight: 600;
  color: #b8b1a4;
  margin: 6px 0 18px;
  letter-spacing: 0.02em;
}
.work__desc { font-size: 16px; max-width: 56ch; margin-bottom: 18px; }
.work__role { font-size: 14px; font-weight: 600; }
.work__role span {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  margin-right: 12px;
}
.work__link {
  display: inline-block;
  margin-top: 18px;
  font-weight: 700;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 2px;
  transition: opacity 0.2s;
}
.work__link:hover { opacity: 0.55; }

/* ============ 04 关于生活 ============ */
.life__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.life__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  border: 1.5px solid var(--ink);
  padding: 16px 28px;
  border-radius: 999px;
  background: var(--cream);
}
.life__icon { font-size: 22px; }

/* ============ 05 联系我（黑底反白） ============ */
.section--contact {
  background: var(--ink);
  color: var(--cream);
}
.section--contact .section__title { color: var(--cream); }
.section--contact .section__title-en { color: #9c958a; }
.contact__lead {
  font-size: clamp(44px, 9vw, 110px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  text-align: center;
}
.contact__sub { font-size: 17px; color: #b8b1a4; margin: 20px auto 56px; max-width: 40ch; text-align: center; }
.contact__list { list-style: none; display: grid; gap: 0; max-width: 720px; margin: 0 auto; width: 100%; }
.contact__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid #3a3631;
}
.contact__item:last-child { border-bottom: 1px solid #3a3631; }
.contact__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #9c958a;
}
.contact__value { font-size: clamp(18px, 2.6vw, 26px); font-weight: 700; display: flex; align-items: center; gap: 14px; }
.contact__value a { border-bottom: 2px solid var(--yellow); transition: opacity 0.2s; }
.contact__value a:hover { opacity: 0.6; }
/* 复制按钮 */
.contact__copy {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink);
  background: var(--yellow);
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.contact__copy:hover { opacity: 0.75; }
.contact__copy.copied { background: var(--cream); }

/* ============ 页脚 ============ */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 6vw;
  font-size: 13px;
  font-weight: 600;
  background: var(--ink);
  color: #9c958a;
  border-top: 1px solid #3a3631;
}
.footer a:hover { color: var(--cream); }

/* ============ 滚动入场动画 ============ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
/* 逐行/逐项依次浮现：靠 --d 变量错开延迟，做出"流动"而非"整块弹出" */
.reveal[style*="--d"] { transition-delay: var(--d); }

/* ============ 网页化元素 ============ */

/* 1. 顶部滚动进度条 */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--ink);
  z-index: 200;
  transition: width 0.1s linear;
}

/* 2. 跟随鼠标的小光标点（仅有鼠标的设备显示） */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 14px; height: 14px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 300;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  mix-blend-mode: difference;
  opacity: 0;
}
.cursor-dot.is-active { opacity: 1; }
.cursor-dot.is-hover { width: 46px; height: 46px; background: var(--cream); }
@media (hover: none) { .cursor-dot { display: none; } }

/* 3. 区块之间的跑马灯横幅：横向无限滚动的文字带，强网页感 */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  background: var(--marquee);
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  padding: 16px 0;
}
.marquee__inner {
  display: inline-block;
  animation: marquee 22s linear infinite;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.marquee__inner span { margin: 0 28px; }
.marquee__inner span.dot { color: var(--ink-soft); }
.marquee:hover .marquee__inner { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* 4. Hero 视差：标题与头像随滚动轻微错位（由 JS 设置 --py） */
.hero__text { transform: translateY(calc(var(--py, 0) * -0.15px)); }
.hero__portrait { transform: translateY(calc(var(--py, 0) * 0.08px)); }
/* 下滚提示垂直对齐标签行，故跟随标签所在的 hero__text 做同样视差位移；-50% 为自身垂直居中 */
.hero__scroll { transform: translateY(calc(-50% + var(--py, 0) * -0.15px)); }

/* ============ 响应式：手机 / 平板 ============ */
@media (max-width: 860px) {
  .hero {
    gap: 32px;
    padding-top: 110px;
  }
  .hero__portrait { justify-content: center; }
  .avatar { max-width: 200px; }
  .about__grid { grid-template-columns: 1fr; gap: 36px; }
  .skills__grid { grid-template-columns: 1fr; }
  .work { flex: 0 0 86vw; padding: 32px 26px; }
  .nav__links { gap: 18px; }
  .nav__brand { font-size: 13px; }
  .nav__links a { font-size: 12px; }
  .contact__item { flex-direction: column; align-items: flex-start; }
  /* 手机上关掉视差，避免错位 */
  .hero__text, .hero__portrait { transform: none; }
}

@media (max-width: 480px) {
  .nav { padding: 14px 5vw; }
  .nav__links { gap: 14px; }
  .section { padding: 70px 5vw; }
  .hero { padding: 110px 5vw 70px; }
}

/* ============ 无障碍：尊重「减少动态效果」偏好 ============ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* 键盘聚焦可见 */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.section--contact a:focus-visible, .contact__copy:focus-visible {
  outline-color: var(--yellow);
}
