/* JonnyP Industries. One stylesheet for every page. The direction is in DESIGN.md. */

/* ------------------------------------------------------------ tokens */

:root {
  --charcoal: #16161a;    /* page background */
  --charcoal-2: #1f1f24;  /* raised areas: game panels, dev log cards */
  --charcoal-3: #2a2a30;  /* borders, dividers, inputs */
  --bone: #ecebe7;        /* body and heading text */
  --ash: #a19f99;         /* secondary text, dates, captions */
  --flame: #e8893a;       /* the one accent: primary buttons, links, focus rings, the star date */

  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;

  /* 1.25 scale from a 17px body */
  --step--1: 0.85rem;
  --step-0: 1.0625rem;
  --step-1: 1.328rem;
  --step-2: 1.66rem;
  --step-3: 2.075rem;
  --step-4: 2.594rem;
  --step-5: 3.243rem;

  --page: 72rem;          /* text runs the full width of its column, the same as the pictures (Jon, 2026-11-13) */
  --read: 72rem;          /* reading pages: one column for text and pictures; the full page like the home page (Jon, 2026-11-13). Lower it to narrow them */
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 4px;

  color-scheme: dark;
}

/* ------------------------------------------------------------- fonts */

@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow/barlow-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow/barlow-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/barlow/barlow-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow/barlow-condensed-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* Infinite Justice: Ack Ack Attack! page headings only. Its licence readme ships beside it. */
@font-face {
  font-family: "Infinite Justice";
  src: url("../fonts/infinite-justice/Infinite.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------- base */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--charcoal);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.6;
}

main { flex: 1; }

img, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.1;
  text-wrap: balance;
}
h1 { font-size: clamp(var(--step-3), 1.2rem + 4.5vw, var(--step-5)); line-height: 1.05; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); font-weight: 700; }

p, ul, ol { margin: 0; }
ul[class], ol[class], nav ul, footer ul { list-style: none; padding: 0; }

a { color: var(--flame); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--bone); }

strong, b { font-weight: 500; }

:focus-visible {
  outline: 2px solid var(--flame);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--flame); color: var(--charcoal); }

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Reading pages (dev log posts, privacy and how-to pages, app pages) keep text and pictures in one column of the
   same width, lined up under the logo. At 72rem it is the full page, the same as home, game pages and the dev log list. */
.post > *, .doc > *, .app > * { max-width: var(--read); }

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--flame);
  color: var(--charcoal);
  font-weight: 500;
  border-radius: var(--radius);
}
.skip-link:focus { top: 0.5rem; color: var(--charcoal); }

.button {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  background: var(--flame);
  color: var(--charcoal);
  font-weight: 500;
  text-decoration: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.button:hover { background: var(--bone); color: var(--charcoal); }

.status {
  color: var(--ash);
  font-size: var(--step--1);
}

/* ------------------------------------------------------------ header */

.site-header { border-bottom: 1px solid var(--charcoal-3); }

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--bone);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1;
  text-decoration: none;
}
.brand img { width: 4.25rem; }
.brand:hover { color: var(--flame); }

.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a {
  display: block;
  padding: 0.5rem 0;
  color: var(--bone);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--flame); }
.site-nav a[aria-current] { border-bottom-color: var(--flame); }

.nav-toggle {
  display: none;
  padding: 0.45rem 0.9rem;
  background: none;
  color: var(--bone);
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--ash);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle[aria-expanded="true"] { border-color: var(--flame); color: var(--flame); }

/* On a phone the menu folds away behind the button. Without JavaScript it simply stays open. */
@media (max-width: 43.99rem) {
  .js .nav-toggle { display: block; }
  .js .site-nav { display: none; flex-basis: 100%; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; gap: 0; padding-bottom: 0.5rem; }
  .js .site-nav a { padding: 0.7rem 0; border-bottom: 1px solid var(--charcoal-3); }
  .js .site-nav a[aria-current] { color: var(--flame); border-bottom-color: var(--charcoal-3); }
}

/* ------------------------------------------------------------ footer */

.site-footer {
  margin-top: 5rem;
  border-top: 1px solid var(--charcoal-3);
  font-size: var(--step--1);
}

