/* Paper Mahjong site - palette and type taken from the app's own theme.ts so
   the page and the game read as one thing. */

:root {
  --paper: #e7e9dc;
  --paper-hi: #fffef9;
  --ink: #1f2a24;
  --ink-soft: #4a5a50;
  --table: #467f63;
  --green: #2f6b4f;
  --red: #ae2b20;
  --gold: #c9a13b;
  --rule: #c9cdbc;
  --serif: Lora, "Iowan Old Style", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  /* faint paper grain, drawn rather than fetched - no image request */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.012) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(0, 0, 0, 0.012) 0 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px;
}

.wrap {
  max-width: 40rem;   /* ~65 characters of body text */
  margin: 0 auto;
  padding: 2.5rem 1.4rem 4rem;
}

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

header.top {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.1rem;
  margin-bottom: 2.2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* the two-tile mark, drawn in CSS */
.mark {
  width: 22px;
  height: 26px;
  border-radius: 3px;
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  box-shadow: 3px 3px 0 var(--table);
  display: inline-block;
  flex: none;
}

nav.top a {
  color: var(--ink-soft);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 1.1rem;
}
nav.top a:first-child { margin-left: 0; }
nav.top a:hover,
nav.top a[aria-current="page"] { color: var(--green); }

/* ---- type -------------------------------------------------------------- */

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.4rem;
  text-wrap: balance;
}

h2 {
  font-size: 1.15rem;
  margin: 2.2rem 0 0.5rem;
  text-wrap: balance;
}

.updated {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 2rem;
}

p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.2rem; }
li { margin-bottom: 0.4rem; }

a { color: var(--green); }
a:hover { color: var(--red); }

strong { font-weight: 700; }

/* ---- landing ----------------------------------------------------------- */

.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

.card {
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.2rem 1.3rem;
  margin: 1.6rem 0;
}
.card h2 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.facts {
  list-style: none;
  padding: 0;
  margin: 1.6rem 0;
}
.facts li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--sans);
  font-size: 0.92rem;
}
.facts li:last-child { border-bottom: 0; }
.facts .k { color: var(--ink-soft); }
.facts .v { font-variant-numeric: tabular-nums; text-align: right; }

/* ---- foot -------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding-top: 1.1rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-soft);
}
footer a { margin-right: 1rem; }

/* wide content must never push the page sideways */
table, pre { display: block; overflow-x: auto; max-width: 100%; }
img { max-width: 100%; height: auto; }

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a201c;
    --paper-hi: #222a25;
    --ink: #e4e8dd;
    --ink-soft: #a3b0a6;
    --rule: #37423a;
    --green: #7fc09b;
    --red: #e0796d;
  }
  body { background-image: none; }
  .mark { box-shadow: 3px 3px 0 var(--table); }
}
