/* Section 03, Value stream: the stat card, the pipeline canvas (js/sections/pipeline-canvas.js) and the value-stream bars (js/sections/value-stream.js). */

@layer components {
  @media (max-width:960px) {
    .rv-stmt {
      flex-direction: column;
    }
  }
  @media (max-width:760px) {
    .rv-legend {
      min-height: 72px;
    }
    #pfCanvas {
      min-width: 720px;
    }
  }
}

@layer sections {
  .stream-section {
    padding: 96px 0;
    border-bottom: 1px solid var(--line);
    background: #eef2f6;
  }

  .stream-heading-faster-coding {
    font-weight: 600;
    font-size: 36px;
    line-height: 1.06;
    letter-spacing: -.02em;
    margin: 14px 0 0;
    white-space: nowrap;
  }

  .stream-row-making-engineers {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 44px;
    flex-wrap: wrap;
    margin-top: 16px;
  }

  .stream-stack-making-engineers {
    flex: 1 1 320px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .stream-copy-making-engineers {
    margin: 0;
    max-width: 74ch;
    font-size: 16.5px;
    line-height: 1.6;
    color: var(--text);
  }

  .stream-stat {
    flex: 0 0 auto;
    background: var(--ink);
    border-radius: 6px;
    padding: 20px 24px;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 14px 34px rgba(14,23,38,.24);
  }

  .stream-box-non-value {
    position: relative;
    width: 84px;
    height: 84px;
    flex: 0 0 auto;
  }

  .stream-row-non-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -.02em;
    color: var(--white);
  }

  .stream-text-non-value {
    font-size: 13px;
    color: #E0A23D;
    margin-left: 1px;
  }

  .stream-label-non-value {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #E0A23D;
  }

  .stream-text-total-delivery {
    font-size: 12.5px;
    color: var(--dk-muted);
    margin-top: 8px;
    line-height: 1.45;
    max-width: 19ch;
  }

  .stream-facts-more {
    column-count: 2;
    column-gap: 48px;
    margin-top: 24px;
  }

  .stream-pfcard {
    margin-top: 40px;
    background: var(--white);
    border: 1px solid var(--line);
    padding: 30px 30px 24px;
    opacity: 1;
    transform: none;
    transition: opacity .8s cubic-bezier(.2,.7,.2,1) .1s,transform .8s cubic-bezier(.2,.7,.2,1) .1s;
  }

  .stream-row-where-work {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
  }

  .stream-box-where-work {
    flex: 1 1 420px;
    min-width: 0;
  }

  .stream-text {
    font-weight: 600;
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -.02em;
    color: var(--ink);
  }

  .stream-grid-work-queues {
    display: grid;
    margin-top: 10px;
    max-width: 72ch;
  }

  .stream-pf-caption-a {
    grid-area: 1/1;
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted);
    transition: opacity .4s ease;
  }

  .stream-pf-caption-b {
    grid-area: 1/1;
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted);
    transition: opacity .4s ease;
    opacity: 0;
  }

  .stream-row-siloed {
    flex: 0 0 auto;
    display: inline-flex;
    gap: 2px;
    border: 1px solid var(--line-strong);
    border-radius: 9999px;
    padding: 3px;
    background: var(--white);
  }

  .stream-pf-siloed {
    border: 0;
    border-radius: 9999px;
    padding: 9px 16px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--white);
    transition: background .3s,color .3s;
  }

  .stream-pf-integrated {
    border: 0;
    border-radius: 9999px;
    padding: 9px 16px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    background: transparent;
    color: var(--muted);
    transition: background .3s,color .3s;
  }

  .stream-pf-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 1840/690;
    margin-top: 12px;
  }

  .stream-legend {
    position: relative;
    height: 22px;
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
  }

  .stream-pf-legend-a {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    transition: opacity .5s ease;
  }

  .stream-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .stream-dot-waiting-queue {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #D29A45;
  }

  .stream-dot-moving-between {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--faint);
  }

  .stream-dot-active-development {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #1F9D6B;
  }

  .stream-pf-legend-b {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity .5s ease;
  }

  .stream-dot-continuous-flow {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--blue);
  }

  .stream-stmt {
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    opacity: 1;
    transform: none;
    transition: opacity .8s cubic-bezier(.2,.7,.2,1) .1s,transform .8s cubic-bezier(.2,.7,.2,1) .1s;
  }

  .stream-copy-industrialize-operational {
    margin: 0;
    max-width: 62ch;
    border-left: 3px solid var(--blue);
    padding: 2px 0 2px 22px;
    font-size: 21px;
    line-height: 1.5;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--ink);
  }

  .stream-cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--blue);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 17px 30px;
    white-space: nowrap;
    transition: background .25s ease;
  }

  .stream-card-where-time {
    margin-top: 40px;
    background: var(--white);
    border: 1px solid var(--line);
    padding: 34px 30px 26px;
    opacity: 1;
    transform: none;
    transition: opacity .8s cubic-bezier(.2,.7,.2,1) .12s,transform .8s cubic-bezier(.2,.7,.2,1) .12s;
  }

  .stream-row-where-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
  }

  .stream-vs-replay {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    background: var(--white);
    border: 1px solid var(--line-strong);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: .2s cubic-bezier(.2,0,.2,1);
  }
  .stream-vs-replay:hover {
    border-color: var(--blue);
    color: var(--blue);
  }

  .stream-label-mission-need {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gray);
    margin-bottom: 6px;
  }

  .stream-copy-eight-stages {
    margin: 0 0 26px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted);
    max-width: 72ch;
  }

  .stream-row-siloed-delivery {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
  }

  .stream-text-2 {
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
  }

  .stream-label-578d-total {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #9a6b1e;
  }

  .stream-card {
    position: relative;
    height: 44px;
    border-radius: 9px;
    overflow: hidden;
    background: var(--paper);
  }

  .stream-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
  }

  .stream-vfade {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--white);
    pointer-events: none;
  }

  .stream-vfade-2 {
    position: absolute;
    left: 32.5%;
    top: 50%;
    transform: translateY(-50%);
    padding-left: 10px;
    opacity: 1;
    font-family: var(--font-mono);
    font-size: 11px;
    color: #5a3f10;
    font-weight: 600;
    pointer-events: none;
  }

  .stream-row-integrated-delivery {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 26px 0 9px;
  }

  .stream-label-188d-total {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--blue);
  }

  .stream-vfade-3 {
    position: absolute;
    left: 32.5%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .05em;
    color: var(--muted);
    padding-left: 16px;
    white-space: nowrap;
    pointer-events: none;
  }

  .stream-text-390-fewer {
    color: var(--blue);
    font-weight: 700;
  }

  .stream-row-0-days {
    display: flex;
    justify-content: space-between;
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid var(--line-soft);
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: .08em;
    color: var(--gray);
  }
}

/* Breakpoint and state overrides: these win over the section styles above. */
@layer overrides {
  @media (max-width:960px) {
    .rv-stmt {
      align-items: flex-start;
      gap: 24px;
    }
  }
  @media (max-width:760px) {
    .rv-stat {
      min-width: 0;
      flex: 1 1 auto;
      padding: 18px 18px;
    }
    #pfcard {
      padding: 20px 16px 18px;
    }
    .rv-legend {
      height: auto;
    }
    .rv-legend > div {
      justify-content: flex-start;
      gap: 6px 18px;
    }
    .rv-stmt p {
      font-size: 18px;
    }
  }
}
