/* Crossroad top-screen window fit.
   JavaScript publishes one measured geometry for the countdown, media
   bundle and SCHEDULED card. CSS only consumes those shared coordinates. */

/* Keep the collapsed media launcher as one bundle at every window width.
   The preview, official link and two related-site icons share one width and
   scale together instead of switching to detached desktop signatures. */
html[data-crossroad-phase="prelaunch"] .crossroad-hero {
  --bundle-trailer-size: var(--bundle-size, 106px);
  --trailer-collapsed-w: var(--bundle-trailer-size);
  --trailer-collapsed-h: var(--bundle-trailer-size);
  --trailer-preview-w: calc(var(--bundle-trailer-size) - 8px);
  --trailer-preview-h: calc(var(--bundle-trailer-size) - 8px);
  --trailer-depth-1-w: calc(var(--bundle-trailer-size) - 8px);
  --trailer-depth-1-h: calc(var(--bundle-trailer-size) - 8px);
  --trailer-depth-2-w: calc(var(--bundle-trailer-size) - 8px);
  --trailer-depth-2-h: calc(var(--bundle-trailer-size) - 8px);
  --trailer-depth-1-x: 4px;
  --trailer-depth-1-y: 2px;
  --trailer-depth-2-x: 8px;
  --trailer-depth-2-y: 4px;
  --mobile-trailer-size: var(--bundle-trailer-size);
  --mobile-trailer-preview-size: calc(var(--bundle-trailer-size) - 8px);
}

html[data-crossroad-phase="prelaunch"] .crossroad-hero > .trailer-archive.is-collapsed,
html[data-crossroad-phase="prelaunch"] .crossroad-hero > .trailer-archive.is-collapsed .trailer-archive-inner {
  overflow: visible;
}

/* Placement is measured on every resize. Do not animate toward stale geometry. */
html[data-crossroad-phase="prelaunch"] .crossroad-hero > .trailer-archive.is-collapsed {
  transition: opacity .3s ease-out;
}

html[data-crossroad-phase="prelaunch"] .countdown-deck {
  transition: transform .42s cubic-bezier(.22, .72, .24, 1) .16s,
    opacity .22s ease-out .16s;
}

html[data-crossroad-phase="prelaunch"] .crossroad-hero > .trailer-archive.is-collapsed .bundle-site-stack {
  position: absolute;
  z-index: 18;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: var(--bundle-trailer-size);
}

html[data-crossroad-phase="prelaunch"] .bundle-site-official {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--bundle-trailer-size);
  height: clamp(34px, calc(var(--bundle-trailer-size) - 56px), 50px);
  padding: 5px 7px;
  border: 1px solid rgba(130, 205, 252, .34);
  background: rgba(4, 12, 20, .78);
  color: var(--silver);
  text-decoration: none;
}

html[data-crossroad-phase="prelaunch"] .bundle-site-official > span {
  display: grid;
  color: var(--silver);
  font: 700 8px/1 "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  letter-spacing: .04em;
}

html[data-crossroad-phase="prelaunch"] .bundle-site-official b {
  color: #f05a18;
  font: inherit;
}

html[data-crossroad-phase="prelaunch"] .bundle-site-official small {
  font: inherit;
  letter-spacing: .08em;
}

html[data-crossroad-phase="prelaunch"] .bundle-site-official::after {
  content: "↗";
  color: color-mix(in srgb, var(--actual) 78%, #fff 22%);
  font: 700 12px/1 var(--mono);
}

html[data-crossroad-phase="prelaunch"] .bundle-related-sites {
  display: grid;
  grid-template-columns: repeat(2, calc((var(--bundle-trailer-size) - 4px) / 2));
  gap: 4px;
}

html[data-crossroad-phase="prelaunch"] .bundle-related-link {
  display: block;
  width: calc((var(--bundle-trailer-size) - 4px) / 2);
  height: calc((var(--bundle-trailer-size) - 4px) / 2);
  overflow: hidden;
}

html[data-crossroad-phase="prelaunch"] .bundle-related-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.68) saturate(.68) contrast(1.04);
}

@media (min-width: 761px) {
  html[data-crossroad-phase="prelaunch"] body > .vfprep-signature,
  html[data-crossroad-phase="prelaunch"] body > .wdk-signature {
    visibility: hidden;
    pointer-events: none;
  }

  html[data-crossroad-phase="prelaunch"] .countdown-deck {
    width: var(--countdown-width, min(500px, calc(100% - var(--axis-x) - 96px)));
  }

  html[data-crossroad-phase="prelaunch"] .future-official-chip {
    min-height: 44px;
    padding: 8px 10px;
    gap: 8px;
  }

  html[data-crossroad-phase="prelaunch"] .future-official-zone {
    width: var(--scheduled-width, 390px);
    bottom: calc(100% - var(--cross-y) + var(--scheduled-axis-gap, 72px));
  }

  html[data-crossroad-phase="prelaunch"] .prediction-zone .rail {
    padding-block: clamp(112px, calc(112px + (100vh - 820px) * .2), 128px);
  }

  html[data-crossroad-phase="prelaunch"] .latest-official {
    top: var(--latest-official-top, 68%);
  }

}

@media (min-width: 761px) and (max-width: 1300px) {
  html[data-crossroad-phase="prelaunch"] .rail {
    --lod-card-width: clamp(210px, 22vw, 220px);
    gap: clamp(14px, 2.2vw, 24px);
  }
}
