@font-face {
  font-family: "Caveat";
  src: url("/assets/fonts/caveat-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Patrick Hand";
  src: url("/assets/fonts/patrick-hand-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("/assets/fonts/courier-prime-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("/assets/fonts/courier-prime-bold-latin.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: "Patrick Hand", "Comic Sans MS", "Segoe Print", cursive;
  --font-serif: "Caveat", "Patrick Hand", cursive;
  --font-mono: "Courier Prime", "Courier New", monospace;
  --site-font-family: var(--font-sans);
  --display-font-family: var(--font-serif);
  --code-font-family: var(--font-mono);

  --paper: #f5eedc;
  --paper-light: #fdf8ec;
  --paper-dark: #ece2cc;
  --ink: #2c2823;
  --ink-soft: #5c5448;
  --ink-faded: #857a68;
  --rule: rgba(70, 80, 95, 0.14);
  --rule-strong: rgba(70, 80, 95, 0.28);
  --pen-blue: #2f5a86;
  --pen-red: #a33a2e;
  --pen-green: #466a49;
  --tape: rgba(226, 213, 168, 0.72);
  --width: 54rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      var(--rule) 31px,
      var(--rule) 32px
    );
  background-attachment: fixed;
  font-family: var(--font-sans);
  font-size: 19px;
  line-height: 1.78;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--ink);
  background: rgba(255, 213, 92, 0.55);
}

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

a:hover {
  color: var(--pen-red);
  text-decoration-style: wavy;
  text-decoration-thickness: 1.5px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: 0.01em;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  font-style: normal;
  margin: 0 0 0.6rem;
}

h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.15rem);
  margin: 2.2rem 0 0.7rem;
}

h3 {
  font-family: var(--font-sans);
  font-size: 1.22rem;
  font-weight: 400;
  margin: 1.8rem 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

hr {
  border: 0;
  border-top: 2px dashed var(--rule-strong);
  margin: 2.2rem 0;
}

img {
  max-width: 100%;
  height: auto;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
}

.container {
  max-width: var(--width);
  margin: 0 auto;
  padding: 2.2rem 1.5rem 4.5rem;
}

.wrapper {
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 100;
  padding: 0.45rem 0.8rem;
  border: 1px dashed var(--ink);
  background: var(--paper-light);
  color: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: relative;
  border-bottom: 1px dashed var(--rule-strong);
  padding: 2rem 1rem 1.1rem;
  background: transparent;
}

.nav-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.5rem;
}

.site-title {
  justify-self: auto;
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 7vw, 3.8rem);
  font-weight: 700;
  font-style: normal;
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  transform: rotate(-1.5deg);
}

.site-title:hover {
  color: var(--pen-red);
  text-decoration: none;
}

.site-title::after {
  content: "";
  display: block;
  width: 108%;
  height: 7px;
  margin: -2px 0 0 -4%;
  background: var(--pen-blue);
  opacity: 0.35;
  clip-path: polygon(0 45%, 8% 20%, 22% 55%, 38% 15%, 55% 60%, 72% 20%, 88% 55%, 100% 30%, 100% 100%, 0 100%);
}

.site-tagline {
  margin: 0.5rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.28rem;
  color: var(--ink-faded);
  transform: rotate(-0.4deg);
}

.site-nav {
  justify-self: auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.1rem 0.55rem;
  margin-top: 0.35rem;
  font-size: 1.02rem;
}

.site-nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.1rem 0.55rem;
}

.page-link {
  padding: 0;
  border-radius: 0;
  color: var(--pen-blue);
  font-size: 1.02rem;
  font-weight: 400;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  opacity: 1;
}

.page-link:hover {
  background: transparent;
  color: var(--pen-red);
  text-decoration-style: wavy;
}

.nav-sep {
  color: var(--ink-faded);
  opacity: 0.7;
  user-select: none;
}

.header-actions,
.theme-toggle,
.nav-toggle,
.nav-close,
.nav-backdrop,
.header-live,
.privacy-consent-dialog,
#policy-banner,
.discord-presence-card,
.privacy-choices-link {
  display: none !important;
}

html[data-theme="light"] .discuss-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  background: #5865f2;
  border-bottom: 2px solid var(--ink);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  text-align: center;
  padding: 0.55rem 1rem;
}

.discord-strip-icon {
  display: inline-flex;
  color: #fff;
}

html[data-theme="light"] .discuss-strip .discord-widget-popover > summary {
  gap: 0.25rem 0.55rem;
  color: #fff;
}

html[data-theme="light"] .discuss-strip .discord-widget-popover > summary:hover strong {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 3px;
}

html[data-theme="light"] .discuss-strip #discord-server-online {
  opacity: 0.82;
}

html[data-theme="light"] .discuss-strip .discord-widget-hint {
  padding: 0.08rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.9;
}

html[data-theme="light"] .discuss-strip a {
  color: #fff;
}

@media (max-width: 520px) {
  html[data-theme="light"] .discuss-strip {
    gap: 0.4rem;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }

  html[data-theme="light"] .discuss-strip .discord-widget-hint {
    display: none;
  }
}

.halloween-note {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 -0.15rem;
  color: #b9470d;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.halloween-note img {
  width: 1.5em;
  height: auto;
  transform: rotate(-8deg);
}

/* The seasonal switch scopes the palette and decorations to Halloween. */
html[data-seasonal="halloween"] {
  color-scheme: dark;
  --paper: #17131d;
  --paper-light: #211a29;
  --paper-dark: #100d15;
  --ink: #f5ebd6;
  --ink-soft: #d0c2a8;
  --ink-faded: #a79780;
  --rule: rgba(198, 165, 255, 0.14);
  --rule-strong: rgba(198, 165, 255, 0.32);
  --pen-blue: #c6a5ff;
  --pen-red: #ff8b3e;
  --pen-green: #b3bf7a;
  --tape: rgba(79, 56, 91, 0.65);
  --halloween-color: #ff8b3e;
}

