/* The browser MMORPG. One screen: a dark temple lit by one pixel flame.
   The game's own interface rule: pixel-crisp inside the world, a quiet serif for the sacred moments. */

@font-face {
  font-family: "EBG World";
  src: url("/assets/worlds/fonts/eb-garamond-latin-wght.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EBG World";
  src: url("/assets/worlds/fonts/eb-garamond-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  /* The game's own tokens (its palette, light model and UI page). */
  --night: #120d1c;
  --gold: #f7b737;
  --gold-pale: #fff1de;
  --ember: #ffb860;
  --parchment: #f0e3d2;
  --text: #ddd1c3;
  --mist: #a6a5b6;
  --hair: rgba(240, 227, 210, 0.12);

  --serif: "EBG World", "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;
  --gut: clamp(20px, 5.6vw, 88px);
  --max: 1160px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --px: 4px; /* one pixel of the game's art, always a whole number of screen pixels */
}
@media (min-height: 980px) and (min-width: 900px) { :root { --px: 5px; } }
@media (max-height: 760px), (max-width: 600px) { :root { --px: 3px; } }

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 400 20px/1.62 var(--serif);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
::selection { background: rgba(247, 183, 55, 0.32); color: #fff; }
img, svg { display: block; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 400; color: var(--gold-pale); text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 2px; }

/* The redaction: a solid plate where the name would be, with the stepped corners of the game's pixels. */
.r {
  --s: max(2px, 0.1em);
  display: inline-block;
  height: 0.78em;
  line-height: 0.78em;
  vertical-align: -0.06em;
  overflow: hidden;
  color: transparent;
  background: var(--parchment);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  clip-path: polygon(0 var(--s), var(--s) var(--s), var(--s) 0, calc(100% - var(--s)) 0, calc(100% - var(--s)) var(--s), 100% var(--s),
    100% calc(100% - var(--s)), calc(100% - var(--s)) calc(100% - var(--s)), calc(100% - var(--s)) 100%, var(--s) 100%,
    var(--s) calc(100% - var(--s)), 0 calc(100% - var(--s)));
}

/* Top bar */
.bar {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px max(var(--gut), calc((100% - var(--max)) / 2)) 0;
  color: var(--mist);
  font-size: 18px;
}
.bar__name { font-size: 19px; line-height: 1; }
.world-exit { justify-self: start; gap: 2px; transition: color 160ms ease; }
.world-lang {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 44px;
  min-height: 44px;
  letter-spacing: 0.04em;
  transition: color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .world-exit:hover, .world-lang:hover { color: var(--gold-pale); }
}

/* The temple: the one screen */
.temple {
  position: relative;
  z-index: 1;
  isolation: isolate;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 84px var(--gut) clamp(56px, 9vh, 96px);
  text-align: center;
}
.temple__h1 {
  max-width: 14em;
  font-size: clamp(40px, min(5vw, 7.4vh), 68px);
  line-height: 1.04;
  letter-spacing: -0.014em;
  /* lit from below, by the flame */
  background: linear-gradient(180deg, #e4d8d6 8%, #fff1de 55%, #ffd9a3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  padding-bottom: 0.08em;
}
.lede {
  max-width: 24em;
  margin-top: clamp(16px, 2.4vh, 24px);
  color: var(--text);
  font-size: clamp(20px, 1.55vw, 22px);
  line-height: 1.5;
  text-wrap: balance;
}
.lede .r { margin-right: 0.06em; }
.nw { white-space: nowrap; }
.actions { margin-top: calc(var(--px) * 11 + clamp(28px, 4.5vh, 44px)); }
.note { margin-top: 14px; color: var(--mist); font-size: 17px; font-style: italic; }

.btn {
  --s: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 1px 28px 0;
  color: var(--night);
  background: var(--gold-pale);
  font: 500 19px/1 var(--serif);
  letter-spacing: 0.01em;
  text-decoration: none;
  clip-path: polygon(0 var(--s), var(--s) var(--s), var(--s) 0, calc(100% - var(--s)) 0, calc(100% - var(--s)) var(--s), 100% var(--s),
    100% calc(100% - var(--s)), calc(100% - var(--s)) calc(100% - var(--s)), calc(100% - var(--s)) 100%, var(--s) 100%,
    var(--s) calc(100% - var(--s)), 0 calc(100% - var(--s)));
  transition: background-color 180ms ease, transform 140ms var(--ease);
}
.btn:active { transform: scale(0.98); }
/* the outline would be cut by the stepped corners, so focus draws inside */
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--night), inset 0 0 0 4px var(--gold); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--gold); } }

