/*
 * The look of the game, on a page that has to be readable for twenty minutes.
 *
 * These pages are PLAIN HTML on purpose. A terms page that needs a JavaScript bundle to render is
 * a terms page a crawler, a screen reader on a bad connection, a regulator and Stripe's own
 * checkout preview may all fail to read, and Stripe requires a URL that resolves to the document
 * itself. So: no framework, no fonts to fetch, one stylesheet, and every colour taken from
 * `game/src/styles/tokens.css` so the pages belong to the same city as the game.
 *
 * The type is deliberately larger and the measure deliberately narrower than the game's UI. The
 * game is a dense instrument panel; this is prose somebody has to actually read.
 */

:root {
  --coal: #050709;
  --char: #0b0f12;
  --panel: #11171b;
  --panel-2: #161d23;
  --brass-deep: #6b4f21;
  --brass: #8a6a2c;
  --gold: #d6a84b;
  --gold-hot: #f0c968;
  --ink-hi: #eef2f4;
  --ink: #c3ccd2;
  --ink-mid: #8d9aa3;
  --ink-dim: #5f6c75;
  --line: #232e35;
  --line-soft: #1a2329;
  --line-brass: rgba(183, 138, 59, 0.38);
  --heat: #f05a32;

  --f-head: 'Oswald', 'Futura', 'Jost', system-ui, sans-serif;
  --f-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'Roboto Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* The anchor targets sit under a sticky header without this. */
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--coal);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The same harbour light the game opens on, kept faint enough to read over. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(24, 34, 42, 0.7), transparent 60%),
    linear-gradient(180deg, #05080a 0%, #070b0e 60%, #050709 100%);
}

/* ---------------------------------------------------------------- masthead */

header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 26px;
  background: linear-gradient(180deg, rgba(11, 15, 18, 0.97), rgba(5, 7, 9, 0.93));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

header.top a.wordmark {
  font-family: var(--f-head);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--ink-hi);
  text-decoration: none;
  text-transform: uppercase;
}

header.top a.wordmark:hover {
  color: var(--gold);
}

header.top nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--f-head);
}

header.top nav a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

header.top nav a:hover,
header.top nav a[aria-current='page'] {
  color: var(--gold);
  border-bottom-color: var(--line-brass);
}

/* ------------------------------------------------------------------ layout */

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 26px 120px;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}

/* The contents rail. It collapses away rather than squashing the prose. */
aside.toc {
  position: sticky;
  top: 96px;
  padding: 18px 0 0;
  font-size: 13px;
  line-height: 1.5;
  border-right: 1px solid var(--line-soft);
}

aside.toc h2 {
  font-family: var(--f-head);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 12px;
}

aside.toc ol {
  list-style: none;
  margin: 0;
  padding: 0 18px 0 0;
  counter-reset: toc;
}

aside.toc li {
  counter-increment: toc;
  margin-bottom: 7px;
}

aside.toc a {
  color: var(--ink-mid);
  text-decoration: none;
  display: block;
  padding-left: 26px;
  position: relative;
}

aside.toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--ink-dim);
}

aside.toc a:hover {
  color: var(--gold);
}

article {
  padding-top: 18px;
  max-width: 74ch;
}

/* ------------------------------------------------------------------- title */

.title-block {
  padding-bottom: 26px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--f-head);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 10px;
}

h1 {
  font-family: var(--f-head);
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-hi);
  margin: 0 0 14px;
  line-height: 1.08;
}

.dateline {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

.dateline strong {
  color: var(--ink-mid);
  font-weight: 400;
}

/* The short version, in a box, before the long version. */
.summary {
  background: linear-gradient(180deg, rgba(138, 106, 44, 0.09), rgba(138, 106, 44, 0.02));
  border: 1px solid var(--line-brass);
  border-left-width: 3px;
  padding: 20px 24px;
  margin: 0 0 44px;
}

.summary h2 {
  font-family: var(--f-head);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 12px;
}

.summary ul {
  margin: 0;
  padding-left: 20px;
}

.summary li {
  margin-bottom: 8px;
  color: var(--ink);
}

.summary li:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- sections */

section {
  margin-bottom: 46px;
  scroll-margin-top: 90px;
}

h2.rule {
  font-family: var(--f-head);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-hi);
  margin: 0 0 4px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

h2.rule .n {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--brass);
  letter-spacing: 0.06em;
  flex: none;
}

h2.rule + .lede {
  color: var(--ink-mid);
  font-size: 14.5px;
  margin: 0 0 18px;
  padding-left: 40px;
  border-left: 1px solid var(--line-soft);
}

h3 {
  font-family: var(--f-head);
  font-size: 14px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 26px 0 8px;
}

p {
  margin: 0 0 15px;
}

ul,
ol {
  padding-left: 22px;
  margin: 0 0 16px;
}

li {
  margin-bottom: 9px;
}

a {
  color: var(--gold);
  text-decoration-color: var(--line-brass);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--gold-hot);
}

strong {
  color: var(--ink-hi);
  font-weight: 600;
}

code {
  font-family: var(--f-mono);
  font-size: 0.88em;
  color: var(--ink-hi);
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  padding: 1px 5px;
}

/* A clause that matters more than the ones around it. */
.callout {
  border-left: 3px solid var(--heat);
  background: rgba(240, 90, 50, 0.05);
  padding: 14px 18px;
  margin: 0 0 18px;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ tables */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--line);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 14px;
  background: var(--panel);
}

th {
  text-align: left;
  font-family: var(--f-head);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
  padding: 11px 14px;
  background: var(--char);
  border-bottom: 1px solid var(--line);
  vertical-align: bottom;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  vertical-align: top;
}

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

td:first-child {
  color: var(--ink-hi);
  width: 27%;
}

/* ------------------------------------------------------------------ footer */

footer.bottom {
  border-top: 1px solid var(--line);
  margin-top: 70px;
  padding: 28px 26px 60px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 13px;
}

footer.bottom a {
  color: var(--ink-mid);
  margin: 0 10px;
}

footer.bottom a:hover {
  color: var(--gold);
}

footer.bottom .mark {
  font-family: var(--f-head);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--brass-deep);
  margin-top: 16px;
}

/* ------------------------------------------------------------- narrow, print */

@media (max-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 20px 80px;
  }
  aside.toc {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 20px;
    margin-bottom: 28px;
  }
  aside.toc ol {
    columns: 2;
    column-gap: 24px;
  }
  header.top {
    padding: 12px 20px;
  }
  header.top nav {
    width: 100%;
    margin-left: 0;
    gap: 16px;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  body::before,
  header.top,
  aside.toc,
  footer.bottom {
    display: none;
  }
  main {
    display: block;
    max-width: none;
    padding: 0;
  }
  a {
    color: #000;
  }
  h1,
  h2.rule,
  strong {
    color: #000;
  }
}
