/* Long-form page styles (readme, alternatives, landing content).
   Extracted from readme.html's inline <style>; keep the two in sync. */
/* ───────── Reading progress bar ───────── */
.readme-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 70;
  background: transparent;
  pointer-events: none;
}
.readme-progress > span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(57,255,122,0.0), rgba(57,255,122,0.9) 60%, rgba(57,255,122,0.9));
  box-shadow: 0 0 12px rgba(57,255,122,0.45);
  transition: width 60ms linear;
}

/* ───────── Layout ───────── */
.readme-shell {
  position: relative; z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 28px 160px;
}
.readme-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}
.readme-toc { grid-column: 1; grid-row: 1; order: -1; }
.readme-article { grid-column: 2; grid-row: 1; }
@media (max-width: 1040px) {
  .readme-layout { grid-template-columns: 1fr; gap: 0; }
  .readme-toc { display: none; }
  .readme-article { grid-column: 1; }
}

/* ───────── Hero (editorial title) ───────── */
.readme-hero {
  border-top: 1px solid var(--line-soft);
  padding-top: 28px;
  margin-bottom: 52px;
}
.readme-meta {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 2px;
  color: var(--text-caption);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.readme-meta .dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-caption);
  display: inline-block;
}
.readme-meta .tag {
  padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-muted);
}
.readme-hero h1 {
  font-family: var(--sans);
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -1.6px;
  color: var(--text-primary);
  font-weight: 600;
  margin: 0 0 0.4em;
}
.readme-lead {
  font-size: 20px;
  color: var(--text-body);
  line-height: 1.55;
  margin: 0 0 1.2em;
  max-width: 680px;
}
.readme-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 22px;
}
.readme-actions a {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  font-size: 14px; font-weight: 500;
  font-family: var(--sans);
  border-radius: 10px;
  border: 1px solid rgba(57,255,122,0.45);
  color: var(--matrix);
  background: transparent;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
  text-decoration: none;
}
.readme-actions a:hover {
  background: var(--matrix); color: #04140a; border-color: var(--matrix);
}
.readme-actions a.is-ghost {
  color: var(--text-muted);
  border-color: var(--line);
}
.readme-actions a.is-ghost:hover {
  background: transparent; color: var(--text-primary); border-color: rgba(255,255,255,0.22);
}
.readme-actions svg { display: block; }

/* ───────── Section with numbered heading ───────── */
.readme-section { margin-top: 72px; scroll-margin-top: 96px; }
.readme-section-head {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.readme-section-num {
  font-family: var(--mono);
  font-size: 12px; letter-spacing: 2px;
  color: var(--matrix);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  padding-top: 9px;
}
.readme-section-head h2 {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

/* ───────── Article prose ───────── */
.readme-prose {
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text-body);
}
.readme-prose h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: var(--text-primary);
  margin: 2.2em 0 0.6em;
  scroll-margin-top: 96px;
}
.readme-prose h3::before {
  content: "§ "; color: var(--matrix); font-weight: 500;
  font-family: var(--mono); font-size: 0.85em;
}
.readme-prose p { margin: 0.9em 0; }
.readme-prose a {
  color: var(--matrix);
  text-decoration: none;
  border-bottom: 1px solid rgba(57,255,122,0.25);
  transition: border-color 0.18s ease, color 0.18s ease;
}
.readme-prose a:hover { border-bottom-color: var(--matrix); }
.readme-prose strong { color: var(--text-primary); font-weight: 600; }
.readme-prose em { color: var(--text-body); font-style: italic; }
.readme-prose ul,
.readme-prose ol { padding-left: 0; margin: 0.8em 0; list-style: none; }
.readme-prose ul li,
.readme-prose ol li {
  margin: 0.45em 0;
  padding-left: 24px;
  position: relative;
}
.readme-prose ul li::before {
  content: "";
  position: absolute; left: 2px; top: 0.75em;
  width: 10px; height: 1px;
  background: var(--matrix);
  opacity: 0.75;
}
.readme-prose ol { counter-reset: step; }
.readme-prose ol > li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 1px;
  color: var(--matrix);
  font-variant-numeric: tabular-nums;
  padding-top: 6px;
}
.readme-prose ul ul,
.readme-prose ol ul { margin: 0.4em 0; }
.readme-prose ul ul li::before { background: var(--text-soft); opacity: 0.5; }