.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(8rem, 13rem) 1fr;
  gap: 2rem 3rem;
  align-items: start;
  padding-block: 2.5rem 2rem;
}

.footer-rocket img { width: 100%; }

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1.75rem 2rem;
}
.footer-links h2 {
  margin-bottom: 0.4rem;
  font-size: var(--step-1);
  font-weight: 700;
}
.footer-links li + li { margin-top: 0.15rem; }
.footer-links a { color: var(--bone); text-decoration: none; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--flame); text-decoration: underline; }

.footer-small {
  grid-column: 1 / -1;
  padding-top: 1.25rem;
  border-top: 1px solid var(--charcoal-3);
  color: var(--ash);
}
.footer-small p + p { margin-top: 0.25rem; }

@media (max-width: 43.99rem) {
  .site-footer-inner { grid-template-columns: 1fr; }
  .footer-rocket { max-width: 9rem; }
}

/* ---------------------------------------------------------- home hero */

/* The one animation that runs by itself (DESIGN.md). Everything else waits for the visitor. */
@keyframes rocket-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-16px) rotate(2deg); }
}
.hero-rocket { animation: rocket-float 5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .hero-rocket { animation: none; } }

/* Short-term offers, above the hero. Comes and goes with content/home.toml [offers]. */
.offers { margin-top: 1.25rem; }
.offers-heading {
  color: var(--flame);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.offers ul { display: grid; gap: 0.5rem; margin-top: 0.5rem; padding: 0; list-style: none; }
.offers li {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--charcoal-2);
  border-left: 3px solid var(--flame);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.offers li[hidden] { display: none; }
.offers .app-icon { flex: none; width: 2.5rem; height: 2.5rem; }
.offers-name { font-weight: 700; }
.offers-name::after { content: ":"; }

.hero {
  display: grid;
  gap: 1.5rem 3rem;
  align-items: center;
  padding-block: clamp(1.5rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem);
}
.hero-text > * + * { margin-top: 1.5rem; }
.hero-intro { max-width: 40rem; line-height: 1.6; }
.hero-intro a { color: var(--bone); text-decoration-color: var(--flame); text-decoration-thickness: 2px; }
.hero-intro a:hover { color: var(--flame); }
.hero-art { order: -1; width: min(60vw, 17rem); }
.hero-art img { width: 100%; }
@media (min-width: 50rem) {
  .hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .hero-intro { font-size: var(--step-1); line-height: 1.5; }
  .hero-art { order: 0; width: 100%; max-width: 30rem; justify-self: end; }
}

/* ---------------------------------------------------- home sections */

.home-games, .home-log, .home-apps, .home-contact { margin-top: clamp(3rem, 8vw, 5.5rem); }
.home-games, .home-log, .home-apps, .about, .home-contact { scroll-margin-top: 1rem; }
.home-games > h2, .home-log > h2, .home-apps > h2 { margin-bottom: 1.25rem; }

/* Games are not equal (DESIGN.md): the one that is out gets the wide panel. */
.game-feature { overflow: hidden; background: var(--charcoal-2); border-radius: var(--radius); }
.game-feature-art { display: block; }
.game-feature-art img { width: 100%; }
.game-feature-body {
  display: grid;
  gap: 1.5rem 3rem;
  align-items: end;
  padding: clamp(1rem, 3vw, 2rem);
}
.game-feature-text > * + * { margin-top: 0.9rem; }
.game-feature-title img { width: min(26rem, 100%); }
.game-feature .logline { margin-top: 0.9rem; font-size: var(--step-0); }
@media (min-width: 50rem) {
  .game-feature-body { grid-template-columns: minmax(0, 1fr) auto; }
  .game-feature .logline { font-size: var(--step-1); }
}

.game-wip { display: grid; gap: 1rem; margin-top: 1rem; }
.wip-panel { overflow: hidden; background: var(--charcoal-2); border-radius: var(--radius); }
.wip-clip video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.wip-text { padding: clamp(1rem, 3vw, 1.5rem); }
.wip-text h3 a { color: var(--bone); text-decoration: none; }
.wip-text h3 a:hover { color: var(--flame); }
.wip-text .status { margin-top: 0.2rem; }
.wip-text p + p { margin-top: 0.75rem; }
.wip-latest { color: var(--ash); font-size: var(--step--1); }
@media (min-width: 50rem) { .game-wip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }   /* equal panels (Jon, 2026-11-13) */

.home-log > * + * { margin-top: 1rem; }
.home-log > h2 + * { margin-top: 0; }

/* Apps are smaller than the games: plain rows. */
.home-apps-intro { margin-bottom: 1.25rem; }
.app-rows li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem 1rem;
  align-items: center;
  padding-block: 0.9rem;
  border-top: 1px solid var(--charcoal-3);
}
.app-rows li:last-child { border-bottom: 1px solid var(--charcoal-3); }
.app-rows .app-icon { width: 3rem; height: 3rem; }
.app-rows h3 { font-size: var(--step-1); }
.app-rows h3 a { color: var(--bone); text-decoration: none; }
.app-rows h3 a:hover { color: var(--flame); }
.app-row-platforms { grid-column: 2; color: var(--ash); font-size: var(--step--1); }
@media (min-width: 44rem) {
  .app-rows li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .app-row-platforms { grid-column: 3; }
}

