@font-face {
  font-family: "ZX Spectrum Web";
  src: url("fonts/zx-spectrum.otf.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Sixtyfour Web";
  src: url("fonts/sixtyfour.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  color-scheme: light;
  --page: #f4f7fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --text: #172033;
  --muted: #5c687b;
  --accent: #1769c2;
  --accent-hover: #0d4f96;
  --accent-soft: #e8f2ff;
  --border: #d9e1ec;
  --border-strong: #b8c4d4;
  --code-bg: #111827;
  --code-text: #e5edf8;
  --inline-code-bg: #e9eef5;
  --quote-border: #68a5e3;
  --table-stripe: #f5f8fc;
  --shadow: 0 18px 45px rgb(28 45 70 / 8%);
  --radius: 12px;
  --content-width: 76rem;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  line-height: 1.65;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgb(55 132 214 / 8%), transparent 32rem),
    var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  color: var(--accent-hover);
}

a:focus-visible {
  border-radius: 3px;
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 3px;
}

::selection {
  color: var(--text);
  background: var(--accent-soft);
}

header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  display: flex;
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

header h1 {
  min-width: 0;
  margin: 0;
  padding: 1.15rem 0;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  letter-spacing: -0.025em;
}

.site-title-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
}

.site-title-link::before {
  width: 0.75rem;
  height: 0.75rem;
  flex: 0 0 auto;
  border: 2px solid var(--surface);
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  content: "";
  transform: rotate(45deg);
}

.site-title-link:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  flex: 0 0 auto;
  gap: 0.55rem;
}

.social-link {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #000000;
  background: #ffffff;
  box-shadow: 0 3px 8px rgb(15 23 42 / 12%);
  place-items: center;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.social-link:hover {
  border-color: #64748b;
  color: #000000;
  background: #ffffff;
  box-shadow: 0 5px 12px rgb(15 23 42 / 20%);
  transform: translateY(-2px);
}

.social-link img {
  display: block;
  max-width: 1.4rem;
  max-height: 1.4rem;
}

main {
  width: min(calc(100% - 2rem), var(--content-width));
  min-height: calc(100vh - 6rem);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) 0;
}

main > h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  letter-spacing: -0.04em;
}

.theme-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin: -0.25rem 0 2.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, var(--accent-soft));
}

.theme-picker label {
  font-size: 0.9rem;
  font-weight: 700;
}

.theme-picker select {
  min-width: min(100%, 16rem);
  padding: 0.5rem 2.25rem 0.5rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: var(--text);
  background-color: var(--surface);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.theme-picker select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
}

.document-hierarchy {
  display: grid;
  gap: 2.5rem;
}

.document-category {
  min-width: 0;
}

.category-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.category-title {
  margin: 0;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
}

.category-count {
  padding: 0.08rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
}

.category-children {
  display: grid;
  gap: 2rem;
  margin: 2rem 0 0 0.5rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
}

.category-children .category-title {
  font-size: 1.2rem;
}

.document-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.document-list > li {
  position: relative;
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: 0 4px 14px rgb(28 45 70 / 4%);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.document-list > li:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.document-list > li > a {
  font-size: 1.05rem;
  font-weight: 700;
}

.document-list > li > a::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
}

