/* The landing page's own styling; the game pages carry their own. The
   tokens and the panel, row and chip shapes follow mojo703.github.io, so the
   two sites read as one. */

:root {
  color-scheme: light;
  --bg: #161e03;
  --bg-surface: #e8e4de;
  --bg-surface-raised: #ddd9d3;
  --bg-surface-inset: #f2eee8;
  --text-primary: #2a2320;
  --text-secondary: #5a534a;
  --text-heading: #3d2e1a;
  --accent: #3a8a3f;
  --accent-hover: #2d6e31;
  --border-edge: rgba(0, 0, 0, 0.12);
  --nav-bg: #e0dcd6;
  --nav-bg-hover: rgba(58, 138, 63, 0.12);
  --nav-text: #2a2320;
  --notice-edge: #b08a2a;
  --notice-bg: #f5ecd2;
  --panel-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  --panel-highlight: inset 1px 1px 0 rgba(255, 255, 255, 0.7);
  --panel-depth: inset -1px -1px 0 rgba(0, 0, 0, 0.1);
  --inset-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.2);
  --inset-highlight: inset -1px -1px 0 rgba(255, 255, 255, 0.5);
  --btn-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  --btn-depth: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --btn-hover-shadow:
    inset 6px 0 4px -6px rgba(0, 0, 0, 0.15),
    inset -6px 0 4px -6px rgba(0, 0, 0, 0.15),
    inset 0 6px 3px -5px rgba(255, 255, 255, 0.25),
    inset 0 -6px 4px -6px rgba(0, 0, 0, 0.2);
  --btn-active-shadow:
    inset 4px 0 4px -4px rgba(0, 0, 0, 0.25),
    inset -4px 0 4px -4px rgba(0, 0, 0, 0.25),
    inset 0 4px 4px -3px rgba(0, 0, 0, 0.3),
    inset 0 -2px 2px -2px rgba(255, 255, 255, 0.1);
  --bevel-border: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cdefs%3E%3ClinearGradient id='t' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.5'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='.15'/%3E%3C/linearGradient%3E%3ClinearGradient id='l' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.4'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='.1'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23000' stop-opacity='.08'/%3E%3Cstop offset='1' stop-color='%23000' stop-opacity='.25'/%3E%3C/linearGradient%3E%3ClinearGradient id='r' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%23000' stop-opacity='.05'/%3E%3Cstop offset='1' stop-color='%23000' stop-opacity='.2'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='0' y='0' width='12' height='4' fill='url(%23t)'/%3E%3Crect x='0' y='0' width='4' height='12' fill='url(%23l)'/%3E%3Crect x='0' y='8' width='12' height='4' fill='url(%23b)'/%3E%3Crect x='8' y='0' width='4' height='12' fill='url(%23r)'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%23ddd9d3'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1a1614;
    --bg-surface: #2a2725;
    --bg-surface-raised: #313031;
    --bg-surface-inset: #414040;
    --text-primary: #e8e4dc;
    --text-secondary: #9a958c;
    --text-heading: #ffe6c0;
    --accent: #5eb663;
    --accent-hover: #4da352;
    --border-edge: rgba(255, 255, 255, 0.08);
    --nav-bg: rgba(0, 0, 0, 0.5);
    --nav-bg-hover: rgba(94, 182, 99, 0.15);
    --nav-text: #e8e4dc;
    --notice-edge: #8a7330;
    --notice-bg: #3a3322;
    --panel-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --panel-highlight: inset 1px 1px 0 rgba(255, 255, 255, 0.06);
    --panel-depth: inset -1px -1px 0 rgba(0, 0, 0, 0.3);
    --inset-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.5);
    --inset-highlight: inset -1px -1px 0 rgba(255, 255, 255, 0.04);
    --btn-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --btn-depth: inset 0 -1px 0 rgba(0, 0, 0, 0.4);
    --btn-hover-shadow:
      inset 6px 0 4px -6px rgba(0, 0, 0, 0.3),
      inset -6px 0 4px -6px rgba(0, 0, 0, 0.3),
      inset 0 6px 3px -5px rgba(255, 255, 255, 0.08),
      inset 0 -6px 4px -6px rgba(0, 0, 0, 0.4);
    --btn-active-shadow:
      inset 4px 0 4px -4px rgba(0, 0, 0, 0.5),
      inset -4px 0 4px -4px rgba(0, 0, 0, 0.5),
      inset 0 4px 4px -3px rgba(0, 0, 0, 0.6),
      inset 0 -2px 2px -2px rgba(255, 255, 255, 0.05);
    --bevel-border: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cdefs%3E%3ClinearGradient id='t' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.12'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='.04'/%3E%3C/linearGradient%3E%3ClinearGradient id='l' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.1'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='.02'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23000' stop-opacity='.15'/%3E%3Cstop offset='1' stop-color='%23000' stop-opacity='.5'/%3E%3C/linearGradient%3E%3ClinearGradient id='r' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%23000' stop-opacity='.1'/%3E%3Cstop offset='1' stop-color='%23000' stop-opacity='.45'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='0' y='0' width='12' height='4' fill='url(%23t)'/%3E%3Crect x='0' y='0' width='4' height='12' fill='url(%23l)'/%3E%3Crect x='0' y='8' width='12' height='4' fill='url(%23b)'/%3E%3Crect x='8' y='0' width='4' height='12' fill='url(%23r)'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%23313031'/%3E%3C/svg%3E");
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1614;
  --bg-surface: #2a2725;
  --bg-surface-raised: #313031;
  --bg-surface-inset: #414040;
  --text-primary: #e8e4dc;
  --text-secondary: #9a958c;
  --text-heading: #ffe6c0;
  --accent: #5eb663;
  --accent-hover: #4da352;
  --border-edge: rgba(255, 255, 255, 0.08);
  --nav-bg: rgba(0, 0, 0, 0.5);
  --nav-bg-hover: rgba(94, 182, 99, 0.15);
  --nav-text: #e8e4dc;
  --notice-edge: #8a7330;
  --notice-bg: #3a3322;
  --panel-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --panel-highlight: inset 1px 1px 0 rgba(255, 255, 255, 0.06);
  --panel-depth: inset -1px -1px 0 rgba(0, 0, 0, 0.3);
  --inset-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.5);
  --inset-highlight: inset -1px -1px 0 rgba(255, 255, 255, 0.04);
  --btn-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --btn-depth: inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  --btn-hover-shadow:
    inset 6px 0 4px -6px rgba(0, 0, 0, 0.3),
    inset -6px 0 4px -6px rgba(0, 0, 0, 0.3),
    inset 0 6px 3px -5px rgba(255, 255, 255, 0.08),
    inset 0 -6px 4px -6px rgba(0, 0, 0, 0.4);
  --btn-active-shadow:
    inset 4px 0 4px -4px rgba(0, 0, 0, 0.5),
    inset -4px 0 4px -4px rgba(0, 0, 0, 0.5),
    inset 0 4px 4px -3px rgba(0, 0, 0, 0.6),
    inset 0 -2px 2px -2px rgba(255, 255, 255, 0.05);
  --bevel-border: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cdefs%3E%3ClinearGradient id='t' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.12'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='.04'/%3E%3C/linearGradient%3E%3ClinearGradient id='l' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.1'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='.02'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23000' stop-opacity='.15'/%3E%3Cstop offset='1' stop-color='%23000' stop-opacity='.5'/%3E%3C/linearGradient%3E%3ClinearGradient id='r' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%23000' stop-opacity='.1'/%3E%3Cstop offset='1' stop-color='%23000' stop-opacity='.45'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='0' y='0' width='12' height='4' fill='url(%23t)'/%3E%3Crect x='0' y='0' width='4' height='12' fill='url(%23l)'/%3E%3Crect x='0' y='8' width='12' height='4' fill='url(%23b)'/%3E%3Crect x='8' y='0' width='4' height='12' fill='url(%23r)'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%23313031'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
}