/* About. The dither texture sits beside the text, never behind it. */
.about {
  margin-top: clamp(3rem, 8vw, 5.5rem);
  padding-block: clamp(2.5rem, 7vw, 4.5rem);
  border-block: 1px solid var(--charcoal-3);
}
.about-inner { display: grid; gap: 2rem 3rem; align-items: center; }
.about-text > * + * { margin-top: 1.25rem; }
.about-body p + p { margin-top: 1rem; }
.about-links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.75rem; }
.about-art img { width: 300px; max-width: 100%; image-rendering: pixelated; }
@media (min-width: 64rem) {
  .about-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .about-art img { width: 450px; }
}
@media (min-width: 76rem) { .about-art img { width: 600px; } }

.credits summary { width: fit-content; color: var(--flame); font-weight: 500; cursor: pointer; }
.credits summary:hover { color: var(--bone); }
.credits-note { margin-top: 0.75rem; color: var(--ash); font-size: var(--step--1); }
.credits dl { margin: 0.75rem 0 0; }
.credits dl > div { padding-block: 0.6rem; border-top: 1px solid var(--charcoal-3); }
.credits dt { font-weight: 500; }
.credits dt span { color: var(--ash); font-weight: 400; }
.credits dd { margin: 0.1rem 0 0; color: var(--ash); }

/* Contact: the form, with the plain email address beside it for people who would sooner use that. */
.home-contact { display: grid; gap: 2rem 4rem; align-items: start; }
.contact-intro > * + * { margin-top: 1rem; }
.contact-direct a { font-weight: 500; overflow-wrap: anywhere; }
@media (min-width: 60rem) { .home-contact { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }

.contact-form { display: grid; gap: 1rem; max-width: 40rem; }
.contact-trap { display: none; }
.field-row { display: grid; gap: 1rem; }
@media (min-width: 34rem) { .field-row { grid-template-columns: 1fr 1fr; } }
.field label { display: block; margin-bottom: 0.3rem; font-weight: 500; }
.field input, .field select, .field textarea {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--charcoal-2);
  color: var(--bone);
  font: inherit;
  border: 1px solid var(--ash);
  border-radius: var(--radius);
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--flame); }
.contact-send { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.contact-send .button { font: inherit; font-weight: 500; }
.contact-send .button:disabled { background: var(--charcoal-3); color: var(--ash); cursor: not-allowed; }
.contact-status { flex: 1 1 14rem; }
.contact-status.is-error { color: var(--flame); }

/* ------------------------------------------------------ page heading */

.page-head { padding-top: clamp(2rem, 6vw, 4rem); margin-bottom: 2.25rem; }
.lede { margin-top: 0.9rem; font-size: var(--step-1); line-height: 1.45; }

.not-found-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; font-size: var(--step-1); }
/* A one-message page with the dithered rocket beside it (the 403 page). */
.notice-inner { display: grid; gap: 2rem 3rem; align-items: center; }
.notice-inner .about-art { padding-top: 1rem; }
@media (min-width: 64rem) { .notice-inner { grid-template-columns: minmax(0, 1fr) auto; } }

/* ----------------------------------------------------- dev log index */

