/* The Hero's Legacy - site styles. Plain CSS, no framework. */

@font-face {
  font-family: "Hearthmark Title";
  src: url("../assets/fonts/HearthmarkPixel-Title.woff") format("woff"),
       url("../assets/fonts/HearthmarkPixel-Title.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Hearthmark";
  src: url("../assets/fonts/HearthmarkPixel-Regular.woff") format("woff"),
       url("../assets/fonts/HearthmarkPixel-Regular.ttf") format("truetype");
  font-display: swap;
}

/* ---------- Colour tokens (dark = default, warm hearth palette) ---------- */
:root {
  color-scheme: dark;
  --bg: #16100d;
  --bg-2: #1f1612;
  --surface: #2a1e17;
  --surface-2: #362619;
  --border: #5a3f29;
  --text: #f1e4cf;
  --muted: #cdb594;
  --accent: #f4ba4f;        /* gold, links + headings */
  --ember: #e86a2c;
  --btn-bg: #f4ba4f;
  --btn-text: #1a110b;
  --btn-bg-hover: #ffd27a;
  --focus: #ffe08a;
  --todo-bg: #3a1f2a;
  --todo-border: #ec8fb0;
  --shadow: 0 4px 0 #0b0806;
  --gutter: 16px;
  --max: 1120px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3e9d6;
    --bg-2: #eadcc1;
    --surface: #fbf4e6;
    --surface-2: #efe2c8;
    --border: #9c7a55;
    --text: #2a1c12;
    --muted: #5a4330;
    --accent: #8a3f0e;
    --ember: #a8481a;
    --btn-bg: #8a3f0e;
    --btn-text: #fff8ec;
    --btn-bg-hover: #6e300a;
    --focus: #1d5fbf;
    --todo-bg: #fbe3ec;
    --todo-border: #a2325a;
    --shadow: 0 4px 0 #c9b28c;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3e9d6;
  --bg-2: #eadcc1;
  --surface: #fbf4e6;
  --surface-2: #efe2c8;
  --border: #9c7a55;
  --text: #2a1c12;
  --muted: #5a4330;
  --accent: #8a3f0e;
  --ember: #a8481a;
  --btn-bg: #8a3f0e;
  --btn-text: #fff8ec;
  --btn-bg-hover: #6e300a;
  --focus: #1d5fbf;
  --todo-bg: #fbe3ec;
  --todo-border: #a2325a;
  --shadow: 0 4px 0 #c9b28c;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
.pixel { image-rendering: pixelated; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ember); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

/* Hearthmark is drawn on an 8 px grid: keep heading sizes on multiples of 8. */
h1, h2, h3, .pixel-font {
  font-family: "Hearthmark Title", "Hearthmark", ui-monospace, monospace;
  font-weight: normal;
  letter-spacing: 0;
  line-height: 1.25;
  -webkit-font-smoothing: none;
  font-smooth: never;
}
h2 { font-size: 32px; color: var(--accent); margin: 0 0 16px; }
h3 { font-size: 24px; color: var(--accent); margin: 0 0 8px; }
p { margin: 0 0 16px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 64px 0; }
.section.alt { background: var(--bg-2); border-block: 2px solid var(--border); }
.lead { font-size: 19px; color: var(--muted); max-width: 46em; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--btn-bg); color: var(--btn-text); padding: 8px 16px; font-weight: 700;
}
.skip-link:focus { top: 8px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 2px solid var(--border);
  backdrop-filter: blur(4px);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand img { width: 32px; height: 32px; }
.brand span { font-family: "Hearthmark Title", monospace; font-size: 16px; -webkit-font-smoothing: none; }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a { font-family: "Hearthmark", monospace; font-size: 16px; text-decoration: none; color: var(--text); padding: 8px 0; -webkit-font-smoothing: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.theme-toggle {
  font: 16px "Hearthmark", monospace; background: transparent; color: var(--text);
  border: 2px solid var(--border); padding: 4px 8px; cursor: pointer; border-radius: 2px;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
  .brand span { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Hearthmark Title", monospace; font-size: 16px; -webkit-font-smoothing: none;
  text-decoration: none; text-transform: none;
  background: var(--btn-bg); color: var(--btn-text);
  border: 2px solid #000; border-radius: 2px;
  padding: 12px 20px; box-shadow: var(--shadow);
  transition: transform .08s ease, background .12s ease;
}
.btn:hover { background: var(--btn-bg-hover); color: var(--btn-text); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.big { font-size: 24px; padding: 16px 28px; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); box-shadow: none; }
.btn.ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn svg { width: 24px; height: 24px; flex: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; text-align: center;
  padding: 40px 0 56px; overflow: hidden;
  background: #120c0a;
  color: #f1e4cf;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
  image-rendering: pixelated;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 60% 45% at 50% 38%, rgba(18,12,10,0) 0%, rgba(18,12,10,.25) 100%),
    linear-gradient(to bottom, rgba(18,12,10,0) 0%, rgba(18,12,10,.1) 44%, rgba(18,12,10,.82) 58%, rgba(18,12,10,.95) 100%);
}
.hero h1 { margin: 72px auto 0; width: max-content; max-width: 100%; }
.hero h1 img { width: 620px; max-width: 100%; height: auto; }    /* 4x native 155 px (file is 8x) */
.hero .tagline {
  font-family: "Hearthmark Title", monospace; -webkit-font-smoothing: none;
  font-size: 24px; color: #ffd27a; margin: 16px 0 8px; text-shadow: 0 2px 0 #000;
}
.hero .pitch { font-size: 19px; color: #f8eedc; max-width: 36em; margin: 0 auto 24px; text-shadow: 0 1px 2px #000; }
.hero .cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero .cta .btn.ghost { color: #f1e4cf; border-color: #8a6a4a; background: rgba(0,0,0,.35); }
.hero .cta .btn { --btn-bg: #f4ba4f; --btn-text: #1a110b; --btn-bg-hover: #ffd27a; }
.hero .meta { margin-top: 8px; font-size: 15px; color: #e3cfae; }
.hero .launch {
  display: inline-block; margin: 24px 0 0; padding: 8px 16px;
  font-family: "Hearthmark Title", monospace; font-size: 16px; -webkit-font-smoothing: none;
  color: #ffd27a; background: rgba(0,0,0,.55); border: 2px solid #e86a2c; text-shadow: 0 2px 0 #000;
}
@media (max-width: 640px) {
  .hero h1 img { width: 310px; }               /* 2x native */
  .hero h1 { margin-top: 48px; }
  .hero-bg { height: 420px; }               /* keep the bosses behind the logo, not the text */
  .hero::after { background: linear-gradient(to bottom, rgba(18,12,10,0) 0, rgba(18,12,10,.1) 220px, rgba(18,12,10,.95) 400px); }
  .hero .tagline { font-size: 16px; }
  .btn.big { font-size: 16px; padding: 14px 20px; }
}

/* ---------- Feature cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 24px; margin-top: 32px; }
.card {
  background: var(--surface); border: 2px solid var(--border); border-radius: 2px;
  padding: 24px; box-shadow: var(--shadow);
}
.card p { color: var(--text); margin: 0; }
.card .kicker { font: 16px "Hearthmark", monospace; color: var(--ember); display: block; margin-bottom: 4px; -webkit-font-smoothing: none; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; margin: 32px 0 0; padding: 0; list-style: none; }
.gallery figure { margin: 0; }
.gallery a { display: block; border: 2px solid var(--border); background: #000; line-height: 0; }
.gallery a:hover, .gallery a:focus-visible { border-color: var(--accent); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery figcaption { font-size: 15px; color: var(--muted); padding-top: 6px; }

/* Lightbox (a <dialog>) */
.lightbox {
  border: 2px solid var(--border); padding: 0; background: #0d0907; color: #f1e4cf;
  width: min(96vw, 1920px); max-width: 96vw; max-height: 96vh;
}
.lightbox { position: relative; }
.lightbox .lb-x { position: absolute; top: 8px; right: 8px; z-index: 1; font-size: 20px; line-height: 1; padding: 6px 10px; background: rgba(13, 9, 7, .85); }
.lightbox::backdrop { background: rgba(5, 3, 2, .88); }
.lightbox img { width: 100%; height: auto; max-height: calc(96vh - 64px); object-fit: contain; }
.lightbox .lb-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.lightbox .lb-cap { flex: 1; font-size: 15px; }
.lightbox button {
  font: 16px "Hearthmark", monospace; background: #2a1e17; color: #f1e4cf;
  border: 2px solid #5a3f29; padding: 6px 12px; cursor: pointer; min-width: 44px; min-height: 40px;
}
.lightbox button:hover { border-color: #f4ba4f; color: #f4ba4f; }

/* ---------- Trailer slot ---------- */
.trailer-slot {
  aspect-ratio: 16 / 9; width: 100%; max-width: 860px; margin: 24px auto 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: repeating-linear-gradient(0deg, var(--surface) 0 6px, var(--surface-2) 6px 8px);
  border: 2px dashed var(--border); padding: 16px;
}
.trailer-slot strong { font: 32px "Hearthmark Title", monospace; color: var(--accent); display: block; -webkit-font-smoothing: none; }
@media (max-width: 640px) { .trailer-slot strong { font-size: 24px; } }
.trailer-poster { position: relative; display: block; max-width: 860px; margin: 24px auto 0; border: 2px solid var(--border); }
.trailer-poster img { display: block; width: 100%; height: auto; }
.trailer-poster .btn { position: absolute; right: 16px; bottom: 16px; white-space: nowrap; }
@media (max-width: 600px) { .trailer-poster .btn { right: 8px; bottom: 8px; padding: 6px 10px; font-size: 12px; } }
.trailer-poster:hover .btn, .trailer-poster:focus-visible .btn { background: var(--btn-bg-hover); }
.trailer-frame { position: relative; max-width: 860px; margin: 24px auto 0; border: 2px solid var(--border); aspect-ratio: 16 / 9; background: #000; }
.trailer-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.trailer-note { text-align: center; color: var(--muted); font-size: 14px; margin: 12px 0 0; }

/* ---------- Legacy pitch ---------- */
.legacy { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.legacy figure { margin: 0; }
.legacy img { border: 2px solid var(--border); }
.legacy ol, .legacy ul { padding-left: 1.3em; margin: 0 0 16px; }
.legacy li { margin-bottom: 8px; }
@media (max-width: 860px) { .legacy { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { max-width: 52em; margin-top: 24px; }
.faq details { background: var(--surface); border: 2px solid var(--border); margin-bottom: 12px; border-radius: 2px; }
.faq summary {
  cursor: pointer; padding: 14px 16px; font: 16px "Hearthmark Title", monospace; color: var(--accent);
  -webkit-font-smoothing: none; list-style-position: inside;
}
.faq details > div { padding: 0 16px 8px; }

/* ---------- Final CTA ---------- */
.cta-band { text-align: center; }
.cta-band .btn { margin-top: 8px; }

/* ---------- TODO blocks (clearly marked, never presented as real) ---------- */
.todo {
  background: var(--todo-bg); border: 2px dashed var(--todo-border); color: var(--text);
  padding: 12px 16px; margin: 16px 0; font-size: 15px;
}
.todo::before { content: "TODO (Zacker): "; font-weight: 700; color: var(--todo-border); }

/* ---------- Press page ---------- */
.facts { width: 100%; border-collapse: collapse; margin: 16px 0 24px; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.facts th { width: 34%; color: var(--muted); font-weight: 600; }
.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 16px; padding: 0; list-style: none; }
.downloads li { background: var(--surface); border: 2px solid var(--border); padding: 12px; }
.downloads img { background: repeating-conic-gradient(#3a2a20 0 25%, #2a1e17 0 50%) 0 0 / 16px 16px; margin-bottom: 8px; width: 100%; aspect-ratio: 16/9; object-fit: contain; }
.downloads span { display: block; font-size: 14px; color: var(--muted); }
.prose > * { max-width: 48em; }
.prose blockquote { margin: 0 0 16px; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--surface); }
.prose ul { padding-left: 1.3em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 2px solid var(--border); background: var(--bg-2); padding: 40px 0 32px; font-size: 15px; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; }
.site-footer h2 { font-size: 16px; margin-bottom: 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer .small { color: var(--muted); margin-top: 24px; }

/* ---------- Cookie choice (X pixel) ---------- */
.consent { position: fixed; left: var(--gutter); right: var(--gutter); bottom: var(--gutter); z-index: 50; max-width: 640px; margin: 0 auto; padding: 16px; background: var(--surface); color: var(--text); border: 2px solid var(--border); box-shadow: var(--shadow); font-size: 15px; }
.consent p { margin: 0 0 12px; }
.consent-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.consent .btn { font-size: 16px; padding: 8px 18px; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 96px 0; }
.notfound img { margin: 0 auto 24px; width: 310px; }

/* ---------- Page titles (press / privacy) ---------- */
.page-title { font-size: 40px; color: var(--accent); margin: 0 0 16px; }
@media (max-width: 640px) { .page-title { font-size: 32px; } }
