/* Home sections fill the viewport beneath the site's persistent header. */
.service-home {
  --home-section-height: calc(100svh - var(--home-header-height, 66px));
}

.service-home .home-two-hero,
.service-home #platforms {
  min-height: var(--home-section-height);
}

.service-home .home-two-hero,
.service-home .home-two-contact {
  display: grid;
  align-content: center;
}

.service-home .home-two-contact {
  min-height: 0;
  margin-bottom: 0;
}

.home-embeds {
  container: home-embeds / inline-size;
  display: flex;
  flex-direction: column;
  min-height: var(--home-section-height);
  padding-block: 24px;
  scroll-margin-top: var(--home-header-height, 66px);
}

.home-embeds-heading {
  display: flex;
  gap: 28px;
  align-items: end;
  justify-content: space-between;
  flex-shrink: 0;
  margin-bottom: 20px;
}

.home-embeds-heading .home-story-copy {
  max-width: 650px;
}

.home-embeds-heading .home-eyebrow {
  margin-bottom: 12px;
}

.home-embeds-heading h2 {
  font-size: 30px;
}

.home-embeds-heading .home-story-copy > p:last-child {
  margin-bottom: 0;
}

.home-embed-showcase {
  --home-embed-control-height: 48px;

  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  overflow-anchor: none;
}

.home-embed-showcase .showcase-rail {
  position: static;
  top: auto;
  left: auto;
  z-index: 10;
  display: grid;
  align-self: start;
  width: 100%;
  max-height: 100%;
  overflow: visible;
  padding: 8px 0;
  transform: none;
  border-bottom: 0;
  border-left: 1px solid #dce3ed;
  background: transparent;
}

.home-embed-showcase .showcase-rail > p {
  display: block;
  margin: 0 0 16px;
  padding-inline: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.home-embed-menu {
  display: grid;
  gap: 0;
}

.home-embed-group {
  display: grid;
  gap: 2px;
}

.home-embed-group + .home-embed-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8edf3;
}

.home-embed-showcase .showcase-rail .home-embed-subtitle {
  margin: 0 0 6px;
  padding-inline: 10px;
  color: #667085;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.home-embed-showcase .showcase-mobile-navigation {
  display: none;
}

.home-embed-showcase .showcase-rail a {
  display: grid;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  grid-template-columns: 22px minmax(0, 1fr);
}

.home-embed-showcase .showcase-rail a span {
  display: inline;
  color: #8a96a8;
  font-size: 10px;
  line-height: 18px;
}

.home-embed-showcase .showcase-rail a:hover {
  color: #344054;
  background: #f5f7fa;
}

.home-embed-showcase .showcase-rail a.active {
  color: #1d4ed8;
  background: transparent;
  font-weight: 500;
  box-shadow: none;
}

.home-embed-showcase .showcase-rail a.active:hover {
  background: transparent;
}

.home-embed-showcase .showcase-rail a.active span {
  color: #2563eb;
}

.home-embed-showcase .showcase-rail a:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.home-embed-showcase .showcase-rail a::before {
  inset: 4px auto 4px -2px;
  width: 3px;
  height: auto;
  border-radius: 0;
  background: transparent;
  content: '';
}

.home-embed-showcase .showcase-rail a.active::before {
  background: #2563eb;
}

.home-embed-showcase .showcase-content {
  display: grid;
  grid-template-rows: minmax(var(--home-embed-control-height), max-content) auto auto auto;
  align-content: start;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  overscroll-behavior: auto;
  margin-left: 0;
}

.home-embed-showcase .showcase-chapter {
  display: grid;
  grid-column: 1;
  grid-row: 1 / -1;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 700px);
  grid-template-rows: subgrid;
  gap: 0 16px;
  align-content: start;
  min-height: 0;
  padding: 8px 0;
  border: 0;
}

.home-embed-showcase .showcase-chapter[hidden] {
  display: grid;
  visibility: hidden;
  pointer-events: none;
}

.home-embed-showcase .showcase-copy {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  min-width: 0;
  width: auto;
  margin-bottom: 0;
}

.home-embed-showcase .showcase-copy h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.home-embed-showcase .showcase-intro {
  margin-top: 16px;
  font-size: 13px;
}

.home-embed-showcase .showcase-points {
  gap: 8px;
  margin-top: 18px;
  font-size: 11px;
}

