/* ==========================================================================
   PHASE 2 — Cinematic Arrival (Beat 1)
   ========================================================================== */
.ceremony-window.arrival-cinema {
  padding: 0;
  max-width: none;
  max-height: none;
}
.arrival-cinema {
  position: relative;
  width: min(980px, 100%);
  height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: #120D0A;
  border: 2px solid #5C3826;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.9);
  animation: arrivalIn 0.5s ease;
}
@media (max-width: 767px) {
  .arrival-cinema {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
}

.arrival-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 46%;
  overflow: hidden;
  background: #1B2427;
  touch-action: none;
  cursor: grab;
}
.arrival-stage .scene-illustration { transform-origin: 50% 35%; }
.arrival-stage.is-revealed .scene-illustration { animation: kenBurns 18s ease-in-out infinite alternate; }
.arrival-cameo {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.arrival-stage .frost-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  transition: opacity 0.9s ease, filter 0.9s ease;
}
.arrival-stage .frost-canvas.is-melting { opacity: 0; filter: blur(6px); }
.arrival-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55);
}

.arrival-topbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 18px 16px;
  background: linear-gradient(180deg, rgba(10, 8, 6, 0.75) 0%, rgba(10, 8, 6, 0) 100%);
  pointer-events: none;
}
.arrival-night {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-amber-glow);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.arrival-close {
  pointer-events: auto;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #FAF6EE;
  font-size: 20px;
  cursor: pointer;
}

.arrival-knock {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: clamp(30px, 7vw, 48px);
  font-style: italic;
  font-weight: 700;
  color: #2B1E17;
  white-space: nowrap;
  transition: opacity 0.6s ease;
}
.arrival-knock span { opacity: 0; display: inline-block; animation: knockIn 0.35s ease forwards; }
.arrival-knock span:nth-child(2) { animation-delay: 0.32s; }
.arrival-knock span:nth-child(3) { animation-delay: 0.64s; }
.arrival-knock.is-gone { opacity: 0; }

.arrival-rub-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
  padding: 8px 16px;
  border-radius: 9999px;
  background: rgba(31, 22, 18, 0.82);
  color: #FFE7BF;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.arrival-rub-hint.is-shown { opacity: 1; animation: hintBob 2.4s ease-in-out infinite; }

.arrival-panel {
  flex: 0 0 auto;
  max-height: 54%;
  overflow-y: auto;
  background: linear-gradient(180deg, #F6EFE2 0%, #EFE4D2 100%);
  color: #2B1E17;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)) 20px;
  border-top: 3px solid #5C3826;
}
.arrival-pre { text-align: center; }
.arrival-whisper {
  font-family: var(--font-prose);
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: #4F382E;
  margin: 0 0 10px 0;
}
.arrival-pre-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.arrival-pct { font-family: var(--font-ui); font-size: 14px; color: #7A5B4C; }
.arrival-link {
  background: transparent;
  border: none;
  color: #8F2432;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 4px;
}

.arrival-revealed { animation: stageFadeIn 0.5s ease; }
.arrival-who { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.arrival-who h3 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: #8F2432;
  margin: 0;
}
.arrival-who span { font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: #7A5B4C; }
.arrival-page {
  display: none;
  font-family: var(--font-prose);
  font-size: 17px;
  line-height: 1.65;
  color: #2B1E17;
  margin: 0;
}
.arrival-page.is-current { display: block; animation: pageIn 0.45s ease; }
.arrival-quote {
  margin: 12px 0 0 0;
  padding: 8px 14px;
  border-left: 3px solid #C48A3A;
  font-family: var(--font-handwritten);
  font-size: 24px;
  line-height: 1.3;
  color: #6E4933;
  animation: pageIn 0.6s ease;
}
.arrival-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.arrival-dots { display: inline-flex; gap: 6px; }
.arrival-dots i { width: 9px; height: 9px; border-radius: 9999px; background: #D6C2AC; display: inline-block; }
.arrival-dots i.on { background: #8F2432; }
.arrival-next {
  margin-left: auto;
  background: #244A3D;
  color: #FAF6EE;
  border: none;
  border-radius: 9999px;
  padding: 12px 26px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.arrival-invite {
  margin-left: auto;
  background: linear-gradient(135deg, #E89B48 0%, #D27623 100%);
  color: #1F1612;
  border: none;
  border-radius: 9999px;
  padding: 13px 26px;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  animation: pageIn 0.5s ease;
}

@keyframes arrivalIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes kenBurns { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.12) translate(-2%, -1.5%); } }
@keyframes knockIn { 0% { opacity: 0; transform: scale(1.4); } 60% { opacity: 1; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }
@keyframes hintBob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -5px); } }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .arrival-stage.is-revealed .scene-illustration,
  .arrival-rub-hint.is-shown,
  .arrival-knock span { animation: none; opacity: 1; }
}

/* Phones: the arrival owns the whole screen (backdrop padding/blur removed) */
@media (max-width: 767px) {
  .modal-backdrop:has(> .arrival-cinema) {
    padding: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: #120D0A;
  }
  .arrival-cinema {
    position: relative;
    inset: auto;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    animation: none;
  }
}
