/* Gloomspire landing page. Colours come from the game's own 32-colour palette. */

@font-face {
  font-family: 'Rammetto One';
  src: url('assets/fonts/rammetto-one.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('assets/fonts/figtree.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ink: #0d0b1a;
  --night: #1b1730;
  --stone: #2a2548;
  --stone-lit: #3d3a6b;
  --mist: #c9d0f0;
  --dim: #8a8fc4;
  --cream: #fff6c9;
  --gold: #ffe07a;
  --amber: #f8a94a;
  --ember: #f0704a;
  --blood: #7a2638;
  --plum: #3b1d2e;
  --gloom: #a85cb8;
  --sky: #7fd6f2;

  --display: 'Rammetto One', 'Arial Black', Impact, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wall: 48px;      /* width of the tower wall on each side */
  --tile: 48px;      /* one game tile at page scale */
  --hud: 56px;
  --pad: clamp(20px, 5vw, 56px);

  /* Filled in by site.js with the game's real tiles. */
  --tile-wall: none;
  --tile-brick: none;
  --tile-bg: none;
}

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

html {
  background: var(--ink);
  scroll-padding-top: calc(var(--hud) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--mist);
  font: 500 1.0625rem/1.6 var(--body);
  overflow-x: hidden;
}

img, video, canvas { display: block; max-width: 100%; }
canvas[data-sprite] { image-rendering: pixelated; image-rendering: crisp-edges; max-width: none; flex: none; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--gold); text-underline-offset: 0.18em; }
a:hover { color: var(--cream); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 50;
  padding: 10px 14px; background: var(--gold); color: var(--ink); font-weight: 700; border-radius: 8px;
}
.skip:focus { top: 12px; }

h2 {
  font: 400 clamp(1.9rem, 5.2vw, 3.3rem)/1.08 var(--display);
  color: var(--cream);
  text-shadow: 0 0.08em 0 var(--blood), 0 0.16em 0 var(--ink);
  letter-spacing: 0.005em;
  text-wrap: balance;
  max-width: 17ch;
}
h3 {
  font: 400 1.25rem/1.15 var(--display);
  color: var(--gold);
  letter-spacing: 0.01em;
}
.intro { max-width: 58ch; margin-top: 18px; font-size: 1.125rem; }

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

.btn {
  display: inline-block;
  padding: 0.72em 1.25em 0.8em;
  font: 400 clamp(1.05rem, 2.6vw, 1.35rem)/1.1 var(--display);
  color: var(--plum);
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(var(--gold), var(--amber) 70%, var(--ember));
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: inset 0 3px 0 rgb(255 255 255 / 0.55), 0 7px 0 var(--blood), 0 7px 0 3px var(--ink);
  transition: transform 90ms, box-shadow 90ms;
}
.btn:hover { color: var(--ink); filter: brightness(1.06); }
.btn:active {
  transform: translateY(5px);
  box-shadow: inset 0 3px 0 rgb(255 255 255 / 0.55), 0 2px 0 var(--blood), 0 2px 0 3px var(--ink);
}
.btn-small {
  padding: 0.5em 0.9em 0.56em;
  font-size: 0.95rem;
  border-radius: 12px;
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.55), 0 4px 0 var(--blood), 0 4px 0 3px var(--ink);
}
.btn-small:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.55), 0 1px 0 var(--blood), 0 1px 0 3px var(--ink);
}
.fineprint { font-size: 0.95rem; color: var(--dim); margin-top: 22px; }

/* ---------- HUD: the game's own top bar (depth, floor) ---------- */

