/* The hub — the shared house style of the games: paper and ink, Source Serif 4 and IBM Plex Mono.
   Font faces and colour tokens are Undefeated's (tool-docs undefeated/DESIGN.md §2), unchanged. */

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-wght-normal.woff2') format('woff2-variations');
  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: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-wght-italic.woff2') format('woff2-variations');
  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: 'Source Serif 4';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-ext-wght-italic.woff2') format('woff2-variations');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

:root {
  --paper: #f3f0e8;
  --paper-2: #e9e5da;
  --ink: #1d1c1a;
  --ink-2: #5c5850;
  --rule: #cdc7b8;
  --friend: #1f4e8c;
  --foe: #a33227;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --col: 34rem;
  --gutter: 1rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #14161a;
    --paper-2: #1c1f24;
    --ink: #e8e4da;
    --ink-2: #a39e93;
    --rule: #33373e;
    --friend: #84a9e1;
    --foe: #e2826f;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #14161a;
  --paper-2: #1c1f24;
  --ink: #e8e4da;
  --ink-2: #a39e93;
  --rule: #33373e;
  --friend: #84a9e1;
  --foe: #e2826f;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
:focus-visible {
  outline: 2px solid var(--friend);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- page */
.page {
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: max(1.5rem, env(safe-area-inset-top)) var(--gutter)
    max(2rem, env(safe-area-inset-bottom));
}
@media (min-width: 52rem) {
  .page {
    max-width: calc(48rem + 2 * var(--gutter));
  }
}

/* ---------------------------------------------------------------- masthead */
/* The front page of a small paper: dateline, nameplate between rules, strapline. */
.masthead {
  text-align: center;
  padding-bottom: 1.1rem;
  border-bottom: 3px double var(--ink);
}
.dateline {
  margin: 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--ink);
  font: 500 0.75rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.title {
  margin: 0.9rem 0 0;
  font-size: clamp(2.5rem, 11.5vw, 4.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.strap {
  margin: 0.6rem 0 0;
  font-style: italic;
  color: var(--ink-2);
}

/* The every-game streak: one line under the masthead, only once there is one. */
.every-game {
  margin: 0;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: center;
  font: 500 0.8125rem/1.4 var(--mono);
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------- games */
.games {
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 52rem) {
  /* Two columns of entries, ruled like a puzzle page. */
  .games {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2.5rem;
  }
}
.game {
  border-bottom: 1px solid var(--rule);
}
.game a {
  display: grid;
  gap: 0.3rem;
  padding: 1.35rem 0 1.4rem;
  text-decoration: none;
}
.game .no {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.game .streak {
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink);
}
.game .name {
  font-size: 1.75rem;
  font-weight: 650;
  line-height: 1.15;
  margin-top: 0.15rem;
}
.game .premise {
  color: var(--ink-2);
  max-width: 30rem;
}
.game .go {
  margin-top: 0.5rem;
  font: 500 0.8125rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.game .go::after {
  content: ' →';
}
/* Played today: a tick and the result, quieter than an unplayed game's "Play". */
.game.done .go {
  color: var(--ink-2);
  text-transform: none;
  letter-spacing: 0.02em;
}
.game.done .go::before {
  content: '✓ ';
  color: var(--ink);
}
.game a:hover .name,
.game a:focus-visible .name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
.fallback .game a {
  padding: 1rem 0;
}

/* ---------------------------------------------------------------- footer, prose */
.foot {
  margin-top: 2.5rem;
  font: 400 0.8125rem/1.6 var(--mono);
  color: var(--ink-2);
  text-align: center;
}
.foot p {
  margin: 0.25rem 0;
}
.prose {
  max-width: var(--col);
  margin: 2rem auto 0;
}
.prose h1 {
  font-size: 2.25rem;
  line-height: 1.1;
  margin: 0 0 1rem;
}
.prose h2 {
  font: 500 0.75rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 2rem 0 0.6rem;
}
.prose p,
.prose li {
  margin: 0 0 0.85rem;
}
.prose ul {
  padding-left: 1.2rem;
}
.back {
  display: inline-block;
  margin-top: 1.5rem;
  font: 500 0.8125rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
