/* The stylesheet of the site: the header of every page, the HTML pages
   that the gateway renders, and the shell of the 3D app. The boot script
   of each page marks the root element with `app` when the browser runs the
   3D app; the rules at the end of this file then cover the page with the
   app. The colours match the palette of the app
   (web/viewer/src/site_pages.rs).

   Every text colour keeps a contrast of at least 4.5:1 on the page and
   the panel colour (WCAG AA). The layout starts at phone width, and each
   wider screen adds to it. */

:root {
  --bg: #040a12;
  --panel: #08121e;
  --panel-2: #0b1826;
  --edge: #162e42;
  --accent: #38d6ff;
  --warm: #ffb340;
  --text: #b2ccdc;
  --strong: #e4f2fa;
  --dim: #8aa4b8;
  --alert: #ff6a57;
  --header-h: 3rem;
  --radius: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial,
    sans-serif;
  color-scheme: dark;
}

/* Vulture Sans: the Latin subset of IBM Plex Sans that the story text of
   the Intel pages uses. The fonts are under the SIL Open Font License, in
   fonts/OFL.txt, and scripts/build_fonts.py makes them. */

@font-face {
  font-family: "Vulture Sans";
  src: url("/fonts/VultureSans-Regular.ttf?v=1") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vulture Sans";
  src: url("/fonts/VultureSans-Italic.ttf?v=1") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Vulture Sans";
  src: url("/fonts/VultureSans-SemiBold.ttf?v=1") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

/* An element with the hidden attribute stays hidden, even under a rule
   that sets its display. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--strong);
}

:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: var(--warm);
  color: #111;
  font-weight: 600;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 0.5rem;
}

/* The site header, on every page and over the 3D app. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: var(--header-h);
  padding: 0 0.75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--edge);
}

.brand {
  flex: none;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.brand-a {
  color: var(--accent);
}

.brand-b {
  color: var(--warm);
}

/* The links of the header. A narrow screen shows the menu button, and the
   menu opens the links in a list under the header. A wide screen shows
   the links in a bar. Only one of the two shows, so a screen reader reads
   one list of links. The header stays one line, so the 3D view keeps its
   height. */

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  color: var(--dim);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--strong);
  background: var(--panel-2);
}

.site-nav a[aria-current="page"] {
  color: var(--bg);
  background: var(--accent);
}

.site-nav-bar {
  display: none;
}

.site-menu {
  margin-left: auto;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.6rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  color: var(--strong);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.menu-toggle::-webkit-details-marker {
  display: none;
}

.menu-toggle:hover,
.site-menu[open] .menu-toggle {
  border-color: var(--accent);
}

/* The word of the menu button needs room. Below this width the button
   shows its icon, and the word stays for a screen reader. */
@media (max-width: 24.49rem) {
  .menu-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

.site-nav-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  max-height: calc(100vh - var(--header-h));
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  padding: 0.5rem 0.75rem 0.75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--edge);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.5);
}

.site-nav-menu ul {
  flex-direction: column;
}

.site-nav-menu a {
  min-height: 3rem;
  padding: 0 0.75rem;
  font-size: 1rem;
}

@media (min-width: 40rem) {
  .site-header {
    gap: 1rem;
    padding: 0 1rem;
  }

  .brand {
    font-size: 1.05rem;
    letter-spacing: 0.08em;
  }
}

@media (min-width: 64rem) {
  .site-nav-bar {
    display: block;
    min-width: 0;
    margin-right: auto;
  }

  .site-menu {
    display: none;
  }
}

/* The pages. */

.page {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

h1,
h2 {
  color: var(--strong);
  line-height: 1.25;
}

h1 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.6rem;
}

h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.2rem;
}

.lede {
  max-width: 44rem;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.crumbs {
  font-size: 0.85rem;
  color: var(--dim);
}

.summary {
  margin: 1rem 0 0.75rem;
  color: var(--dim);
}

.summary strong {
  color: var(--accent);
}

.notice {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--warm);
  border-radius: var(--radius);
  background: rgba(255, 179, 64, 0.08);
  color: var(--strong);
}

/* A notice of more than one line, such as the notice of full uploads. */
.notice p {
  margin: 0;
}

.notice p + p {
  margin-top: 0.5rem;
}

.empty,
.muted {
  color: var(--dim);
}

.sub {
  display: block;
  color: var(--dim);
  font-size: 0.8rem;
}

abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
  cursor: help;
}

/* The filter bar. Each field has a visible label. */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
  padding: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}

.filters label {
  display: flex;
  flex: 1 1 8rem;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--dim);
}

/* The first field, the name or the server, takes a line of its own on a
   phone. A wider screen gives it a fair share of the bar. */
.filters label:first-child {
  flex-basis: 100%;
}

