@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --teal: #91c0b6;
  --cream: #f7e9d0;
  --yellow: #efca70;
  --ink: #2a3035;
  --paper: #fbfbf6;
  --mist: #dee3e4;

  --topbar: 3.5rem;
  --side: 17.5rem;
  --art: calc(var(--side) * 1.5);
  --gutter: clamp(1rem, 3.2vw, 2.75rem);
  --fold: 1.75rem;

  --bg: #1b2024;
  --raised: #252c31;
  --line: #384147;
  --text: #ebe8de;
  --soft: #aeb5b8;
  --link: #a6d3c7;
  --accent: var(--teal);
  --focus: var(--yellow);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: var(--mist);
  --raised: var(--paper);
  --line: #bcc5ca;
  --text: #22282c;
  --soft: #4c555b;
  --link: #1d6356;
  --focus: var(--ink);
  color-scheme: light;
}

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

html {
  scroll-padding-top: calc(var(--topbar) + 1.25rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: 0.008em;
}

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

img,
video {
  height: auto;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

h2,
.title,
.brand-name,
.cta,
.game-entry h3 {
  font-family: "Archivo", "Arial Narrow", Arial, sans-serif;
}

h2 {
  font-size: 1.875rem;
  font-weight: 800;
  font-stretch: 72%;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 1em;
}

small {
  font-size: 0.8125rem;
  color: var(--soft);
}

.icon {
  flex: none;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

a > .icon:last-child {
  margin-left: 0.25em;
}

.skip {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 30;
  padding: 0.5rem 0.75rem;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
}

.skip:focus {
  top: 0.5rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: var(--topbar);
  padding-inline: var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-disc {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 50%;
  background: var(--paper);
}

.brand-name {
  overflow: hidden;
  font-size: 1.1875rem;
  font-weight: 800;
  font-stretch: 76%;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.topnav {
  margin-left: auto;
}

.topnav ul {
  display: flex;
  gap: clamp(1rem, 2.4vw, 1.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.topnav a {
  color: var(--text);
  white-space: nowrap;
  font-size: 0.9375rem;
  font-weight: 600;
  font-stretch: 88%;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.topnav a:hover,
.topnav a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.nav-narrow {
  display: none;
}

.theme-toggle {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--line);
  background: none;
  color: var(--text);
  font-size: 1.0625rem;
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  border-color: var(--soft);
}

.theme-toggle-dark,
[data-theme="light"] .theme-toggle-light {
  display: none;
}

[data-theme="light"] .theme-toggle-dark {
  display: inline;
}

.banner {
  height: clamp(10rem, 27vw, 25rem);
  overflow: hidden;
  border-bottom: 4px solid var(--accent);
  background: var(--raised);
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--banner-zoom, 1));
}

.banner--paper {
  height: clamp(8.5rem, 19vw, 14rem);
  background: var(--teal) url("crease.svg") 50% 0 / 21rem;
  border-bottom-color: var(--cream);
}

.page {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  gap: clamp(2rem, 4.2vw, 3.75rem);
  align-items: start;
  width: 100%;
  max-width: 86rem;
  margin-inline: auto;
  padding: 0 var(--gutter) 5rem;
}

.page--studio {
  --art: var(--side);
}

.side {
  position: relative;
  margin-top: calc(var(--art) * -0.42);
  padding-bottom: 2rem;
}

@media (min-width: 52.0625rem) {
  .side--pinned {
    position: sticky;
    top: calc(var(--topbar) - var(--art));
  }
}

@media (min-width: 52.0625rem) and (max-height: 47.9375rem) {
  .downloads {
    display: none;
  }
}

.boxart {
  aspect-ratio: 2 / 3;
  background: var(--raised);
}

.boxart img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge img {
  width: 100%;
}

.title {
  margin-top: 1.25rem;
  font-size: 2.875rem;
  font-weight: 900;
  font-stretch: 66%;
  line-height: 0.92;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.title small {
  display: block;
  margin-top: 0.5rem;
  color: var(--soft);
  font-size: 1.0625rem;
  font-weight: 500;
  font-stretch: 100%;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.byline {
  margin: 0.625rem 0 0;
  color: var(--soft);
  font-size: 0.9375rem;
}

.cta {
  display: block;
  margin-top: 1.25rem;
  padding: 0.875rem 1rem 0.8125rem;
  background: var(--yellow);
  clip-path: polygon(0 0, calc(100% - 0.75rem) 0, 100% 0.75rem, 100% 100%, 0 100%);
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 800;
  font-stretch: 80%;
  letter-spacing: 0.05em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.cta,
.theme-toggle,
.lightbox-bar button {
  transition: background-color 0.12s, border-color 0.12s;
}

.cta:hover {
  background: #f6d98f;
}

.cta:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--ink);
}

.sidenav {
  margin-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.sidenav ul,
.downloads ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidenav ul {
  padding: 0.625rem 0;
}

.sidenav a {
  position: relative;
  display: block;
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--text);
  text-decoration: none;
}

.sidenav a:hover {
  text-decoration: underline;
}

.sidenav a[aria-current] {
  font-weight: 700;
}

.sidenav a[aria-current]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 0.4375rem;
  height: 0.5625rem;
  background: var(--yellow);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.downloads {
  padding-top: 0.875rem;
  border-top: 1px solid var(--line);
}

.downloads h2 {
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
  font-stretch: 100%;
  letter-spacing: 0;
}

.download {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.4375rem;
  padding: 0.1875rem 0;
}

.download .icon {
  align-self: center;
}

.download small {
  display: inline-block;
}

.intro {
  display: grid;
  grid-template-columns: minmax(13.5rem, 17rem) minmax(0, 1fr);
  gap: clamp(1.75rem, 3.6vw, 3.25rem);
  align-items: start;
  padding-top: 2.5rem;
}

.facts {
  position: relative;
  padding: 1.5rem 1.375rem 1.375rem;
  background: var(--raised);
  clip-path: polygon(0 0, calc(100% - var(--fold)) 0, 100% var(--fold), 100% 100%, 0 100%);
}

.facts::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: var(--fold);
  height: var(--fold);
  background: linear-gradient(to top right, var(--cream) 50%, transparent 50%);
}

.facts dl {
  margin: 0;
}

.facts dt {
  margin-top: 0.9375rem;
  color: var(--soft);
  font-size: 0.875rem;
  font-weight: 700;
}

.facts dd {
  margin: 0.125rem 0 0;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.facts summary {
  cursor: pointer;
}

.facts details[open] summary {
  margin-bottom: 0.25rem;
}

.story {
  max-width: 44rem;
}

.story > section + section {
  margin-top: 2.5rem;
}

.story h2 {
  margin-bottom: 0.875rem;
}

.story h3 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.1875rem;
  font-weight: 800;
  font-stretch: 86%;
  letter-spacing: 0.035em;
}

.pitch {
  margin-bottom: 0;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.5;
}

.pitch + p {
  margin-top: 1em;
}

.clip {
  width: 100%;
  margin: 0 0 1.125rem;
  background: #000;
}

.features {
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li,
.features div {
  padding: 0.5625rem 0;
  border-top: 1px solid var(--line);
}

.features dt {
  font-weight: 700;
}

.features dd {
  margin: 0.125rem 0 0;
}

.steam-widget {
  width: 100%;
  margin-top: 2.5rem;
  border: 0;
  color-scheme: light;
}

.block {
  margin-top: 3.75rem;
  padding-top: 1.625rem;
  border-top: 1px solid var(--line);
}

.block > h2 {
  margin-bottom: 1.25rem;
}

.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.375rem 1.5rem;
  margin-bottom: 1.25rem;
}

.prose > * {
  max-width: 44rem;
}

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

.trailer {
  max-width: 60rem;
  margin: 0 0 1.5rem;
}

.trailer video,
.trailer iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

.trailer figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 0.625rem;
}

.shots,
.art,
.games,
.logos {
  margin: 0;
  padding: 0;
  list-style: none;
}

.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
}

.shots a {
  display: block;
  background: var(--raised);
}

.shots img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.shots a:hover img {
  outline: 3px solid var(--yellow);
  outline-offset: -3px;
}

.art {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem 1rem;
}

.art img {
  width: auto;
  height: 11rem;
}

.art p,
.logos p {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
}

.art small,
.logos small {
  display: block;
}

.games {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem 2.25rem;
}

.game-art {
  display: block;
  background: var(--raised);
}

.game-art img {
  width: 100%;
}

.game-entry h3 {
  margin: 1.125rem 0 0.625rem;
  font-size: 2.125rem;
  font-weight: 900;
  font-stretch: 66%;
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.game-entry h3 a {
  color: var(--text);
  text-decoration: none;
}

.game-entry h3 a:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

.game-entry h3 small {
  display: block;
  margin-top: 0.375rem;
  font-size: 1rem;
  font-weight: 500;
  font-stretch: 100%;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.game-entry p {
  margin-bottom: 0.5rem;
}

.game-meta {
  color: var(--soft);
  font-size: 0.9375rem;
}

.game-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-weight: 600;
}

.logos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 1rem;
}

.logo-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background: var(--mist);
}

.logo-tile img {
  position: absolute;
  inset: 1.5rem;
  width: calc(100% - 3rem);
  height: calc(100% - 3rem);
  object-fit: contain;
}

.lost {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  padding: 5rem var(--gutter) 6rem;
}

.lost .title {
  margin: 0 0 1.25rem;
}

.footer {
  display: flex;
  margin-top: auto;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.5rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.9375rem;
}

.footer p {
  margin: 0;
}

.footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0d1012;
  color: #ebe8de;
  --focus: var(--yellow);
}

.lightbox[open] {
  display: grid;
  grid-template: minmax(0, 1fr) auto / minmax(0, 1fr);
}

.lightbox-stage {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: clamp(0.5rem, 2vw, 1.5rem);
}

.lightbox-stage img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
}

