@font-face {
  font-family: "Ark Pixel";
  src: url("assets/fonts/ark-pixel-16px-latin.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #f3e6cf;
  --ink-muted: #c4b398;
  --ember: #ff9b3d;
  --flame: #ffd27a;
  --gold: #f2c14e;
  --night: #120d1c;
  --abyss: #07060a;

  --wood: #5a3a22;
  --wood-dark: #3a2414;
  --wood-trim: #8a5a32;
  --stone: #45454c;
  --stone-dark: #2b2b31;
  --stone-trim: #6c6c74;
  --leather: #5b3627;
  --leather-dark: #3a2119;
  --leather-trim: #8c5a3c;

  --discord: #5865f2;
  --discord-dark: #3c45a5;

  --pixel: 4px;
  --content: min(1080px, 100% - 32px);
  --font-pixel: "Ark Pixel", ui-monospace, monospace;
  --font-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* Fallback when the world canvas is unavailable: dusk sky fading into the deep. */
  background: linear-gradient(#1b1430 0, #3c2342 600px, #2a1d14 900px, #1a1716 2400px, var(--abyss) 100%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.55;
  overflow-x: hidden;
}

#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  image-rendering: pixelated;
}

img {
  image-rendering: pixelated;
}

h1,
h2,
h3 {
  font-family: var(--font-pixel);
  font-weight: normal;
  line-height: 1.1;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

a {
  color: var(--flame);
}

:focus-visible {
  outline: var(--pixel) solid var(--flame);
  outline-offset: var(--pixel);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 96px 16px 160px;
  text-align: center;
}

.hero__content {
  max-width: 760px;
}

.kicker {
  font-family: var(--font-pixel);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 24px;
}

.title {
  margin: 0;
  color: var(--ink);
  text-shadow:
    var(--pixel) var(--pixel) 0 #1a0f08,
    0 0 32px rgba(255, 155, 61, 0.45);
}

.title__line {
  display: block;
  font-size: clamp(32px, 6vw, 48px);
}

.title__line--big {
  font-size: clamp(64px, 16vw, 144px);
  color: var(--flame);
  letter-spacing: 0.02em;
  text-shadow:
    var(--pixel) var(--pixel) 0 #6b2c07,
    calc(var(--pixel) * 2) calc(var(--pixel) * 2) 0 #1a0f08,
    0 0 48px rgba(255, 155, 61, 0.7);
  animation: title-flicker 4s infinite;
}

@keyframes title-flicker {
  0%, 100% { filter: brightness(1); }
  42% { filter: brightness(1.08); }
  44% { filter: brightness(0.94); }
  71% { filter: brightness(1.04); }
}

.tagline {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  color: var(--ink);
  margin: 28px auto 36px;
  max-width: 34ch;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.status {
  margin: 28px 0 0;
  font-size: 1rem;
  color: var(--ink-muted);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  text-shadow: var(--pixel) var(--pixel) 0 #000;
}

.scroll-hint__arrow {
  width: 16px;
  height: 16px;
  background: var(--flame);
  clip-path: polygon(0 25%, 25% 25%, 25% 50%, 75% 50%, 75% 25%, 100% 25%, 100% 50%, 75% 50%, 75% 75%, 25% 75%, 25% 50%, 0 50%);
  animation: bob 1.6s steps(2) infinite;
}

@keyframes bob {
  50% { transform: translateY(6px); }
}

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--wood);
  --btn-edge: var(--wood-dark);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  background: var(--btn-bg);
  box-shadow:
    inset 0 calc(var(--pixel) * -1) 0 var(--btn-edge),
    inset 0 var(--pixel) 0 rgba(255, 255, 255, 0.18);
  clip-path: var(--stepped);
  transition: transform 80ms steps(1), filter 120ms;
}

.btn:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

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

.btn--primary {
  --btn-bg: var(--discord);
  --btn-edge: var(--discord-dark);
  color: #fff;
}

.btn--ghost {
  --btn-bg: rgba(20, 12, 8, 0.7);
  --btn-edge: rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 0 0 var(--pixel) var(--wood-trim);
}

.btn--large {
  font-size: 20px;
  padding: 20px 32px;
}

.btn__icon {
  width: 24px;
  height: 24px;
  shape-rendering: crispEdges;
}

/* A 4px-stepped rectangle: the corner cut the game's UI frames use. */
:root {
  --stepped: polygon(
    0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0,
    calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px)
  );
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  width: var(--content);
  margin: 0 auto;
  padding: 120px 0;
}

.section-title {
  text-align: center;
  font-size: clamp(32px, 5vw, 48px);
  margin: 0 0 48px;
  color: var(--flame);
  text-shadow:
    var(--pixel) var(--pixel) 0 #000,
    0 0 24px rgba(255, 155, 61, 0.45);
}

/* ---------- Panels: the game's wood / stone / leather window materials ---------- */

.panel {
  --panel-bg: var(--wood);
  --panel-dark: var(--wood-dark);
  --panel-trim: var(--wood-trim);
  position: relative;
  padding: 28px;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 12px,
      rgba(0, 0, 0, 0.12) 12px 16px
    ),
    var(--panel-bg);
  box-shadow:
    inset 0 0 0 var(--pixel) var(--panel-trim),
    inset 0 0 0 calc(var(--pixel) * 2) var(--panel-dark),
    inset 0 calc(var(--pixel) * 3) 0 rgba(255, 255, 255, 0.06);
  clip-path: var(--stepped);
}

