/*
 * The marketing site's stylesheet. Four pages share it: the landing page, the
 * privacy policy, the terms and the press kit.
 *
 * Every colour below is copied from `src/content/palette.ts` and the names match
 * that file exactly, so a change there can be reproduced here by search. It is a
 * copy rather than an import because these are static files served by the asset
 * router with no build step in front of them, and adding a build step to four
 * HTML pages to avoid nine duplicated hex values would be the more expensive
 * mistake. The names are the contract; if `--void-900` ever stops matching
 * `VOID.v900`, the site stops looking like the product, which is the entire
 * reason the palette is shared at all.
 *
 * Dark only, exactly like the app. There is no light mode anywhere in this
 * product and a marketing site that had one would be advertising a different
 * game: the whole art direction is emissive light on near-black, and glow has
 * nothing to bleed into on a white page.
 */

:root {
  /* The neutral ramp. Era-invariant, frozen for the life of the product. */
  --void-900: #07090c;
  --void-800: #0c1014;
  --void-700: #131820;
  --void-600: #1b222c;
  --void-500: #27303c;
  --void-400: #3a4552;
  --void-300: #5a6675;
  --void-200: #8a97a6;
  --void-100: #c3ccd6;
  --void-000: #eaf0f6;

  /* Signal colours. `phosphor-core` is a bloom source and is never text. */
  --phosphor-core: #6bff9e;
  --phosphor: #22e06a;
  --phosphor-dim: #148a45;
  --amber: #ffb020;
  --amber-deep: #c97400;
  --crimson: #ff4a3d;
  --cyan: #35d6ff;
  --violet: #a77bff;
  --bone: #f2e6cf;

  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Rounded', 'Segoe UI', system-ui, sans-serif;

  --page: 68rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  /* The anchor links in the long legal pages land under the sticky header
     without it, which reads as the link having failed. */
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--void-900);
  color: var(--void-100);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  /* Nothing on this site is wide enough to need it, so a horizontal scrollbar
     can only ever mean something has overflowed. */
  overflow-x: hidden;
}

/* ---------------------------------------------------------------------------
   The room. One fixed gradient plus one scanline layer, both non-interactive.
   --------------------------------------------------------------------------- */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(34, 224, 106, 0.09), transparent 60%),
    radial-gradient(90% 60% at 50% 110%, rgba(255, 176, 32, 0.05), transparent 60%);
}

/*
 * Aperture grille. 3px is the smallest period that survives a 1x display
 * without turning into a moire field, and 0.35 opacity on a 2% white is far
 * enough below the text contrast floor that it costs nothing readable.
 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0 1px,
    transparent 1px 3px
  );
}

main,
header,
footer {
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------------------------
   Type
   --------------------------------------------------------------------------- */

h1,
h2,
h3 {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--void-000);
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4.25rem);
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  margin-top: 2.5em;
}

h3 {
  font-size: 1.15rem;
  margin-top: 2em;
  color: var(--void-000);
}

p {
  margin: 0 0 1.1em;
  max-width: 62ch;
}

a {
  color: var(--phosphor);
  text-decoration-color: var(--phosphor-dim);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--phosphor-core);
}

/* `void-400` is 2.04:1 and is non-text only, so a focus ring is exactly the
   kind of thing it is for. */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--phosphor);
  outline-offset: 3px;
  border-radius: 2px;
}

strong {
  color: var(--void-000);
  font-weight: 700;
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--bone);
}

/* `void-300` is 3.41:1 and legal only at 17pt and above, which is why the
   small print is 1.0625rem and not smaller. */
.fine {
  color: var(--void-300);
  font-size: 1.0625rem;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--phosphor);
  margin: 0 0 1rem;
}

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

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(7, 9, 12, 0.82);
  border-bottom: 1px solid var(--void-500);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  color: var(--void-000);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark::before {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.6rem;
  border-radius: 1px;
  background: var(--phosphor);
  box-shadow: 0 0 10px var(--phosphor-core);
  vertical-align: middle;
}

.site-nav {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.75rem);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
}

.site-nav a {
  color: var(--void-200);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--phosphor);
}

section {
  padding-block: clamp(3rem, 8vw, 5.5rem);
}

.rule {
  border: 0;
  border-top: 1px solid var(--void-500);
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95rem 1.5rem;
  border-radius: 3px;
  border: 1px solid var(--void-500);
  color: var(--void-000);
  background: var(--void-700);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--void-600);
  color: var(--void-000);
}

.btn--go {
  background: var(--phosphor);
  /* White on phosphor fails; `void-900` on it is the legal pairing, recorded in
     ON_SIGNAL for exactly this reason. */
  color: var(--void-900);
  border-color: var(--phosphor);
  box-shadow: 0 0 28px rgba(34, 224, 106, 0.35);
}

.btn--go:hover {
  background: var(--phosphor-core);
  color: var(--void-900);
  box-shadow: 0 0 40px rgba(107, 255, 158, 0.45);
}

/* ---------------------------------------------------------------------------
   Cards, tables and the terminal block
   --------------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 2rem;
}

.card {
  background: var(--void-700);
  border: 1px solid var(--void-500);
  border-radius: 4px;
  padding: 1.4rem 1.4rem 1.5rem;
}

.card h3 {
  margin-top: 0;
  font-size: 1rem;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card p {
  margin-bottom: 0;
  color: var(--void-200);
  font-size: 0.975rem;
}

/* Wide content scrolls inside its own box. The page body never scrolls
   sideways, on any width. */
.scroller {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--void-500);
  border-radius: 4px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--void-600);
  vertical-align: top;
}

th {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--void-300);
  background: var(--void-800);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td strong {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/*
 * The amber terminal. Same surface the era transitions and the logbook use in
 * the game, which is why it is amber on `void-900` and never phosphor: in this
 * product green is money and amber is the machine talking.
 */
.terminal {
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--amber);
  background: var(--void-900);
  border: 1px solid var(--amber-deep);
  border-radius: 4px;
  padding: 1.6rem;
  margin: 2rem 0;
  white-space: pre-wrap;
  overflow-x: auto;
  box-shadow: inset 0 0 60px rgba(255, 176, 32, 0.06);
}

ul.plain {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0;
}

ul.plain li {
  padding: 0.55rem 0 0.55rem 1.6rem;
  border-bottom: 1px solid var(--void-600);
  position: relative;
  max-width: 62ch;
}

ul.plain li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.35em;
  width: 0.45rem;
  height: 1px;
  background: var(--phosphor-dim);
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--void-500);
  padding-block: 2.5rem 3.5rem;
  color: var(--void-300);
  font-size: 0.9rem;
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
}

.site-foot a {
  color: var(--void-200);
  text-decoration: none;
}

.site-foot a:hover {
  color: var(--phosphor);
}

/* ---------------------------------------------------------------------------
   Motion
   --------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
