/* Papyrus. Paper as the ground, ink for words, ochre and Nile blue as the two colours, and the
   painted band from the game's frieze as the one ornament. */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-latin-wonk-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #efe3c6;
  --paper-2: #e6d4ad;
  --paper-3: #d8bf8c;
  --ink: #23190f;
  --ink-2: #33261a;
  --ink-soft: #5d4932;
  --line: rgb(35 25 15 / 0.22);
  --ochre: #8c3a1b;
  --ochre-2: #a94a24;
  --nile: #2c66a8;
  --gold: #c9962b;
  --leaf: #4f7d3a;
  --on-dark: #f4ead2;
  --on-dark-soft: #cdbb95;
  --danger: #8f1d0d;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --gutter: 16px;
  --wide: 1180px;
  --text: 42rem;

  /* The band along the top of the frieze: blocks of blue, red, green and gold between thin
     ink lines. */
  --band: repeating-linear-gradient(
    90deg,
    var(--nile) 0 22px,
    var(--paper) 22px 26px,
    var(--ochre) 26px 48px,
    var(--paper) 48px 52px,
    var(--leaf) 52px 74px,
    var(--paper) 74px 78px,
    var(--gold) 78px 100px,
    var(--paper) 100px 104px
  );
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--paper);
  /* A little unevenness, as on a sheet of papyrus. */
  background-image:
    radial-gradient(70rem 40rem at 10% 0%, rgb(255 248 228 / 0.55), transparent 70%),
    radial-gradient(60rem 50rem at 100% 60%, rgb(201 150 43 / 0.08), transparent 70%);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
  overflow-wrap: break-word;
}

[hidden] {
  display: none !important;
}

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

picture {
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.45em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3rem, 11vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.9rem, 5vw, 3rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 1em;
}

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

a:hover {
  color: var(--ochre-2);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--ink);
  color: var(--on-dark);
  padding: 0.5rem 0.75rem;
  z-index: 30;
}

.skip:focus {
  top: var(--gutter);
}

.lead {
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  line-height: 1.55;
}

