/* site.css: the stylesheet every page on barelysolde.red loads.
   wiki.css layers reference-doc styling on top of it for /wiki/ pages. */

/* Fonts, self-hosted (see ../fonts/README.md). Variable weight; latin and
   latin-ext subsets. */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/cinzel-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/cinzel-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/eb-garamond-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/eb-garamond-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/eb-garamond-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/eb-garamond-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Design tokens. The palette is the site's: void-black, a purple-brown panel,
   pale mauve ink, and blood for the headings. */
:root {
  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-mono: Consolas, 'Cascadia Mono', 'Courier New', monospace;

  --void: #18171c;
  --panel: #231b23;
  --well: #1a141a;
  --rule: #2a212a;
  --ink: #b9a9b6;
  --ink-faint: #6d5667;
  --mauve-deep: #6a2c3a;
  --mauve: #8a5a6c;
  --rose: #c97e8c;
  --rose-bright: #e8a8b5;
  --blood: #7a1a1a;

  --measure: 820px;
  --radius: 2px;
  --quick: 0.1s;
  --bar-bg: rgba(24, 23, 28, 0.92);
  --bar-shadow: 0 0 12px rgba(0, 0, 0, 0.18);
  --header-height: 4.2rem;
  --footer-height: 2.4rem;
}

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

[hidden] {
  display: none !important;
}

/* Anchor targets stop below the fixed bar instead of under it. */
[id] {
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

html {
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 100%;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  z-index: 0;
  margin: 0;
  min-height: 100vh;
  padding: var(--header-height) 0 var(--footer-height) 0;
  font-size: 1.5rem;
}

/* The world map behind everything: a fixed layer below the content, darkened
   and faded toward the edges in a single gradient. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(10, 8, 16, 0.6) 55%, var(--void) 100%),
    url('../map_2048.png') center / cover no-repeat;
  image-rendering: pixelated;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.15;
  margin: 0 0 0.6em 0;
}

h1 {
  font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem);
}

h3 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
}

h4 {
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
}

h1,
h2 {
  color: var(--blood);
}

p {
  margin: 0 0 1em 0;
}

a {
  color: var(--rose);
  transition: color var(--quick);
}

a:hover,
a:focus {
  color: var(--rose-bright);
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2em 0;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  background: var(--panel);
  color: var(--mauve);
  border-radius: var(--radius);
  padding: 0.2em 0.6em;
}

pre {
  overflow-x: auto;
  max-width: 100%;
}

img,
iframe {
  max-width: 100%;
}

/* Chrome: a fixed bar top and bottom, the content panel between them. Scoped
   to the body's own header and footer so a <header> inside an article is
   never pinned over the nav. */
body > header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

header nav {
  background: var(--bar-bg);
  border-bottom: 1px solid var(--rule);
  box-shadow: var(--bar-shadow);
}

header nav ul {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.5rem 1.5rem;
}

header nav a,
.nav-toggle-label {
  display: inline-flex;
  align-items: center;
  padding: 0.5em 0.75em;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  white-space: nowrap;
  color: var(--mauve-deep);
  background: var(--panel);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background var(--quick), color var(--quick), border-color var(--quick);
}

header nav a:hover,
header nav a:focus,
.nav-toggle-label:hover,
.nav-toggle:focus-visible + .nav-toggle-label {
  color: var(--mauve);
  background: var(--well);
  outline: 2px solid var(--mauve);
}

header nav a[aria-current="page"],
.nav-toggle:checked + .nav-toggle-label {
  color: var(--ink);
  border-color: var(--mauve-deep);
}

.nav-toggle,
.nav-toggle-label {
  display: none;
}

main {
  max-width: var(--measure);
  margin: 4rem auto 0;
  padding: 2.5rem 2.25rem 3rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-align: center;
}

section {
  margin-bottom: 2rem;
}

body > footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 0.65rem 0;
  background: var(--bar-bg);
  border-top: 1px solid var(--rule);
  box-shadow: var(--bar-shadow);
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
}

