/* ============================================================
   JUE 珏 — Motion & reveal system
   ============================================================ */

/* ---- Keyframes ---- */
@keyframes kenburns {
  0%   { transform: scale(1.02) translate3d(0, 0, 0); }
  100% { transform: scale(1.14) translate3d(-1.5%, -2%, 0); }
}
@keyframes drip {
  0%   { transform: scaleY(0); transform-origin: top; }
  55%  { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@keyframes eq {
  0%, 100% { height: 25%; }
  50% { height: 100%; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, 34px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* ---- Hero entrance (applied via .anim-in elements) ----
   Hidden ONLY when JS is confirmed present (html.js), so a
   failed script never leaves content invisible. */
html.js .anim-in { opacity: 0; }
.anim-in.arrived { animation: fadeUp 1.2s var(--ease-lux) both; }
.anim-in.d1 { animation-delay: 0.12s; }
.anim-in.d2 { animation-delay: 0.24s; }
.anim-in.d3 { animation-delay: 0.38s; }
.anim-in.d4 { animation-delay: 0.52s; }

/* ---- Scroll reveal (default hidden, .in reveals) ---- */
html.js [data-reveal] { opacity: 0; transform: translate3d(0, 40px, 0); transition: opacity 1s var(--ease-lux), transform 1s var(--ease-lux); }
html.js [data-reveal].in { opacity: 1; transform: none; }
html.js [data-reveal="left"] { transform: translate3d(-44px, 0, 0); }
html.js [data-reveal="right"] { transform: translate3d(44px, 0, 0); }
html.js [data-reveal="scale"] { transform: scale(0.94); }
[data-reveal].in { transform: none; }
[data-reveal][data-delay="1"] { transition-delay: 0.15s; }
[data-reveal][data-delay="2"] { transition-delay: 0.3s; }
[data-reveal][data-delay="3"] { transition-delay: 0.45s; }

/* ---- Parallax helper ---- */
[data-parallax] { will-change: transform; }

/* ---- Marquee (motto strip) ---- */
.marquee {
  overflow: hidden; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  padding: 1.1rem 0; white-space: nowrap;
}
.marquee-track { display: inline-flex; gap: 3.5rem; padding-left: 2rem; animation: marquee 30s linear infinite; will-change: transform; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-item {
  font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--muted);
  display: inline-flex; align-items: center; gap: 3.5rem;
}
.marquee-item::after { content: "◆"; font-size: 0.6rem; color: var(--gold-dim); }

/* ---- Gold shimmer text ---- */
.shimmer-text {
  background: linear-gradient(110deg, var(--gold-dim) 20%, var(--gold-soft) 40%, var(--gold) 50%, var(--gold-dim) 70%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer 6s linear infinite;
}

/* ---- Chapter title underline growth ---- */
.chapter-title-line { display: inline-block; }
.chapter-title-line::after {
  content: ""; display: block; width: 0; height: 1px; background: var(--gold);
  transition: width 1.4s var(--ease-slow);
}
[data-reveal].in .chapter-title-line::after { width: 100%; }

/* ---- Fade-through page enter overlay ---- */
.page-veil {
  position: fixed; top:0;right:0;bottom:0;left:0; z-index: 500; background: var(--bg); pointer-events: none;
  will-change: transform, opacity;
}
/* 点击转场：幕布快速淡入（覆盖当前页） */
.page-veil.veil-in { animation: veil-in .22s var(--ease-lux) both; }
@keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }
/* 内部跳转到达：幕布快速上卷 + 轻微淡出 */
.page-veil.veil-out { animation: veil-out .38s var(--ease-lux) both; }
@keyframes veil-out { from { opacity: 1; transform: translateY(0); } to { opacity: .4; transform: translateY(-101%); } }

/* ---- Hero 金色光扫（GPU 合成，慢速） ---- */
.hero-media::after {
  content: ""; position: absolute; top:-20%;right:-20%;bottom:-20%;left:-20%; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(232,214,171,.07) 50%, transparent 58%);
  animation: hero-sheen 14s var(--ease-slow) infinite;
  mix-blend-mode: screen;
}
@keyframes hero-sheen {
  0%   { transform: translateX(-30%) rotate(0deg); }
  100% { transform: translateX(30%) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-media::after { animation: none; opacity: 0; }
}

/* ============================================================
   统一内容动效系统（B）
   ============================================================ */

/* ---- 标题金线扫过（配合 .title-line） ---- */
[data-fx="title"] { position: relative; display: inline-block; }
[data-fx="title"]::after {
  content: ""; position: absolute; left: 0; bottom: -0.12em; height: 1px; width: 100%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  background-size: 200% 100%; opacity: 0;
  animation: fx-title-line 2.6s var(--ease-slow) infinite;
}
@keyframes fx-title-line { 0% { background-position: -200% 0; opacity: 0; } 30% { opacity: .8; } 100% { background-position: 200% 0; opacity: 0; } }

/* ---- 字遮罩上推（GSAP 或 class 触发） ---- */
[data-fx="chars"] .fx-char { display: inline-block; opacity: 0; transform: translateY(26px); }
[data-fx="chars"].fx-on .fx-char { opacity: 1; transform: none; transition: opacity .7s var(--ease-lux), transform .7s var(--ease-lux); }

/* ---- 数字金色脉冲（价格/序号 hover） ---- */
.fx-num { transition: text-shadow .4s var(--ease-lux), color .4s var(--ease-lux); }
.fx-num:hover, .piece-card:hover .fx-num, .board-tile:hover .fx-num {
  color: var(--gold-soft); text-shadow: 0 0 18px rgba(201,168,108,.6);
}

/* ---- 卡片金框描边渐显 ---- */
.fx-card {
  position: relative; overflow: hidden;
  transition: transform .7s var(--ease-lux), box-shadow .7s var(--ease-lux), border-color .7s var(--ease-lux);
}
.fx-card::before {
  content: ""; position: absolute; top:0;right:0;bottom:0;left:0; pointer-events: none; z-index: 2;
  background: linear-gradient(120deg, transparent 30%, rgba(232,214,171,.12) 45%, rgba(201,168,108,.2) 50%, rgba(232,214,171,.12) 55%, transparent 70%);
  background-size: 250% 100%;
  opacity: 0; transition: opacity .6s var(--ease-lux);
}
.fx-card:hover::before { opacity: 1; animation: fx-sheen 1.2s var(--ease-lux); }
@keyframes fx-sheen { 0% { background-position: 200% 0; } 100% { background-position: -80% 0; } }

/* ---- 分区视差（hero 内容） ---- */
[data-hero-depth] { will-change: transform; }

/* ---- 滚动进度金线 ---- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; z-index: 85;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-soft), var(--gold));
  box-shadow: 0 0 12px rgba(201,168,108,.5);
}

/* ---- 金尘爆开（板块卡片入场） ---- */
@keyframes fx-burst {
  0% { transform: translate(0,0) scale(.6); opacity: .9; }
  100% { transform: translate(var(--bx), var(--by)) scale(1.6); opacity: 0; }
}
.fx-burst { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); pointer-events: none; z-index: 3; animation: fx-burst .9s ease-out forwards; }

/* ============================================================
   JUE 珏 — 内容升级配套动效（fx2 / timeline / numbers / quote）
   ============================================================ */

/* ---- [data-frame] 分区金框描边自中心渐显 ---- */
[data-frame] { position: relative; }
[data-frame]::before {
  content: ""; position: absolute; top:0;right:0;bottom:0;left:0; z-index: 0; pointer-events: none;
  border: 1px solid rgba(201,168,108,.45);
  opacity: 0; transform: scale(.92);
  transition: opacity 1s var(--ease-lux), transform 1.2s var(--ease-slow);
}
[data-frame].framed::before { opacity: 1; transform: scale(1); }

/* ---- 编年 / 工艺时间线 ---- */
.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft);
}
.tl-step {
  position: relative; background: var(--bg);
  padding: 2rem;
  padding: clamp(2rem, 4vw, 3rem);
  min-height: 240px;
  display: flex; flex-direction: column; gap: .9rem;
  overflow: hidden;
  transition: background .7s var(--ease-lux);
}
.tl-step::after {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-soft));
  transition: width 1.2s var(--ease-slow);
}
.tl-step:hover { background: var(--bg-2); }
.tl-step:hover::after { width: 100%; }
.tl-step .tl-num { margin-bottom: .4rem; }
.tl-step .h3 { font-size: 1.25rem; line-height: 1.35; }
.tl-step .zh { color: var(--gold); letter-spacing: .3em; margin-right: .5em; font-size: .85em; }
.tl-step p { color: var(--muted); font-size: var(--fs-small); }

