:root {
  --bg: #202020;
  --bg-deep: #171717;
  --bg-raise: #262626;
  --ink: #f6f2ea;
  --muted: #c9c2b4;
  --gold: #e2bc55;
  --gold-soft: #f4e6bf;
  --gold-deep: #9a7428;
  --line: rgba(226, 188, 85, 0.28);
  --mast: 76px;
  --serif: Constantia, "Palatino Linotype", Palatino, serif;
  --sans: "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
  --shadow: 0 28px 50px -32px rgba(0, 0, 0, 0.72);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

img {
  display: block;
  border: 0;
}

a {
  color: var(--gold-soft);
}

p,
ul,
ol,
dd {
  margin: 0 0 14px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  margin: 0;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 80;
  background: var(--gold);
  color: #202020;
  padding: 8px 12px;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.mast {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--mast);
  min-height: var(--mast);
  max-height: var(--mast);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  background: #202020;
  border-bottom: 1px solid transparent;
  box-shadow: inset 0 3px 0 var(--gold);
}

.mast.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: inset 0 3px 0 var(--gold), 0 16px 30px -24px rgba(0, 0, 0, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 168px;
  height: 48px;
}

.brand img {
  width: 48px;
  height: 48px;
}

.brand span {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  padding: 8px 0 6px;
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size 0.28s ease, color 0.28s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--gold-soft);
  background-size: 100% 1px;
}

.enter {
  width: 240px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px 0 18px;
  background: transparent;
  color: var(--gold-soft);
  text-decoration: none;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--gold);
  font-size: 16px;
  font-weight: 600;
  transition: background 0.28s ease, color 0.28s ease, box-shadow 0.28s ease;
}

.enter svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  transition: transform 0.28s ease;
}

.enter:hover,
.enter:focus-visible {
  background: var(--gold);
  color: #202020;
  box-shadow: 0 18px 34px -22px rgba(226, 188, 85, 0.95), inset 0 0 0 1px var(--gold);
}

.enter:hover svg,
.enter:focus-visible svg {
  transform: translateX(5px);
}

.enter-sm {
  width: 188px;
  height: 44px;
  flex: 0 0 188px;
  font-size: 15px;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold-soft);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  margin: 0 auto;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  align-items: start;
}

.home {
  position: sticky;
  top: var(--mast);
  min-height: calc(100vh - var(--mast));
  max-height: calc(100vh - var(--mast));
  overflow: auto;
  padding: 28px 28px 18px;
  background: var(--bg-deep);
  border-right: 1px solid var(--line);
  box-shadow: inset -28px 0 40px rgba(0, 0, 0, 0.18);
}

.home-mark {
  width: 72px;
  height: 72px;
}

.kicker {
  margin: 14px 0 0;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home h1 {
  margin: 10px 0 12px;
  max-width: 11ch;
  font-size: 44px;
  color: #f7f3ea;
}

.home .lead {
  max-width: 36ch;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 16px;
}

.home .enter {
  margin: 6px 0 16px;
}

.checks {
  list-style: none;
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}

.checks li {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
}

.checks li::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--gold);
  flex: 0 0 8px;
}

.chapters {
  min-width: 0;
  background-color: #202020;
  background-image: radial-gradient(rgba(226, 188, 85, 0.13) 0.65px, transparent 0.75px);
  background-size: 20px 20px;
}

.block {
  padding: 64px 56px;
  border-bottom: 1px solid var(--line);
  max-width: 920px;
}

.chapter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.chapter h2 {
  font-size: 34px;
  max-width: 16ch;
}

.leader {
  height: 1px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, rgba(226, 188, 85, 0.85), rgba(226, 188, 85, 0.05));
}

.chapno {
  font-family: var(--mono);
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
}

.leadin {
  margin: 0 0 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(226, 188, 85, 0.16);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
  max-width: 68ch;
}

.prose {
  max-width: 68ch;
  color: var(--muted);
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.route {
  list-style: none;
  margin: 8px 0 22px;
  padding: 6px 0 0;
  counter-reset: step;
  max-width: 68ch;
}

.route li {
  position: relative;
  min-height: 72px;
  padding: 4px 0 18px 64px;
  color: var(--muted);
}

.route li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #202020;
  background: var(--gold);
  font-family: var(--mono);
  font-size: 13px;
}

.route li::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.route li:last-child::after {
  display: none;
}

.plain {
  margin: 0 0 18px;
  padding: 0 0 0 18px;
  max-width: 68ch;
  color: var(--muted);
}

.plain li {
  margin: 0 0 8px;
  padding-left: 4px;
}

.plain li::marker {
  color: var(--gold);
}

.subhead {
  margin: 26px 0 10px;
  font-size: 26px;
  color: var(--gold-soft);
}

.matrix {
  width: 100%;
  max-width: 720px;
  border-collapse: collapse;
  margin: 8px 0 20px;
  background: rgba(23, 23, 23, 0.72);
  box-shadow: var(--shadow);
}

.matrix caption {
  caption-side: bottom;
  text-align: left;
  color: var(--muted);
  font-size: 14px;
  padding-top: 8px;
}

.matrix th,
.matrix td {
  height: 48px;
  padding: 0 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.matrix th {
  width: 34%;
  color: var(--gold-soft);
  font-weight: 600;
  font-size: 15px;
}

.matrix thead th {
  background: #1b1b1b;
  height: 46px;
}

.matrix td {
  color: var(--ink);
}

.ask {
  margin: 0;
  max-width: 72ch;
}

.ask article {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.ask h3 {
  font-size: 22px;
  color: var(--gold-soft);
  margin-bottom: 8px;
}

.ask p {
  margin: 0;
  color: var(--muted);
}

.caution {
  margin-top: 8px;
  padding: 22px 22px 8px 24px;
  background: #1b1b1b;
  box-shadow: inset 4px 0 0 var(--gold), var(--shadow);
  max-width: 72ch;
}

.caution p {
  color: var(--muted);
}

.colophon {
  background: #141414;
  border-top: 1px solid var(--line);
  padding: 42px 56px 28px;
}

.footgrid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.9fr;
  gap: 28px;
  max-width: 1100px;
}

.colophon h2 {
  font-size: 28px;
  margin-bottom: 12px;
}

.colophon p,
.colophon li,
.colophon a {
  color: var(--muted);
  font-size: 15px;
}

.colophon a:hover,
.colophon a:focus-visible {
  color: var(--gold-soft);
}

.foot-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot-links li {
  min-height: 32px;
}

.legal-note {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 188, 85, 0.16);
  color: var(--gold-soft);
  font-size: 14px;
}

.enter:focus-visible,
.nav a:focus-visible,
.brand:focus-visible,
.nav-toggle:focus-visible,
.colophon a:focus-visible,
.skip:focus {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
}

@media (max-width: 1080px) {
  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .enter-sm {
    display: none;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--mast);
    left: 0;
    right: 0;
    margin: 0;
    padding: 12px 22px 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: #171717;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 36px -24px rgba(0, 0, 0, 0.8);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    min-height: 40px;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .home {
    position: static;
    max-height: none;
    min-height: 620px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .block,
  .colophon {
    padding: 42px 22px;
  }

  .chapter h2,
  .home h1 {
    font-size: 38px;
  }

  .footgrid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