body > footer p {
  margin: 0 1rem;
  white-space: nowrap;
}

/* Controls */
button,
input[type="submit"],
a.cta[role="button"] {
  display: inline-block;
  margin-top: 1em;
  padding: 0.5em 1.2em;
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--mauve-deep);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--quick), color var(--quick);
}

button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus,
a.cta[role="button"]:hover,
a.cta[role="button"]:focus {
  color: var(--panel);
  background: var(--mauve);
  outline: 2px solid var(--mauve);
}

input,
textarea,
select {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--well);
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.5em 1em;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--mauve);
  border-color: var(--mauve);
}

/* Contact form (support pages): stacked labels, one column, centred. */
.contact-form {
  max-width: 600px;
  margin: 1.5em auto 0 auto;
  text-align: left;
}

.contact-form p {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  margin-bottom: 1em;
}

.contact-form label {
  font-size: 1.1rem;
  color: var(--ink);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
}

.contact-form textarea {
  min-height: 12em;
  resize: vertical;
}

.contact-form p:last-child {
  align-items: center;
}

.form-note {
  max-width: 600px;
  margin: 1.5em auto 0 auto;
  font-size: 1.1rem;
  color: var(--ink-faint);
}

/* Home page */
.home-hook {
  max-width: 640px;
  margin: 0 auto 1em auto;
  font-style: italic;
}

.featured {
  max-width: 680px;
  margin: 1.5rem auto 0 auto;
}

.featured .game-tile {
  border-color: var(--mauve);
}

.featured-caption {
  margin-top: 1rem;
  font-style: italic;
}

/* "From the Wiki" cards on the home page. Mirrors .wiki-entries in wiki.css,
   restated here because the home page does not load wiki.css. */
.featured-entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6em;
  max-width: var(--measure);
  margin: 1.2rem auto 0 auto;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.55;
  text-align: left;
}

.featured-entries li {
  margin: 0;
  padding: 0.7em 0.9em;
  background: var(--void);
  border: 1px solid var(--rule);
  transition: border-color var(--quick);
}

.featured-entries li:hover {
  border-color: var(--mauve);
}

/* A slot stacks its cards in one grid cell, so it is as tall as its tallest
   card, and crossfades between them: each card is visible for half of a
   24-second cycle with a one-second fade at each end, the second card running
   half a cycle behind the first. Hidden cards are also invisible to focus and
   clicks. The cycle pauses under the pointer so a link holds still. */
.featured-slot {
  display: grid;
}

.featured-card {
  grid-area: 1 / 1;
  animation: featured-cycle 24s infinite;
}

.featured-card:nth-child(2) {
  animation-delay: -12s;
}

.featured-slot:hover .featured-card,
.featured-slot:focus-within .featured-card {
  animation-play-state: paused;
}

@keyframes featured-cycle {
  0%,
  45.8% {
    opacity: 1;
    visibility: visible;
  }

  50%,
  95.8% {
    opacity: 0;
    visibility: hidden;
  }

  100% {
    opacity: 1;
    visibility: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .featured-card {
    animation: none;
  }

  .featured-card:nth-child(2) {
    display: none;
  }
}

/* The title is the card's header: a rule beneath separates it from the body,
   as on the wiki's entry cards. */
.featured-card > a {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  padding-bottom: 0.35em;
  margin-bottom: 0.4em;
  border-bottom: 1px solid var(--rule);
}

.featured-entries .summary {
  display: -webkit-box;
  margin-top: 0.15em;
  color: var(--ink-faint);
  font-size: 0.85rem;
  line-height: 1.45;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card footer: the entry's type as a badge under a rule, matching the wiki's
   entry cards (wiki.css) and the prose cards (prose.css). */
.featured-entries .badges {
  display: block;
  margin-top: 0.6em;
  padding-top: 0.5em;
  border-top: 1px solid var(--rule);
}

.featured-entries .status-badge,
.featured-entries a.status-badge:visited {
  display: inline-block;
  padding: 0.1em 0.6em;
  border: 1px solid var(--ink-faint);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-faint);
  background: var(--void);
  transition: color var(--quick), border-color var(--quick);
}

.featured-entries a.status-badge:hover,
.featured-entries a.status-badge:focus {
  color: var(--rose-bright);
  border-color: var(--rose-bright);
}

.featured-more {
  margin-top: 1rem;
  font-family: var(--font-mono);
}

/* Games grid: two columns of Steam main-capsule tiles (616 x 353). */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: var(--measure);
  margin: 2rem auto;
  padding: 0;
  list-style: none;
}

