/* Ethical Games site. One stylesheet, system fonts, no external requests. */

:root {
  --felt: #0e4d3a;
  --felt-deep: #093426;
  --felt-ink: #ffffff;
  --bg: #fbfaf6;
  --surface: #ffffff;
  --ink: #1b1f1d;
  --muted: #4a524e;
  --line: #d9ddd8;
  --link: #0b5d45;
  --link-hover: #073d2e;
  --accent: #b3261e;
  --focus: #f2b705;
  --radius: 12px;
  --measure: 42rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111513;
    --surface: #1a201d;
    --ink: #eef1ee;
    --muted: #b6bfba;
    --line: #2f3833;
    --link: #7fd3b1;
    --link-hover: #b4ead3;
    --accent: #ff8a80;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111513;
  --surface: #1a201d;
  --ink: #eef1ee;
  --muted: #b6bfba;
  --line: #2f3833;
  --link: #7fd3b1;
  --link-hover: #b4ead3;
  --accent: #ff8a80;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, sans-serif;
  font-size: 1.1875rem; /* 19px: comfortable for older eyes */
  line-height: 1.6;
}

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

a:hover {
  color: var(--link-hover);
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */

.site-header {
  background: var(--felt);
  color: var(--felt-ink);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--felt-ink);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  min-height: 48px;
}

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

.brand svg {
  width: 2rem;
  height: 2rem;
  flex: none;
}

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

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.85rem;
  border-radius: 999px;
  color: var(--felt-ink);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--felt-ink);
}

.site-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.18);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* Hero */

.hero {
  background: var(--felt);
  color: var(--felt-ink);
  padding: 2.5rem 0 3.5rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
  max-width: 18ch;
}

.hero p {
  font-size: 1.3rem;
  max-width: 36rem;
  margin: 0 0 1.5rem;
}

.hero-cards {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hero-cards span {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 4.6rem;
  background: #fff;
  border: 2px solid #333;
  border-radius: 8px;
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.hero-cards .s { color: #111; }
.hero-cards .h { color: #b3261e; }
.hero-cards .d { color: #1a56b0; }
.hero-cards .c { color: #146c2e; }

.hero-cards span:nth-child(1) { transform: rotate(-6deg); }
.hero-cards span:nth-child(2) { transform: rotate(-2deg) translateY(-4px); }
.hero-cards span:nth-child(3) { transform: rotate(2deg) translateY(-4px); }
.hero-cards span:nth-child(4) { transform: rotate(6deg); }

/* Content */

main {
  display: block;
  padding: 2.5rem 0 3.5rem;
}

.hero + main,
main.flush {
  padding-top: 0;
}

.prose {
  max-width: var(--measure);
}

h1,
h2,
h3 {
  line-height: 1.25;
}

main h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
  margin: 0 0 0.5rem;
}

main h2 {
  font-size: 1.55rem;
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.25rem;
}

main h3 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.5rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

li + li {
  margin-top: 0.35rem;
}

.lede {
  font-size: 1.3rem;
  color: var(--muted);
}

.updated {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--felt);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 0 0 2rem;
}

.summary h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.summary ul {
  margin-bottom: 0;
}

.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin: 0 0 2rem;
  font-size: 1.05rem;
}

.toc h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.4rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 700;
}

.table-scroll {
  overflow-x: auto;
}

/* Promise grid */

.section {
  padding-top: 3rem;
}

.section > h2 {
  margin-top: 0;
}

.promises {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.promises li {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.promises h3 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

.promises p {
  margin: 0;
  color: var(--muted);
}

/* Game list */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.games li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.games .icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 22%;
  background: var(--felt);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
}

.games strong {
  display: block;
  font-size: 1.15rem;
}

.games span.kind {
  color: var(--muted);
  font-size: 1rem;
}

.note {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 1rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 0 0 1.5rem;
}

.contact-card p:last-child {
  margin-bottom: 0;
}

.email {
  font-size: 1.25rem;
  font-weight: 700;
  word-break: break-word;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 0.25rem 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "+";
  flex: none;
  width: 1.5rem;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--link);
}

details[open] > summary::before {
  content: "\2212";
}

details > div {
  padding: 0 0 0.75rem 1.5rem;
}

details > div > p:last-child {
  margin-bottom: 0;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  font-size: 1rem;
}

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

.site-footer li + li {
  margin-top: 0;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 40rem) {
  body {
    font-size: 1.125rem;
  }
  .site-nav {
    margin-left: -0.6rem;
  }
  .site-nav a {
    padding: 0 0.6rem;
  }
  .hero {
    padding: 1.75rem 0 2.5rem;
  }
  .hero-cards span {
    width: 2.9rem;
    height: 4rem;
    font-size: 1.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .skip,
  .toc {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }
  a {
    color: #000;
  }
}
