/* Bundled styles for the Benchmark Chart Webflow code component.
 *
 * Two parts:
 *   1. Design tokens (color scales + semantic + type vars) — minimal subset
 *      required by the scatter chart. Mirrors src/app/styles/design-tokens.css
 *      but drops:
 *        - dark-mode block (chart is light-only inside Webflow pages)
 *        - @font-face declarations (Webflow site already serves Lumen Sans
 *          and SF Pro via its own font CDN; falling back through the
 *          font-family stack picks them up)
 *        - typography utility classes (.type-*) — chart uses tokens directly
 *        - spacing / radii / gradient tokens unused by the chart
 *   2. Chart styles (.bm-*) — copied verbatim from src/app/styles/benchmark.css
 *      so this file is the single source of CSS the component needs.
 *
 * Keep in sync with the source files when they change. If divergence becomes
 * painful, swap to a build step that copy/concat's at publish time.
 */

:host {
  /* ---------- color primitives (light scales) ---------- */
  --blue-light-3: #edf2ff;
  --blue-light-7: #abbdfc;
  --blue-light-9: #4a5ee0;
  --blue-light-12: #212b60;

  --green-light-3: #e4f7ee;
  --green-light-9: #2ea37c;
  --green-light-12: #1d3b2f;

  --yellow-light-3: #fff6bc;
  --yellow-light-10: #fed531;
  --yellow-light-12: #443c21;

  --purple-light-3: #f3efff;
  --purple-light-7: #c4b1ff;
  --purple-light-9: #8449eb;
  --purple-light-12: #391c6c;

  --pink-light-3: #ffe9f1;
  --pink-light-9: #db468e;
  --pink-light-12: #62183c;

  --red-light-3: #ffebea;
  --red-light-7: #f5a9a5;
  --red-light-11: #cc2e39;

  --neutral-light-1: #ffffff;
  --neutral-light-3: #f0f0f0;
  --neutral-light-6: #d9d9d9;
  --neutral-light-7: #cecece;
  --neutral-light-9: #8d8d8d;
  --neutral-light-10: #838383;
  --neutral-light-11: #646464;
  --neutral-light-12: #202020;

  /* ---------- semantic tokens ---------- */
  --surface-raised: var(--neutral-light-1);

  --fill-brand-default: var(--blue-light-9);
  --fill-error-subtle: var(--red-light-3);

  --border-default: var(--neutral-light-6);
  --border-error-default: var(--red-light-7);

  --fg-primary: var(--neutral-light-12);
  --fg-secondary: var(--neutral-light-11);
  --fg-tertiary: var(--neutral-light-10);
  --fg-brand-default: var(--blue-light-11, #4457cb);
  --fg-error-default: var(--red-light-11);

  /* ---------- shadows ---------- */
  --shadow-xs: 0 1px 2px rgba(16, 18, 39, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 18, 39, 0.08), 0 2px 4px rgba(16, 18, 39, 0.04);
  --shadow-popover: 0px 0px 20px 0px rgba(16, 18, 39, 0.15);

  /* ---------- type ---------- */
  --font-sans: "Lumen Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial,
    sans-serif;
  --font-system: "SF Pro Text", -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui,
    "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Source Code Pro", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    monospace;
}

/* ============================================================
   Chart component (mirrors src/app/styles/benchmark.css —
   keep in sync; drops table styles unused by scatter)
   ============================================================ */

.bm-component {
  --bm-card-radius: 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--bm-card-radius);
  box-shadow: var(--shadow-xs);
  padding: 28px;
  font-family: var(--font-system);
  color: var(--fg-primary);
  width: 100%;
  box-sizing: border-box;
  container-type: inline-size;
}

@media (max-width: 640px) {
  .bm-component {
    padding: 18px;
    border-radius: 12px;
  }
}

.bm-chart-title-row {
  margin-bottom: 8px;
}
.bm-chart-subtitle {
  font-size: 13px;
  color: var(--fg-secondary);
  margin: 2px 0 0;
}

.bm-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 48px;
  color: var(--fg-secondary);
  border: 1px dashed var(--border-default);
  border-radius: 12px;
  justify-content: center;
}
.bm-state-error {
  color: var(--fg-error-default);
  border-color: var(--border-error-default);
  background: var(--fill-error-subtle);
  flex-direction: column;
}
.bm-state-error .bm-state-sub {
  font-size: 12px;
  color: var(--fg-error-default);
  opacity: 0.7;
  margin-top: 2px;
  font-family: var(--font-mono);
}
.bm-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-default);
  border-top-color: var(--fill-brand-default);
  border-radius: 50%;
  animation: bm-spin 700ms linear infinite;
}
@keyframes bm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Scatter chart ===== */
.bm-scatter-wrap {
  width: 100%;
  position: relative;
  margin-top: 8px;
}

.bm-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 4px 14px;
  font-size: 13px;
}
.bm-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-secondary);
  cursor: pointer;
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: 500;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}
.bm-legend-item:hover,
.bm-legend-item.is-hover {
  background: var(--neutral-light-3);
  color: var(--fg-primary);
}
.bm-legend-item.is-off {
  opacity: 0.45;
  text-decoration: line-through;
}
.bm-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: none;
}
.bm-legend-spacer {
  flex: 1;
}
.bm-legend-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--fg-tertiary);
}
.bm-legend-meta-x {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-brand-default);
}

