/* jcamd.com — /family/ page components.
 *
 * Loads after site.css (and before motion.css) on the Family Neural
 * Architecture page only. Everything here is built from the drafting-board
 * tokens already declared in site.css — 2px ink borders, hard offset block
 * shadows, mono labels — so the page reads as the same sheet stock as the
 * home page rather than a second design system.
 *
 * Components site.css does not have a use for elsewhere:
 *   .codeblock    — source and payload listings, horizontally scrollable
 *   .callout      — a bordered aside for scope/privacy notes
 *   .wheel-fig    — the 64-gate wheel diagram and its caption
 *   .spec-row     — two-column key/value rows for the output contract
 *   .feature-card — a .card carrying a heading and a bullet list
 *   .profile-form, .profile-list, .feed-* — the live feed tool. site.css has
 *     no input/select styling anywhere else on the site (the rest of the
 *     site has no forms), so this is the first form component in the system.
 *   .chart-*, .center-grid, .compatibility-output — the full-chart tool.
 */

/* ── Code and payload listings ──
   The block scrolls inside itself; the page body never scrolls sideways. */
.codeblock {
  margin-top: 14px;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--block-x) var(--block-y) 0 var(--ink-shadow);
  overflow: hidden;
}
.codeblock__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 9px 14px;
  border-bottom: 2px solid var(--ink);
  background: var(--inset);
  font: 600 10px/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.codeblock pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font: 500 12.5px/1.65 var(--font-mono);
  color: var(--text);
  tab-size: 2;
}
.codeblock code { font: inherit; }

/* Inline code inside prose. */
.code-inline {
  padding: 1px 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: 500 0.86em/1.4 var(--font-mono);
  overflow-wrap: anywhere;
}

/* ── Callout ──
   Dashed rather than solid: an aside, not another card in the stack. */
