/* Mod library, game pages and licence. Built on site.css, so they share the
   homepage's column, type, buttons, nav and footer. The games' own screenshots
   carry the colour; everything around them stays on quiet charcoal surfaces.
   Separation comes from space, with hairlines only between rows of data. */

.catalog, .legal { padding-bottom: 1rem; }

.catalog p, .legal p { max-width: 68ch; }
.catalog p + p, .legal p + p { margin-top: 1rem; }
.catalog [id], .legal [id] { scroll-margin-top: 1.5rem; }

.catalog code, .legal code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--field);
  font-family: var(--mono);
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
.catalog kbd {
  padding: 0.1em 0.4em;
  border-radius: 4px;
  background: var(--field);
  box-shadow: inset 0 -1px 0 rgb(255 255 255 / 0.08);
  font-family: var(--mono);
  font-size: 0.85em;
  white-space: nowrap;
}
.catalog pre {
  max-width: 100%;
  overflow-x: auto;
  margin-block: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 0.875rem;
  line-height: 1.55;
}
.catalog pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; }

.catalog__breadcrumbs { padding-top: clamp(1.5rem, 3vw, 2.25rem); color: var(--muted); font-size: 0.875rem; }
.catalog__breadcrumbs ol { display: flex; flex-wrap: wrap; }
.catalog__breadcrumbs li + li::before { content: "/"; padding-inline: 0.55rem; color: var(--dim); }
.catalog__breadcrumbs a { color: var(--muted); text-decoration: none; }
.catalog__breadcrumbs a:hover { color: var(--text); }
.catalog__breadcrumbs [aria-current] { color: var(--text); }

.catalog__links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }

/* A static stand-in for the homepage mascot: same drawing, cut edge on a floor. */
.page-host { width: clamp(6.5rem, 12vw, 10rem); margin-right: clamp(0rem, 4vw, 3rem); align-self: end; pointer-events: none; user-select: none; }

/* Library: a shelf of games, each led by its own screenshot. */

.library__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.5rem;
  padding-top: clamp(2rem, 5vw, 3.5rem);
}
.library__head > div { display: grid; justify-items: start; gap: 1.25rem; padding-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.library__lede { color: var(--muted); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.5; max-width: 44ch; }

.library {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(3rem, 5vw, 4.5rem) clamp(1.5rem, 3.5vw, 3rem);
  padding-top: clamp(1rem, 2vw, 1.5rem);
}
.title { display: grid; align-content: start; gap: 0.6rem; }
.title__shot {
  display: block;
  aspect-ratio: 2 / 1;
  margin-bottom: 0.65rem;
  overflow: hidden;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, 0 100%);
  padding: 1px;
  transition: box-shadow 200ms var(--ease);
}
.title__shot:hover { box-shadow: inset 0 0 0 2px var(--vermilion); }
.title__shot img { width: 100%; height: 100%; object-fit: cover; object-position: 50% var(--y, 60%); }
.title h2::after { display: none; }
.title h2 { font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem); line-height: 1.2; }
.title h2 a { text-decoration: none; }
.title h2 a:hover, .title:has(.title__shot:hover) h2 a { color: var(--mark); }
.title__meta { font-size: 0.9375rem; font-weight: 500; }
.title p + p { margin-top: 0; }
.title > p:not(.title__meta):not(.fine) { color: var(--muted); }
.title__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-top: 0.4rem; }
.title__actions a:not(.btn) { font-size: 0.9375rem; }

.library__note {
  display: grid;
  grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
  gap: 1rem clamp(2rem, 5vw, 4rem);
  padding-top: var(--section);
}
.library__note p { color: var(--muted); }

/* Game page: title and download first, then the game, then the details. */

.game__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem);
  grid-template-areas: "title get" "shot get";
  align-items: start;
  gap: 2rem clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
}
.game__title { grid-area: title; display: grid; gap: 1rem; }
.game__lede { color: var(--muted); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.5; max-width: 52ch; }
.game__shot { grid-area: shot; }
/* --chrome trims the Windows title bar; the link opens the full frame. */
.game__shot .shot img { margin-top: calc(-1 * var(--chrome, 0%)); }
.game__shot figcaption { max-width: 80ch; }

.get {
  grid-area: get;
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  background: radial-gradient(120% 90% at 100% 0, rgb(232 176 78 / 0.1), transparent 60%), var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.get h2 { font-size: 1.25rem; line-height: 1.25; }
.get dl { display: grid; gap: 0.75rem; }
.get dl > div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 0.75rem; }
.get dt { color: var(--muted); font-size: 0.875rem; }
.get dd { font-size: 0.9375rem; overflow-wrap: anywhere; }
.get .btn { width: 100%; white-space: normal; text-align: center; line-height: 1.25; }
.get .fine { font-size: 0.875rem; }

