/* Lopsided Studio: one stylesheet for every page. Black, off-white and EB Garamond, nothing else. */

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #0b0b0b;
  --text: #f2efe9;
  --muted: #a9a39a;
  --line: rgb(242 239 233 / 14%);
  --line-strong: rgb(242 239 233 / 45%);
  --field: rgb(242 239 233 / 4%);
  --measure: 40rem;
  --wide: 64rem;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "EB Garamond", Garamond, "Iowan Old Style", "Palatino Linotype", Palatino, "Noto Serif", serif;
  font-size: 1.25rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 4px;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

h1,
h2 {
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0 0 1em;
}

sup {
  font-size: 0.45em;
  vertical-align: super;
  line-height: 0;
  margin-left: 0.05em;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wide) + 3rem);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -10rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 1rem;
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

/* Navigation bar */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgb(11 11 11 / 88%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  min-height: 4.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.wordmark,
.site-nav a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.wordmark {
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav ul {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--text);
}

/* Pages */

.page {
  padding-top: clamp(4rem, 14vh, 9rem);
  padding-bottom: clamp(4rem, 12vh, 8rem);
}

.page .wrap {
  text-align: center;
}

.page .wrap > * {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.home {
  display: flex;
  align-items: center;
}

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 2rem;
}

.statement {
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  line-height: 1.32;
  letter-spacing: -0.005em;
  margin-bottom: 0;
}

.rule {
  width: 3.5rem;
  height: 1px;
  background: var(--line-strong);
  border: 0;
  margin: 2.75rem auto;
}

.note {
  font-style: italic;
  color: var(--muted);
  font-size: 1.3rem;
}

.more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.2rem;
}

.more:hover {
  border-bottom-color: var(--text);
}

.page h1 {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  margin-bottom: 1.5rem;
}

.body-text p {
  color: var(--text);
}

/* Upcoming games: a picture from the game beside its name, then the story. */

.page .wrap > .game {
  max-width: 46rem;
}

.game-head {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 2.25rem;
}

.game-shot {
  margin: 0;
  border: 1px solid var(--line-strong);
  padding: 6px;
}

.game-shot img,
.photo img {
  display: block;
  width: 100%;
  height: auto;
}

/* A picture from the game on the About and Contact pages. */
.photo {
  margin: 0 auto 2.5rem;
  max-width: 46rem;
  border: 1px solid var(--line-strong);
  padding: 6px;
}

/* Apple's "Download on the App Store" badge, unchanged, on the Games and About pages; a quarter of its height clear
   around it. */
.store .badge { display: inline-block; padding: 0.9rem 0; line-height: 0; }
.store .badge img { display: block; height: 60px; width: auto; }
.store .free { display: block; color: var(--muted); font-size: 1rem; margin-top: 0.1rem; }
.game-head .store { margin: 0.4rem 0 0; }

.page .game h1 {
  margin-bottom: 0.5rem;
}

.game .when {
  font-style: italic;
  color: var(--muted);
  margin: 0;
}

.game .story {
  max-width: var(--measure);
  margin: 0 auto;
}

@media (min-width: 46rem) {
  .game-head {
    grid-template-columns: 1.15fr 1fr;
    gap: 2.5rem;
    text-align: left;
  }
}

/* Contact form */

.form {
  margin-top: 2.5rem;
}

