/*
 * Task 4: one canonical countdown.
 * The large value is always the launch prediction; a different featured
 * prediction is shown only as a compact reference below it.
 */

.countdown-deck {
  z-index: 13;
  /* Landing composition: preserve the internal baseline and align the whole
     countdown block to the trailer wall's lower edge. */
  top: auto !important;
  /* The visible lower rule sits 14px above the panel box; compensate so that
     rule, the trailer thumbnail and the WDK icon share one baseline. */
  bottom: calc(100% - var(--trailer-bottom, 300px) - 14px);
  left: auto;
  right: calc(clamp(28px, 3vw, 44px) + 52px + 24px);
  display: grid !important;
  width: min(
    430px,
    calc(100% - var(--axis-x) - 140px)
  );
  min-width: 300px;
  pointer-events: none;
  will-change: transform, opacity;
  transition:
    top 300ms ease-out,
    bottom 300ms ease-out,
    left 300ms ease-out,
    right 300ms ease-out,
    transform 420ms cubic-bezier(.22, .72, .24, 1) 160ms,
    opacity 220ms ease-out 160ms;
}

.countdown-deck .featured-panel {
  --launch-meta-size: clamp(10px, 2.8cqi, 13px);
  width: 100%;
  pointer-events: none;
  animation: vfprepSignatureFloat 9s ease-in-out infinite;
}

.countdown-deck .count-kicker {
  margin-bottom: 7px;
}

@media (min-width: 761px) {
  .countdown-deck .count-kicker {
    width: 71%;
    margin-left: auto;
  }

  .countdown-deck .featured-panel .launch-countdown-button {
    margin-left: auto;
  }
}

.launch-count-target {
  position: relative;
  z-index: 4;
  top: auto;
  left: auto;
  right: auto;
  display: inline-flex;
  align-items: baseline;
  width: max-content;
  margin: 0;
  color: color-mix(in srgb, var(--prediction) 76%, var(--muted));
  font: 600 var(--launch-meta-size)/1 var(--mono);
  letter-spacing: .14em;
  text-align: left;
}

.launch-count-meta {
  display: flex;
  flex: 0 0 auto;
  align-self: flex-end;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 7px;
  width: max-content;
  margin-right: 7px;
}

.launch-date-question {
  display: block;
  margin-left: .08em;
  color: inherit;
  font-family: var(--numeral);
  font-size: 2.15em;
  font-style: normal;
  font-weight: 320;
  line-height: 1;
  letter-spacing: 0;
  vertical-align: baseline;
}

.countdown-deck .featured-panel .launch-countdown-button {
  display: flex;
  justify-content: start;
  align-items: flex-end;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--prediction) 34%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  gap: 9px;
  padding-bottom: 9px;
  font-size: clamp(82px, 30cqi, 132px);
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
}

.launch-count-label {
  flex: 0 0 auto;
  margin: 0;
  color: color-mix(in srgb, var(--prediction) 82%, var(--text));
  font: 700 var(--launch-meta-size)/1 var(--mono);
  letter-spacing: .18em;
}

.countdown-deck .featured-panel .launch-countdown-button b {
  display: block;
  line-height: .72;
  translate: none;
  color: color-mix(in srgb, var(--prediction) 90%, transparent);
  -webkit-text-fill-color: color-mix(in srgb, var(--prediction) 90%, transparent);
  -webkit-text-stroke: .5px color-mix(in srgb, var(--prediction) 72%, var(--text));
  text-shadow: 0 0 24px color-mix(in srgb, var(--prediction) 12%, transparent);
}

.countdown-deck .featured-panel .launch-countdown-button small {
  display: flex;
  align-items: flex-end;
  align-self: flex-end;
  gap: 2px;
  margin-bottom: 0;
  line-height: 1;
  color: var(--prediction);
}

.count-question {
  display: inline-block;
  margin: 0 0 -.08em 1px;
  color: var(--prediction);
  font-size: 4em;
  font-style: normal;
  font-weight: 300;
  line-height: .72;
  text-shadow: 0 0 18px color-mix(in srgb, var(--prediction) 14%, transparent);
}

.countdown-deck .featured-panel .launch-countdown-button:hover b,
.countdown-deck .featured-panel .launch-countdown-button:focus-visible b {
  color: var(--prediction);
  -webkit-text-fill-color: var(--prediction);
  text-shadow: 0 0 28px color-mix(in srgb, var(--prediction) 20%, transparent);
}

.featured-reference {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 5px 12px;
  max-width: 420px;
  padding-top: 9px;
  color: color-mix(in srgb, var(--prediction) 72%, var(--muted));
  font-family: var(--mono);
}

.featured-reference[hidden] {
  display: none !important;
}