.panel--stone {
  --panel-bg: var(--stone);
  --panel-dark: var(--stone-dark);
  --panel-trim: var(--stone-trim);
  background:
    repeating-conic-gradient(rgba(0, 0, 0, 0.08) 0 25%, transparent 0 50%) 0 0 / 16px 16px,
    var(--panel-bg);
}

.panel--leather {
  --panel-bg: var(--leather);
  --panel-dark: var(--leather-dark);
  --panel-trim: var(--leather-trim);
  background:
    radial-gradient(rgba(0, 0, 0, 0.14) 1px, transparent 1.5px) 0 0 / 8px 8px,
    var(--panel-bg);
}

.panel__title {
  margin: 0 0 20px;
  font-size: 24px;
  color: var(--flame);
  text-shadow: var(--pixel) var(--pixel) 0 #000;
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 24px;
  color: var(--flame);
  text-shadow: calc(var(--pixel) / 2) calc(var(--pixel) / 2) 0 #000;
}

.panel p {
  margin: 0;
  color: var(--ink);
}

/* ---------- Trailer ---------- */

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 0 0 var(--pixel) var(--wood-dark);
}

.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(255, 155, 61, 0.18), transparent 60%),
    repeating-linear-gradient(45deg, #0d0a08 0 16px, #120e0b 16px 32px);
}

.placeholder__label {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--ink-muted);
}

.play-glyph {
  width: 96px;
  height: 96px;
  background: var(--flame);
  box-shadow: 0 0 40px rgba(255, 155, 61, 0.6);
  clip-path: polygon(
    25% 12.5%, 37.5% 12.5%, 37.5% 20%, 50% 20%, 50% 30%, 62.5% 30%, 62.5% 40%, 75% 40%, 75% 60%,
    62.5% 60%, 62.5% 70%, 50% 70%, 50% 80%, 37.5% 80%, 37.5% 87.5%, 25% 87.5%
  );
}

/* ---------- Features ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.feature {
  padding-top: 32px;
}

.feature__icon {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  filter: drop-shadow(var(--pixel) var(--pixel) 0 rgba(0, 0, 0, 0.6));
}

/* ---------- Gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.shot {
  margin: 0;
  padding: 12px 12px 16px;
  background: var(--stone-dark);
  box-shadow: inset 0 0 0 var(--pixel) var(--stone-trim);
  clip-path: var(--stepped);
}

.shot__img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.shot__img--placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 70%, rgba(255, 155, 61, 0.14), transparent 45%),
    repeating-linear-gradient(-45deg, #0c0b0f 0 12px, #121117 12px 24px);
}

.shot__img--placeholder span {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: #5d5a66;
}

.shot figcaption {
  margin-top: 12px;
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--ink);
}

/* ---------- Modes ---------- */

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.mode--hardcore {
  --panel-bg: #4a1f1f;
  --panel-dark: #2a0f0f;
  --panel-trim: #8c3434;
}

.mode--hardcore h3 {
  color: #ff7a6b;
}

/* ---------- Final ---------- */

.section--abyss {
  padding: 200px 0 160px;
}

.final {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 24px;
}

.final__title {
  margin: 0;
  font-size: clamp(32px, 6vw, 64px);
  color: var(--ink);
  text-shadow:
    var(--pixel) var(--pixel) 0 #000,
    0 0 32px rgba(255, 155, 61, 0.35);
}

.final__text {
  margin: 0 0 16px;
  max-width: 44ch;
  color: var(--ink-muted);
}

/* ---------- Torches (the game's own sprite sheet: 6 frames of 32px) ---------- */

.torch {
  position: absolute;
  top: 132px;
  width: 64px;
  height: 64px;
  background: url("assets/art/torch-sheet.png") 0 0 / 384px 64px no-repeat;
  image-rendering: pixelated;
  animation: torch-burn 0.8s steps(6) infinite;
  pointer-events: none;
}

.torch--left {
  left: -88px;
}

.torch--right {
  right: -88px;
}

.torch--hero {
  position: static;
  width: 128px;
  height: 128px;
  background-size: 768px 128px;
  animation-name: torch-burn-large;
}

@keyframes torch-burn {
  to { background-position-x: -384px; }
}

@keyframes torch-burn-large {
  to { background-position-x: -768px; }
}

/* ---------- Depth meter ---------- */

.depth-meter {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  justify-items: end;
  gap: 4px;
  padding: 10px 14px;
  font-family: var(--font-pixel);
  font-size: 16px;
  background: rgba(10, 8, 6, 0.72);
  box-shadow: inset 0 0 0 var(--pixel) rgba(138, 90, 50, 0.7);
  clip-path: var(--stepped);
  pointer-events: none;
  z-index: 10;
}

.depth-meter__value {
  color: var(--flame);
}

.depth-meter__layer {
  color: var(--ink-muted);
}

/* ---------- Footer ---------- */

.footer {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 16px 48px;
  text-align: center;
  color: #6f675c;
  font-size: 0.95rem;
}

.footer__logo {
  width: min(320px, 70vw);
  height: auto;
  image-rendering: auto;
  /* The artwork is lit on pure black; screen blends its black away into the abyss. */
  mix-blend-mode: screen;
}

.footer p {
  margin: 0;
}

/* ---------- Small screens ---------- */

@media (max-width: 1240px) {
  .torch--left,
  .torch--right {
    display: none;
  }
}

@media (max-width: 720px) {
  .depth-meter {
    display: none;
  }

  .section {
    padding: 80px 0;
  }

  .panel {
    padding: 22px;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}

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

  .title__line--big,
  .scroll-hint__arrow,
  .torch {
    animation: none;
  }
}
