/* Title row */
.harness-builder-page .hb-title-side { flex: 1; }
.harness-builder-page .hb-title-with { padding: 0 0.5em; flex-shrink: 0; }

/* Intro row: 2-col grid (description | install) */
.harness-builder-page .home-hero__intro-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3em;
  width: 100%;
  max-width: 72em;
  margin: 0 auto;
  padding-bottom: 6em;
}

.harness-builder-page .home-hero__intro-row .home-hero__description-row {
  background-image: none;
  text-align: left;
  max-width: none;
  padding-top: 0;
  padding-bottom: 0;
}

.harness-builder-page .home-hero__install-row {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  padding: 0;
}

.harness-builder-page .hb-install-mobile { display: none; }

@media (max-width: 991px) {
  .harness-builder-page .hb-title-side { flex: none; text-align: center !important; }
  .harness-builder-page .hb-title-with { padding: 0.4em 0; font-size: 1.8em; }
  .harness-builder-page .hb-install { display: none; }
  .harness-builder-page .hb-install-mobile { display: flex; justify-content: center; }
  .harness-builder-page .home-hero__intro-row { grid-template-columns: 1fr; gap: 1.5em; }
  .harness-builder-page .home-hero__intro-row .home-hero__description-row { text-align: center; }
  .harness-builder-page .home-hero__install-row { justify-content: center; }
}

