/* ==========================================================================
   Product pages — hero spread with a live instrument panel ("workbench"),
   notes ledger and a closing decision row. Composes site.css tokens.
   ========================================================================== */
.product-hero, .product-notes, .product-end {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(var(--s4), 3vw, var(--s8)); row-gap: var(--s6);
}
.product-hero { align-items: center; padding-block: clamp(3.5rem, 2rem + 6vw, 8rem) var(--section-space); }
.product-hero > :first-child, .product-notes h2, .product-end h2 { grid-column: span 5; min-width: 0; }
.product-hero h1 { max-width: 11ch; }
.product-hero .site-label::before { content: ""; width: 2rem; border-top: 1px solid var(--violet-hi); }
.product-hero .site-lede { max-width: 44ch; margin-top: var(--s5); }
.workbench, .product-notes dl, .product-end .site-actions { grid-column: 7 / -1; min-width: 0; }

/* ── the instrument panel ───────────────────────────────────────────── */
.workbench {
  position: relative; isolation: isolate; overflow-wrap: anywhere;
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgb(20 20 28 / .92), rgb(10 10 15 / .96));
  box-shadow: var(--shadow-lg);
  padding: clamp(var(--s5), 2.6vw, var(--s7));
}
.workbench::before {
  content: ""; position: absolute; inset: -1px 18% auto; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(182 171 255 / .7), transparent);
}
.workbench::after {
  content: ""; position: absolute; z-index: -1; inset: -18% -12% auto auto; width: 70%; aspect-ratio: 1; pointer-events: none;
  background: radial-gradient(closest-side, rgb(143 125 255 / .09), transparent);
}
.workbench-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4);
  padding-bottom: var(--s4); border-bottom: 1px solid var(--line);
}
.site-page main .workbench-head h2 { font-size: 1.4rem; line-height: 1.1; letter-spacing: -.01em; }
.workbench-head small, .sample-locator, .sample-meta { font: 400 var(--type-label)/1.6 var(--site-mono); font-variant-numeric: tabular-nums; color: var(--mist); }
.workbench-head small, .sample-locator { text-transform: uppercase; letter-spacing: .18em; }
.sample-locator { color: var(--violet-hi); }
.workbench-body { padding-top: var(--s5); }

/* controls: one segmented group */
.product-controls {
  display: inline-flex; flex-wrap: wrap; gap: 2px; margin-bottom: var(--s5); padding: 3px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill); background: rgb(255 255 255 / .025);
}
.workbench button {
  --sweep: rgb(255 255 255 / .07);
  min-height: 2.25rem; padding: 0 1rem; border: 1px solid transparent; border-radius: var(--r-pill);
  background: transparent; color: var(--fog); font: 500 var(--type-small)/1 var(--site-sans);
}
.workbench button:hover { color: var(--bone); }
.workbench button[aria-pressed=true] { --sweep: transparent; color: var(--print); background: var(--bone); border-color: var(--bone); box-shadow: inset 0 1px 0 rgb(255 255 255 / .5); }
.workbench .sample-apply { --sweep: var(--violet-hi); color: var(--print); background: var(--bone); border-color: var(--bone); margin-top: var(--s4); min-height: 2.5rem; padding-inline: 1.2rem; }

/* the sample sheet */
.sample-locator { margin-bottom: var(--s3); }
.sample-paper { color: var(--fog); }
.sample-paper p { color: var(--fog); }
.site-page .sample-paper p + p, .site-page .sample-paper blockquote + p, .site-page .sample-paper details { margin-top: var(--s4); }
.site-page main .sample-paper h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-bottom: var(--s3); }
.sample-paper blockquote, .sample-flash { margin: 0; font: 400 clamp(1.35rem, 1.15rem + .8vw, 1.85rem)/1.25 var(--site-serif); letter-spacing: -.012em; color: var(--bone); }
.sample-paper :is(mark, ins) { color: var(--bone); text-decoration: none; background: linear-gradient(180deg, transparent 56%, rgb(143 125 255 / .38) 56%); padding-inline: .06em; border-radius: 2px; }
.sample-paper del { color: var(--danger); text-decoration-color: rgb(255 163 163 / .7); }
.sample-paper a, .sample-detail summary { color: var(--violet-hi); }
.sample-meter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); margin-top: var(--s5); font: 400 var(--type-label)/1.5 var(--site-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mist); }
.site-page .sample-meta { margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--line); }
.sample-code {
  white-space: pre-wrap; overflow-wrap: anywhere; font: 400 .82rem/1.65 var(--site-mono); color: var(--bone);
  padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-sm); background: rgb(0 0 0 / .3);
}
.sample-detail { padding-block: var(--s3); }
.sample-detail summary { width: fit-content; }

