/* Pixel Home site: the game's own look. Paper cards, ink outlines, chunky shadows. */
:root {
  --ink: #2b2338;
  --ink-soft: #5b4f6b;
  --paper: #fff8ec;
  --paper-2: #f6ead3;
  --line: #e0caa3;
  --grass: #9fd283;
  --grass-dark: #86c271;
  --soil: #6f4535;
  --coral: #ff7a59;
  --gold: #f5c542;
  --pink: #ff6f8e;
  --yellow: #ffcf3d;
  --green: #5fc95f;
  --blue: #4f9cf0;
  --purple: #a874ee;
  --orange: #ff9442;
  --font:
    ui-rounded, 'SF Pro Rounded', 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto,
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font: 500 17px/1.55 var(--font);
  color: var(--ink);
  background: var(--grass);
  /* A light checker of meadow tiles, like the board. */
  background-image:
    linear-gradient(45deg, var(--grass-dark) 25%, transparent 25%, transparent 75%, var(--grass-dark) 75%),
    linear-gradient(45deg, var(--grass-dark) 25%, transparent 25%, transparent 75%, var(--grass-dark) 75%);
  background-size: 48px 48px;
  background-position:
    0 0,
    24px 24px;
  background-blend-mode: soft-light;
  -webkit-font-smoothing: antialiased;
  /* Long words (German compounds, URLs) break rather than push the page wider. */
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  -webkit-hyphens: auto;
  hyphens: auto;
  text-wrap: balance;
}

/* Japanese: never start a line with a long-vowel mark or small kana. Chinese
   follows the same strict rules for punctuation at the start of a line. */
:lang(ja),
:lang(zh-Hant) {
  line-break: strict;
}

/* Korean breaks lines between words, at spaces, as the game does. */
:lang(ko) {
  word-break: keep-all;
}

/* Thai has no spaces between words (the browser breaks lines by dictionary) and
   stacks vowel and tone marks above and below a letter, so its headings need
   more room between lines. */
:lang(th) :is(h1, h2, h3) {
  line-height: 1.35;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 32px, 980px);
  margin-inline: auto;
}

/* Header ------------------------------------------------------------------ */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 18px;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 3px solid var(--ink);
  image-rendering: pixelated;
}

.top nav {
  display: flex;
  gap: 8px;
}

.top nav a {
  padding: 8px 14px;
  border-radius: 999px;
  border: 3px solid var(--ink);
  background: var(--paper);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--ink);
}

.top nav a[aria-current='page'] {
  background: var(--ink);
  color: var(--paper);
}

/* Cards --------------------------------------------------------------------- */

.card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 28px;
  box-shadow: 0 6px 0 var(--ink);
  padding: clamp(22px, 4vw, 40px);
}

.card + .card,
.card + .grid,
.grid + .card,
.grid + .grid,
.shots + .card,
.card + .shots {
  margin-top: 28px;
}

/* Hero ---------------------------------------------------------------------- */

.hero {
  text-align: center;
}

.hero .icon {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  border: 3px solid var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  image-rendering: pixelated;
}

.wordmark {
  margin: 18px 0 6px;
  font-size: clamp(44px, 11vw, 88px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.35em;
}

.wordmark span span {
  -webkit-text-stroke: 0.07em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.06em 0 var(--ink);
}

.c-r {
  color: var(--pink);
}
.c-y {
  color: var(--yellow);
}
.c-g {
  color: var(--green);
}
.c-b {
  color: var(--blue);
}
.c-p {
  color: var(--purple);
}
.c-o {
  color: var(--orange);
}

.tagline {
  margin: 14px auto 0;
  max-width: 34em;
  font-size: clamp(18px, 2.6vw, 22px);
  font-weight: 700;
  color: var(--ink-soft);
}

.badge {
  display: inline-block;
  margin-top: 22px;
  padding: 12px 22px;
  border-radius: 16px;
  border: 3px solid var(--ink);
  background: var(--gold);
  font-weight: 900;
  box-shadow: 0 4px 0 var(--ink);
  text-decoration: none;
}

a.badge:active {
  transform: translateY(4px);
  box-shadow: none;
}

.play {
  margin-top: 16px;
  font-weight: 700;
}

.small {
  margin-top: 14px;
  font-size: 15px;
  color: var(--ink-soft);
}

/* Screenshots --------------------------------------------------------------- */

.shots {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 4px 14px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.shots img {
  flex: 0 0 auto;
  width: min(62vw, 230px);
  height: auto;
  border-radius: 26px;
  border: 3px solid var(--ink);
  box-shadow: 0 6px 0 var(--ink);
  scroll-snap-align: center;
  background: var(--paper-2);
}

@media (min-width: 900px) {
  .shots {
    justify-content: center;
    overflow: visible;
  }
  .shots img {
    width: 176px;
  }
}

/* App Clip ------------------------------------------------------------------ */

.clip {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 36px);
}

/* 45 modules at 4px each, so every module is a whole number of pixels. */
.clip .qr {
  flex: none;
  width: 180px;
  height: 180px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  image-rendering: pixelated;
}

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

@media (max-width: 600px) {
  .clip {
    flex-direction: column;
    text-align: center;
  }
}

/* Feature grid ---------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.grid .card {
  margin: 0;
  padding: 22px;
  border-radius: 22px;
}

h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3.6vw, 32px);
  line-height: 1.15;
  font-weight: 900;
}

h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 900;
}

.grid h3::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 3px solid var(--ink);
  border-radius: 5px;
  background: var(--dot, var(--coral));
  vertical-align: -1px;
}

/* The pips: one card each, with the game's sprite at a whole-number scale. */

.pip-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.pip-head img {
  flex: none;
  width: 52px;
  height: 68px;
  padding: 10px 14px;
  box-sizing: content-box;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: color-mix(in srgb, var(--dot) 22%, var(--paper));
  image-rendering: pixelated;
}

.pips h3::before {
  content: none;
}

.trait {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: no-preference) {
  .pip:hover .pip-head img {
    animation: hop 0.45s steps(3, end);
  }
}

@keyframes hop {
  50% {
    transform: translateY(-6px);
  }
}

p {
  margin: 0 0 12px;
}

p:last-child,
li:last-child {
  margin-bottom: 0;
}

ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

li {
  margin-bottom: 6px;
}

/* Text pages -------------------------------------------------------------------- */

.prose h1 {
  margin: 0 0 6px;
  font-size: clamp(32px, 6vw, 46px);
  line-height: 1.1;
  font-weight: 900;
}

.prose h2 {
  margin-top: 30px;
  font-size: 23px;
}

.prose .lead {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-soft);
}

.note {
  padding: 14px 18px;
  border-radius: 16px;
  border: 3px solid var(--line);
  background: var(--paper-2);
  font-weight: 700;
}

.button {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 16px;
  border: 3px solid var(--ink);
  background: var(--coral);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
}

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

footer {
  margin-top: 40px;
  padding: 26px 0 40px;
  background: var(--soil);
  color: var(--paper);
  border-top: 3px solid var(--ink);
  font-size: 15px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: space-between;
}

footer nav {
  display: flex;
  gap: 18px;
}

/* Language switcher ------------------------------------------------------------------ */

.languages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
}

.languages a[aria-current] {
  font-weight: 900;
  text-decoration: none;
}

footer .languages {
  justify-content: flex-start;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px solid rgba(255, 248, 236, 0.25);
}
