/* Dark, minimal, and drawn from the game's star map: near black ground, slate text, scanner red accents. */

:root {
  --ground: #07090c;
  --panel: #0c1015;
  --frame: #2a1a1d;
  --frame-bright: #5a1d22;
  --text: #c9d1d9;
  --dim: #7d8a97;
  --heading: #e6ebf0;
  --accent: #b00000;
  --accent-glow: rgba(176, 0, 0, 0.35);
  --link: #e05560;
  --link-hover: #ff7b84;
}

html {
  overflow-y: scroll;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--ground);
  background-image: radial-gradient(ellipse at 50% -10%, rgba(120, 0, 0, 0.22), transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3 {
  font-family: "Exo 2", sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--heading);
}

h1 {
  border-bottom: 1px solid var(--frame);
  padding-bottom: 6px;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--link-hover);
  text-decoration: underline;
}

.not-footer {
  flex: 1 0 auto;
}

/* --- Containers --- */

.container,
.wide-container,
.codex-container {
  box-sizing: border-box;
  max-width: calc(100% - 32px);
  margin: 30px auto 60px;
  padding: 24px 32px;
  background-color: var(--panel);
  border: 1px solid var(--frame);
}

.container {
  width: 800px;
}

.wide-container {
  width: 1000px;
}

.codex-container {
  width: 1100px;
}

/* --- Buttons --- */

.link-button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.link-button,
.link-button:link,
.link-button:visited {
  font-family: "Exo 2", sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  padding: 6px 16px;
  border: 1px solid var(--frame-bright);
  background-color: rgba(0, 0, 0, 0.35);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.link-button:hover,
.link-button:focus,
.link-button.active {
  color: var(--heading);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  text-decoration: none;
}

/* --- Top navigation --- */

.navigation-panel {
  background-color: rgba(0, 0, 0, 0.55);
  border-bottom: 1px solid var(--frame);
  padding: 10px 16px;
}

.navigation-panel .link-button-container {
  justify-content: center;
}

/* --- Social sidebar --- */

.social-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px;
}

.social-buttons a {
  display: block;
  line-height: 0;
  padding: 8px;
  border: 1px solid var(--frame);
  background-color: rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.social-buttons a:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.social-button {
  width: 80px;
  height: auto;
}

@media only screen and (min-width: 768px) {
  .social-buttons {
    position: fixed;
    top: 100px;
    left: 0;
    flex-direction: column;
  }
}

/* --- Home --- */

.home-banner {
  display: block;
  margin: 40px auto 0;
  width: 700px;
  max-width: calc(100% - 32px);
}

.youtube-embed {
  margin-top: 15px;
  text-align: center;
}

.youtube-embed iframe {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* Every slide stacks in the first one's place and only the active one shows, so the box never changes size and the page does not jump. */
.image-carousel {
  margin-top: 30px;
}

.image-carousel-slides {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.image-carousel-slide {
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.image-carousel-slide:first-child {
  position: static;
}

.image-carousel-slide img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  border: 1px solid var(--frame);
}

.image-carousel-slide.active {
  visibility: visible;
}

.image-carousel-prev,
.image-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s;
}

/* Beside the screenshot where there is room, over its edges on narrow screens. */
.image-carousel-prev {
  left: -68px;
}

.image-carousel-next {
  right: -68px;
}

@media only screen and (max-width: 960px) {
  .image-carousel-prev {
    left: 8px;
  }

  .image-carousel-next {
    right: 8px;
  }
}

.image-carousel-prev:hover,
.image-carousel-next:hover {
  background: #d8dce0;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* The chevron is two borders of a rotated square, nudged sideways so its point and arms balance around the middle of the button. */
.image-carousel-prev::before,
.image-carousel-next::before {
  content: "";
  width: 16px;
  height: 16px;
  border-top: 3px solid #000000;
  border-left: 3px solid #000000;
}

.image-carousel-prev::before {
  transform: translateX(4px) rotate(-45deg);
}

.image-carousel-next::before {
  transform: translateX(-4px) rotate(135deg);
}

.image-carousel-counter {
  text-align: center;
  margin-top: 8px;
  color: var(--dim);
  font-size: 15px;
}

.store-buttons-container {
  display: flex;
  justify-content: center;
  margin: 40px 0 50px;
}

.store-button-image {
  width: 280px;
  max-width: 100%;
}

/* --- FAQ --- */

.faq-toc h3 {
  margin-bottom: 4px;
}

.faq-toc ul {
  margin-top: 0;
}

.faq-header {
  margin-top: 48px;
}

/* --- Codex --- */

.codex-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1em;
}

.codex-intro,
.codex-empty-note {
  text-align: center;
  color: var(--dim);
}

/* The codex's front page: the Traveler's Guide project's picture centred over a menu banner, the welcome under it. */
.codex-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 30px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--frame);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.codex-hero:hover,
.codex-hero:focus {
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
  text-decoration: none;
}

.codex-guide {
  width: 300px;
  max-width: 70%;
  filter: drop-shadow(0 0 24px rgba(0, 0, 0, 0.8));
}

/* The codex's welcome under its guide: large, bright and glowing, so it reads against the banner. */
.codex-tagline {
  margin-top: 22px;
  text-align: center;
  font-family: "Exo 2", sans-serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--heading);
  text-shadow: 0 0 14px var(--accent-glow), 0 0 4px #000, 0 0 2px #000;
}

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

