/* Dungeon: marketing site. Colours from the game's palette (Shared/Art/Palette.swift). */

@font-face {
  font-family: "Dungeon Pixel";
  src: url("../fonts/dungeon-pixel.woff") format("woff"), url("../fonts/dungeon-pixel.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #0c0a0e;
  --bg-2: #15111a;
  --panel: #1c1620;
  --line: #3a2e26;
  --brick: #a8743c;
  --brick-dark: #5a3a1e;
  --gold: #f8d040;
  --gold-shadow: #7a3010;
  --fire: #ff8a2a;
  --text: #ece8f0;
  --dim: #a59cb0;
  --pixel: "Dungeon Pixel", ui-monospace, monospace;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
.pixelated, .sprite, .item { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--gold); }
a:hover { color: #fff3b0; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }

/* --- Pixel type ---------------------------------------------------------------------------------- */
.px { font-family: var(--pixel); font-weight: normal; letter-spacing: 0; line-height: 1.25; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--pixel); font-weight: normal; text-transform: uppercase; line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: clamp(26px, 4vw, 40px); color: var(--gold); text-shadow: .1em .1em 0 var(--gold-shadow); }
h3 { font-size: 19px; color: var(--text); }
.kicker { font-family: var(--pixel); text-transform: uppercase; color: var(--fire); font-size: 15px; margin: 0 0 12px; }
.lead { font-size: 19px; color: var(--dim); max-width: 46em; }

/* --- Header -------------------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(12, 10, 14, .88);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold); font-family: var(--pixel); font-size: 22px; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--text); text-decoration: none; font-family: var(--pixel); text-transform: uppercase; font-size: 14px; }
.nav a:hover { color: var(--gold); }
@media (max-width: 720px) { .nav a.optional { display: none; } .nav { gap: 16px; } }

/* --- Buttons ------------------------------------------------------------------------------------- */
.buttons { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--pixel); text-transform: uppercase; font-size: 16px;
  padding: 14px 20px; text-decoration: none; color: #1a1006;
  background: var(--gold); border: 0;
  box-shadow: 0 4px 0 var(--gold-shadow), 0 8px 24px rgba(248, 208, 64, .25);
}
.btn:hover { color: #1a1006; background: #ffe070; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }
.btn.soon { cursor: default; }
.btn.soon:hover { transform: none; background: var(--gold); }
.btn .small { display: block; font-size: 11px; opacity: .75; }

/* --- Hero ---------------------------------------------------------------------------------------- */
.hero { position: relative; height: min(80vh, 56.25vw, 860px); min-height: 380px; display: grid; overflow: hidden; background: #000; }
.hero > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 70%;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,10,14,.55) 0%, rgba(12,10,14,0) 38%, rgba(12,10,14,0) 85%, var(--bg) 100%);
}
.hero-content { position: relative; z-index: 1; align-self: start; text-align: center; padding: clamp(28px, 7vh, 80px) 16px 0; }
.title {
  font-family: var(--pixel); color: var(--gold); margin: 0;
  font-size: clamp(56px, 12vw, 150px); line-height: 1;
  text-shadow: .1em .1em 0 var(--gold-shadow), 0 0 40px rgba(0,0,0,.6);
}
.subtitle { font-family: var(--pixel); text-transform: uppercase; font-size: clamp(16px, 2.6vw, 30px); margin: .6em 0 0; text-shadow: 3px 3px 0 #000; }
.hero-actions { padding: 8px 16px clamp(40px, 6vw, 72px); display: grid; justify-items: center; gap: 16px; text-align: center; }
.hero-actions .tag { font-size: clamp(19px, 2.2vw, 24px); max-width: 34em; margin: 0; }
.platforms { font-family: var(--pixel); text-transform: uppercase; font-size: 13px; color: var(--dim); letter-spacing: .02em; margin: 0; }

/* --- Sections ------------------------------------------------------------------------------------ */
section { padding: clamp(56px, 9vw, 110px) 0; }
section.alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.brick-rule {
  height: 24px; border: 0; margin: 0;
  background:
    linear-gradient(var(--brick-dark) 2px, transparent 2px) 0 0 / 32px 12px,
    linear-gradient(90deg, var(--brick-dark) 2px, transparent 2px) 0 0 / 32px 24px,
    linear-gradient(90deg, var(--brick-dark) 2px, transparent 2px) 16px 12px / 32px 24px,
    var(--brick);
  image-rendering: pixelated;
  opacity: .9;
}

.intro { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.intro .stage { display: flex; align-items: end; gap: 6px; }
@media (max-width: 720px) { .intro { grid-template-columns: 1fr; } .intro .stage { justify-content: center; } }

/* --- Sprites (CSS step animation over a strip of 128x128 frames) --------------------------------- */
.sprite {
  --frames: 4; --speed: .6s; --size: 128px;
  width: var(--size); height: var(--size);
  background-repeat: no-repeat;
  background-size: calc(var(--size) * var(--frames)) var(--size);
  animation: play var(--speed) steps(var(--frames)) infinite;
  flex: none;
}
@keyframes play { from { background-position: 0 0; } to { background-position: calc(var(--size) * var(--frames) * -1) 0; } }
.sprite.s96 { --size: 96px; }
.sprite.s64 { --size: 64px; }
@media (prefers-reduced-motion: reduce) { .sprite { animation: none; } html { scroll-behavior: auto; } }

/* --- Trailer ------------------------------------------------------------------------------------- */
.video { position: relative; margin-top: 28px; border: 2px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #000; }
.video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* --- Feature cards ------------------------------------------------------------------------------- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-top: 36px; }
.card { background: var(--panel); border: 1px solid var(--line); padding: 24px; position: relative; }
.card p { margin: 0; color: var(--dim); }
.card .art { display: flex; gap: 0; align-items: end; height: 128px; margin: -14px 0 10px -20px; }
.card .art img { width: 128px; height: 128px; }

/* --- Modes --------------------------------------------------------------------------------------- */
.modes .card { border-top: 4px solid var(--gold); }
.modes .card:nth-child(2) { border-top-color: var(--fire); }
.modes .card:nth-child(3) { border-top-color: #8a6ad8; }
.modes .label { font-family: var(--pixel); text-transform: uppercase; font-size: 12px; color: var(--dim); margin-bottom: 8px; }

/* --- Floors -------------------------------------------------------------------------------------- */
.floors { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 2px; counter-reset: floor; }
.floors li {
  display: grid; grid-template-columns: 70px 1fr; gap: 6px 20px; align-items: baseline;
  padding: 20px 22px; background: var(--panel);
  border-left: 6px solid var(--brick); counter-increment: floor;
}
.floors li:nth-child(2) { border-left-color: #8a7a6a; background: #1a1620; }
.floors li:nth-child(3) { border-left-color: #6a5a8a; background: #17131c; }
.floors li:nth-child(4) { border-left-color: #c8323a; background: #140f15; }
.floors li::before { content: "B" counter(floor); font-family: var(--pixel); font-size: 28px; color: var(--gold); grid-row: span 2; }
.floors h3 { margin: 0; }
.floors p { margin: 0; color: var(--dim); }

/* --- Bestiary ------------------------------------------------------------------------------------ */
.bestiary { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); margin-top: 36px; }
.monster { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); padding: 10px 16px 10px 8px; }
.monster h3 { font-size: 16px; margin: 0 0 4px; color: var(--gold); }
.monster p { margin: 0; font-size: 15px; color: var(--dim); line-height: 1.45; }
.monster.boss { grid-column: 1 / -1; grid-template-columns: 128px 1fr; border-color: #c8323a; background: linear-gradient(90deg, #2a1012, var(--panel)); }
.monster.boss h3 { font-size: 22px; color: #ff6a5a; }
.monster.boss p { font-size: 16px; }

/* --- Items row ----------------------------------------------------------------------------------- */
.items { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 28px; }
.items img { width: 64px; height: 64px; }

/* --- Screenshots --------------------------------------------------------------------------------- */
.shots { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin-top: 36px; }
.shots figure { margin: 0; background: #000; border: 2px solid var(--line); }
.shots img { width: 100%; height: auto; aspect-ratio: 5 / 3; }
.shots figcaption { font-family: var(--pixel); text-transform: uppercase; font-size: 13px; padding: 10px 12px; color: var(--dim); background: var(--panel); }

/* --- Controls table ------------------------------------------------------------------------------ */
.table-scroll { overflow-x: auto; margin-top: 28px; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { font-family: var(--pixel); font-weight: normal; text-transform: uppercase; font-size: 13px; color: var(--gold); }
td:first-child { color: var(--text); font-weight: 600; }
td { color: var(--dim); }

/* --- Final call ---------------------------------------------------------------------------------- */
.finale { text-align: center; }
.finale .stage { display: flex; justify-content: center; align-items: end; gap: 0; margin-bottom: 24px; }
.finale .buttons { justify-content: center; margin-top: 24px; }

/* --- Footer -------------------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--dim); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer .fine { flex-basis: 100%; font-size: 12px; opacity: .8; margin: 0; }

/* --- Text pages (privacy, support) --------------------------------------------------------------- */
.page { padding: clamp(40px, 7vw, 80px) 0; }
.page .wrap { max-width: 780px; }
.page h1 { font-size: clamp(32px, 5vw, 48px); color: var(--gold); text-shadow: .1em .1em 0 var(--gold-shadow); }
.page h2 { font-size: 22px; margin-top: 2em; }
.page .meta { color: var(--dim); font-size: 15px; }
.page li { margin-bottom: .4em; }
.callout { background: var(--panel); border-left: 4px solid var(--gold); padding: 16px 20px; margin: 24px 0; }
.callout p { margin: 0; }
details { background: var(--panel); border: 1px solid var(--line); padding: 0 20px; margin: 10px 0; }
details[open] { padding-bottom: 14px; }
summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style-position: outside; }
details p, details ul { color: var(--dim); margin-top: 0; }