/* heatmap rows */
.sample-heat { display: flex; flex-direction: column; align-items: stretch; gap: var(--s2); margin-bottom: var(--s5); }
.workbench .sample-heat button {
  min-height: 0; padding: .8rem 1rem; text-align: left; border-radius: var(--r-sm); border-color: var(--line);
  color: var(--bone); font: 400 var(--type-small)/1.5 var(--site-sans);
}
.workbench .sample-heat button:nth-child(1) { background: rgb(143 125 255 / .06); }
.workbench .sample-heat button:nth-child(2) { background: rgb(143 125 255 / .14); }
.workbench .sample-heat button:nth-child(3) { background: rgb(143 125 255 / .26); }
.workbench .sample-heat button:hover { border-color: var(--line-3); }
.workbench .sample-heat button[aria-pressed=true] { border-color: var(--violet-hi); color: var(--bone); box-shadow: 0 0 0 3px rgb(143 125 255 / .16); }

/* search */
.sample-search label { font: 400 var(--type-label)/1.5 var(--site-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mist); }
.sample-search input {
  display: block; width: 100%; min-height: 2.75rem; padding: .65rem .9rem; margin-block: var(--s2) var(--s5);
  color: var(--bone); border: 1px solid var(--field-line); border-radius: var(--r-sm); background: rgb(255 255 255 / .03);
  font: 400 var(--type-body)/1.4 var(--site-sans); text-transform: none; letter-spacing: 0;
}
.sample-search input:hover { border-color: var(--line-3); }
.sample-search input:focus-visible { outline: 0; border-color: var(--violet-hi); box-shadow: 0 0 0 4px rgb(143 125 255 / .2); }
.sample-results { list-style: none; padding: 0; margin: 0; }
.sample-results li + li { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.sample-results .sample-locator { margin-block: var(--s1) var(--s2); }
.sample-results p { font-size: var(--type-small); }

/* ── notes ledger & closing row ─────────────────────────────────────── */
.product-notes dl, .product-end .site-actions { margin: 0; }
.product-notes dl { counter-reset: note; }
.product-notes dl div { counter-increment: note; position: relative; padding: 0 0 var(--s6) 3.25rem; margin-bottom: var(--s6); border-bottom: 1px solid var(--line); }
.product-notes dl div::before { content: counter(note, decimal-leading-zero); position: absolute; left: 0; top: .55em; font: 400 var(--type-label)/1 var(--site-mono); letter-spacing: .1em; color: var(--violet-hi); }
.product-notes dl div:last-child { margin: 0; padding-bottom: 0; border: 0; }
.product-notes dt { font: 400 var(--type-subtitle)/1.15 var(--site-serif); letter-spacing: -.014em; color: var(--bone); }
.product-notes dd { max-width: 62ch; margin: var(--s3) 0 0; color: var(--fog); }
.product-end { align-items: center; }
.product-end .site-actions { justify-content: flex-end; margin-top: 0; }

@media (max-width: 56rem) {
  .product-hero > :first-child, .workbench, .product-notes h2, .product-notes dl, .product-end h2, .product-end .site-actions { grid-column: 1 / -1; }
  .product-hero h1 { max-width: 16ch; }
  .product-end .site-actions { justify-content: flex-start; }
}
@media (max-width: 30rem) {
  .product-notes dl div { padding-left: 2.5rem; }
}
@media (scripting: none) {
  .product-controls, .sample-meter, .sample-apply, .sample-search, .sample-heat { display: none; }
  .workbench [data-example-panel][hidden] {
    display: block !important; padding-block-start: var(--s5); margin-block-start: var(--s5); border-block-start: 1px solid var(--line);
  }
}
