@font-face {
  font-family: 'PirateTok Display';
  src: url('fonts/cinzel-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'PirateTok Mono';
  src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --site-unit: 16px;
  --site-header-height: 64px;
}
body { padding-top: var(--site-header-height); }
.header {
  display: flex;
  align-items: center;
  gap: calc(.75 * var(--site-unit));
  padding: 0 var(--site-unit);
  height: var(--site-header-height);
  background: #000;
  border-bottom: 1px solid #16182a;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  font-size: var(--site-unit);
  line-height: 1.5;
  backdrop-filter: none;
}
.header .brand {
  display: inline-flex;
  align-items: center;
  gap: calc(.1 * var(--site-unit));
  font-family: 'PirateTok Display', serif;
  font-weight: 700;
  font-size: var(--site-unit);
  letter-spacing: .02em;
  margin-left: calc(1.35 * var(--site-unit));
  white-space: nowrap;
  text-decoration: none;
}
.header .brand-pirate { color: #25f5ef; }
.header .brand-tok { color: #fe2c55; }
.header .brand img { height: calc(1.75 * var(--site-unit)); width: auto; }
.header .header-spacer { flex: 1; }
.header .header-links { display: flex; align-items: center; justify-content: flex-end; gap: calc(.75 * var(--site-unit)); }
.header .header-more { display: none; position: relative; justify-self: end; }
.header .header-more summary { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid #2e2e2e; border-radius: 5px; color: #e8e0d4; list-style: none; cursor: pointer; }
.header .header-more summary::-webkit-details-marker { display: none; }
.header .header-more summary:focus-visible { outline: 2px solid #25f5ef; outline-offset: 3px; }
.header .header-more > nav { position: absolute; right: 0; top: calc(100% + 15px); display: grid; gap: 8px; width: 220px; padding: 12px; background: #121212; border: 1px solid #2e2e2e; border-radius: 6px; box-shadow: 0 12px 28px #0009; }
.header .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: calc(.5 * var(--site-unit));
  padding: calc(.35 * var(--site-unit)) calc(.9 * var(--site-unit));
  font-family: 'PirateTok Mono', monospace;
  font-size: calc(.875 * var(--site-unit));
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.5;
  color: #a09585;
  background: transparent;
  border: 1px solid #2e2e2e;
  border-radius: calc(.5 * var(--site-unit));
  white-space: nowrap;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.header .btn-ghost:hover { color: #5ffcfa; border-color: #1ac4bf; }
.header .btn-ghost[aria-current] { color: #25f5ef; border-color: #1ac4bf; }
/* Equal outside columns keep the search at the viewport's center. */
.header--wiki {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, min(38vw, 540px)) minmax(0, 1fr);
  column-gap: 24px;
}
.header--wiki .header-start { display: flex; align-items: center; min-width: 0; }
.header--wiki .searchbox { width: 100%; max-width: none; min-width: 0; margin: 0; }
.header--wiki input { padding: 6px 70px 6px 14px; font-size: 16px; line-height: 1.35; background: #121212; border-color: #2e2e2e; }
.header--wiki kbd { top: 50%; transform: translateY(-50%); font-size: 13px; }
.header--wiki #menu { border: 1px solid #2e2e2e; background: transparent; color: #e8e0d4; border-radius: 5px; padding: 5px 8px; font: 15px system-ui, sans-serif; }
@media (max-width: 1250px) {
  .header--wiki { grid-template-columns: minmax(0, 1fr) minmax(200px, 34vw) minmax(0, 1fr); column-gap: 14px; }
  .header .brand { margin-left: 0; }
  .header .header-links { gap: 6px; }
  .header .btn-ghost { padding: 5px 8px; }
}
@media (max-width: 1150px) {
  .header .header-links { display: none; }
  .header .header-more { display: block; }
  .header--wiki { grid-template-columns: minmax(0, 1fr) minmax(200px, min(50vw, 540px)) minmax(0, 1fr); gap: 12px; }
  .header--wiki .header-start { gap: 10px; }
}
@media (max-width: 700px) {
  .header--wiki { grid-template-columns: 76px minmax(0, 1fr) 76px; gap: 8px; padding: 0 10px; }
  .header--wiki .header-start { gap: 6px; }
  .header--wiki .brand-pirate, .header--wiki .brand-tok { display: none; }
  .header--wiki input { padding-right: 12px; }
  .header--wiki #menu { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; flex-shrink: 0; }
}
@media (max-width: 420px) {
  .header--wiki { grid-template-columns: 68px minmax(0, 1fr) 68px; }
  .header--wiki input { font-size: 15px; padding-left: 10px; }
}
