/* ============================================================
   Styles —— 深色极简作品集
   ============================================================ */

:root {
  --bg: #0b0b0c;
  --bg-soft: #131315;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f2f0ec;
  --text-dim: #9a9891;
  --accent: #d8b26a;
  --radius: 14px;
  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   动态背景层
   ============================================================ */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-blob {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  will-change: transform;
}
.bg-blob--1 {
  top: -12%;
  left: -8%;
  background: radial-gradient(circle at 30% 30%, #d8b26a, transparent 70%);
  animation: blobMove1 26s ease-in-out infinite;
}
.bg-blob--2 {
  bottom: -16%;
  right: -10%;
  background: radial-gradient(circle at 60% 40%, #4b6cb7, transparent 70%);
  animation: blobMove2 32s ease-in-out infinite;
}
.bg-blob--3 {
  top: 34%;
  left: 42%;
  width: 38vw;
  height: 38vw;
  background: radial-gradient(circle at 50% 50%, #b74b7d, transparent 70%);
  opacity: 0.16;
  animation: blobMove3 38s ease-in-out infinite;
}
@keyframes blobMove1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(14vw, 8vh) scale(1.15); }
  66% { transform: translate(-6vw, 14vh) scale(0.95); }
}
@keyframes blobMove2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(-12vw, -10vh) scale(1.1); }
  70% { transform: translate(6vw, -16vh) scale(0.9); }
}
@keyframes blobMove3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-16vw, 10vh) scale(1.2); }
}

.bg-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* 胶片颗粒 */
.bg-grain {
  position: absolute;
  inset: -100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.045;
  animation: grain 0.6s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-4%, 3%); }
  50% { transform: translate(3%, -4%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(4%, 2%); }
}

/* 鼠标跟随光晕 */
.bg-glow {
  position: absolute;
  top: 0; left: 0;
  width: 310px;
  height: 310px;
  margin: -155px 0 0 -155px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 178, 106, 0.16), transparent 62%);
  transform: translate(var(--mx, 50vw), var(--my, 50vh));
  transition: opacity 0.4s ease;
  opacity: 0;
}
.bg.is-pointer .bg-glow { opacity: 1; }

@media (max-width: 860px) {
  .bg-glow { display: none; }
  .bg-blob { filter: blur(60px); opacity: 0.18; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-blob, .bg-grain { animation: none !important; }
}

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8rem 2rem;
  scroll-margin-top: 80px;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.section-title {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
}

/* ===== 顶部导航 ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 2rem;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease),
    padding 0.4s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(11, 11, 12, 0.72);
  backdrop-filter: blur(14px);
  padding: 0.9rem 2rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 600;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
}
.nav { display: flex; gap: 2rem; }
.nav a {
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color 0.25s;
  position: relative;
}
.nav a:hover { color: var(--text); }
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav a:hover::after { width: 100%; }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
}
.hero-title {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: clamp(3rem, 12vw, 9rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0.4rem 0 1.4rem;
}

/* ===== 标题文字动效 =====
   外层 .t-char 负责“悬停”过渡，内层 .t-inner 负责“静止”起伏，
   分开两层，动效才能各自顺滑、互不干扰 */
.t-char {
  display: inline-block;
  cursor: default;
  transition: transform 0.55s var(--ease), color 0.55s var(--ease);
  transition-delay: calc(var(--i, 0) * 32ms);
}
.t-inner {
  display: inline-block;
  animation: titleWave 5.5s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.11s);
}
@keyframes titleWave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.09em); }
}

