/* Mahjong Moonwindow — moonwindow.thenextbeacon.com
 *
 * The game's own materials, not a website's idea of them. Every surface here
 * exists in the app: the dawn wash behind the board, the carved frame the
 * reward panels wear, the gold the tiles are edged with, and the serif the
 * game sets its titles in. A page that looked like a generic product site
 * would be telling a visitor the game is one.
 *
 * Still no JavaScript, no webfont and no build step. The type is a system
 * serif stack — the same one the game uses — so nothing is downloaded to read
 * a privacy policy on a bad connection.
 */

:root {
  /* Straight from apps/web/index.html, so the site cannot drift from the game. */
  --gold: #e8c27a;
  --gold-deep: #b8944f;
  --ink: #2c2a24;
  --ink-dim: #5d5849;
  --paper: #fbf6e9;
  --green: #2b5644;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

/* The page scrolled 40px sideways at 900px wide: a fixed backdrop under a
   full-width wrap. Nothing anyone sees moves; the stray axis goes. */
html { overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  /*
   * The dawn backdrop, washed pale so type sits on it — the same trick the
   * game plays behind its board. Fixed, so scrolling feels like moving down a
   * painting rather than past a header image.
   */
  background:
    linear-gradient(rgba(251, 246, 233, 0.86), rgba(251, 246, 233, 0.94)),
    url("/assets/1-dawn.webp") center / cover fixed no-repeat,
    var(--paper);
}

.wrap { width: min(760px, 100% - 40px); margin: 0 auto; }

/* ------------------------------------------------------------------ chrome */

header.site {
  border-bottom: 1px solid rgba(184, 148, 79, 0.34);
  background: rgba(251, 246, 233, 0.72);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0; flex-wrap: wrap;
}
/*
 * The game's own wordmark, not its name set in type. It is the mark on the
 * title screen, so a visitor arriving from the store sees the same object.
 */
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; height: 38px; width: auto; }
nav.site a {
  color: var(--ink-dim); text-decoration: none; margin-left: 18px; font-size: 15px;
}
nav.site a:hover, nav.site a[aria-current] { color: var(--green); text-decoration: underline; }

footer.site {
  margin-top: 56px; padding: 22px 0 40px;
  border-top: 1px solid rgba(184, 148, 79, 0.34);
  color: var(--ink-dim); font-size: 14px;
}
footer.site a { color: var(--ink-dim); }

/* ------------------------------------------------------------------- sheets
 *
 * THE CARVED FRAME, nine-sliced exactly as the game does it — slice 32 at
 * 14px, which is the border measured off the art rather than a number chosen
 * to look right. Nothing painted behind it: the art has its own stone face,
 * and a colour underneath would show through its corners as a ring.
 */
main section {
  margin: 26px 0;
  padding: 26px 30px;
  border: 0;
  border-image: url("/assets/frame.webp") 32 fill / 14px / 0 stretch;
}

h1 {
  font-size: clamp(30px, 6vw, 42px);
  line-height: 1.15; margin: 0 0 6px;
  color: var(--green); letter-spacing: 0.4px;
}
h2 {
  font-size: 23px; margin: 0 0 10px;
  color: var(--green);
}
h3 {
  font-size: 17px; margin: 22px 0 4px; color: var(--ink);
}
p { margin: 0 0 14px; }
p:last-child, ul:last-child, table:last-child { margin-bottom: 0; }
.lede { font-size: 20px; color: var(--ink-dim); }
.updated { font-size: 14px; color: var(--ink-dim); margin-bottom: 18px; }
a { color: var(--green); }
ul { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 6px; }

/* ---------------------------------------------------------------- the hero */

.hero { text-align: center; }
.hero img.wordmark {
  display: block; width: min(420px, 100%); height: auto; margin: 4px auto 10px;
}
.hero .lede { max-width: 46ch; margin-inline: auto; }

/* Screenshots, side by side where there is room. Framed the way a tile is:
   a gold hairline and a soft seat, rather than floating on the page. */
.shots {
  display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
  margin-top: 6px;
}
.shots img {
  width: min(280px, 44%); height: auto; border-radius: 14px;
  border: 1px solid rgba(184, 148, 79, 0.55);
  box-shadow: 0 6px 18px rgba(44, 42, 36, 0.22);
}

/* ---------------------------------------------------------------- the table
 *
 * The privacy page is mostly this, and it is the page most likely to be read
 * on a phone. Field names in the game's gold, so the eye can run down them.
 */
table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 15.5px; }
th {
  text-align: left; padding: 8px 10px 8px 0; color: var(--green);
  border-bottom: 1px solid rgba(184, 148, 79, 0.5); font-size: 14px;
  text-transform: uppercase; letter-spacing: 1.1px;
}
td { padding: 9px 10px 9px 0; border-bottom: 1px solid rgba(184, 148, 79, 0.22); vertical-align: top; }
/*
 * The field column gets a floor. Without one it squeezed to ~110px on a phone
 * and drove rows 300px tall -- a screen and a half of scrolling per field.
 */
td:first-child { width: 34%; min-width: 132px; }
/*
 * Field names, and they must be READ. Gold on the ivory panel was the
 * lowest-contrast text on the page, which is a poor place to save a colour:
 * this page exists to be checked against the game.
 */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em; color: var(--ink); background: rgba(43, 86, 68, 0.09);
  padding: 1px 5px; border-radius: 4px;
  border: 1px solid rgba(43, 86, 68, 0.14);
}

@media (max-width: 560px) {
  main section { padding: 20px 18px; }
  td:first-child { width: 38%; min-width: 118px; }
  .brand img { height: 30px; }
  .shots img { width: min(280px, 100%); }
}
