/* Helper posts (front matter `helper: on`), loaded after blog.css and longform.css: the four-words grid, the "first
   hour" path, the filter, the command cards by job, and the printable quick-reference sheet. Tokens only, so the light
   default and the dark switch both work. Colour keeps the blog's meanings: slate = the system and the fix, graphite and
   stone = structure, copper = attention (only the "our skill" badge edge and the print button). Motion: transitions
   inside prefers-reduced-motion: no-preference and html.lf-js:not(.motion-paused), the same guard longform.css uses, so
   a paused page or reduced motion shows the final state at once. */

/* four words */
.hc-words { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); border-top: 1px solid var(--fg); border-left: 1px solid var(--line); }
.hc-words div { padding: 0.9rem 1rem 1rem; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hc-words dt { margin-bottom: 0.3rem; font: 500 0.8125rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--tech); }
.hc-words dd { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--fg-2); }

/* shared: a command chip and its copy button */
.hc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: auto; padding-top: 0.75rem; }
.hc-chipcode { font: 500 0.9375rem/1.3 var(--mono); padding: 0.3rem 0.5rem; background: var(--bg); border: 1px solid var(--line); color: var(--fg); }
.hc-copy, .hc-print { display: inline-flex; align-items: center; min-height: 40px; padding: 0.45rem 0.9rem; border: 1px solid var(--line-2); background: var(--bg); color: var(--fg); font: 600 0.875rem/1 var(--sans); cursor: pointer; }
.hc-copy:hover, .hc-print:hover { border-color: var(--fg); }
.hc-copy[data-copied] { border-color: var(--tech-line); color: var(--tech); }
.hc-copytext:not([hidden]) { margin: 0.5rem 0 0; padding: 0.75rem; overflow-x: auto; background: var(--bg); border: 1px dashed var(--line-2); font-size: 0.8125rem; white-space: pre-wrap; }

/* the first hour: six stops down a line */
.prose .hc-path { list-style: none; padding: 0; gap: 0; }
.prose .hc-step { position: relative; display: grid; gap: 0.35rem; max-width: none; padding: 0 0 1.75rem 2.4rem; }
.hc-step::before { content: ""; position: absolute; left: 0.35rem; top: 0.3rem; width: 0.9rem; height: 0.9rem; border-radius: 50%; background: var(--tech-line); box-sizing: border-box; }
.hc-step::after { content: ""; position: absolute; left: calc(0.8rem - 1px); top: 1.4rem; bottom: 0.1rem; width: 2px; background: var(--line-2); transform-origin: top; }
.hc-step:last-child::after { display: none; }
.prose .hc-time { font: 500 0.8125rem/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--tech); }
.hc-step h3 { margin: 0; font: 600 1.25rem/1.3 var(--sans); color: var(--fg); }
.hc-step .hc-foot { justify-content: flex-start; padding-top: 0.25rem; }

