/* Budget Breakdown Block
   Dark comparison section: where an agency budget leaks vs. where DevQ's goes.
   All colours fall back to literals so the block still reads correctly in the
   block editor canvas, where header.php's :root block is not present. */

.budgetbreakdown-block {
  --bb-ink: #03121d;
  --bb-panel: #0a1e2b;
  --bb-panel-2: #0d2432;
  --bb-line: rgba(255, 255, 255, .10);
  --bb-muted: #93acba;
  --bb-dim: #7794a3;
  --bb-teal: var(--secondary, #00c2ab);
  --bb-yellow: var(--tertiary, #f9ed32);
  background: var(--bb-ink);
  padding: 110px 0;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.budgetbreakdown-block * {
  box-sizing: border-box;
}

/* ---------- Header ---------- */

.bb-header {
  max-width: 780px;
  margin-bottom: 50px;
}

.bb-eyebrow {
  display: block;
  font-family: var(--font2, montserrat, sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bb-teal);
  margin-bottom: 16px;
}

.bb-heading {
  font-family: var(--font1, montserrat, sans-serif);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.01em;
  color: #fff;
  margin: 0;
}

.bb-heading-hl {
  display: inline-block;
  background: var(--bb-yellow);
  color: var(--bb-ink);
  padding: 1px 12px 3px;
  margin-top: 6px;
}

.bb-lede {
  font-size: 17px;
  line-height: 1.65;
  color: var(--bb-muted);
  margin: 22px 0 0;
  max-width: 660px;
}

/* ---------- Budget calculator ---------- */

.bb-calc {
  background: var(--bb-panel);
  border: 1px solid var(--bb-line);
  border-radius: 16px;
  padding: 24px 30px 26px;
  margin-bottom: 54px;
}

.bb-calc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.bb-calc-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bb-dim);
  margin: 0;
}

.bb-calc-value {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.bb-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  margin: 20px 0 18px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(90deg,
      var(--bb-teal) 0,
      var(--bb-teal) var(--bb-fill, 5%),
      rgba(255, 255, 255, .13) var(--bb-fill, 5%),
      rgba(255, 255, 255, .13) 100%);
}

.bb-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--bb-teal);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
}

.bb-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--bb-teal);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
}

.bb-slider:focus-visible {
  outline: 3px solid rgba(0, 194, 171, .5);
  outline-offset: 6px;
}

.bb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bb-chip {
  font-family: var(--font2, montserrat, sans-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--bb-muted);
  background: transparent;
  border: 1px solid var(--bb-line);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.bb-chip:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, .3);
}

.bb-chip[aria-pressed="true"] {
  color: var(--bb-ink);
  background: var(--bb-teal);
  border-color: var(--bb-teal);
}

/* ---------- Tracks ---------- */

.bb-tracks {
  display: grid;
  gap: 40px;
}

.bb-track-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

.bb-track-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bb-dim);
  margin: 0;
}

.bb-track--devq .bb-track-name {
  color: var(--bb-teal);
}

.bb-track-result {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-align: right;
}

.bb-track-amount {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.bb-track--devq .bb-track-amount {
  font-size: 34px;
  color: var(--bb-teal);
}

.bb-track-caption {
  font-size: 13px;
  color: var(--bb-dim);
}

.bb-bar-wrap {
  position: relative;
}

.bb-track--devq .bb-bar-wrap {
  padding-top: 26px;
}

.bb-bar {
  display: flex;
  height: 74px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bb-panel-2);
  position: relative;
}

.bb-seg {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 16px;
  min-width: 0;
  overflow: hidden;
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: var(--w, 0%);
}

/* The fill lives on ::before so the reveal can scale it without relaying out
   the bar on every frame. */
.bb-seg::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform-origin: left center;
  border-right: 3px solid var(--bb-ink);
}

.bb-seg:last-child::before {
  border-right: 0;
}

