/* ===========================================================================
   ruza.eu — unified stylesheet
   Shared by: /index.html, /articles/index.html, /articles/*.html
   =========================================================================== */

/* Self-hosted JetBrains Mono — see /fonts/README.md for setup */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: optional;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: optional;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: optional;
}

/* ---- Design tokens (dark mode by default, light mode via media query) ---- */
:root {
  --bg: #000000;
  --surface: #0d0d0d;
  --surface-2: #161616;
  --border: #262626;
  --border-hover: #3d3d3d;
  --text: #f0f0f0;
  --text-muted: #909090;
  --text-dim: #707070;
  --accent: #ffff00;
  --accent-soft: #cccc00;
  --accent-dim: #888800;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f7f7f7;
    --border: #e0e0e0;
    --border-hover: #c0c0c0;
    --text: #1a1a1a;
    --text-muted: #606060;
    --text-dim: #888888;
    --accent: #808000;
    --accent-soft: #999900;
    --accent-dim: #b0b050;
  }
}

/* Explicit theme overrides (via data-theme attribute on <html>, set by JS) */
/* These win over media queries because of attribute specificity */
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #0d0d0d;
  --surface-2: #161616;
  --border: #262626;
  --border-hover: #3d3d3d;
  --text: #f0f0f0;
  --text-muted: #909090;
  --text-dim: #707070;
  --accent: #ffff00;
  --accent-soft: #cccc00;
  --accent-dim: #888800;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --border: #e0e0e0;
  --border-hover: #c0c0c0;
  --text: #1a1a1a;
  --text-muted: #606060;
  --text-dim: #888888;
  --accent: #808000;
  --accent-soft: #999900;
  --accent-dim: #b0b050;
}

/* ---- Reset & base ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* Skip link — visible only when focused via keyboard */
.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0.25rem;
  transform: translateY(-200%);
  transition: transform 0.15s;
  z-index: 100;
}
.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.wrap {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}
.wrap-wide { max-width: 45rem; }

/* ---- Shared divider ---- */
.divider {
  height: 1px;
  margin: 2.5rem 0;
  background: linear-gradient(to right, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

/* ---- Shared footer ---- */
footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.6875rem;
  color: var(--text-dim);
}
footer .blink {
  display: inline-block;
  width: 0.5rem;
  height: 0.125rem;
  background: var(--text-muted);
  vertical-align: baseline;
  margin-left: 0.25rem;
  animation: blink 1.3s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

/* ===========================================================================
   Homepage (/index.html)
   =========================================================================== */

.prompt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}
.prompt .cmd { color: var(--text-dim); }

.hero { text-align: center; margin-bottom: 2rem; }

.yinyang {
  display: block;
  margin: 0 auto 1.5rem;
  width: 7.5rem;
  height: 7.5rem;
  cursor: pointer;
  transition: transform 20s linear, opacity 0.2s;
  opacity: 0.95;
}
.yinyang:hover {
  transform: rotate(360deg);
  opacity: 1;
}
.yinyang:active { opacity: 0.7; }
.yinyang:focus { outline: none; }
.yinyang:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 50%;
}

.theme-indicator {
  display: block;
  text-align: center;
  margin: -0.75rem auto 1.5rem;
  font-size: 0.625rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: lowercase;
  cursor: pointer;
  transition: color 0.15s;
  user-select: none;
}
.theme-indicator:hover { color: var(--text-muted); }

h1 {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* Social links grid */
.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 0.625rem;
}
.link-card {
  display: block;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.875rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.link-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.link-card:active { transform: translateY(0); }

.link-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.375rem;
}

.chip {
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 0.3125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 0.5px solid var(--border);
}

.label {
  color: var(--text);
  opacity: 0.75;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.handle {
  color: var(--accent);
  font-size: 1rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,0,0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.1875rem;
  transition: text-decoration-color 0.15s;
}
.link-card:hover .handle { text-decoration-color: var(--accent); }

/* E-mail card: placeholder dim until JS reveals address */
.mail-card { cursor: pointer; }
.mail-placeholder {
  color: var(--text-dim);
  font-style: italic;
  text-decoration: none;
}
.mail-card:hover .mail-placeholder { color: var(--text-muted); }
.mail-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* GPG section */
.gpg { margin-top: 0.5rem; }
/* Section headings: writing, gpg, latest mastodon, etc. */
h2.gpg-title,
h2.posts-title,
h2.toots-title,
.gpg-title,
.posts-title,
.toots-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.gpg-title svg,
.posts-title svg,
.toots-title svg {
  flex-shrink: 0;
  color: var(--accent);
}
.gpg-box {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.gpg-key {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  user-select: all;
}
.gpg-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.gpg-actions a,
.gpg-actions button {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.6875rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.gpg-actions a:hover,
.gpg-actions button:hover { opacity: 0.7; }
.gpg-note {
  margin-top: 0.625rem;
  font-size: 0.6875rem;
  color: var(--text-dim);
  text-align: center;
}
.gpg-note a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 0.1875rem;
}

/* Mastodon feed */
.toots-status {
  color: var(--text-dim);
  font-size: 0.6875rem;
  text-align: center;
  padding: 0.5rem 0;
}
.toots-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.toot {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 0.875rem;
}
.toot-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.625rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}
.toot-date { color: var(--text-muted); }
.toot-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,0,0.35);
  text-underline-offset: 0.1875rem;
  font-size: 0.625rem;
  white-space: nowrap;
}
.toot-link:hover { text-decoration-color: var(--accent); }
.toot-content {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
}
.toot-content p { margin: 0 0 0.5rem; }
.toot-content p:last-child { margin-bottom: 0; }
.toot-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,0,0.35);
  text-underline-offset: 0.125rem;
  word-break: break-all;
}
.toot-content a:hover { text-decoration-color: var(--accent); }
.toot-content .invisible { display: none; }
.toot-content .ellipsis::after { content: "…"; }