/* The filters need JavaScript, so they only show when it is running. */
.filters { display: none; flex-wrap: wrap; gap: 0.75rem 2rem; margin-bottom: 1.5rem; }
.js .filters { display: flex; }
.filter-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter-group button, .filter-empty button {
  padding: 0.35rem 0.85rem;
  background: none;
  color: var(--bone);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 500;
  border: 1px solid var(--ash);
  border-radius: var(--radius);
  cursor: pointer;
}
.filter-group button:hover, .filter-empty button:hover { border-color: var(--flame); color: var(--flame); }
.filter-group button[aria-pressed="true"] { background: var(--flame); border-color: var(--flame); color: var(--charcoal); }
.filter-empty { color: var(--ash); }
.filter-empty button { margin-left: 0.5rem; }

.post-list { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }

.post-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  gap: 1.25rem 1.75rem;
  align-items: start;
  padding: 1rem;
  background: var(--charcoal-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
}
.post-card[hidden] { display: none; }
.post-card:hover { border-color: var(--flame); }
.post-card-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 2px;
}
.post-card-text { padding-block: 0.25rem; }
.post-card .stamp { margin-bottom: 0.25rem; font-size: var(--step-0); }
.post-card :is(h2, h3) { font-size: var(--step-2); }
.post-card :is(h2, h3) a { color: var(--bone); text-decoration: none; }
.post-card :is(h2, h3) a::after { content: ""; position: absolute; inset: 0; }   /* the whole card is the link */
.post-card:hover :is(h2, h3) a { color: var(--flame); }
.post-card .post-meta { margin-top: 0.35rem; }
.post-card-excerpt { margin-top: 0.75rem; }
.post-card-games { margin-top: 0.75rem; color: var(--ash); font-size: var(--step--1); }

@media (max-width: 43.99rem) {
  .post-card { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------ dev log post */

.post { padding-top: clamp(2rem, 6vw, 4rem); }

.post-header { margin-bottom: 2.25rem; }

.stamp {
  margin-bottom: 0.5rem;
  color: var(--flame);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.2;
}

.post-meta { margin-top: 0.9rem; color: var(--ash); font-size: var(--step--1); }

.post-body > * + * { margin-top: 1.5rem; }
.post-body > p + p { margin-top: 1.1rem; }
.post-body > .gallery + p,
.post-body > .yt-card + p { margin-top: 2.5rem; }

.post-link a { font-weight: 500; }

.code {
  margin-inline: 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  background: var(--charcoal-2);
  border: 1px solid var(--charcoal-3);
  border-radius: var(--radius);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  tab-size: 4;
}

/* Galleries: thumbnails share one shape per gallery; the whole picture opens in the lightbox. */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.gallery a {
  display: block;
  overflow: hidden;
  aspect-ratio: var(--ratio, 16 / 9);
  background: var(--charcoal-2);
  border: 1px solid var(--charcoal-3);
  border-radius: var(--radius);
}
.gallery a:hover { border-color: var(--flame); }
.gallery img, .gallery video { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 34rem) {
  .gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .gallery.last-wide a:last-child { grid-column: 1 / -1; }
}

/* A YouTube link: a still that opens YouTube. Nothing loads from YouTube on this page. */
.yt-card {
  display: block;
  color: var(--bone);
  text-decoration: none;
}
.yt-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--charcoal-2);
  border: 1px solid var(--charcoal-3);
  border-radius: var(--radius);
}
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-card:hover .yt-thumb { border-color: var(--flame); }
.yt-play {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--flame);
  border-radius: 50%;
}
.yt-play::after {
  content: "";
  position: absolute;
  left: 54%;
  top: 50%;
  translate: -50% -50%;
  border-style: solid;
  border-width: 0.6rem 0 0.6rem 1rem;
  border-color: transparent transparent transparent var(--charcoal);
}
.yt-caption { display: block; margin-top: 0.6rem; }
.yt-title { display: block; font-weight: 500; }
.yt-card:hover .yt-title { color: var(--flame); }
.yt-where { display: block; color: var(--ash); font-size: var(--step--1); }

/* Post footer: the games it covers, then the way to the next post. */
.post-footer { margin-top: 4rem; }