/* 悬停：错落上浮 + 倾斜 + 描金 */
.hero-title:hover .t-char,
.section-title:hover .t-char,
.contact-title:hover .t-char {
  transform: translateY(-0.16em);
  color: var(--accent);
}
.hero-title:hover .t-inner,
.section-title:hover .t-inner,
.contact-title:hover .t-inner {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .t-inner { animation: none; }
  .t-char { transition: none; }
}
.hero-intro {
  max-width: 30rem;
  color: var(--text-dim);
  font-size: 1.05rem;
}
.hero-badge {
  margin-top: 1.8rem;
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(216, 178, 106, 0.4);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  background: rgba(216, 178, 106, 0.06);
}
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  animation: float 2.4s ease-in-out infinite;
}
.scroll-hint:hover { color: var(--accent); }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ===== 作品区 ===== */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--text-dim); }
.filter.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}
.work-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  opacity: 0;
  transform: translateY(28px);
  animation: reveal 0.7s var(--ease) forwards;
}
.work-card.featured { grid-column: span 2; aspect-ratio: 16 / 9; }
.work-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease), opacity 0.5s;
}
.work-card:hover img { transform: scale(1.05); }
.work-card .card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.6rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.15) 45%,
    rgba(0, 0, 0, 0) 70%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.work-card:hover .card-overlay { opacity: 1; }
.card-title {
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  font-weight: 500;
}
.card-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}
.card-badge {
  position: absolute;
  top: 1rem; right: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.card-badge svg { width: 14px; height: 14px; fill: #fff; }

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 关于 ===== */
.about {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
}
.about-text { color: var(--text-dim); margin: 1.4rem 0 2rem; max-width: 34rem; }

/* 技能标签 */
.skills { display: grid; gap: 1.3rem; margin-bottom: 1.6rem; }
.skill-group-title {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.7rem;
}
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.25s var(--ease);
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.skill-group.is-ai .skill-group-title { color: var(--accent); }
.skill-group.is-ai .tag {
  border-color: rgba(216, 178, 106, 0.35);
  background: rgba(216, 178, 106, 0.06);
}

/* 本站由 AI 制作 说明 */
.ai-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  border-left: 2px solid var(--accent);
  padding-left: 0.9rem;
  margin-bottom: 1.8rem;
}

.socials { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.socials a {
  font-size: 0.82rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  transition: all 0.25s var(--ease);
}
.socials a:hover { color: var(--bg); background: var(--accent); border-color: var(--accent); }

/* ===== 联系 ===== */
.contact {
  text-align: center;
  border-top: 1px solid var(--line);
}
.contact-title {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.15;
  width: fit-content;
  margin: 0 auto 2rem;
}
.contact-mail {
  display: inline-block;
  font-size: clamp(1rem, 3vw, 1.6rem);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
  transition: color 0.25s, border-color 0.25s;
}
.contact-mail:hover { color: var(--accent); border-color: var(--accent); }

/* ===== 页脚 ===== */
.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 2rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  border-top: 1px solid var(--line);
}

/* ===== 弹层 ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.modal.is-open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  animation: fade 0.3s ease;
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(1000px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: pop 0.35s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
}
.modal-close {
  position: absolute;
  top: 0.6rem; right: 0.8rem;
  z-index: 3;
  width: 40px; height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s;
}
.modal-close:hover { background: rgba(0, 0, 0, 0.75); }
.modal-stage { background: #000; }
.modal-stage.is-video { aspect-ratio: 16 / 9; }
.modal-stage iframe {
  width: 100%; height: 100%;
  border: 0; display: block;
}
.modal-stage img { width: 100%; height: auto; display: block; }
.modal-stage video { width: 100%; height: auto; display: block; background: #000; }
.modal-info { padding: 1.6rem 1.8rem 2rem; }
.modal-info-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.modal-info-head h3 {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: 1.7rem;
}
.modal-type {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.modal-info p { color: var(--text-dim); margin: 0.8rem 0 1.4rem; }
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}
.modal-meta span { color: var(--text-dim); }
.modal-meta b { color: var(--text); font-weight: 500; display: block; margin-top: 0.15rem; }

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  .section { padding: 5.5rem 1.4rem; }
  .works-grid { grid-template-columns: 1fr; }
  .work-card.featured { grid-column: span 1; aspect-ratio: 16 / 10; }
  .about { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-media img { aspect-ratio: 3 / 2; }
  .site-header { padding: 1rem 1.4rem; }
  .nav { gap: 1.2rem; }
  .modal { padding: 0; }
  .modal-panel { max-height: 100vh; border-radius: 0; height: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