.game-grid > li {
  margin: 0;
}

.game-tile {
  position: relative;
  display: block;
  aspect-ratio: 616 / 353;
  background: #000 center / cover no-repeat;
  border: 2px solid var(--ink-faint);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color var(--quick), transform var(--quick);
}

.game-tile--necrowarp {
  background-image: url('/assets/capsules/necrowarp/main.png');
}

.game-tile--insurrection {
  background-image: url('/assets/capsules/insurrection/main.png');
}

a.game-tile:hover,
a.game-tile:focus {
  border-color: var(--mauve);
  outline: 2px solid var(--mauve);
  transform: translateY(-2px);
}

.game-tile--soon {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.game-tile--soon .game-tile-label {
  padding: 0 0.6em;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* An odd tile count leaves one orphan on the last row: centre it. */
.game-grid > li:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}

.game-grid > li:last-child:nth-child(odd) .game-tile {
  width: calc(50% - 0.5rem);
}

/* Game page: long-form description with banners and the store widget. */
.game-about {
  max-width: 720px;
  margin: 2.5rem auto;
}

.game-about p {
  line-height: 1.5;
  margin-bottom: 0.9em;
}

/* The last section on a game page is an anchor target too (#insurrection);
   give it a viewport's worth of height so the page can scroll it to the top. */
main > .game-about:last-child {
  min-height: calc(100vh - var(--header-height) - var(--footer-height) - 4rem);
}

.game-tagline,
.game-closing {
  font-style: italic;
  font-size: 1.75rem;
}

.game-tagline {
  max-width: 600px;
  margin: 0 auto 1.2em auto;
}

.game-closing {
  margin-top: 1.2em;
  color: var(--ink-faint);
}

.inline-figure {
  margin: 1em auto;
}

.inline-figure img {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.inline-figure--capsule img {
  max-width: 480px;
}

.game-buy {
  max-width: 720px;
  margin: 2.5rem auto 0 auto;
}

.game-buy iframe {
  display: block;
  width: 100%;
  max-width: 600px;
  min-width: 0;
  height: 190px;
  margin: 1em auto 0 auto;
  border: none;
  border-radius: 4px;
  background: var(--void);
}

/* Gallery: a scroll-snap strip with numbered anchors beneath it. */
.carousel-track {
  display: flex;
  gap: 0.75rem;
  max-width: var(--measure);
  margin: 0 auto 0.75rem auto;
  padding: 0.25rem 0 0.5rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--mauve-deep) var(--void);
}

.carousel-track:focus {
  outline: 2px solid var(--mauve-deep);
  outline-offset: 2px;
}

.carousel-item {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: block;
  object-fit: cover;
  background: var(--void);
  border: none;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.carousel-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  max-width: var(--measure);
  margin: 0 auto 2rem auto;
  padding: 0 0.5rem;
}

.carousel-dots a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--rose);
  background: var(--void);
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-decoration: none;
  transition: background var(--quick), color var(--quick), border-color var(--quick);
}

.carousel-dots a:hover,
.carousel-dots a:focus {
  color: var(--rose-bright);
  background: var(--well);
  border-color: var(--mauve);
  outline: none;
}

/* Wiki cross-references in body copy. Emitted by the site preprocessor and by
   the wiki build alike, so they live here, not in wiki.css. Inline links
   inherit the surrounding font. */
.wikilink {
  color: var(--rose);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted rgba(201, 126, 140, 0.5);
}

.wikilink:hover,
.wikilink:focus {
  color: var(--rose-bright);
  border-bottom-color: var(--rose-bright);
  outline: none;
}

