/* The studio's site (wildborn.one): one night, the games' own. Phone first (390 x 844), then wider.
   Fonts and pictures are on the site itself (its CSP allows nothing else). */

@font-face {
  font-family: 'Bebas Neue';
  src: url('assets/bebas-neue-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Barlow Semi Condensed';
  src: url('assets/barlow-semi-condensed-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Barlow Semi Condensed';
  src: url('assets/barlow-semi-condensed-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Barlow Semi Condensed';
  src: url('assets/barlow-semi-condensed-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* the night over Val-Morne */
  --night: #14111c;
  --night-2: #1c1827;
  --night-3: #262033;
  --forest: #0f1612;
  --ink: #f4e9d8;
  --ink-2: #c8bdae;
  --ink-3: #8d8397;
  --line: rgba(244, 233, 216, 0.12);
  --line-2: rgba(244, 233, 216, 0.28);
  /* the camp's fire */
  --fire: #ffc34d;
  --fire-deep: #b9781b;
  --fire-ink: #2a1a05;
  --ember: #ff8a3d;
  /* status */
  --live: #7fd67a;
  --test: #ffb547;
  /* the hours of a day (the game's sky) */
  --morning: #9fd4ff;
  --afternoon: #ffd27a;
  --nightfall: #8f8cff;
  --dawn: #ff9fb0;
  --display: 'Bebas Neue', 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --text: 'Barlow Semi Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  /* the walkers' pixel size (2 on a phone, 3 wider) */
  --u: 2;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  text-wrap: balance;
}

p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--fire);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--fire);
  color: var(--fire-ink);
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
}

.skip:focus {
  top: calc(env(safe-area-inset-top, 0px) + 10px);
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  border: 0;
  font: 700 1.05rem/1 var(--text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.btn-fire {
  background: var(--fire);
  color: var(--fire-ink);
  box-shadow:
    0 4px 0 var(--fire-deep),
    0 12px 32px rgba(255, 170, 60, 0.28);
}

.btn-fire:hover {
  background: #ffcf6e;
}

.btn-fire:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 var(--fire-deep),
    0 6px 18px rgba(255, 170, 60, 0.22);
}

.btn-ghost {
  background: rgba(20, 17, 28, 0.45);
  color: var(--ink);
  border: 1.5px solid var(--line-2);
}

.btn-ghost:hover {
  border-color: var(--ink-2);
  background: rgba(38, 32, 51, 0.7);
}

.btn-ghost:active {
  transform: translateY(2px);
}

.btn-small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.92rem;
  border-radius: 10px;
}

.btn-small.btn-fire {
  box-shadow: 0 3px 0 var(--fire-deep);
}

/* ---------- header ---------- */

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  transition:
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

.top.solid {
  background: rgba(20, 17, 28, 0.92);
  box-shadow: 0 1px 0 var(--line);
}

@supports (backdrop-filter: blur(8px)) {
  .top.solid {
    background: rgba(20, 17, 28, 0.78);
    backdrop-filter: blur(10px);
  }
}

.top-in {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  height: 64px;
  margin: 0 auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

.brand-name {
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: 0.04em;
  padding-top: 3px;
}

.brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 3px 7px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
}

.nav {
  display: none;
  gap: 26px;
  margin-left: 12px;
}

.nav a {
  position: relative;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink-2);
  padding: 6px 0;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--fire);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav a:hover {
  color: var(--ink);
}

.nav a:hover::after {
  transform: scaleX(1);
}

.top-end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.lang {
  min-width: 44px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1.5px solid var(--line-2);
  background: rgba(20, 17, 28, 0.45);
  color: var(--ink);
  font: 700 0.9rem/1 var(--text);
  letter-spacing: 0.08em;
  cursor: pointer;
}

.lang:hover {
  border-color: var(--ink-2);
}

/* ---------- hero: the spotlight (Wildborn first, the studio's other games from the strip) ---------- */

/* on a phone the picture on top, at its own size (one picture pixel, one screen point: crisp), the
   camp and the first of the dead in view; the text under it */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero-art {
  position: relative;
  height: 400px;
  overflow: hidden;
  /* the page scrolls faster than the picture (main.js) */
  transform: translate3d(0, var(--sy, 0px), 0);
}