html[data-seasonal="halloween"] body {
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 12% 0%, rgba(111, 58, 141, 0.22), transparent 42rem),
    radial-gradient(ellipse at 92% 8%, rgba(198, 83, 27, 0.16), transparent 38rem),
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--rule) 31px, var(--rule) 32px);
  color: var(--ink);
}

html[data-seasonal="halloween"] body .site-header {
  border-bottom-color: rgba(255, 139, 62, 0.38);
}

html[data-seasonal="halloween"] body .site-title::after {
  background: var(--pen-red);
  opacity: 0.55;
}

html[data-seasonal="halloween"] body .halloween-note {
  color: var(--pen-red);
}

html[data-seasonal="halloween"] body .post-list .card {
  border-color: var(--rule-strong);
  background: rgba(35, 27, 43, 0.82);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 139, 62, 0.035);
}

html[data-seasonal="halloween"] body .related-card,
html[data-seasonal="halloween"] body .archive-entry,
html[data-seasonal="halloween"] body .tag-item,
html[data-seasonal="halloween"] body .toc,
html[data-seasonal="halloween"] body .series-box,
html[data-seasonal="halloween"] body .about-author,
html[data-seasonal="halloween"] body .chart-card,
html[data-seasonal="halloween"] body .comment,
html[data-seasonal="halloween"] body .comment-form,
html[data-seasonal="halloween"] body .locked-panel {
  border-color: var(--rule-strong);
  background-color: rgba(35, 27, 43, 0.82);
  color: var(--ink);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}

html[data-seasonal="halloween"] body .tag-item:hover,
html[data-seasonal="halloween"] body .related-card:hover {
  border-color: rgba(255, 139, 62, 0.62);
  background-color: rgba(104, 53, 40, 0.3);
}

html[data-seasonal="halloween"] body .section-title {
  border-bottom-color: var(--pen-red);
}

html[data-seasonal="halloween"] body .button,
html[data-seasonal="halloween"] body button,
html[data-seasonal="halloween"] body input[type="submit"] {
  border-color: rgba(255, 139, 62, 0.58);
}

.halloween-cobweb {
  position: absolute;
  top: 0.15rem;
  left: 0.25rem;
  width: 118px;
  height: auto;
  opacity: 0.42;
  pointer-events: none;
}

.halloween-bat {
  position: absolute;
  z-index: 2;
  top: -1.8rem;
  right: 2.5rem;
  width: 74px;
  height: auto;
  opacity: 0.9;
  pointer-events: none;
  animation: halloween-hover 5s ease-in-out infinite;
}

@keyframes halloween-hover {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(-6px) rotate(2deg);
  }
}

@media (max-width: 720px) {
  .halloween-cobweb {
    width: 88px;
    opacity: 0.32;
  }

  .halloween-bat {
    top: -1.3rem;
    right: 1rem;
    width: 58px;
  }
}

@media (max-width: 520px) {
  .halloween-cobweb {
    display: none;
  }

  .halloween-bat {
    top: -1.1rem;
    right: 0.5rem;
    width: 48px;
  }

  .halloween-note {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .halloween-bat {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Home / hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  margin: 1rem 0 2.8rem;
}

.hero::after {
  content: "";
  display: block;
  clear: both;
}

.hero-photo {
  float: right;
  width: 190px;
  height: auto;
  margin: 0.2rem 0 1rem 1.6rem;
  padding: 8px 8px 22px;
  background: var(--paper-light);
  border: 1px solid var(--rule-strong);
  box-shadow: 3px 4px 0 rgba(70, 60, 40, 0.12);
  transform: rotate(2.2deg);
  image-rendering: auto;
}

.hero h1 {
  max-width: 42rem;
}

.hero h1 strong {
  font-weight: 700;
  text-decoration: underline wavy rgba(163, 58, 46, 0.45);
  text-underline-offset: 5px;
}

.hero h2 {
  margin-top: 2rem;
}

.hero h2::before {
  content: "## ";
  color: var(--pen-red);
  opacity: 0.7;
}

.hero ul {
  list-style: none;
  padding-left: 0.2rem;
}

.hero li {
  position: relative;
  padding-left: 1.25rem;
  margin: 0.15rem 0;
}

.hero li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--pen-red);
}

.sign-off {
  margin-top: 2rem;
  text-align: right;
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--pen-blue);
  transform: rotate(-1deg);
}

.section-title {
  margin-top: 0;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid var(--ink);
  display: inline-block;
  transform: rotate(-0.4deg);
}

.section-title::before {
  content: "~ ";
  color: var(--pen-red);
}

/* --------------------------------------------------------------------------
   Post list
   -------------------------------------------------------------------------- */

.post-list {
  display: block;
  margin-top: 0.4rem;
}

.card {
  margin: 0;
  padding: 1.35rem 0 1.5rem;
  border: 0;
  border-bottom: 1px dashed var(--rule-strong);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.card:last-child {
  border-bottom: 0;
}

.card h2 {
  margin: 0.3rem 0 0.4rem;
  font-size: clamp(1.65rem, 4vw, 2.05rem);
}

.card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.card h2 a:hover {
  color: var(--pen-blue);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 4px;
}

.card p {
  margin-bottom: 0.55rem;
  color: var(--ink-soft);
}

.card .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--ink-faded);
}

.platform-stamp {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border: 1px dashed var(--pen-red);
  color: var(--pen-red);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transform: rotate(-2deg);
  opacity: 0.9;
}

.badge {
  padding: 0.02rem 0.45rem;
  border: 1px dashed currentColor;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  transform: rotate(1deg);
}

.badge.active {
  color: var(--pen-red);
}

.badge.retired {
  color: var(--pen-green);
}

.htb-card-machine {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.8rem 0 0.9rem;
}