.bb-seg-label {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bb-seg--cost::before {
  background-color: #14303f;
  background-image: repeating-linear-gradient(135deg,
      rgba(255, 255, 255, .07) 0 6px,
      transparent 6px 13px);
}

.bb-seg--cost .bb-seg-label {
  color: #7d9aa9;
}

.bb-seg--build::before {
  background: linear-gradient(180deg, #00c9b2, #00a794);
}

.bb-seg--build .bb-seg-label {
  color: var(--bb-ink);
}

/* Marker: where the agency's build ran out, drawn on the DevQ bar */

.bb-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--mark, 40%);
  border-left: 2px dashed rgba(3, 18, 29, .5);
  z-index: 2;
  pointer-events: none;
}

.bb-marker-label {
  position: absolute;
  top: 0;
  left: var(--mark, 40%);
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--bb-yellow);
  z-index: 2;
}

.bb-marker-label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 3px);
  width: 1px;
  height: 9px;
  background: var(--bb-yellow);
}

/* ---------- Legend ---------- */

.bb-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}

.bb-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin: 0;
  list-style: none;
}

.bb-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 12px;
  background-color: #14303f;
  background-image: repeating-linear-gradient(135deg,
      rgba(255, 255, 255, .16) 0 3px,
      transparent 3px 6px);
}

.bb-legend-item--build .bb-swatch {
  background: var(--bb-teal);
}

.bb-legend-label {
  color: var(--bb-muted);
}

.bb-legend-value {
  color: #fff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bb-legend-pct {
  color: var(--bb-dim);
  font-size: 12px;
}

/* DevQ supporting line — sits where the agency track's legend sits */

.bb-devq-note {
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--bb-muted);
  max-width: 680px;
}

/* ---------- Delta callout ---------- */

.bb-delta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 46px;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--bb-yellow);
}

.bb-delta-amount {
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: var(--bb-yellow);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bb-delta-text {
  font-size: 17px;
  line-height: 1.5;
  color: #dbe7ee;
  max-width: 460px;
  margin: 0;
}

/* ---------- Footer ---------- */

.bb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 44px;
  padding-top: 34px;
  border-top: 1px solid var(--bb-line);
}

.bb-proof {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bb-dim);
  margin: 0;
}

.bb-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 32px;
  border-radius: 30px;
  background: var(--bb-yellow);
  color: var(--bb-ink);
  font-family: var(--font2, montserrat, sans-serif);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease;
}

.bb-cta:hover,
.bb-cta:focus {
  color: var(--bb-ink);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(249, 237, 50, .2);
}

.bb-cta svg {
  flex: 0 0 auto;
}

.bb-note {
  font-size: 12px;
  line-height: 1.6;
  color: #6d8b9c;
  max-width: 640px;
  margin: 24px 0 0;
}

/* ---------- Motion ----------
   The markup renders in its final state, so the block is correct with no JS at
   all (the editor canvas runs none). JS adds .bb-animate to wind it back, then
   .bb-in to release it.

   The fill is scaled on ::before rather than animating the segment's own
   flex-basis: transform is composited, where animating flex-basis relays out
   the whole bar on every frame. */

.bb-animate .bb-seg::before {
  transform: scaleX(0);
  transition-property: transform;
  transition-duration: .85s;
  transition-timing-function: cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--d, 0ms);
}

.bb-animate .bb-seg-label {
  opacity: 0;
  transition-property: opacity;
  transition-duration: .4s;
  transition-timing-function: ease;
  transition-delay: calc(var(--d, 0ms) + 280ms);
}

.bb-animate .bb-marker,
.bb-animate .bb-marker-label {
  opacity: 0;
  transition-property: opacity;
  transition-duration: .45s;
  transition-timing-function: ease;
  transition-delay: 1500ms;
}

.bb-animate.bb-in .bb-seg::before {
  transform: scaleX(1);
}

.bb-animate.bb-in .bb-seg-label,
.bb-animate.bb-in .bb-marker,
.bb-animate.bb-in .bb-marker-label {
  opacity: 1;
}

