/* Minshan launch page additions: the panels behind the Apple iOS button and the
   footer, the stage that holds the sample, and the launch overlay. The page
   itself is the .gate block in base.css. */

/* Panels ------------------------------------------------------------------ */

.lp-dialog {
  position: fixed;
  inset: 0;
  width: min(560px, calc(100vw - 48px));
  max-width: none;
  max-height: min(720px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}

.lp-dialog::backdrop { background: rgba(6, 7, 14, .62); }

.lp-dialog__scroll {
  max-height: inherit;
  padding: 18px 24px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.lp-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.lp-dialog__title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  outline: none;
}

.lp-dialog__close {
  flex: none;
  margin-right: -10px;
  color: var(--text-2);
}

.lp-dialog__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: pretty;
}

.lp-mail { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.lp-mail--select { -webkit-user-select: all; user-select: all; }

@media (max-width: 559px) {
  .lp-dialog {
    top: auto;
    width: 100%;
    max-height: 88dvh;
    margin: auto 0 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }

  .lp-dialog__scroll {
    padding-left: max(24px, var(--safe-l));
    padding-right: max(24px, var(--safe-r));
    padding-bottom: calc(24px + var(--safe-b));
  }
}

/* Waiting list ------------------------------------------------------------ */

.lp-form {
  display: flex;
  gap: 8px;
}

.lp-form__input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text);
  font-family: var(--font-ui);
  /* 16 px keeps iOS Safari from zooming in on focus. */
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}

.lp-form__input::placeholder { color: var(--muted); opacity: 1; }

/* AutoFill paints the field pale yellow with !important in WebKit's own sheet;
   only an inset shadow and text-fill can cover it. */
.lp-form__input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px var(--surface-2) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

.lp-wait__error {
  margin-top: 8px;
  color: var(--bad);
  font-size: 14px;
  line-height: 1.35;
}

.lp-wait__done {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--text);
  font-weight: 500;
  outline: none;
}

.lp-wait__done .icon { color: var(--good); }

.lp-wait__mail {
  display: grid;
  justify-items: start;
  gap: 12px;
  outline: none;
}

.lp-wait__mail .btn { text-decoration: none; }

/* Stage: full-bleed on a phone, a phone outline on the Mac ----------------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 2;
}

.device,
.device__screen {
  position: absolute;
  inset: 0;
}

.device__screen {
  overflow: hidden;
  background: var(--bg);
}

.stage__back { display: none; }

.stage.is-framed {
  /* iPhone 17 Pro: a 402 x 874 pt screen. Short windows lose height rather
     than scale, so the app keeps its real type size and stays crisp. */
  --dev-h: min(874px, calc(100dvh - 48px));
  --dev-w: max(360px, calc(var(--dev-h) * 402 / 874));
  display: grid;
  place-items: center;
}

.stage.is-framed .device {
  position: relative;
  inset: auto;
  width: calc(var(--dev-w) + 3px);
  height: calc(var(--dev-h) + 3px);
  border: 1.5px solid var(--line-strong);
  border-radius: 48px;
}

.stage.is-framed .device__screen {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  border-radius: 46.5px;
  isolation: isolate;
}

.stage.is-framed #app {
  --safe-t: 14px;
  --safe-b: 10px;
}

.stage.is-framed .stage__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  left: 24px;
  top: 20px;
  height: 44px;
  padding: 0 10px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 16px;
  font-weight: 500;
}

@media (hover: hover) {
  .stage__back:hover { color: var(--text); }
}

/* Launch overlay ---------------------------------------------------------- */

/* Every part sits on its own layer and moves by transform and opacity only (see
   playOverlay). The layers are on the page ahead of the tap, painted and invisible:
   each part is at .001 until its animation takes over, because WebKit paints nothing
   for a layer at exactly 0. */
.launch {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.launch.is-playing {
  pointer-events: auto;
}

.launch__flood,
.launch__field,
.launch__ring,
.launch__mark,
.launch__rim,
.launch__patch {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  transform-origin: 0 0;
}

/* Their own layers, but only while they are on the page. */
.launch:not([hidden]) > *,
.launch:not([hidden]) .launch__mark > * {
  will-change: transform, opacity;
}

/* Any transform at all: without one WebKit clips the layer to the viewport, and
   gaining one when the launch starts would paint it again anyway. */
.launch__field,
.launch__ring,
.launch__mark {
  transform: translate(0, 0);
}

.launch__flood {
  width: 100%;
  height: 100%;
  background: #000000;
  opacity: 0;
}

.launch__field {
  fill: #000000;
  fill-rule: evenodd;
  opacity: .001;
}

.launch__ring {
  fill: none;
  stroke: #FFFFFF;
  opacity: .001;
}

/* ZOOM_BOX in launch.js: the logo's 200-unit box at this size, scaled down from it. */
.launch__mark {
  width: 600px;
  height: 600px;
}

.launch__rim {
  fill: #FFFFFF;
  fill-rule: evenodd;
  opacity: .001;
}

.launch__rim--zoom {
  width: 600px;
  height: 600px;
}

.launch__patch {
  fill: #000000;
  opacity: .001;
}

.launch__word {
  position: absolute;
  left: 0;
  right: 0;
  color: #FFFFFF;
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.01em;
  text-align: center;
  opacity: .001;
  transform: translateY(12px);
}