.htb-card-machine > img {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  padding: 4px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--paper-light);
  object-fit: cover;
  transform: rotate(-1.5deg);
}

.htb-card-machine strong {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
}

.htb-card-details {
  display: flex;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faded);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.8rem;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faded);
}

.card-meta a {
  color: inherit;
}

.card-meta a:hover {
  color: var(--pen-red);
}

.button {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  border: 1px dashed var(--ink);
  border-radius: 2px;
  background: var(--paper-light);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.22rem;
  text-decoration: none;
  transform: rotate(-0.6deg);
  cursor: pointer;
}

.button:hover {
  border-color: var(--pen-red);
  color: var(--pen-red);
  background: rgba(255, 213, 92, 0.25);
  text-decoration: none;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.85rem;
  margin: 2.4rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--rule-strong);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.pagination .page-link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-decoration: underline;
}

.pagination .page-link.is-active {
  color: var(--pen-red);
  font-weight: 700;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Article
   -------------------------------------------------------------------------- */

.post {
  max-width: 100%;
  margin: 0 auto;
}

.post-header {
  margin-bottom: 1.8rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--rule-strong);
}

.post-header h1 {
  margin: 0.45rem 0 0.6rem;
}

.post-platform {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pen-red);
}

.post-platform img {
  width: 20px;
  height: 20px;
  padding: 1px;
  background: var(--paper-light);
  object-fit: contain;
}

.lead {
  margin: 0 0 0.8rem;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 1.6rem);
  line-height: 1.35;
  color: var(--ink-soft);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faded);
}

.post-author strong {
  color: var(--pen-blue);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Long-form prose
   -------------------------------------------------------------------------- */

.prose {
  max-width: 100%;
  font-size: 1.06rem;
  line-height: 1.85;
  color: var(--ink);
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin: 2.6rem 0 0.7rem;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid rgba(44, 40, 35, 0.75);
}

.prose h2::before {
  content: "## ";
  color: var(--pen-red);
  opacity: 0.75;
}

.prose h3 {
  margin: 2rem 0 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
}

.prose h3::before {
  content: "### ";
  color: var(--pen-red);
  opacity: 0.6;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  vertical-align: middle;
}

.prose ul,
.prose ol {
  padding-left: 1.5rem;
}

.prose li {
  margin: 0.25rem 0;
}

.prose li::marker {
  color: var(--pen-red);
}

.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.6rem 1.1rem;
  border-left: 3px solid var(--pen-red);
  background: rgba(255, 255, 255, 0.25);
  color: var(--ink-soft);
  font-style: italic;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--pen-blue);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--pen-red);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

/* Polaroid-style screenshots */
.post-figure {
  position: relative;
  margin: 2.2rem auto;
  padding: 0;
  text-align: center;
}

.post-figure picture {
  display: inline-block;
  max-width: 100%;
}

.post-figure img {
  max-width: 100%;
  height: auto;
  padding: 9px;
  border: 1px solid var(--rule-strong);
  background: var(--paper-light);
  box-shadow: 3px 4px 0 rgba(70, 60, 40, 0.13);
  transform: rotate(-0.8deg);
}

.post-figure:nth-of-type(even) img {
  transform: rotate(0.8deg);
}

.post-figure::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  z-index: 2;
  width: 78px;
  height: 20px;
  margin-left: -39px;
  background: var(--tape);
  border-left: 1px dashed rgba(120, 105, 70, 0.25);
  border-right: 1px dashed rgba(120, 105, 70, 0.25);
  transform: rotate(-2deg);
  pointer-events: none;
}

.post-figure figcaption {
  margin-top: 0.65rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink-faded);
}

/* Code */
.prose pre {
  overflow-x: auto;
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--rule-strong);
  border-radius: 2px;
  background: #fbf5e3;
  color: #332f28;
  font-size: 0.86rem;
  line-height: 1.62;
}

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

.code-window {
  margin: 1.8rem 0;
  border: 1px dashed var(--rule-strong);
  border-radius: 2px;
  background: #fbf5e3;
  box-shadow: none;
  overflow: hidden;
}

.code-window-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.8rem;
  border-bottom: 1px dashed var(--rule-strong);
  background: rgba(226, 213, 168, 0.3);
}

.code-window-dots {
  display: none;
}

.code-window-lang {
  margin-left: 0;
  color: var(--ink-faded);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.code-window pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.code-window-bar .copy-btn {
  margin-left: auto;
  padding: 0.05rem 0.5rem;
  border: 1px dashed var(--rule-strong);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  color: var(--ink-faded);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  cursor: pointer;
}

.code-window-bar .copy-btn:hover {
  border-color: var(--pen-blue);
  color: var(--pen-blue);
}

.code-window-bar .copy-btn.copied {
  border-color: var(--pen-green);
  background: rgba(70, 106, 73, 0.12);
  color: var(--pen-green);
}

.prose :not(pre) > code {
  padding: 0.05em 0.35em;
  border: 1px dashed rgba(70, 60, 40, 0.35);
  border-radius: 2px;
  background: rgba(255, 213, 92, 0.22);
  color: #6b3d2a;
  font-size: 0.86em;
  white-space: nowrap;
}

/* Tables on ledger paper */
.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1.6rem 0;
  overflow-x: auto;
  border: 1px solid var(--ink);
  border-radius: 0;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.22);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
}

.prose thead {
  background: rgba(226, 213, 168, 0.45);
}

.prose th {
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem;
}

.prose th,
.prose td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px dashed var(--rule-strong);
  border-right: 1px dashed var(--rule-strong);
  vertical-align: top;
}

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

.prose tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.2);
}

.prose tbody tr:hover {
  background: rgba(255, 213, 92, 0.18);
}

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

/* Small syntax palette for the server-side highlighter */
.hljs-comment,
.hljs-quote {
  color: #7d7466;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal {
  color: #8a3b6b;
}

.hljs-string,
.hljs-doctag,
.hljs-regexp {
  color: #3d6b3f;
}

