/* Void Lepus. Colours of the Lumenweld splash: its background and the engine's masked title (MaskedTitleStyle). */

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #03000a;          /* splash background (3, 0, 10) */
  --core: #070012;        /* Core: the fill of the shapes */
  --primary: #b54cff;     /* Primary: outline and first grid */
  --highlight: #eeb9ff;   /* Highlight: inner outline */
  --warm: #ff4fdd;        /* Warm: second grid and echo */
  --tint: #d0c8e8;        /* LogoTint */
  --text-soft: rgba(208, 200, 232, .78);
  --text-dim: rgba(208, 200, 232, .62);
  --small: clamp(.75rem, .66rem + .3vw, .875rem);  /* labels, never under 12 px */
  --games-top: clamp(3.5rem, 9vh, 6rem);           /* space above the games heading */
  color-scheme: dark;
}

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

html {
  background: var(--bg);
  color: var(--tint);
  font: 400 100%/1.6 "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

img,
canvas {
  display: block;
}

::selection {
  background: rgba(181, 76, 255, .45);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Hero: the splash. The logo is 29.9% of the window's height there (0.46 x 0.65) and the name sits under it;
   1 reference unit (--u) is 1 px of the splash at 1920x1080. */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 2rem 1rem 0;
}

/* As tall as the thread under the block, so the block stays in the middle of the screen. */
.hero::before {
  content: "";
  flex: 1 1 0;
  min-height: 1.5rem;
}

.hero-block {
  --u: calc(min(max(120px, 29.9vh), 340px, 50vw) / 322.92);
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

@supports (height: 1svh) {
  .hero-block {
    --u: calc(min(max(120px, 29.9svh), 340px, 50vw) / 322.92);
  }
}

.hero-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1;
}

.hero-art {
  position: relative;
  display: block;
  width: calc(516 * var(--u));
  height: calc(508 * var(--u));
}

.hero-art > svg,
.hero-art > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* With scripts, the animated version takes the place of the static one. The static one still appears on its own
   if the script never runs, and fades in like the splash when WebGL is missing. */
.js .hero-static {
  opacity: 0;
  animation: hero-fade 1s linear 2.5s forwards;
}

.js .hero-static.is-shown {
  animation: hero-fade 1s linear forwards;
}

.js.hero-gl .hero-static {
  display: none;
}

@keyframes hero-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tagline {
  margin: calc(-14 * var(--u)) 0 0;
  padding-left: .38em;
  font-size: var(--small);
  letter-spacing: .38em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* The thread: a line from under the studio's name down to the games heading, with a light running along it.
   It fills the rest of the hero and reaches into the top of the games section (--games-top). */
.thread {
  position: relative;
  flex: 1 1 0;
  width: 2.5rem;
  min-height: 5rem;
  margin-top: 1.75rem;
}

.thread::before,
.thread-light {
  content: "";
  position: absolute;
  top: 0;
  bottom: calc(1.1rem - var(--games-top));
  left: 50%;
}

.thread::before {
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: linear-gradient(rgba(181, 76, 255, 0), rgba(181, 76, 255, .55) 3.5rem, rgba(181, 76, 255, .55) calc(100% - 2rem), rgba(238, 185, 255, .75));
  transition: background-color .25s ease, box-shadow .25s ease;
}

.thread:hover::before,
.thread:focus-visible::before {
  background: linear-gradient(rgba(238, 185, 255, .2), var(--highlight) 2rem, var(--highlight));
  box-shadow: 0 0 10px rgba(181, 76, 255, .9);
}

.thread:focus-visible {
  outline: none;
}

.thread-light {
  width: 9px;
  margin-left: -4.5px;
  overflow: hidden;
  pointer-events: none;
}

.thread-light::before {
  content: "";
  position: absolute;
  top: 0;
  left: 3px;
  width: 3px;
  height: 100%;
  background: linear-gradient(rgba(238, 185, 255, 0), var(--highlight) 2.6rem, rgba(238, 185, 255, 0) 2.8rem) no-repeat 0 0 / 100% 2.8rem;
  filter: drop-shadow(0 0 3px rgba(181, 76, 255, .95));
  transform: translateY(-2.8rem);
  animation: run 3.6s cubic-bezier(.45, 0, .55, 1) 2s infinite;
}

.js .thread {
  animation: fade 1s ease-out 1.3s both;
}

@keyframes run {
  from { transform: translateY(-2.8rem); }
  to { transform: translateY(100%); }
}

/* The games heading pulses when the thread's light reaches it. Same 3.6 s loop and 2 s start as `run`; with that
   ease-in-out curve the head of the light reaches the bottom of the line 74–76% into each run; the pulse peaks a little after (87%), when the eye sees it arrive (measured at 390–1920 px widths against the drawn line, which is longer than the .thread box). */
.games .label {
  animation: arrive 3.6s linear 2s infinite;
}

@keyframes arrive {
  0%, 79% { color: var(--text-dim); text-shadow: none; transform: scale(1); }
  87% { color: var(--highlight); text-shadow: 0 0 10px rgba(181, 76, 255, .85), 0 0 2px rgba(238, 185, 255, .6); transform: scale(1.035); }
  100% { color: var(--text-dim); text-shadow: none; transform: scale(1); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Games */

.games {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--games-top) 1.5rem clamp(3.5rem, 8vh, 5rem);
}

.label {
  margin: 0 0 2.25rem;
  padding-left: .38em;
  font-size: var(--small);
  font-weight: 400;
  letter-spacing: .38em;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* A game: its library capsule (portrait, 2:3) in a frame, 300 px wide, the capsule's size at 1x. The whole frame
   opens the game's website (a link stretched over it); the Steam badge over the image opens Steam. */
.game {
  position: relative;
  width: min(100%, 18.75rem);
  background: var(--core);
  border: 1px solid rgba(181, 76, 255, .3);
  border-radius: 14px;
  box-shadow: -3px 0 0 rgba(181, 76, 255, .1), 3px 0 0 rgba(255, 79, 221, .08), 0 18px 48px rgba(0, 0, 0, .45);
  transition: border-color .25s ease, box-shadow .25s ease;
}

.game:hover,
.game:has(.game-link:focus-visible) {
  border-color: rgba(181, 76, 255, .8);
  box-shadow: -4px 0 0 rgba(181, 76, 255, .28), 4px 0 0 rgba(255, 79, 221, .22), 0 0 32px rgba(181, 76, 255, .18), 0 18px 48px rgba(0, 0, 0, .45);
}

.game:has(.badge:hover) {
  border-color: rgba(181, 76, 255, .3);
  box-shadow: -3px 0 0 rgba(181, 76, 255, .1), 3px 0 0 rgba(255, 79, 221, .08), 0 18px 48px rgba(0, 0, 0, .45);
}

.game-art {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 13px;
  background: #020205;
  transition: filter .25s ease;
}

.game:hover .game-art {
  filter: brightness(1.12) saturate(1.08);
}

.game:has(.badge:hover) .game-art {
  filter: none;
}

.game-link::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 1;
  border-radius: 14px;
}

.game-link:focus-visible {
  outline: none;
}

.game-link:focus-visible::after {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
}

/* Badges are small masked titles: a dark fill, a purple outline, and the drifting grid when pointed at. */
.badge {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .75em 1.25em .75em 1.5em;
  overflow: hidden;
  isolation: isolate;
  border: 1.5px solid rgba(181, 76, 255, .7);
  border-radius: 14px;
  background: var(--core);
  color: var(--highlight);
  font-size: var(--small);
  letter-spacing: .24em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color .25s ease, box-shadow .25s ease, color .25s ease;
}

/* The two grids of the masked title: purple lines rising to the right and drifting right, faint pink lines the
   other way and drifting left. A 17 px tile holds one period of each, so the drift loops without a seam. */
.badge::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    repeating-linear-gradient(-45deg, rgba(181, 76, 255, .34) 0 1.25px, transparent 1.25px 50%),
    repeating-linear-gradient(45deg, rgba(255, 79, 221, .16) 0 1.1px, transparent 1.1px 50%);
  background-size: 17px 17px;
  opacity: 0;
  transition: opacity .25s ease;
}

.badge:hover,
.badge:focus-visible {
  border-color: var(--primary);
  color: #fff;
  box-shadow: -3px 0 0 rgba(181, 76, 255, .3), 3px 0 0 rgba(255, 79, 221, .24), 0 0 18px rgba(181, 76, 255, .28);
}

.badge:hover::before,
.badge:focus-visible::before {
  opacity: 1;
  animation: drift 1.2s linear infinite;
}

@keyframes drift {
  to { background-position: 17px 0, -17px 0; }
}

/* The Steam badge: a slim pill over the bottom of the image, the icon before the words, on a dark blurred backing
   so that it reads over the art. */
.badge-steam {
  position: absolute;
  left: 50%;
  bottom: clamp(.55rem, 5.5%, 1.1rem);
  gap: .55em;
  padding: .5em .95em .5em .8em;
  border-radius: 999px;
  background: rgba(7, 0, 18, .74);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  letter-spacing: .2em;
  white-space: nowrap;
  transform: translateX(-50%);
}

.badge-icon {
  flex: none;
  width: 1.4em;
  height: 1.4em;
  fill: currentColor;
}

/* Footer */

.footer {
  padding: 1.5rem 1.5rem 2.75rem;
  text-align: center;
  font-size: .78rem;
  letter-spacing: .14em;
  color: var(--text-dim);
}

.footer p {
  margin: 0;
}

/* The page shown for an address that does not exist */

.error-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem 1rem;
  text-align: center;
}

.error-mark {
  width: 7.5rem;
  height: 7.5rem;
  margin-bottom: 2.25rem;
}

.error-title {
  margin: 0;
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  font-weight: 900;
  line-height: 1.2;
  color: var(--tint);
}

.error-text {
  margin: .6rem 0 2.25rem;
  color: var(--text-soft);
}

/* Narrow phones: tighter letter spacing keeps the labels and the badge on one line. */
@media (max-width: 23.75rem) {
  .tagline,
  .label {
    letter-spacing: .24em;
  }

  .tagline,
  .label {
    padding-left: .24em;
  }

  .games {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .badge {
    letter-spacing: .16em;
  }

  .badge-steam {
    padding: .45em .8em .45em .7em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .hero-static,
  .js .hero-static.is-shown,
  .js .thread {
    opacity: 1;
    animation: none;
  }

  .thread-light {
    display: none;
  }

  .games .label {
    animation: none;
  }

  .badge:hover::before,
  .badge:focus-visible::before {
    animation: none;
  }

  .game,
  .game-art,
  .badge {
    transition: none;
  }
}
