/* Quiet details: things you only notice on a second look. */

/* --- 暗纹: caisson-ceiling (藻井) lotus pattern. Nearly invisible at rest;
       a soft pool of light follows the cursor and reveals it. --- */
.fx-pattern {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140' fill='none' stroke='%23d9b35f' stroke-width='0.7'%3E%3Ccircle cx='70' cy='70' r='30'/%3E%3Ccircle cx='70' cy='70' r='9'/%3E%3Cg%3E%3Cellipse cx='70' cy='50' rx='6' ry='11'/%3E%3Cellipse cx='70' cy='90' rx='6' ry='11'/%3E%3Cellipse cx='50' cy='70' rx='11' ry='6'/%3E%3Cellipse cx='90' cy='70' rx='11' ry='6'/%3E%3Cellipse cx='56' cy='56' rx='6' ry='11' transform='rotate(-45 56 56)'/%3E%3Cellipse cx='84' cy='84' rx='6' ry='11' transform='rotate(-45 84 84)'/%3E%3Cellipse cx='84' cy='56' rx='6' ry='11' transform='rotate(45 84 56)'/%3E%3Cellipse cx='56' cy='84' rx='6' ry='11' transform='rotate(45 56 84)'/%3E%3C/g%3E%3Cpath d='M0 26 A26 26 0 0 0 26 0M114 0 A26 26 0 0 0 140 26M140 114 A26 26 0 0 0 114 140M26 140 A26 26 0 0 0 0 114'/%3E%3Cpath d='M70 0v12M70 128v12M0 70h12M128 70h12'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  opacity: 0.028;
}
.fx-pattern.fx-lit {
  opacity: 0.2;
  -webkit-mask-image: radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), #000, transparent 70%);
  mask-image: radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), #000, transparent 70%);
}
main, .site-footer { position: relative; z-index: 1; }

/* --- 科幻: the logo is an eclipse with a satellite in slow orbit --- */
.logo-ring { position: relative; animation: fx-breathe 6s ease-in-out infinite; }
.logo-ring i {
  position: absolute; inset: -5px; border-radius: 50%;
  animation: fx-orbit 14s linear infinite;
}
.logo-ring i::after {
  content: ""; position: absolute; top: 0; right: 12%;
  width: 3px; height: 3px; border-radius: 50%; background: var(--gold-bright);
  box-shadow: 0 0 6px var(--gold-bright);
}
@keyframes fx-orbit { to { transform: rotate(360deg); } }
@keyframes fx-breathe {
  50% { box-shadow: 0 0 16px 2px rgba(243,216,142,0.95), inset 0 0 10px rgba(243,216,142,0.7); }
}

/* --- 自然: drifting sand / gold dust over the hero --- */
.fx-dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.hero-grid { z-index: 2; }

/* --- 人文: a vertical line of verse at the hero edge --- */
.fx-vertical {
  position: absolute; z-index: 2; right: clamp(10px, 2vw, 28px); top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl; font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 12px; letter-spacing: 0.6em; color: var(--gold); opacity: 0.32;
}

/* Chinese numerals as section marks, like a seal */
.fx-num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 12px;
  font-family: "Noto Serif SC", "Songti SC", serif; font-size: 13px; letter-spacing: 0;
  color: #1a1206; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-radius: 3px;
  vertical-align: middle;
}

/* Poster: tilts toward the cursor, with a slow sheen like light across a mural */
.fx-tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out; will-change: transform; }
.fx-sheen { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.fx-sheen::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,240,200,0.16), transparent);
  transform: skewX(-12deg); animation: fx-sheen 9s ease-in-out infinite;
}
@keyframes fx-sheen { 0%, 70% { left: -60%; } 100% { left: 130%; } }

/* --- 科幻: a faint DNA helix drawn beside the story (the thief carries the last genome) --- */
.fx-helix-host { position: relative; overflow: hidden; }
.fx-helix { position: absolute; top: 0; right: clamp(0px, 3vw, 48px); width: 90px; height: 100%; opacity: 0.5; pointer-events: none; }
.fx-helix-host .inner { position: relative; }

/* --- 自然/科幻: constellations behind the roadmap (the star-map puzzle) --- */
.fx-stars-host { position: relative; overflow: hidden; }
.fx-constellation { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--gold); opacity: 0.16; pointer-events: none; }
.fx-constellation circle { animation: fx-twinkle 5s ease-in-out infinite; }
.fx-constellation circle:nth-child(3n) { animation-delay: -1.7s; }
.fx-constellation circle:nth-child(3n+1) { animation-delay: -3.1s; }
@keyframes fx-twinkle { 50% { opacity: 0.25; } }
.fx-stars-host .inner { position: relative; }

/* Roadmap line draws itself in; each node lights in turn */
.roadmap.reveal::before { transform: scaleX(0); transform-origin: left; transition: transform 1.8s ease .3s; }
.roadmap.reveal.in::before { transform: scaleX(1); }
.roadmap.reveal .dot { opacity: 0; transition: opacity .6s ease, box-shadow .6s ease; }
.roadmap.reveal.in .dot { opacity: 1; box-shadow: 0 0 14px rgba(243,216,142,0.6); }
.roadmap.reveal.in li:nth-child(1) .dot { transition-delay: .5s; }
.roadmap.reveal.in li:nth-child(2) .dot { transition-delay: .9s; }
.roadmap.reveal.in li:nth-child(3) .dot { transition-delay: 1.3s; }
.roadmap.reveal.in li:nth-child(4) .dot { transition-delay: 1.7s; }