.hljs-number {
  color: #a35a2a;
}

.hljs-title,
.hljs-section,
.hljs-name {
  color: #2f5a86;
}

.hljs-attr,
.hljs-attribute,
.hljs-variable,
.hljs-template-variable {
  color: #6a4a8a;
}

.hljs-built_in,
.hljs-type,
.hljs-selector-class {
  color: #8a5a2b;
}

.hljs-symbol,
.hljs-bullet,
.hljs-link {
  color: #a33a2e;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 700;
}

/* Table of contents / series */
.toc {
  margin: 1.4rem 0 1.8rem;
  padding: 0.2rem 1rem;
  border: 1px dashed var(--rule-strong);
  background: rgba(255, 255, 255, 0.18);
}

.toc details summary {
  padding: 0.45rem 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  cursor: pointer;
}

.toc ul {
  margin: 0.2rem 0 0.6rem;
  padding-left: 1.2rem;
}

.toc li {
  margin: 0.15rem 0;
}

.toc li.toc-level-3 {
  margin-left: 1rem;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline wavy;
}

.series-box {
  margin: 1.4rem 0;
  padding: 0.8rem 1.1rem;
  border: 1px dashed var(--rule-strong);
  background: rgba(255, 255, 255, 0.18);
}

.series-box h2 {
  margin-top: 0;
  font-size: 1.7rem;
}

.series-list {
  padding-left: 1.2rem;
}

.series-current {
  font-weight: 700;
  color: var(--pen-red);
}

/* Author / share / related / post nav */
.about-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.6rem 0 1.4rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--rule-strong);
  background: rgba(255, 255, 255, 0.2);
}

.about-author img {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--paper-light);
  object-fit: cover;
  transform: rotate(-2deg);
}

.about-author p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.9rem;
  margin: 1.8rem 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faded);
}

.share-buttons span {
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.related {
  margin: 2.4rem 0;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.9rem;
}

.related-card {
  padding: 0.8rem 0.9rem;
  border: 1px dashed var(--rule-strong);
  background: rgba(255, 255, 255, 0.2);
  color: var(--ink);
  text-decoration: none;
  transform: rotate(-0.4deg);
}

.related-card:nth-child(even) {
  transform: rotate(0.4deg);
}

.related-card:hover {
  color: var(--pen-red);
  background: rgba(255, 213, 92, 0.16);
  text-decoration: none;
}

.related-card h3 {
  margin: 0 0 0.3rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tags-badge {
  padding: 0.02rem 0.35rem;
  border: 1px dashed var(--rule-strong);
  color: var(--ink-faded);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.2rem 0 0;
  padding: 1rem 0;
  border-top: 1px dashed var(--rule-strong);
  border-bottom: 1px dashed var(--rule-strong);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
}

.post-nav-older {
  text-align: right;
  margin-left: auto;
}

.post-nav-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faded);
}

.post-nav-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--pen-blue);
}

.post-nav-link:hover .post-nav-title {
  color: var(--pen-red);
  text-decoration: underline wavy;
}

/* --------------------------------------------------------------------------
   Machine banner
   -------------------------------------------------------------------------- */

.machine-banner {
  position: relative;
  min-height: 190px;
  margin: 1.6rem 0;
  padding: 1.4rem;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  background: var(--paper-dark);
}

.machine-banner-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: sepia(0.25) contrast(0.95);
}

.machine-banner-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(245, 238, 220, 0.92), rgba(245, 238, 220, 0.2));
}

.machine-banner-inner {
  position: relative;
  z-index: 1;
}

.machine-name {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  color: var(--ink);
}

.machine-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.machine-watermark {
  position: absolute;
  right: 1rem;
  bottom: -1.4rem;
  font-family: var(--font-serif);
  font-size: 9rem;
  line-height: 1;
  color: rgba(44, 40, 35, 0.12);
}

.machine-completion {
  display: block;
  max-width: 100%;
  margin: 1rem auto;
  padding: 8px;
  border: 1px solid var(--rule-strong);
  background: var(--paper-light);
}

/* --------------------------------------------------------------------------
   Archive / tags / search
   -------------------------------------------------------------------------- */

.page {
  max-width: 100%;
}

.page > h1 {
  display: inline-block;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid var(--ink);
  transform: rotate(-0.5deg);
}

.archive-list {
  margin-top: 1.6rem;
}

.archive-entry {
  padding: 0.9rem 0;
  border: 0;
  border-bottom: 1px dashed var(--rule-strong);
  background: transparent;
}

.archive-entry h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: 1.9rem;
}

.archive-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--pen-red);
  vertical-align: middle;
}

.archive-posts {
  margin: 0;
  padding-left: 1.1rem;
}

.archive-posts li {
  margin: 0.2rem 0;
}

.archive-posts time {
  display: inline-block;
  min-width: 3.2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faded);
}

.archive-author,
.archive-platform,
.archive-readtime {
  margin-left: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faded);
}

.chart-card {
  margin: 1.4rem 0 2rem;
  padding: 0.9rem 1.1rem;
  border: 1px dashed var(--rule-strong);
  background: rgba(255, 255, 255, 0.2);
}

.chart-card h2 {
  margin: 0 0 0.7rem;
  font-size: 1.6rem;
}

.difficulty-bars {
  display: grid;
  gap: 0.4rem;
}

.difficulty-row {
  display: grid;
  grid-template-columns: 5rem 1fr 2rem;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.difficulty-bar {
  height: 11px;
  border: 1px solid var(--rule-strong);
  background: rgba(255, 255, 255, 0.3);
}

.difficulty-fill {
  display: block;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    var(--pen-blue),
    var(--pen-blue) 5px,
    rgba(47, 90, 134, 0.55) 5px,
    rgba(47, 90, 134, 0.55) 10px
  );
}