.codex-table-wrap {
  overflow-x: auto;
}

.codex-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.codex-table th,
.codex-table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--frame);
  vertical-align: top;
}

.codex-table th {
  color: var(--heading);
}

.codex-research td:first-child {
  white-space: nowrap;
  color: var(--dim);
}

.codex-trait-link img {
  width: 20px;
  height: 20px;
  margin-right: 6px;
  vertical-align: -4px;
}

.codex-motto {
  font-style: italic;
}

.codex-none {
  color: var(--dim);
}

.codex-figure {
  margin: 1em 0;
}

.codex-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--frame);
}

.codex-figure-row {
  display: flex;
  gap: 10px;
}

.codex-figure-row img {
  flex: 1;
  min-width: 0;
}

.codex-figure figcaption {
  margin-top: 6px;
  font-size: 15px;
  color: var(--dim);
  text-align: center;
}

/* A primary trait or hazard: a heading and a paragraph, linked to by its id. */
.codex-entry {
  border-bottom: 1px solid var(--frame);
  scroll-margin-top: 20px;
}

.codex-entry:target h2,
.codex-card:target h3 {
  color: var(--link-hover);
}

.codex-trait-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.codex-trait-title img {
  width: 64px;
  height: 64px;
}

/* A hull, component or project: its picture beside everything the technology browser says of it. */
.codex-card {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--frame);
  scroll-margin-top: 20px;
}

.codex-card-picture img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  border: 1px solid var(--frame);
  background-color: #000;
}

.codex-card-body {
  flex: 1;
  min-width: 0;
}

.codex-card-body h3 {
  margin: 0;
}

.codex-card-kind {
  color: var(--dim);
  font-size: 15px;
}

.codex-card-description {
  white-space: pre-line;
}

.codex-card-tables {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px;
  margin-top: 10px;
}

.codex-pairs {
  font-size: 15px;
  border-collapse: collapse;
}