/* The altar. Every size is a whole number of the art's pixels. */
.altar {
  position: relative;
  z-index: -1;
  flex: none;
  width: calc(var(--px) * 32);
  height: calc(var(--px) * 48);
  margin-top: clamp(26px, 4.5vh, 52px);
  animation: kindle 1700ms cubic-bezier(0.33, 0, 0.2, 1) 200ms both;
}
html.is-arriving .altar { animation-delay: 760ms; }
@keyframes kindle { from { opacity: 0; } }
.altar__sprite { position: absolute; inset: 0; overflow: hidden; }
.altar__sprite img {
  width: calc(var(--px) * 128);
  height: calc(var(--px) * 48);
  max-width: none;
  image-rendering: pixelated;
  animation: burn 572ms steps(4) infinite;
}
@keyframes burn { to { transform: translateX(-100%); } }
.altar__pool {
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: calc(var(--px) * -11);
  width: calc(var(--px) * 112);
  height: calc(var(--px) * 26);
  max-width: none;
  transform: translateX(-50%);
  image-rendering: pixelated;
  animation: pool 3400ms ease-in-out infinite alternate;
}
@keyframes pool { from { opacity: 0.78; } to { opacity: 1; } }
/* the light of the flame, at two scales, as the game draws it: a tight core and a wide veil */
.altar__veil, .altar__core {
  position: absolute;
  z-index: -2;
  left: 50%;
  top: calc(var(--px) * 15);
  border-radius: 50%;
  pointer-events: none;
}
.altar__veil {
  width: min(1100px, 170vw);
  height: min(900px, 120vh);
  background: radial-gradient(closest-side, rgba(255, 184, 96, 0.17), rgba(255, 184, 96, 0.07) 42%, rgba(255, 184, 96, 0.02) 70%, transparent);
  transform: translate(-50%, -50%);
  animation: breathe 3600ms ease-in-out infinite alternate;
}
.altar__core {
  width: calc(var(--px) * 60);
  height: calc(var(--px) * 70);
  background: radial-gradient(closest-side, rgba(255, 223, 160, 0.42), rgba(247, 183, 55, 0.14) 52%, transparent);
  transform: translate(-50%, -50%);
  animation: breathe 2300ms ease-in-out infinite alternate-reverse;
}
@keyframes breathe {
  from { transform: translate(-50%, -50%) scale(0.95); opacity: 0.8; }
  to { transform: translate(-50%, -50%) scale(1.04); opacity: 1; }
}
.temple.is-off .altar, .temple.is-off .altar * { animation-play-state: paused; }

/* Three short questions, under the fold */
.faq {
  position: relative;
  z-index: 1;
  width: min(100%, calc(var(--max) + 2 * var(--gut)));
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) var(--gut) clamp(56px, 7vw, 96px);
}
.faq__h2 { color: var(--mist); font-size: 19px; font-style: italic; line-height: 1.4; }
.faq__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(28px, 4.6vw, 72px); margin-top: 22px; }
.qa { padding-top: 18px; border-top: 1px solid var(--hair); }
.qa h3 { font-size: 21px; line-height: 1.25; }
.qa p { margin-top: 8px; color: var(--text); font-size: 18px; line-height: 1.5; text-wrap: pretty; }

/* Colophon */
.world-colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding: 26px max(var(--gut), calc((100% - var(--max)) / 2)) 34px;
  border-top: 1px solid var(--hair);
  color: var(--mist);
  font-size: 16px;
}
.world-colophon a { text-underline-offset: 3px; text-decoration-color: rgba(240, 227, 210, 0.3); }
@media (hover: hover) and (pointer: fine) { .world-colophon a:hover { color: var(--gold-pale); } }

/* Narrow screens */
@media (max-width: 900px) {
  .faq__list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 19px; }
  .bar { padding-top: 6px; font-size: 17px; }
  .temple__h1 { font-size: clamp(38px, 10.4vw, 46px); }
}

@media (prefers-reduced-motion: reduce) {
  .altar, .altar__sprite img, .altar__pool, .altar__veil, .altar__core { animation: none; }
  .btn, .btn:active { transition: none; transform: none; }
}
