.divine-entry {
  --entry-red: #5a0807;
  --entry-deep: #240101;
  --entry-gold: #e7b72f;
  --entry-ivory: #fff5dc;
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--entry-ivory);
  background: var(--entry-deep);
  isolation: isolate;
}

html.divine-entry-seen .divine-entry {
  display: none;
}

body.entry-locked {
  overflow: hidden !important;
}

body.entry-locked #agentation-root,
body.entry-locked [data-agentation-root] {
  display: none !important;
}

.divine-entry[hidden] {
  display: none;
}

.divine-entry::before,
.divine-entry::after {
  content: "";
  position: absolute;
  z-index: -2;
  top: 0;
  bottom: 0;
  width: 51%;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .2), transparent 16%, transparent 78%, rgba(255, 205, 86, .08)),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(255, 226, 151, .025) 44px 46px),
    var(--entry-red);
  transition: transform 1.15s cubic-bezier(.76, 0, .24, 1);
}

.divine-entry::before {
  left: 0;
  border-right: 1px solid rgba(231, 183, 47, .48);
  box-shadow: inset -30px 0 70px rgba(25, 0, 0, .42);
}

.divine-entry::after {
  right: 0;
  border-left: 1px solid rgba(231, 183, 47, .48);
  box-shadow: inset 30px 0 70px rgba(25, 0, 0, .42);
}

.divine-entry.is-entering::before {
  transform: translateX(-101%);
}

.divine-entry.is-entering::after {
  transform: translateX(101%);
}

.divine-entry__canopy {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 100%;
  height: clamp(54px, 8vw, 88px);
  display: flex;
  justify-content: center;
  gap: clamp(2px, .5vw, 8px);
  pointer-events: none;
}

.divine-entry__canopy span {
  width: clamp(30px, 4vw, 54px);
  height: clamp(43px, 6vw, 66px);
  display: block;
  background: #ed9e18;
  border-radius: 0 0 50% 50%;
  box-shadow: inset 0 -9px 0 #c5510b, 0 10px 22px rgba(29, 0, 0, .3);
  transform-origin: top center;
  animation: entry-garland 2.8s ease-in-out infinite alternate;
}

.divine-entry__canopy span:nth-child(2n) {
  height: clamp(34px, 5vw, 56px);
  background: #f3bd28;
  animation-delay: -.7s;
}

.divine-entry__canopy span:nth-child(3n) {
  background: #d96c10;
  animation-delay: -1.4s;
}

.divine-entry__stage {
  position: relative;
  z-index: 2;
  width: min(92vw, 620px);
  min-height: min(84vh, 690px);
  padding: clamp(68px, 9vh, 104px) 24px 34px;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  transition: opacity .52s ease, transform .7s cubic-bezier(.2, .75, .25, 1);
}

.divine-entry.is-entering .divine-entry__stage {
  opacity: 0;
  transform: scale(1.07);
}

.divine-entry__mandala {
  position: relative;
  width: clamp(208px, 34vw, 292px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.divine-entry__mandala::before,
.divine-entry__mandala::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(231, 183, 47, .62);
  border-radius: 50%;
}

.divine-entry__mandala::before {
  background:
    radial-gradient(circle at center, transparent 0 51%, rgba(231, 183, 47, .11) 51.5% 53%, transparent 53.5%),
    repeating-conic-gradient(from 0deg, rgba(231, 183, 47, .88) 0deg 1.4deg, transparent 1.4deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 0 65%, #000 65.5% 72%, transparent 72.5%);
  mask: radial-gradient(circle, transparent 0 65%, #000 65.5% 72%, transparent 72.5%);
  animation: entry-mandala-spin 18s linear infinite;
}

.divine-entry__mandala::after {
  inset: 18px;
  border-style: dashed;
  border-color: rgba(255, 237, 190, .3);
  animation: entry-mandala-spin 24s linear infinite reverse;
}

.divine-entry__halo {
  position: absolute;
  inset: 38px;
  border: 1px solid rgba(231, 183, 47, .28);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(231, 183, 47, .14), inset 0 0 40px rgba(231, 183, 47, .08);
  animation: entry-halo 2.2s ease-in-out infinite;
}

.divine-entry__emblem {
  position: relative;
  z-index: 1;
  width: 58%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 18px 26px rgba(17, 0, 0, .65));
  animation: entry-emblem 1.45s cubic-bezier(.22, .85, .28, 1) both;
}

.divine-entry__diyas {
  width: min(330px, 76vw);
  height: 34px;
  margin-top: -6px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.divine-entry__diya {
  position: relative;
  width: 34px;
  height: 12px;
  border-radius: 4px 4px 18px 18px;
  background: #a9330b;
  border-bottom: 2px solid #f0ad28;
}

.divine-entry__diya::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 9px;
  height: 21px;
  border-radius: 70% 30% 65% 35%;
  background: #ffd45c;
  box-shadow: 0 0 15px #f19b16, 0 0 30px rgba(241, 155, 22, .45);
  transform: translateX(-50%) rotate(4deg);
  transform-origin: 50% 100%;
  animation: entry-flame .82s ease-in-out infinite alternate;
}

.divine-entry__diya:nth-child(2)::before {
  animation-delay: -.22s;
}

.divine-entry__diya:nth-child(3)::before {
  animation-delay: -.47s;
}

.divine-entry__mantra {
  margin: 22px 0 7px;
  color: var(--entry-gold);
  font-family: "Tiro Devanagari Hindi", Georgia, serif;
  font-size: clamp(14px, 2vw, 18px);
  letter-spacing: 0;
}

.divine-entry__title {
  max-width: 540px;
  margin: 0;
  color: var(--entry-ivory);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 600;
  line-height: .92;
  letter-spacing: 0;
}

.divine-entry__welcome {
  margin: 12px 0 18px;
  color: rgba(255, 245, 220, .68);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
}

.divine-entry__progress {
  width: min(250px, 62vw);
  height: 1px;
  overflow: hidden;
  background: rgba(255, 245, 220, .2);
}

.divine-entry__progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--entry-gold);
  transform: translateX(-100%);
  animation: entry-progress 1.25s cubic-bezier(.65, 0, .35, 1) forwards;
}

@keyframes entry-progress {
  to { transform: translateX(0); }
}

@keyframes entry-mandala-spin {
  to { transform: rotate(360deg); }
}

@keyframes entry-emblem {
  from { opacity: 0; transform: scale(.78); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes entry-halo {
  50% { transform: scale(1.04); opacity: .72; }
}

@keyframes entry-flame {
  to { transform: translateX(-50%) rotate(-6deg) scaleY(.88); }
}

@keyframes entry-garland {
  to { transform: rotate(2deg) translateY(3px); }
}

@media (max-height: 700px) {
  .divine-entry__stage { min-height: 100%; padding-top: 52px; padding-bottom: 18px; }
  .divine-entry__mandala { width: 190px; }
  .divine-entry__mantra { margin-top: 12px; }
  .divine-entry__welcome { margin-bottom: 12px; }
}

@media (max-width: 520px) {
  .divine-entry__stage { width: 100%; padding-inline: 18px; }
  .divine-entry__title { max-width: 330px; }
  .divine-entry__canopy span:nth-child(n+10) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .divine-entry *,
  .divine-entry *::before,
  .divine-entry *::after,
  .divine-entry::before,
  .divine-entry::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }

  .divine-entry__progress span { transform: none; }
}
