/* Benchmark antes e depois. A divisória é a variável --split (0% a 100%). */
@property --split { syntax: '<percentage>'; inherits: true; initial-value: 50%; }

.bench .sec-head { display: grid; gap: 18px; align-items: end; }
@media (min-width: 900px) { .bench .sec-head { grid-template-columns: 1.1fr 1fr; } .bench .sec-head .section__lead { justify-self: end; } }

.ba { width: 100%; }
.ba__tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 6px; margin-bottom: 14px; border-radius: 16px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
@media (min-width: 640px) { .ba__tabs { display: flex; width: max-content; max-width: 100%; flex-wrap: wrap; } }
.ba__tab {
  font: inherit; font-size: .94rem; font-weight: 600; color: var(--text-dim); background: transparent;
  border: 0; border-radius: 11px; min-height: 42px; padding: 0 18px; cursor: pointer; transition: color .2s, background-color .25s;
}
.ba__tab:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.ba__tab[aria-selected="true"] { color: var(--accent-ink); background: var(--accent); box-shadow: 0 8px 24px -12px rgba(var(--accent-rgb), .8); }

.ba__hw { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.ba__hwbtn { font: inherit; font-size: .86rem; font-weight: 600; color: var(--text-dim); background: rgba(255, 255, 255, .03); border: 1px solid var(--line-2); border-radius: var(--pill); min-height: 36px; padding: 0 14px; cursor: pointer; }
.ba__hwbtn[aria-pressed="true"] { color: var(--text); border-color: rgba(var(--accent-rgb), .7); background: rgba(var(--accent-rgb), .1); }
.ba__hwone { margin: 0 0 12px; color: var(--text-dim); font-size: .88rem; }

.ba__slide { margin: 0; display: grid; gap: 14px; }
@media (min-width: 1040px) { .ba__slide { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; } }

.ba__view {
  --split: 50%;
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate;
  border-radius: var(--radius); background: #05070a;
  box-shadow: 0 0 0 1px var(--line-2), 0 40px 90px -40px rgba(0, 0, 0, .95), 0 0 80px -40px rgba(var(--accent-rgb), .5);
}
.ba__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; }
.ba__before { position: absolute; inset: 0; z-index: 1; clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.ba__before .ba__img { filter: blur(.9px) saturate(.72) contrast(.94) brightness(.9); }

.ba__hud {
  position: absolute; top: 10px; z-index: 3; margin: 0; padding: 5px 10px;
  font-size: .7rem; line-height: 1.25; white-space: nowrap; font-variant-numeric: tabular-nums;
  color: #fff; background: rgba(3, 5, 7, .72); border-radius: var(--pill);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ba__hud b { margin-right: 5px; }
.ba__hud--before { left: 10px; }
.ba__hud--before b { color: #ff9a9a; }
.ba__hud--after { right: 10px; }
.ba__hud--after b { color: var(--accent); }
@media (max-width: 479px) { .ba__hud--after { top: auto; bottom: 10px; } }
@media (min-width: 640px) { .ba__hud { top: 14px; font-size: .82rem; padding: 6px 12px; } .ba__hud--before { left: 14px; } .ba__hud--after { right: 14px; } }

.ba__line { position: absolute; top: 0; bottom: 0; left: var(--split); z-index: 2; pointer-events: none; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 14px rgba(0, 0, 0, .55); }
.ba__line::after {
  content: ''; position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 6px 20px rgba(0, 0, 0, .45), 0 0 0 4px rgba(255, 255, 255, .15);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6'/%3E%3C/svg%3E") center / 22px no-repeat;
}
.ba__view:has(.ba__range:focus-visible) .ba__line::after { outline: 2px solid var(--accent); outline-offset: 3px; }
.ba__range { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; -webkit-appearance: none; appearance: none; }
.ba__view.is-sweep { animation: ba-sweep 2.6s cubic-bezier(.65, 0, .35, 1) .25s both; }
@keyframes ba-sweep { 0% { --split: 50%; } 35% { --split: 86%; } 70% { --split: 14%; } 100% { --split: 50%; } }

/* números e gráfico */
.ba__stats { display: grid; gap: 12px; align-content: start; }
.ba__metrics { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ba__metrics > div { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.ba__metrics > div:first-child { grid-column: 1 / -1; }
.ba__metrics dt { font-size: .76rem; color: var(--text-dim); font-weight: 600; }
.ba__metrics dd { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.ba__metrics s { font-size: .85rem; text-decoration-color: rgba(var(--bad-rgb), .8); }
.ba__metrics b { font-family: var(--display); font-stretch: 110%; font-size: 1.35rem; font-weight: 800; line-height: 1.1; color: var(--text); letter-spacing: -0.02em; }
.ba__metrics > div:first-child b { font-size: 2.1rem; color: var(--accent); }
.ba__chart { padding: 12px 14px 10px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.ba__chartk { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 6px; font-size: .76rem; color: var(--text-dim); font-weight: 600; }
.ba__chartk span { display: inline-flex; align-items: center; gap: 6px; }
.ba__chartk i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; }
.k-b { background: var(--bad); } .k-a { background: var(--accent); margin-left: 6px; }
.ba__chart svg { display: block; width: 100%; height: 110px; }
.ba__grid line { stroke: rgba(255, 255, 255, .07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ba__line-b, .ba__line-a { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.js .ba__line-b, .js .ba__line-a { stroke-dasharray: 1; stroke-dashoffset: 1; }
.ba__line-b { stroke: rgba(var(--bad-rgb), .85); }
.ba__line-a { stroke: var(--accent); filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), .5)); }
.js .is-drawn .ba__line-b, .js .is-drawn .ba__line-a { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease); }
.js .is-drawn .ba__line-a { transition-delay: .3s; }
.ba__chartf { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0 0; font-size: .72rem; color: var(--text-dim); }
.ba__note { margin: 0; font-size: .8rem; color: var(--text-dim); }

@media (max-width: 559px) {
  .ba__metrics b { font-size: 1.15rem; }
  .ba__metrics > div:first-child b { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ba__view.is-sweep { animation: none; }
  .js .ba__line-b, .js .ba__line-a { stroke-dashoffset: 0; }
}
