/* The welcome scene is isolated from the dungeon and armory styles. */
.sanctum-court { position: absolute; left: 0; top: 0; pointer-events: none; overflow: hidden;
  background: #0a1720 url(assets/hearth-sanctum-v1.jpg) center center / cover no-repeat;
  -webkit-mask-image: linear-gradient(#000 0 84%, transparent 100%); mask-image: linear-gradient(#000 0 84%, transparent 100%); }
.sanctum-court::before { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(3, 10, 17, .72), rgba(3, 10, 17, .3) 34%, transparent 58%), linear-gradient(#040b13 0, transparent 19%, transparent 77%, rgba(6, 17, 23, .35)); }
.sanctum-court::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 100px 18px rgba(0, 0, 0, .25); }
.hearth-threshold { position: absolute; left: 0; top: 0; pointer-events: none; overflow: hidden;
  background: url(assets/hearth-threshold-v2.jpg) no-repeat;
  -webkit-mask-image: linear-gradient(transparent var(--join-start), #000 var(--join-end), #000 calc(100% - var(--exit-fade)), transparent);
  mask-image: linear-gradient(transparent var(--join-start), #000 var(--join-end), #000 calc(100% - var(--exit-fade)), transparent); }
.threshold-warmth { position: absolute; left: 17%; right: 17%; top: calc(var(--sentry-feet) - 150px); height: 260px;
  background: radial-gradient(ellipse at 50% 0, rgba(232, 171, 72, .075), transparent 72%); mix-blend-mode: screen; }
.threshold-haze { position: absolute; left: -5%; right: -5%; top: calc(var(--sentry-feet) - 30px); height: 140px;
  background: radial-gradient(ellipse at 38% 45%, rgba(155, 177, 177, .055), transparent 58%), radial-gradient(ellipse at 72% 65%, rgba(155, 177, 177, .04), transparent 50%);
  animation: threshold-air 24s ease-in-out infinite alternate; }
@keyframes threshold-air { to { translate: 2.5% 0; opacity: .6; } }
.sanctum-fire { position: absolute; left: 69%; top: 41%; width: 145px; height: 140px; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 188, 83, .3), rgba(212, 126, 40, .08) 52%, transparent); mix-blend-mode: screen; animation: hearth-fire 4s ease-in-out infinite; }
.sanctum-embers { position: absolute; left: 69%; top: 42%; width: 1px; height: 1px; }
.sanctum-embers i { position: absolute; width: 2px; height: 2px; background: #f9cd80; border-radius: 50%; box-shadow: 0 0 7px #e9a54e; opacity: 0;
  animation: hearth-ember var(--duration) linear var(--delay) infinite; }
.sanctum-arrival { position: absolute; left: var(--hearth-x, 50%); top: var(--hearth-feet); width: 264px; height: 88px; translate: -50% -50%; border-radius: 50%;
  border: 1px solid rgba(213, 175, 98, .35); box-shadow: 0 0 32px rgba(228, 162, 62, .07), inset 0 0 25px rgba(228, 162, 62, .05); opacity: 0; transition: opacity 1.5s; }
.sanctum-arrival::before, .sanctum-arrival::after { content: ''; position: absolute; border-radius: 50%; inset: 8px 24px; border: 1px solid rgba(213, 175, 98, .17); }
.sanctum-arrival::after { inset: -5px -15px; border-style: dashed; border-color: rgba(213, 175, 98, .13); }
html.sanctum-ready .sanctum-arrival { opacity: 1; }
/* Cross-fade complete lighting layers; no abrupt palette switch at the section boundary. */
html.hearth-world #veil { background: none; }
html.hearth-world #veil::before, html.hearth-world #veil::after { content: ''; position: absolute; inset: 0; }
html.hearth-world #veil::before { opacity: calc(1 - var(--hearth-light, 0));
  background: radial-gradient(ellipse 30% 34% at 50% 64%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(ellipse 95% 80% at 50% 62%, transparent 30%, rgba(5, 9, 13, .58) 72%, rgba(5, 9, 13, .9) 100%),
    linear-gradient(color-mix(in srgb, var(--accent) 7%, transparent), color-mix(in srgb, var(--accent) 7%, transparent)); }
html.hearth-world #veil::after { opacity: var(--hearth-light, 0);
  background: radial-gradient(ellipse 80% 80% at 58% 53%, transparent 32%, rgba(2, 8, 13, .3) 100%); }
html.sanctum-active #walker { filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .8)) drop-shadow(0 0 17px rgba(236, 179, 91, .13)); }
html.sanctum-active #nav { background: rgba(5, 12, 18, .82); border-bottom-color: rgba(192, 165, 110, .2); }
html.sanctum-active #nav nav a { font-family: var(--body); font-size: 10px; letter-spacing: .12em; }
html.sanctum-active #nav nav a:hover { color: #e9c877; }
#hud.away { display: none; }
#seals { transition: opacity .35s; }
html.sanctum-active #seals { opacity: 0; pointer-events: none; }

/* Size the copy from the courtyard so releasing the intro's scrollbar lock does not move it. */
#top.sanctum-top { container-type: inline-size; min-height: 100vh; max-width: none; padding: 0; text-align: left; }
.sanctum-top .top-inner { position: absolute; left: max(6.5%, calc((100% - 1440px) / 2 + 94px)); top: 24vh; width: min(32%, 450px); padding: 0; }
.sanctum-eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 23px; color: #cfb786;
  font: 500 10px/1.5 var(--body); letter-spacing: .27em; text-transform: uppercase; }
.sanctum-eyebrow i { flex: none; width: 7px; height: 7px; rotate: 45deg; border: 1px solid #d4ac63; box-shadow: 0 0 13px rgba(212, 172, 99, .35); }
.sanctum-top h1 { display: block; width: max-content; max-width: none; margin: 0 0 19px; font: 700 clamp(55px, 5.4cqw, 96px)/1 var(--display); letter-spacing: .035em;
  color: #eed8a8; background: linear-gradient(175deg, #fff3d2, #e0bf7c 63%, #a87e3a); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; filter: drop-shadow(0 3px 9px rgba(0, 0, 0, .45)); }
.sanctum-promise { max-width: 350px; color: #ecede5; font: 500 clamp(25px, 2.55cqw, 39px)/1.28 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.sanctum-description { max-width: 325px; margin: 23px 0 0; color: #9eafaf; font: 400 15px/1.85 var(--body); text-wrap: pretty; }
.sanctum-top .cta-row { display: inline-grid; justify-items: center; gap: 16px; margin-top: 31px; }
.sanctum-play { gap: 25px; min-height: 49px; padding: 0 24px; font: 700 11px var(--body); letter-spacing: .13em; }
.sanctum-play > span:last-child { font-size: 19px; font-weight: 400; }
.sanctum-top .knight-replay { font: 10px var(--body); letter-spacing: .025em; }
.sanctum-top .top-hero { display: none; }
@keyframes hearth-fire { 0%, 100% { opacity: .7; scale: .95; } 48% { opacity: 1; scale: 1.08; } 65% { opacity: .8; } }
@keyframes hearth-ember { 0% { opacity: 0; translate: 0 0; } 16% { opacity: .65; } 85% { opacity: .3; } 100% { opacity: 0; translate: var(--drift) -150px; } }

@media (min-width: 901px) {
  #koy .prop { visibility: hidden; }
  /* Reserve space for guards inside the column instead of pushing the panel outside the viewport. */
  #koy.stage > .panel { width: calc(100% - min(4vw, 55px)); margin-right: min(4vw, 55px); }
}
@media (max-width: 1100px) and (min-width: 901px) {
  .sanctum-top .top-inner { left: 5%; top: 23vh; width: 35%; }
  .sanctum-top h1 { font-size: 5.35cqw; }
  .sanctum-promise { font-size: 27px; }
  .sanctum-description { max-width: 280px; font-size: 13px; }
}
@media (max-width: 900px) {
  .hearth-threshold { display: none; }
  #top.sanctum-top { min-height: 980px; }
  .sanctum-top .top-inner { left: 7%; right: 7%; top: 130px; width: auto; }
  .sanctum-top h1 { font-size: clamp(48px, 10cqw, 82px); }
  .sanctum-promise { max-width: 370px; font-size: 29px; }
  .sanctum-description { max-width: 330px; }
  .sanctum-top .top-hero { display: block; position: absolute; top: 420px; left: 50%; height: 210px; margin: 0; translate: -50% 0; }
  .sanctum-court { background-position: 60% center; }
  .sanctum-court::before { background: linear-gradient(#07121c 8%, rgba(7, 18, 28, .7) 42%, transparent 76%); }
  .sanctum-arrival { display: none; }
}
@media (max-width: 379px) {
  .sanctum-top h1 { font-size: clamp(36px, 12.6cqw, 48px); }
}
@media (prefers-reduced-motion: reduce) {
  .threshold-haze { animation: none; }
  .sanctum-fire, .sanctum-embers i { animation: none; }
  .sanctum-embers { display: none; }
}
