/* Dawnbringer site. Colours are the game's palette (game/ui/ui_palette.gd); panels and buttons are
   the game's own 9-slice textures drawn at 2x; pixel fonts are set at whole multiples of their
   pixel grid (Kenney Pixel 16 px, Fusion Pixel 12 px, Jacquarda Bastarda 13 px per em). */

@font-face { font-family: "DB Pixel"; src: url(fonts/kenney-pixel.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "DB Logo"; src: url(fonts/jacquarda-logo.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "DB Fusion JA"; src: url(fonts/fusion-ja.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "DB Fusion KO"; src: url(fonts/fusion-ko.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "DB Fusion SC"; src: url(fonts/fusion-zh_hans.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "DB Fusion TC"; src: url(fonts/fusion-zh_tw.woff2) format("woff2"); font-display: swap; }

:root {
  --ink: #0B0710;
  --ink-2: #140E1F;
  --ink-3: #1E1428;
  --stone: #3A2A3C;
  --bone: #F2E3C6;
  --parchment: #E3CDA4;
  --muted: #A98B6B;
  --ember: #E0873A;
  --gold: #F5C05C;
  --glow: #FFE9A8;
  --blood: #B2403F;
  --blood-light: #D66A51;
  /* The heading font and one step of its pixel grid. */
  --pixel: "DB Pixel", system-ui, sans-serif;
  --px: 16px;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --wrap: 1312px;
  color-scheme: dark;
}
:root:lang(ja) { --pixel: "DB Fusion JA", system-ui, sans-serif; --px: 12px; }
:root:lang(ko) { --pixel: "DB Fusion KO", system-ui, sans-serif; --px: 12px; }
:root:lang(zh-CN) { --pixel: "DB Fusion SC", system-ui, sans-serif; --px: 12px; }
:root:lang(zh-TW) { --pixel: "DB Fusion TC", system-ui, sans-serif; --px: 12px; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); color: var(--parchment); font: 18px/1.6 var(--body); -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body { margin: 0; }
img, video { max-width: 100%; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--glow); }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }

h1, h2, h3, .tagline, .question, .btn, .top nav, .lang summary, .brand {
  font-family: var(--pixel);
  font-weight: normal;
  -webkit-font-smoothing: none;
}
h1, h2, h3 { color: var(--gold); line-height: 1.15; margin: 0 0 0.5em; overflow-wrap: break-word; hyphens: auto; }
h1 { font-size: calc(var(--px) * 3); text-shadow: 0 3px 0 var(--ink); }
h2 { font-size: calc(var(--px) * 2); text-shadow: 0 2px 0 var(--ink); }
h3 { font-size: calc(var(--px) * 2); color: var(--bone); }
@media (min-width: 720px) {
  h2 { font-size: calc(var(--px) * 3); text-shadow: 0 3px 0 var(--ink); }
}
p { margin: 0 0 1em; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--ink); padding: 8px 16px; }
.skip:focus { left: 16px; }

/* The game's frames. */
.panel, .card, .btn, .shot, .lang ul {
  border: 8px solid transparent;
  border-image: url(ui/panel.png) 4 fill / 8px stretch;
  image-rendering: pixelated;
}
.card, .lang ul { border-image-source: url(ui/tooltip.png); }
.panel, .card { padding: 12px 16px; }

.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 14px 4px;
  border-image-source: url(ui/button_normal.png);
  color: var(--parchment); text-decoration: none; font-size: calc(var(--px) * 2); line-height: 1.1;
}
a.btn:hover, a.btn:focus-visible { border-image-source: url(ui/button_hover.png); color: var(--glow); }
a.btn:active { border-image-source: url(ui/button_pressed.png); }
.btn.soon { border-image-source: url(ui/button_disabled.png); color: var(--parchment); cursor: default; }
.btn small { font-size: var(--px); color: var(--muted); line-height: 1.3; }

/* Top bar. */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px;
  padding: 8px 24px; background: rgb(11 7 16 / 0.94); border-bottom: 2px solid var(--stone);
}
.brand { font-family: "DB Logo", var(--pixel); font-size: 26px; color: var(--gold); text-decoration: none; line-height: 1; padding-bottom: 4px; }
.top nav { font-size: calc(var(--px) * 2); order: 3; flex-basis: 100%; overflow-x: auto; }
.top nav ul { display: flex; gap: 0 20px; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
.top nav a { color: var(--parchment); text-decoration: none; line-height: 1.6; }
.top nav a:hover, .top nav a[aria-current] { color: var(--gold); }
@media (min-width: 1100px) {
  .top nav { order: 0; flex-basis: auto; flex: 1; }
}
.lang { position: relative; margin-left: auto; }
.lang summary { cursor: pointer; list-style: none; font-size: calc(var(--px) * 2); color: var(--parchment); line-height: 1.6; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ""; display: inline-block; margin-left: 8px; border: 6px solid transparent; border-top-color: currentColor; vertical-align: middle; transform: translateY(3px); }
.lang ul {
  position: absolute; right: 0; top: 100%; z-index: 11; margin: 4px 0 0; padding: 8px 12px;
  list-style: none; columns: 2; column-gap: 24px; width: max-content; max-width: calc(100vw - 32px);
  font: 16px/1.9 var(--body);
}
.lang ul a { color: var(--parchment); text-decoration: none; }
.lang ul a:hover, .lang ul a[aria-current] { color: var(--gold); }

.suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 24px; background: var(--ink-3); border-bottom: 2px solid var(--stone); }
.suggest[hidden] { display: none; }
.suggest p { margin: 0; }
.suggest button { font: inherit; color: var(--muted); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 4px; }

