/* lnation.org. One stylesheet, no framework, no web font. Colours are tokens
   on :root, redefined for dark mode; nothing below names a colour. The post
   pages are served by Punk's markdown mount, which serves this same file as
   /blog/_punk/app.css. */

:root {
  --bg: #f6f4ef;
  --bg-alt: #efece5;
  --surface: #ffffff;
  --text: #16171a;
  --muted: #5e5a52;
  --faint: #8a857a;
  --rule: #e1ddd3;
  --accent: #8f5f00;
  --accent-soft: #f3e3b8;
  --mark: #f5c542;
  --mark-ink: #14161a;
  --code-bg: #f1eee7;
  --shadow: 0 1px 2px rgb(20 22 26 / 6%), 0 4px 16px rgb(20 22 26 / 5%);
  --radius: 12px;
  --wrap: 72rem;
  --gutter: 16px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  /* code: the Eshu classes Markdown::Simple writes */
  --c-key: #7a3e9d;
  --c-str: #2f7a3e;
  --c-num: #a24b00;
  --c-com: #8a857a;
  --c-var: #1f5fa8;
  --c-re: #b02d5a;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131417;
    --bg-alt: #17191d;
    --surface: #1c1e23;
    --text: #f1efea;
    --muted: #aaa598;
    --faint: #7c786e;
    --rule: #2b2e35;
    --accent: #42f55e;
    --accent-soft: #203a2d;
    --code-bg: #1a1c20;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%);
    --c-key: #c792ea;
    --c-str: #9ece6a;
    --c-num: #f0a35e;
    --c-com: #7c786e;
    --c-var: #7aa2f7;
    --c-re: #f7768e;
  }
}