.post-games {
  padding: 1.5rem;
  background: var(--charcoal-2);
  border-radius: var(--radius);
}
.post-games h2 { font-size: var(--step-2); font-weight: 700; }
.post-games > ul > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
  padding-block: 1rem;
  border-top: 1px solid var(--charcoal-3);
}
.post-games > ul { margin-top: 1rem; }
.post-games > ul > li:last-child { padding-bottom: 0; }
.post-game-name {
  min-width: 13rem;
  color: var(--bone);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.2;
}
.post-game-name:hover { color: var(--flame); }

.store-badges { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; }
.store-badges li { display: flex; flex-direction: column; gap: 0.3rem; }
.store-badges a { display: block; border-radius: 8px; }
.store-badges img { height: 2.75rem; width: auto; object-fit: cover; }
.store-note { color: var(--ash); font-size: var(--step--1); line-height: 1.3; }

.post-nav {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}
.post-nav a {
  display: block;
  padding: 1rem 1.25rem;
  color: var(--bone);
  text-decoration: none;
  border: 1px solid var(--charcoal-3);
  border-radius: var(--radius);
}
.post-nav a:hover { border-color: var(--flame); }
.post-nav-label { display: block; color: var(--ash); font-size: var(--step--1); }
.post-nav-title {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.2;
}
.post-nav a:hover .post-nav-title { color: var(--flame); }
@media (min-width: 34rem) {
  .post-nav { grid-template-columns: 1fr 1fr; }
  .post-nav-newer { grid-column: 2; text-align: right; }
}

.post-back { margin-top: 1.5rem; }

/* --------------------------------------- legal pages and the how-to */

.app-icon { width: 2rem; height: 2rem; border-radius: 22%; }
.app-icon.is-large { width: 6.5rem; height: 6.5rem; }
.app-icon.is-round { border-radius: 50%; }

.doc-product { margin-bottom: 0.75rem; }
.doc-product a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--bone);
  font-weight: 500;
  text-decoration: none;
}
.doc-product a:hover { color: var(--flame); }

.doc-meta { display: flex; flex-wrap: wrap; gap: 0.15rem 1.75rem; margin-top: 0.9rem; color: var(--ash); font-size: var(--step--1); }

.doc-toc {
  margin-bottom: 2.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--charcoal-2);
  border-radius: var(--radius);
}
.doc-toc h2 { margin-bottom: 0.5rem; font-size: var(--step-1); font-weight: 700; }
.doc-toc ol { padding-left: 1.4rem; }
.doc-toc li + li { margin-top: 0.15rem; }

.doc-body { counter-reset: section; }
.doc-body > * + * { margin-top: 1.1rem; }
.doc-body ul, .doc-body ol { padding-left: 1.3rem; }
.doc-body li + li { margin-top: 0.4rem; }
.doc-body > h2 {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--charcoal-3);
  font-size: var(--step-3);
  scroll-margin-top: 1rem;
}
.doc-body > h2::before {
  counter-increment: section;
  content: counter(section) ". ";
  color: var(--flame);
}
.doc-body.is-plain { counter-reset: none; }
.doc-body.is-plain > h2 { font-size: var(--step-2); font-weight: 700; }
.doc-body.is-plain > h2::before { content: none; }
.doc-body > h3 { margin-top: 2rem; font-size: var(--step-1); }
.doc-body .lede { margin-top: 1.1rem; }
.nowrap { white-space: nowrap; }

.summary, .contact {
  padding: 1.25rem 1.5rem;
  background: var(--charcoal-2);
  border-radius: var(--radius);
}
.summary > * + *, .contact > * + * { margin-top: 0.75rem; }
.summary h3 { font-size: var(--step-1); font-weight: 700; }

.doc-body blockquote {
  margin-inline: 0;
  padding: 0.9rem 1.25rem;
  background: var(--charcoal-2);
  border-left: 3px solid var(--flame);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.table-scroll { overflow-x: auto; }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.45; }
.table-scroll th, .table-scroll td {
  padding: 0.6rem 0.9rem 0.6rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--charcoal-3);
}
.table-scroll th { color: var(--ash); font-weight: 500; white-space: nowrap; }
.table-scroll td:first-child { min-width: 9rem; font-weight: 500; }