/* Hero: the key art at whole-pixel scale (1x narrow, 2x and 3x wide), cropped, never resampled. */
.hero { position: relative; background: #0B0710; }
.hero-art img { display: block; width: 100%; height: 280px; object-fit: none; object-position: 50% 100%; image-rendering: pixelated; }
.hero-text { padding: 24px 24px 0; max-width: 680px; }
.logo { font-family: "DB Logo", var(--pixel); font-size: 52px; line-height: 1.1; margin: 0; text-shadow: 0 4px 0 var(--ink); }
.tagline { font-size: calc(var(--px) * 2); color: var(--bone); margin: 4px 0 12px; line-height: 1.2; }
.pitch { max-width: 34em; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.stores .btn { max-width: 100%; text-align: center; }
@media (min-width: 720px) {
  .hero-art img { height: 640px; object-position: 64% 100%; }
  .hero-text {
    position: absolute; inset: 0 auto 0 0; max-width: none; width: min(100%, 720px);
    display: flex; flex-direction: column; justify-content: center;
    padding: 24px 32px 24px max(24px, calc((100vw - var(--wrap)) / 2));
    background: linear-gradient(90deg, rgb(11 7 16 / 0.8) 0%, rgb(11 7 16 / 0.55) 60%, rgb(11 7 16 / 0));
  }
  .logo { font-size: 78px; text-shadow: 0 6px 0 var(--ink); }
}
@media (min-width: 1280px) {
  .hero-art img { height: 800px; object-position: 62% 45%; }
  .hero-text { width: calc(max(24px, (100vw - var(--wrap)) / 2) + 680px); }
}

/* Sections. */
.wrap { max-width: calc(var(--wrap) + 48px); margin: 0 auto; padding: 0 24px; }
main > section, main > .wrap { padding-top: 64px; }
.lead { font-size: 20px; max-width: 40em; color: var(--bone); }
.clip .video { padding: 0; max-width: calc(1280px + 16px); margin: 0 auto; }
.clip video { display: block; width: 100%; height: auto; image-rendering: pixelated; background: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.card h3 { color: var(--gold); }
.card p:last-child { margin-bottom: 0; }

.story p { font-size: 20px; color: var(--bone); max-width: 40em; }
.question { font-size: calc(var(--px) * 2); color: var(--gold); line-height: 1.3; max-width: 30em; border-left: 4px solid var(--blood); padding-left: 16px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 24px 32px; }
.shot { margin: 0; padding: 0; border-image-source: url(ui/inset.png); border-image-slice: 3 fill; border-image-width: 6px; border-width: 6px; }
.shot img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.shot figcaption { padding: 8px 10px 6px; color: var(--parchment); font-size: 16px; background: var(--ink-2); }

.features { columns: 2 22em; column-gap: 40px; margin: 0; padding: 16px 20px; list-style: none; }
.features li { position: relative; padding-left: 22px; margin-bottom: 8px; break-inside: avoid; }
.features li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; background: var(--ember); box-shadow: 2px 2px 0 var(--blood); }

.platforms .card { display: flex; flex-direction: column; align-items: flex-start; }
.platforms .btn { margin-top: auto; }
.demo-includes { margin-bottom: 24px; }
.demo-sums { margin: 16px 0 1em; }
.beta-payment { margin-bottom: 24px; max-width: 52em; }
.beta-payment strong { color: var(--gold); font-size: 1.15em; }
.beta-payment p:last-child { margin-bottom: 0; }
.beta-step .btn { max-width: 100%; overflow-wrap: anywhere; text-align: center; }
.beta-demo { margin-bottom: 24px; max-width: 64em; }
.beta-demo .btn { max-width: 100%; overflow-wrap: anywhere; text-align: center; margin: 4px 8px 4px 0; }
.beta-steps { margin: 0 0 24px; padding: 0; list-style: none; display: grid; gap: 20px; max-width: 64em; }
.beta-step h3 { color: var(--gold); }
.beta-n { display: inline-block; min-width: 1.6em; text-align: center; background: var(--blood); color: var(--parchment); margin-right: 6px; }
.beta-step .beta-shots { margin-top: 12px; align-items: start; }
.beta-shots a { display: block; }
.beta-help { max-width: 52em; margin-top: 24px; }
.beta-help details { border-top: 1px solid var(--stone); padding: 12px 0; }
.beta-help summary { color: var(--gold); cursor: pointer; }
.beta-help details > p { margin: 12px 0; }
.beta-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.beta-shots figure { margin: 0; min-width: 0; }
.beta-shots img { display: block; width: auto; max-width: 100%; height: auto; max-height: 560px; }
.beta-shots figcaption { margin-top: 8px; font-size: 16px; }

/* What makes it different: three pictures with a title and a line each; one column on a phone. */
.why { display: grid; gap: 32px; margin: 0; padding: 0; list-style: none; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .why { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.why-item img { display: block; width: 100%; height: auto; image-rendering: pixelated; border-width: 6px; border-style: solid; border-color: transparent; border-image: url(ui/inset.png) 3 fill / 6px stretch; }
.why-item h3 { margin: 0.6em 0 0.3em; }

/* Duel page: the code in a read-only box that wraps and scrolls, and a copy button. */
.duel-code {
  display: block; width: 100%; min-height: 8rem; max-height: 20rem; resize: vertical; overflow: auto;
  margin: 16px 0; padding: 12px 14px; color: var(--bone); background: var(--ink-2);
  border: 2px solid var(--stone); border-radius: 0;
  font: 16px/1.5 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; overflow-wrap: anywhere; word-break: break-all;
}
.duel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
button.btn { background: none; cursor: pointer; font-family: var(--pixel); }
button.btn:hover, button.btn:focus-visible { border-image-source: url(ui/button_hover.png); color: var(--glow); }
button.btn:active { border-image-source: url(ui/button_pressed.png); }

/* Press kit and plain text pages. */
.press h1 { margin-top: 0; }
.facts { width: 100%; border-collapse: separate; border-spacing: 0; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 6px 12px; border-bottom: 1px solid var(--stone); }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }
.facts th { color: var(--muted); font-weight: normal; width: 12em; }
.downloads { padding-left: 1.2em; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.thumbs img { display: block; width: 100%; height: auto; border: 2px solid var(--stone); }
.prose { max-width: calc(46em + 48px); padding-bottom: 32px; }
.prose h1 { font-size: calc(var(--px) * 2); }
.prose h2 { font-size: calc(var(--px) * 2); margin-top: 1.4em; }
.prose hr { border: 0; border-top: 2px solid var(--stone); margin: 48px 0; }
.langs { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; list-style: none; }

.foot { margin-top: 80px; padding: 32px 24px 40px; border-top: 2px solid var(--stone); background: var(--ink-2); color: var(--muted); font-size: 16px; text-align: center; }
.foot ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; margin: 0 0 12px; padding: 0; list-style: none; }
.foot p { margin: 0 0 6px; }

/* Changelog: one panel per release. */
.changelog .release { margin: 16px 0; }
.changelog .release h2 { margin: 0; }
