/* Shared by the access form and every page under /samples/: the home page's letter column, self-hosted type. */
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-700.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #f5f5f3;
  --fg: #161615;
  --muted: #6f6f6a;
  --rule: #e0e0db;
  --surface: #ffffff;
  --sunk: #efefeb;
  --f-mark: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --f-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #111110; --fg: #e8e8e4; --muted: #95958f; --rule: #2a2a28; --surface: #181817; --sunk: #1c1c1a; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #111110; --fg: #e8e8e4; --muted: #95958f; --rule: #2a2a28; --surface: #181817; --sunk: #1c1c1a; color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg); color: var(--fg);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  padding-inline: 20px;
}
main {
  display: grid; grid-template-columns: 1fr min(640px, 100%) 1fr;
  padding-block: clamp(48px, 10vh, 96px) 80px;
}
main > * { grid-column: 2; min-width: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }

.mark { font-family: var(--f-mark); font-size: 26px; line-height: 1; text-decoration: none; justify-self: start; }
.crumb { margin-top: 40px; font: 400 12px/1.4 var(--f-mono); color: var(--muted); }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
h1 { font-family: var(--f-mark); font-weight: 400; font-size: 38px; line-height: 1.12; letter-spacing: -.01em; margin: 12px 0 0; text-wrap: balance; }
.crumb + h1 { margin-top: 10px; }
.mark + h1 { margin-top: 40px; }
.sub { margin: 10px 0 0; color: var(--muted); }
h2 { font-family: var(--f-body); font-weight: 600; font-size: 16px; margin: 44px 0 0; }
h2 + * { margin-top: 10px; }

.prose { margin-top: 32px; display: grid; gap: 16px; }
.prose > * { margin: 0; }
.prose ul, .prose ol { padding-left: 1.2em; display: grid; gap: 6px; }
p { margin: 14px 0 0; }
.note { color: var(--muted); font-size: 14px; }
b, strong { font-weight: 600; }

/* plain tables: rules only */
.tw { overflow-x: auto; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 400; color: var(--muted); font-size: 12.5px; }
td.n, th.n { text-align: right; padding-right: 0; padding-left: 12px; white-space: nowrap; }
td.m { font-family: var(--f-mono); font-size: 13px; white-space: nowrap; }

/* problem statements and answers, shown as the solver saw them */
.verb { margin-top: 12px; border-left: 2px solid var(--rule); padding: 2px 0 2px 16px; font: 400 13px/1.6 var(--f-mono); white-space: pre-wrap; overflow-wrap: break-word; }
blockquote { margin: 12px 0 0; border-left: 2px solid var(--rule); padding: 2px 0 2px 16px; }
blockquote p:first-child { margin-top: 0; }
details { margin-top: 14px; }
summary { cursor: pointer; font-size: 14px; color: var(--muted); }
summary:hover { color: var(--fg); }

.list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 0; }
.list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.list li:first-child { border-top: 1px solid var(--rule); }
.list .k { font: 400 12px/1.6 var(--f-mono); color: var(--muted); white-space: nowrap; }
.list .d { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }

.slot { margin-top: 14px; padding: 12px 0; border-top: 1px dashed var(--rule); border-bottom: 1px dashed var(--rule); color: var(--muted); font-size: 14px; }

.outline { margin: 12px 0 0; padding: 0; list-style: none; font: 400 12.5px/1.75 var(--f-mono); }
.outline li { display: grid; grid-template-columns: minmax(0, 1fr) 3.5em; gap: 8px; }
.outline .w { text-align: right; color: var(--muted); }
.outline .l { color: var(--muted); }

/* form */
form { margin-top: 32px; display: grid; gap: 18px; }
label { display: grid; gap: 6px; font-size: 14px; }
label span { color: var(--muted); }
input, textarea {
  font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 6px; padding: 9px 11px; width: 100%; box-sizing: border-box;
}
input:focus, textarea:focus { outline: none; border-color: var(--fg); }
textarea { min-height: 96px; resize: vertical; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.btn { all: unset; cursor: pointer; justify-self: start; font-size: 14px; font-weight: 600; padding: 9px 15px; border-radius: 6px; background: var(--fg); color: var(--bg); text-decoration: none; display: inline-block; }
.btn:hover { opacity: .88; }
.btn:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }
.err { color: var(--fg); font-size: 14px; border-left: 2px solid var(--fg); padding-left: 12px; margin: 24px 0 0; }
.meta { font: 400 12.5px/1.6 var(--f-mono); color: var(--muted); }

/* JetBrains Mono would draw |- and |= as single logic symbols, which changes the math */
.crumb, td.m, .verb, .list .k, .outline, .meta { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
/* Instrument Serif draws 1 like l: sample ids in headings use the body face */
h1 .id { font-family: var(--f-body); font-size: .82em; letter-spacing: 0; }

footer { margin-top: 64px; color: var(--muted); font-size: 12.5px; display: grid; gap: 4px; }

@media (max-width: 520px) {
  h1 { font-size: 31px; }
  table { font-size: 13px; }
  th, td { padding-right: 8px; }
  td.n, th.n { padding-left: 8px; }
}
