:root,
.light,
.rust,
.coal,
.navy,
.ayu {
  --bg: #0b0d10;
  --fg: #e7e0d4;
  --links: #c5a263;
  --inline-code-color: #e2c589;
  --sidebar-active: #d7b878;
  --sidebar-bg: #0f1114;
  --sidebar-fg: #b8b0a4;
  --sidebar-non-existant: #726e67;
  --theme-popup-bg: #17191d;
  --theme-popup-border: #44392c;
  --searchbar-bg: #15171b;
  --searchbar-fg: #eee8dc;
  --searchbar-shadow-color: transparent;
  --searchresults-header-fg: #d7b878;
  --searchresults-border-color: #44392c;
  --searchresults-li-bg: #15171b;
  --search-mark-bg: rgba(184, 148, 88, 0.28);
  --wl-surface: #131519;
  --wl-surface-raised: #191b20;
  --wl-surface-deep: #090b0e;
  --wl-border: #41372d;
  --wl-gold: #b89458;
  --wl-gold-bright: #d7b878;
  --wl-crimson: #8e2f3a;
  --wl-crimson-bright: #b4434f;
  --wl-muted: #aaa297;
}

html, body {
  background:
    radial-gradient(circle at 12% 0%, rgba(142, 47, 58, 0.12), transparent 30rem),
    radial-gradient(circle at 92% 12%, rgba(184, 148, 88, 0.055), transparent 24rem),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.008) 0 1px, transparent 1px 5px),
    linear-gradient(180deg, #090b0e 0%, #0b0d10 58%, #0d0f12 100%);
  background-attachment: fixed;
}

body {
  color: var(--fg);
  text-rendering: optimizeLegibility;
}

p,
li,
dd,
td,
blockquote {
  color: #d8d2c9;
}

p,
li,
dd {
  line-height: 1.7;
}

#mdbook-menu-bar,
.sidebar {
  background: linear-gradient(180deg, rgba(19, 21, 25, 0.98), rgba(12, 14, 17, 0.98));
}

#mdbook-menu-bar {
  border-bottom: 1px solid rgba(184, 148, 88, 0.24);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.72),
    0 10px 30px rgba(0, 0, 0, 0.16);
}

.sidebar {
  border-inline-end: 1px solid rgba(184, 148, 88, 0.2);
  box-shadow:
    inset -1px 0 rgba(0, 0, 0, 0.5),
    14px 0 36px rgba(0, 0, 0, 0.14);
}

.menu-title,
h1,
h2,
h3,
h4 {
  letter-spacing: 0.015em;
}

h1,
h2,
h3,
h4,
strong {
  color: #eee8dc;
}

main h1,
main h2,
main h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

main > h1 {
  position: relative;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(184, 148, 88, 0.3);
}

main > h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 4.75rem;
  height: 5px;
  background: linear-gradient(90deg, var(--wl-crimson) 0 66%, var(--wl-gold) 66% 76%, transparent 76%);
}

main h2 {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2.35rem;
  color: #e9dfcf;
}

main h2::after {
  display: none;
}

a {
  text-decoration-color: rgba(184, 148, 88, 0.38);
  text-underline-offset: 0.18em;
}

a:hover,
a:focus {
  color: var(--wl-gold-bright);
  text-decoration-color: currentColor;
}

#mdbook-theme-toggle,
#mdbook-help-container {
  display: none;
}

#mdbook-menu-bar .menu-title {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #e9e1d5;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.035em;
}

#mdbook-menu-bar .menu-title::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 3px 1px 3px 1px;
  background: url('../assets/server-icon.png') center/contain no-repeat;
  flex: 0 0 20px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
}

.hero {
  padding: 1.45rem 1.55rem;
  border: 1px solid var(--wl-border);
  border-top-color: rgba(184, 148, 88, 0.52);
  background:
    linear-gradient(135deg, rgba(142, 47, 58, 0.14), transparent 42%),
    linear-gradient(180deg, #191b20, #121418);
  border-radius: 10px 3px 10px 3px;
  margin-bottom: 1rem;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.025),
    0 18px 42px rgba(0, 0, 0, 0.28);
}

.banner-only {
  margin: 0 0 1rem;
}

.hero-home {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.hero-home--stack {
  display: block;
}

.hero-banner {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 9px 3px 9px 3px;
  border: 1px solid rgba(184, 148, 88, 0.26);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 18px 38px rgba(0, 0, 0, 0.22);
  margin: 0;
}

.server-icon {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  border-radius: 7px 2px 7px 2px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  background: var(--wl-surface-raised);
  border: 1px solid var(--wl-border);
  padding: 0.35rem;
}

.hero-copy {
  flex: 1;
}

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  color: var(--wl-gold-bright);
  opacity: 0.92;
  margin: 0 0 0.55rem;
}

