/* The look of the application.
 *
 * The palette is dark and quiet: the ink, the paper, and one colour for the
 * words of the question. The page is read for a long time, and the words of
 * the question are the only ones that speak.
 *
 * The styles are a file of the repository, and there is no build: the page
 * is rendered on the server and the browser is given this file.
 */

:root {
  --ink: #e7ebf0;
  --paper: #12151b;
  --card: #191e26;
  --quiet: #141920;
  --line: #2a313c;
  --muted: #8e97a5;
  --marked: #d3a559;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 1.5rem 4rem;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 58rem;
  margin: 0 auto;
}

h1 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.5rem;
}

h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 3rem 0 0.75rem;
}

/* The lede of the page says what the proof of concept is, and it is quiet
   about it. */
.the-lede {
  margin: 0 0 2rem;
  max-width: 46rem;
  color: var(--muted);
}

/* **The search is the thing the page is for,** and it stands at the top of
   it: the words of the question are typed into it, and the passages come
   under it while they are written. */
.the-search {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 1rem 0 1.25rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.the-search label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.the-search input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.the-search input:focus {
  border-color: var(--muted);
}

/* The results of the search. They come under the search, and they are the
   passages of the documents with the words of the question in them. */
.the-results {
  min-height: 4rem;
}

.the-count {
  margin: 1.5rem 0 0.75rem;
  color: var(--muted);
}

.the-passages {
  list-style: none;
  margin: 0;
  padding: 0;
}

.the-passage {
  padding: 1rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
}

.the-place {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.the-document {
  color: var(--ink);
  font-weight: 600;
}

.the-path::before {
  content: "› ";
  color: var(--line);
}

.the-text {
  margin: 0;
  max-width: 46rem;
}

.the-text mark {
  background: transparent;
  color: var(--marked);
  font-weight: 600;
}

.the-empty {
  color: var(--muted);
  font-style: italic;
}

/* The tables of the page: the documents in the index, and the commands. */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

td.the-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  color: var(--ink);
  background: var(--quiet);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* The sections of a document, and the ones that hold the sense of a prompt.
   The sections that hold it are marked, and the words of the prompt are
   marked in them. */
.the-section {
  padding: 1rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
}

.the-section h2 {
  margin: 0 0 0.25rem;
  color: var(--ink);
  font-size: 1.05rem;
  text-transform: none;
  letter-spacing: 0;
}

.the-section.the-match {
  border-left: 3px solid var(--marked);
  padding-left: 0.75rem;
}

.the-path {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.the-place {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.the-place a,
.the-document a {
  color: var(--accent);
}

/* The page of a document, as the model of the reading saw it. The picture
   is the ground of the boxes, and the boxes are in the scale of the model:
   a thousand parts over the whole page. */
.the-page {
  position: relative;
  display: inline-block;
  margin: 1.5rem 0;
  max-width: 100%;
}

.the-page img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.the-box {
  position: absolute;
  border: 2px solid var(--marked);
  background: rgba(211, 165, 89, 0.12);
  pointer-events: none;
}