/* Card colors — each tab drives the blip flash and border tint */
.harness-builder-page .radial-marquee__item[data-target-tab="smart-pr-review"]   { --card-color: #a1ff62; }
.harness-builder-page .radial-marquee__item[data-target-tab="fix-github-issue"]  { --card-color: #6840ff; }
.harness-builder-page .radial-marquee__item[data-target-tab="plan-to-pr"]        { --card-color: #f84131; }
.harness-builder-page .radial-marquee__item[data-target-tab="refactor-safely"]   { --card-color: #a1ff62; }
.harness-builder-page .radial-marquee__item[data-target-tab="doc-gardening"]     { --card-color: #6840ff; }
.harness-builder-page .radial-marquee__item[data-target-tab="fix-ci-errors"]     { --card-color: #f84131; }

.harness-builder-page .radial-marquee__item .radial-marquee__card-inner {
  border-left: 8px solid var(--card-color, transparent);
  border-right: 8px solid var(--card-color, transparent);
}

@keyframes hb-reel-pulse-sweep {
  0%   { top: -5%;  opacity: 0; transform: scale(0.6); }
  12%  { opacity: 1; transform: scale(1.1); }
  100% { top: 105%; opacity: 0; transform: scale(1); }
}

.harness-builder-page .reel__bg-line {
  position: relative;
  --pulse-color: #f84131;
}

.harness-builder-page .reel__bg-line.reel-pulse::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 0;
  width: 15px;
  height: 90px;
  background: radial-gradient(
    ellipse at center,
    var(--pulse-color) 0%,
    color-mix(in srgb, var(--pulse-color) 55%, transparent) 35%,
    transparent 75%
  );
  box-shadow: 0 0 24px 6px color-mix(in srgb, var(--pulse-color) 55%, transparent);
  animation: hb-reel-pulse-sweep 2.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
  pointer-events: none;
  border-radius: 999px;
  transform-origin: center;
}

@keyframes hb-card-blip-flash {
  0%   { opacity: 0; }
  18%  { opacity: 0.7; }
  100% { opacity: 0; }
}

.harness-builder-page .radial-marquee__item.card-blip .radial-marquee__card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    var(--card-color, #ff7a1f) 0%,
    color-mix(in srgb, var(--card-color, #ff7a1f) 70%, transparent) 50%,
    color-mix(in srgb, var(--card-color, #ff7a1f) 30%, transparent) 100%
  );
  box-shadow: 0 0 30px 4px color-mix(in srgb, var(--card-color, #ff7a1f) 60%, transparent);
  animation: hb-card-blip-flash 1.1s ease-out forwards;
  pointer-events: none;
}

.sticky-steps {
  min-height: 100dvh;
  position: relative;
  overflow: clip;
}

.sticky-steps__container {
  max-width: 74em;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5em;
  padding-right: 1.5em;
}

.sticky-steps__collection {
  min-height: 100dvh;
  display: flex;
  position: relative;
}

.sticky-steps__list {
  grid-column-gap: 30dvh;
  grid-row-gap: 30dvh;
  flex-flow: column;
  flex: 1;
  padding-top: calc(50dvh - 7.5em);
  padding-bottom: calc(50dvh - 7.5em);
  display: flex;
}

.sticky-steps__text {
  grid-column-gap: 2em;
  grid-row-gap: 2em;
  flex-flow: column;
  width: 50%;
  padding-right: 6em;
  display: flex;
}

.sticky-steps__eyebrow {
  opacity: .5;
  text-transform: uppercase;
  font-size: 1.3125em;
  font-weight: 700;
}

.sticky-steps__h2 {
  letter-spacing: -.04em;
  margin-top: 0;
  margin-bottom: 0;
  font-size: min(5.5em, 15vw);
  font-weight: 500;
  line-height: .9;
}

.sticky-steps__p {
  opacity: .6;
  margin-bottom: 0;
  font-size: min(1.4375em, 5vw);
  line-height: 1.4;
}

.sticky-steps__media {
  width: 50%;
  height: 100%;
  padding-left: 3em;
  position: absolute;
  top: 0;
  right: 0;
}

.sticky-steps__sticky {
  align-items: center;
  width: 100%;
  min-height: 100dvh;
  display: flex;
  position: sticky;
  top: 0;
}

.sticky-steps__visual {
  aspect-ratio: 3 / 4;
  border-radius: 500em;
  width: 100%;
  position: relative;
}

.sticky-steps__cover-image {
  object-fit: cover;
  border-radius: inherit;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

@media screen and (min-width: 992px) {
  [data-sticky-steps-item-status] .sticky-steps__visual {
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    opacity: 0;
    visibility: hidden;
  }

  [data-sticky-steps-item-status="before"] .sticky-steps__visual,
  [data-sticky-steps-item-status="active"] .sticky-steps__visual {
    opacity: 1;
    visibility: visible;
  }

  [data-sticky-steps-item-status] .sticky-steps__text {
    transition: opacity 0.5s ease-in-out;
    opacity: 0.25;
  }

  [data-sticky-steps-item-status="active"] .sticky-steps__text {
    opacity: 1;
  }
}

@media screen and (max-width: 991px) {
  .sticky-steps__list {
    grid-column-gap: 7.5em;
    grid-row-gap: 7.5em;
    padding-top: 10em;
    padding-bottom: 10em;
  }

  .sticky-steps__text {
    width: 100%;
    padding-bottom: 5em;
    padding-right: 0;
  }

  .sticky-steps__sticky {
    min-height: auto;
    position: relative;
    top: auto;
  }

  .sticky-steps__media {
    width: 100%;
    height: auto;
    padding-left: 0;
    position: relative;
    top: auto;
    right: auto;
  }
}

@media screen and (max-width: 767px) {
  .sticky-steps__text {
    grid-column-gap: 1.5em;
    grid-row-gap: 1.5em;
  }
}

/* —— Engine Flow tab fieldset (HarnessBuilderReel) —— */
.ef-demo-notice {
  text-align: center;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.35);
  margin: 0 0 1em;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
}

.ef-tabs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: none;
  padding: 0;
  margin: 0;
}

.ef-tabs legend {
  padding: 0 10px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.6875em;
  letter-spacing: 0.08em;
  opacity: 0.45;
}

.ef-tabs__row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.ef-tab .button-bg {
  background: var(--color-neutral-525);
}
.ef-tab--active .button-bg {
  background: var(--color-electric);
}
.ef-tab:not(.ef-tab--active) {
  color: var(--color-neutral-200);
}
.ef-tab--active {
  color: var(--color-neutral-800);
}
.ef-tab:not(.ef-tab--active):hover .button-bg {
  background: var(--color-neutral-550);
}

/* —— Install command (InstallCommand.astro) —— */
.install {
  --install-bg: #ffffff;
  --install-border: rgba(0, 0, 0, 0.13);
  --install-fg: #151313;
  --install-fg-mute: rgba(0, 0, 0, 0.6);
  --install-fg-faint: rgba(0, 0, 0, 0.45);
  --install-accent: #151313;
  --install-ok: #2f8f3f;
  --install-err: #f84131;

  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
}

.install__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.install__tab {
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid var(--install-border);
  background: transparent;
  color: var(--install-fg-mute);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s, border-color 0.25s, background 0.25s, border-radius 0.25s;
}
.install__tab:hover {
  background: rgb(234, 234, 234);
  border-color: rgba(0, 0, 0, 0.25);
  color: rgba(0, 0, 0, 0.85);
}
.install__tab--active {
  background: var(--install-accent);
  color: #ffffff;
  border-color: var(--install-accent);
  border-radius: 999px;
}
.install__tab--active:hover {
  background: var(--install-accent);
  color: #ffffff;
}

.install__panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  width: 100%;
  background: var(--install-bg);
  border: 1px solid var(--install-border);
  border-radius: 14px;
  box-shadow: 0 16px 32px -16px rgba(21, 19, 19, 0.18);
  cursor: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 2H8V5H16V2Z' stroke='black' stroke-miterlimit='10'/%3E%3Cpath d='M16 3H17.5L19 4.5V19.5L17.5 21H6.5L5 19.5V4.5L6.5 3H8' stroke='black' stroke-miterlimit='10'/%3E%3C/svg%3E") 4 4, copy;
  text-align: left;
  transition: border-color 0.2s;
}
.install__panel:hover {
  border-color: rgba(0, 0, 0, 0.28);
}
.install__panel[data-copy-state="copied"] {
  border-color: var(--install-ok);
}

.install__panel-wrap {
  width: 100%;
}
.install__panel-wrap:has([data-copy-state="copied"]) .css-tooltip__box {
  opacity: 0 !important;
  visibility: hidden !important;
}

.install__prompt {
  color: var(--install-fg-faint);
  font-size: 14px;
  flex: 0 0 auto;
  user-select: none;
}

.install__cmd {
  flex: 1 1 auto;
  overflow-x: auto;
  white-space: nowrap;
  font-family: inherit;
  font-size: 14px;
  color: var(--install-fg);
}

.install__status {
  margin-top: 8px;
  min-height: 18px;
  text-align: center;
  font-size: 12px;
  font-family: inherit;
}
.install__status--ok   { color: var(--install-ok); }
.install__status--err  { color: var(--install-err); }
.install__status--mute { color: var(--install-fg-faint); }

.install__footnote {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  font-family: inherit;
  color: var(--install-fg-faint);
}
.install__footnote code {
  padding: 1px 5px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  font-family: inherit;
  font-size: 11.5px;
}
.install__footnote a {
  color: var(--install-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.install__footnote a:hover {
  text-decoration: none;
}

/* —— Install Steps Panel —— */

.install-steps {
  display: flex;
  flex-direction: column;
  gap: var(--gap-m);
}

.install-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-step__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.install-step__num {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  background: var(--color-neutral-600);
  color: var(--color-neutral-475);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Haffer Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
}

.install-step__title {
  margin: 0;
  font-family: "Haffer XH", Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-neutral-200);
}

.install-step__optional {
  font-weight: 400;
  color: var(--color-neutral-525);
}

.install-step__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-neutral-475);
}

.install-step__desc a {
  color: var(--color-neutral-200);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.install-step__desc a:hover {
  text-decoration: none;
}

.install-step__desc code {
  font-family: "Haffer Mono", ui-monospace, monospace;
  font-size: 11.5px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
}

.install-step__hint {
  margin: 0;
  font-family: "Haffer Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--color-neutral-475);
}

.install-step__hint code {
  font-family: inherit;
  font-size: inherit;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
}

.install-step__hint a {
  color: var(--color-neutral-300);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.install-step__hint a:hover {
  text-decoration: none;
}

.install-step__code-wrap {
  position: relative;
  width: 100%;
}

.install-step__code-wrap:has([data-copy-state="copied"]) .css-tooltip__box {
  opacity: 0 !important;
  visibility: hidden !important;
}

.install-step__code {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s;
}

.install-step__code:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.install-step__code[data-copy-state="copied"] {
  border-color: #2f8f3f;
}

.install-step__prompt {
  flex: 0 0 auto;
  font-family: "Haffer Mono", ui-monospace, monospace;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.25);
  user-select: none;
}

.install-step__cmd {
  flex: 1 1 auto;
  overflow-x: auto;
  white-space: nowrap;
  font-family: "Haffer Mono", ui-monospace, monospace;
  font-size: 13px;
  color: var(--color-neutral-300);
}

/* Install widget dark-context overrides (inside the install modal) */

.install-steps .install {
  --install-border:   rgba(255, 255, 255, 0.12);
  --install-fg-mute:  var(--color-neutral-400);
  --install-fg-faint: var(--color-neutral-475);
  --install-accent:   var(--color-neutral-200);
  /* --install-fg intentionally not overridden — panel command text stays dark on white */
}

.install-steps .install .install__tab--active {
  color: var(--color-neutral-800);
}

.install-steps .install .install__tab:not(.install__tab--active):hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--color-neutral-200);
}

.install-steps .install .install__footnote a {
  color: var(--color-neutral-300);
}

.install-steps .install .install__footnote code {
  background: rgba(255, 255, 255, 0.08);
}

/* —— Harness Builder DAG diagram —— */
.hb-dag-wrap {
  --hb-accent:      var(--color-electric);
  --hb-accent-soft: rgba(161, 255, 98, 0.45);
  --hb-accent-dim:  rgba(161, 255, 98, 0.18);
  --hb-bg-panel:    var(--color-neutral-900);
  --hb-fg-faint:    var(--color-neutral-525);
  --hb-coral:       #f84131;

  margin-top: 2.5em;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.hb-dag-panel {
  width: 100%;
  max-width: 1320px;
  background: var(--hb-bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  overflow: hidden;
  padding: 4em 2em 7em;
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.hb-dag-header {
  display: none;
}

.hb-dag-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font: 600 11px/1 "SF Mono", ui-monospace, Menlo, monospace;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

.hb-dag-svg-wrap {
  width: 100%;
}

.hb-dag-svg {
  width: 100%;
  height: auto;
  display: block;
}

.hb-edge {
  stroke: #ffffff;
  fill: none;
}

.hb-node {
  fill: var(--color-neutral-100);
  stroke: rgba(255, 255, 255, 0.10);
  stroke-width: 1;
  filter: drop-shadow(0 3px 12px rgba(0, 0, 0, 0.45));
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

/* HTML inside foreignObject — node body */
.hb-node-card {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 7px 9px 8px 13px;
  text-align: left;
  pointer-events: none;
  box-sizing: border-box;
  border-radius: 4px;
  background: var(--color-neutral-100);
  border-left: 3px solid var(--node-accent, rgba(0, 0, 0, 0.15));
}

.hb-node-card__badges {
  position: absolute;
  top: 5px;
  right: 6px;
  display: inline-flex;
  gap: 2px;
  align-items: center;
}
.hb-node-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 7.5px;
  font-weight: 700;
  line-height: 1;
  background: color-mix(in srgb, var(--node-accent, #999) 14%, #ffffff);
  color: var(--node-accent, rgba(0, 0, 0, 0.65));
  pointer-events: auto;
}
.hb-node-card__badge--loop {
  font-size: 8px;
}
.hb-node-card__badge--parallel {
  font-size: 7.5px;
  letter-spacing: -0.5px;
}
.hb-node-card__id {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 8px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: var(--hb-bg-panel);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin-bottom: 3px;
}
.hb-node-card:has(.hb-node-card__badges) .hb-node-card__id {
  max-width: calc(100% - 28px);
}
.hb-node-card__meta {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 6.5px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: flex;
  gap: 3px;
}
.hb-node-card__meta-key {
  color: rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}
.hb-node-card__meta-val {
  color: rgba(0, 0, 0, 0.7);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hb-node-card__meta--mcp .hb-node-card__meta-val,
.hb-node-card__meta--loop .hb-node-card__meta-val,
.hb-node-card__meta--parallel .hb-node-card__meta-val {
  color: var(--node-accent, rgba(0, 0, 0, 0.7));
}
.hb-node-card__desc {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 7.5px;
  font-weight: 450;
  line-height: 1.3;
  color: var(--color-neutral-600);
  letter-spacing: 0;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--color-neutral-300);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .hb-dag-panel { padding: 1.1em 1em 1.2em; }
  .hb-node-card { padding: 6px 8px 6px 11px; }
  .hb-node-card__id   { font-size: 8px; margin-bottom: 3px; }
  .hb-node-card__meta { font-size: 6.5px; }
  .hb-node-card__desc { font-size: 7.5px; margin-top: 4px; padding-top: 4px; }
}

/* —— Pixelated scroll transition —— */
.pixelated-scroll-transition {
  z-index: 10;
  pointer-events: none;
  color: var(--color-neutral-200);
  position: absolute;
  inset: auto 0% 0%;
}

[data-pixelated-scroll-transition][data-mode="reveal"] {
  inset: 0% 0% auto;
}

[data-pixelated-scroll-panel] {
  display: flex;
  flex-direction: row;
  width: 100%;
}

[data-pixelated-scroll-column] {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  flex: 1 1 0%;
  min-width: 0;
}

[data-pixelated-scroll-pixel] {
  aspect-ratio: 1;
  width: 100%;
  background-color: currentColor;
  backface-visibility: hidden;
  will-change: opacity;
}