.background_white { background: #fff; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

#module-list[aria-busy="true"] .cards { opacity: 0.55; transition: opacity 120ms; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }

[hidden] { display: none !important; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 8px; padding: 6px 10px; background: var(--surface); z-index: 10; }

/* ---- header and footer ---------------------------------------------------- */

.site-header { border-bottom: 1px solid var(--rule); background: var(--bg); }

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.brand-mark {
  display: inline-block;
  width: 36px;
  height: 36px;
  margin: -4px -6px -4px -8px;
  background: var(--text);
  -webkit-mask: url(/static/logo-mask.png) center / contain no-repeat;
  mask: url(/static/logo-mask.png) center / contain no-repeat;
}
.brand:hover .brand-mark { background: var(--accent); }

/* The main nav. A row of links with one group, Punk, whose links open from a
   <details> (so the dropdown works with no script). On a narrow screen
   site.js turns the row into a panel behind a Menu button; without it the
   links wrap onto a second row instead. */
.site-header { position: relative; z-index: 20; }
.nav-list { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms, background 150ms;
}
.nav-link:hover, .nav-drop[open] > .nav-link { color: var(--text); background: var(--bg-alt); }
.nav-link[aria-current], .nav-group.is-current .nav-link { color: var(--text); }
.nav-link[aria-current]::after, .nav-group.is-current .nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
summary.nav-link { list-style: none; }
summary.nav-link::-webkit-details-marker { display: none; }
summary.nav-link::before {
  content: "";
  order: 2;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 150ms;
}
.nav-drop[open] > summary.nav-link::before { margin-top: 3px; transform: rotate(-135deg); }

.nav-drop { position: relative; }
.nav-sub {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  min-width: 17.5rem;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 4px rgb(20 22 26 / 6%), 0 12px 32px rgb(20 22 26 / 12%);
  transform: translateX(-50%);
}
.nav-sub a {
  display: grid;
  gap: 1px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.nav-sub a:hover, .nav-sub a:focus-visible { background: var(--bg-alt); }
.nav-sub a[aria-current] { background: var(--accent-soft); }
/* a group with many pages: two columns, the overview and the reference across
   both; opened from its trigger's right edge so it never leaves the window */
.nav-sub-wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  min-width: 31rem;
  left: auto;
  right: 0;
  transform: none;
}
.nav-sub-wide .nav-sub-span { grid-column: 1 / -1; }
/* the Modules panel: "All modules" across the top, then the groups in three
   columns under small headings; the tallest panel, so it scrolls rather
   than run past the bottom of the window */
.nav-sub-groups {
  display: block;
  columns: 3;
  column-gap: 2px;
  min-width: 44rem;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
.nav-sub-groups .nav-sub-span { column-span: all; }
.nav-sub-group { break-inside: avoid; }
.nav-sub-group ul { margin: 0; padding: 0; list-style: none; }
.nav-sub-heading {
  display: block;
  padding: 10px 12px 2px;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
/* ...anchored to the whole nav's right edge, not its own trigger, which on a
   narrow desktop sits too far left for 31rem to open leftward from it */
@media (min-width: 761px) {
  .site-nav { position: relative; }
  .nav-group-wide .nav-drop { position: static; }
}
.nav-sub-name { font-weight: 650; }
.nav-sub-text { color: var(--muted); font-size: 0.85rem; }

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.nav-button[hidden] { display: none; }
.nav-bars, .nav-bars::before, .nav-bars::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 150ms, background 150ms;
}
.nav-bars { position: relative; }
.nav-bars::before, .nav-bars::after { content: ""; position: absolute; left: 0; }
.nav-bars::before { top: -5px; }
.nav-bars::after { top: 5px; }
.nav-button[aria-expanded="true"] .nav-bars { background: transparent; }
.nav-button[aria-expanded="true"] .nav-bars::before { transform: translateY(5px) rotate(45deg); }
.nav-button[aria-expanded="true"] .nav-bars::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 760px) {
  /* no script: the links take a second row rather than widening the page */
  .header-row { flex-wrap: wrap; row-gap: 2px; padding-top: 10px; padding-bottom: 10px; min-height: 0; }
  .site-nav { width: 100%; }
  .nav-list { flex-wrap: wrap; margin: 0 -10px; }
  .nav-link { padding: 6px 10px; }
  .nav-sub { left: 0; transform: none; }
  .nav-sub-wide { left: 0; right: auto; min-width: 0; grid-template-columns: 1fr; }
  .nav-sub-groups { columns: 1; }

  /* with script: a Menu button, and the links in a panel under the header */
  .nav-js .header-row { flex-wrap: nowrap; min-height: 60px; padding-top: 0; padding-bottom: 0; }
  .nav-js .site-nav { width: auto; }
  .nav-js .nav-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px var(--gutter) 16px;
    border-bottom: 1px solid var(--rule);
    background: var(--bg);
    box-shadow: 0 12px 24px rgb(20 22 26 / 10%);
  }
  .nav-js .nav-button[aria-expanded="true"] + .nav-list { display: flex; }
  .nav-js .nav-list > li { border-bottom: 1px solid var(--rule); }
  .nav-js .nav-list > li:last-child { border-bottom: 0; }
  .nav-js .nav-link { display: flex; justify-content: space-between; padding: 14px 4px; border-radius: 0; font-size: 1.05rem; }
  .nav-js .nav-link:hover, .nav-js .nav-drop[open] > .nav-link { background: none; }
  .nav-js .nav-link[aria-current]::after, .nav-js .nav-group.is-current .nav-link::after { display: none; }
  .nav-js .nav-link[aria-current], .nav-js .nav-group.is-current .nav-link { color: var(--accent); }
  .nav-js .nav-sub {
    position: static;
    min-width: 0;
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: none;
    transform: none;
  }
  .nav-js .nav-sub a { padding: 10px 12px; }
  .nav-js .nav-sub-wide { display: block; min-width: 0; }
  .nav-js .nav-sub-groups { max-height: none; overflow: visible; }
}

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  padding-bottom: 32px;
}
.footer-row p { margin: 0; }

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---- the landing page ----------------------------------------------------------- */

.hero { padding: clamp(40px, 9vw, 104px) 0 clamp(40px, 7vw, 80px); }

.hero-grid {
  display: grid;
  gap: 40px;
  align-items: end;
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 20rem; gap: 64px; }
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-mark {
  flex: none;
  width: 0.8em;
  height: 0.9em;
  margin-right: 0.08em;
  background: var(--text);
  -webkit-mask: url(/static/logo-mask.png) center / contain no-repeat;
  mask: url(/static/logo-mask.png) center / contain no-repeat;
}

.hero h1 {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: clamp(3rem, 11vw, 6.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.tagline {
  margin: 20px 0 0;
  max-width: 36rem;
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  line-height: 1.35;
  color: var(--text);
}

.bio { max-width: 40rem; margin: 20px 0 28px; color: var(--muted); }

.pills { gap: 8px; }
.pills a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 150ms, color 150ms;
}
.pills a:hover { border-color: var(--accent); color: var(--accent); }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--rule);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.stat { padding: 18px 20px; background: var(--surface); }
.stat dt { color: var(--muted); font-size: 0.82rem; letter-spacing: 0.04em; }
.stat dd {
  margin: 4px 0 0;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.stat-latest { grid-column: 1 / -1; }
.stat-latest dd { font-size: 1.1rem; font-weight: 600; letter-spacing: 0; color: var(--text); }
.stat-latest a { color: inherit; text-decoration: none; }
.stat-latest a:hover { color: var(--accent); }
.ago { color: var(--muted); font-weight: 400; font-size: 0.95rem; }
.stats-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 20px;
  background: var(--surface);
  color: var(--faint);
  font-size: 0.8rem;
}

