/*
  ericiscool.net — "The Workstation"
  You're sitting at Eric's terminal. Window chrome nav, pane-style content,
  vim status bar footer. Press Start 2P for identity, Fira Code for everything else.
*/
:root {
  --bg: #0b0614;
  --surface: #130826;
  --surface2: #1b0f33;
  --editor-bg: #0d0a1a;
  --gutter: #1a1230;
  --line-num: #4a3870;
  --text: #f2e9ff;
  --muted: #b9a6d3;
  --primary: #7c3aed;
  --primaryHi: #a855f7;
  --accent: #22d3ee;
  --green: #4ade80;
  --yellow: #fbbf24;
  --pink: #fb7185;
  --orange: #fb923c;
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(168, 85, 247, 0.3);
  --glow-purple: rgba(124, 58, 237, 0.2);
  --glow-cyan: rgba(34, 211, 238, 0.15);

  --pixel: "Press Start 2P", monospace;
  --code: "Fira Code", "Cascadia Code", "JetBrains Mono", "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: var(--code);
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-feature-settings: "liga" 1, "calt" 1;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
  color: var(--primaryHi);
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

/* Current-work refresh: retain the existing workstation palette and shell. */
.skip-link { position: absolute; top: -100px; left: 12px; z-index: 100; padding: 10px 16px; background: var(--surface2); }
.skip-link:focus { top: 8px; }
:is(summary, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.copy-review { border-left: 3px solid var(--primaryHi); background: var(--surface); padding: 10px 14px; margin-bottom: 28px; color: var(--muted); font-size: .78rem; }
.copy-review strong { color: var(--text); }
.home-heading { font-size: clamp(1.8rem, 5vw, 2.8rem); letter-spacing: -.04em; margin-top: -16px; }
.identity-line { color: var(--muted); font-size: .8rem; margin-bottom: 24px; }
.home-intro { max-width: 70ch; margin-bottom: 32px; }
.home-intro p { margin: 0 0 14px; }
.home-intro p:first-child { font-size: 1.15rem; color: var(--text); }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.section-heading h2, .section-title { font-size: 1rem; color: var(--primaryHi); }
.section-heading a { font-size: .8rem; }
.project-section { margin: 28px 0; }
.section-title { margin-bottom: 16px; }
.project-card .project-header { flex-wrap: wrap; }
.project-card .panel-link { display: inline-block; margin-top: 12px; }
article.project-card { cursor: default; }
.home-grid { margin-top: 28px; }
.home-story-image { width: 100%; height: 170px; object-fit: cover; border-radius: 6px; margin-bottom: 14px; }
.home-grid .panel-link { display: block; margin-top: 12px; }
.now-story { max-width: 70ch; }
.now-story section { margin-bottom: 32px; }
.research-intro { margin-bottom: 30px; }
.historical-note { color: var(--muted); font-size: .8rem; margin-bottom: 24px; }
.metrics-project-header { flex-wrap: wrap; }
.preview-identity { color: var(--muted); font-size: .7rem; padding: 10px 18px; border-bottom: 1px solid var(--border-bright); overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .site-nav { flex-wrap: wrap; }
  .site-nav .nav-link { flex: 0 0 auto; }
  .project-header { gap: 8px; }
  .copy-review { font-size: .75rem; }
}

/* ============================================
   SITE SHELL — window chrome wrapper
   ============================================ */
.site-shell {
  width: min(100%, 900px);
  margin: 24px auto 0;
  padding: 0;
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(124, 58, 237, 0.06);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ============================================
   TITLE BAR — macOS-style window chrome
   ============================================ */
.title-bar {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  background: var(--gutter);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.traffic-lights {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.traffic-lights span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
}

.traffic-lights .red { background: var(--pink); }
.traffic-lights .yellow { background: var(--yellow); }
.traffic-lights .green { background: var(--green); }

.title-bar-text {
  flex: 1;
  text-align: center;
  font-family: var(--code);
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.title-bar-gh {
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color 0.15s;
  flex-shrink: 0;
}

.title-bar-gh:hover {
  color: var(--text);
  text-shadow: none;
}

/* ============================================
   NAV — tab bar below title bar
   ============================================ */
.site-nav {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.nav-link {
  font-family: var(--code);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  padding: 10px 18px;
  border-right: 1px solid var(--border);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(124, 58, 237, 0.08);
  text-shadow: none;
}

.nav-link[aria-current="page"] {
  color: var(--text);
  background: var(--bg);
  font-weight: 500;
}

.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow-cyan);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
main {
  padding: 32px 36px 40px;
  flex: 1;
}

/* ============================================
   STATUS BAR — vim-style footer
   ============================================ */
.status-bar {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  background: var(--primary);
  font-family: var(--code);
  font-size: 0.68rem;
  font-weight: 500;
  color: #fff;
  flex-shrink: 0;
  gap: 0;
  border-radius: 0 0 10px 10px;
}

.status-mode {
  background: var(--surface);
  color: var(--accent);
  padding: 2px 10px;
  margin-right: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.status-file {
  color: rgba(255, 255, 255, 0.9);
}

.status-right {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

/* ============================================
   PAGE HEADERS
   ============================================ */
.page-title {
  font-family: var(--pixel);
  font-size: clamp(0.75rem, 2.5vw, 1.1rem);
  margin: 0 0 8px;
  color: var(--text);
  text-shadow: 0 0 30px var(--glow-purple);
}

.page-subtitle {
  font-family: var(--code);
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 28px;
  font-weight: 300;
}

/* ============================================
   HOMEPAGE — Intro line
   ============================================ */
.intro-line {
  font-family: var(--code);
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.8;
  animation: fadeIn 0.6s ease both;
}

.intro-line .prompt {
  color: var(--green);
  font-weight: 600;
  margin-right: 0.5ch;
  user-select: none;
}

.intro-line .flag {
  color: var(--accent);
}

.intro-line .arg {
  color: var(--yellow);
}

.intro-line .pipe {
  color: var(--line-num);
  margin: 0 0.5ch;
}

/* ============================================
   HOMEPAGE — Hero panel (Quest Ledger)
   ============================================ */
.hero-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, transparent 60%),
    var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 20px;
  text-decoration: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  animation: fadeIn 0.6s 0.1s ease both;
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primaryHi), var(--accent));
  opacity: 0.6;
}

.hero-panel:hover {
  border-color: var(--primaryHi);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.4),
    0 0 40px var(--glow-purple);
  text-shadow: none;
}

.hero-panel:hover .hero-cta {
  color: var(--accent);
}

.hero-content {
  min-width: 0;
}

.hero-label {
  font-family: var(--code);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.hero-title {
  font-family: var(--pixel);
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  color: var(--text);
  margin-bottom: 12px;
}

.hero-desc {
  font-family: var(--code);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  text-align: justify;
  margin-bottom: 16px;
  font-weight: 400;
}

.hero-cta {
  font-family: var(--code);
  font-size: 0.78rem;
  color: var(--line-num);
  transition: color 0.2s;
  font-weight: 500;
}

/* HUD stats sidebar */
.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-left: 1px solid var(--border);
  padding-left: 24px;
  min-width: 140px;
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
  font-family: var(--code);
  font-size: 0.72rem;
}

.stat-label {
  color: var(--line-num);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 400;
}

.stat-value {
  color: var(--muted);
  font-weight: 500;
  text-align: right;
}

.stat-value.active {
  color: var(--green);
}

/* ============================================
   HOMEPAGE — Grid panels
   ============================================ */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 22px;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.panel:nth-child(1) { animation: fadeIn 0.5s 0.2s ease both; }
.panel:nth-child(2) { animation: fadeIn 0.5s 0.3s ease both; }
.panel:nth-child(3) { animation: fadeIn 0.5s 0.4s ease both; }
.panel:nth-child(4) { animation: fadeIn 0.5s 0.5s ease both; }

.panel:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.panel-title {
  font-family: var(--pixel);
  font-size: 0.58rem;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.panel-desc {
  font-family: var(--code);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.65;
  font-weight: 400;
  text-align: justify;
  flex: 1;
}

.panel-link {
  font-family: var(--code);
  font-size: 0.72rem;
  color: var(--line-num);
  margin-top: 12px;
  transition: color 0.2s;
}

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

/* Research numbers callout */
.research-nums {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.research-num {
  font-family: var(--code);
  font-size: 0.72rem;
  line-height: 1.4;
}

.research-num .n {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.research-num .label {
  color: var(--line-num);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Research data cards — used on /research page */
.data-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 1.5em 0;
}

.data-card {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.data-card-num {
  font-family: var(--code);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.data-card-label {
  font-family: var(--code);
  font-size: 0.62rem;
  color: var(--line-num);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================
   RESEARCH — Hero metrics bar
   ============================================ */
.metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 2px;
  margin-bottom: 28px;
  background: var(--border);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-bright);
  animation: fadeIn 0.5s ease both;
}

.metric {
  background: var(--surface);
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-num {
  font-family: var(--code);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.metric-label {
  font-family: var(--code);
  font-size: 0.58rem;
  color: var(--line-num);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================
   RESEARCH — Collapsible sections
   ============================================ */
.research-section {
  margin-top: 2em;
  border: none;
}

.research-section[open] > .section-toggle .section-toggle-icon {
  transform: rotate(90deg);
}

.section-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-family: var(--pixel);
  font-size: 0.78rem;
  color: var(--accent);
  text-shadow: 0 0 12px var(--glow-cyan);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75em;
  user-select: none;
  transition: color 0.15s;
}

.section-toggle:hover {
  color: var(--primaryHi);
}

.section-toggle::-webkit-details-marker { display: none; }
.section-toggle::marker { content: ''; }

.section-toggle-icon {
  font-family: var(--code);
  font-size: 0.6rem;
  color: var(--line-num);
  transition: transform 0.15s;
  display: inline-block;
}

.section-body {
  animation: fadeIn 0.3s ease both;
}

/* ============================================
   RESEARCH — Data table
   ============================================ */
.data-table-wrap {
  overflow-x: auto;
  margin: 1em 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--code);
  font-size: 0.8rem;
}

.data-table th {
  text-align: left;
  padding: 6px 12px;
  color: var(--primaryHi);
  border-bottom: 1px solid var(--border-bright);
  font-weight: 600;
  white-space: nowrap;
}

.data-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--surface);
}

/* ============================================
   RESEARCH — Tool cards
   ============================================ */
.tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 1em 0;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  transition: border-color 0.2s;
}

.tool-card:hover {
  border-color: var(--border-bright);
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tool-card-name {
  font-family: var(--code);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.tool-card-desc {
  font-family: var(--code);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 10px;
}

.tool-card-link {
  font-family: var(--code);
  font-size: 0.72rem;
  color: var(--accent);
}

/* ============================================
   PROSE — code-editor style content
   ============================================ */
.prose {
  font-family: var(--code);
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--text);
  font-weight: 400;
  max-width: 68ch;
  text-align: justify;
}

/* Collapsible sections in blog posts */
.prose details {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  margin: 1.5em 0;
  background: var(--surface);
}

.prose details[open] {
  border-color: var(--border-bright);
}

.prose summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--primaryHi);
  font-size: 0.85rem;
  list-style: none;
  user-select: none;
}

.prose summary::before {
  content: '+ ';
  font-family: var(--code);
}

.prose details[open] summary::before {
  content: '- ';
}

.prose summary::-webkit-details-marker {
  display: none;
}

.prose details > *:not(summary) {
  padding: 0 16px;
}

/* Editor gutter — line numbers on paragraphs */
.prose--editor {
  counter-reset: editor-line;
  border-left: 1px solid var(--border-bright);
  padding-left: 3.5ch;
  position: relative;
  margin-left: 1ch;
}

.prose--editor > p,
.prose--editor > ul,
.prose--editor > ol,
.prose--editor > blockquote {
  position: relative;
  transition: border-color 0.15s;
  border-left: 2px solid transparent;
  padding-left: 8px;
  margin-left: -3.5ch;
  padding-left: calc(3.5ch + 8px);
}

.prose--editor > p::before,
.prose--editor > ul::before,
.prose--editor > ol::before,
.prose--editor > blockquote::before {
  counter-increment: editor-line;
  content: counter(editor-line, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--line-num);
  font-size: 0.75em;
  font-family: var(--code);
  font-weight: 300;
  line-height: 1.85;
  user-select: none;
}

.prose--editor > p:hover,
.prose--editor > ul:hover,
.prose--editor > ol:hover,
.prose--editor > blockquote:hover {
  border-left-color: var(--accent);
  background: rgba(34, 211, 238, 0.03);
}

.prose--editor > p:hover::before,
.prose--editor > ul:hover::before,
.prose--editor > ol:hover::before,
.prose--editor > blockquote:hover::before {
  color: var(--accent);
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: var(--pixel);
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  line-height: 1.4;
}

.prose--editor h2::before {
  content: '// ';
  color: var(--line-num);
  font-family: var(--code);
  font-weight: 400;
}

.prose--editor h3::before {
  content: '/* ';
  color: var(--line-num);
  font-family: var(--code);
  font-weight: 400;
}

.prose--editor h3::after {
  content: ' */';
  color: var(--line-num);
  font-family: var(--code);
  font-weight: 400;
}

.prose h2 {
  font-size: 0.78rem;
  color: var(--accent);
  text-shadow: 0 0 12px var(--glow-cyan);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-size: 0.68rem;
  color: var(--primaryHi);
}

.prose p {
  margin: 1.2em 0;
}

.prose code {
  font-family: var(--code);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  color: var(--yellow);
}

.prose pre {
  background: var(--editor-bg);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  margin: 1.5em 0;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(124, 58, 237, 0.1);
  position: relative;
}

.prose pre::before {
  content: '';
  display: block;
  height: 32px;
  background: var(--gutter);
  border-bottom: 1px solid var(--border);
  background-image:
    radial-gradient(circle at 16px 16px, var(--pink) 5px, transparent 5px),
    radial-gradient(circle at 36px 16px, var(--yellow) 5px, transparent 5px),
    radial-gradient(circle at 56px 16px, var(--green) 5px, transparent 5px);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.prose pre code {
  display: block;
  background: none;
  padding: 16px 20px;
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5em 0;
  padding: 12px 20px;
  background: rgba(34, 211, 238, 0.06);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-style: italic;
}

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

.prose li {
  margin: 0.6em 0;
}

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

.prose strong {
  color: var(--accent);
  font-weight: 600;
}

.prose em {
  color: var(--muted);
  font-style: italic;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* ============================================
   CARDS — for blog listings, etc.
   ============================================ */
.card-grid {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 22px;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
}

.card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.card-hero {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 14px;
}

.card-title {
  font-family: var(--pixel);
  font-size: 0.6rem;
  margin: 0 0 8px;
  color: var(--text);
}

.card-meta {
  font-family: var(--code);
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 300;
}

.card-desc {
  font-family: var(--code);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
  font-weight: 400;
  text-align: justify;
}

/* ============================================
   TAGS
   ============================================ */
.tag {
  display: inline-block;
  font-family: var(--code);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 8px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 3px;
  color: var(--accent);
  letter-spacing: 0.03em;
}

/* ============================================
   WRITING PAGE — pinned research banner
   ============================================ */
.pinned-section {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 28px;
  position: relative;
}

.pinned-section::before {
  content: 'pinned';
  position: absolute;
  top: -9px;
  left: 16px;
  font-family: var(--code);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--bg);
  padding: 0 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pinned-title {
  font-family: var(--pixel);
  font-size: 0.58rem;
  color: var(--text);
  margin-bottom: 6px;
}

.pinned-desc {
  font-family: var(--code);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  text-align: justify;
}

.pinned-link {
  font-family: var(--code);
  font-size: 0.72rem;
  color: var(--accent);
  display: inline-block;
  margin-top: 10px;
}

/* ============================================
   PROJECTS PAGE — repo cards
   ============================================ */
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
  text-shadow: none;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}

.project-name {
  font-family: var(--code);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.project-status {
  font-family: var(--code);
  font-size: 0.6rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: lowercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.project-status.shipping {
  color: var(--green);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.project-status.active {
  color: var(--green);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.project-status.unreleased {
  color: var(--primaryHi);
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.project-status.beta {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.project-status.archived {
  color: var(--line-num);
  background: rgba(74, 56, 112, 0.15);
  border: 1px solid rgba(74, 56, 112, 0.3);
}

.project-desc {
  font-family: var(--code);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
  text-align: justify;
  flex: 1;
  margin: 0;
}

.project-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  font-family: var(--code);
  font-size: 0.68rem;
}

.project-lang {
  color: var(--yellow);
}

.project-stars {
  color: var(--muted);
}

.project-gh-link {
  color: var(--accent);
  font-size: 0.65rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.project-card:hover .project-gh-link {
  opacity: 1;
}

.project-card--no-link {
  cursor: default;
}

.project-card--no-link:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

/* Archive section */
.archive-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.archive-heading {
  font-family: var(--code);
  font-size: 0.72rem;
  color: var(--line-num);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.archive-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--code);
  transition: background 0.15s;
}

.archive-item:first-child {
  border-top: 1px solid var(--border);
}

.archive-item:hover {
  background: rgba(124, 58, 237, 0.04);
}

.archive-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.archive-desc {
  font-size: 0.75rem;
  color: var(--line-num);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-lang {
  font-size: 0.68rem;
  color: var(--yellow);
  white-space: nowrap;
}

/* ============================================
   NOW PAGE — activity cards
   ============================================ */
.now-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.now-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 20px;
  transition: border-color 0.2s;
}

.now-card.active {
  border-color: var(--border-bright);
}

.now-card:hover {
  border-color: var(--border-bright);
}

.now-status {
  font-family: var(--code);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 6px;
}

.now-status.study { color: var(--yellow); }
.now-status.research { color: var(--accent); }

.now-title {
  font-family: var(--pixel);
  font-size: 0.52rem;
  color: var(--text);
  margin: 0 0 8px;
}

.now-desc {
  font-family: var(--code);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
  text-align: justify;
  margin: 0;
}

.now-link {
  font-family: var(--code);
  font-size: 0.7rem;
  color: var(--accent);
  display: inline-block;
  margin-top: 8px;
}

.now-aside {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.now-also {
  font-family: var(--code);
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 300;
}

/* ============================================
   GAME TEASER — bottom of homepage
   ============================================ */
.game-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 16px 22px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 6px;
  animation: fadeIn 0.5s 0.6s ease both;
}

.game-teaser-left {
  flex: 1;
}

.game-teaser-desc {
  font-family: var(--code);
  font-size: 0.78rem;
  color: var(--line-num);
  line-height: 1.5;
  margin: 4px 0 0;
}

.game-teaser-link {
  font-family: var(--code);
  font-size: 0.78rem;
  color: var(--accent);
  white-space: nowrap;
  padding: 6px 14px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 4px;
  transition: background 0.2s, border-color 0.2s;
  text-decoration: none;
}

.game-teaser-link:hover {
  background: rgba(34, 211, 238, 0.08);
  border-color: var(--accent);
  text-shadow: none;
}

/* ============================================
   EDITORIAL — Post listing (file-tree style)
   ============================================ */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-list-item {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  text-decoration: none;
}

.post-list-item:first-child {
  border-top: 1px solid var(--border);
}

.post-list-item:hover {
  background: rgba(124, 58, 237, 0.04);
}

.post-number {
  font-family: var(--code);
  font-size: 0.72rem;
  color: var(--line-num);
  text-align: right;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.post-list-item:hover .post-number {
  color: var(--accent);
}

.post-list-content {
  min-width: 0;
}

.post-list-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.post-list-title {
  font-family: var(--code);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.post-list-desc {
  font-family: var(--code);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 4px 0 0;
  text-align: justify;
}

.post-list-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-family: var(--code);
  font-size: 0.68rem;
  color: var(--line-num);
}

.meta-sep {
  color: var(--primary);
  opacity: 0.5;
}

/* Status badges — git stage metaphor */
.badge {
  font-family: var(--code);
  font-size: 0.58rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 2px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.badge--draft {
  color: var(--primaryHi);
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.badge--rc {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.badge--stable {
  color: var(--green);
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

/* ============================================
   EDITORIAL — Post window chrome
   ============================================ */
.post-article {
  animation: fadeIn 0.5s ease both;
}

.post-window {
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(124, 58, 237, 0.08);
}

.post-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--gutter);
  border-bottom: 1px solid var(--border);
  font-family: var(--code);
  font-size: 0.68rem;
  color: var(--muted);
}

.post-titlebar-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.post-titlebar-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}

.dot-r { background: var(--pink); }
.dot-y { background: var(--yellow); }
.dot-g { background: var(--green); }

.post-titlebar-file {
  color: var(--muted);
  font-weight: 400;
}

.post-titlebar-time {
  margin-left: auto;
  color: var(--line-num);
  font-weight: 400;
}

.post-window-body {
  padding: 28px 32px 36px;
}

/* Post header inside window */
.post-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: var(--code);
  font-size: 0.72rem;
  color: var(--line-num);
  flex-wrap: wrap;
}

/* Leading paragraph emphasis */
.post-body > p:first-of-type {
  font-size: 1.02em;
  color: #f5eeff;
  line-height: 1.9;
}

/* Drop cap — pixel font first letter */
.post-body > p:first-of-type::first-letter {
  font-family: var(--pixel);
  font-size: 3.2rem;
  line-height: 0.85;
  float: left;
  margin-right: 0.15em;
  margin-top: 0.1em;
  color: var(--primaryHi);
  text-shadow: 0 0 20px var(--glow-purple);
}

/* Section dividers */
.post-body hr,
.prose--editor hr {
  border: none;
  border-top: 1px dashed #333;
  margin: 2.5em 0;
  opacity: 0.6;
}

/* Pull quote */
.post-body blockquote em,
.post-body > blockquote:not(:first-of-type) {
  position: relative;
}

.post-body .pull-quote,
.prose--editor .pull-quote {
  font-size: 1.15em;
  line-height: 1.7;
  color: var(--primaryHi);
  border-left: 3px solid var(--primary);
  background: rgba(124, 58, 237, 0.04);
  padding: 16px 20px;
  margin: 2em 0;
  font-style: italic;
}

/* Blockquote refinement */
.post-body blockquote,
.prose--editor blockquote {
  border-left: 2px solid var(--primary);
  background: rgba(124, 58, 237, 0.03);
  padding: 12px 18px;
  margin: 1.5em 0;
  color: var(--muted);
}

/* Heading spacing and accent polish */
.prose--editor h2 {
  margin-top: 3em;
  margin-bottom: 1em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 1000;
  transition: width 50ms linear;
  pointer-events: none;
}

/* ============================================
   EDITORIAL — Callout system
   ============================================ */
.callout {
  margin: 1.5em 0;
  padding: 14px 18px;
  border-radius: 4px;
  border-left: 3px solid;
  font-family: var(--code);
  font-size: 0.85rem;
  line-height: 1.65;
}

.callout--note {
  background: rgba(124, 58, 237, 0.06);
  border-color: var(--primary);
  color: var(--muted);
}

.callout--tip {
  background: rgba(34, 211, 238, 0.06);
  border-color: var(--accent);
  color: var(--muted);
}

.callout--warning {
  background: rgba(251, 191, 36, 0.06);
  border-color: var(--yellow);
  color: var(--muted);
}

.callout::before {
  content: attr(data-label);
  font-family: var(--code);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: inherit;
  opacity: 0.7;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 700px) {
  .site-shell {
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .status-bar {
    border-radius: 0;
  }

  main {
    padding: 24px 20px 32px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
  }

  .stat {
    flex-direction: column;
    gap: 2px;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .metrics-bar {
    grid-template-columns: repeat(4, 1fr);
  }

  .metric {
    padding: 12px 8px;
  }

  .metric-num {
    font-size: 1rem;
  }

  .tool-cards {
    grid-template-columns: 1fr;
  }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .archive-desc {
    white-space: normal;
  }

  .now-grid {
    grid-template-columns: 1fr;
  }

  .game-teaser {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-window-body {
    padding: 20px 18px 28px;
  }

  .post-list-item {
    grid-template-columns: 1fr;
  }

  .post-number {
    display: none;
  }

  .nav-link {
    font-size: 0.7rem;
    padding: 8px 14px;
  }

  .title-bar-text {
    font-size: 0.65rem;
    margin-right: 0;
  }

  body {
    font-size: 14px;
  }

  /* Tighten editor gutter on mobile */
  .prose--editor {
    padding-left: 2.5ch;
    margin-left: 0;
  }

  .prose--editor > p,
  .prose--editor > ul,
  .prose--editor > ol,
  .prose--editor > blockquote {
    margin-left: -2.5ch;
    padding-left: calc(2.5ch + 6px);
  }

  /* Disable drop cap on mobile — too large for narrow viewports */
  .post-body > p:first-of-type::first-letter {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    float: none;
    margin: 0;
    color: inherit;
    text-shadow: none;
  }
}

@media (max-width: 400px) {
  .nav-link {
    font-size: 0.65rem;
    padding: 8px 10px;
  }

  .traffic-lights span {
    width: 10px;
    height: 10px;
  }
}

/* --- Lightbox overrides (medium-zoom) --- */
.medium-zoom-overlay {
  z-index: 100;
}
.medium-zoom-image--opened {
  z-index: 101;
}
.post-body img {
  cursor: zoom-in;
  border-radius: var(--radius-md, 6px);
  transition: transform 0.2s;
}
/* Image pair grid for side-by-side images */
.img-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 1.5em 0;
}
.img-pair img {
  width: 100%;
  border-radius: var(--radius-md, 6px);
}
@media (max-width: 600px) {
  .img-pair { grid-template-columns: 1fr; }
}

/* Keep small action labels legible without relying on hover. */
.panel .panel-link, .project-card .panel-link { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .panel, .intro-line, .hero-panel, .project-card { opacity: 1; transform: none; }
}
.home-grid .panel-title { font-family: var(--code); font-size: .9rem; }

/* Reading labels remain visible across the historical sections. */
.metric-label, .post-list-meta, .post-number, .metrics-timestamp { color: var(--muted); }
.now-story { text-align: left; }

/* ==================================================================
   SHARE / EXPLORER VIEWS
   Ported from wuforge/share-site design/share-views/share.css at
   57d84925d1bd6b07351a5bdc49a6dd3ceff7db70 (design return, owner-reviewed
   2026-10-25). Omitted: the mockup-only banner and the Watermelon
   .ps/.ba/.callout treatments, so the canonical article renders unchanged.
   ================================================================== */
/* ------------------------------------------------------------------ focus */
/* global.css only styles a:focus-visible; Share controls need the same ring. */
.share button:focus-visible,
.share input:focus-visible,
.share select:focus-visible,
.share summary:focus-visible,
.share [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.share .row:focus-visible,
.share .tl-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;          /* inside the row so it never clips at the shell edge */
  background: rgba(34, 211, 238, 0.06);
}

/* ------------------------------------------------------------------ breadcrumb ("cd" line) */
.crumbs {
  font-family: var(--code);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 18px;
}
.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  align-items: baseline;
}
.crumbs li { display: inline-flex; align-items: baseline; min-width: 0; }
.crumbs .prompt { color: var(--green); font-weight: 600; margin-right: 0.6ch; user-select: none; }
.crumbs a { color: var(--accent); }
.crumbs .sep { color: var(--primary); margin: 0 0.5ch; }
.crumbs [aria-current="page"] { color: var(--text); font-weight: 600; }
.crumbs .up {
  margin-left: auto;
  color: var(--muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ folder header (compact: no prose) */
.folder-head { margin-bottom: 4px; }
.folder-head .folder-facts { display: inline-flex; margin: 0 0 0 14px; vertical-align: middle; }
.folder-head .page-title { display: inline; margin-right: 10px; text-transform: none; }
.folder-head .badge { vertical-align: middle; }
.folder-intro {
  font-family: var(--code);
  font-size: 0.9rem;
  color: var(--text);
  max-width: 68ch;
  line-height: 1.75;
  margin: 10px 0 0;
}
.folder-intro p + p { margin-top: 0.8em; }
.folder-intro .placeholder { color: var(--muted); font-style: italic; }

.folder-links {
  margin: 14px 0 0;
  font-family: var(--code);
  font-size: 0.78rem;
}
.folder-links h2 {
  font-family: var(--code);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--line-num);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.folder-links ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.folder-links a::before { content: '▸ '; color: var(--line-num); }
.folder-links .ext::after { content: ' ↗'; color: var(--line-num); font-size: 0.9em; }

/* README window under the listing: the folder's own folder.md body, only when it has one */
.readme { margin: 28px 0 8px; }
.readme .post-titlebar-file { font-weight: 600; color: var(--text); letter-spacing: 0.08em; }
.readme .post-window-body { padding: 20px 26px 24px; }
.readme .prose p { margin: 0 0 1em; font-size: 0.88rem; }
.readme .prose p:last-child { margin-bottom: 0; }

/* file-name token after a title: the node ID, which is also the URL tail */
.fname { display: inline-block; font-size: 0.7rem; color: var(--line-num); font-weight: 400; margin-left: 6px; word-break: normal; }
.row:hover .fname { color: var(--muted); }

/* "Latest" strip (not used on folder pages any more; kept for a possible home-page teaser) */
.latest {
  margin: 22px 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 14px 18px 12px;
}
.latest h2 {
  font-family: var(--code);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.latest ol { list-style: none; }
.latest li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0 14px;
  padding: 5px 0;
  font-family: var(--code);
  font-size: 0.8rem;
  border-top: 1px dashed var(--border);
}
.latest li:first-child { border-top: none; }
.latest time, .latest .undated { color: var(--line-num); font-variant-numeric: tabular-nums; }
.latest .more { margin-top: 8px; font-size: 0.74rem; }

/* ------------------------------------------------------------------ view switch */
.view-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin: 22px 0 0;
  gap: 2px;
}
.view-tabs a {
  font-family: var(--code);
  font-size: 0.76rem;
  color: var(--muted);
  padding: 9px 16px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  position: relative;
  bottom: -1px;
}
.view-tabs a:hover { color: var(--text); background: rgba(124, 58, 237, 0.08); text-shadow: none; }
.view-tabs a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background: var(--bg);
  border-color: var(--border);
}
.view-tabs a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 2px;
  background: var(--accent);
}
.view-tabs .count { color: var(--line-num); font-weight: 400; margin-left: 0.5ch; }

/* ------------------------------------------------------------------ search / filter / sort */
.tools {
  margin: 16px 0 10px;
  font-family: var(--code);
  font-size: 0.78rem;
}
.tools[hidden] { display: none; }
.tools form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  align-items: end;
}
.tools label { display: block; color: var(--muted); font-size: 0.7rem; margin-bottom: 4px; }
.tools input[type="search"] {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--editor-bg);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  padding: 8px 10px 8px 2.4ch;
  background-image: none;
}
.tools .search-wrap { position: relative; }
.tools .search-wrap::before {
  content: '/';
  position: absolute;
  left: 10px;
  bottom: 9px;
  color: var(--green);
  font-weight: 600;
  pointer-events: none;
}
.tools .kbd {
  font-size: 0.62rem;
  color: var(--line-num);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 5px;
  margin-left: 6px;
}
.tools fieldset { border: none; display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.tools legend { float: left; color: var(--muted); font-size: 0.7rem; margin-right: 6px; }
.tools .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 8px;
  color: var(--muted);
  cursor: pointer;
}
.tools .chip input { margin: 0; accent-color: var(--primaryHi); }
.tools .chip:has(input:checked) { color: var(--text); border-color: var(--border-bright); background: rgba(124, 58, 237, 0.1); }
.tools select {
  font: inherit;
  font-size: 0.78rem;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
}
.tools .filters-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.tools .clear { color: var(--accent); }
.result-status {
  font-family: var(--code);
  font-size: 0.74rem;
  color: var(--muted);
  margin: 6px 0 12px;
}
.result-status strong { color: var(--text); font-weight: 600; }
.noscript-note {
  font-family: var(--code);
  font-size: 0.74rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  margin: 14px 0;
}

/* collapsed filters on narrow screens */
.tools details { border: 1px solid var(--border); border-radius: 4px; }
.tools details summary {
  cursor: pointer;
  padding: 7px 10px;
  color: var(--muted);
  list-style: none;
}
.tools details summary::before { content: '+ '; }
.tools details[open] summary::before { content: '- '; }
.tools details summary::-webkit-details-marker { display: none; }
.tools details > div { padding: 4px 10px 10px; display: flex; flex-wrap: wrap; gap: 10px 22px; }

/* ------------------------------------------------------------------ pinned (folder.yaml `pinned:`) */
.pins { padding: 14px 14px 6px; margin: 18px 0 4px; }
.pins ol { list-style: none; }
.pins .row { border-bottom: 1px dashed var(--border); padding: 9px 4px; }
.pins li:last-child .row { border-bottom: none; }
.pins .where { font-size: 0.68rem; color: var(--line-num); margin-top: 2px; }
.pins .where .sep { color: var(--primary); margin: 0 0.4ch; }

/* ------------------------------------------------------------------ explorer listing */
.listing { list-style: none; margin: 0; }
.listing .row, .pins .row {
  display: grid;
  grid-template-columns: 4.6rem 1fr auto;
  gap: 0 14px;
  align-items: baseline;
  padding: 11px 6px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-family: var(--code);
  transition: background 0.15s;
}
.listing li:first-child .row { border-top: 1px solid var(--border); }
.listing .row:hover { background: rgba(124, 58, 237, 0.05); text-shadow: none; color: var(--text); }
.listing .row[hidden] { display: none; }
.listing .kind, .pins .kind {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 6px;
  text-align: center;
  white-space: nowrap;
}
.listing .kind--dir { color: var(--accent); border-color: rgba(34, 211, 238, 0.3); }
.listing .name, .pins .name { min-width: 0; }
.listing .title, .pins .title { font-size: 0.9rem; font-weight: 600; }
.listing .row:hover .title, .pins .row:hover .title { color: var(--primaryHi); }
.pins .row:hover { background: rgba(124, 58, 237, 0.05); text-shadow: none; color: var(--text); }
.listing .folder-slug { font-size: 0.9rem; font-weight: 400; color: var(--text); text-transform: none; }
.listing .summary, .pins .summary {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.5;
}
.listing .meta, .pins .meta {
  font-size: 0.7rem;
  color: var(--line-num);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.listing .meta .badge { margin-left: 8px; }
.listing .tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.listing .tags .tag { font-size: 0.62rem; padding: 1px 6px; }

.empty {
  font-family: var(--code);
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 22px 20px;
  margin: 14px 0;
}
.empty p + p { margin-top: 8px; }
.empty .cmd { color: var(--line-num); font-size: 0.78rem; }
.empty .cmd .prompt { color: var(--green); font-weight: 600; }

/* ------------------------------------------------------------------ timeline */
.tl { margin-top: 6px; }
.tl-group { margin: 22px 0 0; }
.tl-group > h2 {
  font-family: var(--pixel);
  font-size: 0.66rem;
  color: var(--accent);
  text-shadow: 0 0 12px var(--glow-cyan);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.tl-group > h2::before { content: '// '; color: var(--line-num); font-family: var(--code); font-weight: 400; }
.tl-group > h2 .n { color: var(--line-num); font-family: var(--code); font-size: 0.7rem; margin-left: 10px; }
.tl-group--undated > h2 { color: var(--muted); text-shadow: none; }
.tl ol { list-style: none; }
.tl-item {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0 16px;
  padding: 16px 6px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-family: var(--code);
}
.tl-item:hover { background: rgba(124, 58, 237, 0.04); text-shadow: none; color: var(--text); }
.tl-item .when { font-size: 0.74rem; color: var(--line-num); font-variant-numeric: tabular-nums; padding-top: 2px; }
.tl-item .when .undated { color: var(--muted); font-style: italic; }
.tl-item .head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.tl-item .title { font-size: 0.92rem; font-weight: 600; }
.tl-item:hover .title { color: var(--primaryHi); }
.tl-item .kind {
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 6px;
}
.tl-item .where { font-size: 0.68rem; color: var(--line-num); margin-top: 3px; }
.tl-item .where .sep { color: var(--primary); margin: 0 0.4ch; }
.tl-item .desc { font-size: 0.78rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.tl-item .tags { margin-top: 7px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ library (root) */
.collections { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 6px; }
.collection {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.collection:hover { border-color: var(--border-bright); box-shadow: 0 4px 20px rgba(0,0,0,0.3); transform: translateY(-1px); text-shadow: none; color: var(--text); }
.collection h2 { font-family: var(--pixel); font-size: 0.6rem; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.collection h2 .badge { font-family: var(--code); }
.collection p { font-family: var(--code); font-size: 0.8rem; color: var(--muted); line-height: 1.6; flex: 1; }
.collection .facts {
  font-family: var(--code);
  font-size: 0.68rem;
  color: var(--line-num);
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.collection .facts .meta-sep { color: var(--primary); opacity: 0.5; }
.collection .open { font-family: var(--code); font-size: 0.72rem; color: var(--line-num); margin-top: 8px; }
.collection:hover .open { color: var(--accent); }
.collection--legacy { border-style: dashed; }

/* ------------------------------------------------------------------ entry pages */
.entry-head .page-title { margin-bottom: 6px; }
.entry-head .post-meta { margin-top: 6px; }
.entry-head .undated { color: var(--muted); font-style: italic; }
.draft-note {
  font-family: var(--code);
  font-size: 0.74rem;
  color: var(--muted);
  border-left: 2px solid var(--primaryHi);
  padding: 6px 12px;
  margin: 12px 0 0;
  background: rgba(168, 85, 247, 0.06);
}
.entry--note .prose { font-size: 0.9rem; }
.entry--note .post-body > p:first-of-type { font-size: inherit; color: inherit; line-height: inherit; }
.entry--note .post-body > p:first-of-type::first-letter {
  font-family: inherit; font-size: inherit; float: none; margin: 0; color: inherit; text-shadow: none; line-height: inherit;
}

.image-entry figure {
  margin: 0 0 14px;
  background: var(--editor-bg);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 10px;
}
.image-entry img { display: block; width: 100%; height: auto; border-radius: 4px; background: #000; }
.image-entry figcaption { font-family: var(--code); font-size: 0.82rem; color: var(--muted); padding: 10px 6px 2px; line-height: 1.6; }
.image-actions {
  font-family: var(--code);
  font-size: 0.76rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0 0 18px;
}
.image-actions a::before { content: '▸ '; color: var(--line-num); }
.image-actions .facts { color: var(--line-num); }
.alt-text { margin: 0 0 18px; }
.alt-text summary { font-family: var(--code); font-size: 0.76rem; color: var(--accent); cursor: pointer; }
.alt-text p { font-family: var(--code); font-size: 0.82rem; color: var(--muted); padding: 8px 0 0 1.5ch; line-height: 1.6; }
.image-entry .prose { max-width: 68ch; }

/* full image dialog (progressive enhancement) */
.full-image {
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 0;
  max-width: min(96vw, 1400px);
  max-height: 96vh;
}
.full-image::backdrop { background: rgba(5, 2, 12, 0.9); }
.full-image .bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: var(--gutter);
  border-bottom: 1px solid var(--border);
  font-family: var(--code); font-size: 0.72rem; color: var(--muted);
}
.full-image .bar button, .full-image .bar a { font: inherit; color: var(--accent); background: none; border: 1px solid var(--border); border-radius: 3px; padding: 3px 10px; cursor: pointer; }
.full-image .bar .close { margin-left: auto; }
.full-image img { display: block; max-width: 96vw; max-height: calc(96vh - 42px); width: auto; height: auto; margin: 0 auto; }

/* previous / next / up */
.entry-nav {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  font-family: var(--code);
  font-size: 0.76rem;
}
.entry-nav a { display: block; min-width: 0; }
.entry-nav .label { display: block; font-size: 0.62rem; color: var(--line-num); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 3px; }
.entry-nav .next { text-align: right; }
.entry-nav .up { text-align: center; align-self: end; }
.entry-nav .none { color: var(--line-num); }

/* ------------------------------------------------------------------ not found */
.notfound .path {
  font-family: var(--code);
  color: var(--pink);
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.3);
  border-radius: 3px;
  padding: 1px 6px;
  word-break: break-all;
}
.notfound ul { list-style: none; font-family: var(--code); font-size: 0.82rem; margin: 10px 0 0; }
.notfound li { padding: 5px 0; }
.notfound li::before { content: '▸ '; color: var(--line-num); }
.notfound .suggest { margin-top: 18px; }
.notfound .suggest h2 { font-family: var(--code); font-size: 0.62rem; color: var(--accent); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }

/* ------------------------------------------------------------------ status bar additions */
.status-bar .status-kind { margin: 0 18px 0 12px; color: rgba(255,255,255,0.75); white-space: nowrap; }
.share .status-bar .status-file { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.share .status-bar .status-right { white-space: nowrap; flex-shrink: 0; }
.share .title-bar-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ------------------------------------------------------------------ responsive (site breakpoint is 700px; target 360px) */
@media (max-width: 700px) {
  .crumbs { font-size: 0.74rem; }
  .crumbs .up { margin-left: 0; width: 100%; margin-top: 4px; }
  .folder-head .page-title { display: block; margin-bottom: 8px; }
  .folder-head .folder-facts { display: flex; margin: 8px 0 0; }
  .readme .post-window-body { padding: 16px 16px 18px; }

  .latest li { grid-template-columns: 1fr; gap: 0; }
  .latest time, .latest .undated { font-size: 0.7rem; }

  .view-tabs a { flex: 1; text-align: center; padding: 10px 4px; font-size: 0.7rem; white-space: nowrap; }

  .tools form { grid-template-columns: 1fr; }
  .tools .sort-wrap { display: flex; gap: 8px; align-items: center; }

  .listing .row, .pins .row { grid-template-columns: 1fr; gap: 3px 0; padding: 12px 4px; }
  .listing .kind, .pins .kind { justify-self: start; }
  .listing .meta, .pins .meta { text-align: left; white-space: normal; }
  .pins { padding: 12px 10px 4px; }

  .tl-item { grid-template-columns: 1fr; gap: 2px 0; }
  .tl-item .when { font-size: 0.7rem; }

  .collections { grid-template-columns: 1fr; }

  .entry-nav { grid-template-columns: 1fr; }
  .entry-nav .next { text-align: left; }
  .entry-nav .up { text-align: left; }


  .status-bar .status-kind { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .share *, .share *::before, .share *::after { animation: none !important; transition: none !important; }
}

/* Website consumer additions for the Share views */
.share .where { display: block; }
.share .pins-label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