.hud {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: var(--hud);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: linear-gradient(var(--ink) 72%, rgb(13 11 26 / 0));
}
.hud-home { justify-self: start; border-radius: 9px; }
.hud-home img { border-radius: 9px; border: 2px solid var(--ink); box-shadow: 0 0 0 1px var(--stone-lit); }
.hud .btn { justify-self: end; margin-bottom: 4px; }
.hud-read {
  display: flex; gap: 1.1em; align-items: baseline;
  font: 400 0.95rem/1 var(--display);
  color: var(--dim);
  white-space: nowrap;
}
.hud-depth b { font-weight: 400; color: var(--cream); font-variant-numeric: tabular-nums; }
.hud-floor { color: var(--gold); transition: color 200ms; }
.stirring .hud-floor { color: #ff6f8f; }

/* ---------- The Gloom: stop scrolling and it comes down after you ---------- */

.gloom {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  pointer-events: none;
  transform: translateY(-101%);
  transition: transform 500ms cubic-bezier(0.3, 0, 0.2, 1);
}
.gloom img {
  width: max(100%, 760px);
  max-width: none;
  height: auto;
  margin-left: min(0px, calc((100vw - 760px) / 2));
}
.stirring .gloom {
  transform: translateY(-34%);
  transition: transform 5s cubic-bezier(0.5, 0, 0.9, 0.6);
}

/* ---------- The shaft: tower walls down both sides ---------- */

.shaft {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--wall);
  background-color: var(--night);
  background-image: linear-gradient(rgb(13 11 26 / 0.78), rgb(13 11 26 / 0.78)), var(--tile-bg);
  background-size: auto, var(--tile) var(--tile);
  image-rendering: pixelated;
}
.shaft::before, .shaft::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: var(--wall);
  background: var(--stone-lit) var(--tile-wall) 0 0 / var(--tile) var(--tile);
  image-rendering: pixelated;
  box-shadow: inset 0 0 0 0 transparent;
}
.shaft::before { left: 0; border-right: 3px solid var(--ink); }
.shaft::after { right: 0; border-left: 3px solid var(--ink); }
.shaft > * { image-rendering: auto; }

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

.hero {
  position: relative;
  padding-top: calc(var(--hud) + 8px);
  text-align: center;
  background: var(--ink);
}
.logo {
  position: relative; z-index: 2;
  width: min(86%, 500px);
  margin: 0 auto -6%;
}
.logo img { width: 100%; height: auto; filter: drop-shadow(0 10px 18px rgb(13 11 26 / 0.8)); }
.hero-art img {
  width: 100%; height: min(66.6vw, 56vh); min-height: 300px;
  object-fit: cover; object-position: center 30%;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 62%, transparent 99%);
          mask-image: linear-gradient(transparent, #000 14%, #000 62%, transparent 99%);
}
.hero-copy {
  position: relative; z-index: 2;
  margin-top: clamp(-150px, -11vw, -60px);
  padding: 0 var(--pad) clamp(48px, 8vw, 88px);
}
.tagline {
  font: 400 clamp(1.7rem, 5.4vw, 3.2rem)/1.05 var(--display);
  color: var(--cream);
  text-shadow: 0 0.08em 0 var(--blood), 0 0.16em 0 var(--ink), 0 0 28px var(--ink);
}
.lede {
  max-width: 44ch;
  margin: 14px auto 24px;
  font-size: clamp(1.06rem, 2.2vw, 1.25rem);
  color: #e6e9fb;
  text-shadow: 0 1px 10px var(--ink), 0 0 2px var(--ink);
}

/* ---------- Floor breaks: a brick floor with a hole dug through it ---------- */

.floor-break {
  position: relative;
  height: calc(var(--tile) * 2);
  display: grid; place-items: center;
  background: var(--amber) var(--tile-brick) center top / var(--tile) var(--tile);
  image-rendering: pixelated;
  border-block: 3px solid var(--ink);
  --hole: calc(var(--tile) * 4);
  -webkit-mask-image: none;
}
.floor-break::before {
  content: '';
  position: absolute; top: -3px; bottom: -3px; left: 50%;
  width: var(--hole); margin-left: calc(var(--hole) / -2);
  background: var(--ink);
  border-inline: 3px solid var(--ink);
  /* ragged edge, cut on the tile grid */
  clip-path: polygon(0 0, 100% 0, 100% 50%, calc(100% - var(--tile) / 2) 50%, calc(100% - var(--tile) / 2) 100%, calc(var(--tile) / 2) 100%, calc(var(--tile) / 2) 50%, 0 50%);
}
.floor-break span {
  position: relative;
  font: 400 1.2rem/1 var(--display);
  color: var(--gold);
  text-shadow: 0 2px 0 var(--blood);
  white-space: nowrap;
  image-rendering: auto;
}