.eyebrow,
.platform {
  font: 650 0.8rem/1.3 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wt {
  font-family: var(--sans);
  font-size: clamp(0.8rem, 0.18em, 1rem);
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
  vertical-align: middle;
  opacity: 0.8;
}

/* Buttons */

.button {
  display: inline-block;
  font: 650 1.05rem/1 var(--sans);
  background: var(--ink);
  color: var(--on-dark);
  border: 2px solid var(--ink);
  border-radius: 3px;
  padding: 0.95rem 1.3rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.button:hover {
  background: var(--ochre);
  border-color: var(--ochre);
  color: var(--on-dark);
}

.button-small {
  font-size: 0.92rem;
  padding: 0.6rem 0.9rem;
}

.button-ghost {
  background: transparent;
  color: var(--on-dark);
  border-color: rgb(244 234 210 / 0.75);
}

.button-ghost:hover {
  background: rgb(244 234 210 / 0.12);
  border-color: var(--on-dark);
  color: var(--on-dark);
}

.button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
}

/* Header */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(239 227 198 / 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.top::after {
  content: '';
  display: block;
  height: 5px;
  background: var(--band);
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 10px var(--gutter);
}

.brand {
  font: 700 1.45rem/1 var(--serif);
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand:hover {
  color: var(--ink);
}

.brand-by {
  font: 500 0.68rem/1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.top nav {
  display: none;
  gap: 1.5rem;
  margin-left: auto;
}

.top nav a {
  font-weight: 550;
  color: var(--ink);
  text-decoration: none;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
}

.top nav a:hover {
  border-bottom-color: var(--ochre);
  color: var(--ink);
}

.top .button {
  margin-left: auto;
}

/* Home: the film at the top */

.hero {
  position: relative;
  min-height: min(86vh, 860px);
  display: flex;
  align-items: flex-end;
  color: var(--on-dark);
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.film,
.film-still,
.film-still img,
.film video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film {
  z-index: -2;
}

.film video {
  opacity: 0;
  transition: opacity 0.8s;
}

.film video.playing {
  opacity: 1;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgb(20 13 6 / 0.88) 0%, rgb(20 13 6 / 0.55) 38%, rgb(20 13 6 / 0) 70%),
    linear-gradient(to right, rgb(20 13 6 / 0.45), transparent 60%);
}

.hero-text {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 120px var(--gutter) 40px;
}

.hero .eyebrow {
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.hero h1 {
  color: var(--on-dark);
  margin-bottom: 0.15em;
  text-shadow: 0 2px 24px rgb(0 0 0 / 0.35);
}

.hero .wt {
  color: var(--on-dark-soft);
}

.hero-line {
  font: 500 clamp(1.2rem, 3vw, 1.6rem)/1.35 var(--serif);
  max-width: 32rem;
  margin: 0;
}

.hero .button:not(.button-ghost) {
  background: var(--on-dark);
  color: var(--ink);
  border-color: var(--on-dark);
}

.hero .button:not(.button-ghost):hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.hero .platform {
  color: var(--on-dark-soft);
  margin: 0;
}

.film-toggle {
  position: absolute;
  right: var(--gutter);
  bottom: 20px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgb(244 234 210 / 0.7);
  background: rgb(20 13 6 / 0.45);
  color: var(--on-dark);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.film-toggle span {
  width: 12px;
  height: 14px;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

.film-toggle.paused span {
  width: 0;
  height: 0;
  border: 0;
  border-left: 13px solid currentColor;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 4px;
}

/* Home: what the game is */

.intro {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 72px var(--gutter) 24px;
}

.intro-inner {
  max-width: 48rem;
}

.about {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 16px var(--gutter) 80px;
}

.about ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 36px 40px;
  counter-reset: about;
}

.about li {
  counter-increment: about;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}

.about li::before {
  content: counter(about, upper-roman);
  display: block;
  font: 650 0.9rem/1 var(--serif);
  color: var(--ochre);
  margin-bottom: 0.6rem;
}

.about p {
  color: var(--ink-soft);
  margin: 0;
}

/* Home: the story, told on the painted strip */

.story {
  background: var(--ink);
  color: var(--on-dark);
  padding: 80px 0 72px;
  position: relative;
}

.story::before,
.story::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--band);
}

.story::before {
  top: 0;
}

.story::after {
  bottom: 0;
}

.story-text {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter) 36px;
}

.story-text > * {
  max-width: 46rem;
}

.story h2 {
  color: var(--on-dark);
}

.story-text p:not(.lead) {
  color: var(--on-dark-soft);
}

.frieze {
  list-style: none;
  margin: 0;
  padding: 0 var(--gutter) 12px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 88%;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-color: var(--gold) transparent;
}

.frieze li {
  scroll-snap-align: start;
}

.frieze figure {
  margin: 0;
}

.frieze img {
  width: 100%;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(244 234 210 / 0.12);
}

.frieze figcaption {
  font: 400 1.05rem/1.5 var(--serif);
  font-style: italic;
  color: var(--on-dark);
  padding: 14px 4px 0;
}

.frieze .num {
  font-style: normal;
  font-weight: 650;
  color: var(--gold);
  margin-right: 0.4em;
}

/* Home: pictures */

.gallery {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 80px var(--gutter) 40px;
}

.gallery ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px 24px;
}

.gallery figure {
  margin: 0;
}

.gallery a {
  display: block;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgb(35 25 15 / 0.6);
}

.gallery img {
  width: 100%;
  transition: transform 0.4s;
}

.gallery a:hover img {
  transform: scale(1.02);
}

.gallery figcaption {
  font: 400 1rem/1.5 var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  padding-top: 10px;
}

/* Home: the list, and who makes the game */

.closing {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 40px var(--gutter) 24px;
}

.studio {
  max-width: var(--text);
  margin: 0 auto;
  padding: 40px var(--gutter) 72px;
  text-align: center;
  color: var(--ink-soft);
}

.studio p {
  margin-bottom: 0.5rem;
}

.studio-social {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 22px;
  font-weight: 600;
}

.studio-social a {
  display: inline-block;
  padding: 6px 0;
}

/* The sign-up box */

.signup {
  position: relative;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 3px;
  padding: 34px 22px 26px;
  max-width: 52rem;
  margin: 0 auto;
}

.signup::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: var(--band);
}

.signup h2 {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
}

.signup > p,
.signup-fine {
  color: var(--ink-soft);
}

.signup-closed {
  color: var(--ink);
  margin: 0;
}

.signup-form {
  margin-top: 1.2rem;
}

.signup-label {
  display: block;
  font-weight: 650;
  margin-bottom: 0.4rem;
}

.signup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.signup-row input {
  flex: 1 1 15rem;
  min-width: 0;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.85rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}

.signup-row input::placeholder {
  color: #8a7558;
}

.signup-row input:focus-visible {
  outline-offset: 1px;
}

.signup-row input[aria-invalid='true'] {
  border-color: var(--danger);
}

.signup-status {
  min-height: 1.5em;
  margin: 0.7rem 0 0;
  font-weight: 600;
  color: var(--danger);
}

.signup-status.ok {
  color: var(--leaf);
  font-size: 1.1rem;
}

.signup-fine {
  font-size: 0.92rem;
  margin: 0.2rem 0 0;
}

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

/* Footer */

.foot {
  background: var(--ink);
  color: var(--on-dark-soft);
  position: relative;
  font-size: 0.95rem;
}

.foot::before {
  content: '';
  display: block;
  height: 6px;
  background: var(--band);
}

.foot-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 28px var(--gutter) 36px;
  display: grid;
  gap: 10px;
}