.bm-chart-shell {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 4px;
  overflow: visible;
}

.bm-svg {
  display: block;
  overflow: visible;
}
.bm-tick {
  font-family: var(--font-system);
  font-size: 11px;
  fill: var(--fg-tertiary);
}
.bm-axis-title {
  font-family: var(--font-system);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  fill: var(--fg-tertiary);
  text-transform: uppercase;
}
.bm-axis-faster {
  font-family: var(--font-system);
  font-size: 11px;
  font-weight: 500;
  fill: var(--fg-brand-default);
}
.bm-corner {
  font-family: var(--font-system);
  font-size: 11px;
  fill: var(--fg-tertiary);
  font-weight: 500;
}
.bm-dot-g {
  cursor: pointer;
}

/* Inline labels */
.bm-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid;
  font-family: var(--font-system);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  box-sizing: border-box;
  backdrop-filter: blur(2px);
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1), box-shadow 200ms ease;
}
.bm-label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bm-label.is-active {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.bm-label-mark {
  display: inline-flex;
  align-items: center;
  margin-right: 0;
}
.bm-label-name {
  font-weight: 600;
  letter-spacing: -0.005em;
}
.bm-label.is-you .bm-label-name {
  color: inherit;
}
.bm-label-sub {
  font-weight: 500;
  opacity: 0.85;
}
.bm-label-sub-other {
  font-weight: 500;
  opacity: 1;
}
.bm-label-stat {
  text-align: center;
  font-weight: 500;
  opacity: 0.8;
}

/* Tooltip */
.bm-tooltip {
  position: absolute;
  pointer-events: none;
  width: 240px;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-left-width: 3px;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow-popover);
  font-family: var(--font-system);
  z-index: 5;
  animation: bm-tt-in 160ms cubic-bezier(0.2, 0, 0, 1);
}
.bm-tooltip.is-pinned {
  pointer-events: auto;
}
@keyframes bm-tt-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.bm-tt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.bm-tt-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}
.bm-tt-provider {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.bm-tt-close {
  margin-left: auto;
  background: transparent;
  border: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--fg-tertiary);
  cursor: pointer;
}
.bm-tt-close:hover {
  background: var(--neutral-light-3);
  color: var(--fg-primary);
}
.bm-tt-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-primary);
  margin-bottom: 8px;
}
.bm-tt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
}
.bm-tt-k {
  font-size: 10px;
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.bm-tt-v {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  color: var(--fg-primary);
  margin-top: 2px;
}
.bm-tt-unit {
  font-size: 12px;
  color: var(--fg-tertiary);
  font-weight: 500;
  margin-left: 1px;
}
.bm-tt-foot {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-tertiary);
}

/* ============================================================
   Proven in Testing section (mirrors src/app/styles/site-shell.css
   .ss-proven-* rules — required by BenchmarksProven component).
   ============================================================ */

.ss-proven {
  width: 100%;
  margin: 0 auto;
}
.ss-proven-head {
  margin-bottom: 32px;
}
.ss-proven-eyebrow {
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  margin-bottom: 12px;
}
.ss-proven-rule {
  border: 0;
  border-top: 1px solid var(--border-default);
  margin: 0 0 20px;
}
.ss-proven-heading {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 36px;
  line-height: 44px;
  letter-spacing: -0.015em;
  color: var(--fg-primary);
  margin: 0 0 8px;
}
.ss-proven-lede {
  font-family: var(--font-system);
  font-size: 16px;
  line-height: 24px;
  color: var(--fg-secondary);
  margin: 0;
  max-width: 56ch;
}
.ss-proven-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.ss-proven-nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.ss-proven-nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ss-proven-nav-cat {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 18px;
  line-height: 24px;
  color: var(--fg-primary);
}
.ss-proven-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.ss-proven-nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  margin: 0;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  font-family: var(--font-system);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-secondary);
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.ss-proven-nav-item:hover {
  color: var(--fg-primary);
  background: var(--surface-raised);
}
.ss-proven-nav-item.is-active {
  color: var(--fg-primary);
  font-weight: 600;
  border-left-color: var(--fg-brand-default);
}
.ss-proven-panel {
  min-height: 520px;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 16px;
}
.ss-proven-panel-meta {
  font-family: var(--font-system);
  font-size: 12px;
  color: var(--fg-tertiary);
  margin-bottom: 8px;
}
.ss-proven-panel-state {
  font-family: var(--font-system);
  font-size: 14px;
  color: var(--fg-tertiary);
  padding: 32px 16px;
  text-align: center;
}
.ss-proven-panel-state-error {
  color: var(--fg-error-default);
}

@media (max-width: 720px) {
  .ss-proven-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .ss-proven-panel {
    min-height: 420px;
  }
  .ss-proven-heading {
    font-size: 28px;
    line-height: 36px;
  }
}

