:root {
  --void: #070303;
  --gold: #d8b25e;
  --gold-hi: #f7e1a1;
  --gold-lo: #7d5520;
  --bone: #efe6d2;
  --ash: #9b8f84;

  --pulse: 0;

  --serif: "Cormorant Garamond", Georgia, serif;
  --caps: "Cinzel", "Times New Roman", serif;
  --black: "UnifrakturMaguntia", "Cinzel", serif;

  --cur: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='28' viewBox='0 0 24 28'%3E%3Cpath d='M12 2v24M6 18h12' stroke='%23070303' stroke-width='5' stroke-linecap='square'/%3E%3Cpath d='M12 3v22M7 18h10' stroke='%23e3c070' stroke-width='2'/%3E%3C/svg%3E") 12 2, crosshair;
  --cur-hot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='28' viewBox='0 0 24 28'%3E%3Cpath d='M12 2v24M6 18h12' stroke='%23070303' stroke-width='5' stroke-linecap='square'/%3E%3Cpath d='M12 3v22M7 18h10' stroke='%23ff6a2e' stroke-width='2'/%3E%3C/svg%3E") 12 2, pointer;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--void);
  color: var(--bone);
  font-family: var(--serif);
  overflow: hidden;
  cursor: var(--cur);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: var(--cur-hot);
}

a { color: inherit; cursor: var(--cur-hot); }
img { display: block; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.gs-hi  { stop-color: var(--gold-hi); }
.gs-mid { stop-color: var(--gold); }
.gs-lo  { stop-color: var(--gold-lo); }

canvas { display: block; pointer-events: none; }

.s {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.02;
}

.draw .s {
  animation: draw var(--dur, 1.3s) cubic-bezier(0.65, 0, 0.35, 1) forwards;
  animation-delay: calc(var(--d0, 0s) + var(--i, 0) * var(--step, 0.22s));
}

@keyframes draw { to { stroke-dashoffset: 0; } }

.hell {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hell-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 50% 118%, #4d0c05 0%, #1c0504 45%, transparent 75%),
    radial-gradient(90% 70% at 50% 40%, #150505 0%, var(--void) 70%);
  transition: filter 1.2s ease;
}

.hell-floor {
  position: absolute;
  left: -15%;
  right: -15%;
  bottom: -18%;
  height: 72%;
  background: radial-gradient(50% 50% at 50% 100%, rgba(255, 90, 30, 0.3), rgba(160, 20, 8, 0.1) 45%, transparent 75%);
  opacity: calc(0.5 + var(--pulse) * 0.6);
  transform-origin: 50% 100%;
  animation: floorFlicker 3.7s ease-in-out infinite;
}

@keyframes floorFlicker {
  0%, 100% { transform: scaleY(1); }
  23%      { transform: scaleY(1.07); }
  41%      { transform: scaleY(0.96); }
  67%      { transform: scaleY(1.04); }
  82%      { transform: scaleY(0.98); }
}

.smoke {
  position: absolute;
  inset: -700px;
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .1 0 0 0 0 .07 0 0 0 1.8 -.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  background-size: 600px 600px;
  animation: smoke 70s linear infinite;
}

.smoke.s2 {
  opacity: 0.14;
  background-size: 900px 900px;
  animation: smoke2 110s linear infinite;
}

@keyframes smoke  { to { transform: translate3d(-600px, -600px, 0); } }
@keyframes smoke2 { to { transform: translate3d(900px, -900px, 0); } }

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.8) 100%);
}

.inscriptions {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease 0.7s;
}

.quote {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: min(290px, 44vw);
  margin: 0;
  transition: opacity 1.2s ease, filter 1.2s ease;
}

.quote.out {
  opacity: 0;
  filter: blur(6px);
}

.quote:empty { display: none; }

.q-la {
  font-family: var(--caps);
  font-size: 11px;
  line-height: 1.95;
  letter-spacing: 0.3em;
  color: color-mix(in srgb, var(--gold) 58%, transparent);
  animation: candlelight 6s ease-in-out var(--flicker, 0s) infinite;
}

.q-en {
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.03em;
  color: color-mix(in srgb, var(--bone) 36%, transparent);
}

.non-serviam {
  position: absolute;
  left: 50%;
  top: 46%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 1.2s ease;
}