.field {
  margin-bottom: 2rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.field .optional {
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1.2rem;
  color: var(--text);
  background: var(--field);
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 0.6rem 0.75rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  min-height: 10rem;
  resize: vertical;
  line-height: 1.5;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-bottom-color: var(--text);
  background: rgb(242 239 233 / 7%);
}

input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 100px #1a1a1a inset;
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile {
  min-height: 65px;
  margin: 0 0 2rem;
}

.button {
  display: inline-block;
  font: inherit;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--bg);
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 0;
  padding: 0.95rem 2.2rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.button:hover {
  background: transparent;
  color: var(--text);
}

.button:focus-visible {
  outline-offset: 3px;
}

.fine {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 1.5rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding-top: 1.75rem;
  padding-bottom: 2rem;
}

.site-footer p {
  margin: 0;
}

/* A slow, quiet fade on arrival, for people who haven't asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .fade {
    animation: fade 1s ease both;
  }

  .fade.d1 {
    animation-delay: 0.12s;
  }

  .fade.d2 {
    animation-delay: 0.24s;
  }

  @keyframes fade {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
  }
}

@media (max-width: 30rem) {
  body {
    font-size: 1.2rem;
  }

  .site-header .wrap {
    justify-content: center;
    text-align: center;
  }

  .site-nav ul {
    gap: 1.5rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page h1.eyebrow {
  font-size: 0.8rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

input[type="text"],
input[type="email"],
textarea {
  text-align: left;
}

.about p {
  font-size: 1.3rem;
}

/* Even line lengths in centered text, so no line ends with a lone word. */
h1,
h2,
.statement,
.note,
.when {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* The privacy policy page: long text with headings, lists and a few tables. */
.policy { max-width: var(--measure); margin: 0 auto; text-align: left; }
.policy h2, .policy h3 { text-wrap: pretty; }
.policy h2 { font-size: 1.35rem; margin: 2.2rem 0 0.6rem; }
.policy h3 { font-size: 1.1rem; margin: 1.6rem 0 0.4rem; }
.policy p, .policy li { line-height: 1.6; }
.policy ul { padding-left: 1.2rem; margin: 0.4rem 0 1rem; }
.policy ul ul { margin: 0.2rem 0 0.4rem; }
.policy .table-wrap { overflow-x: auto; margin: 0.8rem 0 1.2rem; }
.policy table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.policy table { border: 1px solid var(--line-strong); }
.policy th, .policy td { border: 1px solid var(--line-strong); padding: 0.55rem 0.7rem; text-align: left; vertical-align: top; }
.policy th { background: rgb(242 239 233 / 10%); color: var(--text); font-weight: 600; }
.policy tbody tr:nth-child(even) td { background: rgb(242 239 233 / 4%); }
.policy code { font-size: 0.9em; }
/* A link to a section lands below the sticky header (two rows on phones), not under it. */
.policy [id] { scroll-margin-top: 7rem; }
/* The policy's languages, under its title: each in its own name, the current one not a link. Spaced like the site's
   menu, so a phone wraps the row cleanly. */
.langs ul { list-style: none; margin: -1rem auto 2.5rem; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1.3rem; font-size: 1rem; color: var(--muted); }
.langs [aria-current] { color: var(--text); }
/* A translation's first line: which version applies. */
.policy .translation-note { font-size: 1rem; color: var(--muted); border-left: 2px solid var(--line-strong); padding-left: 0.9rem; margin: 0 0 1.5rem; }
/* Chinese: EB Garamond has no Chinese, so Chinese text takes a Chinese serif the device has (Mac and iPhone, Android,
   Windows), then any Chinese font; Latin letters and digits stay in EB Garamond. */
:lang(zh) { font-family: "EB Garamond", "Songti SC", STSong, "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", SimSun, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }

/* The open-source licenses page: each component on its own lines, license texts as plain paragraphs, NOTICE files
   kept exactly as written (line breaks and spacing too), in a monospace font so their boxes of "=" line up. A NOTICE
   wider than the screen scrolls sideways. */
.licenses li { margin-bottom: 0.45rem; }
.licenses ul ul { margin-top: 0.35rem; }
.licenses p.fine { margin: 0 0 0.6rem; }
.licenses .license-text { font-size: 1rem; overflow-wrap: anywhere; margin-bottom: 1.2rem; }
.licenses .license-text p { margin-bottom: 0.75em; }
.licenses pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.78rem; line-height: 1.5; white-space: pre; overflow-x: auto; margin: 0 0 1.2rem; padding: 0.7rem 0.9rem; border: 1px solid var(--line); }

/* Landing pages (/lopsided-bun/ios, /ios/meta, /ios/google): the picture, the name, then the App Store button straight away. */
.play .wrap { max-width: 46rem; }
.play h1 { margin: 0.5rem 0 0.4rem; }
.play .when { font-style: italic; color: var(--muted); margin: 0 0 1.2rem; }
.play .play-cta { margin: 0 0 2.5rem; text-align: center; }
.page.play { padding-top: 1.5rem; }
.play .play-cta .badge { display: inline-block; padding: 0.9rem; line-height: 0; } /* Apple's badge, unchanged; a quarter of its height clear around it */
.play .play-cta .badge img { display: block; height: 60px; width: auto; }
.play .play-cta .free { display: block; color: var(--muted); font-size: 1rem; margin-top: 0.1rem; }
.play .story { max-width: var(--measure); margin: 0 auto 2.5rem; }
