/* Launch gate: curtain + countdown shown until the site goes live.
   Toggled by html.is-prelaunch (waiting) and html.is-launching (curtain opening);
   both are set by the inline script in the head and by js/launch.js. */

html.is-prelaunch,
html.is-launching {
  overflow: hidden;
}

html.is-prelaunch body > :not(.launch-gate) {
  visibility: hidden;
}

html.is-prelaunch::after,
html.is-launching::after {
  display: none;
}

.launch-gate {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: none;
  overflow: hidden;
  color: var(--cream);
  font-family: var(--font-body);
}

html.is-prelaunch .launch-gate,
html.is-launching .launch-gate,
.launch-gate.is-done {
  display: block;
}

.launch-gate.is-done {
  pointer-events: none;
}

.launch-curtain {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 251, 208, 0.045) 0 2px,
      transparent 2px 46px,
      rgba(0, 0, 0, 0.22) 46px 72px,
      transparent 72px 118px
    ),
    linear-gradient(180deg, #072a15, var(--forest) 55%, #031a0c);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
  transition: transform 1.7s cubic-bezier(0.76, 0, 0.22, 1);
  will-change: transform;
}

.launch-curtain::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(180deg, var(--walnut), var(--walnut-dark) 60%, var(--walnut));
}

.launch-curtain-left {
  left: 0;
}

.launch-curtain-left::after {
  right: 0;
}

.launch-curtain-right {
  right: 0;
}

.launch-curtain-right::after {
  left: 0;
}

.launch-gate.is-open .launch-curtain-left {
  transform: translateX(-102%);
}

.launch-gate.is-open .launch-curtain-right {
  transform: translateX(102%);
}

.launch-gate .river-divider {
  z-index: 2;
  opacity: 0.9;
  transition: opacity 0.5s ease;
}

.launch-gate.is-open .river-divider {
  opacity: 0;
}

.launch-stage {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px 16px 70px;
  text-align: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.launch-gate.is-open .launch-stage {
  opacity: 0;
  transform: scale(1.04);
}

/* The logo sits on a forest disc with a cream ring. The artwork is inset so
   the whole wordmark stays inside the circle; the image itself is left
   unrounded so no letter is clipped. */
.launch-logo-disc {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: clamp(132px, 20vw, 192px);
  height: clamp(132px, 20vw, 192px);
  padding: clamp(22px, 3.3vw, 32px);
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 0 6px rgba(255, 251, 208, 0.08), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.launch-logo {
  width: 100%;
  height: auto;
}

.launch-kicker {
  margin: 16px 0 0;
  color: var(--cream);
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.launch-title {
  margin: 0;
  color: var(--cream);
  font-family: var(--font-accent);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
}

.launch-timer {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(2px, 1vw, 10px);
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 12vw, 8.5rem);
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.55);
}

.launch-unit {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.launch-digits {
  display: inline-block;
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
  text-align: center;
  transition: color 0.3s ease;
}

.launch-label {
  color: rgba(255, 251, 208, 0.62);
  font-family: var(--font-body);
  font-size: clamp(0.66rem, 1vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.launch-colon {
  position: relative;
  top: -0.08em;
  color: var(--walnut);
}

.launch-gate.is-final .launch-digits {
  color: var(--sand);
}

.launch-when {
  margin: 14px 0 0;
  color: rgba(255, 251, 208, 0.72);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.launch-when strong {
  color: var(--cream);
  font-weight: 700;
}

.launch-confetti {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (max-width: 480px) {
  .launch-stage {
    gap: 8px;
  }

  .launch-timer {
    gap: 2px;
    font-size: clamp(2.8rem, 15vw, 3.6rem);
  }

  .launch-when {
    font-size: 0.86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .launch-curtain {
    transition: opacity 0.4s ease;
  }

  .launch-gate.is-open .launch-curtain-left,
  .launch-gate.is-open .launch-curtain-right {
    transform: none;
    opacity: 0;
  }

  .launch-gate.is-open .launch-stage {
    transform: none;
  }
}
