/* DOSA motion — slow, ink-and-moonlight. Everything is disabled for prefers-reduced-motion. */

/* ---------- keyframes ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes inkIn { 0% { opacity: 0; filter: blur(10px); transform: scale(1.12); } 60% { opacity: 1; } 100% { opacity: 1; filter: blur(0); transform: none; } }
@keyframes moonBreathe { 0%, 100% { box-shadow: 0 0 70px rgba(201,168,106,0.35); transform: scale(1); } 50% { box-shadow: 0 0 120px rgba(201,168,106,0.6); transform: scale(1.035); } }
@keyframes moonRise { from { opacity: 0; transform: translateY(40px) scale(0.9); } to { opacity: 0.9; transform: none; } }
@keyframes floatSlow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes glowPulse { 0%, 100% { text-shadow: 0 0 0 rgba(233,223,203,0); } 50% { text-shadow: 0 0 28px rgba(201,168,106,0.55); } }
@keyframes sweep { from { transform: translateX(-120%) skewX(-18deg); } to { transform: translateX(220%) skewX(-18deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinBack { to { transform: rotate(-360deg); } }
@keyframes ringPulse { 0%, 100% { opacity: 0.35; transform: scale(0.96); } 50% { opacity: 0.8; transform: scale(1.04); } }
@keyframes shimmerText { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes ripple { from { transform: scale(0.2); opacity: 0.6; } to { transform: scale(2.6); opacity: 0; } }

/* ---------- hero entrance ---------- */
.hero-copy > * { opacity: 0; animation: fadeUp 1.1s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-copy > *:nth-child(1) { animation-delay: .15s; }
.hero-copy > *:nth-child(2) { animation-delay: .35s; }
.hero-copy > *:nth-child(3) { animation-delay: .7s; }
.hero-copy > *:nth-child(4) { animation-delay: .95s; }
.hero-copy > *:nth-child(5) { animation-delay: 1.15s; }
.hero-art { opacity: 0; animation: fadeIn 1.6s ease .4s forwards; }
.hero-art .moon { opacity: 0; animation: moonRise 2.2s cubic-bezier(.2,.7,.2,1) .9s forwards, moonBreathe 7s ease-in-out 3.1s infinite; }
.hero-art::after { content: ''; position: absolute; inset: 14px; pointer-events: none; overflow: hidden;
  background: linear-gradient(100deg, rgba(255,240,200,0) 30%, rgba(255,240,200,0.16) 50%, rgba(255,240,200,0) 70%); transform: translateX(-120%) skewX(-18deg);
  animation: sweep 2.4s ease-in-out 1.8s 1 forwards; }
.hero-art { overflow: visible; }
.dm-float { opacity: 0; animation: fadeUp 1s cubic-bezier(.2,.7,.2,1) 1.6s forwards; }
.wm { animation: floatSlow 14s ease-in-out infinite; }
.vertical { opacity: 0; animation: fadeIn 3s ease 1.2s forwards; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* headline accent shimmer */
.shimmer { background: linear-gradient(90deg, #C9A86A 0%, #C9A86A 40%, #F6E3B4 50%, #C9A86A 60%, #C9A86A 100%); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: shimmerText 6s linear 2s infinite; }

/* ---------- scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.js .ink { opacity: 0; }
.js .ink.in { animation: inkIn 1.2s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--d, 0s); }

/* cloud divider draws itself */
.divider svg path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.divider.in svg path { animation: draw 1.8s ease forwards; }
.divider.in svg path:nth-child(n+3) { animation-delay: .5s; }
.divider.in svg path:nth-child(n+4) { animation-delay: 1.1s; }
.divider span { transform: scaleX(0); transition: transform 1.4s cubic-bezier(.2,.7,.2,1); }
.divider span:first-child { transform-origin: right; } .divider span:last-child { transform-origin: left; }
.divider.in span { transform: scaleX(1); }

/* bars & gauges grow */
.bar-fill { transition: width 1.4s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
#strengthMarker { transition: left 1.6s cubic-bezier(.2,.7,.2,1) .2s; }
#strengthFill { transition: width 1.6s cubic-bezier(.2,.7,.2,1) .2s; }

/* Day Master glyph breathes */
#dmChar { display: inline-block; animation: glowPulse 5s ease-in-out infinite; }

/* hover life */
.card, .card-gold, .card-dark, .pillar { transition: border-color .4s ease, box-shadow .4s ease, transform .4s ease; }
.card:hover, .card-gold:hover { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(201,168,106,0.25), 0 18px 50px rgba(0,0,0,0.45), 0 0 60px rgba(201,168,106,0.08); transform: translateY(-3px); }
.pillar:hover { border-color: rgba(201,168,106,0.6); box-shadow: 0 0 40px rgba(201,168,106,0.12); }
.btn { position: relative; overflow: hidden; transition: background .3s ease, color .3s ease, transform .3s ease, box-shadow .3s ease; }
.btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(255,255,255,0) 30%, rgba(255,245,220,0.28) 50%, rgba(255,255,255,0) 70%); transform: translateX(-120%) skewX(-18deg); }
.btn:hover::after { animation: sweep .9s ease; }
.btn-seal:hover, .btn-gold:hover { box-shadow: 0 0 34px rgba(201,168,106,0.28); transform: translateY(-1px); }
.locked-card { position: relative; overflow: hidden; transition: background .4s ease; }
.locked-card::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, rgba(201,168,106,0) 35%, rgba(201,168,106,0.07) 50%, rgba(201,168,106,0) 65%); transform: translateX(-120%) skewX(-18deg); animation: sweep 5s ease-in-out infinite; animation-delay: var(--d, 0s); }
.locked-card:hover { background: #221E29 !important; }
.locked-card svg { transition: transform .4s ease; } .locked-card:hover svg { transform: rotate(-12deg) scale(1.1); }

/* ---------- casting ritual (reading page) ---------- */
.ritual { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px;
  background: radial-gradient(600px 400px at 50% 45%, rgba(201,168,106,0.12), rgba(201,168,106,0) 70%), #08070B; transition: opacity .9s ease, visibility .9s; cursor: pointer; }
.ritual.done { opacity: 0; visibility: hidden; }
.ritual-wheel { position: relative; width: 240px; height: 240px; }
.ritual-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(201,168,106,0.35); }
.ritual-ring.outer { animation: spin 18s linear infinite; }
.ritual-ring.inner { inset: 38px; border-style: dashed; border-color: rgba(201,168,106,0.25); animation: spinBack 12s linear infinite; }
.ritual-ring .tg { position: absolute; left: 50%; top: 50%; width: 30px; margin: -15px 0 0 -15px; text-align: center; font-size: 22px; color: rgba(201,168,106,0.8); }
.ritual-glow { position: absolute; inset: 70px; border-radius: 50%; background: radial-gradient(circle, rgba(201,168,106,0.35), rgba(201,168,106,0) 70%); animation: ringPulse 2.4s ease-in-out infinite; }
.ritual-ripple { position: absolute; inset: 90px; border-radius: 50%; border: 1px solid rgba(201,168,106,0.6); animation: ripple 2.4s ease-out infinite; }
.ritual-chars { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--hanja); font-size: 30px; color: var(--text); }
.ritual-chars span { opacity: 0; animation: inkIn .9s ease forwards; }
.ritual-text { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--text-2); min-height: 30px; text-align: center; padding: 0 20px; transition: opacity .4s ease; }
.ritual-skip { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-4); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-copy > *, .hero-art, .dm-float, .vertical, .hero-art .moon, .js .reveal, .js .ink { opacity: 1 !important; transform: none !important; filter: none !important; }
  .divider svg path { stroke-dashoffset: 0; } .divider span { transform: none; }
  .hero-canvas { display: none; }
}
