/* reanimate elements on the v2 pages (2026-11-28). Motion ported from the reanimate examples
   (github.com/NiazMorshed2007/reanimate, MIT, LICENSE-reanimate.txt); copy, colours, fonts and pictures are ours.
   Built in reanimate-draft.html first. Tokens are scoped per element (--rn-*) so the same element works on the
   white/#f5f5f7 sections, inside the .dark pinned sections (white in light theme) and in dark theme. */
.run, .count-row, [data-focus], .ap, .radar, .chat2, .hub {
  --rn-ink: var(--on-light); --rn-soft: var(--on-light-soft); --rn-rule: var(--rule-light);
  --rn-ground: var(--grey); --rn-card: var(--white);
}
.dark .run, .dark .count-row, .dark [data-focus], .dark .ap, .dark .radar, .dark .chat2, .dark .hub {
  --rn-ink: var(--on-dark); --rn-soft: var(--on-dark-soft); --rn-rule: var(--rule-dark);
  --rn-ground: var(--dark-lift); --rn-card: var(--dark);
}
.rn-sec { padding-block: var(--section); }
.rn-sec .section-sub { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }


/* ---------- 1. run bars ---------- */
.run {
  max-width: 52rem; margin-inline: auto; background: var(--rn-card); border: 1px solid var(--rn-rule);
  border-radius: 14px; padding: clamp(1.25rem, 3vw, 2rem);
}
.s-white .run, .light .run { background: var(--rn-ground); }
.run-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.5rem; margin-bottom: 1.5rem; }
.run-name { font-weight: 600; font-size: 1.0625rem; margin-right: auto; }
.run-status, .run-time { font: 500 .8125rem/1 "IBM Plex Mono", ui-monospace, monospace; color: var(--rn-soft); }
.run-status[data-state="running"] { color: var(--red); }
.run-status[data-state="done"] { color: var(--rn-ink); }
.run-time { font-variant-numeric: tabular-nums; }
.run-rows { display: grid; gap: .875rem; }
.run-rows li { display: grid; grid-template-columns: minmax(9rem, 15rem) 1fr; align-items: center; gap: 1rem; }
.run-label { font-size: .9375rem; color: var(--rn-soft); transition: color .25s ease-out; }
.run-rows li.on .run-label { color: var(--rn-ink); }
.run-track { position: relative; height: 10px; }
.run-track::before { content: ""; position: absolute; inset: 4px 0; background: var(--rn-rule); border-radius: 1px; }
.run-track i {
  position: absolute; top: 0; bottom: 0; left: calc(var(--s) * 100%); width: calc(var(--d) * 100%);
  background: var(--red); border-radius: 3px; transform-origin: left center; transform: scaleX(var(--p, 0));
}
.run-last .run-track i { background: var(--rn-ink); }
@media (max-width: 600px) {
  .run-rows li { grid-template-columns: 1fr; gap: .375rem; }
}

/* ---------- 2. rolling counts ---------- */
.count-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 60rem; margin-inline: auto; }
.count-row > div { text-align: center; padding: 0 1rem; border-left: 1px solid var(--rn-rule); }
.count-row > div:first-child { border-left: 0; }
.count-row dt {
  font-family: Archivo, system-ui, sans-serif; font-variation-settings: "wght" 800, "wdth" 112;
  font-size: clamp(4rem, 12vw, 8.5rem); line-height: .95; letter-spacing: -.04em; font-variant-numeric: tabular-nums;
}
.count-row dd { margin-top: .75rem; color: var(--rn-soft); }
@media (max-width: 600px) {
  .count-row { grid-template-columns: 1fr; gap: 2rem; }
  .count-row > div { border-left: 0; border-top: 1px solid var(--rn-rule); padding-top: 1.5rem; }
  .count-row > div:first-child { border-top: 0; padding-top: 0; }
}

