/* Plates A and B for The Pull of Recognition, scoped to .bench-section.
   Site tokens come from /tokens.css; the moon-white evaluation palette and the mono face
   are new and belong only to the bench. Prototype source: research/recognition-attraction/bench/bench.css. */
:root {
  --gold-pale: #e4cf8e;
  --gold-mid: rgba(201, 168, 76, 0.34);
  --moon: #e3e9f2;
  --moon-dim: rgba(227, 233, 242, 0.62);
  --moon-line: rgba(227, 233, 242, 0.26);
  --moon-fill: rgba(227, 233, 242, 0.10);
  --font-mono: 'DM Mono', ui-monospace, Menlo, monospace;
  --bench-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ——— page rhythm around the wide section ——— */
#the-pull-of-recognition > .article-shell:first-child { padding-bottom: 8px; }
#the-pull-of-recognition > .bench-section + .article-shell { padding-top: 8px; }
.bench-section { max-width: 1480px; margin: 0 auto; padding: 0 var(--page-padding-x) 32px; }
.bench-section .bench-head { max-width: 820px; }
.bench-section .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bench-section :focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 4px; }

/* ——— layout: prose drives a pinned stage on wide screens ——— */
.bench-section .layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.bench-section .layout > * { min-width: 0; }
.bench-section .prose { font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.18rem); }
.bench-section .prose img { width: 100%; height: auto; border-radius: 6px; margin: 4px 0 8px; }
.bench-section .prose mjx-container[display="true"] { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
@media (min-width: 1180px) {
  .bench-section .layout { grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); grid-template-areas: "prose stage"; gap: 56px; }
  .bench-section .prose { grid-area: prose; }
  .bench-section .stage { grid-area: stage; position: sticky; top: 70px; align-self: start; max-height: calc(100vh - 84px); overflow-y: auto; scrollbar-width: thin; }
  .bench-section .to-bench { display: none; }
  .bench-section .step { min-height: 62vh; }
  .bench-section .step:last-child { min-height: 70vh; }
}
.bench-section .step { padding: 8px 0 28px 22px; border-left: 1px solid var(--gold-line); transition: border-color 400ms var(--bench-ease); }
.bench-section .step.active { border-left-color: var(--gold); }
.bench-section .to-bench { font-family: var(--font-label); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; background: none; color: var(--gold); border: 1px solid var(--gold-soft); border-radius: 99px; padding: 8px 14px; min-height: 44px; cursor: pointer; }
.bench-section #stage-slot .stage { margin: 4px 0 32px; }

