:root {
  --bg: #faf7f2;
  --bg-soft: #f2ede4;
  --surface: #ffffff;
  --text: #1c1b22;
  --muted: #6b6775;
  --border: #e4ddd0;
  --accent: #c2410c;
  --accent-soft: #fde7d3;
  --accent-2: #6d28d9;
  --code-bg: #1c1b22;
  --code-text: #ece9f3;
  --tok-keyword: #c4b5fd;
  --tok-string: #fcd34d;
  --tok-number: #fdba74;
  --tok-comment: #8a8697;
  --shadow: 0 1px 2px rgb(28 27 34 / 6%), 0 8px 24px rgb(28 27 34 / 6%);
  --radius: 12px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --bg-soft: #161922;
    --surface: #171a23;
    --text: #e8e6ef;
    --muted: #9a97a8;
    --border: #262a36;
    --accent: #f59e0b;
    --accent-soft: rgb(245 158 11 / 12%);
    --accent-2: #a78bfa;
    --code-bg: #0a0c11;
    --code-text: #e8e6ef;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--accent-soft), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  overflow-wrap: break-word;
}

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

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

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--surface);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.85rem 16px;
}

.brand {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand .brace {
  color: var(--accent);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

nav a {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

nav a:hover {
  color: var(--text);
  background: var(--bg-soft);
}

nav a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
}

nav a.external::after {
  content: " ↗";
}

/* Content */

.content {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 16px 4rem;
}

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

h1 {
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  font-weight: 800;
  margin: 0.5rem 0 1rem;
}

h2 {
  font-size: 1.6rem;
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
}

h4 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

hr {
  border: 0;
  height: 1px;
  margin: 2.5rem 0;
  background: var(--border);
}

img {
  max-width: 100%;
  vertical-align: middle;
}

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

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

blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

/* Code */

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

pre {
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-text);
  box-shadow: var(--shadow);
  line-height: 1.55;
}

pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 0.84rem;
}

div.sourceCode {
  margin: 1.5rem 0;
}

div.sourceCode pre {
  margin: 0;
}

code span.kw,
code span.cf,
code span.bu {
  color: var(--tok-keyword);
}

code span.st,
code span.ss,
code span.ch,
code span.vs {
  color: var(--tok-string);
}

code span.dv,
code span.fl,
code span.bn,
code span.cn {
  color: var(--tok-number);
}

code span.co,
code span.do {
  color: var(--tok-comment);
  font-style: italic;
}

/* Tables */

table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.93rem;
}

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

th {
  background: var(--bg-soft);
  font-weight: 600;
}

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

/* Home page: the README hero and list entries */

div[align="center"] {
  text-align: center;
}

.page-home div[align="center"]:first-of-type {
  padding: 2rem 0 0.5rem;
}

.page-home div[align="center"]:first-of-type h1 {
  font-size: clamp(2.4rem, 8vw, 4rem);
  background: linear-gradient(120deg, var(--text) 30%, var(--accent) 70%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-home div[align="center"]:first-of-type h1 img {
  height: 0.45em;
  vertical-align: 0.6em;
}

.page-home div[align="center"] p {
  margin: 0.6rem 0;
}

.page-home div[align="center"] a + a {
  margin-left: 0.25rem;
}

.page-home ul:not(.task-list):has(> li > a:first-child:not([href^="#"])) {
  padding: 0;
}

.page-home ul:not(.task-list):has(> li > a:first-child:not([href^="#"])) > li {
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page-home ul:not(.task-list) > li > a:first-child:not([href^="#"]) {
  font-weight: 600;
}

.task-list {
  padding-left: 0.25rem;
}

.task-list li {
  list-style: none;
}

.page-home pre {
  font-size: 0.95em;
}

/* RFC page */

.page-rfc h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.page-rfc .content > div.sourceCode:first-of-type pre,
.page-rfc .content > pre:first-of-type {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: none;
}

.page-rfc strong {
  color: var(--text);
}

/* Results page */

.page-results .content {
  max-width: 1040px;
}

.r-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0.75rem;
}

.r-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.r-filters select {
  max-width: 15rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.r-summary,
.r-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.r-table th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.r-table th[aria-sort] {
  color: var(--accent);
}

.r-row {
  cursor: pointer;
}

.r-row:hover td {
  background: var(--bg-soft);
}

.r-name {
  display: block;
  font-weight: 600;
}

.r-tags {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.r-partial {
  padding: 0 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.r-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.r-bad {
  color: var(--accent);
  font-weight: 600;
}

.r-score {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 11rem;
}

.r-bar {
  flex: 1;
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-soft);
}

.r-bar i {
  display: block;
  height: 100%;
  background: var(--accent-2);
}

.r-failures td {
  background: var(--bg-soft);
  font-size: 0.85rem;
}

.r-failures ul {
  margin: 0;
  padding-left: 1.1rem;
}

.r-failures li {
  margin: 0.4rem 0;
  overflow-wrap: anywhere;
}

/* Manifesto page */

.page-manifesto .content {
  max-width: 720px;
}

.page-manifesto h1 {
  font-size: clamp(2.4rem, 8vw, 4.2rem);
}

.page-manifesto h1 + p em {
  font-size: 1.35rem;
  color: var(--accent);
}

.page-manifesto h2 {
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-top: 0;
  padding-top: 0;
}

.page-manifesto .content > p {
  font-size: 1.08rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem 16px 2.5rem;
}

.site-footer a {
  color: var(--muted);
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .bar {
    justify-content: center;
  }

  nav {
    justify-content: center;
  }

  h2 {
    font-size: 1.35rem;
  }
}