/* the scenes, one over the other (a margin all round for the pointer's parallax); the chosen one shows */
.scene {
  position: absolute;
  inset: -16px;
  opacity: 0;
  visibility: hidden;
  background: var(--night);
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition:
    opacity 0.6s ease,
    visibility 0s linear 0.6s;
  --s: 1;
}

.scene.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease;
}

.scene img {
  width: 100%;
  height: 100%;
  max-width: none;
  image-rendering: pixelated;
}

.scene-wildborn img {
  object-fit: none;
  object-position: 52% 42%;
  transition: filter 3s ease;
}

.scene-careville img {
  object-fit: cover;
  object-position: 50% 40%;
  image-rendering: auto;
}

/* the next game: a screen not yet switched on */
.scene-next {
  background: radial-gradient(ellipse 70% 80% at 60% 45%, #2a2442 0, var(--night) 70%);
}

.next-noise {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background:
    repeating-linear-gradient(0deg, rgba(244, 233, 216, 0.05) 0 1px, rgba(0, 0, 0, 0) 1px 3px),
    repeating-linear-gradient(90deg, rgba(143, 140, 255, 0.04) 0 2px, rgba(0, 0, 0, 0) 2px 5px);
  animation: noise 0.5s steps(3) infinite;
}

@keyframes noise {
  33% {
    background-position:
      0 1px,
      2px 0;
  }
  66% {
    background-position:
      0 2px,
      1px 0;
  }
}

.next-big {
  position: absolute;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--display);
  font-size: clamp(14rem, 60vw, 34rem);
  line-height: 1;
  color: rgba(244, 233, 216, 0.07);
}

/* changing channel: a burst of static between two games */
.static {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.09) 0 1px, rgba(0, 0, 0, 0) 1px 3px),
    linear-gradient(rgba(143, 140, 255, 0.12), rgba(255, 195, 77, 0.08));
}

.hero-art.switching .static {
  animation: static 0.42s steps(4) both;
}

@keyframes static {
  0% {
    opacity: 0.95;
    background-position: 0 0;
  }
  50% {
    opacity: 0.6;
    background-position: 0 5px;
  }
  100% {
    opacity: 0;
    background-position: 0 2px;
  }
}

/* under the header at the top, into the page at the bottom */
.hero-art::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(20, 17, 28, 0.7) 0,
    rgba(20, 17, 28, 0) 24%,
    rgba(20, 17, 28, 0) 58%,
    rgba(20, 17, 28, 0.75) 80%,
    var(--night) 100%
  );
}

/* dusk, night, dawn: the hours pass while you read (main.js, a game minute a second) */
.tint,
.tint::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 3s ease;
}

.tint {
  mix-blend-mode: soft-light;
  background: linear-gradient(to bottom, rgba(255, 150, 90, 0.75), rgba(200, 90, 150, 0.45) 55%, rgba(60, 40, 110, 0.2));
}

.tint::after {
  content: '';
  opacity: 0;
  background: linear-gradient(to bottom, rgba(255, 190, 200, 0.7), rgba(255, 210, 130, 0.45) 60%, rgba(255, 230, 180, 0.2));
}

.hero.night .tint {
  opacity: 0;
}

.hero.night .scene-wildborn img {
  filter: brightness(0.86) saturate(1.06);
}

.hero.dawn .tint {
  opacity: 1;
  background: none;
}

.hero.dawn .tint::after {
  opacity: 1;
}

