@font-face {
  font-family: "Zilla Slab";
  src: url("/fonts/zilla-slab-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-3.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --night: #17120e;
  --night-text: #efe6d0;
  --night-muted: #b9ab8e;
  --lamp: #f6cf57;
  --paper: #efe6d0;
  --ink: #251c14;
  --ink-muted: #5f5140;
  --rule: #c9bb9b;
  --green: #2c4638;
  --red: #8f2f1f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 1.125rem/1.55 "Source Sans 3", system-ui, sans-serif;
}
h1, h2, h3, .wordmark { font-family: "Zilla Slab", Georgia, serif; font-weight: 600; text-wrap: balance; }
h1, h2, h3, p, ul, ol, dl, dd, figure, pre { margin: 0; }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.375rem); line-height: 1.15; margin-bottom: 1rem; }
h3 { font-size: 1.375rem; line-height: 1.25; margin-bottom: .375rem; }
p + p { margin-top: .875rem; }
a { color: inherit; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; border-radius: 2px; }
.paper :focus-visible { outline-color: var(--green); }
img { display: block; max-width: 100%; height: auto; }
code { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: .875em; }

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; padding: .5rem 1rem; background: var(--lamp); color: var(--ink); z-index: 1; }
.skip:focus { top: 1rem; }

/* Night: header and hero */
.night { color: var(--night-text); }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 2rem; padding-block: 1.25rem; }
.wordmark { display: inline-flex; align-items: center; gap: .625rem; font-size: 1.375rem; text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.site-header nav a { padding-block: .375rem; text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3.5rem; align-items: center; padding-block: 3.5rem 4rem; }
h1 { font-size: clamp(2.375rem, 1.5rem + 3.4vw, 3.75rem); line-height: 1.05; letter-spacing: -.015em; }
.lede { margin-top: 1.25rem; max-width: 34rem; font-size: 1.25rem; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.button {
  display: inline-block; padding: .75rem 1.375rem; border: 2px solid var(--lamp); border-radius: 4px;
  background: var(--lamp); color: var(--ink); font-weight: 650; text-decoration: none;
}
.button:hover { background: #ffdf7d; border-color: #ffdf7d; }
.button-quiet { background: none; border-color: #75664d; color: var(--night-text); }
.button-quiet:hover { background: #2a2119; border-color: var(--night-muted); }
.fine { margin-top: 1rem; color: var(--night-muted); font-size: 1rem; }

/* Example mod-log entry, drawn like a Discord message */
.log { min-width: 0; }
.message { display: flex; gap: .875rem; padding: 1.125rem; border-radius: 8px; background: #313338; color: #dbdee1; font-size: 1rem; line-height: 1.4; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #efe6d0; }
.message-body { min-width: 0; flex: 1; }
.message p { margin: 0; }
.author { color: #f6cf57; font-weight: 600; }
.app-tag { margin-left: .25rem; padding: .0625rem .3125rem; border-radius: 3px; background: #5865f2; color: #fff; font-size: .6875rem; vertical-align: .1em; }
.embed { margin-top: .375rem; padding: .75rem 1rem .875rem; border-left: 4px solid #fee75c; border-radius: 4px; background: #2b2d31; }
.embed-title { color: #f2f3f5; font-weight: 650; }
.embed .embed-title { margin-bottom: .375rem; }
.embed .field { margin-top: .625rem; color: #f2f3f5; font-size: .9375rem; font-weight: 650; }
.embed ul { padding-left: 1.125rem; }
.mention { padding: 0 .125rem; border-radius: 3px; background: #3c4270; color: #d5daff; }
figcaption { margin-top: .75rem; color: var(--night-muted); font-size: 1rem; }

.office { overflow: hidden; background: #0c0a08; }
.office img { width: 100%; max-height: 27rem; object-fit: cover; object-position: 50% 60%; image-rendering: pixelated; }

/* Paper: the case file */
.paper { background: var(--paper); padding-block: 4.5rem; }
.paper section + section { margin-top: 5rem; }
.paper section { scroll-margin-top: 2rem; }
.paper section > p, .split p { max-width: 38rem; }
.aside { color: var(--ink-muted); }
.paper code { padding: .1em .35em; border-radius: 3px; background: #dfd3b6; color: var(--ink); overflow-wrap: anywhere; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin: 2rem 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 1rem; border-top: 3px solid var(--ink); }
.steps h3::before { content: counter(step) ". "; }

.split { display: grid; grid-template-columns: 1fr 1.5fr; gap: 1.5rem 4rem; align-items: start; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .625rem .75rem .625rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
thead th { border-bottom: 2px solid var(--ink); }
.ledger :is(th, td):last-child { padding-right: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger td:last-child { font-weight: 650; color: var(--red); }
.ledger .credit td:last-child { color: var(--green); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 4rem; margin-top: 1.5rem; }

.warning { padding: .875rem 1.125rem; border: 2px solid var(--red); border-radius: 4px; }
.setup { margin: 2rem 0; padding: 0; list-style: none; counter-reset: step; max-width: 46rem; }
.setup li { position: relative; counter-increment: step; padding-left: 3rem; }
.setup li + li { margin-top: 1.75rem; }
.setup li::before { content: counter(step); position: absolute; left: 0; top: -.1rem; font: 600 1.75rem/1.2 "Zilla Slab", Georgia, serif; color: var(--green); }
pre { margin-block: .75rem; padding: 1rem 1.125rem; border-radius: 4px; background: var(--night); color: var(--night-text); overflow-x: auto; }
.paper pre code { padding: 0; background: none; color: inherit; overflow-wrap: normal; }

.perms > div { padding-block: .75rem; border-bottom: 1px solid var(--rule); }
.perms > div:first-child { border-top: 2px solid var(--ink); }
.perms dt { font-weight: 650; }

/* Terms and Privacy */
.legal { max-width: 50rem; }
.legal h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); margin-bottom: 1.25rem; }
.legal h2 { font-size: 1.625rem; margin: 2.5rem 0 .75rem; }
.legal ul { margin-block: .875rem; padding-left: 1.375rem; }
.legal li + li { margin-top: .5rem; }
.legal .source { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--ink-muted); }
.table-wrap { margin-block: 1.25rem; overflow-x: auto; }
.table-wrap table { min-width: 46rem; font-size: 1rem; line-height: 1.45; }

.site-footer { padding-block: 2rem; color: var(--night-text); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }

@media (max-width: 56rem) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding-block: 2rem 3rem; }
  .steps { grid-template-columns: 1fr 1fr; }
  .split, .pair { grid-template-columns: 1fr; }
  .paper { padding-block: 3.5rem; }
  .paper section + section { margin-top: 3.75rem; }
}
@media (max-width: 34rem) {
  .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .message { padding: .875rem; gap: .625rem; }
  .office img { height: 13rem; }
  pre { padding: .75rem .875rem; white-space: pre-wrap; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
