/* Kunshan ritual artwork and a centered modal with a separate ivory stage. */
.ks-ritual{--ks-top:101px;position:fixed;inset:var(--ks-top) 0 0;margin:0;padding:0;width:100vw;max-width:none;height:calc(100svh - var(--ks-top));max-height:none;border:0;border-radius:0;color:#213b36;background:transparent;overflow:auto}
.ks-ritual::backdrop{background:transparent}
.ks-ritual[open]{animation:ks-enter 820ms cubic-bezier(.22,1,.36,1) both}
.ks-shell{position:relative;isolation:isolate;min-height:100%;height:100%;background:#fcfcf5;overflow:hidden}
.ks-atmosphere{position:absolute;inset:0 0 0 29%;z-index:-1;overflow:hidden}
.ks-atmosphere>img{width:100%;height:100%;object-fit:cover;object-position:50% 35%}
.ks-atmosphere::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#fcfcf5 0%,#fcfcf5c9 6%,transparent 24%),linear-gradient(0deg,#fcfcf5d9,transparent 24%)}
.ks-hall-light{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 35%,#ffe6a017,transparent 55%);animation:ks-hall-breathe 8s ease-in-out infinite}
.ks-close{position:absolute;right:22px;top:18px;width:44px;height:44px;padding:0;display:grid;place-items:center;border:1px solid #ae8d4a61;background:#fcfcf5ed;border-radius:50%;z-index:5;line-height:1}
.ks-close>svg{display:block;width:24px;height:24px;stroke-width:2}
.ks-sidebar{position:absolute;left:4%;top:6%;width:29%;max-width:390px}
.ks-eyebrow,.ks-kicker{font-size:10px;letter-spacing:.12em;color:#937444}
.ks-sidebar h2{font-family:SceneSerif,serif;font-size:clamp(25px,2.8vw,40px);line-height:1.35;letter-spacing:.03em;margin:12px 0}
.ks-intro{white-space:pre-line;font-size:12px;line-height:1.9;color:#677366;margin:0 0 22px}
.ks-steps{display:flex;list-style:none;margin:0;padding:0;gap:16px;border-top:1px solid #b7934c44;padding-top:18px}
.ks-steps li{display:flex;gap:9px;align-items:center;opacity:.48}
.ks-steps li.current,.ks-steps li.complete{opacity:1}
.ks-steps b{font-weight:400;font-family:SceneSerif,serif;font-size:22px;color:#9b7a40}
.ks-steps strong{font-size:14px;font-weight:500;display:block}.ks-steps small{display:none}
.ks-steps .current strong{color:#b43a34}.ks-steps .complete b{color:#15675f}
.ks-source{position:fixed;left:4%;bottom:18px;width:29%;max-width:390px;font-size:10px;color:#69736a;z-index:4;background:#fcfcf5f0;border-radius:6px;padding:8px 0}
.ks-source summary{cursor:pointer}.ks-source p{line-height:1.8}.ks-source a{display:inline-block;margin-right:14px;text-decoration:underline;color:#15675f;min-height:28px}
.ks-content{display:contents}
#ks-copy{position:absolute;left:4%;top:40%;width:28%;max-width:380px}
#ks-copy h3{font-family:SceneSerif,serif;font-size:clamp(22px,2.1vw,32px);line-height:1.4;font-weight:500;margin:12px 0}
#ks-copy h3:focus{outline:none}#ks-copy p{font-size:13px;line-height:1.85;color:#627062;margin:12px 0}
#ks-object{position:absolute;left:40%;right:7%;top:54%;bottom:8%;display:flex;align-items:center;justify-content:center;flex-direction:column}
#ks-actions{position:absolute;left:4%;width:28%;max-width:390px;bottom:16%}
.ks-primary{display:flex;align-items:center;justify-content:center;text-align:center;gap:0;min-height:50px;width:100%;padding:12px 20px;background:#a83b32;color:#fff8e6;border:1px solid #a83b32;border-radius:3px;font-size:16px;transition:background .2s,opacity .2s}
.ks-primary:hover{background:#8c302a}.ks-primary:disabled{opacity:.5;cursor:default}
.ks-small{font-size:10px;line-height:1.65;color:#72786a;margin:10px 0}.ks-text{display:block;font-size:12px;min-height:36px;text-decoration:underline;margin:8px auto 0;color:#15675f}
.ks-status{position:absolute;left:4%;bottom:9%;width:28%;max-width:390px;font-size:12px;line-height:1.7;color:#765b31;min-height:22px;margin:0}
.ks-art-note{position:absolute;right:20px;bottom:12px;margin:0;font-size:9px;color:#68756c;background:#fcfcf5bf;padding:4px 7px}
.ks-lot{width:clamp(170px,21vw,310px);position:relative;filter:drop-shadow(0 14px 15px #4a2f2533);transform-origin:50% 80%}
.ks-lot img{display:block;width:100%;height:auto}.ks-lot.shaking{animation:ks-shake .32s ease-in-out 7}
.ks-fallen{position:absolute;left:60%;top:10%;width:18px;height:150px;border:1px solid #986127;border-radius:4px;background:linear-gradient(90deg,#aa6d28,#f7d28b 38%,#e0ad5c 75%,#a37537);transform:rotate(24deg);opacity:0;box-shadow:4px 9px 12px #45332030}
.ks-fallen span{display:block;padding-top:18px;text-align:center;color:#84322b;font:14px SceneSerif}.ks-fallen.falling{animation:ks-drop .55s cubic-bezier(.25,.7,.4,1) 2.1s forwards}
.ks-cups{display:flex;align-items:center;justify-content:center;gap:35px;width:100%;height:130px;perspective:600px}
.ks-cup{position:relative;width:150px;height:70px;border-radius:80% 8% 80% 8%;transform:rotate(-18deg);background:linear-gradient(165deg,#e06553 5%,#bb3226 38%,#8c251e 90%);border:1px solid #883329;box-shadow:inset 0 0 0 4px #e38b652c,0 9px 0 #791e18,0 18px 16px #59362733}
.ks-cup:nth-child(2){transform:rotate(24deg)}.ks-cup.convex{background:radial-gradient(ellipse at 48% 30%,#f08165 0%,#c74632 25%,#8a211b 75%);box-shadow:inset 0 4px 12px #f9ba8070,0 8px 0 #7e291e,0 18px 16px #59362733}
.ks-cup::after{content:"";position:absolute;inset:10px;border-radius:inherit;border:1px solid #f6b18666}.ks-cup span{position:absolute;top:90px;left:0;right:0;font-size:10px;text-align:center;color:#554636;transform:rotate(18deg);white-space:nowrap}.ks-cup:nth-child(2) span{transform:rotate(-24deg)}
.ks-cups.tossing .ks-cup{animation:ks-toss 1.1s cubic-bezier(.2,.6,.3,1)}.ks-cups.tossing .ks-cup:nth-child(2){animation-delay:80ms}.ks-cups.tossing span{visibility:hidden}
.ks-confirmations{display:flex;gap:12px;margin-top:28px}.ks-confirmations i{font-style:normal;display:grid;place-items:center;border:1px solid #b7934c88;border-radius:50%;width:34px;height:34px;color:#9a783e;background:#fff9e6b3}.ks-confirmations i.confirmed{background:#15675f;color:#fffbe9;box-shadow:0 0 18px #d7bb6850}
.ks-ritual[data-phase=reveal] #ks-object{top:14%;bottom:12%}.ks-reveal{position:relative;width:320px;max-width:85%;padding:24px 18px;isolation:isolate}
.ks-golden-rays{position:absolute;z-index:-1;inset:-100px;background:repeating-conic-gradient(from 8deg,#ffe29800 0deg,#ffe9a3a8 3deg,#ffe5a500 8deg,#ffe6a500 17deg);mask-image:radial-gradient(circle,#000 20%,#0007 50%,transparent 70%);animation:ks-rays 3s ease-out both}
.ks-sparks{position:absolute;inset:-40px;pointer-events:none}.ks-sparks i{position:absolute;left:calc(5% + mod(var(--i),4) * 28%);top:calc(3% + var(--i) * 6%);color:#fff1a1;text-shadow:0 0 10px #d4942d,0 0 24px #ffdc75;font-style:normal;font-size:20px;animation:ks-spark 2.2s ease-in-out calc(var(--i) * -.19s) 2}
.ks-poem-card{position:relative;padding:30px 22px 24px;text-align:center;background:linear-gradient(135deg,#fff9e5,#f2e5be);border:1px solid #ac8247;box-shadow:0 15px 50px #4e2d2054,0 0 30px #ffe6a276;animation:ks-card-in 1s cubic-bezier(.16,1,.3,1) both}
.ks-poem-card::before{content:"";position:absolute;inset:7px;border:1px solid #bd965d80;pointer-events:none}.ks-poem-card small{color:#967444;font-size:11px;letter-spacing:.15em}.ks-poem{font-family:SceneSerif,serif;font-size:23px;line-height:1.95;margin:20px 0;color:#604b2f}.ks-poem span{display:block}.ks-seal{font:14px SceneSerif;display:inline-block;padding:5px;border:1px solid #b43a34;color:#b43a34;transform:rotate(-5deg)}
.ks-worship-words{font:16px/1.9 SceneSerif,serif;color:#75643e;margin:0 0 18px}
.ks-ritual[data-phase=wish] #ks-object{top:13%;bottom:12%;background:#fcfcf5ed;box-shadow:0 10px 45px #3b261b20;padding:25px;align-items:stretch;border:1px solid #b7934c50;max-width:640px}
.ks-themes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.ks-themes button{padding:0 0 10px;border:1px solid #b7934c55;background:#fbf5e7;min-width:0;border-radius:3px;overflow:hidden}
.ks-portrait{display:block;width:100%;background-image:url('assets/kunshan-deities-v2.webp');background-size:300% auto;background-position:calc(var(--portrait) * 50%) 0%}
.ks-themes .ks-portrait{height:clamp(100px,15vh,170px)}.ks-themes strong{display:block;font-size:15px;margin:8px 0 2px}.ks-themes small{font-size:10px;color:#7f755e}
.ks-themes button[aria-pressed=true]{border:2px solid #15675f;background:#edf0de;box-shadow:0 0 0 3px #15675f15}.ks-themes button[aria-pressed=true] strong::after{content:" ✓"}
.ks-wish-label{font-size:13px;margin:10px 0}#ks-wish{width:100%;min-height:72px;max-height:100px;resize:vertical;border:1px solid #b7934c66;padding:12px;color:#213b36;background:#fffdf7;font:13px/1.7 SceneSans,sans-serif;border-radius:3px}
.ks-incense{width:300px;height:270px;position:relative;filter:drop-shadow(0 16px 13px #3a25162b)}
.ks-censer{position:absolute;bottom:24px;left:60px;width:180px;height:95px;border-radius:20% 20% 45% 45%;background:linear-gradient(90deg,#564c31,#b69652 23%,#e2c883 45%,#927842 80%,#524832);border:1px solid #76613e;box-shadow:inset 0 -18px 25px #3f382b55}
.ks-censer::before,.ks-censer::after{content:"";position:absolute;top:6px;width:25px;height:50px;border:8px solid #8d7441;border-radius:50%;z-index:-1}.ks-censer::before{left:-23px}.ks-censer::after{right:-23px}
.ks-censer-rim{position:absolute;left:-6px;right:-6px;top:-7px;height:18px;border:4px solid #aa8d50;border-radius:50%;background:radial-gradient(ellipse,#d8ccb0,#665539);box-shadow:0 3px 0 #dfc681}
.ks-censer-mark{position:absolute;top:27px;left:75px;color:#64532f;font:24px SceneSerif;border:1px solid #80663780;border-radius:50%;width:30px;height:30px;text-align:center}.ks-censer i{position:absolute;bottom:-16px;height:23px;width:12px;background:linear-gradient(90deg,#68573a,#c0a469);border-radius:0 0 6px 6px;left:25px}.ks-censer i:nth-last-child(2){left:85px}.ks-censer i:last-child{left:143px}
.ks-stick{position:absolute;bottom:115px;left:calc(100px + var(--stick) * 47px);width:4px;height:155px;z-index:1}
.ks-shaft{position:absolute;bottom:0;width:4px;height:calc(155px - var(--burn) * 133px);background:linear-gradient(90deg,#73502d,#c99554 50%,#9d6c3c);transition:height 90ms linear;border-radius:2px}
.ks-ash{position:absolute;top:0;width:4px;height:calc(var(--burn) * 133px);background:linear-gradient(90deg,#8b877b,#cec5b0,#79766c);opacity:.7}
.ks-ember{position:absolute;bottom:calc(155px - var(--burn) * 133px);width:6px;height:6px;left:-1px;background:#ffd397;border-radius:50%;box-shadow:0 0 8px 3px #ff7438;opacity:0}
.ks-flame{position:absolute;bottom:155px;left:-4px;width:12px;height:24px;border-radius:80% 20% 70% 30%;background:radial-gradient(ellipse at 50% 70%,#fff4b4,#ffc265 48%,#ee692700 78%);opacity:0;transform-origin:bottom;}
.burning .ks-flame{animation:ks-ignite 1.1s ease-out calc(var(--stick) * .32s) both}.burning .ks-ember{opacity:1}.ks-smoke{position:absolute;left:-10px;bottom:calc(158px - var(--burn) * 133px);height:130px;width:25px;border:2px solid #eeebde99;border-bottom:0;border-top:0;border-radius:60% 40% 60% 40%;filter:blur(2px);opacity:0;transform-origin:bottom}
.burning .ks-smoke{animation:ks-smoke 2.2s ease-in-out calc(var(--stick) * -.65s) infinite}.burned .ks-ash{animation:ks-ash-settle 1s forwards}.burned .ks-smoke{animation:ks-smoke-away 1.5s ease-out both}
.ks-ritual[data-phase=result] #ks-object{top:9%;bottom:12%;background:#fcfcf5f0;padding:25px;align-items:stretch;justify-content:flex-start;overflow:auto;border:1px solid #b7934c66;max-width:750px}
.ks-reading{display:grid;grid-template-columns:1fr 1fr;gap:25px}.ks-reading small{font-size:10px;color:#987c4c}.ks-reading .ks-poem{font-size:18px;line-height:2;margin:10px 0}.ks-reading h4{font:20px SceneSerif;margin:0 0 12px}.ks-reading p{font-size:13px;line-height:1.85;margin:0 0 12px}
.ks-desktop-preview{display:grid;grid-template-columns:35% 1fr;min-height:160px;margin-top:18px;background:#f2ead5;border:1px solid #b7934c66;overflow:hidden}.ks-desktop-preview>.ks-portrait{height:100%;min-height:160px}.ks-desktop-preview>div{display:flex;flex-direction:column;justify-content:center;padding:20px;gap:12px}.ks-desktop-preview small{font-size:11px;color:#967447}.ks-desktop-preview strong{font:22px/1.5 SceneSerif}.ks-desktop-preview div>span{font-size:10px;color:#75816d}
html[lang=en] #ks-copy h3{font-size:25px}html[lang=en] .ks-poem{font-size:17px;line-height:1.8}html[lang=en] .ks-reading .ks-poem{font-size:14px}html[lang=en] .ks-sidebar h2{font-size:30px}
@keyframes ks-enter{from{opacity:0;filter:blur(3px)}to{opacity:1;filter:blur(0)}}
@keyframes ks-hall-breathe{50%{opacity:.4}}
@keyframes ks-shake{0%,100%{transform:rotate(0)}25%{transform:rotate(-9deg) translateX(-7px)}75%{transform:rotate(9deg) translateX(7px)}}
@keyframes ks-drop{0%{opacity:0;transform:translate(-75px,-10px) rotate(-12deg)}10%{opacity:1}70%{transform:translate(0,34px) rotate(20deg)}85%{transform:translate(0,14px) rotate(32deg)}100%{opacity:1;transform:translate(0,23px) rotate(24deg)}}
@keyframes ks-toss{0%{translate:0 0;rotate:0}35%{translate:0 -150px;rotate:230deg}70%{translate:0 5px;rotate:360deg}84%{translate:0 -24px;rotate:345deg}100%{translate:0 0;rotate:360deg}}
@keyframes ks-rays{0%{opacity:0;transform:scale(.2) rotate(-10deg)}30%{opacity:1}100%{opacity:.8;transform:scale(1.15) rotate(10deg)}}
@keyframes ks-spark{0%,100%{opacity:.15;scale:.4}45%{opacity:1;scale:1.2}}
@keyframes ks-card-in{from{opacity:0;transform:translateY(20px) scale(.9)}to{opacity:1;transform:none}}
@keyframes ks-ignite{0%{opacity:0;scale:.1}30%{opacity:1;scale:1}75%{opacity:1;scale:.7}100%{opacity:0;scale:.3}}
@keyframes ks-smoke{0%{opacity:0;transform:translateY(15px) scaleX(.6) rotate(-7deg)}30%{opacity:.65}100%{opacity:0;transform:translateY(-45px) scaleX(1.6) rotate(12deg)}}
@keyframes ks-smoke-away{from{opacity:.6}to{opacity:0;transform:translateY(-60px)}}
@keyframes ks-ash-settle{to{opacity:0;transform:translateY(25px)}}
@media(max-width:1050px) and (min-width:761px){.ks-sidebar{left:3%;width:31%}.ks-steps{gap:10px}.ks-steps strong{font-size:12px}#ks-copy,#ks-actions,.ks-status{left:3%;width:31%}#ks-object{left:39%;right:5%}.ks-intro{margin-bottom:15px}.ks-source{left:3%;width:31%}.ks-ritual[data-phase=wish] #ks-object,.ks-ritual[data-phase=result] #ks-object{padding:18px}.ks-reading{gap:15px}.ks-reading .ks-poem{font-size:16px}}
@media(min-width:761px) and (max-height:760px){.ks-sidebar{top:4%}.ks-sidebar h2{font-size:28px}.ks-intro{margin-bottom:12px}#ks-copy{top:38%}#ks-copy h3{font-size:24px}#ks-actions{bottom:15%}.ks-status{bottom:8%}.ks-source{bottom:4px}.ks-lot{width:220px}.ks-ritual[data-phase=wish] #ks-object{top:8%;bottom:10%}.ks-themes .ks-portrait{height:100px}.ks-small{margin:7px 0}.ks-incense{scale:.88}.ks-reading p{font-size:12px}.ks-desktop-preview{min-height:115px}.ks-desktop-preview>.ks-portrait{min-height:115px}}
@media(max-width:760px){
 .ks-shell{display:flex;flex-direction:column;height:auto;min-height:100%;padding:24px 20px 48px;overflow:hidden}
 .ks-atmosphere{inset:0;height:420px;opacity:.84}.ks-atmosphere>img{object-position:50% 35%}.ks-atmosphere::after{background:linear-gradient(0deg,#fcfcf5,transparent 60%),linear-gradient(90deg,#fcfcf570,transparent)}
 .ks-close{right:12px;top:12px}.ks-sidebar{position:relative;left:auto;top:auto;width:100%;max-width:none;margin-bottom:8px;padding-right:28px}.ks-sidebar h2{font-size:27px;margin:10px 0}.ks-eyebrow{font-size:9px;background:#fcfcf5ce;width:fit-content;padding:4px}.ks-intro{display:none}.ks-steps{width:100%;max-width:350px;justify-content:space-between;border:0;padding:10px;background:#fcfcf5e6;border-radius:4px}.ks-steps strong{font-size:12px}.ks-steps b{font-size:18px}.ks-source{position:relative;left:auto;bottom:auto;width:100%;max-width:none;order:5;margin-top:16px;background:transparent}.ks-sidebar .ks-source{display:none}
 .ks-content{display:flex;flex-direction:column;position:relative;z-index:1}#ks-copy{position:static;width:100%;max-width:none;margin-top:165px;background:#fcfcf5d9;padding:10px 0}#ks-copy h3{font-size:25px;margin:8px 0}#ks-copy p{font-size:12px;margin:8px 0}
 #ks-object{position:relative;inset:auto!important;width:100%;max-width:none!important;min-height:220px;padding:10px 0;margin:0!important}.ks-lot{width:235px}.ks-fallen{top:15%}.ks-cups{height:130px;gap:22px}.ks-cup{width:120px;height:58px}.ks-confirmations{margin-top:22px}.ks-ritual[data-phase=cups] #ks-object{min-height:230px}
 #ks-actions{position:static;width:100%;max-width:none;margin-top:10px}.ks-primary{font-size:15px}.ks-status{position:static;width:100%;max-width:none;margin:12px 0 10px}.ks-art-note{position:relative;inset:auto;align-self:center;margin-top:12px;background:transparent}
 .ks-ritual[data-phase=reveal] #ks-object{padding:20px 0;min-height:350px}.ks-reveal{width:300px;max-width:100%}.ks-poem{font-size:22px}.ks-golden-rays{inset:-60px}.ks-worship-words{font-size:16px}
 .ks-ritual[data-phase=wish] #ks-object,.ks-ritual[data-phase=result] #ks-object{padding:16px;background:#fcfcf5f5;border:1px solid #b7934c50;box-shadow:none}.ks-themes{gap:7px}.ks-themes .ks-portrait{height:130px}.ks-themes strong{font-size:14px}.ks-themes small{font-size:10px}.ks-wish-label{font-size:12px}#ks-wish{max-height:160px}.ks-small{font-size:10px}
 .ks-incense{margin-top:25px}.ks-reading{display:block}.ks-reading .ks-poem{font-size:20px;text-align:center}.ks-reading h4{margin-top:20px}.ks-reading p{font-size:13px}.ks-desktop-preview{grid-template-columns:35% 1fr;min-height:150px}.ks-desktop-preview>div{padding:12px}.ks-desktop-preview strong{font-size:19px}
 html[lang=en] .ks-sidebar h2{font-size:24px}html[lang=en] #ks-copy h3{font-size:23px}html[lang=en] .ks-reading .ks-poem{font-size:15px}
}
@media(prefers-reduced-motion:reduce){.ks-ritual[open],.ks-hall-light,.ks-lot.shaking,.ks-cups.tossing .ks-cup,.ks-golden-rays,.ks-sparks i,.ks-poem-card,.ks-smoke,.ks-flame,.burned .ks-ash{animation:none!important}.ks-fallen.falling{animation:ks-drop .01s 2.1s forwards}.burning .ks-smoke{opacity:.4}.burned .ks-smoke,.burned .ks-ash{opacity:0}.ks-shaft{transition:none}}
/* A large modal, with a shrine layer above and a distinct ivory ritual stage below. */
.ks-ritual{inset:0;margin:auto;width:min(1280px,94vw);height:min(850px,90svh);max-height:90svh;background:#fcfcf5;border:1px solid #bd985c66;border-radius:8px;box-shadow:0 25px 100px #203b3640}
.ks-ritual::backdrop{background:#20342e48;backdrop-filter:blur(5px)}
.ks-atmosphere{inset:0 0 auto 35%;height:65%}
.ks-atmosphere>img{object-fit:cover;object-position:center 48%}
.ks-atmosphere::after{background:linear-gradient(90deg,#fcfcf5 0%,#fcfcf5cc 5%,#fcfcf500 22%),linear-gradient(0deg,#fcfcf5 0%,#fcfcf5d9 8%,#fcfcf500 23%)}
.ks-shell::after{content:"";position:absolute;left:38%;right:3%;top:64%;height:1px;background:linear-gradient(90deg,transparent,#b7934c55 25%,#b7934c55 75%,transparent);z-index:-1}
.ks-sidebar{left:4%;width:29%;top:5%;height:91%}.ks-sidebar h2{font-size:32px}.ks-intro{font-size:12px;margin-bottom:20px}
.ks-steps{flex-direction:column;gap:13px;padding-top:17px}.ks-steps b{display:grid;place-items:center;width:30px;height:30px;font-size:22px}.ks-steps small{display:block;font-size:10px;color:#7a7f70;margin-top:3px}.ks-steps strong{font-size:14px}.ks-source{position:absolute;left:0;bottom:0;width:100%;max-width:none;padding-bottom:0}
#ks-copy{top:48%;width:28%}#ks-copy h3{font-size:27px}#ks-copy p{font-size:12px}
#ks-object{left:38%;right:3%;top:65%;bottom:3%;background:#fcfcf5}
#ks-actions{bottom:16%;width:28%}.ks-status{bottom:9%;width:28%;font-size:11px}
.ks-lot{width:400px;height:100%;max-width:96%;filter:drop-shadow(0 8px 8px #796b3b18);display:flex;align-items:flex-end;justify-content:center;transform-origin:50% 90%}.ks-lot img{width:100%;height:100%;object-fit:contain}
.ks-fallen{left:59%;top:5%;height:160px;width:35px;border:0;background:none;box-shadow:none;border-radius:0}.ks-fallen img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.ks-fallen span{position:absolute;inset:56% 0 auto;text-align:center;padding:0;font:12px SceneSerif;color:#803128}
.ks-cups{height:92px}.ks-cup span{top:82px}.ks-confirmations{margin-top:20px}
.ks-ritual[data-phase=reveal] #ks-object{top:21%;bottom:7%;background:transparent}.ks-ritual[data-phase=reveal] .ks-reveal{width:310px}.ks-ritual[data-phase=reveal] .ks-golden-rays{inset:-80px}
.ks-ritual[data-phase=wish] #ks-object{top:16%;bottom:8%;background:#fcfcf5f5;padding:24px;box-shadow:0 8px 40px #4b342a20}
.ks-ritual[data-phase=result] #ks-object{top:15%;bottom:8%;background:#fcfcf5f5;padding:24px}.ks-incense{height:270px;scale:.82;transform-origin:bottom center}.ks-art-note{font-size:9px;right:12px;bottom:8px;pointer-events:none}
html[lang=en] .ks-sidebar h2{font-size:27px}html[lang=en] #ks-copy h3{font-size:23px}
@media(min-width:761px) and (max-height:780px){.ks-ritual{height:92svh;max-height:92svh}.ks-sidebar{top:4%}.ks-sidebar h2{font-size:27px;margin:10px 0}.ks-intro{display:none}.ks-steps{gap:10px;margin-top:14px}.ks-steps small{font-size:9px}#ks-copy{top:43%}#ks-copy h3{font-size:23px}.ks-small{font-size:9px}#ks-actions{bottom:15%}.ks-status{bottom:8%}.ks-lot{width:350px}.ks-incense{scale:.68}.ks-ritual[data-phase=wish] #ks-object{padding:16px}.ks-themes .ks-portrait{height:100px}}
@media(max-width:760px){
 .ks-ritual{width:calc(100vw - 20px);height:92svh;max-height:92svh;border-radius:8px}
 .ks-shell{padding:20px 16px 32px}.ks-shell::after{display:none}.ks-sidebar{height:auto;position:relative;inset:auto;width:100%;padding-right:18px}.ks-sidebar h2{font-size:25px}.ks-atmosphere{inset:0;height:410px}.ks-atmosphere>img{object-fit:cover;object-position:center 35%}.ks-atmosphere::after{background:linear-gradient(0deg,#fcfcf5 0%,#fcfcf5ee 8%,transparent 35%),linear-gradient(90deg,#fcfcf580,transparent 50%)}
 .ks-steps{flex-direction:row;padding:8px;gap:8px;margin-top:14px;background:#fcfcf5ed}.ks-steps b{font-size:17px;width:20px;height:26px}.ks-steps strong{font-size:12px}.ks-steps small{display:none}.ks-source{display:none}
 #ks-copy{margin-top:165px;width:100%;padding-top:14px;position:static}#ks-copy h3{font-size:24px}
 #ks-object{position:relative;inset:auto;background:#fcfcf5!important;width:100%;min-height:245px;height:245px;border-top:1px solid #b7934c44;padding:8px 0;margin-top:4px!important}
 .ks-lot{width:100%;height:100%;max-width:100%}.ks-fallen{top:0;left:60%;height:145px;width:32px}.ks-cups{height:100px}.ks-confirmations{margin-top:24px}
 #ks-actions{position:static;width:100%;margin-top:14px}.ks-status{position:static;width:100%;font-size:11px;margin:12px 0 6px}.ks-art-note{position:static;align-self:center;margin:14px 0 0}
 .ks-ritual[data-phase=reveal] #ks-object{height:auto;min-height:350px;padding:18px 0;background:#fcfcf5!important}.ks-ritual[data-phase=wish] #ks-object,.ks-ritual[data-phase=result] #ks-object{height:auto;min-height:0;padding:16px;border:1px solid #b7934c55;background:#fcfcf5!important;overflow:visible}.ks-ritual[data-phase=wish] .ks-themes .ks-portrait{height:130px}.ks-incense{scale:.85;height:270px}
}
/* Sleeves dissolve into the ivory stage while the grip stays crisp. */
.ks-lot{isolation:isolate}
.ks-lot img{mask-image:linear-gradient(to top,transparent 0%,#0009 9%,#000 24%),linear-gradient(to right,transparent 0%,#000 11%,#000 89%,transparent 100%);mask-composite:intersect}
.ks-lot::before{content:"";position:absolute;inset:0;z-index:-1;background:url('assets/kunshan-lot-hands-v2.webp') center / contain no-repeat;filter:blur(3px);opacity:.45;mask-image:linear-gradient(to top,transparent 1%,#000 12%,transparent 31%)}
.ks-source[open]{padding:12px;background:#fcfcf5;border:1px solid #b7934c66;box-shadow:0 -8px 25px #213b3615;max-height:180px;overflow:auto}
.ks-golden-rays{background:repeating-conic-gradient(from 8deg,#e4ac3700 0deg,#f5ce688c 3deg,#e4ac3700 9deg,#e4ac3700 17deg);filter:drop-shadow(0 0 12px #ffe49c)}

/* The fallen bamboo lot is deliberately larger, with no number on its surface. */
.ks-fallen{left:68%;top:1%;width:70px;height:210px}.ks-fallen img{left:50%;width:auto;max-width:none;height:100%;transform:translateX(-50%)}
@media(max-width:760px){.ks-fallen{left:68%;top:0;width:60px;height:195px}}

@media(max-width:760px){.ks-ritual{overflow-x:hidden}.ks-shell{width:100%;overflow:hidden}.ks-sidebar{background:#fcfcf5}.ks-atmosphere{top:125px;height:300px}.ks-atmosphere::after{background:linear-gradient(0deg,#fcfcf5,transparent 32%)}#ks-copy{margin-top:235px}.ks-eyebrow{background:transparent}}
/* Nine compact cultural themes and a matching lacquered censer. */
.ks-ritual[data-phase=wish] #ks-object{display:block;overflow:auto}
.ks-ritual[data-phase=wish] .ks-themes{gap:9px}
.ks-ritual[data-phase=wish] .ks-themes button{padding-bottom:7px}
.ks-ritual[data-phase=wish] .ks-themes .ks-portrait{height:82px;background-size:300% auto}
.ks-ritual[data-phase=wish] .ks-themes strong{margin:4px 0 1px;font-size:13px}
.ks-ritual[data-phase=wish] .ks-themes small{font-size:10px;line-height:1.4;display:block}
.ks-censer-art{position:absolute;bottom:0;left:0;width:300px;height:200px;object-fit:contain;z-index:2;pointer-events:none}
.ks-ritual[data-phase=result] .ks-desktop-preview{grid-template-columns:112px 1fr;min-height:200px;background:#fbf5e7;border:2px solid #b7934c66}
.ks-ritual[data-phase=result] .ks-desktop-preview>.ks-portrait{height:224px;min-height:224px;background-size:300% 100%}
@media(max-width:760px){.ks-ritual[data-phase=wish] .ks-themes .ks-portrait{height:90px}.ks-ritual[data-phase=wish] .ks-themes small{font-size:9px}.ks-ritual[data-phase=result] .ks-desktop-preview{grid-template-columns:90px 1fr}.ks-ritual[data-phase=result] .ks-desktop-preview>.ks-portrait{height:180px;min-height:180px}}
/* Show complete crowns and faces in the compact theme chooser. */
.ks-ritual[data-phase=wish] .ks-themes .ks-portrait{width:min(90px,100%);height:90px;margin:auto;background-size:300% 200%;background-position:calc(var(--portrait) * 50%) 0}
.ks-incense{height:315px;filter:none}.ks-censer-art{z-index:0;mix-blend-mode:multiply}.ks-stick{bottom:160px}
@media(max-width:760px){.ks-incense{height:315px;scale:.76;transform-origin:bottom center}}

/* The first step is a quiet, full-width chooser. The hall appears only after the wish. */
.ks-ritual[data-phase=wish] .ks-atmosphere{opacity:0;visibility:hidden;pointer-events:none}
.ks-ritual[data-phase=wish] .ks-shell::after,.ks-ritual[data-phase=wish] .ks-art-note,.ks-ritual[data-phase=wish] .ks-source{display:none}
.ks-ritual[data-phase=wish] #ks-object{left:38%;right:4%;top:6%;bottom:5%;max-width:none;padding:0 10px 0 0;border:0;background:transparent;box-shadow:none;scrollbar-width:thin;scrollbar-color:#c5c6ae transparent}
.ks-ritual[data-phase=wish] .ks-themes{gap:12px}
.ks-ritual[data-phase=wish] .ks-themes button{position:relative;height:clamp(145px,19svh,180px);padding:0;border:1px solid #b7934c55;border-radius:5px;isolation:isolate;transition:box-shadow 250ms ease,border-color 250ms ease,transform 250ms ease}
.ks-ritual[data-phase=wish] .ks-themes .ks-portrait{position:absolute;inset:0 0 0 50px;width:calc(100% - 50px);height:100%;margin:0;background-size:300% auto;background-position:calc(var(--portrait) * 50%) 0;transition:transform 450ms cubic-bezier(.22,1,.36,1);transform-origin:center;z-index:-1}
.ks-ritual[data-phase=wish] .ks-themes button::before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#fbf5e7 0px,#fbf5e7 44px,#fbf5e780 56px,transparent 75px);z-index:0;pointer-events:none}
.ks-ritual[data-phase=wish] .ks-theme-label{position:absolute;left:8px;right:auto;top:16px;bottom:16px;width:40px;display:flex;flex-direction:row-reverse;align-items:center;justify-content:center;gap:5px;color:#213b36;z-index:1;transition:transform 300ms cubic-bezier(.22,1,.36,1);text-shadow:none}
.ks-ritual[data-phase=wish] .ks-themes strong{font-size:18px;margin:0;writing-mode:vertical-rl;text-orientation:upright;letter-spacing:.12em}
.ks-ritual[data-phase=wish] .ks-themes small{font-size:11px;color:#756440;writing-mode:vertical-rl;text-orientation:upright;letter-spacing:.08em}
.ks-ritual[data-phase=wish] .ks-themes button[aria-pressed=true]{border:2px solid #15675f;box-shadow:0 0 0 3px #15675f25}
.ks-ritual[data-phase=wish] .ks-themes button[aria-pressed=true] strong::after{content:none}
.ks-ritual[data-phase=wish] .ks-themes button[aria-pressed=true]::after{content:"✓";position:absolute;right:9px;top:9px;width:26px;height:26px;display:grid;place-items:center;border-radius:50%;background:#15675f;color:#fff8e6;border:1px solid #eee2b5;font-size:16px;box-shadow:0 2px 10px #203b3640}
.ks-ritual[data-phase=wish] .ks-themes button:focus-visible{outline:2px solid #15675f;outline-offset:4px}
.ks-ritual[data-phase=wish] .ks-themes button:focus-visible .ks-portrait{filter:none;transform:scale(1.06)}
.ks-ritual[data-phase=wish] .ks-themes button:focus-visible .ks-theme-label{transform:translateX(2px) scale(1.08)}
.ks-ritual[data-phase=wish] .ks-wish-label{display:block;font-size:14px;margin:17px 0 8px}
.ks-hall-arriving{animation:ks-hall-arrive 850ms cubic-bezier(.22,1,.36,1) both}
@keyframes ks-hall-arrive{from{opacity:0;filter:blur(5px)}to{opacity:1;filter:blur(0)}}
@media(hover:hover){
 .ks-ritual[data-phase=wish] .ks-themes button:hover .ks-portrait{filter:none;transform:scale(1.06)}
 .ks-ritual[data-phase=wish] .ks-themes button:hover .ks-theme-label{transform:translateX(2px) scale(1.08)}
}
@media(max-width:760px){
 .ks-ritual[data-phase=wish] #ks-copy{margin-top:12px;padding-top:4px}
 .ks-ritual[data-phase=wish] #ks-object{padding:0;border:0;overflow:visible;background:transparent!important}
 .ks-ritual[data-phase=wish] .ks-themes{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .ks-ritual[data-phase=wish] .ks-themes button{height:160px}
 .ks-ritual[data-phase=wish] .ks-themes .ks-portrait{left:40px;width:calc(100% - 40px)}
 .ks-ritual[data-phase=wish] .ks-themes button::before{background:linear-gradient(90deg,#fbf5e7 0px,#fbf5e7 34px,#fbf5e780 43px,transparent 60px)}
 .ks-ritual[data-phase=wish] .ks-themes strong{font-size:16px}
 .ks-ritual[data-phase=wish] .ks-themes small{font-size:9px}
 .ks-ritual[data-phase=wish] .ks-theme-label{top:12px;bottom:12px;left:4px;right:auto;width:32px;gap:4px}
 .ks-ritual[data-phase=wish] .ks-themes button[aria-pressed=true]::after{width:21px;height:21px;right:5px;top:5px;font-size:13px}
 .ks-ritual[data-phase=wish] .ks-themes button:focus-visible .ks-theme-label{transform:translateX(1px) scale(1.05)}
}
html[lang=en] .ks-ritual[data-phase=wish] .ks-theme-label strong,html[lang=en] .ks-ritual[data-phase=wish] .ks-theme-label small{text-orientation:mixed;letter-spacing:0}
@media(prefers-reduced-motion:reduce){.ks-hall-arriving{animation:none}.ks-ritual[data-phase=wish] .ks-themes button,.ks-ritual[data-phase=wish] .ks-portrait,.ks-ritual[data-phase=wish] .ks-theme-label{transition:none}}

/* On phones, keep all ritual instructions together before the shrine. */
@media(max-width:760px){
 .ks-content{display:contents}
 .ks-sidebar{order:0;margin-bottom:0;padding-right:36px}
 .ks-sidebar h2{margin:10px 0 12px}
 .ks-steps{margin-top:0;padding:8px 0;gap:12px;background:transparent}
 #ks-copy,.ks-ritual[data-phase=wish] #ks-copy{order:1;margin-top:0;padding:14px 0 12px;background:transparent;border-top:1px solid #b7934c33}
 #ks-copy h3{margin:7px 0;font-size:24px}
 #ks-copy p{margin:8px 0 0}
 .ks-atmosphere{order:2;position:relative;inset:auto;z-index:0;flex:none;width:calc(100% + 32px);height:240px;margin:0 -16px;opacity:1}
 .ks-atmosphere>img{object-position:center 42%}
 .ks-atmosphere::after{background:linear-gradient(0deg,#fcfcf5,transparent 24%),linear-gradient(180deg,#fcfcf51a,transparent 14%)}
 .ks-ritual[data-phase=wish] .ks-atmosphere{display:none}
 #ks-object{order:3;flex:none}
 #ks-actions{order:4;flex:none}
 .ks-status{order:5;flex:none}
 .ks-art-note{order:6;flex:none}
 .ks-ritual[data-phase=incense] #ks-object{height:310px;min-height:310px}
 .ks-incense{margin-top:0;scale:.9;transform-origin:center}
}

/* Shared coordinates keep the ash, sticks and front rim aligned while scaling. */
.ks-incense{width:300px;height:340px;flex-shrink:0;isolation:isolate;transform-origin:center}
.ks-censer-art{width:300px;height:auto;bottom:0;left:0;mix-blend-mode:normal;z-index:0}
.ks-stick{bottom:154px;left:calc(122px + var(--stick) * 26px);z-index:1;transform-origin:50% 100%;transform:rotate(calc((var(--stick) - 1) * 2deg))}
.ks-stick::after{content:"";position:absolute;bottom:10px;left:-4px;width:12px;height:4px;background:radial-gradient(ellipse,#44301b80,transparent 70%);border-radius:50%;pointer-events:none}
/* Only the front lip and body cover the inserted ends; ash stays behind the sticks. */
.ks-censer-front{z-index:2;clip-path:inset(26% 0 0 0)}

/* Instructions form one group. On phones the uninterrupted hall leads into it. */
.ks-shell::after{display:none}
.ks-steps{border:0;padding-top:0}
.ks-sidebar #ks-copy{position:static;width:100%;max-width:none;margin:28px 0 0;padding:0;background:transparent;border:0}
.ks-ritual[data-phase=result] .ks-sidebar,.ks-ritual[data-phase=result] .ks-atmosphere,.ks-ritual[data-phase=result] .ks-art-note{display:none}
.ks-ritual[data-phase=result] #ks-object{inset:32px 48px;max-width:none;padding:0;background:transparent;border:0;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:48px;align-items:center;overflow:auto}
.ks-wallpaper{margin:0;text-align:center;min-width:0}
.ks-wallpaper-image{position:relative;aspect-ratio:9/16;width:min(100%,360px);margin:auto;background:#fbf5e7;box-shadow:0 12px 32px #3b30291f}
.ks-wallpaper-image img{display:block;width:100%;height:100%;object-fit:contain}
.ks-wallpaper-image img[hidden],.ks-wallpaper-loading[hidden]{display:none}
.ks-wallpaper-loading{position:absolute;inset:0;display:grid;place-items:center;padding:24px;font-size:13px;color:#765b31}
.ks-wallpaper figcaption{display:flex;flex-direction:column;gap:8px;margin-top:20px}
.ks-wallpaper figcaption span{font-size:13px;color:#765b31}
.ks-wallpaper figcaption strong{font:26px/1.4 SceneSerif,serif;font-weight:500}
.ks-result-details{width:100%;max-width:440px;padding-right:8px}
.ks-result-details #ks-copy{position:static;width:100%;max-width:none;margin:0 0 28px;padding:0;background:transparent;border:0}
.ks-result-details #ks-copy h3{margin:0 0 12px}
.ks-result-details #ks-copy p{margin:0}
.ks-result-details .ks-reading{grid-template-columns:1fr;gap:24px}
.ks-result-details .ks-reading .ks-poem{margin:12px 0 0;font-size:20px}
.ks-result-details #ks-actions{position:static;width:100%;max-width:none;margin-top:28px}
.ks-result-details .ks-status{position:static;width:100%;max-width:none;margin:12px 0 0}
@media(min-width:761px) and (max-height:780px){
 .ks-sidebar #ks-copy{margin-top:24px}
 .ks-ritual[data-phase=result] #ks-object{inset:24px 40px;gap:32px}
 .ks-wallpaper-image{width:min(100%,290px)}
 .ks-result-details #ks-copy{margin-bottom:20px}
 .ks-result-details .ks-reading{gap:16px}
 .ks-result-details #ks-actions{margin-top:20px}
}
@media(max-width:760px){
 .ks-shell{padding:0 24px 32px}
 .ks-atmosphere{order:0;width:calc(100% + 48px);height:280px;margin:0 -24px;opacity:1}
 .ks-atmosphere::after{background:linear-gradient(0deg,#fcfcf5,transparent 20%)}
 .ks-sidebar{order:1;padding:20px 0 0;margin:0}
 .ks-sidebar h2{font-size:25px;margin:10px 0 16px}
 .ks-eyebrow{padding:0}
 .ks-steps{border:0;margin:0;padding:0;gap:8px}
 .ks-sidebar #ks-copy,.ks-ritual[data-phase=wish] .ks-sidebar #ks-copy{margin:24px 0 16px;padding:0;border:0}
 #ks-object,.ks-ritual[data-phase=wish] #ks-object{order:2;border:0;padding:8px 0}
 #ks-actions{order:3}
 .ks-status{order:4}
 .ks-art-note{order:5}
 .ks-ritual[data-phase=wish] .ks-sidebar{padding-top:28px}
 .ks-ritual[data-phase=wish] .ks-sidebar h2{padding-right:20px}
 .ks-ritual[data-phase=result] #ks-object{display:flex;flex-direction:column;align-items:stretch;gap:32px;padding:64px 0 0;border:0;overflow:visible}
 .ks-wallpaper-image{width:100%;max-width:400px}
 .ks-wallpaper figcaption{margin-top:20px}
 .ks-result-details{max-width:none;padding:0}
 .ks-result-details #ks-copy{margin:0 0 24px}
 .ks-result-details .ks-reading{display:grid;gap:20px}
 .ks-result-details .ks-reading .ks-poem{text-align:left}
 .ks-result-details .ks-reading h4{margin-top:0}
 .ks-result-details #ks-actions{margin-top:24px}
}

/* Canonical lot records stay together from drawing through the line-by-line reading. */
.ks-lot-identity{display:block;font-size:12px;line-height:1.7;letter-spacing:.06em;color:#98733b}
.ks-lot-identity>span{margin-left:8px}
.ks-lot-title{margin:12px 0}
.ks-lot-title small{display:block;font-size:10px;line-height:1.5;color:#98733b;margin:0 0 4px}
.ks-lot-title strong{display:block;font:20px/1.6 SceneSerif,serif;color:#604b2f;overflow-wrap:anywhere}
.ks-lot-grade{font-size:12px;line-height:1.7;color:#765b31;margin:12px 0 4px}
.ks-lot-grade b{font-weight:500}
.ks-grade-note{font-size:11px;line-height:1.7;color:#72786a;margin:4px 0 0}
.ks-lot-reference{font-size:11px;line-height:1.7;color:#72786a;margin:12px 0 0}
.ks-lot-reference p{margin:0}
.ks-lot-reference a{display:inline-block;color:#15675f;min-height:32px;padding:6px 0;text-underline-offset:3px;text-decoration:underline;box-sizing:border-box}
.ks-lot-reference a:focus-visible{outline:2px solid #15675f;outline-offset:3px;border-radius:2px}
#kunshan-ritual .ks-poem-card .ks-poem{margin:14px 0}
#kunshan-ritual .ks-poem-card .ks-lot-title strong{font-size:18px}
#kunshan-ritual .ks-poem-card .ks-grade-note{text-align:left}
#kunshan-ritual .ks-reading.ks-canonical-reading,.ritual-dialog .ks-reading.ks-canonical-reading{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;text-align:left}
#kunshan-ritual .ks-canonical-reading .ks-lot-title small{margin-bottom:4px}
#kunshan-ritual .ks-canonical-reading .ks-lot-title strong{font-size:20px}
#kunshan-ritual .ks-canonical-reading .ks-lot-grade{font-size:12px;margin-bottom:4px}
#kunshan-ritual .ks-canonical-reading .ks-grade-note{font-size:11px;margin:4px 0 0}
.ks-line-readings h5{font-size:15px;line-height:1.5;margin:0 0 10px;color:#604b2f}
.ks-line-readings ol{list-style:none;padding:0;margin:16px 0 24px;counter-reset:lot-line}
.ks-line-readings li{position:relative;padding:14px 0 14px 28px;border-top:1px solid #dfc17870;counter-increment:lot-line}
.ks-line-readings li::before{content:counter(lot-line,decimal-leading-zero);position:absolute;left:0;top:17px;font-size:10px;line-height:1.6;color:#98733b}
.ks-line-readings blockquote{font:19px/1.7 SceneSerif,serif;margin:0 0 6px;color:#604b2f}
#kunshan-ritual .ks-line-readings li p,.ritual-dialog .ks-line-readings li p{font-size:14px;line-height:1.85;margin:0;color:#627062}
#kunshan-ritual .ks-canonical-reading .ks-reading-credit{font-size:11px;line-height:1.7;color:#72786a;margin:0}
#kunshan-ritual .ks-canonical-reading .ks-lot-reference p{font-size:11px;line-height:1.7;margin:0}
#kunshan-ritual .ks-canonical-reading .ks-reading-summary{font-size:14px;line-height:1.85;margin:0}
@media(max-width:760px){
 .ks-line-readings blockquote{font-size:18px}
 #kunshan-ritual .ks-poem-card .ks-lot-title strong{font-size:17px}
 #kunshan-ritual .ks-poem-card .ks-lot-grade{font-size:11px}
 .ks-lot-reference a{min-height:44px;padding:10px 0}
}

/* Compact, sourced deity title shown beside the selected theme. */
.ks-deity-info{margin:12px 0 20px;padding:14px 16px;background:#fff8df;border:1px solid #d8bd77;border-radius:14px;color:#554b32;line-height:1.65;overflow-wrap:anywhere}
.ks-deity-info summary{cursor:pointer;font-weight:650;font-size:14px}
.ks-deity-info p{font-size:14px;margin:10px 0}.ks-deity-info a,.ks-source-link{color:#755512;text-underline-offset:4px;font-size:14px}
.ks-lot-reference a{display:inline-block;margin:4px 12px 4px 0}

.ritual-source-links{font-size:13px;line-height:1.6;margin:9px 0 0;color:#786746}.ritual-source-links a{color:inherit;text-underline-offset:4px}