/* lights and life laid on the picture's own fire, lantern and eyes (main.js places them) */
.scene [data-at] {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.scene.placed [data-at] {
  visibility: visible;
}

.glow {
  border-radius: 50%;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}

.glow.fire {
  width: calc(260px * var(--s));
  height: calc(260px * var(--s));
  background: radial-gradient(circle, rgba(255, 196, 96, 0.42) 0, rgba(255, 140, 50, 0.14) 38%, rgba(255, 120, 40, 0) 68%);
  animation: flicker 2.8s steps(1) infinite;
}

.glow.lamp {
  width: calc(120px * var(--s));
  height: calc(120px * var(--s));
  background: radial-gradient(circle, rgba(255, 200, 120, 0.32) 0, rgba(255, 160, 70, 0) 66%);
  animation: flicker 3.4s steps(1) infinite reverse;
}

@keyframes flicker {
  0% {
    opacity: 0.85;
  }
  12% {
    opacity: 1;
  }
  24% {
    opacity: 0.78;
  }
  37% {
    opacity: 0.95;
  }
  51% {
    opacity: 0.82;
  }
  63% {
    opacity: 1;
  }
  78% {
    opacity: 0.88;
  }
  90% {
    opacity: 0.96;
  }
}

.embers,
.final-fire {
  width: 0;
  height: 0;
}

.ember {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(2px * var(--s, 1));
  height: calc(2px * var(--s, 1));
  min-width: 2px;
  min-height: 2px;
  background: #ffd27a;
  box-shadow: 0 0 6px 1px rgba(255, 150, 60, 0.85);
  opacity: 0;
  animation: rise var(--d, 3s) linear var(--delay, 0s) infinite;
}

@keyframes rise {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  70% {
    opacity: 0.8;
  }
  100% {
    transform: translate(calc(var(--dx, 10px) * var(--s, 1)), calc(var(--up, -150px) * var(--s, 1)));
    opacity: 0;
  }
}

/* the eyes in the woods: shut until night falls */
.eye {
  width: calc(18px * var(--s));
  height: calc(18px * var(--s));
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 70, 50, 0.95) 0, rgba(255, 40, 30, 0.35) 32%, rgba(255, 30, 20, 0) 70%);
  mix-blend-mode: screen;
  opacity: 0;
  animation: eye 6s ease-in-out infinite paused;
}

.hero.night .eye {
  animation-play-state: running;
}

@keyframes eye {
  0%,
  100% {
    opacity: 0;
  }
  18%,
  46% {
    opacity: 1;
  }
  50% {
    opacity: 0.1;
  }
  54%,
  70% {
    opacity: 0.9;
  }
}

.fog {
  position: absolute;
  left: -50%;
  width: 200%;
  height: 46%;
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 3s ease;
  background:
    radial-gradient(ellipse 30% 40% at 25% 55%, rgba(176, 186, 228, 0.13), rgba(176, 186, 228, 0) 70%),
    radial-gradient(ellipse 26% 34% at 62% 45%, rgba(176, 186, 228, 0.1), rgba(176, 186, 228, 0) 70%),
    radial-gradient(ellipse 22% 30% at 88% 60%, rgba(176, 186, 228, 0.09), rgba(176, 186, 228, 0) 70%);
}

.hero.night .fog {
  opacity: 1;
}

.fog-a {
  top: 28%;
  animation: drift 46s linear infinite alternate;
}

.fog-b {
  top: 46%;
  animation: drift 64s linear infinite alternate-reverse;
}

@keyframes drift {
  from {
    transform: translateX(-12%);
  }
  to {
    transform: translateX(12%);
  }
}

.hero-text {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1200px;
  margin: -78px auto 0;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-block: 0 30px;
}

.feature {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.feature.enter {
  animation: enter 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fire);
}

.kicker-test {
  color: var(--test);
}

.kicker-next {
  color: var(--nightfall);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 195, 77, 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px rgba(255, 195, 77, 0);
  }
}

.clock-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.clock {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  color: var(--ink-2);
}

.clock-time {
  font-family: var(--display);
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: 0.06em;
  padding-top: 2px;
  color: var(--afternoon);
  font-variant-numeric: tabular-nums;
  transition: color 2s ease;
}

.hero.night .clock-time {
  color: var(--nightfall);
}

.hero.dawn .clock-time {
  color: var(--dawn);
}

/* a crescent: the disc, eaten by its own shadow */
.moon {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset -5px -2px 0 0 #f6e7b8;
  transform: rotate(-20deg);
}

.listen {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(20, 17, 28, 0.55);
  color: var(--ink-2);
  font: 600 0.9rem/1 var(--text);
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.listen:hover {
  color: var(--ink);
  border-color: var(--ink-2);
}

.listen .snd-on,
.listen[aria-pressed='true'] .snd-off {
  display: none;
}

.listen[aria-pressed='true'] .snd-on {
  display: block;
  animation: live 1.2s ease-in-out infinite;
}

.listen[aria-pressed='true'] {
  color: var(--fire);
  border-color: rgba(255, 195, 77, 0.5);
}

.hero .title {
  font-size: clamp(4rem, 19vw, 8.5rem);
  line-height: 0.84;
  letter-spacing: 0.01em;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  margin-top: 2px;
}

.title-sub {
  display: block;
  font-size: 0.4em;
  letter-spacing: 0.34em;
  color: var(--fire);
  margin-top: 0.18em;
}

#f-careville .title-sub {
  color: var(--test);
}