@media (min-width: 40rem) {
  .filters label {
    flex: 0 1 16rem;
  }

  .filters label:first-child {
    flex-basis: 16rem;
  }
}

.filters label.check {
  flex: none;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  color: var(--text);
  font-size: 0.9rem;
}

.filters input[type="search"],
.filters select {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg);
  color: var(--strong);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  font: inherit;
}

.filters input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.filters button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.filters button:hover,
.button:hover {
  background: rgba(56, 214, 255, 0.12);
  color: var(--strong);
}

.button.primary,
.filters button {
  background: var(--accent);
  color: var(--bg);
}

.button.primary:hover,
.filters button:hover {
  background: var(--strong);
  color: var(--bg);
}

.button.large {
  min-height: 3rem;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
}

.reset {
  align-self: center;
  font-size: 0.9rem;
}

/* The state badges: a word, with a colour as a second cue. */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.badge.live {
  color: var(--accent);
}

.badge.stale {
  color: var(--warm);
}

.badge.offline {
  color: var(--dim);
}

th .badge {
  margin-left: 0.5rem;
}

/* The data tables. On a narrow screen each row becomes a card, and each
   cell shows the label of its column. */

.table-wrap {
  margin: 0 0 1rem;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

table.data thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* A card holds one cell on each line. The counts go two on a line, so a
   card stays short on a phone. */
table.data tr {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}

table.data td,
table.data tbody th {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 1rem;
  grid-column: 1 / -1;
  padding: 0.3rem 0;
  text-align: right;
  font-weight: 400;
  overflow-wrap: anywhere;
}

/* Two counts share a line. A lone count keeps the whole line. */
table.data tr:has(td.num + td.num) td.num {
  grid-column: auto;
}

/* The second line of a cell, such as the age of a time or the map of a
   server, goes under the value. */
table.data td .sub {
  flex-basis: 100%;
}

table.data time {
  white-space: nowrap;
}

table.data tbody th a {
  text-decoration: none;
}

table.data tbody th a:hover,
table.data tbody th a:focus-visible {
  text-decoration: underline;
}

table.data tbody th {
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
}

/* The name of the column. It never breaks inside a word, and the value
   takes the rest of the line. */
table.data td[data-label]::before {
  content: attr(data-label);
  flex: none;
  max-width: 60%;
  color: var(--dim);
  text-align: left;
  overflow-wrap: normal;
}

table.data td.action {
  justify-content: flex-end;
}

table.data td.action:empty {
  display: none;
}

@media (min-width: 48rem) {
  .table-wrap {
    overflow-x: auto;
    border: 1px solid var(--edge);
    border-radius: var(--radius);
  }

  table.data thead {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  table.data thead th {
    padding: 0.6rem 0.75rem;
    background: var(--panel-2);
    color: var(--dim);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--edge);
  }

  table.data thead th a {
    color: var(--dim);
  }

  table.data thead th[aria-sort] {
    color: var(--accent);
  }

  table.data tr {
    display: table-row;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
  }

  table.data tbody tr:nth-child(even) {
    background: rgba(8, 18, 30, 0.6);
  }

  table.data tbody tr:hover {
    background: var(--panel-2);
  }

  table.data td,
  table.data tbody th {
    display: table-cell;
    padding: 0.6rem 0.75rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid rgba(22, 46, 66, 0.6);
  }

  table.data tbody th {
    font-size: 1rem;
  }

  table.data td[data-label]::before {
    content: none;
  }

  table.data td .sub {
    display: block;
  }

  /* The name of a server needs room to read. A count needs little. */
  table.data td[data-label="Server"] {
    min-width: 11rem;
  }

  table.data thead th.num {
    white-space: normal;
  }

  table.data .num {
    text-align: right;
  }

  table.data td.action {
    text-align: right;
  }

  table.data td.action:empty {
    display: table-cell;
  }
}

/* The panel of one server or one pilot. */

.panel {
  margin: 0 0 1.5rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}

.state-line {
  margin: 0 0 1rem;
  color: var(--strong);
  overflow-wrap: anywhere;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 1rem 0 0;
}

.facts dt {
  color: var(--dim);
  font-size: 0.8rem;
}

.facts dd {
  margin: 0;
  color: var(--strong);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.weather-line {
  margin: 0.75rem 0 0;
  color: var(--dim);
  font-size: 0.9rem;
}

.aliases {
  margin: 1rem 0 0;
  color: var(--dim);
}

/* The upload form, and the links of the manage page of an upload. */

/* The progress bar of a pending upload. The page reloads every 3 s. */

.upload-progress {
  margin: 0 0 1rem;
}

.upload-progress label {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--strong);
  font-variant-numeric: tabular-nums;
}

.upload-progress progress {
  display: block;
  width: 100%;
  height: 0.6rem;
  accent-color: var(--accent);
}

.upload-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}

