/* Plain reading pages (privacy, support): the same two glazes as the donut
   page, with a theme chosen there carried over. */
@font-face {
  font-family: "NanumSquareRound";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_two@1.0/NanumSquareRound.woff")
    format("woff");
  font-weight: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page-bg: #d4eafb;
  --sheet-bg: #ffffff;
  --ink: #4a2817;
  --muted: #8a6858;
  --line: #e2edf7;
  --light-only: block;
  --dark-only: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page-bg: #4a2817;
    --sheet-bg: #63392a;
    --ink: #d4eafb;
    --muted: #a9c3d8;
    --line: #4f2b1b;
    --light-only: none;
    --dark-only: block;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #4a2817;
  --sheet-bg: #63392a;
  --ink: #d4eafb;
  --muted: #a9c3d8;
  --line: #4f2b1b;
  --light-only: none;
  --dark-only: block;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 32px max(16px, env(safe-area-inset-right, 0px)) 48px
    max(16px, env(safe-area-inset-left, 0px));
  background: var(--page-bg);
  color: var(--ink);
  font-family:
    "NanumSquareRound",
    Pretendard,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 17px;
  line-height: 1.65;
  /* A long address or email breaks rather than running off the page. */
  overflow-wrap: anywhere;
}

/* Korean wraps between words, not in the middle of one. */
:lang(ko) {
  word-break: keep-all;
}

/* One column that never grows past the page, however wide its content. */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  max-width: 680px;
  margin: 0 auto;
  padding: 40px clamp(24px, 6vw, 48px);
  border-radius: 28px;
  background: var(--sheet-bg);
}

.home {
  justify-self: start;
  border-radius: 10px;
}

.home img {
  display: block;
  width: 150px;
  height: auto;
}

.home .light {
  display: var(--light-only);
}

.home .dark {
  display: var(--dark-only);
}

/* A page in two languages: links to each, and each in its own block. */
.lang-nav {
  display: flex;
  gap: 16px;
  font-size: 14px;
}

article {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}

article + article {
  padding-top: 28px;
  border-top: 2px solid var(--line);
}

/* Press kit: facts as label and value rows, and files as tiles to grab. */
.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 20px;
  margin: 0 0 16px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

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

.game-head img {
  flex: none;
  width: 96px;
  height: 96px;
  border-radius: 22%;
}

.assets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.asset {
  display: grid;
  gap: 8px;
  font-size: 15px;
}

.asset-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 128px;
  padding: 18px;
  border-radius: 16px;
  background: #d4eafb;
}

.asset-preview--dark {
  background: #4a2817;
}

/* An icon is its own tile: it stands on the page as it is, no box around it. */
.asset-preview--icon {
  padding: 0;
  background: none;
}

/* A real size, not only a limit: Safari sometimes ignores max sizes on an
   SVG, which has no size of its own, and draws it as wide as the screen. */
.asset-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-preview--icon img {
  width: auto;
  aspect-ratio: 1;
  border-radius: 22%;
}

.asset-links {
  display: flex;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 5vw, 34px);
  font-weight: normal;
  line-height: 1.25;
  text-wrap: balance;
}

h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

section p,
section ul {
  margin: 0 0 12px;
  max-width: 62ch;
}

section ul {
  padding-left: 1.2em;
}

.updated {
  margin: -16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

a {
  color: var(--ink);
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

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

footer p {
  margin: 0;
}

/* On a phone: slightly smaller text, and each fact's label above its value. */
@media (max-width: 520px) {
  body {
    font-size: 16px;
  }

  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .facts dd + dt {
    margin-top: 10px;
  }
}