.difficulty-fill.diff-easy {
  background: repeating-linear-gradient(45deg, var(--pen-green), var(--pen-green) 5px, rgba(70, 106, 73, 0.5) 5px, rgba(70, 106, 73, 0.5) 10px);
}

.difficulty-fill.diff-hard,
.difficulty-fill.diff-insane {
  background: repeating-linear-gradient(45deg, var(--pen-red), var(--pen-red) 5px, rgba(163, 58, 46, 0.5) 5px, rgba(163, 58, 46, 0.5) 10px);
}

.difficulty-count {
  text-align: right;
  color: var(--pen-red);
}

.tag-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 1.2rem;
}

.tag-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0.7rem;
  border: 1px dashed var(--rule-strong);
  background: rgba(255, 255, 255, 0.16);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.03rem;
}

.tag-item:hover {
  color: var(--pen-red);
  background: rgba(255, 213, 92, 0.16);
  text-decoration: none;
  transform: rotate(-0.4deg);
}

.tag-item > span:last-child {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faded);
  text-align: right;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1.2rem 0;
}

.search-form input[type="search"] {
  flex: 1 1 18rem;
  max-width: 34rem;
  width: auto;
  padding: 0.35rem 0.6rem;
  border: 1px dashed var(--ink);
  border-radius: 0;
  background: var(--paper-light);
  color: var(--ink);
  font-family: var(--font-hand, var(--font-sans));
  font-size: 1.02rem;
}

.search-results {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.4rem;
}

/* --------------------------------------------------------------------------
   Forms / comments / misc
   -------------------------------------------------------------------------- */

input,
textarea,
select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px dashed var(--rule-strong);
  border-radius: 0;
  background: var(--paper-light);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px dashed var(--pen-red);
  outline-offset: 3px;
}

.post-comments {
  margin-top: 2.6rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--rule-strong);
}

.post-comments h2 {
  margin-top: 0;
}

.comment,
.comment-form {
  border: 1px dashed var(--rule-strong);
  background: rgba(255, 255, 255, 0.2);
}

.comment {
  padding: 0.7rem 0.9rem;
  margin: 0.7rem 0;
}

.comment-avatar {
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--paper-light);
}

.comment-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
}

.comment-time,
.comment-actions,
.commenting-as,
.comment-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faded);
}

.comment-body {
  color: var(--ink);
}

.comment-form {
  padding: 0.9rem;
}

.comment-form-main {
  display: grid;
  gap: 0.5rem;
}

.comment-form-main textarea {
  min-height: 5rem;
}

.post-feedback,
.reading-progress,
.back-to-top,
.views-live {
  display: none !important;
}

.zoom-overlay[hidden] { display: none !important; }
.zoom-overlay:not([hidden]) { display: flex !important; }

.error {
  margin: 1rem 0;
  padding: 0.7rem 0.9rem;
  border: 1px dashed var(--pen-red);
  background: rgba(163, 58, 46, 0.06);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 0;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px dashed var(--rule-strong);
  background: transparent;
  color: var(--ink-soft);
  text-align: center;
}

.footer-simple-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.65rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 0.65rem 1.25rem; width: 100%; }
.footer-row-main { padding-bottom: 0.55rem; }
.footer-row-meta { padding-top: 0.55rem; border-top: 1px dashed var(--rule); font: 0.68rem var(--font-mono); color: var(--ink-faded); }
.build-version { display: inline-block; padding: 0.08rem 0.38rem; border: 1px solid #b28a00; border-radius: 0.2rem; color: #342900; background: #ffe66d; font-weight: 700; line-height: 1.35; }
.footer-server-status, .discord-presence-inline { white-space: nowrap; }
.discord-presence-inline { display: inline-flex; align-items: center; gap: 0.35rem; }
.discord-presence-inline .discord-presence-dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; }

.footer-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faded);
}

.footer-kicker, .footer-simple-description { display: none; }

.footer-simple-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--ink);
  transform: none;
  font-size: 1.25rem;
  white-space: nowrap;
}

.footer-simple-description {
  max-width: 32rem;
  margin: 0.1rem 0 0.6rem;
  color: var(--ink-faded);
  font-size: 0.98rem;
}

.footer-simple-nav,
.footer-simple-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 0.55rem;
  font-size: 0.98rem;
}

.footer-simple-nav { justify-content: flex-start; }
.footer-simple-social { margin-top: 0; }

