:root {
  --pointer-x: 0px;
  --pointer-y: 0px;
  --camera-x: 0vw;
  --far-x: 0px;
  --far-y: 0px;
  --ground-x: 0px;
  --ground-y: 0px;
  --grass-x: 0px;
  --grass-y: 0px;
  --sky-top: #010101;
  --sky-bottom: #151516;
  --ground: #c9c6bb;
  --stone: #595b58;
  --stone-light: #848681;
  --stone-side: #30312f;
  --mist: rgba(246, 244, 235, .13);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: #1a2021;
  color: #f4f0e8;
  font-family: Georgia, "Songti SC", "SimSun", serif;
}

.cemetery {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  perspective: 900px;
  background: linear-gradient(var(--sky-top) 0%, var(--sky-bottom) 55%, var(--ground) 56%);
  cursor: default;
}

.sky, .atmosphere, .distant-hills, .tree-line, .grounds, .mist { position: absolute; inset: 0; }
.sky { z-index: -7; overflow: hidden; }
.sky::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 14, 22, .1), rgba(19, 25, 22, 0) 50%, rgba(12, 18, 15, .12));
}
.moon {
  position: absolute; width: clamp(66px, 9vw, 126px); aspect-ratio: 1; border-radius: 50%;
  top: 12%; right: 17%; opacity: .31;
  background: radial-gradient(circle at 37% 33%, #fffef1 0 4%, transparent 4.5%), radial-gradient(circle at 64% 59%, #deded3 0 9%, transparent 10%), #f5f2dc;
  box-shadow: 0 0 58px 14px rgba(243, 245, 220, .22);
}
.cloud { position: absolute; width: 46vw; height: 12vw; min-width: 360px; border-radius: 50%; background: rgba(68, 68, 68, .2); filter: blur(17px); }
.cloud-one { top: 16%; left: -12%; animation: drift 55s linear infinite alternate; }
.cloud-two { top: 29%; right: -18%; opacity: .72; animation: drift 68s -19s linear infinite alternate-reverse; }
@keyframes drift { to { transform: translateX(13vw); } }

.atmosphere { z-index: -3; pointer-events: none; opacity: .23; background-image: radial-gradient(ellipse at 70% 46%, rgba(255,255,242,.12), transparent 34%), linear-gradient(102deg, transparent 0 47%, rgba(255,255,255,.035) 48% 49%, transparent 50% 100%); mix-blend-mode: screen; }
.distant-hills { z-index: -5; top: 43%; height: 26%; inset-inline: -4%; clip-path: polygon(0 70%, 7% 48%, 17% 60%, 29% 17%, 40% 58%, 52% 36%, 63% 60%, 74% 26%, 88% 57%, 100% 28%, 100% 100%, 0 100%); background: linear-gradient(#29292a, #151515); opacity: .9; }
.tree-line { z-index: -4; top: 47%; height: 26%; inset-inline: -2%; opacity: .92; background: linear-gradient(90deg, #0d0e0d, #161714); clip-path: polygon(0 100%,0 35%,2% 35%,3% 8%,5% 42%,7% 17%,9% 50%,12% 4%,15% 42%,18% 26%,20% 51%,24% 10%,28% 48%,32% 31%,36% 53%,40% 8%,44% 44%,49% 17%,53% 50%,59% 12%,63% 46%,67% 30%,71% 52%,75% 5%,79% 45%,82% 19%,86% 49%,90% 7%,95% 45%,98% 25%,100% 44%,100% 100%); }
.layer { transform: translate3d(var(--far-x), var(--far-y), 0); transition: transform 1.2s cubic-bezier(.16,.85,.25,1); }

.grounds { z-index: 1; top: 49%; right: auto; width: 480vw; transform-style: preserve-3d; transform: rotateX(11deg) translate3d(calc(var(--camera-x) + var(--ground-x)), var(--ground-y), 0); transition: transform 1.25s cubic-bezier(.16,.85,.25,1); clip-path:polygon(0 12%, 2% 5%, 5% 8%, 8% 2%, 11% 9%, 15% 4%, 19% 10%, 23% 3%, 28% 7%, 32% 1%, 36% 8%, 40% 4%, 45% 10%, 49% 2%, 53% 7%, 57% 1%, 61% 9%, 66% 3%, 70% 8%, 74% 2%, 78% 10%, 82% 4%, 86% 9%, 90% 1%, 94% 7%, 97% 3%, 100% 10%, 100% 100%, 0 100%); background: linear-gradient(180deg, #dbd8ce, var(--ground) 38%, #a9a69d 100%); }
.path { position: absolute; inset: 15% 19% -10% 35%; transform: rotate(-7deg); opacity: .53; background: linear-gradient(90deg, transparent, rgba(165,157,134,.34) 43%, rgba(179,170,143,.22) 59%, transparent 100%); clip-path: polygon(45% 0, 65% 0, 100% 100%, 0 100%); }
.grass { position: absolute; left: -5%; width: 110%; pointer-events: none; background:none; }
.grass-back { height: 22%; top: 5%; opacity: .55; }
.grass-front { height: 27%; bottom: -3%; z-index: 10; opacity: .9; transform: translate3d(var(--grass-x), var(--grass-y), 0); transition: transform 1.1s cubic-bezier(.16,.85,.25,1); }

.grave { --scale: 1; position: absolute; z-index: 4; width: 92px; height: 154px; padding: 0; border: 0; background: none; transform-style: preserve-3d; transform: translateZ(0) scale(var(--scale)); cursor: pointer; transition: filter .5s ease, transform .75s cubic-bezier(.18,.86,.27,1); filter: drop-shadow(18px 21px 7px rgba(10,16,13,.34)); }
.grave:focus-visible { outline: none; }
.grave:hover, .grave.is-listening { filter: brightness(1.04) drop-shadow(18px 21px 7px rgba(10,16,13,.42)); transform: translateY(-5px) translateZ(12px) scale(calc(var(--scale) * 1.025)); }
.grave__face, .grave__side, .grave__base, .grave__cap { position: absolute; display: block; }
.grave__face { inset: 9px 15px 19px 7px; z-index: 2; background: linear-gradient(105deg, var(--stone-light), var(--stone) 42%, #474d4a 100%); box-shadow: inset 2px 2px 4px rgba(255,255,255,.16), inset -3px -2px 5px rgba(0,0,0,.23); }
.grave__face::after { content:""; position: absolute; inset: 13% 27% 20%; opacity: .17; background: repeating-linear-gradient(105deg, transparent 0 17px, rgba(24,31,28,.7) 18px 19px, transparent 20px 32px); }
.grave__side { top: 15px; right: 0; bottom: 20px; width: 17px; z-index: 1; transform: skewY(-34deg); transform-origin: left top; background: linear-gradient(90deg, #3a413e, #212825); }
.grave__base { z-index:4; height:15px; left:-5px; right:-2px; bottom:3px; background:linear-gradient(#646963, #383d39); clip-path:polygon(4% 0, 100% 0, 95% 100%, 0 100%); box-shadow:7px 8px 7px rgba(12,15,14,.26); }
.grave__base::before { content:""; position:absolute; left:6px; right:1px; top:-8px; height:10px; background:linear-gradient(100deg,#8e938a,#676d66); clip-path:polygon(7% 0, 100% 0, 93% 100%, 0 100%); transform:skewX(-22deg); transform-origin:bottom left; }
.grave__base::after { content:""; position:absolute; right:-7px; top:1px; width:10px; height:14px; background:linear-gradient(90deg,#303532,#464b46); clip-path:polygon(0 0,100% 23%,100% 100%,0 100%); transform:skewY(-31deg); transform-origin:left top; }
.grave__cap { z-index:3; left:12px; top:3px; width:65px; height:17px; transform:skewX(-22deg); transform-origin:bottom left; clip-path:polygon(0 66%, 19% 0, 100% 0, 82% 68%); background:linear-gradient(110deg, #a4a69f, #737670 49%, #4d504d); box-shadow:inset 0 1px 2px rgba(255,255,255,.24), 2px 2px 2px rgba(0,0,0,.17); }
.grave--slab { --scale: .86; left: 45vw; top: 20%; opacity: .86; }
.grave--slab .grave__face { clip-path: polygon(0 9%, 18% 0, 79% 0, 100% 10%, 100% 100%, 0 100%); }
.grave--arch { --scale: 1.16; left: 138vw; top: 10%; }
.grave--arch .grave__face { clip-path: polygon(0 23%, 5% 10%, 17% 2%, 50% 0, 83% 2%, 95% 10%, 100% 23%, 100% 100%, 0 100%); }
.grave--tall { --scale: .84; left: 231vw; top: 19%; opacity: .9; }
.grave--tall .grave__face { clip-path: polygon(0 13%, 21% 5%, 47% 0, 78% 7%, 100% 15%, 100% 100%, 0 100%); }
.grave--round { --scale: 1.34; left: 324vw; top: 35%; z-index: 6; }
.grave--round .grave__face { clip-path: polygon(0 27%, 6% 12%, 19% 3%, 42% 0, 70% 4%, 91% 15%, 100% 29%, 100% 100%, 0 100%); }
.grave--near { --scale: 1.68; left: 417vw; top: 34%; z-index: 7; }
.grave--near .grave__face { clip-path: polygon(0 16%, 16% 5%, 54% 0, 88% 9%, 100% 20%, 100% 100%, 0 100%); }

.offerings { position:absolute; inset:0; z-index:9; pointer-events:none; }
.offering { position:absolute; animation:offering-arrives .85s cubic-bezier(.13,.85,.27,1) both; transform-origin:bottom center; }
.offering--flower { width:32px; height:22px; }
.offering--flower::before { content:"✽"; position:absolute; color:#f2eee4; font-size:28px; text-shadow:5px 4px 4px rgba(0,0,0,.28); transform:rotate(var(--petal-turn, -18deg)); }
.offering--flower::after { content:""; position:absolute; left:12px; top:18px; width:2px; height:21px; background:#606a59; transform:rotate(-20deg); }
.offering--incense { width:48px; height:30px; border-radius:0 0 24px 24px; background:linear-gradient(90deg,#383836,#81796b 45%,#383836); box-shadow:7px 9px 9px rgba(0,0,0,.3); }
.offering--incense::before { content:""; position:absolute; inset:-4px 3px auto; height:9px; border-radius:50%; background:#9c947f; box-shadow:inset 0 2px 3px #2d302d; }
.offering--incense::after { content:""; position:absolute; left:22px; bottom:24px; width:2px; height:35px; background:#4c4036; box-shadow:-10px 3px 0 #4c4036, 10px 3px 0 #4c4036, 0 -36px 15px 6px rgba(235,232,211,.22); }
.offering--stick { width:3px; height:35px; background:#4c4036; box-shadow:0 -2px 4px 1px rgba(237,229,205,.75); transform-origin:bottom; }
@keyframes offering-arrives { from { opacity:0; transform:translate(var(--fall-x, 0), var(--fall-y, -20px)) rotate(var(--turn, 0deg)) scale(.65); } to { opacity:1; transform:translate(0, 0) rotate(var(--rest-turn, 0deg)) scale(1); } }

.mist { z-index: 12; pointer-events: none; width: 140%; left: -20%; height: 30%; border-radius: 50%; background: radial-gradient(ellipse, var(--mist), transparent 64%); filter: blur(13px); mix-blend-mode: screen; opacity: .7; }
.mist-back { top: 49%; animation: mist 22s ease-in-out infinite alternate; }
@keyframes mist { to { transform: translateX(8%) scaleX(1.08); opacity: .43; } }

.lyrics { position: absolute; z-index: 20; width: min(80vw, 660px); left: 50%; bottom: 9vh; text-align: center; transform: translateX(-50%); pointer-events: none; text-shadow: 0 2px 12px rgba(0,0,0,.85); }
.lyric { min-height: 1.45em; margin: .3em 0; font-size: clamp(13px, 1.35vw, 18px); letter-spacing: .12em; transition: opacity 1.4s ease, transform 1.4s ease; }
.lyric--previous, .lyric--next { opacity: 0; transform: translateY(5px); font-size: clamp(11px, 1.05vw, 15px); }
.lyrics.has-lyrics .lyric--previous, .lyrics.has-lyrics .lyric--next { opacity: .38; }
.lyric--current { opacity: 0; font-size: clamp(15px, 1.7vw, 23px); } .lyrics.has-lyrics .lyric--current { opacity: .92; }

.sound-toggle { position:absolute; z-index:31; left:50%; bottom:25px; width:30px; height:30px; display:flex; align-items:center; justify-content:center; gap:3px; border:0; border-radius:50%; padding:0; color:inherit; background:rgba(18,24,21,.24); opacity:.42; cursor:pointer; transform:translateX(-50%); transition:opacity .5s ease, background .5s ease; }
.sound-toggle:hover, .sound-toggle:focus-visible { opacity:.9; background:rgba(239,237,218,.12); outline:1px solid rgba(244,242,219,.7); outline-offset:3px; }
.sound-toggle span { width:2px; height:5px; background:rgba(247,244,222,.86); border-radius:2px; }
.sound-toggle.is-playing span { animation:sound 1s ease-in-out infinite alternate; }.sound-toggle.is-playing span:nth-child(2){animation-delay:-.35s}.sound-toggle.is-playing span:nth-child(3){animation-delay:-.7s}
.rites { position:absolute; z-index:31; inset:0; pointer-events:none; }
.rite { position:absolute; bottom:25px; width:30px; height:30px; border:0; border-radius:50%; padding:0; pointer-events:auto; background:rgba(18,18,17,.2); opacity:.48; cursor:pointer; transition:opacity .4s ease, background .4s ease; }
.rite--flower { left:28px; }.rite--incense { right:28px; }
.rite:hover, .rite:focus-visible { opacity:.95; background:rgba(255,255,250,.13); outline:1px solid rgba(244,242,219,.7); outline-offset:3px; }
.rite--flower::before { content:"✽"; color:#f5f1e9; font-size:20px; line-height:28px; }
.rite--incense::before { content:""; position:absolute; left:7px; bottom:8px; width:16px; height:6px; border-radius:0 0 8px 8px; background:#918977; }.rite--incense::after { content:""; position:absolute; left:14px; bottom:13px; width:2px; height:12px; background:#e6dfcf; box-shadow:-5px 2px 0 #e6dfcf,5px 2px 0 #e6dfcf; }
.sound-status { position: absolute; z-index: 30; left: 50%; bottom: 4.5vh; display: flex; gap: 3px; align-items: center; height: 12px; transform: translateX(-50%); opacity: 0; transition: opacity .8s ease; }
.sound-status span { width: 2px; height: 3px; border-radius: 2px; background: rgba(247,244,222,.78); }
.is-playing .sound-status { opacity: .8; } .is-playing .sound-status span { animation: sound 1s ease-in-out infinite alternate; }
.is-playing .sound-status span:nth-child(2) { animation-delay: -.45s; } .is-playing .sound-status span:nth-child(3) { animation-delay: -.75s; }
@keyframes sound { to { height: 11px; } }
.player { position: fixed; width: 1px; height: 1px; opacity: .01; pointer-events: none; right: 0; bottom: 0; border: 0; }

body.is-rainy .cemetery::after { content: ""; position: absolute; z-index: 15; inset: -20%; pointer-events: none; opacity: .23; background-image: repeating-linear-gradient(108deg, transparent 0 22px, rgba(222,229,239,.8) 23px 24px, transparent 25px 48px); animation: rain .65s linear infinite; }
@keyframes rain { to { transform: translate3d(-38px, 85px, 0); } }
body.is-winter { --sky-top:#000; --sky-bottom:#16171a; --ground:#d1d0cb; --stone:#727573; }
body.is-summer { --sky-top:#020202; --sky-bottom:#1c1d20; --ground:#c4c1b7; --stone:#676a66; }

@media (max-width: 600px) { .lyrics { bottom: 13vh; } .moon { right: 10%; top: 10%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
