:root {
  --fo-charcoal-950: #080b10;
  --fo-charcoal-900: #0a0e14;
  --fo-maroon-950: #18070d;
  --fo-oxblood-900: #3b0b18;
  --fo-crimson-600: #b51f35;
  --fo-crimson-500: #d12a43;
  --fo-navy-950: #071522;
  --fo-cobalt-800: #173a63;
  --fo-off-white: #f3f5f7;
  --fo-steel-300: #b7c0cc;
  --fo-steel-500: #8b96a6;
  --fo-focus: #8bbbe8;
  --fo-rule: rgba(183, 192, 204, 0.18);
  --fo-panel: rgba(10, 21, 32, 0.76);
  --fo-shadow: 0 22px 70px rgba(0, 0, 0, 0.26);
  --fo-motion-fast: 160ms;
  --fo-motion-standard: 240ms;
  --fo-ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--fo-charcoal-950);
  color-scheme: dark;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% 4%, rgba(139, 187, 232, 0.11), transparent 25rem),
    linear-gradient(112deg, transparent 0 62%, rgba(181, 31, 53, 0.07) 62.1%, transparent 76%),
    linear-gradient(180deg, var(--fo-navy-950) 0, var(--fo-charcoal-950) 38rem);
  color: var(--fo-off-white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(rgba(183, 192, 204, 0.025) 1px, transparent 1px);
  background-size: 100% 4rem;
  content: "";
  pointer-events: none;
}

a {
  color: #a9cff2;
  text-decoration-color: rgba(169, 207, 242, 0.55);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
  transition: color var(--fo-motion-fast) ease, text-decoration-color var(--fo-motion-fast) ease;
}

a:hover {
  color: var(--fo-off-white);
  text-decoration-color: var(--fo-crimson-500);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--fo-focus) !important;
  outline-offset: 3px;
}

.container-lg {
  width: min(100%, 1280px);
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

#wiki-wrapper {
  min-width: 0;
  padding-bottom: 2rem;
}

#head {
  position: sticky;
  z-index: 20;
  top: 0;
  margin-inline: calc(clamp(1.25rem, 4vw, 3rem) * -1);
  border-bottom: 1px solid var(--fo-rule);
  background: rgba(7, 21, 34, 0.9);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(18px);
}

#head nav {
  width: min(100%, 1280px);
  min-height: 4.5rem;
  margin-inline: auto;
  padding: 0.75rem clamp(1.25rem, 4vw, 3rem) !important;
  border: 0 !important;
  overflow: visible;
}

#head .TableObject-item--primary {
  padding-inline: 1rem !important;
}

.btn,
button,
input[type="submit"] {
  min-height: 44px;
  border: 1px solid rgba(183, 192, 204, 0.35);
  border-radius: 4px;
  background: rgba(243, 245, 247, 0.045);
  box-shadow: none;
  color: var(--fo-off-white);
  font: 650 0.8125rem/1 ui-sans-serif, system-ui, sans-serif;
  transition: border-color var(--fo-motion-fast) ease, background var(--fo-motion-fast) ease, transform var(--fo-motion-fast) ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
  border-color: rgba(243, 245, 247, 0.7);
  background: rgba(243, 245, 247, 0.1);
  color: var(--fo-off-white);
}

.btn:active,
button:active,
input[type="submit"]:active {
  transform: translateY(1px);
}

.btn-primary,
input[type="submit"].primary,
.minibutton-new-page {
  border-color: var(--fo-crimson-600);
  background: var(--fo-crimson-600);
  color: var(--fo-off-white);
}

.btn-primary:hover,
input[type="submit"].primary:hover,
.minibutton-new-page:hover {
  border-color: var(--fo-crimson-500);
  background: var(--fo-crimson-500);
}

#minibutton-home {
  position: relative;
  width: 3rem;
  overflow: hidden;
  border-color: rgba(181, 31, 53, 0.75);
  color: transparent;
}

#minibutton-home::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--fo-off-white);
  content: "FO";
  font: 750 0.78rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}

input,
textarea,
select,
.form-control {
  border: 1px solid rgba(183, 192, 204, 0.34);
  border-radius: 4px;
  background: rgba(8, 11, 16, 0.72);
  box-shadow: none;
  color: var(--fo-off-white);
}

input::placeholder,
textarea::placeholder {
  color: var(--fo-steel-500);
}

#search-query {
  height: 44px;
  padding-inline: 0.9rem;
}

#wiki-content {
  position: relative;
  padding-inline: 0 !important;
}

#wiki-content::before,
#wiki-content::after {
  position: absolute;
  top: 3.5rem;
  width: 3.25rem;
  height: 3.25rem;
  content: "";
  pointer-events: none;
}

