@font-face {
  font-family: "Lexend";
  src: url("/LexendVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --accent: hsl(270 60% 75%);
  --accent-light: hsl(270 60% 88%);
  --bg: #0e0e12;
  --bg-surface: hsl(270 60% 75% / 0.08);
  --border: hsl(270 60% 75% / 0.45);
  --border-hover: hsl(270 60% 75% / 0.65);
  --radius-sm: 8px;
  --radius-md: 12px;
  --text: white;
  --text-secondary: hsl(0 0% 100% / 0.6);
  --mono-font:
    ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas,
    "DejaVu Sans Mono", monospace;
  --min-width: 80rem;
  --accent-error: hsl(0 60% 30% / 0.4);
  color-scheme: dark;
}

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

body {
  margin: 0;
  font-family:
    "Lexend",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  display: grid;
  grid-template-columns: 1fr min(var(--min-width), 90%) 1fr;
  min-height: 100dvh;
  overflow-wrap: break-word;
}

body > * {
  grid-column: 2;
  min-width: 0;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-light);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

body > header {
  align-items: baseline;
  display: flex;
  justify-content: center;
  padding: unset;
}

body > header > :only-child {
  margin-block-start: unset;
}

header > nav {
  width: min(var(--min-width), 90%);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 0;
  overflow-x: auto;
}

header > nav a {
  margin-bottom: unset;
  font-size: 1.15rem;
  text-wrap: nowrap;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

header > nav a:hover {
  background: var(--bg-surface);
}

header > nav a.current {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  color: var(--accent-light);
}

nav > h1 > a {
  margin-left: unset;
  padding-left: unset;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
}

body > header h1 {
  margin: unset;
  font-size: 1.15rem;
}

main {
  padding-top: unset;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

form {
  margin: 1.5rem 0;
  display: grid;
  align-items: start;
  grid-template-columns: 16em 1fr;
  column-gap: 1rem;
  row-gap: 1rem;
}

form > search {
  grid-column: 1 / span 2;
}

fieldset {
  display: flex;
  column-gap: 1ex;
  border: none;
  padding: unset;
  margin: unset;
}

.facet-queries {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

legend {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: baseline;
}

.help {
  font-size: 0.875rem;
}

section {
  border: none;
  margin: unset;
  padding: unset;
  overflow-x: auto;
  overflow-y: hidden;
}

input[type="search"] {
  width: 100%;
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

input[type="search"]::placeholder {
  color: var(--accent);
  opacity: 0.5;
}

input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px hsl(270 60% 75% / 0.2);
}

button,
.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--accent);
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

button:hover,
.button:hover {
  border-color: var(--border-hover);
  background: hsl(270 60% 75% / 0.14);
  color: var(--accent-light);
}

dt::after {
  content: ": ";
}

dd {
  margin-inline-start: 1rem;
}

dd > p,
td > p,
blockquote > p {
  margin: unset;
}

dl {
  display: grid;
  align-items: baseline;
  grid-row-gap: 1ch;
  grid-template-rows: 1fr;
  grid-template-columns: max-content 1fr;
}

dt {
  color: var(--text-secondary);
  font-weight: 500;
}

code {
  font-family: var(--mono-font);
  font-size: 0.9em;
  background: var(--bg-surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  margin: unset;
  padding: 1ch 1.4ch;
  background: var(--bg-surface);
  border: 1px solid hsl(270 60% 75% / 0.15);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

#pagination {
  display: flex;
  justify-content: space-between;
  align-items: baseline;

  a[rel="next"] {
    margin-left: auto;
  }
}

#results footer {
  grid-column: 1 / 3;
  text-align: center;
}

.error {
  background: var(--accent-error);
  border-color: hsl(0 60% 50% / 0.4);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 0;
}

h3 {
  margin: unset;
  font-size: 1.25rem;
  font-weight: 600;
  display: inline-block;
}

dialog {
  max-width: unset;
  width: min(var(--min-width), 90%);
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

dialog::backdrop {
  background: hsl(0 0% 0% / 0.6);
}

dialog > button {
  float: right;
}

main > h2 {
  margin-top: 1.5rem;
}

dialog > h2 {
  margin-top: 0.5rem;
}

#results {
  display: contents;
}

#results .notice {
  grid-column: 1 / 3;
}

.notice {
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.facets {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
}

.facets h3 {
  margin-top: 0;
  padding: 0.25em 0 0.5em;
}

.facets h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.25em 0 0;
}

.facets ul {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-bottom: 1ex;
}

.facet .term {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  padding: 0.25rem 0;
  margin-right: 0;
  transition: border-color 0.15s ease;
}

.facet .term:hover {
  border-bottom-color: var(--border);
}

.term .count {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

table {
  margin: 0;
  width: 100%;
  table-layout: fixed;
  white-space: nowrap;
  border-collapse: collapse;
}

thead {
  background: var(--bg-surface);
}

th {
  font-weight: 600;
  text-align: left;
}

th.description {
  width: 50%;
}

th.score {
  width: 8ex;
}

td,
th {
  padding: 0.25rem 0.5rem;
  text-overflow: ellipsis;
  overflow: clip;
}

tr {
  height: 1.5rem;
  border-bottom: 1px solid hsl(270 60% 75% / 0.1);
}

thead tr {
  border-bottom: 1.5px solid var(--border);
}

td.description > * {
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: clip;
}

td.description > *:not(:first-child) {
  display: none;
}

ul:only-child {
  padding-inline-start: unset;
  margin: unset;
}

li {
  display: inline-block;
  margin-right: 1ex;
  list-style: none;
}

p:last-child {
  margin-bottom: unset;
}

.open-sibling-dialog {
  cursor: pointer;
  text-decoration: underline;
}

var {
  font-style: normal;
  font-family: var(--mono-font);
}

body > footer {
  margin-top: 2rem;
  padding-top: 0.5rem;
  border-top: 1px solid hsl(270 60% 75% / 0.15);
  color: var(--text-secondary);
}

body > footer > p {
  margin: 0.5rem 0;
  font-size: 0.875rem;
}

@media only screen and (max-width: 768px) {
  body {
    grid-template-columns: 1ch 1fr 1ch;
  }

  header > nav {
    width: auto;
    padding: 1ch;
    padding-right: 0;
  }
}

@media only screen and (max-width: 600px) {
  header > nav {
    display: unset;
    padding: 1ch 0;
  }

  td,
  th {
    padding: 0.2rem;
  }

  tr,
  .term {
    height: 2rem;
  }

  .description,
  .score {
    display: none;
  }

  form {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  form > search {
    grid-column: 1;
  }

  .facets {
    grid-area: 3;
  }

  #results > table {
    grid-area: 2;
  }

  dialog {
    width: 100%;
    padding: 1rem 1ch;
  }

  dialog > button {
    float: none;
    display: block;
    margin-left: auto;
  }

  dl {
    grid-template-columns: 1fr;
  }

  dd {
    margin-inline-start: 0;
  }

  pre {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 1ch;
  }

  #results .notice,
  #results footer {
    grid-column: 1;
  }
}
