@import url('/public-site.css');

.tree-page main {
  overflow: visible;
}

.tree-hero {
  max-width: 1180px;
  margin: auto;
  padding: clamp(5rem, 10vw, 8rem) 1.5rem 3rem;
  text-align: left;
}

.tree-hero h1 {
  max-width: 1020px;
  margin: 0 0 1.5rem;
  font-size: clamp(3.8rem, 9vw, 7.8rem);
  line-height: 0.88;
  letter-spacing: -0.078em;
}

.tree-hero > p:not(.kicker) {
  margin-bottom: 1.5rem;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.tree-tour-controls {
  display: grid;
  grid-template-columns: auto minmax(180px, 380px) auto;
  gap: 1rem;
  align-items: center;
  max-width: 720px;
  margin-bottom: 1.2rem;
}

.tree-tour-progress {
  --tour-progress: 14.28%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e8e3;
}

.tree-tour-progress span {
  display: block;
  width: var(--tour-progress);
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 360ms ease;
}

.tree-tour-controls output {
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.tree-explorer {
  display: grid;
  grid-template-columns: minmax(230px, 0.44fr) minmax(0, 1.56fr);
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem 7rem;
}

.tree-rail {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.tree-rail-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.15rem 0.75rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
}

.tree-rail-item:hover {
  transform: translateX(3px);
}

.tree-rail-item > span {
  grid-row: 1 / 3;
  align-self: center;
  color: #8b928d;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
}

.tree-rail-item strong {
  font-size: 0.82rem;
}

.tree-rail-item small {
  color: #7a827c;
  font-size: 0.66rem;
}

.tree-rail-item.is-active {
  border-color: #172019;
  background: #172019;
  color: white;
}

.tree-rail-item.is-active > span,
.tree-rail-item.is-active small {
  color: #b3c2b7;
}

.tree-stage {
  min-height: 650px;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 8%, rgba(109, 169, 132, 0.26), transparent 34%),
    linear-gradient(145deg, #111713, #1b2d21);
  color: white;
  box-shadow: 0 35px 90px rgba(17, 23, 19, 0.2);
  animation: stage-arrive 280ms ease both;
}

.stage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.stage-heading h2 {
  max-width: 720px;
  margin: 0.4rem 0 0.7rem;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.stage-heading .kicker {
  color: #a9c6b2;
}

.stage-job {
  max-width: 680px;
  color: #c3d0c6;
  font-size: 1rem;
}

.tree-status {
  flex: 0 0 auto;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #d9e7dc;
  font-size: 0.66rem;
  font-weight: 750;
}

.stage-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr) 38px minmax(0, 1fr);
  gap: 0.35rem;
  align-items: center;
  margin: 2.5rem 0;
}

.stage-step {
  display: grid;
  min-height: 190px;
  align-content: start;
  padding: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.055);
}

.stage-step > span {
  display: grid;
  width: 30px;
  height: 30px;
  margin-bottom: 2.2rem;
  place-items: center;
  border-radius: 50%;
  background: #dcecdf;
  color: #173f2e;
  font-size: 0.7rem;
  font-weight: 800;
}

.stage-step small {
  color: #9eb1a3;
  font-size: 0.67rem;
}

.stage-step strong {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.stage-connector {
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
}

.stage-connector span {
  display: block;
  width: 54%;
  height: 100%;
  background: #bfe1ca;
  animation: handoff 1.4s ease infinite;
}

.stage-details {
  margin-bottom: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.stage-details summary {
  padding: 1rem 0;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
}

.stage-details dl {
  margin: 0 0 1rem;
}

.stage-details dl div {
  display: grid;
  grid-template-columns: minmax(95px, 0.25fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-details dt {
  color: #9eb1a3;
  font-size: 0.7rem;
}

.stage-details dd {
  margin: 0;
  color: #e4ece6;
  font-size: 0.76rem;
}

.stage-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.stage-actions .primary {
  background: white;
  color: #172019;
}

.stage-execution,
.disabled-action {
  color: #adc0b2;
  font-size: 0.72rem;
}

.tree-boundary {
  max-width: 1180px;
  margin: 0 auto 6rem;
  padding: 0 1.5rem;
}

.tree-boundary h2 {
  max-width: 760px;
  margin: 0 0 1.8rem;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.tree-boundary [data-tool-summary] {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.tree-boundary [data-tool-summary] span {
  display: grid;
  min-height: 130px;
  align-content: space-between;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.tree-boundary [data-tool-summary] b {
  font-size: 2.5rem;
  letter-spacing: -0.06em;
}

.tree-boundary [data-tool-summary] small {
  color: var(--muted);
}

.tree-boundary details {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tree-boundary summary {
  cursor: pointer;
  font-weight: 750;
}

@keyframes handoff {
  from { transform: translateX(-110%); }
  to { transform: translateX(210%); }
}

@keyframes stage-arrive {
  from { opacity: 0.2; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .tree-explorer {
    grid-template-columns: 1fr;
  }

  .tree-rail {
    display: flex;
    padding-bottom: 0.35rem;
    overflow-x: auto;
  }

  .tree-rail-item {
    min-width: 210px;
    flex: 0 0 210px;
  }
}

@media (max-width: 720px) {
  .tree-hero {
    padding-top: 4rem;
  }

  .tree-hero h1 {
    font-size: clamp(3.2rem, 17vw, 5.4rem);
  }

  .tree-tour-controls {
    grid-template-columns: 1fr auto;
  }

  .tree-tour-controls .button {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .tree-stage {
    min-height: auto;
    padding: 1.2rem;
    border-radius: 20px;
  }

  .stage-heading {
    flex-direction: column-reverse;
  }

  .stage-flow {
    grid-template-columns: 1fr;
  }

  .stage-connector {
    width: 2px;
    height: 24px;
    margin-left: 1.9rem;
  }

  .stage-connector span {
    width: 100%;
    height: 54%;
    animation: handoff-mobile 1.4s ease infinite;
  }

  .stage-step {
    min-height: 145px;
  }

  .stage-step > span {
    margin-bottom: 1.4rem;
  }

  .tree-boundary [data-tool-summary] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@keyframes handoff-mobile {
  from { transform: translateY(-110%); }
  to { transform: translateY(210%); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
