/* ============================================================
   Spatial portfolio · startup (boot up)
   js/space/startup.js drives every value frame by frame; this file
   holds the layout, type and the pre script black cover.
   ============================================================ */

/* Black from the very first paint until startup.js decides (it adds
   .vx-booting or .vx-booted). Only when scripts run, never when
   arriving from the alter ego (transform.js plays its own reveal),
   and it lifts by itself if the script never arrives. */
@media (scripting: enabled) {
  html:not(.tf-arrive):not(.vx-booting):not(.vx-booted) body.vx::after {
    content: ""; position: fixed; inset: 0; z-index: 2147483100; background: #000; pointer-events: none;
    animation: vxsu-cover-out 0.4s ease 2.6s forwards;
  }
}
@keyframes vxsu-cover-out { to { opacity: 0; visibility: hidden; } }

.vxsu {
  --vxsu-bg: 1;
  position: fixed; inset: 0; z-index: 2147483100;
  display: grid; place-items: center;
  background: rgb(0 0 0 / var(--vxsu-bg));
  color: #fff;
  font-family: var(--vx-font, system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  cursor: default;
  contain: layout style;
}
.vxsu__stage { position: relative; width: 100%; height: 100%; display: grid; place-items: center; pointer-events: none; }

/* mark + progress (Apple style: centred mark, a thin bar below it).
   The SDR monogram is drawn by startup.js: its box is the mark's cap
   height × 2.13 (the monogram's proportions); the canvas overflows the
   box to hold the globe of bits and reach down to the bar. */
.vxsu { --vxsu-cap: 80px; }
.vxsu__boot { grid-area: 1 / 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 44px; }
.vxsu__mark, .vxsu__bar, .vxsu__cmd, .vxsu__photo, .vxsu__cap { opacity: 0; will-change: opacity, transform; }
.vxsu__mark { position: relative; width: calc(var(--vxsu-cap) * 2.13); height: var(--vxsu-cap); }
.vxsu__cv { position: absolute; display: block; pointer-events: none; }
/* reduced motion: the same mark, still (vector) */
.vxsu__still { grid-area: 1 / 1; width: calc(var(--vxsu-cap) * 2.13); color: #fff; opacity: 0; transition: opacity 0.2s linear; }
.vxsu--reduced.is-in .vxsu__still { opacity: 1; }
.vxsu__svg { display: block; width: 100%; height: auto; overflow: visible; }
.vxsu__bar { width: 160px; height: 4px; border-radius: 2px; background: rgb(255 255 255 / 0.18); overflow: hidden; }
.vxsu__bar i { display: block; width: 100%; height: 100%; border-radius: inherit; background: #fff; transform: scaleX(0); transform-origin: 0 50%; }

/* terminal moment */
.vxsu__term {
  --vxsu-ph: min(46vh, 420px);
  grid-area: 1 / 1;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.vxsu__cmd {
  margin: 0; display: flex; align-items: center; gap: 8px;
  font-family: var(--vx-mono, ui-monospace, monospace); font-size: 13px; line-height: 16px; letter-spacing: 0;
  color: rgb(255 255 255 / 0.8);
  min-width: calc(var(--vxsu-ph) * 0.8);
}
.vxsu__prompt { color: rgb(255 255 255 / 0.5); }
.vxsu__caret { display: inline-block; width: 8px; height: 16px; margin-left: -6px; background: rgb(255 255 255 / 0.85); border-radius: 1px; }
.vxsu__photo, .vxsu__ghost { width: calc(var(--vxsu-ph) * 0.8); height: var(--vxsu-ph); flex: none; }
.vxsu__photo {
  --vxsu-r1: 28px; --vxsu-r2: 28px; --vxsu-f: 0;
  position: relative; overflow: hidden; background: #000;
  border-radius: calc(var(--vxsu-r1) + (var(--vxsu-r2) - var(--vxsu-r1)) * var(--vxsu-f));
}
.vxsu__photo.is-flying {
  position: fixed; margin: 0; z-index: 2;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.6);
}
.vxsu__canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.vxsu__cap { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.vxsu__cap b { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.01em; color: rgb(255 255 255 / 0.96); }
.vxsu__cap span { font-size: 13px; line-height: 18px; font-weight: 400; color: rgb(255 255 255 / 0.66); }

/* skip (bottom right, a quiet pill; bottom centre on phones) */
.vxsu__skip {
  position: absolute; right: 32px; bottom: 32px;
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 8px 0 16px; border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.18); background: rgb(255 255 255 / 0.06);
  color: rgb(255 255 255 / 0.82); font: 500 13px/16px var(--vx-font, system-ui, sans-serif);
  cursor: pointer; opacity: 0; transform: translateY(6px);
  transition: opacity 0.4s var(--vx-ease-out, ease-out), transform 0.4s var(--vx-ease-out, ease-out), background-color 0.2s, border-color 0.2s, color 0.2s;
}
.vxsu__skip.is-in { opacity: 1; transform: none; }
.vxsu__skip:hover { background: rgb(255 255 255 / 0.12); border-color: rgb(255 255 255 / 0.3); color: #fff; }
.vxsu__skip:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.vxsu__skip kbd {
  display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 6px; border-radius: 6px;
  background: rgb(255 255 255 / 0.1); color: rgb(255 255 255 / 0.66);
  font: 500 11px/1 var(--vx-mono, ui-monospace, monospace);
}

.vxsu__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* reduced motion: black, then a single short fade */
.vxsu--reduced { transition: opacity 0.2s linear; }
.vxsu--reduced.is-out { opacity: 0; }

/* phones */
@media (max-width: 599px) {
  .vxsu { --vxsu-cap: 60px; }
  .vxsu__boot { gap: 36px; }
  .vxsu__bar { width: 136px; }
  .vxsu__term { --vxsu-ph: min(calc(68vw * 1.25), 50vh, 380px); }
  .vxsu__skip { right: auto; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px)); transform: translate(-50%, 6px); }
  .vxsu__skip.is-in { transform: translate(-50%, 0); }
  .vxsu__skip kbd { display: none; }
  .vxsu__skip { padding: 0 16px; }
}
@media (max-height: 520px) {
  .vxsu__term { --vxsu-ph: min(58vh, 300px); gap: 8px; }
  .vxsu__cap span { display: none; }
}
@media (hover: none) { .vxsu__skip kbd { display: none; } .vxsu__skip { padding: 0 16px; } }
.vxsu__skip.is-out { opacity: 0; pointer-events: none; transition-duration: 0.2s; }