/* --- 人文: mural-frame corner brackets on the trailer --- */
.fx-corners::before, .fx-corners::after {
  content: ""; position: absolute; width: 34px; height: 34px; pointer-events: none; z-index: 2;
  border: 1px solid var(--gold);
}
.fx-corners::before { top: -9px; left: -9px; border-right: 0; border-bottom: 0; }
.fx-corners::after { bottom: -9px; right: -9px; border-left: 0; border-top: 0; }

/* Service cards: a hairline of light traces the top edge on hover */
.service { position: relative; overflow: hidden; }
.service::before {
  content: ""; position: absolute; top: 0; left: 0; height: 1px; width: 100%;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  transform: translateX(-100%); transition: transform .9s ease;
}
.service:hover::before { transform: translateX(100%); }

@media (max-width: 860px) {
  .fx-vertical, .fx-helix { display: none; }
  .roadmap.reveal::before { transform: scaleY(0); transform-origin: top; }
  .roadmap.reveal.in::before { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-ring, .logo-ring i, .fx-sheen::after, .fx-constellation circle { animation: none; }
  .fx-tilt { transform: none; }
  .roadmap.reveal::before { transform: none; transition: none; }
  .roadmap.reveal .dot { opacity: 1; transition: none; }
}

/* --- Torchlight: the cursor lights up the mural behind the hero, like a lamp in a cave --- */
.hero-bg-lit {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-size: cover; background-position: center;
  filter: saturate(1.1) brightness(1.08);
  opacity: var(--lit, 0); transition: opacity .5s ease;
  -webkit-mask-image: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), #000 0, rgba(0,0,0,0.75) 110px, rgba(0,0,0,0.25) 230px, transparent 340px);
  mask-image: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), #000 0, rgba(0,0,0,0.75) 110px, rgba(0,0,0,0.25) 230px, transparent 340px);
}
/* keep the copy readable when the light passes behind it */
.hero h1, .hero .tagline, .hero-desc, .hero .eyebrow { text-shadow: 0 2px 18px rgba(0,0,0,0.85); }
.hero h1 .gold-text { filter: drop-shadow(0 2px 14px rgba(0,0,0,0.8)); }

/* Larger poster on desktop, still fitting one screen */
@media (min-width: 861px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
  .poster { max-width: min(500px, calc((100svh - 190px) * 0.636)); }
  .hero h1 { font-size: clamp(44px, 6.6vw, 92px); }
}

/* --- One continuous space: the home page is a single descent through the cave.
       No section dividers or per-section panels; one atmosphere runs top to bottom. --- */
main.space { isolation: isolate; }
main.space::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 9% at 78% 14%, rgba(217,179,95,0.10), transparent 70%),
    radial-gradient(70% 11% at 12% 30%, rgba(120,150,190,0.055), transparent 70%),
    radial-gradient(75% 12% at 60% 46%, rgba(217,179,95,0.085), transparent 70%),
    radial-gradient(70% 11% at 22% 63%, rgba(120,150,190,0.05), transparent 70%),
    radial-gradient(70% 10% at 80% 79%, rgba(217,179,95,0.07), transparent 70%),
    radial-gradient(80% 10% at 50% 100%, rgba(217,179,95,0.14), transparent 72%);
}
/* fine grain so the dark reads as a surface, not flat black */
main.space::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay;
  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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main.space .trailer, main.space .contact-band { background: none; }
main.space .section { padding-block: clamp(56px, 8vw, 104px); }

/* the hero mural dissolves downward instead of ending at an edge */
main.space .hero { overflow: visible; }
main.space .hero-bg, main.space .hero-bg-lit { bottom: -22vh; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }
main.space .hero-bg-lit {
  -webkit-mask-image: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), #000 0, rgba(0,0,0,0.75) 110px, rgba(0,0,0,0.25) 230px, transparent 340px), linear-gradient(180deg, #000 55%, transparent 100%);
  mask-image: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), #000 0, rgba(0,0,0,0.75) 110px, rgba(0,0,0,0.25) 230px, transparent 340px), linear-gradient(180deg, #000 55%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
main.space .hero::after {
  bottom: -22vh;
  background:
    radial-gradient(ellipse at 72% 40%, rgba(217,179,95,0.16), transparent 55%),
    linear-gradient(90deg, rgba(5,5,5,0.92) 8%, rgba(5,5,5,0.5) 55%, rgba(5,5,5,0.8));
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}
main.space .fx-dust { height: calc(100% + 22vh); -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent 100%); mask-image: linear-gradient(180deg, #000 60%, transparent 100%); }

/* decorative layers fade in and out rather than being clipped at section edges */
main.space .fx-helix-host, main.space .fx-stars-host { overflow: visible; }
main.space .fx-helix, main.space .fx-constellation {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
}
main.space .fx-constellation { top: -12%; height: 124%; }