/* ——— stage frame ——— */
.bench-section .stage { background: linear-gradient(180deg, var(--void-raised), var(--void) 70%); border: 1px solid var(--gold-line); border-radius: 14px; padding: 14px 16px 16px; }
.bench-section .stage:focus { outline: none; }
.bench-section .stage:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 4px; }
.bench-section .stage-label { font-family: var(--font-label); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-dim); margin: 0 0 6px; }
.bench-section .step-hint { font-family: var(--font-label); font-size: 0.86rem; line-height: 1.5; color: var(--text-body); margin: 0 0 10px; min-height: 2.6em; }
.bench-section .chips ol { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bench-section .chips button { font-family: var(--font-label); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.66rem; color: var(--text-muted); background: none; border: 1px solid var(--gold-line); border-radius: 99px; padding: 6px 12px 6px 6px; min-height: 32px; cursor: pointer; transition: color 200ms, border-color 200ms, background 200ms; }
.bench-section .chips button:hover { color: var(--text-body); border-color: var(--gold-soft); }
.bench-section .chips button.active { color: var(--gold); border-color: var(--gold-mid); background: var(--gold-ghost); }
.bench-section .chip-n { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 7px; border-radius: 50%; border: 1px solid currentColor; font-size: 0.62rem; letter-spacing: 0; }
.bench-section .bench { display: grid; gap: 14px; }
@media (min-width: 760px) { .bench-section .bench { grid-template-columns: minmax(0, 1fr) 272px; align-items: start; } }
.bench-section .plane-wrap { position: relative; width: 100%; max-width: min(100%, calc(100vh - 300px)); min-width: 280px; }
.bench-section #plane { width: 100%; height: auto; display: block; user-select: none; touch-action: pan-y pinch-zoom; }
.bench-section canvas.relief { display: none; width: 100%; background: var(--void); border-radius: 6px; cursor: grab; touch-action: pan-y; }
.bench-section canvas.relief:active { cursor: grabbing; }

/* ——— svg: shared ——— */
.bench-section .grid-line { stroke: var(--gold-ghost); stroke-width: 1; }
.bench-section .grid-zero { stroke: var(--gold-line); }
.bench-section .tick { fill: var(--text-muted); font: 11px var(--font-mono); }
.bench-section .axis-title { fill: var(--text-muted); font: italic 13px var(--font-display); letter-spacing: 0.03em; }
.bench-section .corner { fill: none; stroke: var(--gold-dim); stroke-width: 1.2; }
.bench-section .diagonal line { stroke: var(--gold-mid); stroke-width: 1.2; }
.bench-section .diag-label { fill: var(--gold-dim); font: italic 13px var(--font-display); letter-spacing: 0.04em; }
.bench-section .proof-line { stroke: var(--gold-dim); stroke-width: 1; stroke-dasharray: 5 5; }
.bench-section .level { fill: none; stroke: rgba(201, 168, 76, 0.2); stroke-width: 1; }
.bench-section .level-now { stroke: var(--gold-mid); stroke-width: 1.2; }
.bench-section .proof-label { fill: var(--gold-dim); font: italic 13px var(--font-display); }
.bench-section .proof-note { fill: var(--text-muted); }
.bench-section .ghost { fill: none; stroke: var(--gold); stroke-opacity: 0.2; stroke-width: 1; stroke-dasharray: 2 4; }
.bench-section .trail-seg { fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.bench-section .head-dot { fill: var(--gold-pale); }
.bench-section .head-ring { fill: none; stroke: var(--gold); stroke-opacity: 0.4; }
.bench-section .landing-ring { fill: var(--void); stroke: var(--gold-dim); stroke-width: 1.2; }
.bench-section .landing-label, .bench-section .z-label, .bench-section .start-label { fill: var(--gold-dim); font: 11px var(--font-label); letter-spacing: 0.06em; }
.bench-section .z-diamond { fill: var(--void); stroke: var(--gold); stroke-width: 1.4; }
.bench-section .start-ring { fill: none; stroke: var(--gold-dim); stroke-width: 1.2; stroke-dasharray: 3 3; }
.bench-section .glass { fill: none; stroke: var(--moon-line); stroke-width: 1; }
.bench-section .glass-label { fill: var(--moon-dim); font: 9.5px var(--font-label); letter-spacing: 0.16em; }
.bench-section .eval-connector { stroke: var(--moon-dim); stroke-width: 1; stroke-dasharray: 1.5 4; stroke-linecap: round; }
.bench-section .theta-ring { fill: var(--moon-fill); stroke: var(--moon); stroke-width: 1.4; }
.bench-section .theta-ticks { stroke: var(--moon-dim); stroke-width: 1.2; }
.bench-section .theta-label { fill: var(--moon-dim); font: 11px var(--font-label); letter-spacing: 0.06em; }
.bench-section .handle { cursor: grab; outline: none; touch-action: none; }
.bench-section .handle .hit { fill: transparent; }
.bench-section .handle.dragging { cursor: grabbing; }
.bench-section .handle:focus-visible .hit { fill: none; stroke: var(--gold-bright); stroke-width: 1.5; stroke-dasharray: 2 3; }
.bench-section .theta:focus-visible .hit { stroke: var(--moon); }
.bench-section .handle:hover .start-ring, .bench-section .handle:hover .z-diamond { stroke: var(--gold-pale); }
.bench-section .theta:hover .theta-ring { fill: rgba(227, 233, 242, 0.2); }

/* ——— side panel ——— */
.bench-section .side { display: flex; flex-direction: column; gap: 12px; }
.bench-section .viewswitch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--gold-soft); border-radius: 8px; overflow: hidden; }
.bench-section .viewswitch button { font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; background: none; color: var(--text-muted); border: 0; padding: 8px 6px; min-height: 44px; cursor: pointer; line-height: 1.25; }
.bench-section .viewswitch button + button { border-left: 1px solid var(--gold-soft); }
.bench-section .viewswitch button span { display: block; font-size: 0.66rem; letter-spacing: 0.02em; text-transform: none; }
.bench-section .viewswitch button[aria-pressed="true"] { color: var(--gold); background: var(--gold-ghost); }
.bench-section .relief-turn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bench-section .relief-turn[hidden] { display: none; }
.bench-section .readouts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--gold-line); border: 1px solid var(--gold-line); border-radius: 8px; overflow: hidden; }
.bench-section .readouts > div { background: var(--void-raised); padding: 7px 10px 8px; }
.bench-section .readouts > div:first-child { grid-column: 1 / -1; }
.bench-section dt { font-family: var(--font-label); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 2px; }
.bench-section dt var { font-family: var(--font-mono); font-style: normal; color: var(--text-body); }
.bench-section .dt-note { letter-spacing: 0.02em; }
.bench-section dd { margin: 0; font-family: var(--font-mono); font-size: 1.02rem; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.bench-section .ro-eval { background: #0f1015 !important; }
.bench-section .ro-eval dt { color: var(--moon-dim); }
.bench-section .ro-eval dd { color: var(--moon); }
.bench-section .readouts.eval-off .ro-eval dd, .bench-section .readouts.eval-off .ro-eval dt { visibility: hidden; }
.bench-section .caption { margin: 0; font-family: var(--font-body); font-size: 0.98rem; line-height: 1.55; color: var(--text-primary); min-height: 7.8em; }
.bench-section .toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.bench-section .toolbar button, .bench-section .pill { font-family: var(--font-label); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.66rem; color: var(--text-body); background: none; border: 1px solid var(--gold-soft); border-radius: 99px; padding: 7px 12px; min-height: 36px; cursor: pointer; }
.bench-section .relief-turn .pill { min-height: 44px; }
.bench-section .toolbar button:hover, .bench-section .pill:hover { border-color: var(--gold-mid); color: var(--text-primary); }
.bench-section .toggle-eval { display: inline-flex; align-items: center; gap: 8px; border-color: var(--moon-line) !important; }
.bench-section .switch { width: 26px; height: 14px; border-radius: 99px; border: 1px solid var(--moon-dim); position: relative; }
.bench-section .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--moon-dim); transition: transform 200ms var(--bench-ease), background 200ms; }
.bench-section .toggle-eval[aria-pressed="true"] .switch::after { transform: translateX(12px); background: var(--moon); }
.bench-section .toggle-eval[aria-pressed="true"] { color: var(--moon); }
.bench-section .case-badge { margin: 0; font-family: var(--font-label); font-size: 0.66rem; line-height: 1.6; color: var(--text-muted); letter-spacing: 0.04em; }
.bench-section .case-badge.on-grid { color: var(--gold-dim); }

