/* Rex hero: exploded drawing + the crowd of agents. Everything is scoped under .rx-hero. */
.rx-hero{
  --rh-ease: cubic-bezier(.22, 1, .36, 1);
  display: grid; grid-template-columns: minmax(0, 370px) minmax(0, 1fr); gap: 32px; align-items: center;
  padding: calc(var(--barh, 0px) + 28px) max(32px, calc((100% - 1200px) / 2)) 28px;
  color: var(--ink); font-family: var(--sans);
}
.rx-hero *, .rx-hero *::before, .rx-hero *::after{ box-sizing: border-box; }
.rx-hero .rh-copy > *{ margin: 0; }
.rx-hero .rh-kicker{ font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.rx-hero .rh-kicker b{ color: var(--accent); font-weight: 500; }
.rx-hero .rh-copy h1{ font: 500 clamp(32px, 3.2vw, 44px)/1.07 var(--sans); letter-spacing: -.022em; text-wrap: balance; color: var(--ink); margin: 0 0 22px; }
.rx-hero .rh-copy .rh-dek{ font: 400 18px/1.55 var(--sans); color: var(--body); text-wrap: pretty; margin-bottom: 26px; }
.rx-hero .rh-by{ font: 400 12.5px/1.4 var(--mono); letter-spacing: .04em; color: var(--body); padding-top: 18px; border-top: 1px solid var(--line); }
.rx-hero .rh-by span{ color: var(--ink); }

.rx-hero.rh-js .rh-copy > *{ opacity: 0; transform: translateY(8px); }
.rx-hero.rh-js.rh-go .rh-copy > *{ opacity: 1; transform: none; transition: opacity .45s var(--ease-out) calc(var(--n) * 60ms), transform .55s var(--rh-ease) calc(var(--n) * 60ms); }

.rx-hero .rh-fig{ margin: 0; min-width: 0; }
.rx-hero .rh-art{
  --rh-sw: calc(1.15 * var(--k, 1));
  display: block; width: 100%; height: auto; aspect-ratio: 840 / 590; overflow: visible; touch-action: manipulation;
  max-height: max(460px, min(640px, calc(88svh - var(--barh, 0px) - 28px - 28px - 96px)));
}
.rx-hero .rh-figcap{ display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 4px; font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rx-hero .rh-figcap .tap{ display: none; }
.rx-hero .rh-jump{
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-pill);
  font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: none; cursor: pointer;
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.rx-hero .rh-jump:hover{ border-color: var(--accent); color: var(--accent); }
.rx-hero .rh-jump:focus-visible{ outline: 2px solid var(--accent); outline-offset: 3px; }
.rx-hero .rh-jump kbd{ display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid var(--muted); border-radius: var(--r-xs); font: inherit; letter-spacing: 0; color: var(--ink); }
.rx-hero .rh-readout{ margin: 6px 0 0; min-height: 3.2em; font: 400 15px/1.5 var(--sans); color: var(--body); }
.rx-hero .rh-readout b{ display: block; font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.rx-hero .rh-legend{ display: none; list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line); }
.rx-hero .rh-legend button{ width: 100%; min-height: 44px; display: grid; grid-template-columns: 34px 1fr; align-items: center; text-align: left; border-bottom: 1px solid var(--line); font: var(--t-label); letter-spacing: .08em; text-transform: uppercase; color: var(--body); background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; transition: color .2s var(--ease-out); }
.rx-hero .rh-legend button:focus-visible{ outline: 2px solid var(--accent); outline-offset: -2px; }
.rx-hero .rh-legend .n{ width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--muted); border-radius: 50%; font-size: 11.5px; letter-spacing: 0; transition: background .2s var(--ease-out), border-color .2s var(--ease-out), color .2s var(--ease-out); }
.rx-hero .rh-legend .is-hl{ color: var(--ink); }
.rx-hero .rh-legend .is-hl .n{ background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- drawing ---------- */
.rx-hero .rh-art path, .rx-hero .rh-art circle, .rx-hero .rh-art rect, .rx-hero .rh-art text{ transition: stroke-opacity .2s var(--ease-out), fill-opacity .2s var(--ease-out), fill .25s var(--ease-out), stroke .25s var(--ease-out), stroke-width .2s var(--ease-out), opacity .25s var(--ease-out); }
.rx-hero .rh-art .dr{ fill: none; stroke: var(--ink); stroke-width: var(--rh-sw); stroke-linejoin: round; stroke-linecap: round; stroke-opacity: .88; }
.rx-hero .rh-art .d2{ stroke-opacity: .5; }
.rx-hero .rh-art .d3{ stroke: var(--body); stroke-opacity: .4; }
.rx-hero .rh-art .st{ stroke: var(--accent); stroke-opacity: .6; stroke-width: calc(var(--rh-sw) * 1.2); }
.rx-hero .rh-art .fl{ fill: var(--bg); stroke: none; }
.rx-hero .rh-art .fl.s{ fill: var(--paper); }
.rx-hero .rh-art .blk{ fill: var(--ink); stroke: none; }
.rx-hero .rh-art .hit{ fill: none; stroke: transparent; stroke-width: 18; pointer-events: stroke; }
.rx-hero .rh-art .flowl{ fill: none; stroke: var(--accent); stroke-width: calc(var(--rh-sw) * 2); stroke-linecap: round; stroke-dasharray: 2 10; opacity: 0; pointer-events: none; }
.rx-hero .rh-art .dimn{ fill: none; stroke: var(--ink); stroke-opacity: .55; stroke-width: var(--rh-sw); stroke-dasharray: 3 4; }
.rx-hero .rh-art .adot{ fill: var(--bg); stroke: var(--ink); stroke-width: var(--rh-sw); }

/* the crowd */
.rx-hero .rh-art .cable{ fill: none; stroke: var(--ink); stroke-opacity: .3; stroke-width: calc(var(--rh-sw) * .8); stroke-linecap: round; }
.rx-hero .rh-art .chip{ fill: var(--bg); stroke: var(--ink); stroke-opacity: .6; stroke-width: var(--rh-sw); }
.rx-hero .rh-art .chip-t{ font: 500 calc(10px * var(--k, 1)) var(--mono); letter-spacing: .04em; fill: var(--body); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.rx-hero .rh-art .hint{ font: 500 calc(11.5px * var(--k, 1)) var(--mono); letter-spacing: .08em; text-transform: uppercase; fill: var(--accent); paint-order: stroke; stroke: var(--bg); stroke-width: calc(4px * var(--k, 1)); stroke-linejoin: round; opacity: 0; pointer-events: none; }
.rx-hero .rh-art .hint.on{ opacity: 1; }
.rx-hero .rh-art .agent.wait .chip{ stroke: var(--accent); stroke-opacity: 1; stroke-width: calc(var(--rh-sw) * 1.4); }
.rx-hero .rh-art .agent.wait .chip-t{ fill: var(--accent); }
.rx-hero .rh-art .agent.wait .cable{ stroke: var(--accent); stroke-opacity: .85; }

/* the path lit by J */
.rx-hero .rh-art .lit .rim{ stroke: var(--accent); stroke-opacity: 1; stroke-width: calc(var(--rh-sw) * 1.8); }
.rx-hero .rh-art .lit.st, .rx-hero .rh-art .lit .st{ stroke-opacity: 1; stroke-width: calc(var(--rh-sw) * 2); }
.rx-hero .rh-art .lit .flowl{ opacity: 1; }

/* layers start stacked, then separate with a spring */
.rx-hero .rh-art .layer{ transform: translateY(calc(var(--i) * var(--cg, 100) * 1px)); }
.rx-hero .rh-art.rh-go .layer{ transform: none; transition: transform var(--spring-settle-dur, 700ms) var(--spring-settle, ease) calc(var(--sep) + var(--i) * var(--sepstep)); }

.rx-hero.rh-js .rh-art .dr{ stroke-dasharray: 1 2; stroke-dashoffset: 1; transition-property: stroke-dashoffset, stroke-opacity, stroke, stroke-width; transition-duration: var(--draw), .2s, .25s, .2s; transition-timing-function: var(--rh-ease), var(--ease-out), var(--ease-out), var(--ease-out); transition-delay: var(--d, 0ms), 0s, 0s, 0s; }
.rx-hero.rh-js .rh-art.rh-go .dr{ stroke-dashoffset: 0; }
.rx-hero.rh-js .rh-art .fd, .rx-hero.rh-js .rh-art .fl{ opacity: 0; transition-property: opacity, stroke-opacity, fill-opacity, fill, stroke, stroke-width; transition-duration: .35s, .2s, .2s, .25s, .25s, .2s; transition-timing-function: var(--ease-out); transition-delay: var(--d, 0ms), 0s, 0s, 0s, 0s, 0s; }
.rx-hero.rh-js .rh-art.rh-go .fd, .rx-hero.rh-js .rh-art.rh-go .fl{ opacity: 1; }
.rx-hero .rh-art.rh-go .dimn{ stroke-opacity: .55; }
.rx-hero .rh-art.rh-run .flowl{ opacity: .9; animation: rh-flow 1.4s linear infinite; }
.rx-hero .rh-art.rh-run .cur{ animation: rh-blink 1.2s steps(1) infinite; }
.rx-hero .rh-art.rh-off .flowl, .rx-hero .rh-art.rh-off .cur{ animation-play-state: paused; }
@keyframes rh-flow{ to{ stroke-dashoffset: -12; } }
@keyframes rh-blink{ 50%{ opacity: 0; } }

/* hover and tap */
.rx-hero .rh-art [data-p]{ cursor: pointer; }
.rx-hero .rh-art.has-hl [data-p]:not(.is-hl) .dr{ stroke-opacity: .16; }
.rx-hero .rh-art.has-hl [data-p]:not(.is-hl) .flowl{ opacity: .25; }
.rx-hero .rh-art.has-hl [data-p]:not(.is-hl) .blk{ fill-opacity: .25; }
.rx-hero .rh-art .is-hl .dr{ stroke: var(--ink); stroke-opacity: 1; stroke-width: calc(var(--rh-sw) * 1.5); }
.rx-hero .rh-art .is-hl .dr.st{ stroke: var(--accent); }
.rx-hero .rh-art .is-hl .fl{ fill: var(--paper); }
.rx-hero .rh-art .is-hl .fl.s{ fill: var(--paper-2); }
.rx-hero .rh-art .is-hl .chip{ stroke-opacity: 1; }
.rx-hero .rh-art .is-hl .cable{ stroke-opacity: .7; }
.rx-hero .rh-art.has-hl [data-p]:not(.is-hl) .chip, .rx-hero .rh-art.has-hl [data-p]:not(.is-hl) .cable{ opacity: .35; }
.rx-hero .rh-art .co.is-hl .lead{ stroke: var(--accent); }

.rx-hero .rh-art .lb{ font: 500 calc(11.5px * var(--k, 1)) var(--mono); letter-spacing: .08em; text-transform: uppercase; fill: var(--ink); }
.rx-hero .rh-art .sb{ font: 400 calc(12.5px * var(--k, 1)) var(--sans); fill: var(--body); }
.rx-hero .rh-art .bd{ fill: var(--bg); stroke: var(--muted); stroke-width: var(--rh-sw); }
.rx-hero .rh-art .bn{ font: 500 calc(11px * var(--k, 1)) var(--mono); fill: var(--body); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.rx-hero .rh-art .co:focus-visible{ outline: none; }
.rx-hero .rh-art .co:focus-visible .bd{ stroke: var(--accent); stroke-width: calc(var(--rh-sw) * 2); }
.rx-hero .rh-art .is-hl .lb{ fill: var(--accent); }
.rx-hero .rh-art .is-hl .bd{ fill: var(--accent); stroke: var(--accent); }
.rx-hero .rh-art .is-hl .bn{ fill: var(--accent-ink); }
.rx-hero .rh-art .is-hl .adot{ fill: var(--accent); stroke: var(--accent); }
.rx-hero .rh-art.has-hl .co:not(.is-hl) .lb, .rx-hero .rh-art.has-hl .co:not(.is-hl) .sb{ fill-opacity: .4; }
.rx-hero .rh-art .zone{ fill: transparent; }
.rx-hero .rh-art .mb{ display: none; }

/* narrower desktops and tablets: copy above the drawing, drawing full width */
@media (max-width: 1000px){
  .rx-hero{ grid-template-columns: 1fr; gap: 28px; padding-inline: max(28px, calc((100% - 760px) / 2)); }
  .rx-hero .rh-art{ max-height: none; }
}
/* phones: drawing under the title, numbered badges, legend list */
@media (max-width: 759px){
  .rx-hero{ gap: 22px; padding: calc(var(--barh, 0px) + 20px) max(20px, env(safe-area-inset-left)) 24px; }
  .rx-hero .rh-copy h1{ font-size: clamp(30px, 8.6vw, 38px); margin-bottom: 16px; }
  .rx-hero .rh-kicker{ margin-bottom: 14px; }
  .rx-hero .rh-copy .rh-dek{ font-size: 17px; margin-bottom: 18px; }
  .rx-hero .rh-art{ aspect-ratio: 586 / 580; }
  .rx-hero .rh-art .lab, .rx-hero .rh-art .lead, .rx-hero .rh-art .adot, .rx-hero .rh-art .hint, .rx-hero .rh-art .chip-t{ display: none; }
  .rx-hero .rh-art .mb{ display: inline; }
  .rx-hero .rh-legend{ display: block; }
  .rx-hero .rh-figcap .tap{ display: inline; }
  .rx-hero .rh-figcap .hov{ display: none; }
}
@media (prefers-reduced-motion: reduce){
  .rx-hero .rh-art *, .rx-hero .rh-copy > *{ transition: none !important; animation: none !important; }
}
.rx-hero.rh-still .rh-art *, .rx-hero.rh-still .rh-copy > *{ transition: none !important; animation: none !important; }

/* the J button under the drawing already says this; the in-drawing hint collided with chip labels */
.rx-hero .hint{ display: none; }