/* Reveal stagger: the agency bar fills segment by segment, so the leak reads as
   it happens; the DevQ bar then sweeps in as one piece. */

.bb-animate .bb-track--agency .bb-seg:nth-child(1) { --d: 0ms; }
.bb-animate .bb-track--agency .bb-seg:nth-child(2) { --d: 130ms; }
.bb-animate .bb-track--agency .bb-seg:nth-child(3) { --d: 260ms; }
.bb-animate .bb-track--agency .bb-seg:nth-child(4) { --d: 390ms; }
.bb-animate .bb-track--agency .bb-seg:nth-child(5) { --d: 520ms; }
.bb-animate .bb-track--agency .bb-seg:nth-child(6) { --d: 650ms; }
.bb-animate .bb-track--devq .bb-seg { --d: 820ms; }

@media (prefers-reduced-motion: reduce) {

  .bb-animate .bb-seg::before {
    transform: none;
    transition: none;
  }

  .bb-animate .bb-seg-label,
  .bb-animate .bb-marker,
  .bb-animate .bb-marker-label {
    opacity: 1;
    transition: none;
  }

  .bb-cta {
    transition: none;
  }
}

/* ---------- Tablet ---------- */

@media (max-width: 1199px) {
  .budgetbreakdown-block {
    padding: 80px 0;
  }

  .bb-heading {
    font-size: 34px;
  }

  .bb-lede {
    font-size: 16px;
  }

  .bb-calc {
    padding: 22px 24px 24px;
    margin-bottom: 44px;
  }

  .bb-calc-value {
    font-size: 30px;
  }

  .bb-bar {
    height: 64px;
  }

  /* Below the 1200px container step the overhead segments are too narrow for
     their own captions — the legend underneath carries every one of them. */
  .bb-seg--cost .bb-seg-label {
    display: none;
  }

  .bb-track-amount {
    font-size: 26px;
  }

  .bb-track--devq .bb-track-amount {
    font-size: 30px;
  }

  .bb-delta-amount {
    font-size: 32px;
  }

  .bb-delta-text {
    font-size: 16px;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
  .budgetbreakdown-block {
    padding: 60px 0;
  }

  .bb-header {
    margin-bottom: 34px;
  }

  .bb-heading {
    font-size: 27px;
  }

  .bb-heading-hl {
    padding: 1px 8px 3px;
  }

  .bb-lede {
    font-size: 15px;
    margin-top: 18px;
  }

  .bb-calc {
    padding: 20px 18px 22px;
    margin-bottom: 36px;
  }

  .bb-calc-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .bb-calc-value {
    font-size: 28px;
  }

  .bb-chip {
    font-size: 12px;
    padding: 6px 13px;
  }

  .bb-tracks {
    gap: 34px;
  }

  .bb-track-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .bb-track-result {
    text-align: left;
  }

  .bb-track-amount,
  .bb-track--devq .bb-track-amount {
    font-size: 24px;
  }

  .bb-bar {
    height: 54px;
    border-radius: 9px;
  }

  .bb-seg {
    padding: 0;
    border-right-width: 2px;
  }

  .bb-seg-label {
    display: none;
  }

  .bb-marker-label {
    font-size: 10px;
    letter-spacing: .06em;
  }

  .bb-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .bb-devq-note {
    font-size: 13px;
  }

  .bb-delta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 36px;
  }

  .bb-delta-amount {
    font-size: 30px;
  }

  .bb-delta-text {
    font-size: 15px;
  }

  .bb-foot {
    margin-top: 36px;
    padding-top: 28px;
    gap: 22px;
  }

  .bb-cta {
    width: 100%;
    justify-content: center;
    height: 52px;
  }
}

/* ---------- Marker caption clamping at the extremes ---------- */

.bb-marker-label--start {
  transform: none;
}

.bb-marker-label--start::after {
  left: 0;
}

.bb-marker-label--end {
  transform: translateX(-100%);
}

.bb-marker-label--end::after {
  left: auto;
  right: 0;
}