/* A reference whose entry is not yet written: dimmer and dashed. Upgrades to
   a plain .wikilink on the next build once the entry exists. */
.wikilink-unknown {
  color: #9a7a82;
  border-bottom-style: dashed;
}

.wikilink-unknown:hover,
.wikilink-unknown:focus {
  color: #c79aa3;
  border-bottom-color: #c79aa3;
}

/* Spoiler: a native <details> block marked in blood. Inherits its context's
   font (Consolas inside .wiki-content, the body serif elsewhere). */
.wiki-spoiler {
  margin: 1em 0;
  padding: 0.6em 0.9em;
  border-left: 3px solid var(--blood);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(122, 26, 26, 0.08);
  text-align: left;
}

.wiki-spoiler > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  color: var(--blood);
  font-weight: 700;
}

.wiki-spoiler > summary::-webkit-details-marker {
  display: none;
}

.wiki-spoiler > summary::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 0.5em;
}

.wiki-spoiler[open] > summary::before {
  content: "\25BC";
}

.wiki-spoiler[open] > summary {
  margin-bottom: 0.5em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--rule);
}

.wiki-spoiler > summary .reveals {
  font-weight: normal;
  font-style: italic;
  color: var(--ink-faint);
}

/* Narrow screens */
@media (max-width: 768px) {
  body {
    font-size: 1.4rem;
  }

  main {
    max-width: 95%;
    margin-top: 2rem;
    padding: 2rem 1.5rem 2.5rem;
  }
}

@media (max-width: 600px) {
  :root {
    --footer-height: 3.6rem;
  }

  body {
    font-size: 1.3rem;
    line-height: 1.55;
  }

  main {
    max-width: 100%;
    margin: 1.5rem 0.5rem 0;
    padding: 1.5rem 1.25rem 2rem;
    border-radius: 0;
  }

  body > footer {
    font-size: 0.85rem;
  }

  body > footer p {
    white-space: normal;
    line-height: 1.3;
  }

  button,
  input[type="submit"],
  a.cta[role="button"] {
    min-height: 2.75rem;
    padding: 0.6em 1.25em;
    font-size: 0.9rem;
  }

  .game-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .game-grid > li:last-child:nth-child(odd) {
    display: block;
  }

  .game-grid > li:last-child:nth-child(odd) .game-tile {
    width: 100%;
  }

  .game-buy iframe {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 1.2rem;
  }

  main {
    margin: 1rem 0.25rem 0;
    padding: 1.25rem 1rem 1.5rem;
  }

  body > footer {
    font-size: 0.75rem;
  }
}

header nav .nav-search {
  position: relative;
}

.site-search,
.search-form {
  --control-height: calc(2.4rem + 4px);
  display: flex;
  align-items: stretch;
  height: var(--control-height);
  border-radius: var(--radius);
}

.site-search:focus-within,
.search-form:focus-within {
  outline: 2px solid var(--mauve);
}

.site-search input,
.search-form input {
  box-sizing: border-box;
  height: 100%;
  min-width: 0;
  margin: 0;
  appearance: none;
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
  color: var(--ink);
  background: var(--well);
  border: 2px solid var(--rule);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 0 0.7em;
  outline: none;
}

.site-search input {
  width: 10rem;
}

.site-search button,
.search-form button {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  white-space: nowrap;
  color: var(--mauve-deep);
  background: var(--panel);
  border: 2px solid var(--rule);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-sizing: border-box;
  height: 100%;
  margin: 0;
  padding: 0 0.75em;
  cursor: pointer;
  outline: none;
  transition: background var(--quick), color var(--quick);
}

.site-search button:hover,
.site-search button:focus,
.search-form button:hover,
.search-form button:focus {
  color: var(--mauve);
  background: var(--well);
}

header nav .search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  width: min(26rem, 90vw);
  max-height: 70vh;
  overflow-y: auto;
  margin: 0;
  padding: 0.5rem;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--rule);
  box-shadow: var(--bar-shadow);
  z-index: 20;
}