.foot-name {
  font: 700 1.15rem/1 var(--serif);
  color: var(--on-dark);
  margin: 0;
}

.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
}

.foot a {
  color: var(--on-dark);
  display: inline-block;
  padding: 6px 0;
}

.foot a:hover {
  color: var(--gold);
}

.foot-copy {
  margin: 0;
}

/* Text pages */

.prose,
.message {
  max-width: var(--text);
  margin: 0 auto;
  padding: 48px var(--gutter) 56px;
}

.prose h1,
.message h1 {
  font-size: clamp(2.3rem, 7vw, 3.6rem);
}

.prose h2 {
  font-size: 1.45rem;
  margin-top: 2em;
}

.de {
  display: block;
  font-family: var(--sans);
  font-size: 0.5em;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-soft);
  margin-top: 0.3em;
}

.prose h2 .de {
  font-size: 0.65em;
}

.draft {
  border: 1px dashed var(--ochre);
  padding: 0.75rem 1rem;
  font-weight: 600;
}

.placeholder {
  background: #ffe066;
  color: #1a1400;
  padding: 0 0.2em;
}

.updated {
  margin-top: 2.5em;
  color: var(--ink-soft);
}

.message .signup {
  margin-top: 12px;
}

/* Wider screens */

@media (min-width: 720px) {
  :root {
    --gutter: 28px;
  }

  .top nav {
    display: flex;
  }

  .top nav + .button {
    margin-left: 1.5rem;
  }

  .hero-text {
    padding-bottom: 64px;
  }

  .about ol {
    grid-template-columns: repeat(2, 1fr);
  }

  .frieze {
    grid-auto-columns: calc((100% - 16px) / 2);
    padding-left: max(var(--gutter), calc((100vw - var(--wide)) / 2 + var(--gutter)));
    padding-right: max(var(--gutter), calc((100vw - var(--wide)) / 2 + var(--gutter)));
  }

  .gallery ul {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery li.wide {
    grid-column: 1 / -1;
  }

  .signup {
    padding: 42px 40px 32px;
  }

  .foot-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: 'name social copy' 'links links links';
    align-items: center;
    gap: 14px 28px;
  }

  .foot-name {
    grid-area: name;
  }

  .foot-social {
    grid-area: social;
  }

  .foot-links {
    grid-area: links;
  }

  .foot-copy {
    grid-area: copy;
  }
}

@media (min-width: 1000px) {
  .about ol {
    grid-template-columns: repeat(3, 1fr);
  }

  .frieze {
    overflow: visible;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, 1fr);
    max-width: var(--wide);
    margin: 0 auto;
    padding: 0 var(--gutter);
    gap: 36px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .gallery img,
  .film video,
  .button {
    transition: none;
  }
}

@media (forced-colors: active) {
  .button,
  .signup,
  .signup-row input {
    border: 2px solid CanvasText;
  }

  .top::after,
  .story::before,
  .story::after,
  .signup::before,
  .foot::before {
    display: none;
  }
}

/* The short page: pictures without captions sit closer together. */
.gallery-plain ul {
  gap: 18px;
}

.gallery-plain {
  padding-top: 32px;
}
