/* 开屏纸雕山景：图层、配色、离开时的折叠动画 */
.intro-v3 {
  background: #f3ecdc;
  color: #3d4c43;
}
.intro-v3::after {
  opacity: 0.2;
}
.intro-v3 .intro-opening-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #f3ecdc;
}
.intro-v3 .cl {
  position: absolute;
  left: -5%;
  top: -3%;
  width: 110%;
  height: 106%;
  will-change: transform;
  pointer-events: none;
}
.intro-v3 .cl-in {
  width: 100%;
  height: 100%;
}
.intro-v3 .cl svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.intro-v3 .cl.far svg,
.intro-v3 .cl.mid svg,
.intro-v3 .cl.hills svg {
  filter: drop-shadow(0 -5px 12px rgba(122, 88, 64, 0.14));
}
.intro-v3 .cl.near svg,
.intro-v3 .cl.front svg {
  filter: drop-shadow(0 -7px 16px rgba(122, 88, 64, 0.16));
}
/* entrance: layers settle in, nearer ones travel further */
.intro-v3 .cl-in {
  animation: v3-rise 2.4s cubic-bezier(0.16, 0.84, 0.24, 1) both;
}
.intro-v3 .cl.sky .cl-in {
  animation-name: v3-sky;
}
.intro-v3 .cl.clouds .cl-in {
  --r: 30px;
  animation-delay: 0.2s;
}
.intro-v3 .cl.far .cl-in {
  --r: 60px;
  animation-delay: 0.25s;
}
.intro-v3 .cl.mid .cl-in {
  --r: 110px;
  animation-delay: 0.35s;
}
.intro-v3 .cl.hills .cl-in {
  --r: 170px;
  animation-delay: 0.45s;
}
.intro-v3 .cl.near .cl-in {
  --r: 240px;
  animation-delay: 0.55s;
}
.intro-v3 .cl.front .cl-in {
  --r: 320px;
  animation-delay: 0.65s;
}
@keyframes v3-rise {
  from {
    transform: translateY(var(--r, 80px)) scale(1.06);
  }
  to {
    transform: none;
  }
}
@keyframes v3-sky {
  from {
    transform: scale(1.12);
  }
  to {
    transform: none;
  }
}
.intro-v3 .sun {
  animation:
    v3-sun 3.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both,
    v3-glow 6s ease-in-out 4s infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes v3-sun {
  from {
    transform: translateY(230px);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes v3-glow {
  to {
    transform: scale(1.06);
  }
}
@keyframes v3-cloud {
  from {
    transform: translateX(-60px);
  }
  to {
    transform: translateX(90px);
  }
}
.intro-v3 .mist {
  position: absolute;
  left: -30%;
  width: 160%;
  height: 16%;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 250, 240, 0.75), rgba(255, 250, 240, 0) 70%);
  filter: blur(6px);
}
.intro-v3 .mist.m1 {
  top: 55%;
  animation:
    v3-mist 18s ease-in-out infinite alternate,
    fade-in 2.5s ease-out 0.6s both;
}
@keyframes v3-mist {
  from {
    transform: translateX(-8%);
  }
  to {
    transform: translateX(8%);
  }
}
.intro-v3 .tuft {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: v3-sway var(--sw, 3.6s) ease-in-out var(--dl, 0s) infinite alternate;
}
@keyframes v3-sway {
  from {
    transform: rotate(-5deg);
  }
  to {
    transform: rotate(6deg);
  }
}
.intro-v3 .morning-fog {
  position: absolute;
  inset: 0;
  background: #fbf6ec;
  pointer-events: none;
  animation: v3-fog 2.2s ease-out both;
}
@keyframes v3-fog {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

/* copy */
.intro-v3 .intro-copy {
  position: absolute;
  inset: 11% 0 auto 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: auto;
  margin: 0;
  transform: none;
  animation: none;
  color: #3d4c43;
}
.intro-v3 .intro-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: auto;
  font:
    700 12px/1 Neue,
    sans-serif;
  letter-spacing: 0.32em;
  color: #6c5a4a;
  animation: fade-up 0.9s ease-out 1.3s both;
}
.intro-v3 .intro-meta .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e59a5a;
}
.intro-v3 .intro-name {
  display: block;
  overflow: hidden;
  margin: 18px 0 6px;
  padding: 0.04em 0.04em 0.1em;
  font:
    900 clamp(70px, 11.5vw, 176px) / 0.92 Cenzo,
    Impact,
    sans-serif;
  letter-spacing: 0.01em;
  color: #3d4c43;
  white-space: pre;
}
.intro-v3 .intro-name .ch {
  display: inline-block;
  transform: translateY(115%);
  animation: ch-up 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) calc(1s + var(--i, 0) * 70ms) forwards;
}
.intro-v3 .intro-line {
  display: block;
  font:
    700 clamp(15px, 1.5vw, 20px) / 1.4 "Microsoft YaHei",
    "PingFang SC",
    Neue,
    sans-serif;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  color: #b8613f;
  animation: fade-up 0.9s ease-out 1.8s both;
}
.intro-v3 .intro-tagline {
  display: block;
  margin-top: 12px;
  font:
    700 11px/1 Neue,
    "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  color: #6c5a4a;
  animation: fade-up 0.9s ease-out 2.1s both;
}
.intro-v3 .intro-scroll {
  position: absolute;
  z-index: 9;
  left: 50%;
  right: auto;
  bottom: 4.5%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 6px 10px;
  color: #5a4636;
  font:
    700 11px/1 Neue,
    "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0.16em;
  animation: fade-in 1s ease-out 2.4s both;
}
.intro-v3 .intro-scroll span {
  font-size: inherit;
  line-height: 1;
}
.intro-v3 .intro-scroll:hover {
  background: transparent;
  color: #b8613f;
}
.intro-v3 .intro-lang {
  border-color: #5a4636;
  color: #5a4636;
  background: #fbf6ec99;
}
.intro-v3 .intro-lang:hover {
  background: #5a4636;
  color: #fbf6ec;
}
.intro-overlay.leaving .intro-scroll,
.intro-overlay.leaving .intro-lang {
  animation: intro-fade-out 0.3s ease-in forwards;
}
.intro-v3.leaving .intro-copy {
  animation: intro-title-release 0.6s ease-in forwards;
}
.intro-v3.quiet .morning-fog {
  display: none;
}
.intro-v3.quiet .cl-in,
.intro-v3.quiet .sun,
.intro-v3.quiet .intro-name .ch,
.intro-v3.quiet .intro-meta,
.intro-v3.quiet .intro-line,
.intro-v3.quiet .intro-tagline,
.intro-v3.quiet .intro-scroll,
.intro-v3.quiet .intro-lang,
.intro-v3.quiet .mist {
  animation-delay: 0s !important;
  animation-duration: 0.01s !important;
}
.intro-v3.quiet .mist.m1 {
  animation: v3-mist 20s ease-in-out infinite alternate;
}
@media (max-width: 650px) {
  .intro-v3 .intro-copy {
    inset: 13% 5% auto;
  }
  .intro-v3 .intro-name {
    font-size: clamp(46px, 14vw, 80px);
  }
  .intro-v3 .intro-meta {
    font-size: 10px;
    letter-spacing: 0.24em;
  }
  .intro-v3 .intro-line {
    font-size: 14px;
    letter-spacing: 0.2em;
  }
  .intro-v3 .intro-tagline {
    font-size: 9.5px;
    letter-spacing: 0.2em;
  }
}
@media (orientation: portrait) {
  .intro-v3 .sun {
    translate: none;
  }
}
.intro-v3 {
  transition: background-color 0.5s ease;
}
.intro-v3.leaving {
  background: var(--hero-bg);
}
/* ===== 流畅度：只让位移和透明度动，带阴影的图层保持静止 ===== */
.intro-v3 .sun {
  animation: none;
}
.intro-v3 .cl.sunl svg {
  transform-origin: 50% 48%;
  animation:
    v3-sun 3.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both,
    v3-glow 6s ease-in-out 4s infinite alternate;
  will-change: transform, opacity;
}
.intro-v3 .cl.sunl .cl-in {
  animation: none;
}
.intro-v3 .cl.clouds svg {
  animation: v3-cloud 30s ease-in-out infinite alternate;
  will-change: transform;
}
.intro-v3 .mist {
  will-change: transform;
}
.intro-v3::after {
  background: url("../../assets/textures/grain.webp") center/cover;
  mix-blend-mode: normal;
  filter: none;
  opacity: 0.2;
}
.gallery-home .hero::after {
  animation: none;
  mix-blend-mode: normal;
  opacity: 0.05;
}
.intro-v3.quiet .cl.sunl svg {
  animation: v3-glow 6s ease-in-out infinite alternate;
}
.intro-v3 .cl svg {
  filter: none !important;
}
.intro-v3 .tuft {
  animation: none;
}
/* gallery: no animated blur, pause everything behind the opening */
.gallery-home .bg-drift i {
  filter: none;
}
.gallery-home:has(.intro-overlay) .bg-drift i,
.gallery-home:has(.intro-overlay) .stamp-float,
.gallery-home:has(.intro-overlay) .hero-path {
  animation-play-state: paused;
}
.intro-v3 .mist {
  filter: none;
}
/* shadow lives on the moving paper itself, so it is drawn once and travels with the stamp */
.gallery-home .stamp-card {
  filter: none;
}
.gallery-home .stamp-paper {
  filter: drop-shadow(20px 18px 6px #161e183d);
  will-change: transform;
}
/* colour changes repaint only a flat fill; the paper texture sits on its own still layer */
.gallery-home .hero {
  background-image: none;
}
@keyframes path-draw {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* ===== 配色：取自六枚邮票 ===== */
.intro-v3,
.intro-v3 .intro-opening-art {
  background: #f8e8cb;
}
.intro-v3::after {
  opacity: 0.34 !important;
}
.intro-v3 .intro-copy,
.intro-v3 .intro-name {
  color: #173b49;
}
.intro-v3 .intro-meta,
.intro-v3 .intro-tagline {
  color: #7a4a28;
}
.intro-v3 .intro-line {
  color: #c9502d;
}
.intro-v3 .intro-scroll {
  color: #fbf1de;
}
.intro-v3 .intro-scroll:hover {
  color: #f6bb5a;
}
.intro-v3 .mist {
  background: radial-gradient(ellipse at center, rgba(251, 241, 222, 0.55), rgba(251, 241, 222, 0) 70%);
}
.intro-v3 .cl.sunl svg {
  transform-origin: 50% 50%;
}
.intro-v3 .intro-lang {
  border-color: #173b49;
  color: #173b49;
  background: #f8e8cb99;
}
.intro-v3 .intro-lang:hover {
  background: #173b49;
  color: #f8e8cb;
}
/* ===== 离开开屏：图层逐层收起，画面变成第一枚邮票 ===== */
.intro-v3.leaving {
  animation: intro-overlay-release 3.4s ease-in-out forwards;
}
.intro-v3.leaving .intro-art-frame {
  animation: v3-fold 3.4s cubic-bezier(0.65, 0, 0.25, 1) forwards;
}
.intro-v3.leaving .intro-opening-art {
  animation: none;
  z-index: 2;
  background: transparent;
}
.intro-v3.leaving .intro-final-art {
  animation: none;
  opacity: 1;
  z-index: 1;
}
.intro-v3.leaving .cl-in {
  animation: v3-retract 1s cubic-bezier(0.55, 0, 0.35, 1) forwards;
}
.intro-v3.leaving .cl.front .cl-in {
  animation-delay: 0s;
}
.intro-v3.leaving .cl.near .cl-in {
  animation-delay: 0.22s;
}
.intro-v3.leaving .cl.hills .cl-in {
  animation-delay: 0.44s;
}
.intro-v3.leaving .cl.mid .cl-in {
  animation-delay: 0.66s;
}
.intro-v3.leaving .cl.far .cl-in {
  animation-delay: 0.88s;
}
.intro-v3.leaving .cl.clouds .cl-in {
  animation: v3-lift 1s cubic-bezier(0.55, 0, 0.35, 1) 0.5s forwards;
}
.intro-v3.leaving .cl.sunl .cl-in {
  animation: v3-retract 1.1s cubic-bezier(0.55, 0, 0.35, 1) 0.95s forwards;
}
.intro-v3.leaving .cl.sky .cl-in {
  animation: v3-fadeaway 0.7s ease 1.35s forwards;
}
.intro-v3.leaving .mist {
  animation: intro-fade-out 0.4s ease forwards;
}
@keyframes v3-retract {
  to {
    transform: translateY(105%);
  }
}
@keyframes v3-lift {
  to {
    transform: translateY(-60%);
    opacity: 0;
  }
}
@keyframes v3-fadeaway {
  to {
    opacity: 0;
  }
}
@keyframes v3-fold {
  0%,
  58% {
    width: 100vw;
    height: 100vh;
    border-width: 0;
    filter: none;
  }
  92%,
  100% {
    width: var(--intro-target-w);
    height: var(--intro-target-h);
    border-width: 14px;
    filter: drop-shadow(18px 17px 6px #161e1840);
  }
}
.intro-v3.leaving .intro-teeth,
.intro-v3.leaving .intro-stamp-inscription,
.intro-v3.leaving .intro-stamp-title {
  animation: v3-details 3.4s linear forwards;
}
@keyframes v3-details {
  0%,
  78% {
    opacity: 0;
  }
  92%,
  100% {
    opacity: 1;
  }
}
