/* Figures for /blog/how-i-work-with-coding-agents, rendered by figures.js into <figure class="pf">.
   Unlayered on purpose so it wins over the site's base layer (p max-width, ol counters, tables).
   Width comes from the post layout: every <figure> in a post spans the content box. */

.pf {
  --pf-me: var(--color-accent);
  --pf-team: #787882;
  position: relative;
  margin: 40px 0 44px;
  color: var(--color-text-mid);
}

.pf.pf-ready .pf-fallback {
  display: none;
}

.pf p {
  max-width: none;
  margin: 0;
}

.pf .pf-cap {
  font-size: 12px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--color-text-low);
}

.pf .pf-note {
  font-size: 12px;
  color: var(--color-text-low);
  margin-top: 12px;
}

/* ---- entrance ---------------------------------------------------------- */
.pf .rv {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.7s var(--ease-ui),
    transform 0.7s var(--ease-ui);
  transition-delay: var(--d, 0s);
}

.pf.in .rv {
  opacity: 1;
  transform: none;
}

.pf .line.draw {
  transition: stroke-dashoffset 1.4s var(--ease-ui);
}

/* end points and labels appear once the lines reach them */
.pf .late {
  opacity: 0;
  transition: opacity 0.5s var(--ease-ui) 1.25s;
}

.pf.in .late {
  opacity: 1;
}

.pf .bar .fl {
  width: 0;
  transition: width 1s var(--ease-ui);
  transition-delay: var(--d, 0s);
}

.pf.in .bar .fl {
  width: var(--w);
}

.pf .cell {
  opacity: 0;
  transition: opacity 0.5s var(--ease-ui);
}

.pf.in .cell {
  opacity: 1;
}

.pf.still .rv,
.pf.still .late,
.pf.still .cell {
  opacity: 1;
  transform: none;
  transition: none;
}

.pf.still .bar .fl {
  width: var(--w);
  transition: none;
}

.pf.still .line.draw {
  transition: none;
}

/* ---- jump -------------------------------------------------------------- */
.pf-jump {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
  padding: 24px 0 8px;
}

.pf-jump .num {
  font-size: clamp(64px, 11vw, 128px);
  font-weight: 200;
  line-height: 1;
  color: var(--color-text-hi);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.14em;
}

.pf-jump .num .arrow {
  color: var(--color-text-low);
  font-size: 0.5em;
}

.pf-jump .basis {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 36px;
  align-items: center;
  width: 100%;
  margin-top: 12px;
}

.pf-jump .basis .b {
  font-size: 12.5px;
  color: var(--color-text-low);
  line-height: 1.7;
}

.pf-jump .basis .b:first-child {
  text-align: right;
}

.pf-jump .basis .b:last-child {
  text-align: left;
}

.pf-jump .basis .b b {
  display: block;
  color: var(--color-text-mid);
  font-weight: 400;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 2px;
}

.pf-jump .mult {
  font-size: 22px;
  font-weight: 300;
  color: var(--color-accent);
  border: 1px solid var(--color-accent-dim);
  padding: 9px 18px;
  letter-spacing: 0.1em;
  line-height: 1;
}