.document-list > li p {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.index-hosting-link {
  display: block;
  width: 200px;
  max-width: 100%;
  margin: 2.5rem 0 0;
}

.index-hosting-link:hover,
:root[data-theme] .index-hosting-link:hover {
  background: transparent;
}

.index-hosting-badge {
  display: block;
  width: 100%;
  height: auto;
}

.breadcrumbs {
  margin: -1rem 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.breadcrumbs li + li::before {
  color: var(--border-strong);
  content: "/";
}

.breadcrumbs [aria-current="page"] {
  color: var(--text);
}

article {
  padding: clamp(1.25rem, 4vw, 3.25rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

article > :first-child {
  margin-top: 0;
}

article > :last-child {
  margin-bottom: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  letter-spacing: -0.025em;
  scroll-margin-top: 2rem;
}

article h1 {
  margin-bottom: 1.25rem;
  font-size: clamp(1.6rem, 4.5vw, 2.35rem);
  letter-spacing: -0.05em;
}

.page-meta {
  margin: -0.45rem 0 2.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.page-meta time {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

article h2 {
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
}

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

article p,
article ul,
article ol,
article blockquote {
  max-width: 78ch;
}

article li + li {
  margin-top: 0.3rem;
}

article strong {
  font-weight: 700;
}

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

article blockquote {
  margin: 1.5rem 0;
  padding: 0.15rem 1rem;
  border-left: 4px solid var(--quote-border);
  color: var(--muted);
  background: var(--accent-soft);
}

code,
kbd,
pre {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-variant-ligatures: none;
}

:not(pre) > code {
  padding: 0.12em 0.35em;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: var(--inline-code-bg);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  margin: 1.4rem 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 9px;
  color: var(--code-text);
  background: var(--code-bg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%);
  font-size: 0.9rem;
  line-height: 1.6;
  tab-size: 4;
}

pre code {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
}

kbd {
  padding: 0.12rem 0.38rem;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  font-size: 0.85em;
}

table {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

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

th {
  color: var(--text);
  background: var(--accent-soft);
  font-weight: 700;
  white-space: nowrap;
}

tr:nth-child(even) td {
  background: var(--table-stripe);
}

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

th:last-child,
td:last-child {
  border-right: 0;
}

article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0b1120;
    --surface: #111a2b;
    --surface-raised: #111a2b;
    --text: #e7edf7;
    --muted: #a4b0c2;
    --accent: #69aff7;
    --accent-hover: #9bcbfb;
    --accent-soft: #162d49;
    --border: #27364c;
    --border-strong: #3c506c;
    --code-bg: #070b12;
    --code-text: #dce7f5;
    --inline-code-bg: #1b293d;
    --quote-border: #4d96df;
    --table-stripe: #0e1828;
    --shadow: 0 20px 50px rgb(0 0 0 / 22%);
  }

  body {
    background:
      radial-gradient(circle at top left, rgb(48 117 190 / 14%), transparent 32rem),
      var(--page);
  }

  .document-list > li {
    box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
  }
}

:root[data-theme="retro"] {
  color-scheme: dark;
  --page: #020604;
  --surface: #061009;
  --surface-raised: #07140c;
  --text: #a8f5ad;
  --muted: #64bb6d;
  --accent: #9dff75;
  --accent-hover: #e1ffc9;
  --accent-soft: #0c2513;
  --border: #226b31;
  --border-strong: #55c966;
  --code-bg: #010302;
  --code-text: #a8f5ad;
  --inline-code-bg: #0a1e10;
  --quote-border: #78e588;
  --table-stripe: #08170d;
  --shadow: 0 0 24px rgb(68 220 91 / 10%);
  --radius: 0;
  font-family: "Cascadia Mono", "Courier New", Courier, monospace;
  line-height: 1.55;
}

:root[data-theme="retro"] body {
  color: var(--text);
  background:
    radial-gradient(circle at 50% 15%, rgb(47 139 61 / 14%), transparent 38rem),
    linear-gradient(rgb(1 9 4 / 88%), rgb(1 5 3 / 96%)),
    var(--page);
  letter-spacing: 0.012em;
  text-shadow: 0 0 5px rgb(117 255 136 / 18%);
}

:root[data-theme="retro"] body::before {
  position: fixed;
  z-index: 9999;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgb(0 0 0 / 22%) 3px,
    rgb(0 0 0 / 22%) 4px
  );
  content: "";
}

:root[data-theme="retro"] a {
  text-decoration-style: dotted;
  text-shadow: 0 0 7px rgb(126 255 145 / 35%);
}

:root[data-theme="retro"] a:hover {
  color: var(--page);
  background: var(--accent);
  text-shadow: none;
}

:root[data-theme="retro"] header {
  border-bottom: 2px solid var(--border-strong);
  background: rgb(2 12 6 / 96%);
  box-shadow: 0 0 18px rgb(73 223 95 / 12%);
  backdrop-filter: none;
}

:root[data-theme="retro"] header h1 {
  font-size: clamp(1rem, 3vw, 1.25rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root[data-theme="retro"] .site-title-link::before {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  background: none;
  box-shadow: none;
  content: ">_";
  transform: none;
}

:root[data-theme="retro"] main > h2 {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

:root[data-theme="retro"] main > h2::before {
  color: var(--muted);
  content: "/HOME/ ";
}

:root[data-theme="retro"] .theme-picker {
  border-width: 1px 1px 1px 4px;
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}

:root[data-theme="retro"] .theme-picker label {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

:root[data-theme="retro"] .theme-picker label::before {
  color: var(--muted);
  content: "[CONFIG] ";
}

:root[data-theme="retro"] .theme-picker select {
  border-radius: 0;
  color: var(--accent);
  background-color: var(--code-bg);
}

:root[data-theme="retro"] .category-header {
  border-bottom-style: dashed;
}

:root[data-theme="retro"] .category-title {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

:root[data-theme="retro"] .category-title::before {
  color: var(--muted);
  content: "DIR ";
}

:root[data-theme="retro"] .category-count {
  border-radius: 0;
  color: var(--accent);
  background: transparent;
}

:root[data-theme="retro"] .category-children {
  border-left-style: dashed;
}

:root[data-theme="retro"] .document-list > li {
  border-color: var(--border);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgb(70 210 90 / 5%), transparent 55%),
    var(--surface-raised);
  box-shadow: none;
}

:root[data-theme="retro"] .document-list > li:hover {
  border-color: var(--accent);
  box-shadow: 4px 4px 0 var(--border);
  transform: translate(-2px, -2px);
}

:root[data-theme="retro"] .document-list > li > a::before {
  color: var(--muted);
  content: "> ";
}

:root[data-theme="retro"] .breadcrumbs li + li::before {
  content: ">";
}

:root[data-theme="retro"] article {
  border: 2px solid var(--border);
  background:
    linear-gradient(rgb(79 220 99 / 2%), rgb(79 220 99 / 2%)),
    var(--surface);
  box-shadow:
    inset 0 0 35px rgb(41 142 56 / 8%),
    var(--shadow);
}

:root[data-theme="retro"] article h1,
:root[data-theme="retro"] article h2,
:root[data-theme="retro"] article h3 {
  letter-spacing: 0.025em;
}

:root[data-theme="retro"] article h1::before {
  color: var(--muted);
  content: "$ ";
}

:root[data-theme="retro"] .page-meta::before {
  color: var(--muted);
  content: "[STAT] ";
}

:root[data-theme="retro"] article h2 {
  border-bottom-style: dashed;
}

:root[data-theme="retro"] article h2::before {
  color: var(--muted);
  content: "## ";
}

:root[data-theme="retro"] article blockquote {
  border-left-width: 2px;
  background: var(--accent-soft);
}

:root[data-theme="retro"] :not(pre) > code,
:root[data-theme="retro"] kbd,
:root[data-theme="retro"] pre,
:root[data-theme="retro"] table,
:root[data-theme="retro"] article img {
  border-radius: 0;
}

:root[data-theme="retro"] pre {
  border-color: var(--border);
  box-shadow: inset 0 0 18px rgb(62 199 82 / 8%);
}

:root[data-theme="retro"] th {
  color: var(--accent);
  background: var(--accent-soft);
}

:root[data-theme="retro"] * {
  scrollbar-color: var(--border-strong) var(--code-bg);
}

:root[data-theme="spectrum"] {
  color-scheme: dark;
  --page: #0000aa;
  --surface: #050505;
  --surface-raised: #050505;
  --text: #f7f7f7;
  --muted: #b8b8b8;
  --accent: #00ffff;
  --accent-hover: #ffff00;
  --accent-soft: #000066;
  --border: #ffffff;
  --border-strong: #00ffff;
  --code-bg: #000000;
  --code-text: #00ff00;
  --inline-code-bg: #000066;
  --quote-border: #ffff00;
  --table-stripe: #00005f;
  --shadow: 7px 7px 0 #000000;
  --radius: 0;
  font-family: "Cascadia Mono", "Courier New", Courier, monospace;
  line-height: 1.55;
}

:root[data-theme="spectrum"] body {
  background:
    linear-gradient(rgb(255 255 255 / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 3%) 1px, transparent 1px),
    var(--page);
  background-size: 8px 8px;
  letter-spacing: 0.015em;
  text-shadow: none;
  -webkit-font-smoothing: none;
}

:root[data-theme="spectrum"] header,
:root[data-theme="spectrum"] main > h2,
:root[data-theme="spectrum"] .theme-picker,
:root[data-theme="spectrum"] .category-header,
:root[data-theme="spectrum"] .document-list > li > a,
:root[data-theme="spectrum"] .breadcrumbs,
:root[data-theme="spectrum"] article h1,
:root[data-theme="spectrum"] article h2,
:root[data-theme="spectrum"] article h3,
:root[data-theme="spectrum"] th {
  font-family: "ZX Spectrum Web", "Cascadia Mono", "Courier New", monospace;
}

:root[data-theme="spectrum"] header h1,
:root[data-theme="spectrum"] .theme-picker label,
:root[data-theme="spectrum"] .category-title,
:root[data-theme="spectrum"] .category-count,
:root[data-theme="spectrum"] .document-list > li > a,
:root[data-theme="spectrum"] article h1,
:root[data-theme="spectrum"] article h2,
:root[data-theme="spectrum"] article h3,
:root[data-theme="spectrum"] th {
  font-weight: 400;
}

:root[data-theme="spectrum"] a {
  color: var(--accent);
  text-decoration-thickness: 2px;
  text-decoration-style: solid;
}

:root[data-theme="spectrum"] a:hover {
  color: #000000;
  background: var(--accent-hover);
}

:root[data-theme="spectrum"] a:focus-visible,
:root[data-theme="spectrum"] .theme-picker select:focus-visible {
  border-radius: 0;
  outline: 3px solid #ffff00;
  outline-offset: 3px;
}

:root[data-theme="spectrum"] header {
  position: relative;
  border-bottom: 12px solid #ffffff;
  background: #000000;
  box-shadow: none;
  backdrop-filter: none;
}

:root[data-theme="spectrum"] header::after {
  position: absolute;
  right: max(1rem, calc((100% - var(--content-width)) / 2));
  bottom: -12px;
  width: min(12rem, 42vw);
  height: 12px;
  background: linear-gradient(
    90deg,
    #ff0000 0 25%,
    #ffff00 25% 50%,
    #00c800 50% 75%,
    #0066ff 75% 100%
  );
  content: "";
  transform: skewX(-28deg);
  transform-origin: right bottom;
}

:root[data-theme="spectrum"] header h1 {
  font-size: clamp(1rem, 3vw, 1.25rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root[data-theme="spectrum"] .site-title-link {
  color: #ffffff;
}

:root[data-theme="spectrum"] .site-title-link::before {
  width: auto;
  height: auto;
  padding: 0.08rem 0.25rem;
  border: 0;
  border-radius: 0;
  color: #000000;
  background: #00ffff;
  box-shadow: none;
  content: "48K";
  transform: none;
}

:root[data-theme="spectrum"] main > h2 {
  display: inline-block;
  margin-bottom: 1.75rem;
  padding: 0.2rem 0.45rem;
  color: #000000;
  background: #ffff00;
  font-size: clamp(1.45rem, 5vw, 2.2rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

:root[data-theme="spectrum"] main > h2::before {
  content: "CAT ";
}

:root[data-theme="spectrum"] .theme-picker {
  border: 4px solid #ffffff;
  background: #000000;
  box-shadow: var(--shadow);
}

:root[data-theme="spectrum"] .theme-picker label {
  color: #ffff00;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

:root[data-theme="spectrum"] .theme-picker label::before {
  color: #00ffff;
  content: "PAPER 0: ";
}

:root[data-theme="spectrum"] .theme-picker select {
  border: 3px solid #00ffff;
  border-radius: 0;
  color: #ffffff;
  background: #000000;
}

:root[data-theme="spectrum"] .category-header {
  border-bottom: 3px solid #00ffff;
}

:root[data-theme="spectrum"] .category-title {
  color: #00ffff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

:root[data-theme="spectrum"] .category-title::before {
  color: #ffff00;
  content: "[";
}

:root[data-theme="spectrum"] .category-title::after {
  color: #ffff00;
  content: "]";
}

:root[data-theme="spectrum"] .category-count {
  border: 0;
  border-radius: 0;
  color: #000000;
  background: #00ffff;
}

:root[data-theme="spectrum"] .category-children {
  border-left: 4px solid #ff00ff;
}

:root[data-theme="spectrum"] .document-list > li {
  border: 4px solid #ffffff;
  border-radius: 0;
  background: #000000;
  box-shadow: 5px 5px 0 #000000;
}

:root[data-theme="spectrum"] .document-list > li:hover {
  border-color: #ffff00;
  box-shadow:
    5px 5px 0 #ff00ff,
    10px 10px 0 #00ffff;
  transform: translate(-3px, -3px);
}

:root[data-theme="spectrum"] .document-list > li > a {
  color: #ffff00;
}

:root[data-theme="spectrum"] .document-list > li > a::before {
  color: #00ffff;
  content: "LOAD ";
}

:root[data-theme="spectrum"] .document-list > li p {
  color: #ffffff;
}

:root[data-theme="spectrum"] .breadcrumbs {
  color: #ffffff;
}

:root[data-theme="spectrum"] .breadcrumbs li + li::before {
  color: #ffff00;
  content: "»";
}

:root[data-theme="spectrum"] article {
  border: 8px solid #ffffff;
  background: #000000;
  box-shadow: var(--shadow);
}

:root[data-theme="spectrum"] article h1 {
  color: #ffff00;
  letter-spacing: 0.02em;
}

:root[data-theme="spectrum"] .page-meta {
  border-bottom: 3px solid #ff00ff;
  color: #ffffff;
  font-family: "ZX Spectrum Web", "Cascadia Mono", "Courier New", monospace;
}

:root[data-theme="spectrum"] .page-meta time {
  color: #00ffff;
}

:root[data-theme="spectrum"] article h2 {
  border-bottom: 3px solid #00ffff;
  color: #00ffff;
}

:root[data-theme="spectrum"] article h3 {
  color: #00ff00;
}

:root[data-theme="spectrum"] article blockquote {
  border-left: 6px solid #ffff00;
  color: #ffffff;
  background: #000066;
}

:root[data-theme="spectrum"] :not(pre) > code {
  border: 2px solid #00ffff;
  border-radius: 0;
  color: #ffff00;
  background: #000066;
}

:root[data-theme="spectrum"] pre {
  border: 4px solid #00ff00;
  border-radius: 0;
  color: #00ff00;
  background: #000000;
  box-shadow: none;
}

:root[data-theme="spectrum"] kbd {
  border-radius: 0;
  color: #000000;
  background: #ffffff;
}

:root[data-theme="spectrum"] table {
  border: 4px solid #ffffff;
  border-radius: 0;
  background: #000000;
}

:root[data-theme="spectrum"] th {
  color: #000000;
  background: #00ffff;
}

:root[data-theme="spectrum"] tr:nth-child(even) td {
  background: var(--table-stripe);
}

:root[data-theme="spectrum"] article img {
  border: 4px solid #ffffff;
  border-radius: 0;
  image-rendering: pixelated;
}

:root[data-theme="spectrum"] * {
  scrollbar-color: #00ffff #000000;
}

:root[data-theme="c64"] {
  color-scheme: dark;
  --page: #6c5eb5;
  --surface: #352879;
  --surface-raised: #352879;
  --text: #d8d2ff;
  --muted: #aaa1e3;
  --accent: #ffffff;
  --accent-hover: #b8c76f;
  --accent-soft: #40339a;
  --border: #b8b0ee;
  --border-strong: #ffffff;
  --code-bg: #21185e;
  --code-text: #9ad284;
  --inline-code-bg: #21185e;
  --quote-border: #b8c76f;
  --table-stripe: #40339a;
  --shadow: 7px 7px 0 #21185e;
  --radius: 0;
  font-family: "Sixtyfour Web", "Cascadia Mono", "Courier New", Courier, monospace;
  line-height: 1.7;
}

:root[data-theme="c64"] body {
  background:
    repeating-linear-gradient(
      0deg,
      rgb(255 255 255 / 2%) 0,
      rgb(255 255 255 / 2%) 2px,
      transparent 2px,
      transparent 4px
    ),
    var(--page);
  letter-spacing: 0.025em;
  -webkit-font-smoothing: none;
}

:root[data-theme="c64"] a {
  color: var(--accent);
  text-decoration-style: solid;
  text-transform: uppercase;
}

:root[data-theme="c64"] a:hover {
  color: var(--surface);
  background: var(--accent-hover);
}

:root[data-theme="c64"] a:focus-visible,
:root[data-theme="c64"] .theme-picker select:focus-visible {
  border-radius: 0;
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

:root[data-theme="c64"] header {
  border: 0;
  border-bottom: 10px solid var(--page);
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
}

:root[data-theme="c64"] header h1 {
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root[data-theme="c64"] .site-title-link {
  color: var(--text);
}

:root[data-theme="c64"] .site-title-link::before {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  color: var(--surface);
  background: var(--text);
  box-shadow: none;
  content: "READY.";
  transform: none;
}

:root[data-theme="c64"] main > h2,
:root[data-theme="c64"] main > p {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

:root[data-theme="c64"] main > h2 {
  margin-bottom: 1.75rem;
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root[data-theme="c64"] main > h2::before {
  content: "LIST ";
}

:root[data-theme="c64"] .theme-picker {
  border: 5px solid var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

:root[data-theme="c64"] .theme-picker label {
  color: var(--text);
  font-weight: 400;
  text-transform: uppercase;
}

:root[data-theme="c64"] .theme-picker label::before {
  color: #9ad284;
  content: "POKE 53281,";
}

:root[data-theme="c64"] .theme-picker select {
  border: 3px solid var(--text);
  border-radius: 0;
  color: var(--text);
  background: var(--code-bg);
  text-transform: uppercase;
}

:root[data-theme="c64"] .document-hierarchy {
  counter-reset: c64-index-section;
}

:root[data-theme="c64"] .category-header {
  padding: 0.55rem 0.75rem;
  border: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--code-bg);
}

:root[data-theme="c64"] .category-title {
  color: var(--text);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  counter-increment: c64-index-section 10;
}

:root[data-theme="c64"] .category-title::before {
  color: #9ad284;
  content: counter(c64-index-section) " ";
}

:root[data-theme="c64"] .category-count {
  border: 0;
  border-radius: 0;
  color: var(--surface);
  background: var(--text);
  font-weight: 400;
  text-transform: uppercase;
}

:root[data-theme="c64"] .category-children {
  border-left: 5px solid var(--surface);
}

:root[data-theme="c64"] .document-list > li {
  border: 5px solid var(--text);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

:root[data-theme="c64"] .document-list > li:hover {
  border-color: #b8c76f;
  box-shadow:
    7px 7px 0 #6f3d86,
    12px 12px 0 #70a4b2;
  transform: translate(-3px, -3px);
}

:root[data-theme="c64"] .document-list > li > a {
  color: #ffffff;
  font-weight: 400;
}

:root[data-theme="c64"] .document-list > li > a::before {
  color: #9ad284;
  content: "LOAD ";
}

:root[data-theme="c64"] .document-list > li p {
  color: var(--text);
}

:root[data-theme="c64"] .breadcrumbs {
  padding: 0.4rem 0.6rem;
  color: var(--text);
  background: var(--surface);
}

:root[data-theme="c64"] .breadcrumbs li + li::before {
  color: #9ad284;
  content: ">";
}

:root[data-theme="c64"] article {
  border: 10px solid var(--text);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  counter-reset: c64-section 20;
}

:root[data-theme="c64"] article h1,
:root[data-theme="c64"] article h2,
:root[data-theme="c64"] article h3 {
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

:root[data-theme="c64"] article h1 {
  color: #ffffff;
}

:root[data-theme="c64"] article h1::before {
  display: block;
  margin-bottom: 0.65rem;
  color: #9ad284;
  content: "READY.";
  font-size: 0.45em;
}

:root[data-theme="c64"] .page-meta {
  border-bottom: 3px solid var(--text);
  color: var(--text);
  text-transform: uppercase;
}

:root[data-theme="c64"] .page-meta::before {
  color: #9ad284;
  content: "20 ";
}

:root[data-theme="c64"] .page-meta time {
  color: #ffffff;
}

:root[data-theme="c64"] article h2 {
  border-bottom: 3px solid var(--text);
  color: var(--text);
  counter-increment: c64-section 10;
}

:root[data-theme="c64"] article h2::before {
  color: #9ad284;
  content: counter(c64-section) " ";
}

:root[data-theme="c64"] article h3 {
  color: #70a4b2;
}

:root[data-theme="c64"] article blockquote {
  border-left: 6px solid #b8c76f;
  color: #ffffff;
  background: var(--code-bg);
}

:root[data-theme="c64"] :not(pre) > code {
  border: 2px solid var(--text);
  border-radius: 0;
  color: #9ad284;
  background: var(--code-bg);
}

:root[data-theme="c64"] pre {
  border: 5px solid var(--text);
  border-radius: 0;
  color: var(--code-text);
  background: var(--code-bg);
  box-shadow: none;
}

:root[data-theme="c64"] kbd {
  border-radius: 0;
  color: var(--surface);
  background: var(--text);
}

:root[data-theme="c64"] table {
  border: 5px solid var(--text);
  border-radius: 0;
  color: var(--text);
  background: var(--surface);
}

:root[data-theme="c64"] th {
  color: var(--surface);
  background: var(--text);
  font-weight: 400;
}

:root[data-theme="c64"] tr:nth-child(even) td {
  background: var(--table-stripe);
}

:root[data-theme="c64"] article img {
  border: 5px solid var(--text);
  border-radius: 0;
  image-rendering: pixelated;
}

:root[data-theme="c64"] * {
  scrollbar-color: var(--text) var(--surface);
}

:root[data-theme] .social-link,
:root[data-theme] .social-link:hover {
  color: #000000;
  background: #ffffff;
  text-shadow: none;
  text-transform: none;
}

:root[data-theme="retro"] .social-link,
:root[data-theme="spectrum"] .social-link,
:root[data-theme="c64"] .social-link {
  border-radius: 0;
}

.site-footer {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
  padding: 1rem 0 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 0.35rem;
}

:root[data-theme="spectrum"] .site-footer {
  border-top: 4px solid #ffffff;
  color: #ffffff;
  font-family: "ZX Spectrum Web", "Cascadia Mono", "Courier New", monospace;
}

:root[data-theme="c64"] .site-footer {
  border-top: 5px solid var(--text);
  color: var(--text);
  background: var(--surface);
  text-transform: uppercase;
}

@media (max-width: 40rem) {
  .site-header-inner,
  main,
  .site-footer {
    width: min(calc(100% - 1.25rem), var(--content-width));
  }

  .site-header-inner {
    gap: 0.5rem 0.75rem;
  }

  header h1 {
    flex: 1 1 13rem;
  }

  main {
    padding: 1.5rem 0 2.5rem;
  }

  article {
    padding: 1.15rem;
  }

  article h1 {
    overflow-wrap: anywhere;
  }

  .theme-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .theme-picker select {
    width: 100%;
  }

  th,
  td {
    padding: 0.55rem 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .document-list > li {
    transition: none;
  }
}

@media print {
  :root,
  :root[data-theme="retro"],
  :root[data-theme="spectrum"],
  :root[data-theme="c64"] {
    color-scheme: light;
    --page: #ffffff;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --text: #000000;
    --muted: #333333;
    --accent: #000000;
    --accent-soft: #ffffff;
    --border: #bbbbbb;
    --shadow: none;
    font-family: ui-sans-serif, system-ui, sans-serif;
  }

  header {
    display: none;
  }

  .theme-picker {
    display: none;
  }

  .site-footer {
    display: none;
  }

  main {
    width: 100%;
    padding: 0;
  }

  article {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  pre,
  table,
  blockquote {
    break-inside: avoid;
  }

  :root[data-theme="retro"] body {
    background: #ffffff;
    letter-spacing: normal;
    text-shadow: none;
  }

  :root[data-theme="spectrum"] body {
    background: #ffffff;
    letter-spacing: normal;
    -webkit-font-smoothing: antialiased;
  }

  :root[data-theme="c64"] body {
    background: #ffffff;
    letter-spacing: normal;
    -webkit-font-smoothing: antialiased;
  }

  :root[data-theme="retro"] article,
  :root[data-theme="spectrum"] article,
  :root[data-theme="c64"] article {
    padding: 0;
    border: 0;
    color: #000000;
    background: #ffffff;
    box-shadow: none;
  }

  :root[data-theme="spectrum"] main > h2,
  :root[data-theme="spectrum"] article h1,
  :root[data-theme="spectrum"] article h2,
  :root[data-theme="spectrum"] article h3,
  :root[data-theme="c64"] main > h2,
  :root[data-theme="c64"] article h1,
  :root[data-theme="c64"] article h2,
  :root[data-theme="c64"] article h3 {
    color: #000000;
    background: transparent;
  }

  :root[data-theme="retro"] pre,
  :root[data-theme="spectrum"] pre,
  :root[data-theme="c64"] pre {
    border: 1px solid #bbbbbb;
    color: #000000;
    background: #ffffff;
    box-shadow: none;
  }

  :root[data-theme="retro"] body::before {
    display: none;
  }

  :root[data-theme="retro"] main > h2::before,
  :root[data-theme="retro"] article h1::before,
  :root[data-theme="retro"] article h2::before,
  :root[data-theme="spectrum"] main > h2::before,
  :root[data-theme="spectrum"] .category-title::before,
  :root[data-theme="spectrum"] .category-title::after,
  :root[data-theme="spectrum"] .document-list > li > a::before,
  :root[data-theme="c64"] main > h2::before,
  :root[data-theme="c64"] .category-title::before,
  :root[data-theme="c64"] .document-list > li > a::before,
  :root[data-theme="c64"] article h1::before,
  :root[data-theme="c64"] article h2::before {
    content: none;
  }
}
