/* The scene controller owns opacity and state; there is no autonomous effect here. */
#crossing {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 46%, #e6f1ff72 0%, #a9b6e745 27%, #9087c128 52%, #111b3d18 79%, transparent 100%);
  background: radial-gradient(ellipse at 50% 46%, #e6f1ff72 0%, color-mix(in srgb, var(--accent, #b6baf2) 28%, transparent) 31%, color-mix(in srgb, var(--accent, #b6baf2) 14%, transparent) 57%, #111b3d18 79%, transparent 100%);
}

.world-skip { display: none; }
body.inside-world .world-skip { display: block; }
body.inside-world .skip-link:not(.world-skip),
body.crossing .skip-link,
body.quiet .world-skip { display: none; }

body.inside-world .intro,
body.inside-world .navigation-shell,
body.inside-world #selection,
body.inside-world #portal-labels,
body.inside-world #explore,
body.crossing .intro,
body.crossing .navigation-shell,
body.crossing #selection,
body.crossing #portal-labels,
body.crossing #explore { display: none !important; }

#world-ui {
  position: fixed;
  z-index: 4;
  left: 34px;
  right: 34px;
  bottom: calc(28px + var(--safe-bottom, 0px));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  pointer-events: none;
  text-shadow: 0 2px 18px #02071cb8;
}
.world-heading { max-width: 390px; }
#world-role {
  margin: 0 0 6px;
  color: var(--accent, #c8bef2);
  font-size: 8px;
  letter-spacing: 1.7px;
}
#world-title {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 6px;
  color: #f2edfb;
  font: 400 clamp(31px, 3.3vw, 46px)/1.05 Cormorant, Georgia, serif;
  letter-spacing: -.35px;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
#world-title:focus-visible { outline-color: #bcd9ee; outline-offset: 6px; border-radius: 2px; }
#world-invitation { margin: 0; max-width: 370px; color: #c7cee2; font-size: 11px; line-height: 1.65; }
.world-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 670px;
  pointer-events: auto;
}
.world-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid #c8bee74d;
  border-radius: 4px;
  background: #111a36dc;
  color: #e1e3f3;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  backdrop-filter: blur(14px);
  box-shadow: 0 5px 24px #03071d24;
}
.world-actions button:hover { background: #30324fdc; border-color: #c5c8ed94; color: #fff; }
.world-actions button:focus-visible { outline-color: #a4e8ff; outline-offset: 3px; }
.world-actions button > span { font-size: 17px; line-height: 1; }
#world-explore { background: #d4d0e9; color: #232640; border-color: #e6def7; }
#world-explore:hover { background: #e9e5f6; color: #1d2037; }
#world-details { font-size: 10px; color: #c9c1e7; }
body.inside-world .tools { top: 110px; right: 34px; bottom: auto; }
body.crossing #world-ui,
body.quiet #world-ui { visibility: hidden; opacity: 0; pointer-events: none; }
body.crossing #world-ui *,
body.quiet #world-ui * { pointer-events: none; }

@media (max-width: 1100px) {
  #world-ui { align-items: flex-start; flex-direction: column; gap: 16px; }
  .world-actions { justify-content: flex-start; max-width: 100%; }
  #world-title { font-size: 37px; }
}
@media (max-width: 600px) {
  #world-ui { left: 18px; right: 18px; bottom: calc(18px + var(--safe-bottom, 0px)); gap: 13px; }
  .world-heading { max-width: 100%; }
  #world-role { font-size: 7px; letter-spacing: 1.35px; margin-bottom: 5px; }
  #world-title { font-size: 32px; margin-bottom: 5px; }
  #world-invitation { max-width: 100%; font-size: 10px; }
  .world-actions { width: 100%; display: grid; grid-template-columns: 1.12fr 1fr; gap: 7px; }
  .world-actions button { min-width: 0; min-height: 48px; padding: 10px 9px; font-size: 10px; gap: 6px; }
  #world-details { grid-column: 1 / -1; min-height: 44px; font-size: 10px; background: #111a36b8; }
  body.inside-world .tools { top: 82px; right: 16px; bottom: auto; flex-direction: row; gap: 6px; }
}
@media (max-height: 620px) {
  #world-ui { bottom: calc(13px + var(--safe-bottom, 0px)); gap: 9px; }
  #world-role { margin-bottom: 3px; }
  #world-title { font-size: 29px; margin-bottom: 3px; }
  #world-invitation { font-size: 10px; }
  .world-actions button { min-height: 44px; padding-block: 9px; }
  body.inside-world .tools { top: 86px; }
}
@media (max-height: 480px) and (min-width: 601px) {
  #world-ui { left: 23px; right: 23px; flex-direction: row; align-items: flex-end; gap: 18px; }
  .world-heading { max-width: 33%; }
  .world-actions { max-width: 64%; justify-content: flex-end; gap: 6px; }
  .world-actions button { font-size: 10px; padding-inline: 11px; }
  #world-title { font-size: 27px; }
  #world-invitation { display: none; }
  body.inside-world .tools { top: 78px; right: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  #crossing, #world-ui, .world-actions button { animation: none !important; transition: none !important; }
}

/* Internal camera cuts retain their dissolve; the portal itself stays open. */
#crossing {background:radial-gradient(ellipse at 50% 48%,#e2f2f9 0%,color-mix(in srgb,var(--accent,#b6baf2) 72%,#7182ac) 52%,#222c55 100%);}
body[data-journey-phase="threshold"] #crossing,
body[data-journey-phase="arriving"] #crossing,
body[data-journey-phase="returning"] #crossing {
  background: radial-gradient(ellipse at center, transparent 38%, rgb(181 216 245 / 8%) 82%, transparent);
  background: radial-gradient(ellipse at center, transparent 38%, color-mix(in srgb, var(--accent, #b5d8f5) 8%, transparent) 82%, transparent);
}
#portal-labels .portal-label:not(.join-label){width:174px;padding:9px 11px;white-space:normal;background:linear-gradient(145deg,#111a3be8,#201b3dc9);border-color:color-mix(in srgb,var(--portal-color,#b3beed) 40%,transparent);box-shadow:0 5px 25px #03071c60, inset 0 1px 0 #d9d9f522;}
#portal-labels .portal-function{display:block;margin-top:5px;font-size:8px;font-weight:400;line-height:1.5;letter-spacing:.1px;color:#c9cbe0;}
@media(max-width:600px){#portal-labels .portal-label:not(.join-label){width:44px;padding:0}#portal-labels .portal-function{display:none}}

@media(min-width:901px) and (max-height:800px){.intro h1{font-size:34px;margin-bottom:7px}.intro .eyebrow{margin-bottom:8px}.intro .lead{font-size:10px;margin-bottom:10px}}