.footer-simple-nav a,
.footer-simple-social a,
.footer-simple-bottom a {
  color: var(--pen-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.footer-simple-nav a:hover,
.footer-simple-social a:hover,
.footer-simple-bottom a:hover {
  color: var(--pen-red);
  text-decoration-style: wavy;
}

.footer-simple-social {
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.footer-simple-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 0.8rem;
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faded);
  grid-column: auto;
}

@media (max-width: 760px) {
  .footer-row { flex-wrap: wrap; justify-content: center; text-align: center; }
  .footer-simple-nav, .footer-simple-social { justify-content: center; }
  .footer-row-meta { flex-direction: column; }
}

/* --------------------------------------------------------------------------
   Old pages that still exist (login, maintenance, 404, admin, …)
   -------------------------------------------------------------------------- */

.locked,
.auth-box,
.center {
  max-width: 38rem;
  margin: 4rem auto;
  text-align: center;
}

.admin-card,
.admin-card-wide,
.admin-row,
.admin-editor {
  border: 1px dashed var(--rule-strong);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  body {
    font-size: 18px;
    background-image:
      repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 30px,
        var(--rule) 30px,
        var(--rule) 31px
      );
  }

  .container {
    padding: 1.5rem 1.1rem 3.2rem;
  }

  .site-header {
    padding-top: 1.4rem;
  }

  .site-tagline {
    font-size: 1.1rem;
  }

  .hero-photo {
    float: none;
    display: block;
    width: 150px;
    margin: 0 auto 1.2rem;
    transform: rotate(-1.5deg);
  }

  .hero h1 {
    text-align: center;
  }

  .site-nav {
    font-size: 0.95rem;
  }

  .page-link {
    font-size: 0.95rem;
  }

  .post-figure::before {
    top: -7px;
    width: 60px;
    height: 16px;
    margin-left: -30px;
  }

  .post-nav {
    flex-direction: column;
  }

  .post-nav-older {
    text-align: left;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Keep the paper skin above site.css's late light-theme component rules.
   Those selectors are intentionally specific, so match their weight here.
   -------------------------------------------------------------------------- */

html[data-theme="light"] body {
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      var(--rule) 31px,
      var(--rule) 32px
    );
  background-attachment: fixed;
  color: var(--ink);
}

html[data-theme="light"] body .site-header {
  border-bottom: 1px dashed var(--rule-strong);
  background: transparent;
}

html[data-theme="light"] body .page-link,
html[data-theme="light"] body .site-nav.is-open .page-link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--pen-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

html[data-theme="light"] body .page-link:hover,
html[data-theme="light"] body .site-nav.is-open .page-link:hover {
  background: transparent;
  color: var(--pen-red);
  text-decoration-style: wavy;
}

html[data-theme="light"] body .card {
  margin: 0;
  padding: 1.35rem 0 1.5rem;
  border: 0;
  border-bottom: 1px dashed var(--rule-strong);
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
}

html[data-theme="light"] body .card:last-child {
  border-bottom: 0;
}

html[data-theme="light"] body .related-card,
html[data-theme="light"] body .archive-entry,
html[data-theme="light"] body .tag-item {
  border: 1px dashed var(--rule-strong);
  border-radius: 0;
  background-color: rgba(255, 255, 255, 0.18);
  background-image: none;
  box-shadow: none;
  color: var(--ink);
}

html[data-theme="light"] body .archive-entry {
  border: 0;
  border-bottom: 1px dashed var(--rule-strong);
  background: transparent;
}

html[data-theme="light"] body .tag-item:hover,
html[data-theme="light"] body .related-card:hover {
  background-color: rgba(255, 213, 92, 0.16);
  color: var(--pen-red);
}

html[data-theme="light"] body .series-box,
html[data-theme="light"] body .toc,
html[data-theme="light"] body .about-author,
html[data-theme="light"] body .chart-card {
  border: 1px dashed var(--rule-strong);
  border-radius: 0;
  background-color: rgba(255, 255, 255, 0.2);
  background-image: none;
  box-shadow: none;
}

html[data-theme="light"] body .post-nav,
html[data-theme="light"] body .post-nav-link {
  border-color: var(--rule-strong);
  background: transparent;
  background-image: none;
  box-shadow: none;
}

html[data-theme="light"] body .meta {
  color: var(--ink-faded);
}

html[data-theme="light"] body .lead {
  color: var(--ink-soft);
}

html[data-theme="light"] body .post-author strong {
  color: var(--pen-blue);
}

html[data-theme="light"] body .prose pre {
  border: 1px dashed var(--rule-strong);
  border-radius: 2px;
  background: #fbf5e3;
  color: #332f28;
}

html[data-theme="light"] body .code-window {
  border-color: var(--rule-strong);
  background: #fbf5e3;
  box-shadow: none;
}

html[data-theme="light"] body .code-window pre {
  background: transparent;
  color: inherit;
}

html[data-theme="light"] body .prose :not(pre) > code {
  border-color: rgba(70, 60, 40, 0.35);
  background: rgba(255, 213, 92, 0.22);
  color: #6b3d2a;
}

html[data-theme="light"] body .prose table {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.22);
}

html[data-theme="light"] body .prose thead {
  background: rgba(226, 213, 168, 0.45);
  background-image: none;
}

html[data-theme="light"] body .prose th {
  color: var(--ink);
}

html[data-theme="light"] body .prose th,
html[data-theme="light"] body .prose td {
  border-color: var(--rule-strong);
}

html[data-theme="light"] body .prose tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.2);
}

html[data-theme="light"] body .prose tbody tr:hover {
  background: rgba(255, 213, 92, 0.18);
}

html[data-theme="light"] body .pagination .page-link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--pen-blue);
  text-decoration: underline;
}

html[data-theme="light"] body .pagination .page-link:hover {
  color: var(--pen-red);
}

html[data-theme="light"] body .pagination .page-link.is-active {
  background: transparent;
  color: var(--pen-red);
  font-weight: 700;
  text-decoration: none;
}

html[data-theme="light"] body input,
html[data-theme="light"] body textarea,
html[data-theme="light"] body select {
  border: 1px dashed var(--rule-strong);
  border-radius: 0;
  background: var(--paper-light);
  background-image: none;
  color: var(--ink);
  box-shadow: none;
}

html[data-theme="light"] body .button,
html[data-theme="light"] body button,
html[data-theme="light"] body input[type="submit"] {
  border: 1px dashed var(--ink);
  border-radius: 2px;
  background: var(--paper-light);
  background-image: none;
  box-shadow: none;
  color: var(--ink);
}

html[data-theme="light"] body .button:hover,
html[data-theme="light"] body button:hover:not(:disabled),
html[data-theme="light"] body input[type="submit"]:hover {
  border-color: var(--pen-red);
  background: rgba(255, 213, 92, 0.25);
  background-image: none;
  color: var(--pen-red);
}

html[data-theme="light"] body .site-footer {
  border-top: 1px dashed var(--rule-strong);
  background: transparent;
  color: var(--ink-soft);
}

html[data-theme="light"] body .footer-simple-wrapper {
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
}