.home-embed-showcase .showcase-demo {
  display: grid;
  grid-column: 2;
  grid-row: 1 / -1;
  grid-template-rows: subgrid;
  place-self: stretch end;
  align-items: start;
  min-width: 0;
  width: 100%;
  max-width: 700px;
}

/* Every panel contributes to shared rows, including inactive panels. This keeps
   the section, copy and chart positions stable without a fixed content height.
   Inactive panels are inert; the loader activates only the selected example. */
.home-embed-showcase
  .showcase-demo
  > :is(
    .showcase-select-control,
    .custom-example-control,
    .comparison-example-control,
    .external-embed-controls
  ) {
  grid-row: 1;
  align-self: start;
}

.home-embed-showcase .showcase-demo > .external-embed-controls {
  justify-content: flex-end;
}

/* Match the native one-row selectors, including controls supplied by an iframe
   after it loads. Their labels must not add a new row above the chart. */
.home-embed-showcase .external-embed-controls label {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 11px;
}

.home-embed-showcase .external-embed-controls select {
  min-width: 0;
  width: 260px;
}

.home-embed-showcase .showcase-preview,
.home-embed-showcase .home-portal-preview {
  grid-row: 2;
}

.home-embed-showcase .showcase-release-note {
  grid-row: 3;
}

.home-embed-showcase .showcase-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 700 / 480;
  box-shadow: 0 12px 32px rgb(15 23 42 / 6%);
}

.home-embed-showcase .showcase-preview iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 700px;
  height: 480px;
  transform: scale(var(--preview-scale, 1));
  transform-origin: top left;
}

.home-embed-showcase .showcase-preview:has(iframe[data-eqtstory-managed]) {
  aspect-ratio: auto;
}

.home-embed-showcase .showcase-preview iframe[data-eqtstory-managed] {
  position: relative;
  width: 100%;
  transform: none;
}

.home-embed-showcase .comparison-example-slider.home-release-type-slider {
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  width: min(100%, 270px);
}

.home-embed-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 22px;
}

.home-action-button {
  width: 190px;
  max-width: 100%;
}

.home-action-arrow {
  flex: 0 0 auto;
  vertical-align: middle;
}

.home-portal-preview {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--home-hero-frame-border);
  border-radius: 6px;
  background: var(--home-hero-frame);
}

.home-portal-preview a,
.home-portal-preview img {
  display: block;
  width: 100%;
}

.home-portal-preview img {
  height: auto;
}

.home-embed-showcase .showcase-select-control select,
.home-embed-showcase #equity-dataset-select {
  min-width: 0;
  max-width: 100%;
}

.home-embed-showcase .custom-example-control,
.home-embed-showcase .comparison-example-control {
  flex-wrap: wrap;
}

/* Keep the copy beside the chart on desktop. The preview may scale slightly
   before stacking on tablets; outer page margins do not select the layout. */
@container home-embeds (max-width: 1030px) {
  .home-embed-showcase .showcase-content {
    grid-template-rows: auto minmax(var(--home-embed-control-height), max-content) auto auto auto;
  }

  .home-embed-showcase .showcase-chapter {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-embed-showcase .showcase-copy {
    grid-row: 1;
    margin-bottom: 20px;
  }

  .home-embed-showcase .showcase-demo {
    grid-column: 1;
    grid-row: 2 / -1;
  }
}

@media (max-width: 1000px) {
  .home-embeds-heading {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }

  .home-embed-showcase {
    gap: 24px;
  }
}

@media (max-width: 700px) {
  .home-embeds {
    padding-block: 16px;
  }

  .home-embed-showcase {
    --home-embed-control-height: 76px;

    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 16px;
  }

  .home-embed-showcase
    .showcase-demo
    > :is(.showcase-select-control, .custom-example-control, .comparison-example-control) {
    flex-wrap: wrap;
  }

  .home-embed-showcase
    .showcase-demo
    > :is(.showcase-select-control, .custom-example-control, .comparison-example-control)
    > span {
    flex-basis: 100%;
    text-align: right;
  }

  .home-embed-showcase .custom-example-slider {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(100%, 308px);
  }

  .home-embed-showcase .comparison-example-slider {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 270px);
  }

  .home-embed-showcase .showcase-rail {
    padding: 10px 0;
    border-left: 0;
    border-bottom: 1px solid var(--home-line);
    background: #fff;
  }

  .home-embed-showcase .showcase-rail p,
  .home-embed-menu {
    display: none;
  }

  .home-embed-showcase .showcase-mobile-navigation {
    display: flex;
  }
}
