/* Great Games: one stylesheet for all pages. Tokens and rules: DESIGN.md. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-full-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --surface: #fcfbf8;
  --ink: #2a2926;
  --muted: rgb(42 41 38 / 0.62);
  --rule: rgb(42 41 38 / 0.14);
  --accent: #d24d2c;
  --frame: clamp(1.5rem, 5vw, 4.5rem);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --text-ui: 0.8125rem;
  --text-small: 0.75rem;
  --text-body: 0.9375rem;
  --radius: 14px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1a1917;
  --surface: #211f1d;
  --ink: rgb(255 255 255 / 0.92);
  --muted: rgb(255 255 255 / 0.58);
  --rule: rgb(255 255 255 / 0.15);
  --accent: #ff7a59;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #1a1917;
    --surface: #211f1d;
    --ink: rgb(255 255 255 / 0.92);
    --muted: rgb(255 255 255 / 0.58);
    --rule: rgb(255 255 255 / 0.15);
    --accent: #ff7a59;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 8vh, 5rem);
  padding: var(--frame);
  padding-left: max(var(--frame), env(safe-area-inset-left));
  padding-right: max(var(--frame), env(safe-area-inset-right));
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--text-body);
  line-height: 1.6;
  transition:
    background-color 400ms ease,
    color 400ms ease;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 150ms ease;
}
a:hover {
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Frame: sign top left, language top right; credit bottom left, contact and legal bottom right. */
.top,
.bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  font-size: var(--text-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.top {
  align-items: center;
}
.top a,
.bottom a {
  text-decoration: none;
}
.top a:hover,
.bottom a:hover,
.bottom button:hover {
  opacity: 0.65;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.emblem {
  fill: currentColor;
  flex: none;
}
.emblem .piece {
  fill: var(--accent);
}
.languages {
  display: flex;
  gap: 1rem;
}
.languages [aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}
.bottom {
  color: var(--muted);
}
.bottom p {
  margin: 0;
}
.bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.bottom-links a:first-child {
  text-transform: none;
  letter-spacing: 0;
}
.theme {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

/* Lead sentence */
.intro {
  max-width: 40rem;
  margin-bottom: clamp(2rem, 6vh, 3.5rem);
}
.intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 380;
  font-variation-settings:
    "SOFT" 100,
    "WONK" 0;
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 16ch;
}
.intro p {
  margin: 1rem 0 0;
  color: var(--muted);
}
.intro h1 + p + h1 {
  margin-top: 2.5rem;
}

/* Game tiles */
.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr));
  gap: 1rem;
  max-width: 64rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Two columns on a phone; from tablets on wide enough for a two-word name on one line. */
@media (min-width: 40rem) {
  .games {
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  }
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  padding: 1.25rem 1.25rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition:
    border-color 150ms ease,
    background-color 400ms ease;
}
.tile:hover {
  border-color: var(--ink);
}
.tile-icon {
  display: block;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1.5rem;
  border-radius: 1rem;
  background: var(--rule);
  overflow: hidden;
  transition: transform 150ms ease;
}
.tile:hover .tile-icon {
  transform: translateY(-2px);
}
.tile-icon img {
  display: block;
  width: 100%;
  height: 100%;
}
.tile-name {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 480;
  font-variation-settings: "SOFT" 100;
  line-height: 1.2;
}
.tile-meta {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: var(--text-small);
}
.soon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 11rem;
  padding: 1.25rem;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--text-small);
  text-align: center;
}

/* Legal page: a centred reading column */
.legal {
  max-width: 47.5rem;
}
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 3rem;
  font-size: var(--text-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.legal-nav a {
  text-decoration: none;
}
.legal section + section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--rule);
}
.legal h1 {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 380;
  font-variation-settings: "SOFT" 100;
  line-height: 1.15;
}
.legal h2 {
  margin: 2.25rem 0 0.5rem;
  font-size: var(--text-ui);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.legal p,
.legal li {
  max-width: 68ch;
}
.legal ul {
  padding-left: 1.25rem;
}
.legal .card {
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.legal .lead {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 380;
  font-variation-settings: "SOFT" 100;
  line-height: 1.5;
}
.legal .date {
  color: var(--muted);
  font-size: var(--text-small);
}

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