body {
  margin: 0;
  font-family: "Titillium Web", sans-serif;
  color: var(--text-primary);
}

h1,
h2,
h3 {
  font-family: "Titillium Web", sans-serif;
  font-weight: 700;
  color: var(--text-heading);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: Consolas, monaco, monospace;
  font-size: 0.9em;
  padding: 0 0.3em;
  border-radius: 2px;
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-edge);
}

.brand {
  display: block;
  fill: currentColor;
  flex-shrink: 0;
}

.icon {
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-left: 2px;
}

@media (max-width: 800px) {
  .navbar > a > span {
    display: none;
  }
}

.content {
  margin: 50px auto 0;
  padding: 0 10px;
  max-width: 1200px;
}

@media (min-width: 600px) {
  .content {
    padding: 0 calc(5vw + 10px);
  }
}

/* The bar at the top: the two away links and the theme switch. */
.navbar {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  text-align: center;
  border-radius: 3px;
  overflow: hidden;
  font-size: large;
  background-color: var(--nav-bg);
  border: 1px solid var(--border-edge);
  box-shadow: var(--panel-shadow), var(--panel-highlight), var(--panel-depth);
}

.navbar > a,
.navbar > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 1px;
  color: var(--nav-text);
  font: inherit;
  font-weight: 600;
  background: none;
  border: none;
  border-right: 1px solid var(--border-edge);
  cursor: pointer;
  box-shadow: var(--btn-highlight), var(--btn-depth);
  transition: box-shadow 50ms ease, color 50ms ease, background-color 50ms ease;
}