/* ===========================================================================
   Writing section (shared by homepage + /articles/index.html)
   =========================================================================== */

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.post {
  /* Block layout — date is inline with title */
}
.post-date {
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin-right: 0.5rem;
}
.post-title {
  color: var(--accent);
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,0,0.35);
  text-underline-offset: 0.1875rem;
  word-break: break-word;
}
.post-title:hover { text-decoration-color: var(--accent); }
.post-desc {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-top: 0.25rem;
}
.posts-all {
  margin: 0.875rem auto 0;
  font-size: 0.6875rem;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,0,0.35);
  text-underline-offset: 0.1875rem;
  display: block;
  width: fit-content;
  text-align: center;
}
.posts-all:hover { text-decoration-color: var(--accent); }

/* ===========================================================================
   Article index (/articles/index.html)
   =========================================================================== */

.breadcrumb {
  margin-bottom: 2.5rem;
  font-size: 0.75rem;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb a:hover { color: var(--accent); }

.page-header { margin-bottom: 2rem; }
.page-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 0.375rem;
}
.page-title svg { flex-shrink: 0; color: var(--text-muted); }
.page-desc {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.year-heading {
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 2rem 0 1rem;
}
.year-group:first-child .year-heading { margin-top: 0; }

/* ===========================================================================
   Individual article (/articles/*.html)
   =========================================================================== */

.article-header { margin-bottom: 2rem; }

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.article-meta .dot {
  width: 0.1875rem;
  height: 0.1875rem;
  background: var(--text-dim);
  border-radius: 50%;
}

.article-title {
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 0.625rem;
}
.article-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* --- Article body (prose) --- */
.article-toc {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.875rem 1.125rem;
  margin: 0 0 2rem;
  font-size: 0.9375rem;
}
.article-toc summary {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc summary::before {
  content: "▶";
  font-size: 0.625rem;
  color: var(--text-dim);
  transition: transform 0.15s;
  display: inline-block;
}
.article-toc[open] summary::before { transform: rotate(90deg); }
.article-toc summary:hover { color: var(--text); }

.article-toc .toc {
  margin-top: 0.875rem;
}
.article-toc .toc ul {
  list-style: none;
  padding-left: 0;
}
.article-toc .toc > ul {
  padding-left: 0;
}
.article-toc .toc ul ul {
  padding-left: 1rem;
  margin-top: 0.25rem;
}
.article-toc .toc li {
  margin: 0.25rem 0;
  position: static;
}
.article-toc .toc li::before { content: none; }
.article-toc .toc a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}
.article-toc .toc a:hover { color: var(--accent); }

.article-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
}
.article-body > * + * { margin-top: 1.25rem; }
.article-body p { color: var(--text); }
.article-body h2 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-top: 3rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border);
}
.article-body h3 {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-top: 2.25rem;
}
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,0,0.35);
  text-underline-offset: 0.1875rem;
}
.article-body a:hover { text-decoration-color: var(--accent); }
.article-body strong { font-weight: 500; color: var(--text); }
.article-body em { font-style: italic; color: var(--text); }
.article-body ul, .article-body ol { padding-left: 1.5rem; }
.article-body ul { list-style: none; }
.article-body ul > li { position: relative; }
.article-body ul > li::before {
  content: '·';
  position: absolute;
  left: -1.1rem;
  color: var(--text-dim);
  font-weight: 500;
}
.article-body ol {
  list-style-type: decimal;
  font-variant-numeric: tabular-nums;
}
.article-body li + li { margin-top: 0.5rem; }
.article-body blockquote {
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-left: 0.125rem solid var(--border);
  color: var(--text-muted);
  font-style: italic;
}
.article-body code {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 0.25rem;
  padding: 1px 0.375rem;
  font-size: 0.9em;
  color: var(--accent);
}
/* Code block with copy button — wraps codehilite output */
.code-block {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin: 1.5rem 0;
  overflow: hidden;
}
.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.375rem 0.75rem 0.375rem 0.875rem;
  background: var(--surface-2);
  border-bottom: 0.5px solid var(--border);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.code-block-lang {
  font-weight: 500;
}
.code-block-copy {
  background: transparent;
  border: none;
  padding: 0.25rem 0.5rem;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background 0.15s;
}
.code-block-copy:hover { background: rgba(255, 255, 0, 0.08); }
.code-block-copy:active { opacity: 0.7; }
.code-block-copy.copied { color: var(--text-muted); }