.lightbox-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem var(--gutter);
  border-top: 1px solid #384147;
}

.lightbox-count {
  min-width: 3.5rem;
  font-variant-numeric: tabular-nums;
}

.lightbox-caption {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #aeb5b8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-original {
  flex: none;
  color: #a6d3c7;
}

.lightbox-bar button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid #384147;
  background: none;
  color: inherit;
  font-size: 1.125rem;
  cursor: pointer;
}

.lightbox-bar button:hover {
  border-color: #aeb5b8;
}

@media (min-width: 68.0625rem) {
  .facts--pinned {
    position: sticky;
    top: calc(var(--topbar) + 1.25rem);
    max-height: calc(100dvh - var(--topbar) - 2.5rem);
    overflow-y: auto;
  }
}

@media (max-width: 68rem) {
  .intro {
    display: flex;
    flex-direction: column;
  }

  
  .story {
    display: contents;
  }

  .story > :first-child {
    order: -1;
  }

  .facts {
    margin-top: 2rem;
  }

  .facts dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.5rem;
  }

  .shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 52rem) {
  .nav-wide {
    display: none;
  }

  .nav-narrow {
    display: block;
  }

  .page {
    display: block;
  }

  .side {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 0 1rem;
    align-items: end;
    margin-top: 0;
    padding-bottom: 0;
  }

  .boxart,
  .badge {
    grid-row: span 2;
    margin-top: -3.25rem;
  }

  .title {
    align-self: end;
    margin-top: 0.875rem;
    font-size: clamp(1.5rem, 7.6vw, 2.25rem);
  }

  .byline {
    align-self: start;
  }

  .cta,
  .sidenav {
    grid-column: 1 / -1;
  }

  .cta {
    max-width: 26rem;
  }

  .sidenav {
    margin-top: 1.25rem;
    border-bottom: 1px solid var(--line);
  }

  .sidenav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
  }

  .sidenav a {
    padding-left: 0;
  }

  .sidenav a[aria-current]::before {
    display: none;
  }

  .downloads {
    display: none;
  }

  .intro {
    padding-top: 1.75rem;
  }

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

  .art img {
    width: 100%;
    height: auto;
  }
}

@media (max-width: 30rem) {
  .facts dl,
  .shots {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-name {
    font-size: 1.0625rem;
  }

  
  .nav-optional {
    display: none;
  }

  
  .lightbox-caption {
    flex-basis: calc(100% - 4rem);
    white-space: normal;
  }

  .lightbox-original {
    margin-right: auto;
  }
}

@media (max-width: 25rem) {
  
  .steam-widget {
    display: none;
  }
}

@media (max-width: 22.5rem) {
  .topbar {
    gap: 0.75rem;
  }

  .brand {
    gap: 0.5rem;
  }

  .brand-name {
    font-size: 0.9375rem;
  }
}

@media print {
  .topbar,
  .sidenav,
  .downloads,
  .theme-toggle,
  .steam-widget,
  .lightbox {
    display: none;
  }
}

.game--grubstake {
  --accent: #ea9d41;
  --banner-zoom: 1.1;
}

.game--mortiscript {
  --accent: #fff927;
}