/* ---------- Floors (sections) ---------- */

.floor { padding: clamp(56px, 9vw, 104px) var(--pad); }

/* Floor 2: how a run goes */
.run-grid {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
  margin-top: clamp(32px, 5vw, 56px);
}
.phone { position: sticky; top: calc(var(--hud) + 20px); }
.phone video {
  width: 100%; height: auto;
  background: var(--ink);
  border: 6px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 0 0 3px var(--stone-lit), 0 18px 0 -6px rgb(13 11 26 / 0.6);
  image-rendering: pixelated;
}
.phone figcaption { margin-top: 14px; font-size: 0.92rem; color: var(--dim); text-align: center; }
.beats { display: grid; gap: 34px; max-width: 54ch; }
.beat-art { display: flex; gap: 10px; align-items: flex-end; height: 48px; margin-bottom: 12px; }
.beat h3 { font-size: 1.6rem; color: var(--cream); margin-bottom: 6px; }
.pickups {
  display: grid; gap: 14px;
  padding-top: 28px;
  border-top: 3px dashed var(--stone-lit);
}
.pickups li { display: flex; gap: 16px; align-items: center; }
.pickups b { font: 400 1.05rem var(--display); color: var(--gold); margin-right: 0.15em; }

/* Floor 3: the bestiary */
.bestiary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 26px clamp(24px, 4vw, 48px);
  margin-top: clamp(32px, 5vw, 52px);
}
.bestiary li { display: flex; gap: 18px; align-items: flex-start; }
.bestiary canvas {
  box-sizing: content-box;
  width: 64px; height: 64px;
  padding: 8px;
  background: var(--stone);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 0 0 2px var(--stone-lit);
  object-fit: contain;
}
.bestiary h3 { margin: 4px 0 4px; }
.bestiary p { font-size: 1rem; line-height: 1.5; }

/* Floor 4: modes */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 40px clamp(28px, 5vw, 64px);
  margin-top: clamp(32px, 5vw, 56px);
}
.mode-grid canvas { margin-bottom: 18px; }
.mode-grid h3 { font-size: 1.6rem; color: var(--cream); margin-bottom: 8px; }
.mode-grid p { max-width: 34ch; }

/* Floor 5: the roster. Each digger walks on its own brick. */
.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 30px 10px;
  margin-top: clamp(32px, 5vw, 56px);
}
.roster li { display: grid; justify-items: center; align-content: end; }
.roster .stand {
  position: relative;
  display: grid; justify-items: center; align-items: end;
  width: 100%; height: 76px;
  margin-bottom: 24px;
}
.roster .stand::after {
  content: '';
  position: absolute; left: 12%; right: 12%; bottom: -24px; height: 24px;
  background: var(--amber) var(--tile-brick) center top / 24px 24px;
  image-rendering: pixelated;
  border: 3px solid var(--ink);
  border-radius: 3px;
}
.roster span {
  margin-top: 10px;
  font: 400 0.82rem/1.15 var(--display);
  color: var(--mist);
  text-align: center;
}

/* ---------- The vault: last call ---------- */