.callout {
  margin-top: 18px;
  padding: 14px 16px;
  border: 2px dashed var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
/* Scoped to .callout so it outranks the .callout p colour rule below it. */
.callout .callout__label {
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.callout p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.callout p + p { margin-top: 8px; }

/* ── 64-gate wheel diagram ──
   The ticks are one dashed <circle>, not 64 elements: circumference
   2π×92 = 578.05, divided by 64 gates = 9.032 per gate. */
.wheel-fig {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--block-x) var(--block-y) 0 var(--ink-shadow);
  padding: 18px;
}
@media (min-width: 620px) {
  .wheel-fig { grid-template-columns: 240px 1fr; }
}
.wheel-fig svg { width: 100%; max-width: 240px; height: auto; justify-self: center; }
.wheel-fig figcaption {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.wheel-fig figcaption strong { color: var(--text); }

/* ── Feature card ──
   site.css styles bullet lists only inside .job-card. This is the same
   em-dash treatment, available to a plain .card. */
.feature-card + .feature-card { margin-top: 12px; }
.feature-card h3 {
  font: 600 1.02rem/1.3 var(--font-body);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.feature-card ul { list-style: none; }
.feature-card li {
  position: relative;
  padding: 4px 0 4px 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}
.feature-card li::before {
  content: "—";
  position: absolute; left: 0;
  color: var(--pencil);
  font-family: var(--font-mono);
}
.feature-card li strong { color: var(--text); font-weight: 600; }

/* ── Output contract rows ── */
.spec-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
@media (min-width: 560px) {
  .spec-row { grid-template-columns: 150px 1fr; gap: 16px; align-items: baseline; }
}
.spec-row:last-of-type { border-bottom: 0; }
.spec-row__key {
  font: 700 10px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.spec-row__val {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ── Profile form ── */
.profile-form {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: var(--block-x) var(--block-y) 0 var(--ink-shadow);
  padding: 18px;
}
@media (min-width: 700px) {
  .profile-form { grid-template-columns: repeat(4, 1fr) auto; align-items: end; }
}
.profile-form__row { display: grid; gap: 6px; min-width: 0; }
.profile-form__row label {
  font: 700 10px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-form input, .profile-form select {
  min-height: var(--touch-min, 44px);
  padding: 0 10px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: 500 0.92rem/1.4 var(--font-body);
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
}
.profile-form select {
  background-image: linear-gradient(45deg, transparent 50%, var(--pencil) 50%), linear-gradient(135deg, var(--pencil) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.profile-form input:focus, .profile-form select:focus,
.profile-form input:focus-visible, .profile-form select:focus-visible {
  outline: none;
  border-color: var(--ink);
}
.profile-form__submit { min-height: var(--touch-min, 44px); white-space: nowrap; }

/* ── Saved profiles ── */
.profile-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.profile-chip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.profile-chip__name { font: 600 0.92rem/1.3 var(--font-body); color: var(--text); }
.profile-chip__meta {
  font: 500 10px/1.3 var(--font-mono);
  color: var(--pencil);
  margin-right: auto;
}
.profile-chip__del {
  min-height: var(--touch-min, 44px);
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.profile-chip__del:hover, .profile-chip__del:focus-visible { color: var(--ink); border-color: var(--ink); }

/* ── Feed controls + output ── */
.feed-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.feed-output { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.feed-empty {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 14px 0;
}
.feed-profile__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.feed-profile__head h3 { font: 600 1.05rem/1.3 var(--font-body); }
.feed-profile__date {
  font: 500 10px/1 var(--font-mono);
  color: var(--pencil);
  white-space: nowrap;
}
.feed-summary {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text);
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}
.feed-section-label {
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 14px 0 8px;
}
.feed-section-label:first-of-type { margin-top: 0; }
.feed-item { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-item__title {
  font: 600 0.94rem/1.35 var(--font-body);
  color: var(--text);
}
.feed-item__gates {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  background: var(--inset);
  font: 700 11px/1.4 var(--font-mono);
  color: var(--accent);
}
.feed-item__prompt {
  margin-top: 4px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.feed-item__meta {
  margin-top: 4px;
  font: 500 10px/1.4 var(--font-mono);
  color: var(--pencil);
}
.feed-item__meta--standalone { margin-top: 0; margin-bottom: 8px; }
.feed-item--echo .feed-item__title { font-weight: 600; color: var(--text-secondary); }

/* ── Full chart ── */
.chart-output { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.chart-type-badge {
  font: 700 10px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-ink);
  background: var(--accent);
  padding: 4px 10px;
  white-space: nowrap;
}
.chart-row {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
@media (min-width: 480px) {
  .chart-row { grid-template-columns: 110px 1fr; gap: 12px; align-items: baseline; }
}
.chart-row__key {
  font: 700 10px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.chart-row__val { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.5; }

.center-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}
@media (min-width: 480px) {
  .center-grid { grid-template-columns: repeat(3, minmax(0, 140px)); }
}
.center-dot {
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: var(--inset);
  color: var(--muted);
  font: 500 10px/1.3 var(--font-mono);
  text-align: center;
}
.center-dot.is-defined {
  border-color: var(--ink);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink-shadow);
}

.chart-affirmation {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font: 500 italic 0.9rem/1.5 var(--font-body);
  color: var(--text-secondary);
}

.compatibility-output { margin-top: 16px; }
.compatibility-output .feature-card h3 {
  font: 600 1.02rem/1.3 var(--font-body);
}

/* ── Bodygraph diagram + definition ring ──
   --accent-b exists only here: the second overlay color for the
   compatibility bodygraph (person A vs person B vs both). Everywhere
   else on the page uses --accent alone. */
:root { --accent-b: #8a5a34; }

.chart-badge-wrap { display: flex; align-items: center; gap: 8px; }
.def-ring-wrap { width: 40px; height: 40px; flex-shrink: 0; }
.def-ring-wrap svg { width: 100%; height: 100%; display: block; }
.def-ring__track { fill: none; stroke: var(--border); stroke-width: 5; }
.def-ring__fill {
  fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round;
  transition: stroke-dasharray var(--dur-base, 260ms) var(--ease-standard, ease);
}
.def-ring__text {
  font: 700 13px/1 var(--font-mono);
  fill: var(--text);
}

.bodygraph-wrap {
  margin-top: 12px;
  padding: 14px;
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: var(--block-x) var(--block-y) 0 var(--ink-shadow);
}
.bodygraph { width: 100%; max-width: 320px; height: auto; display: block; margin: 0 auto; }
.bg-center {
  stroke: var(--border); stroke-width: 1.5; fill: var(--inset);
  cursor: pointer; transition: fill 100ms, stroke 100ms;
}
.bg-center:hover, .bg-center:focus-visible { stroke: var(--ink); stroke-width: 2.5; }
.bg-center.is-defined { fill: var(--accent); stroke: var(--ink); stroke-width: 2; }
.bg-center.is-a { fill: var(--accent); stroke: var(--ink); }
.bg-center.is-b { fill: var(--accent-b); stroke: var(--ink); }
.bg-center.is-both { fill: var(--ink); stroke: var(--ink); }

.bg-channel-hit {
  stroke: transparent; stroke-width: 6; cursor: pointer;
}
.bg-channel {
  stroke: var(--border); stroke-width: 1.25; opacity: 0.7; pointer-events: none;
  transition: stroke 100ms, stroke-width 100ms;
}
.bg-channel-hit:hover + .bg-channel { stroke: var(--pencil); stroke-width: 2; }
.bg-channel.is-active { stroke: var(--ink); stroke-width: 2.5; opacity: 1; }
.bg-channel.is-a { stroke: var(--accent); stroke-width: 2.5; opacity: 1; }
.bg-channel.is-b { stroke: var(--accent-b); stroke-width: 2.5; opacity: 1; }
.bg-channel.is-both { stroke: var(--ink); stroke-width: 3; opacity: 1; }

.bg-caption {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  min-height: 2.4em;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.bodygraph-wrap--dual { margin-top: 14px; }
