/* Shared style for the pages served outside the game (privacy, terms, the
   playtest survey). Self-hosted fonts only. Colours follow the game's paper and ink in
   light mode and the invite gate's greens in dark mode. */

@font-face {
  font-family: 'Vollkorn';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/vollkorn-latin-variable.woff2) format('woff2');
}

@font-face {
  font-family: 'Vollkorn';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/vollkorn-italic-latin-variable.woff2) format('woff2');
}

@font-face {
  font-family: 'Nunito Variable';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(/fonts/nunito-latin-variable.woff2) format('woff2');
}

:root {
  color-scheme: light dark;
  --bg: #f6ecc8;
  --sheet: #fbf5df;
  --ink: #3f2f18;
  --ink-soft: #5c4a2e;
  --rule: #d9c79a;
  --link: #4c5f2f;
  --table-head: #eedeb0;
  --field: #fffaea;
  --trouble: #9a3412;
  --serif: Vollkorn, Georgia, 'Times New Roman', serif;
  --sans: 'Nunito Variable', ui-rounded, 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14200f;
    --sheet: #1f2c1a;
    --ink: #f2f7ec;
    --ink-soft: #b7c8ab;
    --rule: #3a4a31;
    --link: #b5d18a;
    --table-head: #26351f;
    --field: #172312;
    --trouble: #f4a37c;
  }
}

* {
  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: var(--serif);
  font-size: 18px;
  line-height: 1.6;
}

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.sheet {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 28px 24px 32px;
}

header.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 20px;
  font-family: var(--sans);
  font-size: 15px;
}

header.top .name {
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

h1 {
  margin: 0 0 4px;
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
}

.effective {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-style: italic;
}

h2 {
  margin: 36px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 1.35rem;
  line-height: 1.3;
}

h3 {
  margin: 24px 0 6px;
  font-size: 1.1rem;
  line-height: 1.35;
}

p,
ul,
ol {
  margin: 0 0 12px;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin-bottom: 6px;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

.summary {
  margin: 0 0 8px;
  padding: 16px 20px;
  border-left: 4px solid var(--link);
  background: var(--bg);
  border-radius: 0 6px 6px 0;
}

.summary ul {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.45;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border: 1px solid var(--rule);
}

th {
  background: var(--table-head);
  font-weight: 700;
}

footer {
  margin-top: 24px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink-soft);
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

/* The survey form. */

[hidden] {
  display: none !important;
}

.survey .question {
  margin: 0 0 4px;
  padding: 18px 0 14px;
  border: none;
  /* A shadow, not a border: a fieldset border breaks around its legend. */
  box-shadow: inset 0 1px 0 var(--rule);
  min-width: 0;
}

.survey legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
}

.survey legend label {
  cursor: inherit;
}

.survey .num {
  color: var(--ink-soft);
  font-weight: 600;
  font-variant-numeric: lining-nums;
}

.survey legend + * {
  clear: both;
}

.survey .hint,
.survey .fine {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.survey .fine {
  margin-top: 14px;
}

.survey input + .hint,
.survey textarea + .hint {
  margin-top: 6px;
}

.survey .choices {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.survey .choices-row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin-bottom: 10px;
}

.survey .choices label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
}

.survey .choices label:hover {
  background: var(--bg);
}

.survey input[type='radio'] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
  accent-color: var(--link);
}

.survey .sub {
  display: block;
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.survey textarea,
.survey input[type='email'],
.survey input[type='text'] {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--field);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
}

.survey textarea {
  resize: vertical;
}

.survey .age-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.survey .age-row input {
  width: 6em;
}

.survey textarea:focus-visible,
.survey input:focus-visible,
.survey button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.survey button {
  min-height: 44px;
  padding: 8px 22px;
  border: 1px solid var(--link);
  border-radius: 6px;
  background: var(--link);
  color: var(--sheet);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.survey button.quiet {
  min-height: 40px;
  padding: 6px 16px;
  background: transparent;
  color: var(--link);
}

.survey button:disabled {
  opacity: 0.6;
  cursor: default;
}

.survey .send-row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.survey-trouble {
  margin: 8px 0 0;
  color: var(--trouble);
  font-size: 0.95rem;
  line-height: 1.45;
}

.survey-trouble:empty {
  display: none;
}

/* The honeypot stays out of sight and out of the tab order. */
.survey-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.thanks h2 {
  margin-top: 8px;
}

.thanks:focus {
  outline: none;
}

@media (max-width: 560px) {
  body {
    font-size: 17px;
  }

  .page {
    padding-top: 16px;
  }

  .sheet {
    padding: 20px 16px 24px;
  }

  h1 {
    font-size: 1.6rem;
  }

  /* Narrow screens read each table row as a small card. */
  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  table.stack tr {
    display: block;
    border: 1px solid var(--rule);
    border-radius: 4px;
    margin-bottom: 10px;
  }

  table.stack td {
    display: block;
    border: none;
    padding: 4px 10px;
  }

  table.stack td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
}
