/* Three chapters share ONE pinned screen. No JavaScript or nested scroll trap. */
html:has(.home-journey) { scroll-snap-type: y proximity; scroll-padding-top: 0; }
#three-realms { position: relative; background: #0b1f23; color: #eee4ce; scroll-margin-top: 0; }
.three-scroll-stop { display: none; }
.realm-panel { position: relative; min-height: 100svh; }
.realm-panel-sticky { position: relative; height: 100svh; min-height: 680px; padding: 108px 7vw 100px; overflow: hidden; isolation: isolate; }
.realm-panel-backdrop { position: absolute; inset: -4%; z-index: -2; background: url('../assets/fullframe/silk-map.webp') center 10% / auto 210% no-repeat; filter: blur(3px) saturate(.5); opacity: .24; }
.realm-panel-life .realm-panel-backdrop { background-position: center 55%; background-size: auto 230%; }
.realm-panel-depth .realm-panel-backdrop { background-position: center 95%; background-size: auto 260%; }
.realm-panel-sticky::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 70% 60%,#45625930,transparent 60%),linear-gradient(90deg,#071b20ed,#10252785),linear-gradient(0deg,#06191c,transparent 60%); }
.realm-panel-life .realm-panel-sticky::before { background: radial-gradient(ellipse at 65% 58%,#86744633,transparent 60%),linear-gradient(90deg,#171f1eeb,#282c2070),linear-gradient(0deg,#111f20,transparent 60%); }
.realm-panel-depth .realm-panel-sticky::before { background: radial-gradient(ellipse at 60% 65%,#315f6830,transparent 60%),linear-gradient(90deg,#051c26ed,#072b3380),linear-gradient(0deg,#051920,transparent 60%); }
.realm-panel-content { position: relative; z-index: 2; width: 45%; max-width: 540px; padding-top: 7svh; }
.three-heading h2, .three-heading-repeat { margin: 0 0 12px; font: 400 1rem/1.5 'Songti SC',serif; letter-spacing: .3em; color: #cfb986; }
.three-subtitle { display: none; }
.three-english { font: 12px/1.6 Arial,sans-serif; letter-spacing: .15em; margin: 0; color: #9ca99b; }
.realm-panel-copy { margin-top: 5svh; }
.three-count { font: 14px/1.5 Arial,sans-serif; color: #c8b38b; letter-spacing: .18em; margin: 0 0 20px; }
.realm-panel-copy h3 { font: 400 clamp(2.8rem,5vw,5rem)/1.2 Painting,'Songti SC',serif; margin: 0 0 22px; letter-spacing: .15em; }
.realm-panel-copy h3 span { display: block; margin-top: 22px; font: 400 clamp(1.1rem,1.6vw,1.5rem)/1.7 'Songti SC',serif; letter-spacing: .08em; color: #e2cc9c; }
.realm-panel-copy > p:last-child { font-size: 16px; line-height: 2; color: #c6c9b9; max-width: 29rem; margin: 0; }
.realm-panel-art { position: absolute; z-index: 1; width: 41vw; height: 46svh; right: 6vw; top: 26%; margin: 0; }
.realm-panel-art::before { content: ''; position: absolute; inset: 6% -12% -16%; background: radial-gradient(ellipse,#ac966824,transparent 70%); }
.three-part { position: absolute; object-fit: contain; max-height: 100%; filter: drop-shadow(0 20px 22px #0007); }
.three-moon { width: 27%; left: 0; top: 2%; }
.three-sun { width: 27%; right: 0; top: 2%; }
.three-deity { width: 63.32%; left: 19.5%; bottom: 4%; }
.three-canopy { width: 60%; height: 38%; left: 20%; top: -8%; }
.three-envoys { width: 35%; left: 1%; bottom: 3%; }
.three-xinzhui { width: 58%; right: 0; bottom: 3%; }
.three-earth { width: 96%; left: 2%; top: 0; }
.three-giant { width: 46%; height: 80%; left: 27%; top: 12%; }
.three-fish { width: 42%; left: 29%; bottom: -9%; max-height: 30%; }
.realm-panel-art figcaption { position: absolute; top: calc(100% + 22px); width: 100%; text-align: center; font-size: 14px; color: #bcb18e; letter-spacing: .12em; }
.three-footer { position: absolute; z-index: 3; left: 7vw; right: 7vw; bottom: 4svh; }
.three-progress { display: flex; gap: 20px; width: min(420px,100%); margin: 0; padding: 0; list-style: none; }
.three-progress li { flex: 1; color: #7e958f; font-size: 14px; letter-spacing: .15em; }
.three-progress i { display: block; height: 2px; margin-top: 13px; background: #c4af8130; overflow: hidden; }
.three-progress i::after { content: ''; display: block; width: 100%; height: 100%; background: #d5b980; transform: scaleX(0); transform-origin: left; }
.three-progress .is-current { color: #f0d59c; }
.three-progress .is-current i::after, .three-progress .is-complete i::after { transform: scaleX(1); }
.three-next { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: #a6b3a4; letter-spacing: .1em; margin-top: 8px; }
.three-next:hover, .three-next:focus-visible { color: #f5dca5; }
@supports (animation-timeline: view()) {
 #three-realms { height: 400svh; view-timeline: --nav-three block, --three-journey block; }
 .three-stage { position: sticky; top: 0; height: 100svh; overflow: clip; isolation: isolate; }
 .three-scroll-stop { display: block; position: absolute; top: 0; width: 1px; height: 1px; pointer-events: none; scroll-snap-align: start; scroll-snap-stop: always; scroll-margin: 0; }
 .three-stop-life { top: 110svh; }
 .three-stop-depth { top: 220svh; }
 .realm-panel { position: absolute; inset: 0; min-height: 0; height: 100%; animation: three-sky-stage linear both; animation-timeline: --three-journey; animation-range: contain 0% contain 100%; }
 .realm-panel-life { animation-name: three-life-stage; }
 .realm-panel-depth { animation-name: three-depth-stage; }
 .realm-panel-sticky { height: 100%; min-height: 0; }
 .realm-panel-sky .is-current i::after { animation: sky-progress linear both; }
 .realm-panel-life .is-current i::after { animation: life-progress linear both; }
 .realm-panel-depth .is-current i::after { animation: depth-progress linear both; }
 .three-progress .is-current i::after { animation-timeline: --three-journey; animation-range: contain 0% contain 100%; }
}
@keyframes three-sky-stage { 0%,29.99% { opacity: 1; visibility: visible; transform: none; } 30%,100% { opacity: 0; visibility: hidden; transform: translateY(-24px); } }
@keyframes three-life-stage { 0%,29.99% { opacity: 0; visibility: hidden; transform: translateY(24px); } 30%,63.32% { opacity: 1; visibility: visible; transform: none; } 63.33%,100% { opacity: 0; visibility: hidden; transform: translateY(-24px); } }
@keyframes three-depth-stage { 0%,63.32% { opacity: 0; visibility: hidden; transform: translateY(24px); } 63.33%,100% { opacity: 1; visibility: visible; transform: none; } }
@keyframes sky-progress { 0% { transform: scaleX(.08); } 30%,100% { transform: scaleX(1); } }
@keyframes life-progress { 0%,30% { transform: scaleX(0); } 63.33%,100% { transform: scaleX(1); } }
@keyframes depth-progress { 0%,63.33% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
@media (max-width: 899px) {
 .realm-panel-sticky { padding: 94px 7vw 100px; }
 .realm-panel-content { width: 100%; max-width: 550px; padding-top: 0; }
 .three-heading h2,.three-heading-repeat { font-size: 14px; margin-bottom: 6px; }
 .three-english { font-size: 10px; }
 .realm-panel-copy { margin-top: 20px; }
 .three-count { margin-bottom: 10px; font-size: 12px; }
 .realm-panel-copy h3 { font-size: 2.65rem; margin-bottom: 12px; }
 .realm-panel-copy h3 span { margin-top: 10px; font-size: 18px; }
 .realm-panel-copy > p:last-child { max-width: 34rem; line-height: 1.8; }
 .realm-panel-art { top: 47%; width: 76vw; max-width: 490px; height: 30svh; left: 50%; right: auto; translate: -50% 0; }
 .realm-panel-art figcaption { font-size: 12px; top: calc(100% + 18px); }
 .three-footer { bottom: 2svh; }
 .three-progress { width: 100%; }
 .three-next { margin-top: 4px; }
}
@media (max-width: 899px) and (max-height: 740px) {
 .realm-panel-sticky { padding-top: 82px; }
 .three-english { display: none; }
 .realm-panel-copy { margin-top: 10px; }
 .three-count { display: none; }
 .realm-panel-copy h3 { font-size: 2.2rem; }
 .realm-panel-copy h3 span { font-size: 16px; margin-top: 6px; }
 .realm-panel-copy > p:last-child { font-size: 14px; line-height: 1.65; }
 .realm-panel-art { top: 48%; height: 26svh; }
 .three-progress li,.three-next { font-size: 12px; }
}
@media (max-height: 520px) and (min-width: 700px) {
 .realm-panel-sticky { padding-top: 80px; }
 .realm-panel-content { width: 48%; }
 .realm-panel-art { left: auto; right: 5vw; top: 24%; translate: none; width: 36vw; height: 42svh; }
 .three-english,.three-count { display: none; }
 .realm-panel-copy { margin-top: 12px; }
 .realm-panel-copy h3 { font-size: 2rem; }
 .realm-panel-copy h3 span { margin-top: 6px; font-size: 16px; }
 .realm-panel-copy > p:last-child { font-size: 14px; }
 .three-footer { right: 54%; bottom: 2svh; }
}
@media (prefers-reduced-motion: reduce) {
 html:has(.home-journey) { scroll-snap-type: none; }
 #three-realms { height: auto; }
 .three-stage { position: relative; height: auto; overflow: visible; }
 .three-scroll-stop { position: static; height: 0; }
 .realm-panel { position: relative; height: auto; min-height: 100svh; animation: none; opacity: 1; visibility: visible; }
 .realm-panel-sticky { height: auto; min-height: 800px; }
 .three-progress .is-current i::after { animation: none; transform: scaleX(1); }
}

/* Each opaque scene occupies the same pinned viewport; cuts have no exposed seam. */
@supports (animation-timeline: view()) {
 .realm-panel { background:#0b1f23; }
 .realm-panel-life { background:#202820; }
 .realm-panel-depth { background:#071c26; }
}
@supports not (animation-timeline: view()) {
 .realm-panel { scroll-snap-align:start; scroll-snap-stop:always; }
 .realm-panel-sticky { min-height:100svh; }
}

.three-progress a { display:inline-flex; align-items:center; min-height:30px; }
.three-progress a:focus-visible { outline:2px solid #e3c78d; outline-offset:3px; }
@supports not (animation-timeline:view()) {
 .three-scroll-stop { display:block; position:absolute; top:0; width:1px; height:1px; }
 .three-stop-life { top:100svh; }
 .three-stop-depth { top:200svh; }
 .realm-panel-sticky { height:100svh; min-height:0; }
}
