:root {
  --page: #f6f1e8;
  --content: #fffdf8;
  --ink: #1f1b16;
  --muted: #665d50;
  --line: #ddd3c3;
  --gold: #b98422;
  --sidebar: #211811;
  --sidebar-hover: #30241a;
  --code: #f0e4cf;
}

@font-face {
  font-family: "Monocraft";
  src: url("fonts/Monocraft.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Verdana, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 20px 16px;
  background: var(--sidebar);
  color: #f9edd2;
  border-right: 1px solid #000;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand strong {
  display: block;
  font-family: "Monocraft", "Courier New", monospace;
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand span {
  display: block;
  color: #d9c49c;
  font-family: "Monocraft", "Courier New", monospace;
  font-size: 0.64rem;
  line-height: 1.25;
  margin-top: 3px;
  text-transform: uppercase;
}

.crest {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  background: #dca43a;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.chapters {
  display: grid;
  gap: 1px;
}

.chapters a {
  color: #ebddc2;
  text-decoration: none;
  padding: 8px 9px;
  border-radius: 3px;
  font-size: 0.86rem;
  border-left: 3px solid transparent;
}

.chapters a:hover,
.chapters a.active {
  background: var(--sidebar-hover);
  color: #fff6de;
  border-left-color: var(--gold);
}

.content {
  width: calc(100% - 260px);
  max-width: none;
  margin-left: 260px;
  padding: 42px 72px 80px;
  background: var(--content);
  min-height: 100vh;
}

.hero,
.chapter {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.hero {
  padding: 0 0 34px;
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font: 700 0.72rem/1 Verdana, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

h1 {
  margin: 0;
  font-family: "Monocraft", "Courier New", monospace;
  font-size: clamp(1.75rem, 3vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

h1 span {
  display: block;
}

.hero-title-main {
  font-weight: 700;
  text-shadow: 1px 0 0 currentColor;
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  letter-spacing: -0.01em;
}

h3 {
  margin: 24px 0 8px;
  font-size: 1rem;
}

.lead {
  position: relative;
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.chapter {
  padding: 34px 0;
  margin: 0;
  scroll-margin-top: 22px;
  overflow-x: auto;
}

p {
  margin: 0 0 14px;
}

code {
  color: #22180e;
  background: var(--code);
  border: 1px solid #dccaa8;
  border-radius: 3px;
  padding: 0.12rem 0.34rem;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

code.command-code {
  font-family: "Monocraft", "Courier New", monospace;
  font-size: 0.82em;
  letter-spacing: 0.01em;
}

pre {
  margin: 14px 0;
  padding: 16px;
  overflow-x: auto;
  background: #27211a;
  color: #fff0cf;
  border-radius: 4px;
  border: 0;
}

pre code {
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
}

pre code.command-code {
  font-size: 0.86em;
  line-height: 1.7;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: #fff;
  border: 1px solid var(--line);
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

th {
  color: #fff3d5;
  background: #332519;
  font-family: Verdana, sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

tr:last-child td {
  border-bottom: 0;
}

td:first-child {
  font-weight: 700;
}

ul,
ol {
  margin: 12px 0 0;
  padding-left: 1.4rem;
}

li {
  margin: 6px 0;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.command-grid div,
.steps div {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.command-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.steps b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  color: #fff6df;
  background: var(--gold);
  border-radius: 50%;
  font-family: Verdana, sans-serif;
}

.steps span {
  display: block;
}

.note {
  margin: 18px 0 0;
  padding: 12px 14px;
  color: #3a2a18;
  background: #f7ecd7;
  border-left: 4px solid var(--gold);
  border-radius: 0;
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    max-height: none;
  }

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

  .content {
    margin-left: 0;
    width: auto;
    padding: 24px 18px 60px;
  }

  .hero,
  .chapter {
    border-radius: 0;
  }

  .hero {
    padding: 30px;
  }

  .command-grid,
  .steps {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 521px) and (max-width: 760px) {
  .content {
    padding: 24px 22px 70px;
  }

  .hero {
    padding: 28px;
  }

  .chapter {
    padding: 24px;
  }

  .command-grid,
  .steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .chapters {
    grid-template-columns: 1fr;
  }

  .chapter {
    padding: 24px 18px;
  }

  th,
  td {
    padding: 10px;
  }
}