header nav .site-search:focus-within .search-suggestions:not(:empty),
header nav .search-suggestions:not(:empty):hover {
  display: block;
}

.search-suggestions,
.search-results {
  font-family: var(--font-mono);
}

.search-suggestions li,
.search-results li {
  display: block;
  margin: 0;
  padding: 0.7em 0.9em;
  background: var(--void);
  border: 1px solid var(--rule);
  transition: border-color var(--quick);
}

.search-suggestions li:hover,
.search-results li:hover {
  border-color: var(--mauve);
}

.search-suggestions li + li {
  margin-top: 0.5rem;
}

header nav .search-suggestions a,
.search-results a {
  display: block;
  margin: 0 0 0.4em;
  padding: 0 0 0.35em;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
  white-space: normal;
  color: var(--rose);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  text-decoration: none;
}

header nav .search-suggestions a:hover,
header nav .search-suggestions a:focus,
.search-results a:hover,
.search-results a:focus {
  color: var(--rose-bright);
  background: none;
  outline: none;
}

.search-suggestions li.search-has-art,
.search-results li.search-has-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 616 / 353;
  overflow: hidden;
}

.search-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-has-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(24, 23, 28, 0.94) 0%, rgba(24, 23, 28, 0.8) 45%, rgba(24, 23, 28, 0.1) 100%);
}

.search-has-art > :not(.search-art) {
  position: relative;
  z-index: 1;
}

.search-has-art .search-blurb {
  color: var(--ink);
}

.search-blurb {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--ink-faint);
}

.search-badges {
  display: block;
  margin-top: 0.6em;
  padding-top: 0.5em;
  border-top: 1px solid var(--rule);
}

.search-badge {
  display: inline-block;
  margin-right: 0.5em;
  white-space: nowrap;
  padding: 0.1em 0.6em;
  border: 1px solid var(--ink-faint);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--void);
}

.search-form {
  margin: 1rem 0;
}

.search-form input {
  flex: 1;
  font-size: 1.1rem;
}

.search-count {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.search-results {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6em;
  margin: 1rem 0 0;
  padding: 0;
}

.search-results li {
  flex: 0 1 calc((100% - 1.2em) / 3);
  min-width: 240px;
}

@media (max-width: 1199px) {
  header nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.5rem;
    padding: 0.5rem 0.75rem;
  }

  .nav-toggle {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
  }

  .nav-toggle-label {
    display: inline-flex;
    gap: 0.5em;
    cursor: pointer;
    user-select: none;
  }

  .nav-toggle-label::before {
    content: "";
    width: 18px;
    height: 14px;
    background: repeating-linear-gradient(to bottom, currentColor 0 2px, transparent 2px 6px);
  }

  .nav-toggle:checked + .nav-toggle-label::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.45);
    cursor: default;
  }

  header nav > ul {
    display: contents;
  }

  header nav > ul::before {
    content: "";
    order: 2;
    flex: 0 0 100%;
  }

  header nav > ul > li {
    display: none;
    order: 3;
    flex: 1 1 21%;
    max-width: calc(25% - 0.375rem);
    margin-top: 0.5rem;
  }

  header nav > ul > .nav-search {
    display: block;
    order: 1;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    margin-top: 0;
  }

  .nav-toggle:checked ~ ul > li {
    display: block;
  }

  header nav > ul > li > a {
    display: flex;
    justify-content: center;
  }

  .site-search {
    max-width: 24rem;
    margin-left: auto;
  }

  .site-search input {
    flex: 1 1 0;
    width: auto;
  }
}

@media (max-width: 600px) {
  .search-results li {
    flex-basis: 100%;
  }

  header nav > ul > li {
    flex-basis: 41%;
    max-width: calc(50% - 0.25rem);
  }

  header nav a,
  .nav-toggle-label,
  .site-search button {
    font-size: 1rem;
  }

  .site-search {
    --control-height: calc(2rem + 4px);
  }

  .site-search button {
    min-height: 0;
    padding: 0 0.75em;
  }
}