.codex-pairs caption {
  text-align: left;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.codex-pairs td {
  padding: 1px 12px 1px 0;
  vertical-align: top;
}

.codex-pairs td:last-child {
  color: var(--heading);
}

/* A hull's slots, as the ship designer lays them out in half cells. */
.codex-hull-layout {
  --unit: 34px;
  position: relative;
  margin: 12px 0;
}

.codex-slot {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: pre-line;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid #000;
  background-color: #141a22;
  outline: 1px solid var(--frame);
  overflow: hidden;
}

.codex-hold {
  color: var(--dim);
  background: repeating-linear-gradient(45deg, #141a22, #141a22 4px, #1f2731 4px, #1f2731 6px);
}

/* A mining rig's environment limits as the game's system summary draws a race's: a black track per axis, its band in the axis's colour. */
.codex-ranges {
  margin-top: 10px;
  max-width: 560px;
}

.codex-range {
  display: grid;
  grid-template-columns: 100px 1fr 150px;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.codex-range-name {
  font-weight: bold;
  color: var(--heading);
}

.codex-range-track {
  position: relative;
  height: 12px;
  background-color: #000;
  outline: 1px solid var(--frame);
}

.codex-range-band {
  position: absolute;
  top: 0;
  bottom: 0;
}

.codex-range-text {
  color: var(--dim);
}

/* Portraits.cs Gauge.BandColour */
.axis-temperature { background-color: #d02020; }
.axis-pressure { background-color: #9040c0; }
.axis-gravity { background-color: #2040d0; }
.axis-radiation { background-color: #20b020; }

/* An engine's fuel chart, as the design manager draws it, in the site's colours. */
.codex-fuel {
  margin-top: 10px;
  max-width: 560px;
}

.codex-fuel-title {
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fuel-chart {
  display: block;
  width: 100%;
}

.fuel-chart .plot {
  fill: #000;
}

.fuel-chart .danger {
  fill: var(--link);
  fill-opacity: 0.15;
}

.fuel-chart .frame {
  fill: none;
  stroke: var(--frame-bright);
}

.fuel-chart .grid {
  stroke: var(--frame);
}

.fuel-chart .full {
  stroke: var(--dim);
}

.fuel-chart text {
  font-size: 11px;
}

.fuel-chart .label {
  fill: var(--dim);
}

.fuel-chart .bad {
  fill: var(--link);
}

.fuel-chart polyline {
  fill: none;
  stroke-width: 2;
}

.fuel-chart .safe {
  stroke: #5ad48a;
}

.fuel-chart .unsafe {
  stroke: var(--link);
}

.fuel-chart .point.safe {
  fill: #5ad48a;
}

.fuel-chart .point.unsafe {
  fill: var(--link);
}

.fuel-chart .hover {
  fill: transparent;
  cursor: help;
}

.fuel-chart .hover:hover {
  stroke: var(--heading);
  stroke-width: 1;
}

/* A hull's pictures, one at a time. */
.codex-carousel img {
  display: none;
}

.codex-carousel img.active {
  display: block;
}

/* Links to the pages of a group of rows, each shown by its first row's picture. */
.codex-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 1em;
}

.codex-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  text-align: center;
  color: var(--text);
  border: 1px solid var(--frame);
  background-color: rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.codex-tile:hover,
.codex-tile:focus {
  color: var(--heading);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  text-decoration: none;
}

.codex-tile img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background-color: #000;
}

.codex-count {
  color: var(--dim);
}

/* Every centre and body type, a picture over its name and description. */
.codex-bodies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.codex-body img {
  width: 100%;
  border: 1px solid var(--frame);
}

.codex-body h3 {
  margin: 6px 0 2px;
}

.codex-body p {
  margin: 0;
  font-size: 15px;
  color: var(--dim);
}

/* Materials named in the codex, in the colours the game draws them in, as MapScreen.MaterialColour has them. */
.material-bulk_matter { color: #9c8563; }
.material-metalium { color: #3050e0; }
.material-gasternium { color: #20a020; }
.material-superheavy_elements { color: #c0a000; }
.material-noble_matter { color: #a040c0; }
.material-brane_segments { color: #e070b0; }
.material-degenerate_matter { color: #e020f0; }

/* --- Footer --- */

.footer {
  flex-shrink: 0;
  color: var(--dim);
  font-size: 16px;
  background-color: rgba(0, 0, 0, 0.55);
  border-top: 1px solid var(--frame);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  box-sizing: border-box;
  width: 1000px;
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 16px;
}

.footer-left {
  width: 380px;
  max-width: 100%;
}

.footer-right {
  width: 420px;
  max-width: 100%;
}

.footer-right .link-button-container {
  justify-content: flex-end;
}

.footer-logo {
  width: 200px;
  margin: 10px 0;
}

.contact-email {
  height: 25px;
  display: block;
}

/* The three scan kinds, in the slate theme's scanner colours, which read on the site's dark ground. */
.scanner-red { color: #e05560; font-weight: 600; }
.scanner-yellow { color: #e0c060; font-weight: 600; }
.scanner-purple { color: #b070e0; font-weight: 600; }

/* --- Press kit --- */

/* The factsheet sits beside the description, as presskit() lays it out, and above it on a phone. */
.press-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
}

@media (max-width: 760px) {
  .press-layout {
    grid-template-columns: 1fr;
  }
}

.press-factsheet h3 {
  margin: 14px 0 2px;
  font-size: 16px;
  color: var(--dim);
}

.press-factsheet p {
  margin: 0;
}

.press-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 1em;
}

.press-gallery img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: contain;
  background-color: #000;
  border: 1px solid var(--frame);
}

.press-gallery a:hover img,
.press-gallery a:focus img {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