.vault { position: relative; background: var(--ink); text-align: center; }
.vault img {
  width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(transparent, #000 16%, #000 70%, transparent 99%);
          mask-image: linear-gradient(transparent, #000 16%, #000 70%, transparent 99%);
}
.vault-copy {
  position: relative;
  margin-top: -13%;
  padding: 0 var(--pad) clamp(56px, 9vw, 96px);
}
.vault h2 { max-width: none; margin-bottom: 30px; text-shadow: 0 0.08em 0 var(--blood), 0 0.16em 0 var(--ink), 0 0 30px var(--ink); }

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

.foot { border-top: 3px solid var(--stone); padding: 40px var(--pad) 56px; font-size: 0.98rem; }
.foot-in { max-width: 1084px; margin: 0 auto; display: grid; gap: 18px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.foot-help b { color: var(--cream); }
.foot-legal { color: var(--dim); font-size: 0.9rem; }

/* ---------- Privacy policy page ---------- */

.doc { max-width: 720px; margin: 0 auto; padding: calc(var(--hud) + 40px) var(--pad) 72px; }
.doc h1 {
  font: 400 clamp(2.1rem, 6vw, 3.2rem)/1.08 var(--display);
  color: var(--cream);
  text-shadow: 0 0.08em 0 var(--blood), 0 0.16em 0 var(--ink);
}
.doc .updated { color: var(--dim); margin-top: 14px; }
.doc h2 { font-size: clamp(1.35rem, 3.6vw, 1.7rem); max-width: none; margin: 52px 0 14px; text-shadow: none; color: var(--gold); }
.doc h3 { font: 700 1.08rem/1.3 var(--body); color: var(--cream); margin: 26px 0 8px; letter-spacing: 0; }
.doc p, .doc ul { margin-top: 12px; }
.doc ul { list-style: disc; padding-left: 1.3em; }
.doc li { margin-top: 6px; }
.doc li::marker { color: var(--gloom); }
.doc strong { color: var(--cream); }
.doc .summary {
  margin-top: 28px; padding: 20px 22px;
  background: var(--night);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 0 0 2px var(--stone-lit);
}
.doc .summary p:first-child { margin-top: 0; }
.hud-plain { grid-template-columns: auto 1fr auto; background: var(--ink); border-bottom: 3px solid var(--stone); }
.hud-plain .hud-name { font: 400 1.05rem var(--display); color: var(--cream); text-decoration: none; }

/* ---------- Cookie consent banner (assets/consent), themed for this site ---------- */

:root {
  --consent-color-bg: var(--night);
  --consent-color-fg: var(--mist);
  --consent-color-link: var(--gold);
  --consent-color-btn-bg: var(--gold);
  --consent-color-btn-fg: var(--plum);
  --consent-color-focus: var(--sky);
  --consent-btn-shadow: 0 3px 0 var(--blood);
  --consent-radius: 14px;
  --consent-radius-btn: 12px;
  --consent-font: var(--body);
  --consent-font-display: var(--display);
  --consent-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--stone-lit), 0 14px 34px rgb(0 0 0 / 0.55);
}
.consent-banner__btn,
.consent-banner__title,
.consent-banner__name { font-weight: 400; }
.consent-banner__row input { accent-color: var(--amber); }
.foot nav button[data-consent-settings] {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--gold); text-decoration: underline; text-underline-offset: 0.18em;
}
.foot nav button[data-consent-settings]:hover { color: var(--cream); }

.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--gold); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }

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

@media (max-width: 720px) {
  .hero .btn, .vault .btn { white-space: normal; }
  :root { --wall: 16px; --tile: 32px; --hud: 52px; }
  .shaft::before, .shaft::after { background-position: center top; }
  .logo { margin-bottom: -10%; width: 92%; }
  .hero-art img { height: auto; min-height: 0; }
  .hero-copy { margin-top: -30%; }
  .run-grid { grid-template-columns: 1fr; }
  .phone { position: static; width: min(260px, 72%); margin: 0 auto; }
  .hud-read { font-size: 0.82rem; gap: 0.8em; }
  .vault-copy { margin-top: -6%; }
  .roster { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .roster span { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gloom { display: none; }
  .btn { transition: none; }
}

.doc code { font-size: 0.92em; color: var(--cream); }
.doc ul ul { margin-top: 6px; }

.doc .table-wrap { overflow-x: auto; margin-top: 16px; }
.doc table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 2px solid var(--stone); }
.doc th { color: var(--cream); font-weight: 700; }