.ns-la {
  font-family: var(--caps);
  font-weight: 800;
  font-size: clamp(30px, 8vw, 118px);
  line-height: 0.9;
  letter-spacing: 0.08em;
  text-indent: 0.08em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 100, 40, calc(0.25 + var(--pulse) * 0.2));
  transition: color 1s ease, text-shadow 1s ease;
}

.ns-en {
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: color-mix(in srgb, var(--bone) 34%, transparent);
  transition: color 1s ease;
}

.sigil-bg {
  position: absolute;
  left: 50%;
  top: 46%;
  height: min(72vh, 104vw);
  aspect-ratio: 95.4 / 131;
  transform: translate(-50%, -50%) translate(var(--px, 0px), var(--py, 0px)) scale(var(--grow, 0.9));
  opacity: 0;
  cursor: var(--cur-hot);
  outline: none;
  transition: opacity 0.5s ease, transform 0.9s cubic-bezier(0.16, 0.9, 0.3, 1);
}

body.is-landed .sigil-bg { --grow: 1; }

.sigil-pulse {
  width: 100%;
  height: 100%;
  opacity: calc(0.78 + var(--pulse) * 0.22);
  filter:
    drop-shadow(0 0 3px rgba(255, 90, 30, 0.9))
    drop-shadow(0 0 calc(14px + var(--pulse) * 26px) rgba(220, 30, 10, 0.7));
  transition: filter 0.4s ease;
}

.sigil-pulse svg { width: 100%; height: 100%; overflow: visible; }

.sigil-pulse .s {
  stroke: #d42a12;
  stroke-width: 1.7;
  transition: stroke 0.4s ease;
}

.sigil-bg:hover .sigil-pulse,
.sigil-bg:focus-visible .sigil-pulse {
  filter:
    drop-shadow(0 0 4px rgba(255, 150, 70, 1))
    drop-shadow(0 0 44px rgba(255, 50, 15, 0.9));
}

.sigil-bg:hover .sigil-pulse .s,
.sigil-bg:focus-visible .sigil-pulse .s { stroke: #ff5a2a; }

.sigil-bg .draw { --dur: 0.9s; --step: 0.16s; }

#fxBack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 18px); filter: blur(6px); }
  to   { opacity: 1; transform: translate(-50%, 0); filter: none; }
}

@keyframes candlelight {
  0%, 100% { opacity: 1; }
  31%      { opacity: 0.9; }
  33%      { opacity: 1; }
  62%      { opacity: 0.94; }
  64%      { opacity: 1; }
}

.socials {
  position: absolute;
  left: 50%;
  bottom: max(22px, 5vh);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: auto;
}

body.is-landed .socials { animation: rise 0.6s cubic-bezier(0.16, 0.9, 0.3, 1) 0.35s both; }

.social {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px 9px 12px;
  font-family: var(--caps);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: color-mix(in srgb, var(--bone) 85%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 24%, transparent);
  background: rgba(40, 10, 8, 0.45);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.social:hover {
  color: var(--gold-hi);
  border-color: color-mix(in srgb, var(--gold) 70%, transparent);
  background: rgba(110, 20, 10, 0.35);
}

.social .ico {
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

#fxFront {
  position: fixed;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
}

.slam {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 7;
  pointer-events: none;
  font-family: var(--caps);
  font-weight: 800;
  font-size: clamp(56px, 15vw, 210px);
  line-height: 0.88;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
  color: #ffcf8a;
  text-shadow: 0 0 40px rgba(255, 80, 20, 0.75), 0 0 4px #fff2d6;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.slam.go { animation: slam 1.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@keyframes slam {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(1.9); filter: blur(14px); }
  14%  { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; }
  62%  { opacity: 1; transform: translate(-50%, -50%) scale(0.97); filter: none; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); filter: blur(5px); }
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 9;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g' x='0' y='0' width='1' height='1'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  animation: grain 0.8s steps(4) infinite;
}

