:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --ink: #141513;
  --muted: #5d635f;
  --line: #d8d2c5;
  --red: #8d1f1f;
  --red-dark: #5c1616;
  --gold: #b8872f;
  --green: #1f6b4b;
  --steel: #59666b;
  --shadow: 0 18px 45px rgba(28, 24, 18, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: var(--red);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 21, 19, 0.92);
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  background: var(--red);
  font-size: 14px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.top-nav a {
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
}

.language-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 30px;
  padding: 4px 7px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
}

.language-switcher a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 520px;
  overflow: hidden;
  background: #1c1b18;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: rgba(18, 15, 12, 0.68);
}

.hero-content {
  position: relative;
  width: min(920px, calc(100% - 36px));
  padding: 96px clamp(18px, 4vw, 56px) 64px;
  color: #fff;
}

.hero h1,
.page-hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.98;
}

.hero p {
  max-width: 720px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
}

.button.primary {
  background: var(--gold);
  color: #15110b;
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
}

.section,
.page-hero {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.section {
  padding: 54px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section h2,
.planner-output h2,
.plain-panel h3,
.source-card h2 {
  margin: 0 0 12px;
  line-height: 1.15;
}

.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-grid,
.faction-grid,
.source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card,
.faction-card,
.source-card,
.plain-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card,
.source-card,
.plain-panel {
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.1;
}

.stat-card p,
.plain-panel p,
.source-card p {
  color: var(--muted);
}

.two-column,
.split-lists {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: start;
}

.faction-card {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border-top: 6px solid var(--red);
}

.faction-card.orks {
  border-top-color: var(--green);
}

.faction-card.necrons {
  border-top-color: var(--steel);
}

.faction-card.adeptus-mechanicus {
  border-top-color: var(--gold);
}

.faction-card h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.text-link {
  font-weight: 800;
}

.tool-band,
.planner-shell,
.unit-tool {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.picker-form,
.planner-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

select,
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}

.picker-result {
  grid-column: 1 / -1;
  min-height: 56px;
  padding: 14px;
  border-left: 4px solid var(--gold);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.page-hero {
  padding: 72px 0 34px;
}

.page-hero.compact h1,
.faction-hero h1 {
  color: var(--ink);
  font-size: clamp(38px, 6vw, 64px);
}

.page-hero p {
  max-width: 780px;
  color: var(--muted);
  font-size: 19px;
}

.faction-hero {
  padding-bottom: 42px;
  border-bottom: 6px solid var(--red);
}

.faction-hero.orks {
  border-color: var(--green);
}

.faction-hero.necrons {
  border-color: var(--steel);
}

.faction-hero.adeptus-mechanicus {
  border-color: var(--gold);
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.source-row a {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.check-list {
  margin: 0;
  padding-left: 20px;
}

.check-list li + li {
  margin-top: 10px;
}

.status-note {
  padding: 12px 14px;
  border-left: 4px solid var(--red);
  background: #fff;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #ede7dc;
  color: #2b2a27;
  font-size: 13px;
  text-transform: uppercase;
}

.planner-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.6fr) minmax(0, 1fr);
  gap: 28px;
}

.planner-controls {
  align-self: start;
  grid-template-columns: 1fr;
}

.planner-output {
  min-height: 240px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.planner-output li + li {
  margin-top: 12px;
}

.source-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-card a {
  overflow-wrap: anywhere;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.related-card {
  display: grid;
  gap: 8px;
  color: var(--ink);
}

.related-card span {
  color: var(--muted);
}

.faq-section {
  display: grid;
  gap: 16px;
}

.faq-section .section-head {
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: #191a17;
  color: rgba(255, 255, 255, 0.82);
}

.site-footer a {
  color: #f2c66d;
}

.site-footer p {
  max-width: 700px;
  margin: 8px 0 0;
}

.site-footer div:last-child {
  display: grid;
  gap: 8px;
  text-align: right;
}

@media (max-width: 920px) {
  .stat-grid,
  .faction-grid,
  .source-grid,
  .related-grid,
  .two-column,
  .split-lists,
  .planner-shell {
    grid-template-columns: 1fr 1fr;
  }

  .planner-shell,
  .two-column,
  .split-lists {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: 500px;
  }

  .hero-content {
    padding-top: 80px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 42px;
  }

  .stat-grid,
  .faction-grid,
  .source-grid,
  .related-grid,
  .picker-form {
    grid-template-columns: 1fr;
  }

  .site-footer div:last-child {
    text-align: left;
  }
}