/* the filter */
.hc-filter { display: grid; gap: 0.75rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 1px solid var(--fg); }
.hc-filter[hidden] { display: none; }
.hc-filter fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hc-filter legend { margin-bottom: 0.4rem; font: 500 0.8125rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.hc-chip { position: relative; }
.hc-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.hc-chip span { display: inline-flex; align-items: center; min-height: 36px; padding: 0.3rem 0.8rem; border: 1px solid var(--line-2); background: var(--bg); color: var(--fg-2); font: 500 0.9375rem/1 var(--sans); }
.hc-chip input:checked + span { background: var(--tech); border-color: var(--tech); color: var(--bg); }
.hc-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hc-search { display: grid; gap: 0.3rem; font: 500 0.8125rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.hc-search input { min-height: 44px; padding: 0.5rem 0.75rem; border: 1px solid var(--line-2); background: var(--bg); color: var(--fg); font: 400 1rem/1.3 var(--sans); text-transform: none; letter-spacing: 0; }
.prose .hc-count { font-size: 0.9375rem; color: var(--fg-3); }

/* groups and cards */
.hc-ref { display: grid; gap: 1.1rem; }
.hc-group { display: grid; gap: 0.6rem; margin-top: 1.25rem; padding-top: 0; border-top: 0; }
.hc-group[hidden] { display: none; }
.prose .hc-group-h { display: flex; align-items: baseline; gap: 0.7rem; margin: 0; font: 400 clamp(1.5rem, 3vw, 1.875rem)/1.15 var(--serif); letter-spacing: -0.02em; color: var(--fg); }
.hc-num { font: 500 0.875rem/1 var(--mono); color: var(--tech); letter-spacing: 0.04em; }
.prose .hc-intro { color: var(--fg-3); font-size: 1rem; }
.hc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); gap: 0.75rem; }
.hc-card { display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; padding: 1rem 1.05rem 0.9rem; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--line-2); }
.hc-card[hidden] { display: none; }
.hc-card:has(.hc-src.bundled), .hc-card:has(.hc-src.kit) { border-top-color: var(--tech-line); }
.hc-card:has(.hc-src.ours) { border-top-color: var(--accent-line); }
.hc-cmd { margin: 0; font-size: 1rem; line-height: 1.3; }
.prose .hc-cmd code { padding: 0; background: none; font: 600 1.0625rem/1.35 var(--mono); color: var(--fg); overflow-wrap: anywhere; }
.prose .hc-what { font-size: 1rem; line-height: 1.5; color: var(--fg); }
.hc-dl { margin: 0; display: grid; gap: 0.45rem; }
.hc-dl div { display: grid; gap: 0.1rem; }
.hc-dl dt { font: 500 0.75rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.hc-dl dd { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: var(--fg-2); }
.hc-src { font: 500 0.75rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.hc-src.bundled, .hc-src.kit { color: var(--tech); }
.hc-src.ours { color: var(--accent); }

/* the sheet */
.hc-sheet-wrap { overflow-x: auto; }
.hc-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.4; }
.hc-table caption { caption-side: top; text-align: left; padding-bottom: 0.5rem; font: 500 0.8125rem/1.4 var(--mono); letter-spacing: 0.04em; color: var(--fg-3); }
.hc-table th, .hc-table td { padding: 0.5rem 0.75rem 0.5rem 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-weight: 400; color: var(--fg-2); }
.hc-table thead th { border-top: 1px solid var(--fg); font: 500 0.75rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.prose .hc-table code { padding: 0; background: none; font: 500 0.875rem/1.4 var(--mono); color: var(--fg); }
.hc-print { justify-self: start; border-color: var(--accent-line); }
.hc-print[hidden] { display: none; }

@media (max-width: 34rem) {
  .hc-table thead th:nth-child(2), .hc-table td:nth-child(2) { display: none; }  /* the job column is the section; drop it on a phone */
}

/* motion: the path draws down as each stop arrives; cards lift a little under the pointer */
@media (prefers-reduced-motion: no-preference) {
  html.lf-js:not(.motion-paused) .hc-step::after { transition: transform 0.6s var(--ease) 0.25s; }
  html.lf-js:not(.motion-paused) .hc-step:not(.is-in)::after { transform: scaleY(0); }
  html.lf-js:not(.motion-paused) .hc-step::before { transition: transform 0.4s var(--ease); }
  html.lf-js:not(.motion-paused) .hc-step:not(.is-in)::before { transform: scale(0.3); }
  html.lf-js:not(.motion-paused) .hc-card { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease; }
  html.lf-js:not(.motion-paused) .hc-card.is-in:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -18px var(--shadow); }
}

/* print: the whole post prints plainly; the print button prints only the sheet */
@media print {
  .site-header, .site-footer, .read-progress, .menu, .skip, .hc-filter, .hc-copy, .hc-print, .back, .hero-art { display: none !important; }
  [data-reveal], .lf-kinetic .w { opacity: 1 !important; transform: none !important; }
  .hc-card { break-inside: avoid; }
  html.hc-printing body * { visibility: hidden; }
  html.hc-printing .hc-sheet, html.hc-printing .hc-sheet * { visibility: visible; }
  html.hc-printing .hc-sheet { position: absolute; inset: 0 0 auto; }
  html.hc-printing .hc-sheet > p { display: none; }
  .hc-table td:nth-child(2), .hc-table thead th:nth-child(2) { display: table-cell !important; }
}