/* ---- 数字证据条 ---- */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft);
}
.num-cell {
  background: var(--bg);
  padding: 2rem;
  padding: clamp(2rem, 4vw, 3rem);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  transition: background .7s var(--ease-lux);
}
.num-cell:hover { background: var(--bg-2); }
.num-value {
  font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: var(--gold-soft); line-height: 1;
  text-shadow: 0 0 24px rgba(201,168,108,.35);
}
.num-zh { letter-spacing: .4em; }
.num-label { color: var(--muted-2); font-size: var(--fs-micro); letter-spacing: .18em; text-transform: uppercase; }

/* ---- 引文区块 ---- */
.big-quote {
  text-align: center; position: relative;
  padding: 2rem;
  padding: clamp(2rem, 6vh, 4rem) 0;
}
.quote-mark {
  font-family: var(--serif); font-size: 4rem; line-height: .6;
  color: var(--gold-dim); opacity: .7; margin-bottom: 1.4rem;
}
.quote-text {
  font-family: var(--zh); font-size: clamp(1.5rem, 3.4vw, 2.6rem);
  color: var(--gold-soft); letter-spacing: .18em; line-height: 1.6;
  min-height: 1.6em; max-width: 30rem; margin: 0 auto;
}
.quote-text.typing::after { content: "▍"; animation: q-caret 1s steps(1) infinite; color: var(--gold-dim); }
@keyframes q-caret { 50% { opacity: 0; } }
.quote-text.typed::after { content: ""; }
.quote-src { margin-top: 1.4rem; color: var(--muted-2); }