#wiki-content::before {
  left: 0;
  border-top: 1px solid rgba(181, 31, 53, 0.8);
  border-left: 1px solid rgba(181, 31, 53, 0.8);
}

#wiki-content::after {
  right: 0;
  border-top: 1px solid rgba(139, 187, 232, 0.45);
  border-right: 1px solid rgba(139, 187, 232, 0.45);
}

.header-title {
  max-width: 12ch;
  margin: 0;
  padding: clamp(5.5rem, 10vw, 8.75rem) 0 clamp(4.5rem, 8vw, 7rem) !important;
  color: var(--fo-off-white);
  font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(3.2rem, 7.7vw, 7.2rem);
  font-stretch: condensed;
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 0.91;
  overflow-wrap: anywhere;
  text-align: left !important;
  text-wrap: balance;
}

.header-title::before {
  display: block;
  margin-bottom: 1.3rem;
  color: var(--fo-steel-300);
  content: "PRODUCTION DEVELOPMENT / PUBLIC WORKSPACE";
  font: 650 clamp(0.7rem, 0.67rem + 0.15vw, 0.8rem)/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.15em;
}

.breadcrumb {
  margin: 0 0 1.5rem;
  color: var(--fo-steel-300);
  font: 0.75rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
}

#wiki-body > .main-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 17rem);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  width: 100%;
  padding: 0 !important;
}

#wiki-body > .main-content::before,
#wiki-body > .main-content::after {
  display: none;
  content: none;
}

#wiki-body .markdown-body,
#wiki-sidebar {
  float: none !important;
  width: auto !important;
  min-width: 0;
  max-width: none;
}

.markdown-body {
  background: transparent;
  color: var(--fo-off-white);
  font-family: inherit;
  font-size: clamp(1rem, 0.95rem + 0.22vw, 1.125rem);
  line-height: 1.66;
  overflow-wrap: anywhere;
}

.markdown-body > p:first-child {
  max-width: 40ch;
  margin-top: 0;
  color: var(--fo-off-white);
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.36;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: var(--fo-off-white);
  font-family: inherit;
}

.markdown-body h1 {
  border-bottom: 1px solid rgba(181, 31, 53, 0.72);
  font-size: clamp(2.35rem, 1.7rem + 3vw, 4.75rem);
  line-height: 1;
}

.markdown-body h2 {
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
  padding: 0 0 0.8rem;
  border-bottom: 1px solid var(--fo-rule);
  font-size: clamp(1.55rem, 1.3rem + 1vw, 2.25rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.markdown-body h3 {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.markdown-body p,
.markdown-body li {
  max-width: 68ch;
}

.markdown-body strong {
  color: var(--fo-off-white);
}

.markdown-body hr {
  height: 1px;
  border: 0;
  background: var(--fo-rule);
}

.markdown-body code,
.markdown-body pre {
  border: 1px solid var(--fo-rule);
  border-radius: 4px;
  background: #0b1b2b;
  color: var(--fo-off-white);
}

.markdown-body blockquote {
  margin-inline: 0;
  border-left: 2px solid var(--fo-crimson-600);
  color: var(--fo-steel-300);
}

.markdown-body h2:has(> a#start-here) + ul,
.markdown-body h2:has(> a#current-productions) + ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  max-width: none;
  margin: 1.5rem 0 0;
  padding: 1px;
  background: var(--fo-rule);
  list-style: none;
}

.markdown-body h2:has(> a#start-here) + ul {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.markdown-body h2:has(> a#start-here) + ul > li,
.markdown-body h2:has(> a#current-productions) + ul > li {
  position: relative;
  min-height: 10rem;
  max-width: none;
  margin: 0;
  padding: 1.4rem;
  background: linear-gradient(145deg, rgba(23, 58, 99, 0.3), rgba(8, 11, 16, 0.92));
  color: var(--fo-steel-300);
}

.markdown-body h2:has(> a#current-productions) + ul > li {
  min-height: 8rem;
  background: linear-gradient(145deg, rgba(59, 11, 24, 0.36), rgba(8, 11, 16, 0.94));
}

.markdown-body h2:has(> a#start-here) + ul a,
.markdown-body h2:has(> a#current-productions) + ul a {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--fo-off-white);
  font-size: 1.08rem;
  font-weight: 720;
  text-decoration: none;
}

.markdown-body h2:has(> a#start-here) + ul a::after,
.markdown-body h2:has(> a#current-productions) + ul a::after {
  color: var(--fo-crimson-500);
  content: "  →";
}

#wiki-sidebar {
  align-self: start;
  position: sticky;
  top: 6.5rem;
  border: 0;
  border-left: 1px solid var(--fo-rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#sidebar-content {
  padding: 0.35rem 0 0 1.5rem !important;
}

#sidebar-content h3 {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  color: var(--fo-steel-300);
  font: 650 0.72rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

#sidebar-content h3:not(:first-child) {
  margin-top: 2rem;
}

#sidebar-content ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#sidebar-content li {
  margin: 0;
  border-top: 1px solid rgba(183, 192, 204, 0.1);
}

#sidebar-content li:last-child {
  border-bottom: 1px solid rgba(183, 192, 204, 0.1);
}

#sidebar-content li a,
#sidebar-content > p a {
  display: block;
  min-height: 44px;
  padding: 0.72rem 0;
  color: var(--fo-off-white);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

#sidebar-content li a:hover,
#sidebar-content > p a:hover {
  color: #a9cff2;
}

#sidebar-content > p {
  margin-top: 2rem;
}

#sidebar-content > p a::after {
  margin-left: 0.35rem;
  color: var(--fo-crimson-500);
  content: "↗";
}

#wiki-footer {
  margin-top: clamp(4rem, 8vw, 7rem) !important;
  border-top: 1px solid var(--fo-rule);
}

