/* PersonalAgentEval assistants: the title block and the Leaderboard | Blog post tab bar, shared by
   assistants/index.html (the post) and assistants/leaderboard/index.html (generated by `pae site-leaderboard`).
   Self-contained (its own tokens), so it renders the same under css/site.css and under the leaderboard's styles.
   The motif is matraix.ai's: a field of faint points and one ringed sphere of light. */

.pae-head {
  --f-bg: #0a0a0a;
  --f-ink: #f5f5f5;
  --f-dim: #b0b0b0;
  --f-mute: #8a8a8a;
  --f-phos: #4a8fc2;
  --f-violet: #a855f7;
  --f-amber: #f0b45a;
  --f-line: rgba(74, 143, 194, 0.22);
  --f-gutter: clamp(20px, 5vw, 64px);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(74, 143, 194, 0.10), transparent 60%),
    var(--f-bg);
  color: var(--f-ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  border-bottom: 1px solid var(--f-line);
}
.pae-head *, .pae-head *::before, .pae-head *::after { box-sizing: border-box; }

/* A field of faint points (two offset grids of 1px dots), fading out towards the text. */
.pae-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(176, 196, 222, 0.32) 1px, transparent 1.4px),
    radial-gradient(circle at 1px 1px, rgba(74, 143, 194, 0.42) 1px, transparent 1.4px);
  background-size: 97px 89px, 151px 137px;
  background-position: 13px 21px, 61px 7px;
  -webkit-mask-image: linear-gradient(100deg, transparent 22%, #000 70%);
  mask-image: linear-gradient(100deg, transparent 22%, #000 70%);
  pointer-events: none;
}
/* The ringed sphere, cut by the right edge. */
.pae-orb {
  position: absolute;
  top: 50%;
  right: max(-9rem, calc((100vw - 77rem) / 2 - 15rem));
  width: 27rem;
  height: 27rem;
  border-radius: 50%;
  transform: translateY(-46%);
  background: radial-gradient(circle at 50% 42%, rgba(26, 52, 82, 0.55), rgba(10, 14, 22, 0.9) 62%, rgba(10, 10, 10, 0) 72%);
  box-shadow: inset 0 0 0 1px rgba(122, 172, 214, 0.38), 0 0 60px 6px rgba(74, 143, 194, 0.12), 0 0 140px 30px rgba(74, 143, 194, 0.06);
  pointer-events: none;
}
.pae-orb::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background-image: radial-gradient(circle at 1px 1px, rgba(150, 190, 230, 0.55) 1px, transparent 1.5px);
  background-size: 23px 29px;
  opacity: 0.35;
  -webkit-mask-image: radial-gradient(circle, #000 40%, transparent 70%);
  mask-image: radial-gradient(circle, #000 40%, transparent 70%);
}

.pae-wrap {
  position: relative;
  z-index: 1;
  max-width: calc(77rem + 2 * var(--f-gutter));
  margin: 0 auto;
  padding: clamp(24px, 3.2vw, 40px) var(--f-gutter) 0;
}
.pae-title {
  margin: 0;
  color: var(--f-ink);
  font-family: inherit;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.035em;
}
.pae-title .pae-agent {
  background: linear-gradient(90deg, var(--f-violet), var(--f-phos));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--f-phos);
}
.pae-desc {
  max-width: none;
  margin: 12px 0 0;
  color: var(--f-dim);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  font-weight: 400;
  line-height: 1.5;
}
.pae-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin: 14px 0 0;
  color: var(--f-mute);
  font-size: 0.875rem;
  line-height: 1.5;
}
.pae-meta .pae-prelim {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 10px;
  border: 1px solid rgba(217, 119, 6, 0.4);
  border-radius: 999px;
  color: var(--f-amber);
}
.pae-meta .pae-prelim::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #d97706; }
.pae-meta .pae-prelim[hidden] { display: none; }