.navbar > button {
  padding: 6px 10px;
  min-width: 2em;
  border-right: none;
}

.navbar > a:hover,
.navbar > a:focus-visible,
.navbar > button:hover,
.navbar > button:focus-visible {
  background-color: var(--nav-bg-hover);
  color: var(--accent);
  text-decoration: none;
  box-shadow: var(--btn-hover-shadow);
  outline: none;
}

.navbar > a:active,
.navbar > button:active {
  padding-top: 8px;
  padding-bottom: 4px;
  box-shadow: var(--btn-active-shadow);
}

.theme-toggle .sun,
.theme-toggle .moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .sun {
  display: block;
}

:root[data-theme="light"] .theme-toggle .moon {
  display: block;
}

.title {
  margin: 0 auto 10px;
  width: fit-content;
  padding: 4px 16px;
  border-radius: 3px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  background-color: var(--bg-surface);
  color: var(--text-heading);
  border: 1px solid var(--border-edge);
  box-shadow: var(--panel-shadow), var(--panel-highlight), var(--panel-depth);
}

/* A raised panel with a bevelled frame and a recessed body of rows. */
.panel {
  margin: 16px 0;
  background-color: var(--bg-surface-raised);
  border: 4px solid transparent;
  border-image: var(--bevel-border) 4 fill;
  box-shadow: var(--panel-shadow);
}

.panel-header {
  margin: 0;
  padding: 8px 12px;
  font-size: 1.1em;
  text-align: left;
}

.panel-body {
  margin: 8px;
  padding: 2px;
  background-color: var(--bg-surface-raised);
  box-shadow:
    inset 0 2px 2px -1px rgba(0, 0, 0, 0.6),
    inset 0 0 2px 0 rgba(0, 0, 0, 0.4),
    inset 0 -2px 2px -2px rgba(255, 255, 255, 0.08);
}

.panel-body > p {
  margin: 1px 0;
  padding: 0.5em 10px;
  background-color: var(--bg-surface-inset);
}

.panel-body > .notice {
  border: 1px solid var(--notice-edge);
  background-color: var(--notice-bg);
}

/* The examples: a grid of cards, each led by its screenshot. */
.examples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.example {
  display: flex;
  flex-direction: column;
  padding: 10px;
  background-color: var(--bg-surface-inset);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
}

.example:nth-child(4n + 2),
.example:nth-child(4n + 3) {
  filter: brightness(1.04);
}

.example-image {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border-edge);
  box-shadow: var(--inset-shadow), var(--inset-highlight);
  background: #000;
  overflow: hidden;
}

.example-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 150ms ease, filter 150ms ease;
}

.example-image .play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 14px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background-color: var(--accent);
  border: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow: var(--panel-shadow), var(--btn-highlight), var(--btn-depth);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.example-image:hover,
.example-image:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.example-image:hover img,
.example-image:focus-visible img {
  transform: scale(1.03);
  filter: brightness(1.08);
}

.example-image:hover .play,
.example-image:focus-visible .play {
  opacity: 1;
  transform: none;
}

.example-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 8px;
}

.example-title {
  margin: 0 0 6px;
  font-size: 1.1em;
}

.example-title > a {
  color: inherit;
}

.example-title > a:hover {
  color: var(--accent);
  text-decoration: none;
}

.example-text > p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 0.95em;
  line-height: 1.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--chip-color) 38%, var(--bg-surface-raised));
  border-radius: 2px;
  background-color: color-mix(in srgb, var(--chip-color) 10%, var(--bg-surface-raised));
  box-shadow: var(--panel-highlight), var(--panel-depth);
  color: color-mix(in srgb, var(--chip-color) 34%, var(--text-primary));
  font-size: 0.78em;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

footer {
  text-align: center;
  margin: 16px 0 40px;
  padding: 4px 10px;
  background-color: var(--bg-surface-raised);
  border: 4px solid transparent;
  border-image: var(--bevel-border) 4 fill;
  box-shadow: var(--panel-shadow);
  color: var(--text-secondary);
}

@media (max-width: 800px) {
  html {
    font-size: 14px;
  }
}