#f-next .title-sub {
  color: var(--nightfall);
}

.pitch {
  max-width: 34rem;
  font-size: 1.14rem;
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero .actions {
  margin-top: 6px;
  width: 100%;
}

.hero .actions .btn {
  flex: 1 1 200px;
}

.pulse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--live);
  animation: live 1.8s ease-in-out infinite;
}

@keyframes live {
  50% {
    opacity: 0.35;
  }
}

.pulse-mark strong {
  color: var(--fire);
}

.pulse-mark span[aria-hidden] {
  color: var(--fire);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: 4px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(20, 17, 28, 0.5);
}

/* the strip of the studio's games, under the spotlight */
.spot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.spot-tab {
  display: grid;
  gap: 3px;
  align-content: start;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.spot-tab img,
.spot-q {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--line);
  opacity: 0.62;
  margin-bottom: 4px;
  transition:
    opacity 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.spot-tab img {
  image-rendering: pixelated;
}

.spot-q {
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(0deg, rgba(244, 233, 216, 0.04) 0 1px, rgba(0, 0, 0, 0) 1px 3px),
    var(--night-3);
  font-family: var(--display);
  font-size: 2.2rem;
  color: var(--ink-3);
}

.spot-tab:hover img,
.spot-tab:hover .spot-q {
  opacity: 0.9;
  transform: translateY(-2px);
}

.spot-tab[aria-selected='true'] {
  color: var(--ink);
}

.spot-tab[aria-selected='true'] img,
.spot-tab[aria-selected='true'] .spot-q {
  opacity: 1;
  border-color: var(--fire);
  box-shadow: 0 6px 20px rgba(255, 170, 60, 0.18);
}

.spot-name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spot-state {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.state-live {
  color: var(--live);
}

.state-test {
  color: var(--test);
}

.state-next {
  color: var(--ink-3);
}

/* ---------- the road: the survivor runs, the dead follow ---------- */

.road {
  position: relative;
  height: calc(32px * var(--u) + 18px);
  overflow: hidden;
  /* a trail at night: packed earth, a few stones */
  background:
    radial-gradient(circle at 18% 74%, rgba(244, 233, 216, 0.09) 0 1.5px, rgba(0, 0, 0, 0) 2.5px) 0 0 / 46px 100%,
    radial-gradient(circle at 64% 88%, rgba(244, 233, 216, 0.07) 0 1px, rgba(0, 0, 0, 0) 2px) 0 0 / 71px 100%,
    linear-gradient(to bottom, var(--night) 0, #1e1926 46%, #241e2c 100%);
  border-bottom: 1px solid var(--line);
}

.walker {
  position: absolute;
  left: 0;
  bottom: 8px;
  animation: cross 20s linear infinite backwards;
}

/* their shadow on the road */
.walker::after {
  content: '';
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -3px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  z-index: -1;
}

.w1 {
  animation-delay: 1.1s;
}
.w2 {
  animation-delay: 2.3s;
}
.w3 {
  animation-delay: 3.1s;
}
.w4 {
  animation-delay: 4s;
}
.w5 {
  animation-delay: 4.9s;
}

/* across in 70 % of the turn, then the road stays empty until the last one is gone */
@keyframes cross {
  0% {
    transform: translateX(calc(-16px * var(--u) - 10px));
  }
  70%,
  100% {
    transform: translateX(calc(100vw + 10px));
  }
}

/* walkers.png: 8 frames of 16 x 32 a row (stand, walk x6, act), one row each: survivor, zombie,
   runner, brute, screamer, soldier, bloater */
.sprite,
.foe-sprite {
  display: block;
  width: calc(16px * var(--u));
  height: calc(32px * var(--u));
  background-image: url('assets/walkers.png');
  background-repeat: no-repeat;
  background-size: calc(128px * var(--u)) calc(224px * var(--u));
  image-rendering: pixelated;
  animation: walk 0.8s steps(6) infinite;
}

.s-survivor,
.f-survivor {
  background-position-y: 0;
  animation-duration: 0.5s;
}
.s-zombie,
.f-zombie {
  background-position-y: calc(-32px * var(--u));
  animation-duration: 0.95s;
}
.s-runner,
.f-runner {
  background-position-y: calc(-64px * var(--u));
  animation-duration: 0.55s;
}
.s-brute,
.f-brute {
  background-position-y: calc(-96px * var(--u));
  animation-duration: 1.05s;
}
.f-screamer {
  background-position-y: calc(-128px * var(--u));
  animation-duration: 0.8s;
}
.s-soldier,
.f-soldier {
  background-position-y: calc(-160px * var(--u));
  animation-duration: 0.85s;
}
.s-bloater,
.f-bloater {
  background-position-y: calc(-192px * var(--u));
  animation-duration: 1.2s;
}

@keyframes walk {
  from {
    background-position-x: calc(-16px * var(--u));
  }
  to {
    background-position-x: calc(-112px * var(--u));
  }
}

/* ---------- sections ---------- */

main > section:not(.hero) {
  padding-block: 76px;
}

.head {
  display: grid;
  gap: 10px;
  margin-bottom: 30px;
}

.label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fire);
}

h2 {
  font-size: clamp(2.6rem, 10vw, 4.4rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
}

.lead {
  max-width: 38rem;
  color: var(--ink-2);
  font-size: 1.12rem;
}

/* ---------- the games ---------- */

.shelf {
  display: grid;
  gap: 18px;
}

.game {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--night-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.game:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.game-pic {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  overflow: hidden;
  background: var(--night-3);
}

.game-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  image-rendering: pixelated;
  transition: filter 0.3s ease;
}

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

.game-main .game-pic::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(28, 24, 39, 0), var(--night-2));
}