.upload-form label {
  color: var(--strong);
  font-weight: 600;
}

/* The flex gap of the form sets the space around the line. */
.upload-form .while-you-wait {
  margin: 0 0 0.5rem;
}

.upload-form input[type="file"] {
  max-width: 100%;
  color: var(--text);
  font: inherit;
}

/* The file button is the main control of the form, so it is a large
   target. */
.upload-form input[type="file"]::file-selector-button {
  min-height: 2.75rem;
  margin-right: 0.75rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.error {
  margin: 0 0 0.5rem;
  color: var(--alert);
  font-weight: 600;
}

.link-box {
  padding: 0.6rem 0.8rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.delete-form .button {
  border-color: var(--alert);
  color: var(--alert);
}

/* The page links. Each link is a tap target of at least 2.5rem. */

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1rem 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--edge);
  text-decoration: none;
}

.pagination span[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 700;
}

.pagination .gap {
  border: 0;
  min-width: 1rem;
  color: var(--dim);
}

/* The call to action and the steps of the home page. */

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.steps ol {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 0.75rem 1rem 0.75rem 3.25rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.steps h3 {
  margin: 0 0 0.25rem;
  color: var(--strong);
  font-size: 1rem;
}

.steps p {
  margin: 0;
}

@media (min-width: 48rem) {
  .steps ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* The about page. */

.prose {
  max-width: 42rem;
}

.prose li {
  margin: 0 0 0.5rem;
}

/* The controls of the 3D view, on the about page. */

table.controls {
  width: 100%;
  border-collapse: collapse;
}

table.controls th,
table.controls td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--edge);
  text-align: left;
  vertical-align: top;
}

table.controls thead th {
  color: var(--dim);
  font-size: 0.8rem;
  font-weight: 600;
}

table.controls tbody th {
  color: var(--strong);
  font-weight: 600;
}

.site-footer {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid var(--edge);
  color: var(--dim);
  font-size: 0.85rem;
}

/* A touch screen gets controls of at least 44 by 44 CSS pixels. */

@media (pointer: coarse) {
  .button,
  .filters button,
  .filters input[type="search"],
  .filters select,
  .pagination a,
  .pagination span,
  .site-nav a,
  .mode-toggle {
    min-height: 2.75rem;
  }

  .pagination a,
  .pagination span {
    min-width: 2.75rem;
  }

  .search-toggle {
    width: 2.75rem;
    height: 2.75rem;
  }

  .filters label.check {
    min-height: 2.75rem;
  }

  .filters input[type="checkbox"] {
    width: 1.4rem;
    height: 1.4rem;
  }

  .site-footer a {
    display: inline-block;
    padding: 0.6rem 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .site-nav a {
    transition: background-color 0.15s ease, color 0.15s ease;
  }
}

/* The Intel pages: the index, the cards of a kind, and the article of an
   entry. */

.intel-kinds,
.intel-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 2rem;
  padding: 0;
  list-style: none;
}

.intel-kinds a,
.intel-card {
  display: block;
  height: 100%;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}

.intel-kinds a:hover,
.intel-card:hover {
  border-color: var(--accent);
}

.intel-kinds h2 {
  margin: 0 0 0.5rem;
}

.intel-kinds p {
  margin: 0 0 0.5rem;
}

.intel-card-title {
  display: block;
  color: var(--strong);
  font-weight: 600;
}

.intel-card-subtitle,
.intel-card-meta {
  display: block;
  color: var(--dim);
  font-size: 0.85rem;
}

.intel-card-summary {
  display: block;
  margin-top: 0.5rem;
}

.intel {
  max-width: 46rem;
  font-family: "Vulture Sans", var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.intel h1 {
  margin-bottom: 0.25rem;
  font-size: 2rem;
}

.intel-subtitle {
  margin: 0;
  color: var(--strong);
  font-size: 1.15rem;
}

.intel-meta {
  margin: 0.25rem 0 1rem;
  color: var(--dim);
}

.intel-clock {
  margin: -0.5rem 0 1rem;
  color: var(--dim);
}

.intel .beat,
.intel-facts,
.intel-related,
.intel-sources {
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge);
}

.intel .beat h2,
.intel-facts h2,
.intel-related h2,
.intel-sources h2 {
  margin-top: 0;
}

.intel-figures {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.intel-figures div {
  padding: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}

.intel-figures dt {
  color: var(--dim);
  font-size: 0.8rem;
}

.intel-figures dd {
  margin: 0;
  color: var(--strong);
  font-size: 1.2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.intel-timeline {
  margin: 1rem 0;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--edge);
  list-style: none;
}

.intel-timeline li {
  position: relative;
  margin: 0 0 0.75rem;
}

.intel-timeline li::before {
  content: "";
  position: absolute;
  left: -1.65rem;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
}

.intel-date {
  color: var(--warm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.intel-table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
}

/* In its wrap, a table takes no margin of its own: the wrap spaces it, and
   on a wide screen the border of the wrap fits the table. */
.table-wrap > .intel-table {
  margin: 0;
}

.intel-table th,
.intel-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--edge);
  text-align: left;
  vertical-align: top;
}