.hero h1 {
  margin: 0 0 0.65rem;
  font-size: 2.1rem;
  line-height: 1.08;
}

.hero .lead {
  margin: 0;
  max-width: 44rem;
  font-size: 1rem;
  line-height: 1.7;
  color: #dcd4c8;
}

.info-box {
  margin: 0.8rem 0 1.55rem;
  padding: 0.9rem 1.05rem;
  border-radius: 7px 2px 7px 2px;
  border: 1px solid var(--wl-border);
  border-inline-start: 3px solid var(--wl-crimson);
  background: linear-gradient(90deg, rgba(142, 47, 58, 0.08), rgba(25, 27, 32, 0.76));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.02);
}

.info-box ul,
.info-box ol {
  margin: 0;
}

.quick-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0 0 1.55rem;
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  border-radius: 5px 1px 5px 1px;
  border: 1px solid var(--wl-border);
  border-top-color: rgba(184, 148, 88, 0.4);
  background: linear-gradient(180deg, #1b1d22, #14161a);
  color: #d9d1c6;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.quick-pill:hover {
  border-color: rgba(184, 148, 88, 0.62);
  background: linear-gradient(180deg, #222127, #18191d);
  transform: translateY(-1px);
}

.quick-pill strong {
  color: #efe5d3;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.95rem;
  margin: 1.1rem 0 1.7rem;
}

.recipe-card,
.machine-card {
  margin: 0.95rem 0 1.25rem;
  padding: 1rem 1.05rem;
  border-radius: 7px 2px 7px 2px;
  border: 1px solid var(--wl-border);
  border-top-color: rgba(184, 148, 88, 0.5);
  background:
    linear-gradient(135deg, rgba(184, 148, 88, 0.035), transparent 36%),
    linear-gradient(180deg, #191b20, #121418);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.025),
    0 14px 28px rgba(0, 0, 0, 0.24);
}

.recipe-card {
  width: fit-content;
  min-width: min(100%, 34rem);
  max-width: 100%;
}

.recipe-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  gap: 0.45rem;
  padding: 0.75rem;
  border-radius: 5px 2px 5px 2px;
  background: linear-gradient(180deg, rgba(4, 5, 7, 0.7), rgba(11, 12, 15, 0.82));
  border: 1px solid #332c25;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.48),
    0 8px 18px rgba(0, 0, 0, 0.18);
}

.recipe-slot,
.recipe-output,
.machine-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 3px;
  background: linear-gradient(145deg, #292a2e, #17191d);
  border: 1px solid #3b3833;
  box-shadow:
    inset 2px 2px rgba(255, 255, 255, 0.035),
    inset -2px -2px rgba(0, 0, 0, 0.3);
}

.recipe-slot img,
.recipe-output img,
.machine-slot img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
}

.recipe-slot--empty {
  background: rgba(12, 13, 16, 0.72);
  border-style: dashed;
  border-color: #302d29;
}

.recipe-slot[data-item]::after,
.recipe-output[data-item]::after,
.machine-slot[data-item]::after {
  content: attr(data-item);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 0.45rem 0.65rem;
  border-radius: 4px 1px 4px 1px;
  background: rgba(15, 16, 19, 0.98);
  border: 1px solid rgba(184, 148, 88, 0.38);
  color: #eee7dc;
  font-size: 0.92rem;
  line-height: 1.28;
  white-space: normal;
  min-width: 110px;
  max-width: 190px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  z-index: 3;
}

.recipe-slot[data-item]:hover::after,
.recipe-output[data-item]:hover::after,
.machine-slot[data-item]:hover::after,
.recipe-slot[data-item]:focus-within::after,
.recipe-output[data-item]:focus-within::after,
.machine-slot[data-item]:focus-within::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.recipe-arrow {
  font-size: 1.8rem;
  color: var(--wl-gold-bright);
  line-height: 1;
  opacity: 0.9;
}

.recipe-result {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 170px;
}

.recipe-output {
  width: 68px;
  height: 68px;
}

.recipe-output img {
  width: 46px;
  height: 46px;
}

.recipe-caption,
.machine-caption {
  margin: 0.8rem 0 0;
  color: var(--wl-muted);
  line-height: 1.6;
}

.recipe-caption strong,
.machine-caption strong {
  color: #eee6da;
}