#footer-content {
  padding: 1.25rem 0 !important;
  border: 0;
  background: transparent;
  color: var(--fo-steel-300);
  font: 0.75rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}

#footer-content p {
  margin: 0;
}

#footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem !important;
  border-top: 1px solid rgba(183, 192, 204, 0.08);
  color: var(--fo-steel-500);
  font-size: 0.78rem;
}

#footer p {
  margin: 0;
}

#delete-link {
  color: #e5a7a3;
}

.SelectMenu-modal,
.Box,
.wiki-auxiliary-content,
.wiki-rightbar,
.wiki-leftbar {
  border-color: var(--fo-rule);
  background: var(--fo-charcoal-900);
  color: var(--fo-off-white);
}

.SelectMenu-item,
.SelectMenu-divider {
  border-color: var(--fo-rule);
  color: var(--fo-off-white);
}

.SelectMenu-item:hover {
  background: rgba(23, 58, 99, 0.5);
}

table,
.markdown-body table tr,
.markdown-body table th,
.markdown-body table td {
  border-color: var(--fo-rule);
  background: transparent;
  color: var(--fo-off-white);
}

.markdown-body table tr:nth-child(2n) {
  background: rgba(23, 58, 99, 0.16);
}

@media (max-width: 900px) {
  #wiki-body > .main-content {
    grid-template-columns: minmax(0, 1fr) 13rem;
    gap: 2rem;
  }

  .markdown-body h2:has(> a#start-here) + ul {
    grid-template-columns: 1fr;
  }

  .markdown-body h2:has(> a#start-here) + ul > li {
    min-height: 7.5rem;
  }
}

@media (max-width: 767px) {
  .container-lg {
    padding-inline: 1.25rem;
  }

  #head {
    margin-inline: -1.25rem;
  }

  #head nav {
    min-height: 4rem;
    padding: 0.6rem 1.25rem !important;
  }

  #head .TableObject-item--primary {
    padding-inline: 0.65rem !important;
  }

  #wiki-content::before,
  #wiki-content::after {
    top: 2rem;
    width: 2rem;
    height: 2rem;
  }

  .header-title {
    max-width: 11ch;
    padding: 4.75rem 0 4rem !important;
    font-size: clamp(2.8rem, 14vw, 4.2rem);
  }

  .header-title::before {
    max-width: 28ch;
    margin-bottom: 1rem;
    font-size: 0.65rem;
  }

  #wiki-body > .main-content {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
  }

  .markdown-body h2:has(> a#start-here) + ul,
  .markdown-body h2:has(> a#current-productions) + ul {
    grid-template-columns: 1fr;
  }

  .markdown-body h2:has(> a#current-productions) + ul > li {
    min-height: 7rem;
  }

  #wiki-sidebar {
    width: 100% !important;
    align-self: stretch;
    position: static;
    border-top: 1px solid var(--fo-rule);
    border-left: 0;
  }

  #sidebar-content {
    padding: 2rem 0 0 !important;
  }

  #footer {
    display: block;
  }

  #footer p + p {
    margin-top: 0.75rem;
  }
}

@media (max-width: 420px) {
  #head .TableObject-item--primary {
    min-width: 0;
  }

  #search-query {
    min-width: 0;
  }

  .header-title {
    font-size: clamp(2.55rem, 13.5vw, 3.45rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  #head,
  #wiki-sidebar,
  .markdown-body h1,
  .markdown-body h2,
  .markdown-body blockquote,
  #wiki-footer {
    border-color: CanvasText;
  }

  #wiki-content::before,
  #wiki-content::after,
  body::before {
    display: none;
  }
}