.intel-table th[scope="row"] {
  color: var(--dim);
  font-weight: 400;
}

.intel-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.intel-places,
.intel-related ul {
  padding-left: 1.25rem;
}

.sub-inline {
  color: var(--dim);
  font-size: 0.85rem;
}

.intel-loadout {
  margin: 1.5rem 0;
}

.intel-loadout h3 {
  margin: 0 0 0.5rem;
  color: var(--strong);
  font-size: 1rem;
  font-weight: 600;
}

.intel-diagram {
  display: block;
  width: 100%;
  max-width: 28rem;
  height: auto;
  margin: 0 auto 1rem;
}

.intel-diagram .outline {
  fill: var(--panel-2);
  stroke: var(--accent);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}

/* A weapon on a pylon and a weapon of the row in front of the nose: a
   fill a little brighter than the outline. */
.intel-diagram .store {
  fill: var(--edge);
  stroke: var(--accent);
  stroke-width: 1px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.intel-diagram .station circle {
  fill: var(--bg);
  stroke: var(--warm);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}

.intel-diagram .station line {
  stroke: var(--dim);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.intel-diagram .station text {
  fill: var(--strong);
  font-family: var(--font);
  font-weight: 700;
}

.cite {
  font-size: 0.7em;
  line-height: 0;
}

.cite a {
  padding: 0 0.1em;
  text-decoration: none;
}

.intel-sources ol {
  padding-left: 1.5rem;
  color: var(--dim);
  font-size: 0.9rem;
}

.intel-sources li {
  margin: 0 0 0.5rem;
}

.intel-sources li:target {
  color: var(--strong);
}


/* The mode button at the end of the header: "Text version" over the 3D
   app, and "3D version" on an HTML page in a browser that runs the app.
   app.js names it and shows it. */

.mode-toggle {
  flex: none;
  min-height: 2.25rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.mode-toggle:hover {
  border-color: var(--accent);
  color: var(--strong);
}

/* The search button before the mode button: a magnifier that opens the
   search panel of the 3D app. app.js shows it in the app mode only. The
   app sets aria-expanded while the panel shows. */

.search-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}

.search-toggle[hidden] {
  display: none;
}

.search-toggle:hover,
.search-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--strong);
}

/* A link into the 3D view needs the app. A browser that cannot run the
   app does not show the link, and the note says why. */

html:not(.app-capable) .watch {
  display: none;
}

html.app-capable .app-note-html {
  display: none;
}

/* A calm note: a fact about the page, not a fault. */
.note {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

/* The shell of the 3D app: the canvas under the header, and the load
   overlay. Each page holds the shell, and only the app mode shows it. */

.app-shell,
.skip-link.app-only {
  display: none;
}

html.app,
html.app body {
  height: 100%;
  overflow: hidden;
}

html.app .page,
html.app .site-footer,
html.app .skip-link.html-only {
  display: none;
}

html.app .app-shell,
html.app .skip-link.app-only {
  display: block;
}

#viewer {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  left: 0;
}

#vulture-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

/* The overlay starts under the header, so the links of the header stay
   usable while the app loads. */
#load-progress {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.load-progress-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(420px, 100% - 2rem);
  max-height: 100%;
  overflow-y: auto;
}

.load-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--edge);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: load-spin 0.9s linear infinite;
}

@keyframes load-spin {
  to {
    transform: rotate(360deg);
  }
}

#load-progress-label {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.load-progress-track {
  width: 100%;
  height: 4px;
  background: var(--panel-2);
  border-radius: 2px;
  overflow: hidden;
}

/* What the site is and how to move the view, under the bar. A touch
   screen gets the gestures, and a mouse gets the mouse controls. */

.load-pitch {
  margin-top: 1.5rem;
  text-align: center;
}

.load-lede {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 0.95rem;
}

.load-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.load-controls div {
  padding: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}

.load-controls dt {
  color: var(--strong);
  font-size: 0.85rem;
  font-weight: 600;
}

.load-controls dd {
  margin: 0;
  color: var(--dim);
  font-size: 0.8rem;
}

.load-controls.touch-only {
  display: none;
}

/* A phone on its side has little height: the controls stay, the lede goes. */
@media (max-height: 30rem) {
  .load-lede {
    display: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .load-controls.touch-only {
    display: grid;
  }

  .load-controls.mouse-only {
    display: none;
  }
}

.load-progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1b8fb4, var(--accent));
  transition: width 0.15s ease-out;
}