.code-block pre {
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.875rem 1rem;
  overflow-x: auto;
  line-height: 1.55;
  font-size: 0.8125rem;
}
.code-block .codehilite {
  margin: 0;
}
.code-block .codehilite pre {
  margin: 0;
}

/* Fallback for plain <pre> blocks without our wrapper (manual HTML) */
.article-body > pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  overflow-x: auto;
  line-height: 1.55;
  font-size: 0.8125rem;
  margin: 1.5rem 0;
}
.article-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  border: 0.5px solid var(--border);
  display: block;
  margin: 1.5rem auto;
  /* Fallback aspect-ratio so layout doesn't shift while image loads.
     Will be overridden by intrinsic ratio once image dimensions are known. */
  background: var(--surface-2);
}
.article-body figure img { margin-bottom: 0.5rem; }
.article-body figcaption {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.article-body hr {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border) 20%, var(--border) 80%, transparent);
  margin: 2rem 0;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.article-body th, .article-body td {
  padding: 0.5rem 0.625rem;
  border-bottom: 0.5px solid var(--border);
  text-align: left;
}
.article-body th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  flex-wrap: wrap;
}
.article-nav a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,0,0.35);
  text-underline-offset: 0.1875rem;
}
.article-nav a:hover { text-decoration-color: var(--accent); }

/* ===========================================================================
   Article comments (Mastodon thread replies)
   =========================================================================== */

.article-comments {
  margin-top: 0.5rem;
}
.comments-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.comments-title svg { flex-shrink: 0; color: var(--accent); }

.comments-intro {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}
.comments-thread-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,0,0.35);
  text-underline-offset: 0.1875rem;
}
.comments-thread-link:hover { text-decoration-color: var(--accent); }

.comments-status {
  color: var(--text-dim);
  font-size: 0.8125rem;
  text-align: center;
  padding: 0.75rem 0;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.comment {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
  flex-wrap: wrap;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.comment-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.25rem;
  background: var(--surface-2);
  flex-shrink: 0;
}
.comment-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comment-handle {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.comment-author:hover .comment-name { color: var(--accent); }

.comment-link {
  color: var(--text-dim);
  font-size: 0.75rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.comment-link:hover { color: var(--accent); }

.comment-content {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}
.comment-content p { margin: 0 0 0.5rem; }
.comment-content p:last-child { margin-bottom: 0; }
.comment-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,0,0.35);
  text-underline-offset: 0.125rem;
  word-break: break-all;
}
.comment-content a:hover { text-decoration-color: var(--accent); }
.comment-content .invisible { display: none; }
.comment-content .ellipsis::after { content: "…"; }

/* ===========================================================================
   Syntax highlighting (Pygments codehilite, custom palette to match site)
   =========================================================================== */

.codehilite {
  background: transparent !important;  /* let .article-body pre styling apply */
}
.codehilite pre { background: transparent; padding: 0; border: 0; margin: 0; }

/* Comments — dim */
.codehilite .c, .codehilite .ch, .codehilite .cm, .codehilite .c1, .codehilite .cs { color: var(--text-dim); font-style: italic; }
.codehilite .cp, .codehilite .cpf { color: var(--text-dim); }

/* Keywords — accent yellow */
.codehilite .k, .codehilite .kc, .codehilite .kd, .codehilite .kn, .codehilite .kp, .codehilite .kr, .codehilite .kt { color: var(--accent); font-weight: 500; }

/* Strings — soft yellow */
.codehilite .s, .codehilite .sa, .codehilite .sb, .codehilite .sc, .codehilite .dl, .codehilite .sd, .codehilite .s2, .codehilite .se, .codehilite .sh, .codehilite .si, .codehilite .sx, .codehilite .sr, .codehilite .s1, .codehilite .ss { color: var(--accent-soft); }

/* Numbers, constants — accent dim */
.codehilite .m, .codehilite .mb, .codehilite .mf, .codehilite .mh, .codehilite .mi, .codehilite .mo, .codehilite .il { color: var(--accent-dim); }

/* Function names, classes — text */
.codehilite .nf, .codehilite .nc, .codehilite .nn { color: var(--text); font-weight: 500; }

/* Variables, names — text-muted */
.codehilite .n, .codehilite .nv, .codehilite .vc, .codehilite .vg, .codehilite .vi, .codehilite .vm { color: var(--text); }

/* Operators — text-muted */
.codehilite .o, .codehilite .ow, .codehilite .p { color: var(--text-muted); }

/* Built-in types — accent */
.codehilite .nb, .codehilite .bp { color: var(--accent); }

/* Errors */
.codehilite .err { color: #ff6b6b; background: transparent; }

/* Light mode override */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .codehilite .err { color: #c00; }
}
:root[data-theme="light"] .codehilite .err { color: #c00; }

/* ===========================================================================
   Responsive
   =========================================================================== */

@media (max-width: 480px) {
  .wrap { padding: 2rem 1rem 3rem; }
  h1 { font-size: 1.625rem; }
  .yinyang { width: 6.25rem; height: 6.25rem; }
}