.section { padding: clamp(40px, 7vw, 80px) 0; }

.section-project { padding-top: 0; }
.project {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px 28px;
  align-items: center;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
@media (max-width: 560px) { .project { grid-template-columns: minmax(0, 1fr); } }
.project-icon { display: block; width: 96px; height: 96px; border-radius: 22px; }
.project-text h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -0.02em; }
.project-text h2 a { color: var(--text); text-decoration: none; }
.project-text h2 a:hover { color: var(--accent); }
.project-text p { margin: 8px 0 0; color: var(--muted); max-width: 42rem; }
.project-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px !important; }

.button {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 150ms, color 150ms, background 150ms;
}
.button:hover { border-color: var(--accent); color: var(--accent); }
.button-primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.button-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--mark-ink); }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

.section-head { margin-bottom: 24px; }
.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
}
.section-head p { margin: 6px 0 0; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip {
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color 150ms, color 150ms, background 150ms;
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip[aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--bg); }

.module-range { margin: 0 0 12px; color: var(--faint); font-size: 0.88rem; font-variant-numeric: tabular-nums; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin: 28px 0 0;
  font-variant-numeric: tabular-nums;
}
.pager ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pager a, .pager span {
  display: inline-block;
  min-width: 40px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  text-decoration: none;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager [aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 650; }
.pager [aria-disabled="true"] { color: var(--faint); background: transparent; }
.pager .pager-gap { padding: 8px 2px; border: 0; background: none; color: var(--faint); min-width: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 150ms, transform 150ms, box-shadow 150ms;
}
.card-link:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-group {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.card-name { margin: 12px 0 6px; font-family: var(--mono); font-size: 1.08rem; font-weight: 650; }
.card-tagline { margin: 0 0 16px; color: var(--muted); font-size: 0.97rem; flex: 1; }
.card-meta { margin: 0; color: var(--faint); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.ver { color: var(--text); font-family: var(--mono); font-weight: 600; }

.more { margin: 24px 0 0; font-weight: 500; }

.columns { display: grid; gap: 48px; }
@media (min-width: 900px) { .columns { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 64px; } }

.post-list { display: grid; gap: 4px; }
.post-card { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.post-card:first-child { padding-top: 0; }
.post-card h3 { margin: 0; font-size: 1.2rem; line-height: 1.3; }
.post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h3 a:hover { color: var(--accent); }
.post-date { margin: 4px 0 0; color: var(--faint); font-size: 0.88rem; }
.post-summary { margin: 8px 0 0; color: var(--muted); }

.releases { margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.releases li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.releases a { color: var(--text); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.releases a:hover .rel-dist { color: var(--accent); }
.rel-dist { font-family: var(--mono); font-weight: 600; font-size: 0.95rem; }
.rel-ver { color: var(--muted); font-family: var(--mono); font-size: 0.9rem; }
.releases time { color: var(--faint); font-size: 0.85rem; white-space: nowrap; }

.empty { color: var(--muted); }

/* ---- the blog ------------------------------------------------------------------ */

.blog-index { padding-top: clamp(32px, 6vw, 64px); padding-bottom: 64px; max-width: 48rem; }
.blog-index h1 { margin: 0 0 24px; font-size: clamp(2.2rem, 6vw, 3.2rem); letter-spacing: -0.03em; }
.blog-index h2 { margin: 40px 0 8px; font-size: 1.3rem; color: var(--muted); }

.post {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 48px;
  padding-top: clamp(32px, 6vw, 64px);
  padding-bottom: 64px;
}
@media (min-width: 1100px) {
  .post { grid-template-columns: minmax(0, 46rem) 14rem; justify-content: center; }
  /* every part of the article in the first column, whether or not there is
     a contents list to fill the second: without this a post with no h2s
     auto-flows its parts across both columns */
  .post > * { grid-column: 1; }
  .post > .post-toc { grid-column: 2; grid-row: 1 / span 20; position: sticky; top: 24px; align-self: start; }
}
.post-cover { margin: 0 0 28px; }
.post-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 420;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--bg-alt);
}
.post-meta { margin: 0 0 8px; color: var(--faint); font-size: 0.92rem; }
.post-updated { margin-left: 8px; }
.tags { display: flex; flex-wrap: wrap; align-items: flex-start; align-self: start; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; }
.tags li {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}
.post-toc { font-size: 0.9rem; }
.post-toc p { margin: 0 0 6px; color: var(--faint); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.post-toc ul { margin: 0; padding: 0; list-style: none; }
.post-toc li { margin: 4px 0; }
.post-toc .lvl3 { padding-left: 12px; }
.post-toc a { color: var(--muted); text-decoration: none; }
.post-toc a:hover { color: var(--accent); }
.post-back { margin: 40px 0 0; }

.post-body { font-size: 1.08rem; line-height: 1.7; min-width: 0; }
.post-body h1 { margin: 0 0 24px; font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; letter-spacing: -0.03em; }
.post-body h2 { margin: 48px 0 12px; font-size: 1.6rem; letter-spacing: -0.015em; }
.post-body h3 { margin: 32px 0 8px; font-size: 1.25rem; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; }
.post-body blockquote { margin: 24px 0; padding: 4px 20px; border-left: 3px solid var(--mark); color: var(--muted); }
.post-body :not(pre) > code { padding: 0.1em 0.35em; border-radius: 4px; background: var(--code-bg); }
.post-body pre {
  margin: 24px 0;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--code-bg);
  overflow-x: auto;
  line-height: 1.5;
}
.post-body table { width: 100%; border-collapse: collapse; margin: 24px 0; display: block; overflow-x: auto; }
.post-body th, .post-body td { padding: 8px 12px; border-bottom: 1px solid var(--rule); text-align: left; }
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

.esh-k, .esh-b { color: var(--c-key); }
.esh-s, .esh-h { color: var(--c-str); }
.esh-n         { color: var(--c-num); }
.esh-c, .esh-p, .esh-d { color: var(--c-com); font-style: italic; }
.esh-v, .esh-a { color: var(--c-var); }
.esh-r, .esh-g { color: var(--c-re); }

.notfound { padding-top: 64px; padding-bottom: 64px; }

/* ---- codepens ------------------------------------------------------------------ */

.codepens { padding-top: clamp(32px, 6vw, 64px); padding-bottom: 64px; max-width: 60rem; }
.codepens h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.2rem); letter-spacing: -0.03em; }
.pen { margin: 40px 0 0; }
.pen h2 { margin: 0 0 6px; font-size: 1.35rem; }
.pen h2 a { color: var(--text); text-decoration: none; }
.pen h2 a:hover { color: var(--accent); }
.pen-description { margin: 0 0 12px; color: var(--muted); }
.pen-frame {
  display: block;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.pen-open { margin: 8px 0 0; font-size: 0.92rem; }

/* ---- the wish list -------------------------------------------------------------- */

.wishlist { padding-top: clamp(32px, 6vw, 64px); padding-bottom: 64px; }
.wishlist h1 { margin: 0 0 20px; font-size: clamp(2.2rem, 6vw, 3.2rem); letter-spacing: -0.03em; }
.wishlist-frame {
  display: block;
  width: 100%;
  height: min(80vh, 900px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: #fff;
}
.wishlist-go { margin: 12px 0 0; }

/* ---- Punk's documentation (/punk/docs) ------------------------------------------------ */

.docs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 40px;
  padding-top: clamp(24px, 4vw, 40px);
  padding-bottom: 64px;
}
.docs-side { display: none; }
@media (min-width: 900px) {
  .docs { grid-template-columns: 15rem minmax(0, 1fr); }
  .docs > * { grid-column: 2; }
  .docs > .docs-side {
    display: block;
    grid-column: 1;
    grid-row: 1 / span 20;
    position: sticky;
    top: 16px;
    align-self: start;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
  .docs-contents { display: none; }
}
@media (min-width: 1180px) {
  .docs { grid-template-columns: 15rem minmax(0, 46rem) 13rem; justify-content: center; }
  .docs > .docs-toc {
    grid-column: 3;
    grid-row: 1 / span 20;
    position: sticky;
    top: 16px;
    align-self: start;
    /* a long reference page (File::Raw has 77 headings) scrolls its own contents */
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
}
.docs-main { min-width: 0; }

.docs-search input {
  width: 100%;
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.docs-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.docs-contents {
  margin: 0 0 24px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.docs-contents > summary { padding: 12px 16px; font-weight: 650; cursor: pointer; }
.docs-contents[open] > summary { border-bottom: 1px solid var(--rule); }
.docs-contents > .docs-search, .docs-contents > .docs-nav { margin: 12px 16px; }

.punk-md-nav, .punk-md-nav ul { margin: 0; padding: 0; list-style: none; }
.punk-md-nav a {
  display: block;
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.93rem;
  text-decoration: none;
}
.punk-md-nav a:hover { color: var(--text); background: var(--bg-alt); }
.punk-md-nav a.current { color: var(--text); background: var(--accent-soft); font-weight: 650; }
.punk-md-section > details { margin: 8px 0 0; }
.punk-md-section > details > summary {
  padding: 6px 10px;
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.docs-toc { font-size: 0.9rem; }
.docs-toc p { margin: 0 0 6px; color: var(--faint); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
.punk-md-toc { margin: 0; padding: 0; list-style: none; }
.punk-md-toc li { margin: 4px 0; }
.punk-md-toc .lvl3 { padding-left: 12px; }
.punk-md-toc a { color: var(--muted); text-decoration: none; }
.punk-md-toc a:hover { color: var(--accent); }

.docs-results .punk-md-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.punk-md-results { padding-left: 1.2em; }
.punk-md-results li { margin: 16px 0; }
.punk-md-results a { font-weight: 650; }
.punk-md-snippet { margin: 4px 0 0; color: var(--muted); }
.punk-md-hint, .punk-md-empty { color: var(--muted); }

/* Screenshots on the Punk pages: a framed image and its caption. A row of
   them is .shots; a wide one spans the row. */
.shots { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.shot { margin: 0; min-width: 0; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.shot figcaption { margin-top: 10px; color: var(--muted); font-size: 0.9rem; }
.shot figcaption code { font-family: var(--mono); font-size: 0.85em; }
.shots .shot-wide { grid-column: 1 / -1; }

/* ---- /punk -------------------------------------------------------------------- */

.punk-hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 1000px) { .punk-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; } }
.punk-title {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}
.punk-badge {
  display: inline-block;
  margin: 16px 0 0;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--mark);
  color: var(--mark-ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}
.punk-hero .tagline { font-size: clamp(1.05rem, 2.2vw, 1.25rem); }

.code-sample {
  margin: 0;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--code-bg);
  box-shadow: var(--shadow);
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.55;
}
pre.code-sample code { padding: 0; border-radius: 0; background: none; font-size: inherit; }
.prose .code-sample { margin: 20px 0; }

.prose { max-width: 46rem; min-width: 0; }
.prose h2 { margin: 0 0 12px; font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -0.02em; }
.prose p { color: var(--muted); }
p.prose { color: var(--muted); margin: 28px 0; }
.prose code, .section-head code, .feature code, .punk-hero code, .footnote code, .card-tagline code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
  font-size: 0.85em;
}

.split { display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; } }

.punk-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.punk-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 16px 28px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}
.punk-numbers strong { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; color: var(--accent); }
.punk-numbers span { color: var(--muted); font-size: 0.95rem; }
.footnote { max-width: 60rem; margin: 0; color: var(--faint); font-size: 0.85rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature {
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.feature h3 { margin: 0 0 8px; font-size: 1.08rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.teaser .card-name { font-family: var(--sans); font-size: 1.2rem; }
.teaser-go { margin-top: auto; color: var(--accent); font-weight: 600; font-size: 0.95rem; }

/* /punk/queue and /punk/observe */
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.wrap > .code-sample { margin: 8px 0 24px; }
.wrap > .shots { margin-top: 32px; }
.footnote-after { margin-top: 24px; }
.free-note { align-self: start; }
.free-note p { margin: 0; }

/* A module with its own page on this site: the card goes there, and a
   second link, outside the card's own, goes to CPAN. */
.card-has-page { position: relative; }
.card-cpan {
  position: absolute;
  right: 20px;
  bottom: 18px;
  color: var(--muted);
  font-size: 0.85rem;
}
.card-cpan:hover { color: var(--accent); }

/* ---- /file-raw -------------------------------------------------------------------- */

.family .card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.plugin-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.plugin-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.wrap > .feature-grid + .code-sample { margin-top: 24px; }

.bench-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}
.bench-list li {
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.bench-list strong {
  display: block;
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.bench-label { display: block; margin-top: 4px; }
.bench-note { display: block; margin-top: 6px; color: var(--faint); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

/* a plugin page: a module name is longer than a slogan */
.punk-title-module { font-size: clamp(2rem, 5vw, 3.2rem); }
.plugin-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 20px; color: var(--muted); font-size: 0.95rem; }
.works-list, .reference-list { margin: 0; padding: 0; list-style: none; }
.works-list li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.works-list code { padding: 0.1em 0.35em; border-radius: 4px; background: var(--code-bg); font-size: 0.9em; }
.reference-list li { padding: 6px 0; }
.reference-list a { font-family: var(--mono); font-size: 0.95rem; }
.reference-list span { display: block; color: var(--muted); font-size: 0.9rem; }
