/* Godot Facts: a reading site for code and engine output. System fonts only. */

:root {
  --bg: #fbfaf6;
  --surface: #f2f0e9;
  --text: #1c1e21;
  --muted: #565c63;
  --rule: #dedad0;
  --accent: #0a6b4d;
  --accent-soft: #e2f1ea;
  --code-bg: #f2f0e9;
  --code-text: #1c1e21;
  --out-bg: #15191e;
  --out-text: #e4e6e8;
  --out-muted: #9aa3ad;
  --out-error: #ff9b8f;
  --out-warning: #f2c86b;
  --add: #0a6b4d;
  --remove: #a3302a;
  --change: #7a5200;
  --focus: #0a6b4d;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111417;
    --surface: #1a1e23;
    --text: #e6e8ea;
    --muted: #a4abb3;
    --rule: #2b3138;
    --accent: #5ccf9f;
    --accent-soft: #15302a;
    --code-bg: #1a1e23;
    --code-text: #e6e8ea;
    --out-bg: #0a0c0e;
    --out-text: #e4e6e8;
    --out-muted: #8f98a2;
    --out-error: #ff9b8f;
    --out-warning: #f2c86b;
    --add: #5ccf9f;
    --remove: #ff9b8f;
    --change: #f2c86b;
    --focus: #5ccf9f;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

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

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--bg);
  padding: 6px 10px;
}

.skip:focus {
  left: 8px;
  z-index: 2;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark .mark {
  color: var(--accent);
  flex: none;
}

.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.97rem;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

/* Text */

main.wrap {
  padding-top: 36px;
  padding-bottom: 56px;
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.012em;
}

h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.15rem);
  margin: 0 0 18px;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.35rem;
  margin: 44px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

h3 {
  font-size: 1.1rem;
  margin: 28px 0 8px;
}

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

.lead {
  font-size: 1.1rem;
  color: var(--text);
}

.kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.note {
  color: var(--muted);
  font-size: 0.92rem;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

/* Code and output blocks */

.block {
  margin: 14px 0 22px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  background: var(--code-bg);
}

.block figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 6px 14px;
  border-bottom: 1px solid var(--rule);
  font: 600 0.8rem/1.4 var(--mono);
  color: var(--muted);
}

.block pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font: 0.86rem/1.55 var(--mono);
  color: var(--code-text);
  tab-size: 4;
}

.block pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  overflow-wrap: normal;
  white-space: pre;
}

.block-output {
  background: var(--out-bg);
  border-color: var(--out-bg);
}

.block-output figcaption {
  color: var(--out-muted);
  border-bottom-color: #2a3038;
}

.block-output pre {
  color: var(--out-text);
}

.o-banner {
  color: var(--out-muted);
}

.o-error {
  color: var(--out-error);
}

.o-warning {
  color: var(--out-warning);
}

.copy {
  font: 600 0.78rem/1 var(--sans);
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  opacity: 0.85;
}

.copy:hover {
  opacity: 1;
}

/* Lists */

.links {
  padding-left: 0;
  list-style: none;
}

.links li {
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}

.links li:last-child {
  border-bottom: 0;
}

.toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 0;
  list-style: none;
}

.older {
  padding-left: 0;
  list-style: none;
}

.older li {
  margin: 0 0 10px;
}

.older .versions {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.run-line {
  margin-top: 32px;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
}

.failures code,
.classes code,
.diff code {
  background: none;
  padding: 0;
}

.diff {
  padding-left: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.diff li {
  padding: 2px 0;
}

.d-add code {
  color: var(--add);
}

.d-remove code {
  color: var(--remove);
}

.d-change code,
.d-deprecated code {
  color: var(--change);
}

details {
  margin: 8px 0 18px;
}

summary {
  cursor: pointer;
  color: var(--accent);
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  margin: 16px 0 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  vertical-align: top;
}

thead th {
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody th {
  font-weight: 600;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* At phone width the scores stay in view: maker and date are on desktop and in the CSV. */
@media (max-width: 640px) {
  .models .wide {
    display: none;
  }

  .models th,
  .models td {
    white-space: normal;
    padding: 8px 10px;
  }

  .models thead th {
    vertical-align: bottom;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.button {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.08);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  padding-top: 20px;
  padding-bottom: 28px;
}

.site-footer p {
  margin: 0 0 6px;
}
