/* panel-intro.css — the first-run arrival, played in front of the welcome.
 *
 * A WebGL scene (.px-intro-gl, intro-glass.mjs) over black: the wisps, the
 * dust, the side rays and the liquid-glass mark. When the mark has risen, the
 * welcome stands in that scene ("in space"), sign-in and setup included, until
 * it closes. panel-intro.js drives every moving number; the stacking and the
 * welcome's look in space live here.
 *
 * The black and the colours in space are literal, not theme tokens: this is
 * the same picture in either theme. */

.px-intro {
  position: fixed; inset: 0; z-index: var(--z-intro);
  overflow: hidden;
  cursor: default;
  background: #000;
}
.px-intro[hidden] { display: none; }

/* The scene: the whole picture, mark included, in one canvas. */
.px-intro-gl {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  pointer-events: none;
}

/* ---- the welcome, in space ------------------------------------------------
   For the whole intro the welcome sits OVER the scene, emptied: no sheet, no
   wash, its mark, words and buttons hidden. The words and buttons come up
   during the rise (wel-arriving comes off). Its mark is never shown in space:
   it is laid out at the glass mark's size, so the words sit under it, and the
   glass mark lands on its box and stays there as the logo. */
.welcome.wel-in-space { z-index: calc(var(--z-intro) + 1); }

.welcome.wel-in-space:not(.wel-space-leaving) .welcome-field { display: none; }
.welcome.wel-in-space:not(.wel-space-leaving) .welcome-sheet {
  background: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.welcome.wel-in-space:not(.wel-space-leaving) .welcome-sheet::before,
.welcome.wel-in-space:not(.wel-space-leaving) .welcome-sheet::after { display: none !important; }

/* The glass mark's arrived size (intro-glass.mjs: 38.5% of the panel's width),
   so landing on this box is a move up and not a shrink. */
.welcome.wel-in-space #welStepIntro .welcome-mark { width: min(38.5vw, 240px); }
.welcome.wel-mark-pending .welcome-mark { opacity: 0; }

/* Light on the dark scene, in either theme: the welcome takes the dark
   theme's tokens while it is in space, so every step (the sign-in form it
   borrows, the setup questions) reads on the black. Restated from panel.html's
   dark :root, which is what they are. */
.welcome.wel-in-space:not(.wel-space-leaving) {
  color-scheme: dark;
  --ink:  #000000;
  --bone: #EAEEF0;
  --rim:  #9EB6C4;
  --rim-rgb:  158,182,196;
  --bone-rgb: 234,238,240;
  --warm-rgb:   220,228,232;
  --ink-rgb:    0,0,0;
  --panel-rgb:  16,20,22;
  --panel-hi-rgb: 24,30,33;
  --lit-rgb:    255,255,255;
  --litrim-rgb: 200,225,235;
  --s-card:  rgba(var(--warm-rgb),.05);
  --s-inter: rgba(var(--warm-rgb),.10);
  --s-quiet: rgba(var(--warm-rgb),.04);
  --s-rim:   rgba(var(--rim-rgb),.12);
  --lit-card: inset 0 0 0 1px rgba(var(--lit-rgb),calc(.16 * var(--edge-k)));
  --lit-pill: inset 0 0 0 1px rgba(var(--lit-rgb),calc(.20 * var(--edge-k)));
  --lit-rim:  inset 0 0 0 1px rgba(var(--litrim-rgb),calc(.36 * var(--edge-k)));
  --t-primary:   var(--bone);
  --t-strong:    rgba(var(--bone-rgb),.84);
  --t-body:      rgba(var(--bone-rgb),.74);
  --t-secondary: rgba(var(--bone-rgb),.64);
  --t-meta:      rgba(var(--bone-rgb),.57);
  --t-faint:     rgba(var(--bone-rgb),.52);
  --hair:        rgba(var(--bone-rgb),calc(.10 * var(--edge-k)));
  color: var(--t-body);
}
.welcome.wel-in-space:not(.wel-space-leaving) .welcome-title { color: #EAEEF0; }
.welcome.wel-in-space:not(.wel-space-leaving) .wel-primary:not(.px-btn) { background: #EAEEF0; color: #0c0f11; }
.welcome.wel-in-space:not(.wel-space-leaving) .wel-quiet { color: rgba(234, 238, 240, .62); }
.welcome.wel-in-space:not(.wel-space-leaving) .wel-quiet:hover { color: #fff; }

/* Room for the glass logo above the sign-in and setup steps (panel-intro.js
   PX_INTRO_LOGO_W puts it in the top of this). */
.welcome.wel-in-space:not(.wel-space-leaving) .wel-step:not(#welStepIntro) { padding-top: 64px; }

/* While hidden, the words and buttons are out of the way of the pointer too:
   a click on the scene is a skip, never a press of an invisible button. */
.welcome.wel-arriving #welStepIntro > :not(.welcome-mark) {
  opacity: 0; transform: translateY(10px);
  pointer-events: none;
}
/* Only while revealing: .wel-primary is meant to have no transition, and a
   hover fade that eased in for the rest of the session would be this leaking. */
.welcome.wel-revealing #welStepIntro > :not(.welcome-mark) {
  transition: opacity var(--dur-6) ease, transform var(--dur-6) var(--ease-out);
}
.welcome.wel-revealing #welStepIntro > .welcome-title { transition-delay: .05s; }
.welcome.wel-revealing #welStepIntro > #welStart      { transition-delay: .22s; }
.welcome.wel-revealing #welStepIntro > #welSignIn     { transition-delay: .32s; }