@media (max-width: 640px) {
  .pf-jump .basis {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pf-jump .basis .b:first-child,
  .pf-jump .basis .b:last-child {
    text-align: center;
  }

  .pf-jump .mult {
    justify-self: center;
  }
}

/* ---- hero: the jump as the post's lead graphic ------------------------- */
.pf.pf-hero {
  margin: 0;
  min-height: min(78vh, 760px);
  display: grid;
  align-content: center;
}

.pf-hero .pf-jump {
  position: relative;
  padding: 0;
}

.pf-hero .pf-jump .num {
  font-size: clamp(72px, 12vw, 176px);
}

.pf-hero .rings {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(86vh, 900px, 140vw);
  height: auto;
  overflow: visible;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pf-hero .rings circle {
  fill: none;
  stroke: rgba(230, 230, 233, 0.13);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.pf-hero .rings .spin {
  animation: pf-rot 420s linear infinite;
  transform-origin: 50% 50%;
}

.pf-hero .rings .spin-ccw {
  animation: pf-rot 700s linear infinite reverse;
  transform-origin: 50% 50%;
}

/* on phones the rings are wider than tall content; size the hero to the rings */
@media (max-width: 640px) {
  .pf.pf-hero {
    min-height: 140vw;
  }
}

@keyframes pf-rot {
  to {
    transform: rotate(1turn);
  }
}

/* ---- weekly chart ------------------------------------------------------ */
.pf svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.pf .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 12px;
  color: var(--color-text-mid);
  align-items: center;
  margin-bottom: 4px;
}

.pf .legend i {
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--pf-team);
  vertical-align: middle;
  margin-right: 10px;
}

.pf .legend i.me {
  background: var(--pf-me);
}

.pf .legend i.sq {
  width: 12px;
  height: 12px;
  background: rgba(230, 230, 233, 0.06);
  border: 1px solid var(--color-stroke-faint);
}

.pf .ax {
  font-size: 12px;
  fill: var(--color-text-low);
}

.pf .ax.u {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pf .ann {
  font-size: 12px;
  fill: var(--color-text-mid);
}

.pf .ann.hi {
  fill: var(--color-text-hi);
}

.pf .grid {
  stroke: var(--color-stroke-faint);
}

.pf .base,
.pf .mark {
  stroke: var(--color-stroke);
}

.pf .line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.pf .line.me {
  stroke: var(--pf-me);
}

.pf .line.team {
  stroke: var(--pf-team);
}

.pf .line.partial {
  opacity: 0.45;
}

.pf .dot {
  stroke: var(--color-bg-0);
  stroke-width: 2;
}

.pf .dot.me {
  fill: var(--pf-me);
}

.pf .dot.team {
  fill: var(--pf-team);
}

.pf .dot.hollow {
  fill: var(--color-bg-0);
}

.pf .dot.hollow.me {
  stroke: var(--pf-me);
}

.pf .dot.hollow.team {
  stroke: var(--pf-team);
}

.pf .xhair {
  stroke: var(--color-stroke-strong);
  opacity: 0;
}

.pf .hdot {
  opacity: 0;
}

.pf.hover .xhair,
.pf.hover .hdot {
  opacity: 1;
}

.pf .tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  background: var(--color-bg-2);
  border: 1px solid var(--color-stroke-faint);
  padding: 10px 14px 9px;
  font-size: 12px;
  line-height: 1.6;
  min-width: 170px;
  opacity: 0;
  transition: opacity 0.15s var(--ease-ui);
  transform: translate(-50%, calc(-100% - 14px));
  white-space: nowrap;
}

.pf .tip.on {
  opacity: 1;
}

.pf .tip .k {
  color: var(--color-text-low);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  font-size: 10px;
  margin-bottom: 4px;
}

.pf .tip .row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pf .tip .row i {
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--pf-team);
  flex-shrink: 0;
}

.pf .tip .row i.me {
  background: var(--pf-me);
}

.pf .tip .row b {
  color: var(--color-text-hi);
  font-weight: 500;
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pf .tip .m {
  color: var(--color-text-low);
  font-size: 11px;
  margin-top: 2px;
}

/* ---- table views ------------------------------------------------------- */
.pf details.tv {
  margin-top: 8px;
}

.pf details.tv summary {
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--color-text-low);
  display: inline-flex;
  gap: 10px;
}

.pf details.tv summary::-webkit-details-marker {
  display: none;
}

.pf details.tv summary::before {
  content: "+";
  width: 1ch;
}

.pf details.tv[open] summary::before {
  content: "−";
}

.pf details.tv summary:hover {
  color: var(--color-text-mid);
}

.pf details.tv .scroll {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--color-stroke-faint);
  margin-top: 10px;
  background: var(--color-bg-1);
}

.pf table {
  margin: 0;
  max-width: none;
  font-size: 12.5px;
}

.pf th,
.pf td {
  padding: 7px 18px 7px 0;
  white-space: nowrap;
}

.pf th:first-child,
.pf td:first-child {
  padding-left: 14px;
}

.pf th {
  font-size: 11px;
  position: sticky;
  top: 0;
  background: var(--color-bg-1);
}

.pf td.n,
.pf th.n {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pf td.hi {
  color: var(--color-text-hi);
}

/* ---- tiles ------------------------------------------------------------- */
.pf-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-stroke-faint);
  border: 1px solid var(--color-stroke-faint);
}

.pf .tile {
  background: var(--color-bg-0);
  padding: 30px 30px 32px;
  display: grid;
  gap: 22px;
  align-content: start;
  position: relative;
}

.pf .corner {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 14px;
  height: 14px;
  border-top: 1px solid var(--color-stroke);
  border-left: 1px solid var(--color-stroke);
}

.pf .tile .l {
  font-size: 12px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--color-text-mid);
}

.pf .tile .big {
  font-size: 60px;
  font-weight: 200;
  color: var(--color-text-hi);
  line-height: 1;
  letter-spacing: -0.02em;
}

.pf .tile .big .vs {
  font-size: 18px;
  color: var(--color-text-low);
  font-weight: 300;
  margin-left: 12px;
  letter-spacing: 0.04em;
}

.pf .bars {
  display: grid;
  gap: 12px;
}

.pf .bar {
  display: grid;
  grid-template-columns: 116px 1fr 60px;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
}

.pf .bar .n {
  color: var(--color-text-mid);
  white-space: nowrap;
}