html[data-theme="light"] body .footer-simple-nav a,
html[data-theme="light"] body .footer-simple-nav button,
html[data-theme="light"] body .footer-simple-social a,
html[data-theme="light"] body .footer-simple-bottom a {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--pen-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

html[data-theme="light"] body .footer-simple-nav a:hover,
html[data-theme="light"] body .footer-simple-nav button:hover,
html[data-theme="light"] body .footer-simple-social a:hover,
html[data-theme="light"] body .footer-simple-bottom a:hover {
  color: var(--pen-red);
  text-decoration-style: wavy;
}

html[data-theme="light"] body .footer-simple-bottom {
  border-top: 1px dashed var(--rule);
}

html[data-theme="light"] body .footer-simple-bottom a {
  display: inline;
  padding: 0;
}

html[data-theme="light"] body time.rel-time {
  border-bottom-color: rgba(70, 60, 40, 0.35);
  color: inherit;
}

html[data-theme="light"] body .post .post-header .meta time.rel-time {
  color: var(--ink-faded);
}

/* --------------------------------------------------------------------------
   Finishing touch: soft, hand-drawn boxes and rounded corners everywhere.
   -------------------------------------------------------------------------- */

html[data-theme="light"] body .post-list .card {
  margin: 0 0 1.1rem;
  padding: 1.25rem 1.35rem 1.35rem;
  border: 1px solid rgba(70, 60, 40, 0.28);
  border-radius: 14px;
  background: rgba(253, 248, 236, 0.66);
  box-shadow: 2px 3px 0 rgba(70, 60, 40, 0.07);
}

html[data-theme="light"] body .post-list .card:last-child {
  border-bottom: 1px solid rgba(70, 60, 40, 0.28);
}

html[data-theme="light"] body .page-link,
html[data-theme="light"] body .site-nav.is-open .page-link {
  padding: 0.1rem 0.58rem 0.14rem;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
}

html[data-theme="light"] body .page-link:hover,
html[data-theme="light"] body .site-nav.is-open .page-link:hover {
  border-color: var(--rule-strong);
  background: rgba(255, 255, 255, 0.42);
  text-decoration: underline;
  text-decoration-style: wavy;
}

.hero-photo {
  border-radius: 10px;
}

.button,
html[data-theme="light"] body .button {
  padding: 0.3rem 0.95rem 0.36rem;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--paper-light);
  box-shadow: 2px 2px 0 rgba(70, 60, 40, 0.16);
}

html[data-theme="light"] body .button:hover {
  box-shadow: 1px 1px 0 rgba(70, 60, 40, 0.16);
  transform: translate(1px, 1px) rotate(-0.6deg);
}

html[data-theme="light"] body input,
html[data-theme="light"] body textarea,
html[data-theme="light"] body select,
.search-form input[type="search"] {
  border: 1px solid var(--rule-strong);
  border-radius: 9px;
  background: var(--paper-light);
}

html[data-theme="light"] body .platform-stamp,
html[data-theme="light"] body .badge {
  border-radius: 7px;
}

html[data-theme="light"] body .htb-card-machine > img {
  border-radius: 9px;
}

html[data-theme="light"] body .toc,
html[data-theme="light"] body .series-box,
html[data-theme="light"] body .about-author,
html[data-theme="light"] body .chart-card,
html[data-theme="light"] body .related-card,
html[data-theme="light"] body .tag-item,
html[data-theme="light"] body .archive-entry {
  border: 1px solid rgba(70, 60, 40, 0.24);
  border-radius: 12px;
  background: rgba(253, 248, 236, 0.58);
  box-shadow: 2px 2px 0 rgba(70, 60, 40, 0.05);
}

html[data-theme="light"] body .archive-entry {
  margin-bottom: 0.65rem;
  padding: 0.8rem 1rem;
}

html[data-theme="light"] body .tag-item:hover,
html[data-theme="light"] body .related-card:hover {
  border-color: rgba(163, 58, 46, 0.4);
  background: rgba(255, 213, 92, 0.2);
}

.post-figure img {
  border-radius: 8px;
}

.code-window,
html[data-theme="light"] body .code-window {
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
}

.code-window-bar {
  border-radius: 11px 11px 0 0;
}

.code-window pre,
html[data-theme="light"] body .code-window pre {
  border-radius: 0 0 11px 11px;
}

.prose pre,
html[data-theme="light"] body .prose pre {
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
}

.prose table,
html[data-theme="light"] body .prose table {
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  overflow: hidden;
}

.prose :not(pre) > code,
html[data-theme="light"] body .prose :not(pre) > code {
  border-radius: 6px;
}

.difficulty-bar,
.difficulty-fill {
  border-radius: 999px;
}

html[data-theme="light"] body .pagination .page-link {
  padding: 0.12rem 0.6rem 0.18rem;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.3);
  text-decoration: none;
}

html[data-theme="light"] body .pagination .page-link:hover {
  border-color: var(--pen-red);
  background: rgba(255, 213, 92, 0.18);
  color: var(--pen-red);
}

html[data-theme="light"] body .pagination .page-link.is-active {
  border-color: var(--pen-red);
  background: var(--pen-red);
  color: var(--paper-light);
  text-decoration: none;
}

html[data-theme="light"] body .post-nav {
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: rgba(253, 248, 236, 0.5);
}

.share-buttons {
  padding: 0.55rem 0.85rem;
  border: 1px dashed var(--rule-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
}

html[data-theme="light"] body .machine-banner,
.machine-banner {
  border-radius: 14px;
}

.machine-banner-art {
  border-radius: 13px;
}

.machine-completion {
  border-radius: 10px;
}

html[data-theme="light"] body .comment,
html[data-theme="light"] body .comment-form {
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: rgba(253, 248, 236, 0.5);
}

.comment-avatar {
  border-radius: 9px;
}

html[data-theme="light"] body .auth-box,
html[data-theme="light"] body .admin-card,
html[data-theme="light"] body .admin-card-wide,
html[data-theme="light"] body .admin-row,
html[data-theme="light"] body .admin-panel,
html[data-theme="light"] body .admin-editor {
  border-radius: 12px;
  background: rgba(253, 248, 236, 0.55);
  background-image: none;
  box-shadow: none;
}

html[data-theme="light"] body .footer-simple-social a,
html[data-theme="light"] body .footer-simple-bottom a {
  border-radius: 6px;
}

html[data-theme="light"][data-seasonal="halloween"] body {
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 12% 0%, rgba(111, 58, 141, 0.22), transparent 42rem),
    radial-gradient(ellipse at 92% 8%, rgba(198, 83, 27, 0.16), transparent 38rem),
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--rule) 31px, var(--rule) 32px);
  color: var(--ink);
}