.machine-board {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 176 / 166;
  border-radius: 6px 2px 6px 2px;
  overflow: hidden;
  border: 1px solid var(--wl-border);
  background: var(--wl-surface-deep);
}

.machine-board > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.machine-slot {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 3px;
  background: rgba(11, 12, 15, 0.9);
}

.machine-slot img {
  width: 28px;
  height: 28px;
}

.machine-slot--top-left {
  left: 61px;
  top: 35px;
}

.machine-slot--top-center {
  left: 104px;
  top: 35px;
}

.machine-slot--top-right {
  left: 147px;
  top: 35px;
}

.machine-slot--fuel {
  left: 61px;
  top: 92px;
}

.machine-slot--flux {
  left: 104px;
  top: 92px;
}

.machine-slot--output {
  right: 24px;
  top: 62px;
  width: 48px;
  height: 48px;
}

.machine-side {
  flex: 1 1 240px;
  min-width: 240px;
}

.machine-side ul {
  margin: 0;
}

.wiki-card {
  display: block;
  padding: 1rem 1rem 0.95rem;
  border-radius: 7px 2px 7px 2px;
  border: 1px solid var(--wl-border);
  border-top-color: rgba(184, 148, 88, 0.42);
  background: linear-gradient(180deg, #191b20, #131519);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.wiki-card:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 148, 88, 0.64);
  background: linear-gradient(180deg, #201f23, #16181c);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.30);
}

.wiki-card strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 1.02rem;
  color: #eee4d3;
}

.wiki-card span {
  display: block;
  color: #c8c0b6;
  line-height: 1.55;
}

.ship-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.95rem;
  margin: 1rem 0 1.4rem;
}

.ship-gallery__item {
  margin: 0;
  padding: 0.9rem;
  border-radius: 7px 2px 7px 2px;
  border: 1px solid var(--wl-border);
  border-top-color: rgba(184, 148, 88, 0.42);
  background: linear-gradient(180deg, #191b20, #131519);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.ship-gallery__item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px 1px 4px 1px;
}

.ship-gallery__item figcaption {
  margin-top: 0.7rem;
  text-align: center;
  color: #eee6da;
  font-weight: 600;
}

.content main {
  max-width: 940px;
}

.sidebar .chapter li a {
  margin: 1px 0;
  border-inline-start: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  color: #b9b1a6;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.sidebar .chapter li a:hover {
  color: #dfd5c6;
  background: rgba(184, 148, 88, 0.055);
}

.sidebar .chapter li a.active {
  border-inline-start-color: var(--wl-gold);
  color: var(--wl-gold-bright);
  background: transparent;
}

.sidebar .chapter li a.active strong {
  color: inherit;
}

code {
  padding: 0.08em 0.34em;
  border: 1px solid rgba(184, 148, 88, 0.14);
  border-radius: 3px;
  background: rgba(184, 148, 88, 0.07);
  color: var(--inline-code-color);
}

blockquote {
  border-inline-start: 3px solid var(--wl-gold);
  border-radius: 0 5px 5px 0;
  background: linear-gradient(90deg, rgba(184, 148, 88, 0.08), transparent);
}

hr {
  position: relative;
  height: 1px;
  margin: 2.2rem 0;
  overflow: visible;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(184, 148, 88, 0.46), transparent);
}

hr::after {
  content: "";
  position: absolute;
  top: -3px;
  left: calc(50% - 3px);
  width: 7px;
  height: 7px;
  border: 1px solid var(--wl-gold);
  background: var(--bg);
  transform: rotate(45deg);
}

table {
  border: 1px solid var(--wl-border);
  border-radius: 5px 1px 5px 1px;
  background: rgba(19, 21, 25, 0.72);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

table thead {
  background: linear-gradient(180deg, rgba(142, 47, 58, 0.2), rgba(27, 25, 26, 0.92));
}

table th {
  color: var(--wl-gold-bright);
}

table td,
table th {
  border-color: rgba(184, 148, 88, 0.14);
}

@media (max-width: 700px) {
  .hero-home {
    flex-direction: column;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .recipe-grid {
    grid-template-columns: repeat(3, 50px);
  }

  .recipe-slot,
  .machine-slot {
    width: 50px;
    height: 50px;
  }

  .recipe-output {
    width: 60px;
    height: 60px;
  }

  .recipe-arrow {
    width: 100%;
    text-align: center;
  }

  .recipe-card {
    width: 100%;
    min-width: 0;
  }

  main h2::after {
    display: none;
  }
}

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