/* Rows of screenshots: Apple Watch screens are small and rounded, phone screens taller. */
.shots { display: flex; flex-wrap: wrap; gap: 1.25rem 1.5rem; align-items: flex-start; }
.shot { width: min(10rem, calc(50% - 0.75rem)); margin: 0; }   /* two watch screens fit side by side on a phone */
.shot.phone { width: min(14rem, 100%); }
.shot.tablet { width: min(30rem, 100%); }
.shot.tablet img { border-radius: 0.75rem; }
.shot img { width: 100%; background: #000; border: 1px solid var(--charcoal-3); border-radius: 1.6rem; }
.shot.phone img { border-radius: 1.25rem; }
.shot figcaption { margin-top: 0.5rem; color: var(--ash); font-size: var(--step--1); line-height: 1.35; }

/* -------------------------------------------------------- game pages */

.game > * + * { margin-top: clamp(3rem, 8vw, 5.5rem); }
.game h2 { font-size: clamp(var(--step-2), 1rem + 2.6vw, var(--step-4)); }

/* The Ack Ack Attack! page sets its headings in the game's own font. It has one weight. */
.font-infinite-justice h2, .font-infinite-justice h3 {
  font-family: "Infinite Justice", var(--font-head);
  font-weight: 400;
  line-height: 1.15;
}
.font-infinite-justice h2 { font-size: clamp(var(--step-1), 0.9rem + 2vw, var(--step-3)); }
.font-infinite-justice h3 { font-size: var(--step-0); }

.game-hero { padding-top: clamp(2rem, 6vw, 4rem); }
.game-title-art { max-width: 46rem; }
.game-title-art img { width: 100%; }
.game-hero .status { margin-top: 0.5rem; font-size: var(--step-0); }
.logline {
  max-width: 44rem;
  margin-top: 1rem;
  font-size: var(--step-1);
  font-style: italic;
  line-height: 1.4;
}
.game-key-art { margin-top: 2rem; }
.game-key-art img { width: 100%; border-radius: var(--radius); }

.game-premise { margin-top: 2.5rem; }
.game-premise .lede { margin-top: 0; font-size: var(--step-0); line-height: 1.6; }
.game-premise .store-badges { margin-top: 1.75rem; }
@media (min-width: 50rem) { .game-premise .lede { font-size: var(--step-1); line-height: 1.5; } }

/* Two views: text and buttons on one side, the chosen screenshot on the other. */
.views { display: grid; gap: 1.5rem 3rem; align-items: center; }
.views-text > * + * { margin-top: 1rem; }
.view-buttons { display: none; gap: 0.5rem; }
.js .view-buttons { display: flex; }
.view-buttons button {
  padding: 0.5rem 1.1rem;
  background: none;
  color: var(--bone);
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--ash);
  border-radius: var(--radius);
  cursor: pointer;
}
.view-buttons button:hover { border-color: var(--flame); color: var(--flame); }
.view-buttons button[aria-pressed="true"] { background: var(--flame); border-color: var(--flame); color: var(--charcoal); }
.views-stage figure { margin: 0; }
.views-stage figure + figure { margin-top: 1rem; }
.views-stage figure[hidden] + figure, .views-stage figure + figure[hidden] { margin-top: 0; }
.views-stage img { width: 100%; border: 1px solid var(--charcoal-3); border-radius: var(--radius); }
.views-stage figcaption { margin-top: 0.5rem; color: var(--ash); font-size: var(--step--1); }
@media (min-width: 60rem) { .views { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }

/* Feature blocks, media on alternating sides. */
.features { display: grid; gap: clamp(2.5rem, 6vw, 4.5rem); }
.feature { display: grid; gap: 1.25rem 3rem; align-items: center; }
.feature-media img, .feature-media video { width: 100%; border: 1px solid var(--charcoal-3); border-radius: var(--radius); }
.feature-text > * + * { margin-top: 0.9rem; }
@media (min-width: 60rem) {
  .feature { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .feature:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .feature:nth-child(even) .feature-media { order: 2; }
}

.so-far > * + * { margin-top: 1rem; }
.so-far .gallery { margin-top: 1.75rem; }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: 1.75rem 1.25rem;
  margin-top: 1.75rem;
}
.mode-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.mode-grid h3 { margin-top: 0.75rem; }
.mode-grid p { margin-top: 0.3rem; color: var(--ash); font-size: 0.95rem; line-height: 1.5; }

.extras ul { margin-top: 1rem; padding-left: 1.2rem; }
.extras li + li { margin-top: 0.5rem; }

.get {
  padding-block: 2rem;
  border-block: 1px solid var(--charcoal-3);
}
.get { display: grid; gap: 2rem 3rem; align-items: center; scroll-margin-top: 1rem; }
.get-text > * + * { margin-top: 1.25rem; }
.get-poster img { width: min(20rem, 70vw); border-radius: var(--radius); }
@media (min-width: 50rem) { .get.has-poster { grid-template-columns: minmax(0, 1fr) auto; } }
.get-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; color: var(--ash); font-size: var(--step--1); }