.pf .bar .tr {
  height: 14px;
  position: relative;
}

.pf .bar .fl {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--pf-team);
  border-radius: 0 4px 4px 0;
}

.pf .bar.me .fl {
  background: var(--pf-me);
}

.pf .bar.hi .fl {
  background: var(--color-text-hi);
}

.pf .bar .v {
  color: var(--color-text-hi);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pf .tile .foot {
  font-size: 12px;
  color: var(--color-text-low);
}

@media (max-width: 900px) {
  .pf-tiles {
    grid-template-columns: 1fr;
  }
}

/* ---- steps ------------------------------------------------------------- */
.pf-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: relative;
}

.pf-steps::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 1px;
  background: var(--color-stroke-faint);
}

.pf .step {
  padding: 30px 28px 0 0;
  position: relative;
}

.pf .step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 11px;
  height: 11px;
  border: 1px solid var(--color-stroke);
  border-radius: 50%;
  background: var(--color-bg-0);
}

.pf .step.first::before {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.pf .step .i {
  font-size: 11px;
  letter-spacing: var(--track-label);
  color: var(--color-text-low);
  margin-bottom: 10px;
}

.pf .step p {
  font-size: 13.5px;
  line-height: 1.7;
}

@media (max-width: 1023px) {
  .pf-steps {
    grid-template-columns: 1fr;
    row-gap: 18px;
  }

  .pf-steps::before {
    display: none;
  }

  .pf .step {
    display: grid;
    grid-template-columns: 36px 1fr;
    align-items: baseline;
    padding: 0 0 0 26px;
  }

  .pf .step::before {
    top: 50%;
    transform: translateY(-50%);
  }

  .pf .step .i {
    margin: 0;
  }
}

/* ---- sessions ---------------------------------------------------------- */
.pf-sess {
  display: grid;
  gap: 36px;
}

.pf .readouts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--color-stroke-faint);
  border: 1px solid var(--color-stroke-faint);
}

.pf .ro {
  background: var(--color-bg-0);
  padding: 20px 20px 22px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.pf .ro .v {
  font-size: 34px;
  font-weight: 200;
  color: var(--color-text-hi);
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.pf .ro .v small {
  font-size: 14px;
  color: var(--color-text-low);
  margin-left: 4px;
  letter-spacing: 0;
}

.pf .ro .l {
  font-size: 11px;
  color: var(--color-text-mid);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  margin-top: 4px;
}

.pf .ro .s {
  font-size: 11.5px;
  color: var(--color-text-low);
  line-height: 1.6;
}

.pf .row2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px 56px;
  align-items: start;
}

.pf .row2 .heat {
  grid-column: 1 / -1;
}

.pf .blk {
  display: grid;
  gap: 14px;
  position: relative;
}

.pf .bh {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.pf .bh .l {
  font-size: 12px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--color-text-hi);
}

.pf .bh .s {
  font-size: 11.5px;
  color: var(--color-text-low);
}

.pf .hm-scroll {
  overflow-x: auto;
  position: relative;
}

.pf .hm {
  min-width: 600px;
}

.pf .cell.empty {
  fill: var(--color-bg-1);
}

.pf .hm-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--color-text-low);
}

.pf .hm-legend .ramp {
  width: 120px;
  height: 8px;
  background: linear-gradient(90deg, #121214, #e6e6e9);
}

.pf .split {
  display: grid;
  gap: 10px;
}

.pf .split .track {
  display: flex;
  gap: 2px;
  height: 16px;
}

.pf .split .track span {
  display: block;
  height: 100%;
  background: var(--pf-team);
}

.pf .split .track span.me {
  background: var(--pf-me);
  border-radius: 0 4px 4px 0;
}

.pf .split .lg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 12px;
}

.pf .split .lg i {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--pf-team);
  margin-right: 8px;
  vertical-align: -1px;
}

.pf .split .lg i.me {
  background: var(--pf-me);
}

.pf .split .lg b {
  color: var(--color-text-hi);
  font-weight: 500;
}

.pf .mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 20px;
}

.pf .mini div {
  display: grid;
}

.pf .mini b {
  color: var(--color-text-hi);
  font-weight: 300;
  font-size: 24px;
  line-height: 1.2;
}

.pf .mini span {
  color: var(--color-text-low);
  font-size: 11px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

@media (max-width: 1023px) {
  .pf .readouts {
    grid-template-columns: repeat(2, 1fr);
  }

  .pf .row2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .pf .readouts {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf .rv,
  .pf .late,
  .pf .cell {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .pf .bar .fl {
    width: var(--w);
    transition: none;
  }

  .pf .line.draw {
    transition: none;
  }

  .pf-hero .rings g {
    animation: none;
  }
}