/* ---------- 3. hover focus (vercel-previews: blur 4px, 250ms cubic-bezier(0,0,.2,1)) ---------- */
.focus-list { max-width: 52rem; margin-inline: auto; border-top: 1px solid var(--rn-rule); }
.focus-list li, [data-focus] > * {
  transition: filter 250ms cubic-bezier(0, 0, .2, 1), opacity 250ms cubic-bezier(0, 0, .2, 1), color 250ms cubic-bezier(0, 0, .2, 1);
}
.focus-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1rem; align-items: baseline;
  padding: 1.25rem .25rem; border-bottom: 1px solid var(--rn-rule); cursor: default; outline: none;
  transition: filter 250ms cubic-bezier(0, 0, .2, 1), opacity 250ms cubic-bezier(0, 0, .2, 1), color 250ms cubic-bezier(0, 0, .2, 1);
}
.focus-list b { font-size: clamp(1.375rem, 2.6vw, 1.875rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.focus-list span { color: var(--rn-soft); }
[data-focus].has-focus > * { filter: blur(4px); opacity: .45; }
[data-focus].has-focus > .is-focus { filter: none; opacity: 1; color: var(--red); }
.focus-list li:focus-visible { box-shadow: inset 0 0 0 2px var(--red); border-radius: 4px; }
@media (max-width: 600px) { .focus-list li { grid-template-columns: 1fr; gap: .25rem; } }

/* ---------- 4. approval window ---------- */
.ap {
  max-width: 60rem; margin-inline: auto; background: var(--rn-card); border: 1px solid var(--rn-rule);
  border-radius: 14px; overflow: hidden;
}
.ap-tabs { display: flex; gap: 1.5rem; padding: 0 1.25rem; border-bottom: 1px solid var(--rn-rule); overflow-x: auto; }
.ap-tabs button {
  font: inherit; font-size: .9375rem; color: var(--rn-soft); background: none; border: 0; cursor: pointer;
  padding: .9rem 0 .8rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .3s ease-out, border-color .3s ease-out;
}
.ap-tabs button[aria-selected="true"] { color: var(--rn-ink); border-bottom-color: var(--red); }
.ap-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 17rem; min-height: 22rem; }
.ap-frame { position: relative; background: var(--rn-ground); overflow: hidden; }
.ap-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: blur(8px);
  transform: scale(1.04); transition: opacity .3s cubic-bezier(.25, .1, .35, 1), filter .3s cubic-bezier(.25, .1, .35, 1);
}
.ap-frame img.on { opacity: 1; filter: none; }
.ap-panel {
  position: relative; margin: 1.25rem; align-self: start; background: var(--rn-card); border: 1px solid var(--rn-rule);
  border-radius: 12px; padding: 1rem 1.125rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .06);
  will-change: transform;
}
.ap-who { display: flex; align-items: center; gap: .625rem; font-weight: 600; font-size: .9375rem; }
.ap-av {
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--rn-ink); color: var(--rn-card); font: 600 .75rem/1 "Inter Tight", system-ui, sans-serif;
}
.ap-msg { margin-top: .75rem; line-height: 1.45; }
.ap-state { margin-top: .75rem; font: 500 .75rem/1.3 "IBM Plex Mono", ui-monospace, monospace; color: var(--red-text-light); }
.ap-panel .fade { transition: opacity .3s cubic-bezier(.25, .1, .35, 1); }
.ap-panel.swap .fade { opacity: 0; }
.ap-progress { height: 2px; background: var(--rn-rule); }
.ap-progress i { display: block; height: 100%; background: var(--rn-ink); transform-origin: left; transform: scaleX(0); }
@media (max-width: 720px) {
  .ap-body { grid-template-columns: 1fr; min-height: 0; }
  .ap-frame { aspect-ratio: 16 / 10; }
  .ap-panel { margin: -2.5rem 1rem 1rem; }
}

/* ---------- 5. radar ---------- */
.radar { max-width: 26rem; margin-inline: auto; text-align: center; --rc: #86868b; }
.radar.live { --rc: var(--red); }
.radar svg { width: 100%; height: auto; overflow: visible; display: block; }
.rd-discs circle { fill: none; stroke: var(--rn-rule); stroke-width: 1; transition: opacity .4s ease-out; }
.rd-discs circle:nth-child(1) { fill: var(--rn-ground); }
.s-grey .rd-discs circle:nth-child(1) { fill: var(--rn-card); }
.rd-beam { stroke: var(--rc); stroke-width: 1; opacity: .5; transition: stroke .3s; }
.rd-dot { fill: var(--rn-soft); transition: opacity .3s ease-out, fill .3s ease-out; }
.rd-dot.hit { fill: var(--rc); }
.rd-cross circle { fill: none; stroke: var(--rc); stroke-width: 1.5; stroke-dasharray: 8 3; transition: stroke .3s; }
.rd-pin { fill: var(--rn-ink); }
.radar-cap { margin-top: 1rem; color: var(--rn-soft); font-variant-numeric: tabular-nums; }
.radar-cap span { color: var(--rn-ink); font-weight: 600; }

/* ---------- 6. chat timing (stripe: user .25s/.75s, agent 1.0s/.35s, words from 1.2s every 60ms, plan 1.4s) ---------- */
.chat2 { max-width: 34rem; margin: 2.5rem auto 0; display: grid; gap: .75rem; text-align: left; }
.chat2 p { max-width: 85%; padding: .75rem 1rem; border-radius: 18px; line-height: 1.4; }
.c2-you { justify-self: end; background: var(--red); color: #fff; border-bottom-right-radius: 6px; }
.c2-us { justify-self: start; background: var(--rn-card); border: 1px solid var(--rn-rule); border-bottom-left-radius: 6px; }
.s-white .c2-us { background: var(--rn-ground); }
.c2-us .w { opacity: 0; transition: opacity .1s cubic-bezier(0, 0, .58, 1); }
.c2-us .w.on { opacity: 1; }
.c2-plan { justify-self: start; width: min(85%, 22rem); border-top: 1px solid var(--rn-rule); margin-top: .25rem; }
.c2-plan div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .25rem; border-bottom: 1px solid var(--rn-rule); font-size: .9375rem; }
.c2-plan dt { color: var(--rn-soft); }
.c2-plan dd { font-weight: 600; }
.chat2 [data-pre] { opacity: 0; transform: translateY(20px); }

/* ---------- 7. hub ---------- */
.hub { max-width: 52rem; margin-inline: auto; }
.hub svg { width: 100%; height: auto; display: block; overflow: visible; }
.hub-line { fill: none; stroke: var(--rn-soft); stroke-width: 1; opacity: .55; }
.hub-run { fill: var(--red); }
.hub-node { fill: var(--rn-ink); }
.hub-t { font: 500 13px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .08em; fill: var(--rn-ink); }
.hub-core { fill: var(--red); }
.hub-core-t { font: 600 12px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .12em; fill: var(--rn-ink); }
.hub [data-pre] { opacity: 0; }

/* radar inside a pinned step: smaller, left-aligned */
.step .radar { max-width: 15rem; margin: 1.75rem 0 0; text-align: left; }
.step .radar-cap { font-size: .875rem; }
