/* The feature map: readable procedures in the site's workshop notebook. */
:root {
  --muted: #aba49a;
  --feature-inset: #11110f;
  --feature-rule: #3d3b34;
}

html { scroll-behavior: smooth; scroll-padding-top: 24px; }
[hidden] { display: none !important; }
.feature-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 38px 36px 70px;
}
.feature-shell a { color: var(--teal); text-underline-offset: 0.2em; }
.feature-shell a:hover { color: var(--ink); }
.feature-shell :focus-visible, .topbar :focus-visible, .skip-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--border-radius);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  width: min(calc(100% - 72px), 1168px);
  padding-bottom: 20px;
  margin: 38px auto 24px;
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.65rem;
  line-height: 1.1;
  text-decoration: none;
}
.topbar .brand span { color: var(--muted); font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.015em; }
.topbar .category-link {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.76rem;
  text-decoration: none;
}
.topbar a:hover { color: var(--ink); }
.eyebrow {
  margin-bottom: 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.category-tag {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid #51452c;
  border-radius: 3px;
  background: rgba(201, 168, 76, 0.07);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.67rem;
  line-height: 1.5;
  letter-spacing: 0.025em;
  text-decoration: none;
}
.feature-shell a.category-tag { color: var(--accent); }
.hero-title {
  max-width: 1000px;
  margin: 0 0 24px;
  font-size: clamp(3.1rem, 7vw, 5.7rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.lead {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(1.06rem, 2vw, 1.25rem);
  line-height: 1.7;
  color: var(--ink);
}
.feature-shell .meta { max-width: 850px; margin: 0 0 28px; font-size: 0.83rem; }
.feature-shell .meta code { font-size: 0.8rem; }
.feature-shell code {
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
.feature-shell pre {
  min-width: 0;
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--feature-rule);
  border-radius: 4px;
  background: var(--feature-inset);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.feature-shell pre code {
  display: block;
  padding: 0;
  background: transparent;
  white-space: pre-wrap;
  font-size: 0.76rem;
  line-height: 1.8;
}
.metrics { margin: 30px 0 42px; }
.metrics dl, dl.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 42px;
  padding: 22px 0;
  border-block: 1px solid var(--border);
}
.metrics dl > div, dl.metrics > div { display: flex; flex-direction: column-reverse; gap: 2px; }
.metrics dt { color: var(--muted); font-family: var(--mono); font-size: 0.7rem; }
.metrics dd { font-family: var(--serif); font-size: 2.25rem; line-height: 1.1; }
.page-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.page-content { min-width: 0; }
.page-nav {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding-right: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--feature-rule) transparent;
}
.page-nav h2 { margin: 0 0 12px; font-size: 0.68rem; }
.page-nav h3 { margin: 22px 0 8px; font-size: 0.76rem; font-weight: 500; color: var(--muted); }
.page-nav ul, .page-nav ol { list-style: none; padding: 0; }
.page-nav li + li { margin-top: 3px; }
.page-nav a {
  display: block;
  padding: 6px 8px;
  border-left: 2px solid var(--border);
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.page-nav a:hover, .page-nav a[aria-current] { border-left-color: var(--accent); color: var(--ink); }
.recipe-toc { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }
.recipe-toc summary { margin-bottom: 10px; color: var(--accent); font-family: var(--mono); font-size: 0.72rem; cursor: pointer; }
.feature-shell h2 { margin-top: 48px; font-size: 0.75rem; line-height: 1.7; }
.page-content > section:first-child h2 { margin-top: 0; }
.feature-shell h3 { font-weight: 500; line-height: 1.4; }
.page-content p { margin-bottom: 14px; }
.page-content ul:not(.behavior-list), .page-content ol:not(.script-steps) { padding-left: 22px; }
.page-content li:not(.script-row) { margin-bottom: 8px; }
.overview, .entry-points, .preconditions, .gotchas { font-size: 0.97rem; line-height: 1.75; }
.entry-points li, .preconditions li, .gotchas li { padding-left: 3px; }
.gotchas { margin-top: 40px; padding: 4px 24px 18px; border-left: 2px solid var(--accent); background: rgba(201, 168, 76, 0.04); }
.gotchas h2 { margin-top: 18px; }
.behaviors details {
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  background: var(--card);
}
.behaviors summary, .capture-commands summary {
  cursor: pointer;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
}
.behaviors summary:hover, .capture-commands summary:hover { color: var(--ink); }
.behavior-list { list-style: none; padding: 0; margin-top: 20px; }
.behavior-list li { padding: 13px 0; border-top: 1px solid var(--feature-rule); font-size: 0.9rem; }
.behavior-list .behavior-id {
  display: block;
  width: fit-content;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.73rem;
  overflow-wrap: anywhere;
}
.recipe-group { margin: 34px 0 0; }
.recipe-group > h3, h3.recipe-group { padding-bottom: 10px; margin: 40px 0 20px; color: var(--accent); font-family: var(--serif); font-size: 1.7rem; }
.recipe {
  margin-bottom: 30px;
  border: 1px solid var(--feature-rule);
  border-radius: var(--border-radius);
  background: var(--card);
  overflow: clip;
  scroll-margin-top: 24px;
}
.recipe-header { padding: 24px 26px 20px; }
.recipe-header h3 { margin: 0 0 12px; color: var(--ink); font-family: var(--serif); font-size: 1.85rem; }
.recipe-header p { margin-top: 12px; color: var(--muted); font-size: 0.9rem; }
.behavior-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.behavior-tags a {
  padding: 3px 7px;
  border: 1px solid var(--feature-rule);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.55;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.script-steps { list-style: none; padding: 0; counter-reset: script-step; }
.script-row {
  display: grid;
  grid-template-columns: 25px 58px minmax(0, 1fr);
  align-items: baseline;
  gap: 9px;
  padding: 15px 26px;
  margin: 0;
  border-top: 1px solid var(--feature-rule);
  counter-increment: script-step;
}
.script-row::before {
  content: counter(script-step, decimal-leading-zero);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}
.row-kind { color: var(--accent); font-family: var(--mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.035em; text-transform: uppercase; }
.row-content { min-width: 0; font-size: 0.9rem; line-height: 1.7; overflow-wrap: anywhere; }
.row-content p:last-child { margin-bottom: 0; }
.row-content .step-observation { margin: 9px 0 0; color: var(--muted); font-size: 0.84rem; }
.command-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #37352f;
  border-radius: 4px;
  background: var(--feature-inset);
}
.row-content > .command-line:not(:first-child) { margin-top: 10px; }
.feature-shell .command-line code {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: #e8dfc8;
  font-size: 0.76rem;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}
.copy-command { display: none; }
.feature-map-js .copy-command {
  display: inline-block;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #5c5647;
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.5;
  cursor: pointer;
}
.copy-command:hover { border-color: var(--accent); color: var(--accent); }
.copy-command[data-copy-state="copied"] { color: var(--green); }
.copy-command[data-copy-state="failed"] { color: var(--ink); }
.recipe-evidence {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 18px;
  padding: 24px 26px;
  border-top: 1px solid var(--feature-rule);
}
.recipe-evidence figure { min-width: 0; margin: 0; }
.recipe-evidence .capture-unit { min-width: 0; }
.recipe-evidence > p, .recipe-evidence > details { grid-column: 1 / -1; }
.capture-unit > p { margin: 14px 0 0; font-size: 0.86rem; line-height: 1.7; }
.capture-unit .source-note { padding-top: 12px; color: var(--muted); font-size: 0.75rem; }
.capture-unit .capture-commands { margin-top: 14px; padding: 12px 0 0; }
.recipe-evidence figure > a { display: block; }
.recipe-evidence img, .recipe-evidence video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--feature-rule);
  border-radius: 4px;
  background: var(--feature-inset);
}
.recipe-evidence a:hover img { border-color: var(--accent); }
.recipe-evidence figcaption { padding-top: 10px; color: var(--muted); font-size: 0.78rem; line-height: 1.6; overflow-wrap: anywhere; }
.capture-commands { padding: 16px 26px; border-top: 1px solid var(--feature-rule); }
.capture-commands pre { margin-top: 14px; padding: 14px; border-radius: 4px; background: var(--feature-inset); }
.feature-shell .capture-commands pre code { padding: 0; background: transparent; font-size: 0.72rem; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-note { margin: 30px 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.81rem; line-height: 1.7; overflow-wrap: anywhere; }
.search-box { max-width: 640px; margin: 35px 0 10px; }
.search-box label { display: block; margin-bottom: 9px; color: var(--muted); font-family: var(--mono); font-size: 0.76rem; }
.search-box input {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid #5c5647;
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.93rem;
}
.search-box input::placeholder { color: var(--muted); opacity: 1; }
#search-status, #recipe-search-status { margin: 10px 0 24px; color: var(--muted); font-family: var(--mono); font-size: 0.74rem; }
#search-empty, #recipe-search-empty { padding: 20px; border: 1px solid var(--feature-rule); border-radius: 4px; color: var(--muted); }
.family-groups > section, #family-list > section { margin-top: 46px; }
.family-groups > section > h2 { margin-top: 0; }
#family-list > section > h3 { margin-bottom: 20px; color: var(--accent); font-family: var(--serif); font-size: 1.8rem; }
.family-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.family-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 23px;
  border: 1px solid var(--feature-rule);
  border-radius: var(--border-radius);
  background: var(--card);
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease;
}
.feature-shell .family-card { color: var(--ink); }
.family-card:hover { border-color: var(--accent); background: #201f1a; }
.family-id { color: var(--accent); font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.07em; }
.family-card h3 { margin: 11px 0 12px; font-family: var(--serif); font-size: 1.9rem; line-height: 1.15; }
.family-card p { margin-bottom: 18px; color: var(--muted); font-size: 0.87rem; line-height: 1.7; }
.family-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: auto; color: var(--muted); font-family: var(--mono); font-size: 0.67rem; }
.family-card .category-tag { align-self: flex-start; margin-top: 14px; }
.family-nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin: 50px 0 0; padding-top: 22px; border-top: 1px solid var(--border); }
.family-nav a { font-size: 0.9rem; text-decoration: none; overflow-wrap: anywhere; }
.family-nav a:last-child { text-align: right; }
.family-nav span, .family-nav small { display: block; color: var(--muted); font-family: var(--mono); font-size: 0.68rem; }
.feature-shell footer { margin-top: 52px; font-size: 0.71rem; line-height: 1.8; overflow-wrap: anywhere; }

@media (max-width: 1040px) {
  .page-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 30px; }
  .family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .script-row { padding-inline: 18px; grid-template-columns: 22px 48px minmax(0, 1fr); gap: 7px; }
  .recipe-header, .recipe-evidence, .capture-commands { padding-inline: 18px; }
}
@media (max-width: 760px) {
  .feature-shell { padding: 24px 22px 48px; }
  .topbar { width: calc(100% - 44px); margin: 24px auto 20px; }
  .hero-title { font-size: clamp(2.8rem, 11vw, 4.6rem); }
  .page-layout { display: block; }
  .page-nav { position: static; max-height: none; padding: 0 0 22px; margin-bottom: 34px; border-bottom: 1px solid var(--border); }
  .page-nav ul, .page-nav ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
  .page-nav li + li { margin-top: 0; }
  .page-nav h3 { margin-top: 16px; }
  .page-nav nav:not(.recipe-toc), nav.recipe-toc, .recipe-toc > nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
  .metrics dl, dl.metrics { gap: 18px 30px; }
  .feature-shell h2 { margin-top: 38px; }
  .command-line { flex-direction: column; gap: 10px; }
  .copy-command { align-self: flex-end; }
  .recipe-evidence { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .feature-shell { padding-inline: 17px; }
  .topbar { width: calc(100% - 34px); align-items: flex-start; gap: 11px; }
  .topbar .brand { font-size: 1.5rem; }
  .topbar .category-link { font-size: 0.69rem; padding-top: 5px; }
  .lead { font-size: 1.03rem; }
  .family-grid { grid-template-columns: minmax(0, 1fr); }
  .family-card { padding: 22px; }
  .recipe-header { padding: 20px 15px 16px; }
  .recipe-header h3 { font-size: 1.65rem; }
  .script-row { grid-template-columns: 22px minmax(0, 1fr); gap: 2px 9px; padding: 14px 15px; }
  .row-kind { grid-column: 2; }
  .row-content { grid-column: 2; margin-top: 5px; font-size: 0.88rem; }
  .recipe-evidence, .capture-commands { padding-inline: 15px; }
  .feature-shell .command-line code { font-size: 0.72rem; }
  .gotchas { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  :root { --bg: #fff; --card: #fff; --ink: #111; --muted: #444; --accent: #493b19; --teal: #174e45; --border: #ccc; --feature-rule: #bbb; --feature-inset: #f4f4f2; }
  body { background: #fff; color: #111; font-size: 10pt; }
  html { scroll-behavior: auto; }
  .feature-shell { width: 100%; padding: 0; }
  .topbar { width: 100%; margin: 0 0 25px; }
  .hero-title { font-size: 34pt; }
  .page-layout { display: block; }
  .page-nav, .search-box, #search-status, #recipe-search-status, .copy-command, .skip-link { display: none !important; }
  .family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-shell .command-line code { color: #111; font-size: 8pt; }
  .command-line { padding: 8px; border-color: #ccc; }
  .recipe, .family-card { overflow: visible; background: #fff; }
  .recipe-header, .script-row, figure, .family-card { break-inside: avoid; }
  .recipe-header { break-after: avoid; }
  .recipe-evidence img { max-height: 170mm; object-fit: contain; }
  .feature-shell a { color: #174e45; }
  .feature-shell h2 { margin-top: 25px; }
  .family-nav, footer { margin-top: 25px; }
}
