/* SquashScope reviewer walkthrough refinements · v0.91 */

.stage1-branch-video { display: none; }

@media (min-width: 881px) {
  .stage1-flow-header,
  .stage2-flow-header,
  .stage3-flow-header,
  .stage4-flow-header,
  .stage5-flow-header {
    height: 54px;
    padding-block: 0;
    border-bottom-color: rgba(35, 41, 35, .13);
  }

  .stage1-flow-header > div:first-child,
  .stage2-flow-header > div:first-child,
  .stage3-flow-header > div:first-child,
  .stage4-flow-header > div:first-child,
  .stage5-flow-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .stage1-flow-header .section-kicker,
  .stage2-flow-header .section-kicker,
  .stage3-flow-header .section-kicker,
  .stage4-flow-header .section-kicker,
  .stage5-flow-header .section-kicker { display: none; }

  .stage1-flow-header h2,
  .stage2-flow-header h2,
  .stage3-flow-header h2,
  .stage4-flow-header h2,
  .stage5-flow-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font: 740 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .stage1-flow-header h2::before,
  .stage2-flow-header h2::before,
  .stage3-flow-header h2::before,
  .stage4-flow-header h2::before,
  .stage5-flow-header h2::before {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 50%;
    background: var(--scope-yellow);
    color: #242924;
    font-size: 8px;
    letter-spacing: 0;
  }

  .stage1-flow-header h2::before { content: "01"; }
  .stage2-flow-header h2::before { content: "02"; }
  .stage3-flow-header h2::before { content: "03"; }
  .stage4-flow-header h2::before { content: "04"; }
  .stage5-flow-header h2::before { content: "05"; }

  .stage1-flow-status > span,
  .stage2-flow-status > span,
  .stage3-flow-status > span,
  .stage4-flow-status > span,
  .stage5-flow-status > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #697169;
  }

  .stage1-flow-status > span::before,
  .stage2-flow-status > span::before,
  .stage3-flow-status > span::before,
  .stage4-flow-status > span::before,
  .stage5-flow-status > span::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d6c31c;
    box-shadow: 0 0 0 4px rgba(250, 229, 87, .15);
  }

  .stage1-flow-viewport,
  .stage2-flow-viewport,
  .stage3-flow-viewport,
  .stage4-flow-viewport,
  .stage5-flow-viewport { height: calc(100% - 54px); }

  .stage1-flow-panel,
  .stage2-flow-panel,
  .stage3-flow-panel,
  .stage4-flow-panel,
  .stage5-flow-panel { padding-top: 12px; }

  .stage1-page-heading h3,
  .stage2-page-heading h3,
  .stage3-page-heading h3,
  .stage4-page-heading h3,
  .stage5-page-heading h3 {
    font-size: clamp(28px, 2.55vw, 39px);
    line-height: 1;
  }

  .stage1-edge-next,
  .stage2-edge-next,
  .stage3-edge-next,
  .stage4-edge-next,
  .stage5-edge-next {
    right: calc(-1 * clamp(30px, 4.2vw, 68px) - 82px);
    border-color: rgba(121, 107, 0, .32);
    background: rgba(250, 229, 87, .96);
    box-shadow: 0 16px 44px rgba(114, 100, 0, .18);
  }

  .stage1-edge-next span,
  .stage2-edge-next span,
  .stage3-edge-next span,
  .stage4-edge-next span,
  .stage5-edge-next span { color: #3b3a22; }

  .stage1-edge-next.is-ready svg,
  .stage2-edge-next.is-ready svg,
  .stage3-edge-next.is-ready svg,
  .stage4-edge-next.is-ready svg,
  .stage5-edge-next.is-ready svg { animation: scope-edge-invite 1.35s ease-in-out infinite; }

  .stage1-edge-next.is-ready:hover,
  .stage1-edge-next.is-ready:focus-visible,
  .stage2-edge-next.is-ready:hover,
  .stage2-edge-next.is-ready:focus-visible,
  .stage3-edge-next.is-ready:hover,
  .stage3-edge-next.is-ready:focus-visible,
  .stage4-edge-next.is-ready:hover,
  .stage4-edge-next.is-ready:focus-visible,
  .stage5-edge-next.is-ready:hover,
  .stage5-edge-next.is-ready:focus-visible {
    right: calc(-1 * clamp(30px, 4.2vw, 68px));
    background: #ffec55;
  }

  .stage1-edge-next:disabled,
  .stage2-edge-next:disabled,
  .stage3-edge-next:disabled,
  .stage4-edge-next[aria-disabled="true"],
  .stage5-edge-next[aria-disabled="true"] {
    background: rgba(239, 241, 236, .92);
    border-color: var(--hairline-strong);
    box-shadow: none;
  }

  .stage1-process-trigger,
  .stage1-visual-action,
  .stage2-visual-action,
  .stage3-visual-action,
  .stage4-visual-action {
    border-color: rgba(111, 98, 0, .42);
    background: rgba(250, 229, 87, .95);
    color: #202520;
    box-shadow: 0 16px 44px rgba(84, 76, 10, .2);
    backdrop-filter: blur(12px);
  }

  .stage1-process-trigger:hover,
  .stage1-visual-action:hover,
  .stage2-visual-action:hover,
  .stage3-visual-action:hover,
  .stage4-visual-action:hover { background: #ffec55; }

  .stage1-process-trigger small,
  .stage1-visual-action small,
  .stage2-visual-action small,
  .stage3-visual-action small,
  .stage4-visual-action small { color: rgba(32, 37, 32, .64); }

  .stage1-process-spinner,
  .stage2-process-spinner,
  .stage3-process-spinner,
  .stage4-process-spinner {
    border-color: rgba(32, 37, 32, .2);
    border-top-color: #202520;
  }

  .stage2-sidewall-layout {
    width: min(100%, 1200px);
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(300px, 1fr) auto;
    gap: clamp(10px, 1.45vh, 15px);
  }

  .stage2-sidewall-layout .stage2-page-heading { grid-column: 1; }
  .stage2-sidewall-frame { min-height: 300px; align-self: stretch; }
  #stage2-sidewall-overlay {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
  }

  .stage2-sidewall-evidence {
    grid-template-columns: minmax(170px, .48fr) minmax(350px, 1.05fr) minmax(280px, .8fr);
    grid-template-rows: minmax(90px, 1fr) auto;
    align-items: center;
    gap: 7px 24px;
    min-height: 126px;
    padding-block: 9px;
    border-block: 1px solid var(--hairline-strong);
  }

  .stage2-sidewall-evidence > header {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: grid;
    justify-content: stretch;
    gap: 8px;
  }

  .stage2-sidewall-evidence > header strong { font-size: 13px; line-height: 1.15; }

  .stage2-sidewall-logic {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--hairline);
  }

  .stage2-sidewall-logic li {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 3px;
    border-bottom: 1px solid var(--hairline);
    opacity: .32;
    transform: translateX(8px);
    transition: opacity 300ms ease, transform 460ms cubic-bezier(.2,.8,.2,1);
  }

  .stage2-sidewall-evidence.is-revealed .stage2-sidewall-logic li { opacity: 1; transform: none; }
  .stage2-sidewall-evidence.is-revealed .stage2-sidewall-logic li:nth-child(2) { transition-delay: 100ms; }
  .stage2-sidewall-evidence.is-revealed .stage2-sidewall-logic li:nth-child(3) { transition-delay: 200ms; }
  .stage2-sidewall-logic b,
  .stage2-sidewall-logic em {
    color: #747b74;
    font: normal 750 7px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .06em;
  }
  .stage2-sidewall-logic span { font-size: 10px; font-weight: 670; }
  .stage2-sidewall-logic em { color: #746900; }
  .stage2-sidewall-evidence .stage2-chart-wrap { min-height: 120px; }
  .stage2-sidewall-evidence .stage2-chart-wrap {
    grid-column: 3;
    grid-row: 1;
    height: 96px;
    min-height: 96px;
  }
  .stage2-sidewall-evidence .stage2-window-key {
    grid-column: 3;
    grid-row: 2;
    gap: 8px;
  }
  .stage2-sidewall-evidence .stage2-window-key span { font-size: 6px; }

  .stage3-rule-layout,
  .stage3-frontwall-layout {
    width: min(100%, 1120px);
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(290px, 1fr) auto;
    gap: clamp(10px, 1.5vh, 15px);
  }

  .stage3-rule-layout .stage3-page-heading,
  .stage3-frontwall-layout .stage3-page-heading { grid-column: 1; }
  .stage3-video-evidence { min-height: 290px; }

  .stage3-evidence-strip,
  .stage3-interval-checks {
    align-self: stretch;
    display: grid;
    grid-template-columns: minmax(220px, .28fr) minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: center;
    gap: 24px;
    min-height: 102px;
    padding: 9px 0;
  }

  .stage3-evidence-strip canvas,
  .stage3-interval-checks canvas { width: 100%; height: 94px; min-height: 94px; }

  .stage3-output-layout {
    width: min(100%, 1120px);
    grid-template-columns: minmax(330px, .72fr) minmax(500px, 1.28fr);
    gap: 16px 48px;
  }

  .stage4-sync-layout,
  .stage4-semantic-layout,
  .stage4-composite-layout {
    width: min(100%, 1160px);
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(300px, 1fr) auto;
    gap: clamp(10px, 1.5vh, 15px);
  }

  .stage4-page-heading { grid-column: 1; }
  .stage4-video-stage { min-height: 300px; }

  .stage4-layer-ledger {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stage4-layer-ledger li {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    padding: 12px 13px;
    border-right: 1px solid var(--hairline);
  }
  .stage4-layer-ledger li:last-child { border-right: 0; }

  .stage4-contact-scrubber { gap: 10px; padding-block: 10px; }
  .stage4-contact-scrubber__track { height: 28px; }
  .stage4-contact-scrubber__track i { inset: 8px 0; }

  .stage4-phase-timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0;
  }
  .stage4-phase-timeline > div:not(.stage4-phase-timeline__cursor) {
    min-width: 0;
    padding: 14px 18px;
    border-right: 1px solid var(--hairline);
    border-bottom: 0;
  }
  .stage4-phase-timeline > div:nth-last-child(1) { border-right: 0; }
  .stage4-phase-timeline > div.is-active { padding-left: 24px; }
  .stage4-phase-timeline__cursor {
    top: 0;
    bottom: 0;
    left: calc(16.666% - 1px);
    width: 2px;
    height: auto;
    transition: left 260ms cubic-bezier(.2,.8,.2,1);
  }
}

@keyframes scope-edge-invite {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

.stage1-frame-scrubber.is-guiding .stage1-frame-scrubber__meta strong {
  color: #756900;
  animation: scope-guide-label 720ms ease-in-out infinite alternate;
}
.stage1-frame-scrubber.is-guiding #stage1-completion-scrubber::-webkit-slider-thumb {
  box-shadow: 0 0 0 7px rgba(250, 229, 87, .25), 0 5px 15px rgba(22, 27, 22, .2);
}
.stage1-frame-scrubber.is-guiding #stage1-completion-scrubber::-moz-range-thumb {
  box-shadow: 0 0 0 7px rgba(250, 229, 87, .25), 0 5px 15px rgba(22, 27, 22, .2);
}
@keyframes scope-guide-label { to { opacity: .56; } }

@media (prefers-reduced-motion: reduce) {
  .stage1-edge-next svg,
  .stage2-edge-next svg,
  .stage3-edge-next svg,
  .stage4-edge-next svg,
  .stage5-edge-next svg,
  .stage1-frame-scrubber.is-guiding .stage1-frame-scrubber__meta strong { animation: none !important; }
}