.game-posts > * + * { margin-top: 1rem; }
.post-rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 1.25rem;
  padding-block: 0.7rem;
  border-top: 1px solid var(--charcoal-3);
}
.post-rows li:last-child { border-bottom: 1px solid var(--charcoal-3); }
.post-rows .stamp { margin: 0; font-size: var(--step-0); white-space: nowrap; }
.post-rows a { color: var(--bone); font-weight: 500; }
.post-rows a:hover { color: var(--flame); }

/* --------------------------------------------------------- app pages */

/* Quieter than the game pages: icon, what it is, where to get it, then the detail. */
.app-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem 2rem;
  align-items: start;
  padding-top: clamp(2rem, 6vw, 4rem);
  margin-bottom: 2.5rem;
}
.app-head-text > * + * { margin-top: 1rem; }
.app-head h1 { font-size: clamp(var(--step-3), 1.2rem + 3.5vw, var(--step-4)); }
.app-head .app-logline { margin-top: 0.35rem; color: var(--ash); font-weight: 500; }
.app-head .lede { margin-top: 1rem; font-size: var(--step-0); line-height: 1.6; }
.app-head .store-badges { margin-top: 1.5rem; }

.facts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.facts li {
  padding: 0.15rem 0.65rem;
  color: var(--ash);
  font-size: var(--step--1);
  border: 1px solid var(--charcoal-3);
  border-radius: var(--radius);
}
.offer {
  padding: 0.75rem 1rem;
  background: var(--charcoal-2);
  border-left: 3px solid var(--flame);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.app-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; font-size: var(--step--1); }
.app-links li { color: var(--ash); }

@media (max-width: 33.99rem) {
  .app-head { grid-template-columns: 1fr; }
  .app-icon.is-large { width: 4.5rem; height: 4.5rem; }
}

/* A row of screens under the header. It scrolls sideways when it does not fit. */
.shot-strip {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  padding-bottom: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
.shot-strip img {
  flex: none;
  width: 13rem;
  height: auto;
  background: #000;
  border: 1px solid var(--charcoal-3);
  border-radius: 1.25rem;
  scroll-snap-align: start;
}
.shot-strip img.watch { width: 9.5rem; border-radius: 1.6rem; }

/* ---------------------------------------------------------- lightbox */

.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  background: rgb(14 14 17 / 0.96);
  color: var(--bone);
  border: 0;
}
.lightbox::backdrop { background: rgb(14 14 17 / 0.96); }
html:has(.lightbox[open]) { overflow: hidden; }   /* the page behind stays put */
.lightbox[open] { display: grid; grid-template-rows: auto 1fr; }

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem var(--gutter);
}
.lightbox-count { color: var(--ash); font-size: var(--step--1); }
.lightbox-buttons { display: flex; gap: 0.5rem; }
.lightbox button {
  padding: 0.45rem 0.9rem;
  background: var(--charcoal-2);
  color: var(--bone);
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--charcoal-3);
  border-radius: var(--radius);
  cursor: pointer;
}
.lightbox button:hover { border-color: var(--flame); color: var(--flame); }

.lightbox-stage {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);   /* a definite box, so the picture's max-height has something to measure against */
  place-items: center;
  min-height: 0;
  padding: 0 var(--gutter) var(--gutter);
}
.lightbox-stage img, .lightbox-stage video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lightbox-stage video { width: min(100%, 60rem); }