.pae-tabs {
  display: flex;
  gap: 6px;
  margin-top: clamp(18px, 2.2vw, 26px);
}
.pae-tabs a {
  position: relative;
  padding: 14px 22px 15px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  color: var(--f-dim);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.pae-tabs a:hover { color: var(--f-ink); background: rgba(74, 143, 194, 0.07); }
.pae-tabs a[aria-current="page"] {
  border-color: var(--f-line);
  background: var(--f-bg);
  color: var(--f-ink);
}
.pae-tabs a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: -1px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, var(--f-violet), var(--f-phos));
}
.pae-tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--f-bg);
}
.pae-tabs a:focus-visible { outline: 2px solid var(--f-phos); outline-offset: -2px; }
/* the page as a PDF to share: an action, not a tab, so it sits apart at the row's end */
.pae-tabs .pae-act, .pae-share .pae-act { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px 8px; padding: 8px 14px; border: 1px solid var(--f-line); border-radius: 999px; background: rgba(10, 10, 10, 0.8); color: var(--f-dim); font-family: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.2; text-decoration: none; cursor: pointer; align-self: center; transition: color 0.2s, background-color 0.2s; }
.pae-tabs a:not(.pae-act) + .pae-act { margin-left: auto; }
.pae-tabs .pae-act:hover, .pae-tabs .pae-act[aria-expanded="true"], .pae-share .pae-act:hover, .pae-share .pae-act[aria-expanded="true"] { color: var(--f-ink); background: rgba(30, 34, 40, 0.9); }
.pae-tabs .pae-act:focus-visible, .pae-share .pae-act:focus-visible { outline: 2px solid var(--f-phos); outline-offset: 2px; }
.pae-tabs .pae-act svg, .pae-share .pae-act svg { width: 15px; height: 15px; flex: none; }
/* Share: the word, then one icon per place to post the link, then copy link (folds into one button on a phone) */
.pae-share { display: inline-flex; align-items: center; margin: 0 0 8px 8px; align-self: center; }
.pae-tabs a:not(.pae-act) + .pae-share { margin-left: auto; }
.pae-share .ps-toggle { display: none; margin: 0; }
.pae-share .ps-row { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 14px; border: 1px solid var(--f-line); border-radius: 999px; background: rgba(10, 10, 10, 0.8); }
.pae-share .ps-l { margin-right: 6px; color: var(--f-dim); font-size: 0.875rem; font-weight: 500; }
.pae-share .ps-i { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--f-dim); cursor: pointer; transition: color 0.15s, background-color 0.15s; }
.pae-share .ps-i svg { width: 16px; height: 16px; }
.pae-share .ps-i:hover { color: var(--f-ink); background: rgba(168, 85, 247, 0.16); }
.pae-share .ps-i:focus-visible { outline: 2px solid var(--f-phos); outline-offset: 1px; }
.pae-share .ps-copy.done { color: #4ade80; }

/* The live globe (globe/globe.js) replaces the CSS sphere where WebGL runs; the sphere stays as the fallback. */
.pae-orb.is-live {
  top: -3.5rem;
  bottom: auto;
  width: 42rem;
  height: 42rem;
  right: max(-14rem, calc((100vw - 77rem) / 2 - 12rem));
  transform: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  /* a backdrop: faded under the text on its left, cropped by the band's right and bottom edges */
  -webkit-mask-image: linear-gradient(90deg, transparent 40%, rgba(0, 0, 0, 0.5) 60%, #000 80%);
  mask-image: linear-gradient(90deg, transparent 40%, rgba(0, 0, 0, 0.5) 60%, #000 80%);
}
.pae-desc, .pae-meta { text-shadow: 0 0 14px #0a0a0a, 0 0 4px #0a0a0a; }
@media (prefers-reduced-motion: no-preference) { .pae-orb.is-live { animation: pae-globe-in 1.4s ease both; } }
.pae-orb.is-live::after { display: none; }
@keyframes pae-globe-in { from { opacity: 0; } }

@media (max-width: 40rem) {
  .pae-orb { width: 13rem; height: 13rem; top: auto; bottom: -5.5rem; right: -5rem; transform: none; opacity: 0.55; }
  .pae-orb { animation: none !important; }
  .pae-tabs { gap: 4px; }
  .pae-tabs a { flex: 1; padding: 13px 10px 14px; text-align: center; }
  .pae-tabs a.pae-act, .pae-tabs .pae-act, .pae-share .pae-act { flex: none; padding: 8px 12px; text-align: left; }
  .pae-tabs .pae-act span { display: none; }
  .pae-tabs a { white-space: nowrap; }
  .pae-share { position: relative; flex: none; }
  .pae-share .ps-toggle { display: inline-flex; }
  .pae-share .ps-row { display: none; }
  .pae-share.open .ps-row { position: fixed; z-index: 60; display: grid; grid-template-columns: repeat(4, 40px); gap: 4px; padding: 8px; border-radius: 14px; background: #15171b; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); }
  .pae-share.open .ps-l { display: none; }
  .pae-share .ps-i { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: no-preference) {
  .pae-orb { animation: pae-orb-in 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes pae-orb-in { from { opacity: 0; transform: translateY(-40%) scale(0.96); } }
}
@media (prefers-reduced-motion: reduce) { .pae-tabs a { transition: none; } }

@media (prefers-reduced-motion: no-preference) {
  /* in-page switches (task type, assistant, measure, failure mode, domain): rows glide to their new place */
  ::view-transition-group(*) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
}


/* scrolling in: blocks slide up and fade in as they enter the screen */
@media (prefers-reduced-motion: no-preference) {
  html.rv .rv-item { opacity: 0; transform: translateY(32px); transition: opacity .55s cubic-bezier(.2, .7, .2, 1) var(--rv-d, 0s), transform .55s cubic-bezier(.2, .7, .2, 1) var(--rv-d, 0s); }
  html.rv .rv-item.in { opacity: 1; transform: none; }
}
/* phones: the header's links get a 40px touch area without moving them */
@media (max-width: 40rem) {
  .nav .brand, .nav .nav-out, .nav .nav-links a { position: relative; }
  .nav .brand::before, .nav .nav-out::before, .nav .nav-links a::before { content: ""; position: absolute; inset: -12px -6px; }
}
/* the nav: MatrAIx at the left, the benchmark links in the middle, an empty end that keeps them centred */
header.nav { display: grid; grid-template-columns: 1fr auto 1fr; }
header.nav .brand { justify-self: start; }
header.nav .nav-end { justify-self: end; }
/* the team behind the benchmark, set apart from the date in the title block */
.pae-meta .pae-team { display: inline-flex; align-items: baseline; gap: 7px; padding: 5px 14px; border: 1px solid rgba(168, 85, 247, 0.45); border-radius: 999px;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.16), rgba(74, 143, 194, 0.14)); color: #f5f5f5; font-weight: 600; text-shadow: none; }
.pae-meta .pae-team .mx-wordmark { font-family: "Orbitron", "Space Grotesk", sans-serif; font-weight: 700; letter-spacing: 0.02em; }
.pae-meta .pae-team .mx-wordmark em { font-style: normal; background: linear-gradient(90deg, #a855f7, #4a8fc2); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
/* Share sits at the end of the tab row; once the row scrolls away it stays at the top right, under the nav bar */
.pae-share.float { position: fixed; top: 72px; right: 24px; z-index: 50; margin: 0 !important; }
.pae-share.float .ps-row { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); background: rgba(16, 18, 22, 0.94); backdrop-filter: blur(8px); }
.pae-share-spot { flex: none; }
body.share-float .toc ol, body.share-float .lb-toc ol { top: 144px !important; }
@media (max-width: 40rem) {
  .pae-share.float { top: 12px; right: 16px; }
  .pae-share.float .ps-toggle { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); background: rgba(16, 18, 22, 0.94); }
}
/* the contents rail (post and leaderboard): the list and a Share row stick together under "In this post";
   in a short window the list scrolls and Share stays in view */
nav .toc-stick { position: sticky; top: 96px; display: flex; flex-direction: column; max-height: calc(100vh - 112px); margin-top: 10px; }
nav .toc-stick > ol { position: static; flex: 0 1 auto; min-height: 0; margin: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-left: 0; box-shadow: inset 1px 0 0 var(--line-soft, rgba(74, 143, 194, 0.1)); }
nav .toc-stick a { margin-left: 0; }
.rail-share { flex: none; margin-top: 14px; padding: 14px 0 0 8px; border-top: 1px solid var(--line-soft, rgba(74, 143, 194, 0.1)); }
.rail-share .ps-row { display: grid; grid-template-columns: repeat(4, 32px); align-items: center; gap: 6px; }
.rail-share .ps-row .ps-l { grid-column: 1 / -1; }
.rail-share .ps-l { flex-basis: 100%; margin: 0 0 8px 2px; color: #e6e6ea; font-size: 0.86rem; font-weight: 600; }
.rail-share .ps-i { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; background: rgba(255, 255, 255, 0.04); color: #d4d4da; cursor: pointer; transition: color 0.15s, background-color 0.15s; }
.rail-share .ps-i svg { width: 16px; height: 16px; }
.rail-share .ps-i:hover { color: #fff; border-color: rgba(168, 85, 247, 0.5); background: rgba(168, 85, 247, 0.2); }
.rail-share .ps-i:focus-visible { outline: 2px solid #4a8fc2; outline-offset: 1px; }
.rail-share .ps-copy.done { color: #4ade80; }
/* on desktop the rail carries Share, so the header's Share pill is not shown (phones keep it, where the rail is hidden) */
@media (min-width: 64.0625rem) { body:has(.rail-share) .pae-share { display: none; } }

/* evaluate-your-agent invitation: a card under the rail's Share row, and a line at the end of each page */
.rail-contact { flex: none; margin: 14px 0 0 8px; padding: 14px 14px 12px; border: 1px solid rgba(168, 85, 247, 0.35); border-radius: 12px; background: linear-gradient(160deg, rgba(168, 85, 247, 0.14), rgba(74, 143, 194, 0.08)); }
.rail-contact p { margin: 0; }
.rail-contact .rc-h { color: #f2f2f4; font-size: 0.92rem; font-weight: 600; white-space: nowrap; }
.rail-contact .rc-t { margin-top: 4px; color: #a9a9b3; font-size: 0.78rem; line-height: 1.45; }
.rail-contact .rc-btn { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; padding: 8px 12px; border-radius: 9px; background: linear-gradient(90deg, #a855f7, #4a8fc2); color: #fff; font-size: 0.82rem; font-weight: 600; text-decoration: none; transition: filter 0.15s, transform 0.15s; }
.rail-contact .rc-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.rail-contact .rc-btn:hover { filter: brightness(1.12); }
.rail-contact .rc-btn:hover svg { transform: translateX(2px); }
.rail-contact .rc-btn:focus-visible, .rail-contact .rc-mail:focus-visible { outline: 2px solid #4a8fc2; outline-offset: 2px; }
.rail-contact .rc-mail { display: block; margin-top: 7px; color: #a8c4ff; font-size: 0.74rem; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
.rail-contact .rc-mail:hover { text-decoration: underline; }
.eval-cta { margin: 28px 0 0; padding: 14px 16px; border: 1px solid var(--line-soft, rgba(74, 143, 194, 0.18)); border-radius: 12px; background: rgba(168, 85, 247, 0.05); color: var(--muted, #9a9a9a); font-size: 0.95rem; }
.eval-cta a { color: #a8c4ff; overflow-wrap: anywhere; }
main > .eval-cta { grid-column: 1; margin: 32px 0 8px; }
/* the end-of-page invitation only where the rail (with its contact card) is hidden */
@media (min-width: 64.0625rem) { body:has(.rail-contact) .eval-cta { display: none; } }
/* three tabs and Share on a phone: Share shrinks to its icon, the tabs to their words */
@media (max-width: 40rem) {
  .pae-tabs a:not(.pae-act) { padding-left: 8px; padding-right: 8px; font-size: 0.9375rem; }
  .pae-share:not(.float) .ps-toggle { gap: 0; padding: 9px 11px; font-size: 0; }
}
@media (max-width: 26rem) {
  /* four tabs and the share button on one row at phone width */
  .pae-tabs { gap: 2px; }
  .pae-tabs a:not(.pae-act) { padding-left: 4px; padding-right: 4px; font-size: 0.8125rem; }
}
@media (max-width: 23rem) {
  .pae-tabs a:not(.pae-act) { padding-left: 3px; padding-right: 3px; font-size: 0.75rem; }
}
