* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: .45em .7em; border-radius: 2px; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; top: -100px; padding: 12px; background: var(--surface); }
.skip-link:focus { top: 8px; z-index: 10; }
.site-shell { max-width: 1260px; margin: 0 auto; padding: 56px 40px 24px; display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 54px; }
.site-rail { align-self: start; position: sticky; top: 40px; border-right: 1px solid var(--line); padding-right: 24px; }
.site-name { font: 600 19px/1.4 ui-monospace, monospace; color: var(--ink); text-decoration: none; white-space: nowrap; }
.site-rail nav { display: flex; flex-direction: column; gap: 12px; margin: 38px 0; }
.site-rail nav a { text-decoration: none; color: var(--muted); }
.site-rail nav a:hover, .site-rail nav a[aria-current] { color: var(--accent); }
.site-rail nav a[aria-current] { font-weight: 700; }
.site-rail .secondary-nav { font-size: 14px; gap: 8px; padding-top: 22px; border-top: 1px solid var(--line); }
#mode-toggle { font-size: 13px; }
#mode-toggle[aria-pressed=true] { border-color: var(--accent); color: var(--accent); }
.site-body, main, .content, .post { min-width: 0; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.025em; }
h1 { font-size: clamp(32px, 4vw, 48px); margin: 0 0 24px; }
h2 { font-size: 25px; margin-top: 2em; }
h3 { font-size: 21px; }
p { margin: 0 0 1.25em; }
.home-intro { margin-bottom: 52px; }
.home-intro h1 { max-width: 17ch; font-size: clamp(36px, 4vw, 48px); }
.home-intro p, .page-intro { color: var(--muted); font-size: 18px; }
.home-columns { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; }
.home-columns h2 { font: 500 14px/1.4 ui-monospace, monospace; margin: 0 0 22px; }
.post-card { padding: 24px 0; border-top: 1px solid var(--line); }
.post-card h2, .post-card h3 { margin: 0 0 12px; font-size: 23px; }
.post-card h2 a, .post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--accent); }
.post-card p { color: var(--muted); }
.project-panel { background: var(--surface); border: 1px solid var(--line); padding: 24px; align-self: start; }
.project-panel p { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.project-panel p a { font-size: 17px; display: inline-block; margin-bottom: 5px; }
.elsewhere { display: flex; gap: 12px 22px; flex-wrap: wrap; margin-top: 38px; font-size: 14px; }
.elsewhere span { color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 20px 0; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.site-footer p { margin: 0; }
.content-wrapper { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 32px; }
.sidebar { font-size: 14px; color: var(--muted); min-width: 0; }
.sidebar > div { border-top: 1px solid var(--line); margin-bottom: 28px; padding-top: 16px; }
.sidebar h3 { font: 500 14px/1.5 ui-monospace, monospace; color: var(--ink); margin: 0 0 18px; }
.sidebar ul { list-style: none; padding: 0; }
.rss-item { margin-bottom: 18px; }
.rss-item-date, .rss-item-review-note { font-size: 12px; }
.post-meta, .project-meta, .series-progress, .word-pos { font: 12px/1.7 ui-monospace, monospace; color: var(--muted); }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 8px 0; }
.post-excerpt { margin: 16px 0; }
.post-excerpt p { margin: 0; }
.post-content { font-size: 18px; line-height: 1.8; max-width: 68ch; overflow-wrap: anywhere; }
.post-header { margin-bottom: 32px; }
.post-content h2, .post-content h3 { margin-top: 1.8em; scroll-margin-top: 24px; }
img, video { max-width: 100%; height: auto; }
blockquote { margin: 24px 0; padding: 8px 24px; border-left: 3px solid var(--accent); color: var(--muted); }
pre { overflow: auto; padding: 20px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 1.6; }
code { font-family: ui-monospace, monospace; font-size: .88em; }
:not(pre) > code { background: var(--surface); padding: .1em .25em; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .nt, .highlight .nf { color: var(--accent); }
.highlight .c, .highlight .c1, .highlight .cm { color: var(--muted); font-style: italic; }
.highlight .s, .highlight .s1, .highlight .s2 { color: var(--ink); text-decoration: underline dotted var(--muted); }
.copy-code { font-size: 12px; margin-bottom: 16px; }
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin-bottom: 24px; }
th, td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.category-links, .social-links { display: grid; gap: 10px; }
.project-card, .series-card, .tag-card, .word-item { padding: 22px 0; border-top: 1px solid var(--line); }
.project-card h3 { margin: 0 0 12px; }
.project-description { margin: 12px 0; }
.post-series { margin: 32px 0; border: 1px solid var(--line); background: var(--surface); }
.series-banner { padding: 20px; }
.series-title { margin: 8px 0; }
.series-navigation { display: flex; border-top: 1px solid var(--line); }
.series-navigation > * { flex: 1; padding: 16px; min-width: 0; }
.series-nav-label, .series-nav-title { display: block; }
.series-nav-label { font-size: 12px; color: var(--muted); }
.words-controls, .filter-container { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.word-search { width: 100%; }
.word-card { border-top: 1px solid var(--line); padding: 16px 0; cursor: pointer; }
.word-card h3 { margin: 0 0 6px; }
.word-detail { display: none; background: var(--surface); border: 1px solid var(--line); padding: 24px; }
.word-detail.active { display: block; }
.word-detail-header { display: flex; justify-content: space-between; gap: 20px; }
.word-detail-close { cursor: pointer; font-size: 24px; }
.alphabet-links { display: flex; flex-wrap: wrap; gap: 10px; }
.stats, .words-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-value { color: var(--ink); font-size: 22px; }
@media (max-width: 1080px) { .content-wrapper { grid-template-columns: minmax(0, 1fr); } .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
@media (max-width: 850px) { .site-shell { grid-template-columns: 140px minmax(0, 1fr); gap: 28px; padding: 36px 24px; } .site-name { font-size: 16px; } .home-columns { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .site-shell { display: block; padding: 24px 20px; } .site-rail { position: static; border: 0; border-bottom: 1px solid var(--line); padding: 0 0 22px; margin-bottom: 32px; } .site-rail nav, .site-rail .secondary-nav { flex-direction: row; flex-wrap: wrap; gap: 12px 20px; margin: 18px 0; padding: 0; border: 0; } .sidebar { display: block; } .series-navigation { flex-direction: column; } .post-content { font-size: 17px; } }
.post-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-excerpt h2, .post-excerpt h3 { font-size: inherit; margin: 0; }
.rss-list { max-height: 520px; overflow-y: auto; padding-right: 8px !important; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 18px; margin: 24px 0; background: var(--surface); }
.callout-title { font-weight: 600; margin-bottom: 8px; }
.callout-content > :last-child { margin-bottom: 0; }
.word-card.selected { border-left: 3px solid var(--accent); padding-left: 14px; }
#mode-toggle::before { content: '○'; margin-right: 8px; }
#mode-toggle[aria-pressed=true]::before { content: '●'; }
/* Reading aids have a distinct surface, while staying within Workbench. */
.article-sidebar { align-self: start; position: sticky; top: 32px; display: block; }
.table-of-contents { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 18px; }
.table-of-contents summary { cursor: pointer; color: var(--ink); font-weight: 600; font-size: 15px; }
#toc { max-height: 65vh; overflow-y: auto; margin-top: 16px; }
#toc ul { margin: 0; padding: 0; list-style: none; }
#toc li + li { border-top: 1px solid var(--line); }
#toc a { display: block; padding: 11px 3px; line-height: 1.5; text-decoration: none; }
#toc a:hover { text-decoration: underline; }
#toc .toc-subsection { padding-left: 14px; font-size: 13px; }
.post-navigation { margin-top: 32px; padding: 20px; border: 1px solid var(--line); background: var(--surface); }
.sidebar .rss-widget { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 18px; }
.rss-widget-header { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 8px; }
.rss-widget-header h3 { font: 600 18px/1.3 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; margin-bottom: 8px; }
.rss-widget-header > a { font-size: 12px; }
.rss-widget .rss-list { margin: 0; }
.rss-widget .rss-item { padding: 16px 0; margin: 0; border-bottom: 1px solid var(--line); }
.rss-widget .rss-item:last-child { border-bottom: 0; }
.rss-item-title { display: block; color: var(--ink); font-weight: 600; line-height: 1.5; text-decoration: none; }
.rss-item-title:hover { color: var(--accent); text-decoration: underline; }
.rss-item-date { margin: 6px 0; font-family: ui-monospace, monospace; }
@media (max-width: 1080px) {
  .article-layout .article-sidebar { grid-row: 1; position: static; }
  #toc { max-height: 240px; }
}

#toc a[aria-current="location"] {
  color: var(--accent);
  font-weight: 700;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  background: var(--bg);
}
.profile-modules { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.home-module { min-width: 0; background: var(--surface); border: 1px solid var(--line); padding: 26px; overflow-wrap: anywhere; }
.module-full { grid-column: 1 / -1; }
.module-profile { background: none; border: 0; padding: 0 0 20px; }
.module-profile h1 { max-width: 18ch; }
.profile-intro { font-size: 18px; color: var(--muted); }
.module-profile .elsewhere { margin-top: 24px; }
.home-module h2 { margin: 0 0 24px; font: 500 14px/1.4 ui-monospace, monospace; color: var(--muted); }
.home-module h3 { margin: 0 0 16px; font-size: 25px; }
.home-module h3 a { color: var(--ink); text-decoration: none; }
.home-module h3 a:hover { color: var(--accent); text-decoration: underline; }
.module-word h3 { font-size: 32px; }
.showcase-meta { font: 12px/1.6 ui-monospace, monospace; color: var(--muted); }
.module-more { display: block; margin-top: 22px; font-size: 14px; }
.showcase-shuffle { font-size: 13px; }
.showcase-list { list-style: none; padding: 0; margin: 0 0 22px; }
.showcase-list li + li { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.showcase-list h3 { font-size: 19px; margin-bottom: 8px; }
.showcase-list p { font-size: 14px; margin-bottom: 0; }
.module-prose > :last-child { margin-bottom: 0; }
@media (max-width: 850px) { .profile-modules { grid-template-columns: minmax(0, 1fr); } }
.footer-signature { display: flex; align-items: center; gap: 10px; }
.site-footer { align-items: center; }
.cow { display: inline-block; flex-shrink: 0; font-size: 1.5rem; line-height: 1; min-width: 44px; min-height: 44px; padding: 8px; border: 0; background: transparent; cursor: pointer; }
.cow.jumping { animation: cow-hop .6s ease; }
@keyframes cow-hop {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-15px) rotate(-5deg); }
  50% { transform: translateY(-25px); }
  75% { transform: translateY(-10px) rotate(5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .cow.jumping { animation: cow-acknowledge .3s ease; }
  @keyframes cow-acknowledge { 50% { background-color: var(--surface); outline: 1px solid var(--accent); } }
}
/* Native word details remain usable before JavaScript and without it. */
.word-card summary { cursor: pointer; }
.word-card .word-title { font-size: 21px; font-weight: 600; margin-right: 10px; }
.word-card .word-brief { display: block; margin: 8px 0 0; color: var(--muted); }
.word-expanded { padding: 18px 0 0; }
.word-card[open] { border-left: 3px solid var(--accent); padding-left: 14px; }
.word-card[open] .word-brief { display: none; }
.word-letter-anchor { scroll-margin-top: 24px; }
.alphabet-link[aria-current] { font-weight: 700; text-decoration-thickness: 3px; }
.alphabet-link.disabled { color: var(--muted); }
@media (min-width: 851px) {
  .profile-modules.independent-stacks { grid-auto-rows: 1px; row-gap: 0; }
}

/* Short entries are readable in full, without the article sidebar. */
.notes-page { max-width: 68ch; }
.note-entry { padding: 28px 0; border-top: 1px solid var(--line); }
.note-entry header { margin-bottom: 18px; }
.note-entry header h2 { margin: 0 0 10px; font-size: 23px; }
.note-entry header h2 a { color: var(--ink); text-decoration: none; }
.note-entry header h2 a:hover { color: var(--accent); }
.notes-empty { padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); }