html[data-theme="light"][data-seasonal="halloween"] body .site-header {
  border-bottom-color: rgba(255, 139, 62, 0.38);
}

html[data-theme="light"][data-seasonal="halloween"] body :is(
  h1, h2, h3, h4, h5, h6, p, li, dt, dd, label, summary, blockquote,
  figcaption, small, time, .meta, .post-lede, .topic-group-title,
  .coverage-step-label, .coverage-step-note, .locked-cta p,
  .discord-widget-panel > p, .discord-widget-panel > a
) {
  color: var(--ink-soft);
}

html[data-theme="light"][data-seasonal="halloween"] body :is(h1, h2, h3, h4, h5, h6) {
  color: var(--ink);
}

html[data-theme="light"][data-seasonal="halloween"] body .halloween-note {
  color: var(--pen-red);
}

html[data-theme="light"][data-seasonal="halloween"] body .sign-off {
  color: var(--pen-blue);
}

html[data-theme="light"][data-seasonal="halloween"] body .machine-banner-shade {
  background: linear-gradient(90deg, rgba(16, 13, 21, 0.94), rgba(16, 13, 21, 0.24));
}

html[data-theme="light"][data-seasonal="halloween"] body .locked-community-card {
  border-color: rgba(198, 165, 255, 0.36);
  background: rgba(35, 27, 43, 0.9);
  color: var(--ink);
}

html[data-theme="light"][data-seasonal="halloween"] body .post-nav,
html[data-theme="light"][data-seasonal="halloween"] body .post-nav-link {
  border-color: var(--rule-strong);
  background: rgba(35, 27, 43, 0.82);
  color: var(--ink);
}

html[data-theme="light"][data-seasonal="halloween"] body :is(
  .card, .related-card, .archive-entry, .tag-item, .toc, .series-box,
  .about-author, .chart-card, .comment, .comment-form, .locked-panel,
  .admin-card, .admin-card-wide, .admin-row, .admin-panel, .admin-editor,
  .auth-box, .privacy-consent-panel, .privacy-consent-option,
  .locked-community-card, .machine-fact, .post-nav, .post-nav-link, .share-btn
) {
  border-color: var(--rule-strong);
  background-color: rgba(35, 27, 43, 0.9);
  background-image: none;
  color: var(--ink);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"][data-seasonal="halloween"] body .toc summary {
  color: var(--ink);
}

html[data-theme="light"][data-seasonal="halloween"] body .toc a {
  color: var(--pen-blue);
}

html[data-theme="light"][data-seasonal="halloween"] body .toc a:hover {
  color: var(--pen-red);
}

html[data-theme="light"][data-seasonal="halloween"] body .prose pre,
html[data-theme="light"][data-seasonal="halloween"] body .code-window {
  border-color: var(--rule-strong);
  background: #100d15;
  color: #f5ebd6;
}

html[data-theme="light"][data-seasonal="halloween"] body .code-window pre {
  background: transparent;
  color: #f5ebd6;
}

html[data-theme="light"][data-seasonal="halloween"] body .code-window pre code,
html[data-theme="light"][data-seasonal="halloween"] body .prose pre code {
  background: transparent;
  color: inherit;
}

html[data-theme="light"][data-seasonal="halloween"] body .code-window-bar {
  border-color: var(--rule-strong);
  background: rgba(198, 165, 255, 0.12);
  color: var(--ink);
}

html[data-theme="light"][data-seasonal="halloween"] body .code-window-lang,
html[data-theme="light"][data-seasonal="halloween"] body .code-window-bar .copy-btn {
  border-color: var(--rule-strong);
  color: var(--ink-soft);
}

html[data-theme="light"][data-seasonal="halloween"] body .hljs-comment,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-quote { color: #c1b2ca; }
html[data-theme="light"][data-seasonal="halloween"] body .hljs-keyword,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-selector-tag,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-literal { color: #ff9bd8; }
html[data-theme="light"][data-seasonal="halloween"] body .hljs-string,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-doctag,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-regexp { color: #a8e6a2; }
html[data-theme="light"][data-seasonal="halloween"] body .hljs-number { color: #ffc078; }
html[data-theme="light"][data-seasonal="halloween"] body .hljs-title,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-section,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-name { color: #a9caff; }
html[data-theme="light"][data-seasonal="halloween"] body .hljs-attr,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-attribute,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-variable,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-template-variable { color: #d8aaff; }
html[data-theme="light"][data-seasonal="halloween"] body .hljs-built_in,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-type,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-selector-class { color: #ffd479; }
html[data-theme="light"][data-seasonal="halloween"] body .hljs-symbol,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-bullet,
html[data-theme="light"][data-seasonal="halloween"] body .hljs-link { color: #ff9b91; }

html[data-theme="light"][data-seasonal="halloween"] body .prose :not(pre) > code {
  border-color: rgba(198, 165, 255, 0.35);
  background: rgba(198, 165, 255, 0.13);
  color: #f2c27a;
}

html[data-theme="light"][data-seasonal="halloween"] body .prose thead {
  background: rgba(198, 165, 255, 0.13);
}

html[data-theme="light"][data-seasonal="halloween"] body .prose tbody tr:nth-child(even) {
  background: rgba(198, 165, 255, 0.055);
}

html[data-theme="light"][data-seasonal="halloween"] body .prose tbody tr:hover {
  background: rgba(255, 139, 62, 0.13);
}