@keyframes grain {
  0%   { transform: translate3d(0, 0, 0); }
  25%  { transform: translate3d(-3%, 2%, 0); }
  50%  { transform: translate3d(2%, -3%, 0); }
  75%  { transform: translate3d(-2%, -1%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.heaven {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background: #fbf6ea;
  cursor: var(--cur-hot);
  transition: opacity 0.8s ease;
}

#fxHeaven {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rays {
  position: absolute;
  inset: -25% -25% 0;
  pointer-events: none;
  opacity: 0.75;
  background: repeating-conic-gradient(from 0deg at 50% 0%,
    rgba(255, 238, 196, 0) 0deg 3deg,
    rgba(255, 238, 196, 0.55) 5deg,
    rgba(255, 238, 196, 0) 7deg 11deg);
  -webkit-mask: radial-gradient(75% 85% at 50% 0%, #000 0%, transparent 78%);
  mask: radial-gradient(75% 85% at 50% 0%, #000 0%, transparent 78%);
  transform-origin: 50% 0;
  animation: raysSway 16s ease-in-out infinite alternate;
  transition: opacity 0.9s ease;
}

@keyframes raysSway {
  from { transform: rotate(-4deg); }
  to   { transform: rotate(4deg); }
}

.gate {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.gate > * { animation: gateIn 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.gate > :nth-child(2) { animation-delay: 0.25s; }
.gate > :nth-child(3) { animation-delay: 0.4s; }
.gate > :nth-child(4) { animation-delay: 0.6s; }
.gate > :nth-child(5) { animation-delay: 0.75s; }

@keyframes gateIn {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.star {
  position: relative;
  display: block;
  width: 124px;
  height: 124px;
  will-change: transform;
}

.star:focus-visible {
  outline: 1px dashed rgba(150, 110, 40, 0.55);
  outline-offset: 22px;
  border-radius: 50%;
}

.star::before {
  content: "";
  position: absolute;
  inset: -70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 214, 0.95) 0%, rgba(255, 214, 130, 0.42) 22%, rgba(255, 200, 110, 0) 62%);
  animation: starPulse 3.2s ease-in-out infinite;
  transition: background 2s ease;
}

.st {
  position: absolute;
  inset: 0;
  animation: twinkle 7s ease-in-out infinite;
}

.st svg { width: 100%; height: 100%; overflow: visible; }
.st-gold { filter: drop-shadow(0 0 6px #ffd27a) drop-shadow(0 0 20px #e2a647); }
.st-gold path { fill: #fffaf0; }

.st-hot {
  opacity: 0;
  filter: drop-shadow(0 0 8px #ff7a2a) drop-shadow(0 0 30px #ff2a10);
}

.st-hot path { fill: #fff0dc; }

@keyframes starPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.12); opacity: 1; }
}

@keyframes twinkle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50%      { transform: rotate(8deg) scale(0.94); }
}

body.is-falling .heaven { cursor: var(--cur); }
body.is-falling .rays { opacity: 0; }

body.is-falling .st { animation-duration: 0.9s; }

body.is-falling .star::before {
  background: radial-gradient(circle, rgba(255, 236, 200, 0.95) 0%, rgba(255, 120, 40, 0.5) 24%, rgba(255, 60, 20, 0) 64%);
}

body.is-landed .heaven {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease 0.18s;
}

body.is-landed .stage { opacity: 1; }
body.is-landed .sigil-bg { opacity: 1; }
body.is-landed .inscriptions { opacity: 1; }

body.shake .hell,
body.shake .stage { animation: shake 0.65s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

@keyframes shake {
  10%, 90% { transform: translate(-2px, 1px); }
  20%, 80% { transform: translate(4px, -3px); }
  30%, 50%, 70% { transform: translate(-7px, 4px); }
  40%, 60% { transform: translate(7px, -4px); }
}

.candle {
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 12;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.6s ease 0.6s, transform 0.6s ease 0.6s;
}

body.is-landed .candle {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.np {
  padding-bottom: 3px;
  font-family: var(--caps);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  white-space: nowrap;
  color: color-mix(in srgb, var(--gold) 60%, transparent);
  transition: color 0.3s, opacity 0.3s;
}

.np::before { content: "\266A  "; }

.candle:hover .np { color: var(--gold-hi); }
.candle.muted .np { opacity: 0.4; text-decoration: line-through; }

.candle-art {
  position: relative;
  width: 16px;
  height: 54px;
}

.candle-art i { position: absolute; display: block; }

.wax {
  left: 2px;
  right: 2px;
  bottom: 0;
  height: 30px;
  border-radius: 2px 2px 3px 3px;
  background: linear-gradient(90deg, #b9aa8c, #efe6d2 40%, #a8977a);
}

.wax::after {
  content: "";
  position: absolute;
  left: 2px;
  top: -1px;
  width: 4px;
  height: 11px;
  border-radius: 0 0 3px 3px;
  background: #e6dcc6;
}

.wick {
  left: 50%;
  bottom: 30px;
  width: 1.5px;
  height: 5px;
  margin-left: -0.75px;
  background: #2a1a10;
}

.flame {
  left: 50%;
  bottom: 33px;
  width: 10px;
  height: 18px;
  margin-left: -5px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 78%, #fff 0%, #ffe39a 26%, #ff9a2a 56%, rgba(255, 60, 10, 0) 76%);
  transform-origin: 50% 90%;
  animation: flame 1.3s ease-in-out infinite alternate;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.glow {
  left: 50%;
  bottom: 26px;
  width: 64px;
  height: 64px;
  margin-left: -32px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 150, 50, 0.35), transparent 65%);
  animation: flameGlow 2.1s ease-in-out infinite;
  transition: opacity 0.3s ease;
}

@keyframes flame {
  0%   { transform: rotate(-3deg) scaleY(1); }
  40%  { transform: rotate(2deg) scaleY(1.08); }
  70%  { transform: rotate(-1deg) scaleY(0.94); }
  100% { transform: rotate(3deg) scaleY(1.04); }
}

@keyframes flameGlow {
  0%, 100% { opacity: 0.8; }
  50%      { opacity: 1; }
}

.wisp {
  left: 50%;
  bottom: 35px;
  width: 2px;
  height: 18px;
  margin-left: -1px;
  border-radius: 2px;
  background: linear-gradient(0deg, rgba(200, 190, 180, 0.6), transparent);
  filter: blur(1px);
  opacity: 0;
}

.candle.muted .flame { transform: scale(0); opacity: 0; }
.candle.muted .glow { opacity: 0; }
.candle.muted .wisp { animation: wisp 1.8s ease-out; }

@keyframes wisp {
  0%   { opacity: 0.9; transform: translateY(0) scaleX(1); }
  100% { opacity: 0; transform: translateY(-26px) scaleX(3) skewX(20deg); }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  padding: 10px 18px;
  font-family: var(--caps);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold-hi);
  background: rgba(14, 4, 4, 0.94);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  box-shadow: 0 0 30px rgba(255, 60, 20, 0.25);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.inferno {
  --gold: #ff4a24;
  --gold-hi: #ffc29a;
  --gold-lo: #7a1208;
}

body.inferno .hell-sky { filter: saturate(1.7) brightness(1.5); }
body.inferno .hell-floor { opacity: calc(0.9 + var(--pulse) * 0.6); }
body.inferno .sigil-pulse .s { stroke: #ff3b1f; }
body.inferno .sigil-pulse { opacity: calc(0.4 + var(--pulse) * 0.5); }

body.inferno .non-serviam { opacity: 1; }

body.inferno .ns-la {
  color: rgba(255, 70, 30, 0.85);
  -webkit-text-stroke: 1px #ffb38a;
  text-shadow: 0 0 calc(18px + var(--pulse) * 30px) rgba(255, 60, 20, 0.6);
}

body.inferno .ns-en { color: color-mix(in srgb, var(--bone) 75%, transparent); }
body.inferno .q-la { color: color-mix(in srgb, var(--gold) 85%, transparent); }
body.inferno .q-en { color: color-mix(in srgb, var(--bone) 60%, transparent); }

html.flicker { animation: hellFlash 0.5s steps(1) 1; }

@keyframes hellFlash {
  0%   { filter: invert(1) hue-rotate(180deg); }
  20%  { filter: none; }
  40%  { filter: saturate(3) brightness(1.6) hue-rotate(-20deg); }
  60%  { filter: none; }
  80%  { filter: invert(1) hue-rotate(180deg); }
  100% { filter: none; }
}

@media (max-width: 760px) {
  .quote { max-width: min(250px, 70vw); }
  .q-la { font-size: 10px; letter-spacing: 0.24em; line-height: 1.8; }
  .q-en { font-size: 13px; }
}

@media (max-width: 520px) {
  .np { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .smoke, .grain, .rays, .st, .star::before, .hell-floor, .q-la { animation: none; }
  body.shake .hell, body.shake .stage { animation: none; }
}
