/* ========================================================================
   cards.css — 卡片堆叠机制 + Hero 区 + 卡片通用结构
   （collage-website-skill §2 页面结构 + §2.4 卡片堆叠）
   ======================================================================== */

/* ─────────────── 导航栏 (skill §2.2) ─────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 62px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(242, 238, 230, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.3s var(--ease-main);
}
.navbar.scrolled {
  background: rgba(242, 238, 230, 0.95);
}
.wordmark {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.6;
  transition: opacity 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
}

/* ─────────────── Hero 首页区 (skill §2.3) ─────────────── */
.hero {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 0;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cream) 0%, #e8e2d5 100%);
  z-index: 0;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.28;
  mix-blend-mode: soft-light;
}
.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 62px 40px 0;
  display: flex;
  align-items: center;
  gap: 40px;
}
.hero-text {
  width: min(660px, 58%);
}
.hero-tagline {
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 16px;
}
.hero-name {
  font-family: var(--font-serif);
  font-size: 92px;
  line-height: 0.92;
  font-weight: 700;
  margin-bottom: 16px;
}
.hero-role {
  font-size: 18px;
  opacity: 0.75;
  margin-bottom: 40px;
}
.hero-stats {
  display: flex;
  gap: 48px;
}
.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  display: block;
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-top: 6px;
}

/* 右侧人物拼贴区（几何剪影贴图） */
.hero-figure {
  position: relative;
  width: min(50%, 650px);
  height: 68%;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-figure-img {
  width: min(100%, 300px);
  transform: rotate(-3deg);
  filter: drop-shadow(0 14px 30px rgba(41, 38, 38, 0.18));
}
.figure-circle {
  position: absolute;
  right: 10%;
  bottom: 8%;
  width: 120px;
  height: 120px;
  border: 2px dashed var(--ink);
  border-radius: 50%;
  opacity: 0.3;
}

/* 滚动提示 */
.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 44px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
  opacity: 0.4;
  z-index: 2;
}
.scroll-ball {
  width: 6px;
  height: 6px;
  background: var(--ink);
  border-radius: 50%;
  animation: scrollBall 1.6s var(--ease-main) infinite;
}
@keyframes scrollBall {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(16px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ─────────────── 卡片区（普通滚动，每卡至少一屏） ─────────────── */
.card-stack {
  position: relative;
  z-index: 1;
}

.portfolio-card {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--card-color);
  overflow: hidden;
}

/* 卡片顶部大标题 (skill §3.1) */
.card-crown {
  position: absolute;
  top: 20px;
  left: 40px;
  font-family: var(--font-display);
  font-size: 132px;
  font-weight: 700;
  line-height: 1;
  color: var(--card-title);
  z-index: 2;
  white-space: nowrap;
}
.card-crown[data-shadow]::after {
  color: var(--ink);
  opacity: 0.18;
}

/* 卡片编号便签 */
.card-sticky-note {
  position: absolute;
  top: 170px;
  left: 44px;
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--card-title);
  opacity: 0.7;
  z-index: 2;
  padding: 6px 12px;
  border: 1px solid currentColor;
  border-radius: 2px;
  transform: rotate(-2deg);
}

/* 卡片内容区 (skill §2.4 通用结构) */
.card-surface {
  position: relative;
  width: min(92%, 1100px);
  margin-top: 220px;
  background: var(--cream);
  box-shadow: var(--card-shadow);
  border: var(--card-outline);
  z-index: 1;
  /* 锯齿边缘 (skill §1.3 clip-path) */
  clip-path: polygon(
    0% 1.5%, 3% 0%, 8% 1%, 14% 0.5%, 22% 0%, 31% 1.2%, 40% 0.3%, 50% 0.8%,
    60% 0%, 70% 1%, 80% 0.4%, 88% 0%, 95% 1.1%, 100% 0.5%,
    100% 98.5%, 96% 100%, 90% 99%, 82% 99.6%, 74% 100%, 65% 98.8%,
    56% 99.4%, 48% 100%, 38% 99.2%, 28% 99.8%, 18% 99%, 10% 99.5%, 3% 100%, 0% 98.8%
  );
}
.card-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='250' height='250'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.45;
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 0;
}
.card-inner {
  position: relative;
  z-index: 1;
  padding: 70px 60px 80px;
}

/* ─────────────── 入场动画初始状态 (skill §4.1) ─────────────── */
[data-anim] {
  opacity: 0;
}
[data-anim="text"] {
  transform: translateY(16px);
}
.portfolio-card.active [data-anim="text"] {
  animation: fadeUp 0.6s var(--ease-main) 0.1s forwards;
}
.portfolio-card.active [data-anim="media"] {
  animation: fadeIn 0.6s var(--ease-main) 0.9s forwards;
}
.hero [data-anim="text"] {
  animation: fadeUp 0.6s var(--ease-main) 0.2s forwards;
}
.hero [data-anim="figure"] {
  animation: fadeIn 0.8s var(--ease-main) 0.5s forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  to { opacity: 1; }
}