.status {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(20, 17, 28, 0.82);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-live {
  color: var(--live);
}

.status-test {
  color: var(--test);
}

.game-body {
  display: grid;
  gap: 10px;
  padding: 18px 18px 22px;
  align-content: start;
}

.game-body h3 {
  font-size: 2.2rem;
  line-height: 0.95;
  letter-spacing: 0.02em;
}

.game-main .game-body h3 {
  font-size: clamp(2.4rem, 9vw, 3.4rem);
}

.tags {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.game-body > p:not(.tags) {
  color: var(--ink-2);
}

.game-body .actions {
  margin-top: 6px;
}

.game-next {
  background: transparent;
  border: 2px dashed var(--line-2);
}

.game-next:hover {
  transform: none;
  box-shadow: none;
}

.next-pic {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(244, 233, 216, 0.03) 0 2px, rgba(0, 0, 0, 0) 2px 4px),
    radial-gradient(circle at 50% 55%, rgba(143, 140, 255, 0.14), rgba(0, 0, 0, 0) 60%);
}

.next-q {
  font-family: var(--display);
  font-size: 6rem;
  line-height: 1;
  color: var(--ink-3);
  animation: hum 3.2s ease-in-out infinite;
}

@keyframes hum {
  50% {
    color: var(--ink-2);
    transform: translateY(-4px);
  }
}

.next-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -20%;
  height: 20%;
  background: linear-gradient(to bottom, rgba(143, 140, 255, 0), rgba(143, 140, 255, 0.12), rgba(143, 140, 255, 0));
  animation: scan 4.5s linear infinite;
}

@keyframes scan {
  to {
    top: 100%;
  }
}

/* ---------- a day at Val-Morne ---------- */

.day {
  background: linear-gradient(to bottom, var(--night) 0, var(--night-2) 50%, var(--night) 100%);
}

.hours {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(82%, 340px);
  gap: 14px;
  margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter-l));
  padding: 4px var(--gutter-r) 14px var(--gutter-l);
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter-l);
  scrollbar-width: none;
}

.hours::-webkit-scrollbar {
  display: none;
}

.hour {
  scroll-snap-align: start;
  min-width: 0;
}

.hour:nth-child(1) {
  --sky: var(--morning);
}
.hour:nth-child(2) {
  --sky: var(--afternoon);
}
.hour:nth-child(3) {
  --sky: var(--nightfall);
}
.hour:nth-child(4) {
  --sky: var(--dawn);
}

.hour figure {
  position: relative;
  height: 100%;
  margin: 0;
  background: var(--night-3);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

/* the hour's sky, over its picture */
.hour figure::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1;
  height: 4px;
  background: var(--sky);
}

.hour img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  image-rendering: pixelated;
}

.hour figcaption {
  display: grid;
  gap: 4px;
  padding: 14px 16px 18px;
  color: var(--ink-2);
}

.time {
  font-family: var(--display);
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--sky);
}

.hour strong {
  font-size: 1.2rem;
  color: var(--ink);
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(20, 17, 28, 0.5);
}