/* ---- 规格档案 ---- */
.spec-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center;
}
@media (max-width: 900px) { .spec-grid { grid-template-columns: 1fr; } }
.spec-lead .lead { margin-top: 1.2rem; }
.spec-sheet {
  border: 1px solid var(--line); background: var(--bg-2);
  padding: 1.4rem;
  padding: clamp(1.4rem, 3vw, 2.4rem);
}
.spec-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .95rem 0; border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-small);
}
.spec-row > span:first-child { color: var(--muted-2); letter-spacing: .18em; text-transform: uppercase; }
.spec-row > span:last-child { color: var(--ink-text); text-align: right; }
.spec-row-total { border-bottom: 0; padding-top: 1.2rem; }
.spec-row-total .price { font-family: var(--serif); font-size: 1.6rem; color: var(--gold-soft); }

/* ---- 问愿三步 ---- */
.fortune-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  margin-top: 2.4rem;
}
@media (max-width: 700px) { .fortune-steps { grid-template-columns: 1fr; } }
.fstep { background: rgba(15,13,9,.72); padding: 1.5rem 1.4rem; display: flex; gap: 1rem; align-items: flex-start; }
.fstep-num {
  font-family: var(--zh); font-size: 1.3rem; color: var(--gold); line-height: 1;
  flex: none; margin-top: .1rem;
}
.fstep-en { color: var(--gold-dim); letter-spacing: .22em; }
.fstep-zh { font-family: var(--zh); color: var(--gold-soft); letter-spacing: .2em; margin-top: .3rem; font-size: 1rem; }
.fstep-text { color: var(--muted); font-size: var(--fs-small); margin-top: .35rem; line-height: 1.6; }

/* ---- 星尘第二层（CSS 漂移，GPU） ---- */
.star-drift {
  position: fixed; top:-25%;right:-25%;bottom:-25%;left:-25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1.5px 1.5px at 18% 22%, rgba(232,214,171,.28), transparent 100%),
    radial-gradient(1px 1px at 32% 68%, rgba(232,214,171,.18), transparent 100%),
    radial-gradient(2px 2px at 55% 30%, rgba(183,208,191,.2), transparent 100%),
    radial-gradient(1.5px 1.5px at 70% 55%, rgba(232,214,171,.16), transparent 100%),
    radial-gradient(1px 1px at 84% 20%, rgba(183,208,191,.18), transparent 100%),
    radial-gradient(2px 2px at 90% 80%, rgba(232,214,171,.14), transparent 100%),
    radial-gradient(1.5px 1.5px at 10% 85%, rgba(232,214,171,.16), transparent 100%),
    radial-gradient(1px 1px at 45% 90%, rgba(183,208,191,.14), transparent 100%);
  animation: star-drift 70s linear infinite;
  will-change: transform;
}
@keyframes star-drift {
  from { transform: translate3d(0,0,0); }
  to   { transform: translate3d(3%, 2%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .star-drift, .quote-text.typing::after { animation: none; }
}