/* ——— time bar ——— */
.bench-section .timebar { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 10px; }
.bench-section .play { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--gold-mid); background: var(--gold-ghost); color: var(--gold); cursor: pointer; display: grid; place-items: center; padding: 0; }
.bench-section .play svg { width: 20px; height: 20px; fill: currentColor; }
.bench-section .play .icon-pause { display: none; }
.bench-section .play.is-playing .icon-pause { display: inline; }
.bench-section .play.is-playing .icon-play { display: none; }
.bench-section #strip { width: 100%; height: auto; display: block; cursor: ew-resize; user-select: none; border-radius: 6px; touch-action: pan-y; }
.bench-section .pill-inf { font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: none; font-size: 0.82rem; }
.bench-section .x-line { fill: none; stroke: var(--gold); stroke-width: 1.8; }
.bench-section .y-line { fill: none; stroke: var(--gold-pale); stroke-width: 1.8; stroke-dasharray: 6 4; }
.bench-section .z-line { stroke: var(--gold-dim); stroke-width: 1.2; stroke-dasharray: 1 4; stroke-linecap: round; }
.bench-section .strip-future { opacity: 0.22; }
.bench-section .theta-line { stroke: var(--moon-dim); stroke-width: 1; stroke-dasharray: 1.5 4; stroke-linecap: round; }
.bench-section .strip-cursor { stroke: var(--gold-bright); stroke-width: 1; }
.bench-section .axis-break { stroke: var(--text-muted); fill: none; }
.bench-section .inf-mark { fill: var(--gold); font: 16px var(--font-display); }
.bench-section .limit-dot { fill: var(--gold-pale); }
.bench-section .limit-theta { fill: var(--moon-fill); stroke: var(--moon); stroke-width: 1.2; }