.facts strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--fire);
}

.facts span {
  color: var(--ink-2);
  font-size: 0.98rem;
  line-height: 1.3;
}

/* ---------- the dead ---------- */

.dead {
  position: relative;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(80, 140, 70, 0.1), rgba(0, 0, 0, 0) 70%),
    linear-gradient(to bottom, var(--night) 0, var(--forest) 18%, var(--forest) 82%, var(--night) 100%);
}

.foes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* each one a button: touched, it growls (main.js) */
.foe {
  display: grid;
  gap: 6px;
  align-content: start;
  justify-items: start;
  min-width: 0;
  padding: 16px 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(20, 17, 28, 0.55);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.foe:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 70, 50, 0.45);
  background: rgba(40, 20, 26, 0.6);
}

.foe:active {
  transform: scale(0.98);
}

.foe-sprite {
  --u: 3;
  margin: 0 0 4px 2px;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35));
}

/* its action frame, a shake, while it is heard */
.foe.act .foe-sprite {
  animation: shake 0.12s steps(2) 4;
  background-position-x: calc(-112px * var(--u));
}

@keyframes shake {
  50% {
    transform: translateX(3px);
  }
}

.foe.act {
  border-color: rgba(255, 70, 50, 0.7);
}

.foe strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: 0.03em;
}

.foe-text {
  color: var(--ink-2);
  font-size: 0.98rem;
  line-height: 1.4;
}

