/* Beasts vs Undead - ember (beasts) vs ghost teal (undead) on near-black. */
:root {
  --bg: #0e0d0c;
  --panel: #191715;
  --line: #2c2824;
  --text: #e9e1d3;
  --muted: #a69c8c;
  --ember: #e0703a;
  --ghost: #5fd1c1;
  --heading: "Cinzel", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 "Inter", system-ui, sans-serif;
}
img { max-width: 100%; display: block; }
a { color: var(--ghost); }
a:hover { color: var(--ember); }
h1, h2, h3 { font-family: var(--heading); line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.small { color: var(--muted); font-size: .9rem; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
  padding: .75rem 1.25rem;
  background: rgba(14, 13, 12, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.brand { font-family: var(--heading); font-weight: 800; font-size: 1.2rem; color: var(--text); text-decoration: none; letter-spacing: .03em; }
.brand span, .hero h1 span { color: var(--ember); }
.topbar nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.topbar nav a:hover { color: var(--text); }

/* Hero */
.hero {
  min-height: min(88vh, 820px);
  display: flex; align-items: flex-end;
  background-size: cover; background-position: center;
  position: relative;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 2%, rgba(14,13,12,.75) 35%, rgba(14,13,12,.15) 75%);
}
.hero { isolation: isolate; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero::before { z-index: 1; }
@media (prefers-reduced-motion: reduce) { .hero-video { display: none; } }
.clips { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.clips figure { margin: 0; }
.clips video { width: 100%; border-radius: 6px; background: #000; display: block; }
.clips figcaption { color: var(--ghost); font-size: .9rem; margin-top: .4rem; }
.hero-text { z-index: 2; position: relative; max-width: 760px; padding: 2rem 1.25rem 4rem; margin-left: max(1.25rem, 6vw); }
.kicker { color: var(--ghost); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; margin: 0 0 .75rem; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 5.2rem); font-weight: 800; text-shadow: 0 4px 30px #000; }
.pitch { font-size: 1.15rem; max-width: 640px; }
.buttons { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.button {
  display: inline-block; padding: .8rem 1.4rem; border-radius: 4px;
  border: 1px solid var(--muted); color: var(--text); text-decoration: none; font-weight: 600;
}
.button:hover { border-color: var(--ghost); color: var(--ghost); }
.button.primary { background: var(--ember); border-color: var(--ember); color: #1a0d06; }
.button.primary:hover { background: #f08a55; color: #1a0d06; }

/* Feature rows, image alternating sides */
.features { max-width: 1150px; margin: 0 auto; padding: 4rem 1.25rem 2rem; display: grid; gap: 4rem; }
.feature { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; align-items: center; }
.feature:nth-child(even) img { order: 2; }
.feature img { border-radius: 6px; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.feature h2 { color: var(--text); }
.feature:nth-child(odd) h2 { border-left: 3px solid var(--ember); padding-left: .75rem; }
.feature:nth-child(even) h2 { border-left: 3px solid var(--ghost); padding-left: .75rem; }
.feature p { color: var(--muted); }

/* Screenshots */
.gallery, .latest, .page { max-width: 1150px; margin: 0 auto; padding: 3rem 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; margin-top: 1rem; }
.grid img { border-radius: 4px; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; transition: transform .2s; }
.grid a:hover img { transform: scale(1.02); }

/* Devlog cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin: 1rem 0 1.5rem; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; color: var(--text); text-decoration: none;
}
.card:hover { border-color: var(--ember); color: var(--text); }
.card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.card .date, .card h3, .card p { margin-left: 1rem; margin-right: 1rem; }
.card .date { display: block; margin-top: .9rem; }
.card p { color: var(--muted); font-size: .95rem; }
.date { color: var(--muted); font-size: .85rem; }
.draft { color: var(--ember); }

/* Single post */
.post { max-width: 760px; }
.post h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.post-image { border-radius: 6px; margin: 1rem 0 2rem; }
.post-body img { border-radius: 6px; margin: 1.5rem 0; }
.post-body h2 { margin-top: 2rem; font-size: 1.5rem; }
.post-body iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 6px; }

/* Follow box */
.follow {
  max-width: 760px; margin: 2rem auto 4rem; padding: 2.5rem 1.5rem; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
}
.follow > p:first-of-type { color: var(--muted); }
.signup { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 1.5rem 0; }
.signup input {
  flex: 1 1 240px; max-width: 340px; padding: .8rem 1rem; border-radius: 4px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
.signup button {
  padding: .8rem 1.4rem; border-radius: 4px; border: 0; font: inherit; font-weight: 600;
  background: var(--ember); color: #1a0d06; cursor: pointer;
}
.signup button:disabled, .signup input:disabled { opacity: .55; cursor: not-allowed; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 2rem 1.25rem; text-align: center; color: var(--muted); font-size: .9rem; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; margin-bottom: 1rem; }
.socials a { color: var(--text); text-decoration: none; }
.socials a:hover { color: var(--ghost); }

/* Header additions */
.topbar nav a.current { color: var(--text); border-bottom: 2px solid var(--ember); }
.button.small { padding: .35rem .8rem; font-size: .85rem; }
.button.kofi { border-color: var(--ember); color: var(--ember); }
.button.kofi:hover { background: var(--ember); color: #1a0d06; }
.buttons.center { justify-content: center; }
/* "Demo coming 2027" box where the old demo button was (Jan 2026-12-03: old 2025 builds unlinked) */
.demo-soon { display: inline-block; margin-top: 1.25rem; padding: .7rem 1.1rem; border: 1px solid var(--ember);
  border-radius: 6px; background: rgba(0, 0, 0, .45); color: inherit; text-decoration: none; }
.demo-soon b { color: var(--ember); }
.demo-soon:hover { background: rgba(0, 0, 0, .65); }
.lead { font-size: 1.1rem; }
.todo { color: #ffd37a; background: rgba(255, 211, 122, .08); border: 1px dashed #8a6a2a; border-radius: 4px; padding: .1rem .4rem; }
p.todo { padding: .6rem .8rem; }
.page .features { padding-left: 0; padding-right: 0; }

/* Game page */
.factions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.faction { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.25rem; }
.faction.beasts { border-top: 3px solid var(--ember); }
.faction.undead { border-top: 3px solid var(--ghost); }
.faction h3 { margin-bottom: .25rem; }

/* Play */
.build { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.5rem 1.25rem; margin: 1rem 0 2rem; }

/* Bestiary */
.bestiary-group { margin-top: 2.5rem; }
.bestiary-group.beasts h2 { border-left: 3px solid var(--ember); padding-left: .75rem; }
.bestiary-group.undead h2 { border-left: 3px solid var(--ghost); padding-left: .75rem; }
.bestiary-group.neutral h2 { border-left: 3px solid var(--muted); padding-left: .75rem; }
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-top: 1rem; }
.unit-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .5rem; color: var(--text); text-decoration: none; text-align: center; }
.unit-card:hover { border-color: var(--ember); color: var(--text); }
.unit-card h3 { font-size: .95rem; margin: .5rem 0 .1rem; }
.unit-card img { aspect-ratio: 1; width: 100%; height: auto; object-fit: cover; border-radius: 4px; }
.units-text { margin-top: .75rem; }
.units-text .unit-card { padding: .6rem .5rem; }
.units-text .unit-card h3 { margin-top: 0; }
.unit-layout.no-pictures { grid-template-columns: minmax(0, 1fr); max-width: 46rem; }
.unit-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 2rem; margin-top: 1rem; align-items: start; }
.unit-art img { border-radius: 6px; border: 1px solid var(--line); margin-bottom: .75rem; }
.badge { display: inline-block; margin: 0 0 .5rem; padding: .1rem .7rem; border-radius: 99px; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--muted); }
.badge.beasts { color: var(--ember); border-color: var(--ember); }
.badge.undead { color: var(--ghost); border-color: var(--ghost); }
.stats { border-collapse: collapse; margin: 1rem 0; min-width: 14rem; }
.stats th, .stats td { text-align: left; padding: .25rem 1.5rem .25rem 0; border-bottom: 1px solid var(--line); }
.stats th { color: var(--muted); font-weight: 400; }
.facts { padding-left: 1.1rem; color: var(--muted); }
.facts b { color: var(--text); }
.pager { display: flex; justify-content: space-between; margin-top: 3rem; }

/* Old pages (tools, tutorials, about ...) inside the new look: calm archive layout */
.archive .cards .card h3.pad { margin: .9rem 1rem .25rem; }
.legacy { font-size: 1rem; }
.legacy img { display: inline-block; height: auto; border-radius: 4px; }
.legacy .div_paragraph, .legacy .div_paragraph_collapsible { margin: 0 0 1.25rem; }
.legacy .div_paragraph { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.25rem; overflow: auto; }
.legacy font { color: inherit; }
.legacy h3 { font-size: 1.15rem; }
.legacy iframe { max-width: 100%; border: 0; border-radius: 6px; }
details.fold { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; margin: .75rem 0; }
details.fold > summary { cursor: pointer; padding: .75rem 1rem; font-weight: 600; }
details.fold[open] > summary { border-bottom: 1px solid var(--line); color: var(--ember); }
details.fold > :not(summary) { margin-left: 1.25rem; margin-right: 1.25rem; }
details.fold::after { content: ""; display: block; clear: both; height: .75rem; }
.legacy .regular_button, .legacy .send_button, .legacy button[type=submit] {
  padding: .7rem 1.2rem; border-radius: 4px; border: 1px solid var(--ember); background: var(--ember); color: #1a0d06; font: inherit; font-weight: 600; cursor: pointer; max-width: 100%; white-space: normal; }
.legacy input[type=text], .legacy input[type=email], .legacy textarea {
  width: 100%; max-width: 560px; padding: .7rem .9rem; border-radius: 4px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.legacy label { display: block; margin-top: .75rem; }
.legacy .embed-pdf, .legacy .pdf_container { max-width: 100%; }
.legacy .embed-pdf { width: 100%; height: 70vh; }
.legacy ul { padding-left: 1.4rem; }
.legacy .module-section { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.25rem; margin: 1rem 0; }
.legacy pre, .legacy .code-block, .legacy code { background: #121110; border: 1px solid var(--line); border-radius: 4px; color: #d8cfc0; font-family: Consolas, monospace; font-size: .9rem; }
.legacy code { padding: .05rem .3rem; }
.legacy pre, .legacy .code-block { padding: .75rem 1rem; overflow-x: auto; margin: .75rem 0; }
.legacy #toc { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .5rem 1.25rem; }
.legacy table { max-width: 100%; display: block; overflow-x: auto; }

@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; gap: 1.25rem; }
  .feature:nth-child(even) img { order: 0; }
  .hero-text { margin-left: 0; padding-bottom: 2.5rem; }
  .features { gap: 3rem; }
  .unit-layout { grid-template-columns: 1fr; }
  .topbar { padding: .6rem .9rem; }
  .topbar nav { gap: .15rem .9rem; flex-basis: 100%; order: 3; }
  .topbar nav a { font-size: .9rem; }
  .button.small { order: 2; }
  .gallery, .latest, .page { padding-top: 2rem; padding-bottom: 2rem; }
}
.small-h { font-size: 1.15rem; margin-top: 1.5rem; }
.abilities { padding-left: 1.1rem; color: var(--muted); }
.abilities b { color: var(--text); }
.narrow { max-width: 680px; }
.center-text { text-align: center; }
.signup-embed { max-width: 460px; margin: 1.25rem auto; }