.game__body {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  padding-top: var(--section);
}
.game__nav { position: sticky; top: 1.5rem; align-self: start; }
.game__nav ul { display: grid; gap: 0.15rem; }
.game__nav a {
  display: block;
  padding: 0.35rem 0;
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
}
.game__nav a:hover { color: var(--text); }
.game__sections { min-width: 0; max-width: 54rem; }
.game__sections > section + section { padding-top: clamp(3.5rem, 6vw, 5rem); }
.game__sections h2 { margin-bottom: 1.5rem; }
.game__sections section > h3 { margin: 2.25rem 0 0.6rem; }
.game__sections h3 { color: var(--text); font-size: 1rem; }
.game__sections h3 .fine { font-weight: 400; }
.game__sections .fine { max-width: 68ch; }
.game__sections section > p:not(.fine) { color: #d9cfbe; }

.features { display: grid; gap: 1.5rem; margin-bottom: 1.5rem; }
.features > article { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 0.35rem 2rem; }
.features p { color: var(--muted); }

.catalog__proof { margin-block: 2rem; }

.catalog__table-wrap { overflow-x: auto; margin-top: 1.5rem; border-radius: var(--radius); }
.catalog table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; text-align: left; }
.catalog th {
  padding: 0.6rem 0.8rem;
  background: var(--raised);
  color: var(--muted);
  font-weight: 500;
}
.catalog th:first-child { border-radius: 3px 0 0 3px; }
.catalog th:last-child { border-radius: 0 3px 3px 0; }
.catalog td { padding: 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.catalog td:first-child { color: var(--text); font-weight: 500; }

.catalog__steps { display: grid; gap: 1.25rem; margin-bottom: 1.5rem; counter-reset: step; max-width: 68ch; }
/* Steps hold inline prose, so the number is positioned rather than gridded. */
.catalog__steps li {
  position: relative;
  padding-left: 2rem;
  counter-increment: step;
  color: var(--muted);
}
.catalog__steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  color: var(--mark);
  font-variant-numeric: tabular-nums;
}
.catalog__steps strong { color: var(--text); font-weight: 600; }

/* Questions and limits: plain disclosure rows with a hairline between them. */
.catalog details { border-top: 1px solid var(--line); }
.catalog details:last-of-type { border-bottom: 1px solid var(--line); }
.catalog summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.catalog summary::-webkit-details-marker { display: none; }
/* The toggle is drawn: two 1.5px strokes for closed, one for open. */
.catalog summary::after {
  content: "";
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.45em;
  color: var(--muted);
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
}
.catalog details[open] > summary::after { background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat; }
.catalog summary:hover::after { color: var(--mark); }
.catalog details > :not(summary) { max-width: 68ch; color: var(--muted); }
.catalog details > p { margin: 0 0 1.25rem; }
.catalog details + p { margin-top: 1.5rem; }

/* The closing purchase panel matches the homepage's price panel. */
.catalog__cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem 3rem;
  margin-top: var(--section);
  padding: clamp(2rem, 4vw, 3rem);
  background: radial-gradient(120% 140% at 100% 0, rgb(232 176 78 / 0.13), transparent 55%), var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}
.catalog__cta h2 { margin-bottom: 0.75rem; }
.catalog__cta p { color: var(--muted); }
.catalog__cta .fine { grid-column: 1 / -1; max-width: none; }

/* Licence */

.legal__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.5rem;
  padding-top: clamp(2rem, 5vw, 3.5rem);
}
.legal__header > div { display: grid; gap: 1rem; padding-bottom: clamp(2rem, 4vw, 3rem); }
.legal__date { color: var(--muted); font-size: 0.9375rem; }
.legal__nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.legal__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.75rem;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}
.legal__nav a:hover { background: var(--hover); color: var(--text); }
.legal__sections { display: grid; gap: clamp(2.5rem, 5vw, 3.5rem); max-width: 50rem; padding-top: clamp(1.5rem, 3vw, 2.5rem); }
.legal__sections h2 { margin-bottom: 1rem; font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem); }
.legal__sections p { color: #d9cfbe; }
.legal__requirements { padding: clamp(1.5rem, 3vw, 2rem); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-strong); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }
.legal__requirements dl { display: grid; gap: 0.85rem; margin-bottom: 1.25rem; }
.legal__requirements dl > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; }
.legal__requirements dt { color: var(--muted); }
.legal__requirements p { color: var(--muted); font-size: 0.9375rem; }

@media (max-width: 1000px) {
  .game__head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "shot" "get"; }
  .get { max-width: 34rem; }
  .game__body { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .game__nav { position: static; }
  .game__nav ul { display: flex; flex-wrap: wrap; gap: 0.4rem; }
  .game__nav a { padding: 0 0.75rem; min-height: 2rem; display: inline-flex; align-items: center; border-radius: 3px; background: var(--field); font-size: 0.875rem; }
  .game__nav a:hover { background: var(--hover); }
}

@media (max-width: 760px) {
  .library { grid-template-columns: minmax(0, 1fr); }
  .library__note { grid-template-columns: minmax(0, 1fr); }
  .features > article { grid-template-columns: minmax(0, 1fr); }
  .catalog__cta { grid-template-columns: minmax(0, 1fr); }
  .catalog table { min-width: 34rem; }
  .catalog__links > .btn { max-width: 100%; white-space: normal; line-height: 1.25; text-align: center; }
  .legal__requirements dl > div { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
}

@media (max-width: 520px) {
  /* The heading spans the row; the mascot stands beside the lede and action. */
  .library__head, .legal__header { gap: 1rem 0.75rem; }
  .library__head > div, .legal__header > div { display: contents; }
  .library__head h1, .legal__header h1 { grid-column: 1 / -1; }
  .library__lede { grid-column: 1; }
  .library__head .btn { grid-column: 1; justify-self: start; margin-bottom: 2rem; }
  .legal__header > div > :not(h1) { grid-column: 1; }
  .legal__nav { margin-bottom: 2rem; }
  .page-host { grid-column: 2; grid-row: 2 / span 2; width: 5.5rem; margin-right: 0; }
  .get { padding: 1.15rem; }
  .get dl > div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
}

/* Page titles stay upright; the mascot keeps his rim light. */
.catalog h1, .legal h1 { font-weight: 700; letter-spacing: -0.015em; }
.page-host { filter: drop-shadow(3px -2px 6px rgb(240 150 64 / 0.18)); }