.readme-prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(255,255,255,0.045);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--matrix-soft);
  border: 1px solid rgba(255,255,255,0.05);
}
.readme-prose pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--pill-bg);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 36px 20px 18px;
  overflow-x: auto;
  margin: 1.3em 0;
  position: relative;
}
.readme-prose pre::before {
  content: "";
  position: absolute;
  top: 12px; left: 14px;
  width: 40px; height: 8px;
  background:
    radial-gradient(circle at 4px 4px, #ff605c 3.5px, transparent 4px),
    radial-gradient(circle at 18px 4px, #ffbd44 3.5px, transparent 4px),
    radial-gradient(circle at 32px 4px, #00ca4e 3.5px, transparent 4px);
}
.readme-prose pre::after {
  content: "zsh";
  position: absolute;
  top: 10px; right: 14px;
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--text-caption);
  text-transform: uppercase;
}
.readme-prose pre code {
  background: none; border: 0; padding: 0;
  color: var(--text-body); font-size: inherit;
}

/* ───────── Tip callout ───────── */
.readme-tip {
  position: relative;
  margin: 1.8em 0;
  padding: 18px 22px 18px 56px;
  background: linear-gradient(180deg, rgba(57,255,122,0.06), rgba(57,255,122,0.02));
  border: 1px solid rgba(57,255,122,0.22);
  border-radius: 12px;
  color: var(--text-body);
  line-height: 1.65;
  font-size: 15.5px;
}
.readme-tip::before {
  content: "TIP";
  position: absolute;
  top: 16px; left: 16px;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(57,255,122,0.18);
  border: 1px solid rgba(57,255,122,0.35);
  color: var(--matrix);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 16px rgba(57,255,122,0.18);
}

/* ───────── Figures ───────── */
.readme-figure {
  margin: 2em 0;
  text-align: center;
}
.readme-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.9);
  display: inline-block;
}
.readme-figure.is-popover img { max-width: 360px; }
.readme-figure.is-pref img { max-width: 620px; }
.readme-figure figcaption {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-caption);
}

/* ───────── TOC ───────── */
.readme-toc {
  position: sticky; top: 100px;
  align-self: start;
  padding-right: 24px;
  border-right: 1px solid var(--line-soft);
}
.readme-toc-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2.4px;
  color: var(--text-caption);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.readme-toc ol {
  list-style: none; padding: 0; margin: 0;
  counter-reset: toc;
  display: flex; flex-direction: column; gap: 2px;
}
.readme-toc a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.4px;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.18s ease;
  counter-increment: toc;
}
.readme-toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--text-caption);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  padding-top: 1px;
  width: 22px;
}
.readme-toc a:hover { color: var(--text-muted); }
.readme-toc a.is-active {
  color: var(--matrix);
}
.readme-toc a.is-active::before { color: var(--matrix); }

/* ───────── Source footer ───────── */
.readme-source {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.4px;
  color: var(--text-caption);
  text-transform: uppercase;
  display: flex; justify-content: flex-start; gap: 18px; flex-wrap: wrap;
}
.readme-source a {
  color: var(--text-muted);
  border-bottom: 1px dotted rgba(255,255,255,0.2);
  text-decoration: none;
}
.readme-source a:hover { color: var(--matrix); }

/* ───────── Mobile ───────── */
@media (max-width: 820px) {
  .readme-shell { padding: 96px 16px 72px; }
  .readme-hero { padding-top: 18px; margin-bottom: 36px; }
  .readme-hero h1 { font-size: clamp(32px, 9vw, 44px); line-height: 1.08; letter-spacing: -0.8px; }
  .readme-lead { font-size: 16px; line-height: 1.55; }
  .readme-meta { font-size: 9.5px; letter-spacing: 1.6px; flex-wrap: wrap; row-gap: 6px; }
  .readme-actions { gap: 8px; }
  .readme-actions a { padding: 10px 14px; font-size: 13px; }
  .readme-section { margin-top: 48px; }
  .readme-section-head { grid-template-columns: 40px 1fr; gap: 10px; }
  .readme-section-head h2 { font-size: 22px; letter-spacing: -0.2px; }
  .readme-prose { font-size: 15.5px; line-height: 1.65; }
  .readme-prose h3 { font-size: 16.5px; margin: 1.8em 0 0.5em; }
  .readme-prose pre { padding: 32px 14px 14px; font-size: 12px; }
  /* Figures must never exceed the column on phones. */
  .readme-figure { margin: 1.6em 0; }
  .readme-figure.is-popover img,
  .readme-figure.is-pref img { max-width: 100%; }
  .readme-figure figcaption { font-size: 9.5px; letter-spacing: 1.4px; }
  .readme-tip { padding: 16px 18px 16px 48px; font-size: 14.5px; }
}
@media (max-width: 520px) {
  .readme-shell { padding: 88px 14px 64px; }
  .readme-hero h1 { font-size: 32px; }
  .readme-lead { font-size: 15.5px; }
  .readme-section-head { grid-template-columns: 32px 1fr; gap: 8px; }
  .readme-section-head h2 { font-size: 20px; }
  .readme-prose { font-size: 15px; }
}

/* ───────── Comparison tables ───────── */
.table-wrap {
  margin: 1.4em 0;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(5,5,7,0.55);
}
.cmp-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
}
.cmp-table th,
.cmp-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.cmp-table tbody tr:last-child th,
.cmp-table tbody tr:last-child td { border-bottom: 0; }
.cmp-table thead th {
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cmp-table thead th:nth-child(2),
.cmp-table tbody td:nth-child(2) { color: var(--matrix-soft); }
.cmp-table tbody th {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}
.readme-prose .cmp-table a { border-bottom: 0; }
.cmp-note {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.6px;
  color: var(--text-caption);
}

/* ───────── Landing content below the hero ───────── */
.landing-content { padding-top: 24px; }
.landing-article { max-width: 820px; margin: 0 auto; }
.landing-content .readme-section:first-child { margin-top: 24px; }
@media (max-width: 820px) {
  .landing-content { padding-top: 16px !important; }
}
/* Grid items default to min-width:auto, so a wide table would stretch the
   single mobile column past the viewport. */
.readme-article { min-width: 0; }
@media (max-width: 1040px) {
  .readme-layout { grid-template-columns: minmax(0, 1fr); }
}
