/*
 * The site's stylesheet, written by hand to look like the game's console: amber phosphor on near-black,
 * scanlines, a vignette and a faint glow. The colours and the effects follow Valmorde/Terminal.swift and
 * Valmorde/CRT.metal; change them there first. The pages carry no script and no inline style.
 */

@font-face {
  font-family: "PxPlus IBM VGA";
  src: url(/fonts/PxPlus_IBM_VGA_8x16.ttf) format("truetype");
  font-display: swap;
}

:root {
  --ground: #0A0801;
  --amber: #FFB000;
  --dim: rgb(255 176 0 / 45%);
  --glow: rgb(255 176 0 / 35%);
  --fringe-red: rgb(255 40 0 / 55%);
  --fringe-blue: rgb(0 120 255 / 55%);
  --font: "PxPlus IBM VGA", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ground);
}

body {
  margin: 0;
  padding: 16px;
  background: var(--ground);
  color: var(--amber);
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  font-synthesis: none;
  text-shadow: 0 0 4px var(--glow);
  overflow-wrap: anywhere;
}

/* The CRT: both overlays sit above the page, never take a click, and leave the badge alone. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

body::before {
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / 22%) 2px 4px);
}

body::after {
  background: radial-gradient(ellipse at center, transparent 55%, rgb(0 0 0 / 55%) 100%);
}

header,
main,
footer {
  max-width: 80ch;
  margin: 0 auto;
}

header {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--dim);
}

main {
  padding: 24px 0;
}

footer {
  padding-top: 8px;
  border-top: 1px solid var(--dim);
}

h1,
h2,
h3 {
  margin: 24px 0 8px;
  font-weight: normal;
  line-height: 32px;
}

h1 {
  margin-top: 0;
  font-size: 32px;
  line-height: 48px;
}

h2 {
  font-size: 16px;
  text-transform: uppercase;
}

h3 {
  font-size: 16px;
}

h1,
h2,
h3,
.gate {
  text-shadow: 0 0 6px var(--glow), -0.75px 0 var(--fringe-red), 0.75px 0 var(--fringe-blue);
}

p,
ul {
  margin: 0 0 16px;
}

ul {
  padding-left: 24px;
}

strong {
  font-weight: normal;
  text-transform: uppercase;
}

a {
  color: var(--amber);
  text-decoration: underline;
}

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

img,
pre {
  border: 1px solid var(--dim);
  outline: 1px solid var(--dim);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 8px 0 16px;
}

pre {
  margin: 0 0 16px;
  padding: 8px;
  font: inherit;
  white-space: pre-wrap;
}

.tagline {
  text-transform: uppercase;
}

/* The gate: 38 columns of the 8 x 16 font, so 16 px is 304 px wide and fits a 375 px phone;
 * on wider screens it doubles, never to a size that scrolls. */
.gate {
  max-width: 100%;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  outline: 0;
  font-size: 16px;
  line-height: 16px;
  white-space: pre;
  overflow: hidden;
}

@media (min-width: 704px) {
  .gate {
    font-size: 32px;
    line-height: 32px;
  }
}

/* The gate's two tones. The dim one is for decoration, never for text a reader must read. */
.bright {
  color: var(--amber);
}

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

nav a + a {
  margin-left: 16px;
}

footer p {
  margin: 8px 0 0;
}

/* The badge is Apple's artwork: above the overlays, with no glow, outline or filter. */
.badge {
  position: relative;
  z-index: 20;
  text-shadow: none;
}

.badge img {
  display: inline-block;
  height: 40px;
  width: auto;
  margin: 0;
  border: 0;
  outline: 0;
  filter: none;
}

@media (prefers-contrast: more) {
  body {
    text-shadow: none;
  }

  body::before,
  body::after {
    display: none;
  }

  h1,
  h2,
  h3,
  .gate {
    text-shadow: none;
  }

  .dim {
    color: var(--amber);
  }
}

@media (forced-colors: active) {
  body {
    text-shadow: none;
  }

  body::before,
  body::after {
    display: none;
  }

  h1,
  h2,
  h3,
  .gate {
    text-shadow: none;
  }

  .dim,
  .bright {
    color: inherit;
  }
}