/* ——— controls ——— */
.bench-section .controls { margin-top: 14px; border-top: 1px solid var(--gold-line); padding-top: 10px; }
.bench-section summary { font-family: var(--font-label); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.68rem; color: var(--gold-dim); cursor: pointer; padding: 4px 0; min-height: 32px; }
.bench-section .ctl-grid { display: grid; gap: 12px; margin-top: 8px; }
@media (min-width: 760px) { .bench-section .ctl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bench-section fieldset { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--gold-line); border-radius: 8px; min-width: 0; }
.bench-section legend { font-family: var(--font-label); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.62rem; color: var(--gold-dim); padding: 0 6px; }
.bench-section .legend-note { letter-spacing: 0.04em; text-transform: none; color: var(--text-muted); }
.bench-section .fs-eval { border-color: var(--moon-line); }
.bench-section .fs-eval legend { color: var(--moon-dim); }
.bench-section .ctl { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; margin-bottom: 8px; }
.bench-section .ctl label { font-family: var(--font-label); font-size: 0.78rem; color: var(--text-muted); }
.bench-section .ctl label b { font-family: var(--font-mono); font-weight: 500; color: var(--text-primary); margin-right: 6px; }
.bench-section .ctl input[type=range], .bench-section .ctl select { grid-column: 1 / -1; grid-row: 2; }
.bench-section .ctl output { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-primary); grid-row: 1; grid-column: 2; }
.bench-section .fs-eval .ctl output { color: var(--moon); }
.bench-section .check { font-family: var(--font-label); font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; margin: 0 0 8px; min-height: 28px; }
.bench-section select { width: 100%; background: var(--void); color: var(--text-body); border: 1px solid var(--gold-soft); border-radius: 6px; padding: 6px 8px; font: 0.82rem var(--font-label); min-height: 34px; }
.bench-section input[type=checkbox] { accent-color: var(--gold); width: 16px; height: 16px; }
.bench-section input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; margin: 0; cursor: pointer; }
.bench-section input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--gold-soft); border-radius: 2px; }
.bench-section input[type=range]::-moz-range-track { height: 2px; background: var(--gold-soft); border-radius: 2px; }
.bench-section input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -7px; border-radius: 50%; background: var(--gold); border: 3px solid var(--void); box-shadow: 0 0 0 1px var(--gold-mid); }
.bench-section input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 3px solid var(--void); box-shadow: 0 0 0 1px var(--gold-mid); }
.bench-section .fs-eval input[type=range]::-webkit-slider-thumb { background: var(--moon); box-shadow: 0 0 0 1px var(--moon-dim); }
.bench-section .fs-eval input[type=range]::-moz-range-thumb { background: var(--moon); }
.bench-section input[type=range]:disabled { opacity: 0.35; cursor: not-allowed; }

/* ——— phones: strip on its own row; SVG text scaled up to survive the viewBox shrink ——— */
@media (max-width: 599px) {
  .bench-section .timebar { grid-template-columns: 44px 1fr; row-gap: 6px; }
  .bench-section #strip { grid-column: 1 / -1; grid-row: 1; }
  .bench-section .play { grid-row: 2; }
  .bench-section .pill-inf { grid-row: 2; justify-self: end; }
  .bench-section .tick, .bench-section .landing-label, .bench-section .z-label, .bench-section .start-label, .bench-section .theta-label { font-size: 17px; }
  .bench-section .proof-label, .bench-section .axis-title, .bench-section .diag-label { font-size: 19px; }
  .bench-section .glass-label { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .bench-section *, .bench-section *::before, .bench-section *::after { transition: none !important; }
}

/* Links inside running prose carry an underline, not colour alone (WCAG 1.4.1). */
#the-pull-of-recognition .math-article__body p a { text-decoration: underline; text-decoration-color: var(--gold-dim); text-decoration-thickness: 1px; text-underline-offset: 3px; }
#the-pull-of-recognition .math-article__body p a:hover { text-decoration-color: var(--gold); }
