/* ============================================================
   LUNA DAO — v8.3 Cinematic UI
   Hero KV · floating Luopan frame · three-coin ritual
   ============================================================ */

/* Never-flat-black base fallback (also covers reduced-motion) */
body {
  background:
    radial-gradient(1200px 800px at 50% -10%, hsl(262,45%,16%), transparent 60%),
    radial-gradient(1000px 700px at 85% 20%, hsla(205,60%,22%,.35), transparent 60%),
    radial-gradient(900px 900px at 10% 90%, hsla(288,50%,18%,.4), transparent 60%),
    hsl(252, 34%, 7%);
}

/* ---------- HERO cinematic keyvisual ---------- */
.hero { position: relative; min-height: 100svh; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.hero-kv {
  position: absolute; inset: 0; z-index: 0;
  background-image: url('/images/bg/hero-bg.webp'), url('/images/bg/hero-bg.jpg');
  background-size: cover; background-position: center 38%;
  animation: heroDrift 38s ease-in-out infinite alternate;
  opacity: 0; transition: opacity 1.6s ease;
}
body.cinematic .hero-kv { opacity: 1; }
.hero-kv::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 30%, hsla(258,45%,6%,.55) 78%, hsla(258,50%,4%,.92) 100%),
    linear-gradient(180deg, hsla(256,48%,5%,.55) 0%, transparent 30%, transparent 55%, hsla(256,48%,5%,.85) 100%),
    linear-gradient(90deg, hsla(256,50%,4%,.72) 0%, transparent 42%, transparent 100%);
}
@keyframes heroDrift {
  0%   { transform: scale(1.06) translateY(0); }
  100% { transform: scale(1.14) translateY(-1.6%); }
}
.hero-content { position: relative; z-index: 2; max-width: 880px; text-align: center; }
.hero-subtitle { letter-spacing: .42em; text-transform: uppercase; font-size: .8rem; color: var(--gold-light); margin-bottom: 18px; }
.hero-title {
  font-size: clamp(2.7rem, 6.4vw, 5.2rem); line-height: 1.04; font-weight: 600;
  background: linear-gradient(180deg, #fff7e6 0%, var(--gold-light) 45%, hsl(40,72%,58%) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 0 60px hsla(42,85%,62%,.18); margin-bottom: 20px;
}
/* CJK headings are wider; keep them on one elegant line on phones */
:lang(zh) .hero-title, :lang(ja) .hero-title, :lang(ko) .hero-title { letter-spacing: .05em; }
@media (max-width: 600px) {
  .hero-title { font-size: clamp(2.1rem, 9vw, 3rem); }
  :lang(zh) .hero-title, :lang(ja) .hero-title, :lang(ko) .hero-title { font-size: clamp(1.85rem, 8.2vw, 2.5rem); }
}
.hero-desc { font-size: clamp(1.02rem, 1.6vw, 1.22rem); color: hsl(40,18%,86%); max-width: 620px; margin: 0 auto 30px; line-height: 1.7; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn-primary { animation: ctaGlow 3.2s ease-in-out infinite; }
@keyframes ctaGlow {
  0%,100% { box-shadow: 0 0 0 0 hsla(42,90%,62%,.35), 0 10px 30px hsla(42,85%,50%,.25); }
  50%     { box-shadow: 0 0 0 10px hsla(42,90%,62%,0), 0 14px 44px hsla(42,85%,55%,.45); }
}
.hero-trust { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 34px; font-size: .82rem; color: var(--text-dim); }
.hero-social-proof { margin-top: 20px; display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--text-dim); font-size: .9rem; }
.hero-stars { color: var(--gold); letter-spacing: 2px; }
.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2; color: var(--text-muted); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.scroll-arrow { width: 1px; height: 42px; margin: 8px auto 0; background: linear-gradient(var(--gold), transparent); animation: scrollDrop 1.8s ease-in-out infinite; }
@keyframes scrollDrop { 0%{transform:scaleY(0);transform-origin:top} 55%{transform:scaleY(1);transform-origin:top} 56%{transform-origin:bottom} 100%{transform:scaleY(0);transform-origin:bottom} }

/* Cinematic entry */
body.cinematic .hero-content .animate-fade { animation: heroRise 1.1s cubic-bezier(.2,.7,.2,1) both; }
body.cinematic .hero-content .animate-fade:nth-child(1){animation-delay:.15s}
body.cinematic .hero-content .animate-fade:nth-child(2){animation-delay:.32s}
body.cinematic .hero-content .animate-fade:nth-child(3){animation-delay:.5s}
body.cinematic .hero-content .animate-fade:nth-child(4){animation-delay:.68s}
body.cinematic .hero-content .animate-fade:nth-child(5){animation-delay:.84s}
body.cinematic .hero-content .animate-fade:nth-child(6){animation-delay:1s}
@keyframes heroRise { from{opacity:0;transform:translateY(26px);filter:blur(6px)} to{opacity:1;transform:none;filter:blur(0)} }

/* ---------- COMPASS PAGE ---------- */
.compass-page { position: relative; overflow: hidden; }
.compass-bg {
  position: absolute; inset: -8%; z-index: 0; pointer-events: none;
  background: url('/images/bg/luopan-bg.webp'), url('/images/bg/luopan-bg.jpg');
  background-size: cover; background-position: center;
  opacity: .32; filter: saturate(1.05);
  animation: bgBreathe 26s ease-in-out infinite alternate;
}
.compass-bg::after { content:''; position:absolute; inset:0; background: radial-gradient(circle at 50% 42%, hsla(258,50%,6%,.35), hsla(258,52%,4%,.82) 78%); }
@keyframes bgBreathe { 0%{transform:scale(1.04)} 100%{transform:scale(1.12)} }
.compass-page .container.narrow { position: relative; z-index: 2; }
.compass-header h1 { font-size: clamp(2rem,4.4vw,3.2rem); }
.luopan-zh, .h3-zh { color: var(--gold); font-weight: 400; }

/* Floating Luopan frame (ritual centerpiece) */
.luopan-stage { position: relative; width: min(360px, 78vw); height: min(360px, 78vw); margin: 10px auto 8px; }
.luopan-float { position: absolute; inset: 0; animation: luopanFloat 7s ease-in-out infinite; transform-style: preserve-3d; }
@keyframes luopanFloat { 0%,100%{transform:translateY(0) rotateX(4deg)} 50%{transform:translateY(-14px) rotateX(-3deg)} }
.lp-ring { position: absolute; border-radius: 50%; top: 50%; left: 50%; }
.lp-ring.r1 { width:100%; height:100%; transform:translate(-50%,-50%); border:1px solid hsla(42,85%,66%,.4);
  background: conic-gradient(from 0deg, hsla(42,90%,64%,.10), transparent 22%, hsla(205,80%,70%,.08) 48%, transparent 70%, hsla(42,90%,64%,.10));
  box-shadow: 0 0 60px hsla(268,70%,60%,.25) inset, 0 0 50px hsla(42,85%,60%,.18); animation: lpSpin 46s linear infinite; }
.lp-ring.r2 { width:78%; height:78%; transform:translate(-50%,-50%); border:1px dashed hsla(205,80%,74%,.35); animation: lpSpinRev 34s linear infinite; }
.lp-ring.r3 { width:56%; height:56%; transform:translate(-50%,-50%); border:1px solid hsla(42,85%,70%,.5);
  background: radial-gradient(circle, hsla(268,60%,40%,.5), hsla(258,55%,12%,.25) 70%);
  box-shadow: 0 0 40px hsla(42,85%,60%,.25); animation: lpSpin 24s linear infinite; }
.lp-ring.r4 { width:34%; height:34%; transform:translate(-50%,-50%); border:1px solid hsla(42,90%,74%,.6); display:flex;align-items:center;justify-content:center;
  background: radial-gradient(circle at 40% 35%, hsl(270,55%,30%), hsl(258,60%,12%));
  box-shadow: 0 0 34px hsla(42,90%,66%,.4), 0 0 80px hsla(268,70%,60%,.3) inset; }
.lp-taiji { font-size: clamp(2rem,9vw,2.9rem); color: var(--gold-light); text-shadow:0 0 22px hsla(42,90%,66%,.8); animation: lpSpinRev 30s linear infinite; }
.lp-ticks { position:absolute; inset:0; animation: lpSpin 60s linear infinite; }
.lp-ticks i { position:absolute; top:50%; left:50%; width:2px; height:9px; background:hsla(42,90%,72%,.55); transform-origin:50% calc(min(180px,39vw) * -1); }
@keyframes lpSpin { to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes lpSpinRev { from { transform: translate(-50%,-50%) rotate(0);} to { transform: translate(-50%,-50%) rotate(-360deg);} }
.lp-ring.r2 { animation-name: lpSpinRev2; }
@keyframes lpSpinRev2 { from{transform:translate(-50%,-50%) rotate(0)} to{transform:translate(-50%,-50%) rotate(-360deg)} }
.lp-ring.r4 .lp-taiji { animation: none; }
/* casting speed state toggled by JS */
.luopan-stage.is-casting .lp-ring.r1 { animation-duration: 3.2s; }
.luopan-stage.is-casting .lp-ring.r2 { animation-duration: 2.4s; }
.luopan-stage.is-casting .lp-ring.r3 { animation-duration: 1.7s; }
.luopan-stage.is-done .lp-ring { animation-play-state: paused; }

/* Three-coin ritual */
.coin-row { display:flex; gap:26px; justify-content:center; margin:22px 0 6px; }
.oracle-coin {
  width:54px; height:54px; border-radius:50%; position:relative; transform-style:preserve-3d;
  transition: transform .55s cubic-bezier(.3,.8,.3,1);
  filter: drop-shadow(0 6px 14px hsla(42,85%,50%,.35));
}
.oracle-coin .face { position:absolute; inset:0; border-radius:50%; display:flex;align-items:center;justify-content:center;
  font-family:var(--font-serif); font-weight:700; backface-visibility:hidden;
  background: radial-gradient(circle at 38% 32%, #ffe9a8, #d4af5f 46%, #9a7426 100%); color:#4a3408; border:2px solid #f0d488; }
.oracle-coin .face.back { transform: rotateY(180deg); background: radial-gradient(circle at 38% 32%, #e7c878, #b8862f 55%, #7d5a18); }
.oracle-coin.tossing { animation: coinToss .9s cubic-bezier(.3,.8,.3,1); }
@keyframes coinToss {
  0% { transform: translateY(0) rotateY(0); }
  35% { transform: translateY(-46px) rotateY(540deg); }
  70% { transform: translateY(6px) rotateY(900deg); }
  100% { transform: translateY(0) rotateY(1080deg); }
}
/* Hexagram lines build, bottom → top */
.yao-build { display:flex; flex-direction:column-reverse; gap:9px; align-items:center; margin:18px auto 4px; width:min(220px,70vw); }
.yao { height:9px; border-radius:3px; opacity:0; transform:translateY(10px) scaleX(.4); transition:all .5s cubic-bezier(.2,.8,.2,1); }
.yao.yang { width:130px; background:linear-gradient(90deg,transparent,var(--gold-light),transparent); box-shadow:0 0 14px hsla(42,90%,64%,.5); }
.yao.yin { width:130px; background:linear-gradient(90deg,transparent,var(--purple-light),transparent); position:relative; }
.yao.yin::before, .yao.yin::after { content:''; position:absolute; top:0; height:100%; width:42%; background:transparent; }
.yao.yin::before { left:0; }.yao.yin::after { right:0; }
.yao.yin { -webkit-mask: linear-gradient(90deg,#000 0 40%,transparent 40% 60%,#000 60% 100%); mask: linear-gradient(90deg,#000 0 40%,transparent 40% 60%,#000 60% 100%); }
.yao.lit { opacity:1; transform:none; }
.ritual-caption { min-height: 26px; text-align:center; color:var(--gold-light); font-family:var(--font-serif); font-style:italic; font-size:1.08rem; letter-spacing:.04em; }
.ritual-hint { text-align:center; color:var(--text-muted); font-size:.86rem; margin-top:6px; }

/* Glassy cards on the compass page */
.compass-full-widget .compass-step, .compass-widget .compass-step { max-width: 720px; margin: 0 auto; }
.intention-card { position:relative; overflow:hidden; backdrop-filter: blur(8px); }
.intention-card::after { content:''; position:absolute; inset:0; background:linear-gradient(120deg,transparent 30%,hsla(42,90%,70%,.12) 50%,transparent 70%); transform:translateX(-120%); transition:transform .8s; }
.intention-card:hover::after { transform:translateX(120%); }
.hex-card, .deep-paywall, .plan-col, .rpc-card, .rec-card, .next-step { backdrop-filter: blur(10px); }
.deep-paywall { border:1px solid var(--border-gold); box-shadow:0 0 0 1px hsla(42,85%,62%,.08), 0 24px 70px hsla(260,70%,4%,.6); }
.btn-whatsapp { background:linear-gradient(135deg,hsl(140,66%,42%),hsl(140,70%,34%)); }

/* Story section dividers */
.story-veil { position:relative; }
.eyebrow-zh { display:block; font-size:.78rem; letter-spacing:.4em; color:var(--gold); opacity:.8; margin-bottom:8px; }

/* Section content above bg */
section, .compass-section, .mood-section, .products-section { position:relative; z-index:1; }

/* Mobile */
@media (max-width: 640px) {
  .hero-kv { background-position: center 46%; }
  .luopan-stage { width: 268px; height: 268px; }
  .coin-row { gap:16px; } .oracle-coin { width:46px; height:46px; }
  .hero-trust { gap:12px; }
}
/* Reduced motion: keep KV visible, kill loops */
@media (prefers-reduced-motion: reduce) {
  .hero-kv, .compass-bg, .lp-ring, .luopan-float, .hero-cta .btn-primary { animation: none !important; }
  #cosmic-bg { display:block !important; }
}

/* ---------- Homepage immersive compass gateway ---------- */
.luopan-stage.mini { width: min(320px, 72vw); height: min(320px, 72vw); }
.compass-gateway {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 52px; align-items: center;
  background: linear-gradient(160deg, hsla(262,50%,17%,.55), hsla(258,48%,9%,.62));
  border: 1px solid var(--border-gold); border-radius: 28px; padding: 52px 48px;
  box-shadow: 0 30px 90px hsla(260,70%,4%,.55), inset 0 0 60px hsla(42,85%,60%,.05);
  backdrop-filter: blur(12px);
}
.cg-visual { display:flex; align-items:center; justify-content:center; }
.cg-eyebrow { text-align:left !important; margin-bottom:10px; }
.cg-title {
  font-family: var(--font-serif); font-weight:600; line-height:1.1; margin:0 0 16px;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  background: linear-gradient(180deg,#fff7e6,var(--gold-light) 60%,hsl(40,70%,56%));
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}
.cg-desc { color: var(--text-dim); line-height:1.75; font-size:1.04rem; margin:0 0 24px; }
.cg-cta { margin-bottom:14px; }
.cg-free { color:var(--gold-light); font-size:.84rem; margin:0 0 22px; }
.cg-funnel { list-style:none; margin:0; padding:0; display:grid; gap:14px; }
.cg-funnel li { display:flex; align-items:center; gap:14px; color:var(--text); font-size:.96rem; }
.cg-n { flex:none; width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-serif); font-weight:700; color:#241a05;
  background:linear-gradient(135deg,var(--gold-light),var(--gold)); box-shadow:0 0 18px hsla(42,85%,60%,.35); }
@media (max-width: 860px) {
  .compass-gateway { grid-template-columns:1fr; gap:26px; padding:34px 24px; text-align:center; }
  .cg-eyebrow { text-align:center !important; }
  .cg-funnel li { text-align:left; }
  .luopan-stage.mini { width:230px; height:230px; }
}