.cta-row {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

/* ---------- the band: what every game of the studio promises, running ---------- */

.band {
  overflow: hidden;
  padding-block: 18px;
}

.band-run {
  display: flex;
  align-items: center;
  gap: 22px;
  width: max-content;
  /* (the same gap after the last word: the two halves are then exactly alike, the loop seamless) */
  padding: 12px 22px 10px 0;
  background: var(--fire);
  color: var(--fire-ink);
  font-family: var(--display);
  font-size: clamp(1.7rem, 6vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(-1.2deg);
  animation: run 40s linear infinite;
}

.band-run i {
  font-style: normal;
  font-size: 0.55em;
  opacity: 0.6;
}

@keyframes run {
  from {
    transform: rotate(-1.2deg) translateX(0);
  }
  to {
    transform: rotate(-1.2deg) translateX(-50%);
  }
}

/* ---------- the studio ---------- */

.studio {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.manifest {
  position: relative;
  display: grid;
  gap: 12px;
  margin-bottom: 34px;
}

.manifest-title {
  font-size: clamp(3.6rem, 16vw, 9.5rem);
  line-height: 0.86;
}

/* the studio's mark, very large behind its words */
.emblem {
  position: absolute;
  z-index: -1;
  right: -40px;
  top: -40px;
  width: 240px;
  height: 240px;
  image-rendering: pixelated;
  opacity: 0.1;
  transform: rotate(8deg);
}

.values {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.values li {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 20px;
  border-radius: 16px;
  background: var(--night-2);
  border: 1px solid var(--line);
}

.v-num {
  font-family: var(--display);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--fire);
}

.values strong {
  font-size: 1.25rem;
}

.values p {
  color: var(--ink-2);
}

.contact {
  display: grid;
  gap: 12px;
  margin-top: 26px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: linear-gradient(135deg, rgba(255, 195, 77, 0.08), rgba(255, 195, 77, 0) 60%);
}

.contact p {
  color: var(--ink-2);
}

.mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.mail-addr {
  font-size: 1.25rem;
  font-weight: 700;
  user-select: all;
  overflow-wrap: anywhere;
}

/* ---------- the last call: a fire at the bottom of the page ---------- */

.final {
  position: relative;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(ellipse 50% 60% at 50% 105%, rgba(255, 150, 60, 0.28), rgba(255, 120, 40, 0) 70%),
    var(--night);
}

.final-in {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
}

.final h2 {
  font-size: clamp(3.4rem, 14vw, 7.5rem);
  line-height: 0.9;
}

.final-fire {
  position: absolute;
  left: 50%;
  bottom: 0;
}

.btn-big {
  min-height: 62px;
  padding: 0 34px;
  font-size: 1.25rem;
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 40px calc(36px + env(safe-area-inset-bottom, 0px));
}

.foot-in {
  display: grid;
  gap: 22px;
}

.foot-brand p {
  color: var(--ink-3);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.foot-links a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
}

.foot-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.credits {
  font-size: 0.86rem;
  color: var(--ink-3);
}

/* ---------- appearing as the page scrolls (main.js: only what is below the fold) ---------- */

.pre {
  opacity: 0;
  transform: translateY(22px);
}

.in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- wider ---------- */

@media (min-width: 640px) {
  :root {
    --u: 3;
  }

  .foes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero .actions {
    width: auto;
  }

  .hero .actions .btn {
    flex: 0 0 auto;
  }

  .spot {
    max-width: 560px;
  }
}

@media (min-width: 860px) {
  .nav {
    display: flex;
  }

  main > section:not(.hero) {
    padding-block: 112px;
  }

  /* wider: the picture behind the text, still at its own size (640 high), the camp on the right of
     the text and the woods beyond */
  .hero {
    display: flex;
    align-items: center;
    min-height: 640px;
  }

  .hero-art {
    position: absolute;
    inset: 0;
    height: auto;
    z-index: -1;
  }

  .scene-wildborn img {
    object-position: 12% 0;
  }

  /* the text on the sea's side */
  .hero-art::after {
    background:
      linear-gradient(90deg, rgba(20, 17, 28, 0.88) 0, rgba(20, 17, 28, 0.5) 34%, rgba(20, 17, 28, 0) 56%),
      linear-gradient(to bottom, rgba(20, 17, 28, 0.55) 0, rgba(20, 17, 28, 0) 16%, rgba(20, 17, 28, 0) 74%, var(--night) 100%);
  }

  .hero-text {
    margin-top: 0;
    padding-block: 96px 40px;
  }

  .feature > * {
    max-width: 560px;
  }

  .emblem {
    width: 420px;
    height: 420px;
    right: -20px;
    top: -90px;
  }

  .manifest .lead {
    max-width: 44rem;
    font-size: 1.25rem;
  }

  .shelf {
    grid-template-columns: 1.35fr 1fr;
    grid-template-rows: auto auto;
  }

  .game-main {
    grid-row: span 2;
  }

  .game-main .game-pic {
    aspect-ratio: 16 / 10;
  }

  .game-main .game-body {
    padding: 22px 26px 28px;
  }

  .game:not(.game-main) {
    display: grid;
    grid-template-columns: 44% minmax(0, 1fr);
  }

  .game:not(.game-main) .game-pic,
  .game:not(.game-main) .next-pic {
    aspect-ratio: auto;
    height: 100%;
    min-height: 200px;
  }

  .hours {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-columns: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .values {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contact {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 24px 28px;
  }

  .foot-in {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  .foot-links {
    justify-content: flex-end;
  }

  .credits {
    grid-column: 1 / -1;
  }
}

/* wide enough: the strip of games at the bottom right of the picture, as the big studios do */
@media (min-width: 1180px) {
  .hero-text {
    position: static;
    padding-block: 96px 56px;
  }

  .spot {
    position: absolute;
    z-index: 3;
    right: max(var(--gutter-r), calc((100% - 1200px) / 2 + 16px));
    bottom: 30px;
    width: 470px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(20, 17, 28, 0.66);
  }

  @supports (backdrop-filter: blur(6px)) {
    .spot {
      background: rgba(20, 17, 28, 0.5);
      backdrop-filter: blur(8px);
    }
  }

  .foes {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* past the picture's own width: it covers */
@media (min-width: 1921px) {
  .scene-wildborn img {
    object-fit: cover;
  }
}

/* ---------- quiet ---------- */

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .road .walker,
  .ember {
    display: none;
  }

  .eye {
    opacity: 0;
  }

  .pre {
    opacity: 1;
    transform: none;
  }

  .band-run {
    transform: rotate(-1.2deg);
  }

  .sprite,
  .foe-sprite {
    background-position-x: calc(-16px * var(--u));
  }
}

/* ---------- 404: lost in the woods ---------- */

.lost {
  display: grid;
  min-height: 100svh;
  align-items: center;
  background: radial-gradient(ellipse 60% 50% at 50% 100%, rgba(80, 140, 70, 0.12), rgba(0, 0, 0, 0) 70%), var(--night);
}

.lost-in {
  display: grid;
  gap: 14px;
  justify-items: start;
  padding-block: 60px;
}

.lost h1 {
  font-size: clamp(3.4rem, 14vw, 7rem);
  line-height: 0.9;
}