.featured-reference > span {
  grid-row: 1 / span 2;
  padding-right: 10px;
  border-right: 1px solid color-mix(in srgb, var(--prediction) 28%, transparent);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.featured-reference strong {
  overflow: hidden;
  color: color-mix(in srgb, var(--text) 78%, var(--prediction));
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured-reference small {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 8px;
  line-height: 1;
  letter-spacing: .12em;
}

.featured-reference small i {
  opacity: .45;
  font-style: normal;
}

.featured-reference small b {
  color: var(--prediction);
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .countdown-deck {
    top: 198px !important;
    bottom: auto;
    left: calc(var(--axis-x) + 30px);
    right: 14px;
    width: auto;
    min-width: 0;
  }

  .countdown-deck .featured-panel {
    --launch-meta-size: 8px;
    padding: 4px 0 8px;
  }

  .countdown-deck .count-kicker {
    margin-bottom: 4px;
  }

  .countdown-deck .count-kicker .prediction-badge {
    font-size: 8px;
  }

  .launch-count-target {
    margin: 0;
  }

  .launch-count-meta {
    gap: 5px;
    margin-right: 3px;
  }

  .countdown-deck .featured-panel .launch-countdown-button {
    gap: 6px;
    padding-bottom: 5px;
    font-size: clamp(54px, 20vw, 72px);
  }

  .launch-count-label {
    margin-right: 2px;
    font-size: 8px;
    letter-spacing: .12em;
  }

  .count-question {
    font-size: 3em;
  }

  .featured-reference {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 7px;
    padding-top: 5px;
  }

  .featured-reference > span {
    padding-right: 6px;
    font-size: 6px;
  }

  .featured-reference strong {
    font-size: 8px;
  }

  .featured-reference small,
  .featured-reference small b {
    font-size: 7px;
  }

}

@media (max-width: 380px) {
  .countdown-deck {
    left: calc(var(--axis-x) + 22px);
    right: 10px;
  }
}

/* Trailer focus: the canonical counter exits to the right. A separate edge
   tab follows from the same direction, so the change reads as one object. */
.crossroad-hero:has(> .trailer-archive:not(.is-collapsed)) .countdown-deck {
  transform: translateX(calc(100vw + 120px));
  opacity: 0;
  pointer-events: none;
  transition-delay: 0ms;
}

.crossroad-hero:has(> .trailer-archive:not(.is-collapsed)) .countdown-deck .launch-countdown-button {
  pointer-events: none;
}

.launch-edge-banner {
  position: absolute;
  z-index: 18;
  top: calc(var(--trailer-screen-bottom, 210px) + 18px);
  right: clamp(28px, 3vw, 44px);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  width: 52px;
  height: 52px;
  min-height: 52px;
  border: 0;
  background: transparent;
  padding: 9px 3px 7px;
  color: color-mix(in srgb, var(--text) 94%, var(--actual));
  font-family: var(--mono);
  box-shadow: none;
  backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(calc(100% + 6px));
  pointer-events: none;
  cursor: pointer;
  transition:
    transform 240ms ease-in,
    opacity 140ms ease-in,
    visibility 0s linear 240ms;
}

.launch-edge-banner::before {
  display: none;
}

.launch-edge-banner > span,
.launch-edge-banner > small,
.launch-edge-banner > em {
  transform: translateY(2px);
}

.launch-edge-banner .launch-edge-label {
  display: none;
}

.launch-edge-banner small {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 3px;
  display: block;
  margin: 0;
  color: color-mix(in srgb, var(--text) 88%, var(--actual));
  font: 800 5px/1 var(--mono);
  letter-spacing: .18em;
  transform: translateX(-58%);
}

.launch-edge-banner b {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-size: 32px;
  font-weight: 900;
  line-height: .72;
  letter-spacing: -.065em;
  color: color-mix(in srgb, var(--text) 94%, var(--actual));
  -webkit-text-stroke: 0;
  text-shadow: 0 0 15px rgba(130, 205, 252, .08);
}

.launch-edge-banner em {
  position: absolute;
  left: calc(50% + 13px);
  right: auto;
  top: auto;
  bottom: 3px;
  transform: none;
  font-family: var(--mono);
  font-size: 5px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .18em;
}

.launch-edge-banner:hover,
.launch-edge-banner:focus-visible {
  background: transparent;
  filter: brightness(1.12) drop-shadow(0 0 8px rgba(130, 205, 252, .16));
  outline: none;
}

.crossroad-hero:has(> .trailer-archive:not(.is-collapsed)) .launch-edge-banner {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
  transition:
    transform 280ms cubic-bezier(.22, .72, .24, 1) 240ms,
    opacity 160ms ease-out 240ms,
    visibility 0s linear 240ms;
}

@media (max-width: 760px) {
  .launch-edge-banner {
    top: 200px;
    right: 26px;
    width: 46px;
    height: 46px;
    min-height: 46px;
    gap: 1px;
    padding: 8px 2px 6px;
  }

  .launch-edge-banner b { font-size: 29px; }
  .launch-edge-banner em { left: calc(50% + 11px); right: auto; bottom: 2px; font-size: 4px; transform: none; }
  .launch-edge-banner small { left: 50%; right: auto; bottom: 2px; font-size: 4px; }

  .launch-edge-banner b { transform: translate(-50%, -50%); }
  .launch-edge-banner em { right: auto; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .countdown-deck .featured-panel {
    animation: none !important;
  }
  .countdown-deck,
  .featured-reference,
  .launch-countdown-button,
  .launch-edge-banner {
    transition: none !important;
  }
}
