/* ============================================================
   transmissions — onboarding view css  (#/welcome)
   The 4-beat cinematic. Owns the shell choreography while the
   welcome runs: topbar and dock slide away under
   html.tx-onboarding and return under html.tx-ob-reveal.
   Reads tokens.css + base.css.
   ============================================================ */

/* ---------------------------------------------------------- */
/* Shell choreography                                          */
/* ---------------------------------------------------------- */

html.tx-onboarding #topbar {
  opacity: 0;
  transform: translateY(-110%);
  pointer-events: none;
  transition: opacity 0.45s var(--ease-out), transform 0.6s var(--ease-glide);
}

html.tx-onboarding #dock {
  transform: translateY(220%);
  pointer-events: none;
  transition: transform 0.75s var(--ease-glide);
}

html.tx-onboarding.tx-ob-reveal #topbar {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition-delay: 0.2s;
}

html.tx-onboarding.tx-ob-reveal #dock {
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------------------------------------------------------- */
/* The overlay + beats                                         */
/* ---------------------------------------------------------- */

.ob {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--world);
  color: var(--fg);
  overflow: hidden;
}

.ob-beat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--safe-top) + var(--s-8))
    calc(var(--s-5) + var(--safe-right))
    calc(var(--safe-bottom) + var(--s-8))
    calc(var(--s-5) + var(--safe-left));
  opacity: 0;
  visibility: hidden;
  transform: translateY(22px);
  pointer-events: none;
  transition: opacity 0.45s var(--ease-out), transform 0.55s var(--ease-glide),
    visibility 0s linear 0.55s;
}

.ob-beat.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  z-index: 2;
  transition: opacity 0.5s var(--ease-out) 0.12s,
    transform 0.6s var(--ease-glide) 0.12s, visibility 0s;
}

.ob-inner {
  margin: auto;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}

.ob-center {
  align-items: center;
  text-align: center;
}

.ob-head {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.ob-h {
  font-size: clamp(1.7rem, 6.4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: var(--tracking-head);
  line-height: 1.04;
}

.ob-p {
  color: var(--fg-muted);
  font-size: var(--fs-lede);
  line-height: 1.55;
  max-width: 38ch;
}

/* neutral error, marked with the accent (red stays ON AIR only) */
.ob-err {
  font-size: var(--fs-small);
  line-height: 1.45;
  color: var(--fg-muted);
  border-left: 2px solid var(--accent-45);
  padding-left: 10px;
}

@keyframes ob-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.ob-shake {
  animation: ob-shake 0.5s var(--ease-out);
}

/* ---------------------------------------------------------- */
/* Beat 1 · dead air, the star draws in                        */
/* ---------------------------------------------------------- */

.ob-b1 {
  cursor: pointer;
}

.ob-star {
  width: clamp(84px, 24vw, 116px);
  color: var(--accent);
  filter: drop-shadow(0 0 22px rgba(196, 181, 253, 0.45));
  margin-bottom: var(--s-2);
}

.ob-star svg {
  width: 100%;
  height: auto;
}

.ob-star-fill {
  opacity: 0;
}

.ob-wordmark {
  font-size: clamp(2.4rem, 10vw, 3.6rem);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: 1;
  animation: rise 0.75s var(--ease-glide) 1.5s backwards;
}

.ob-sub {
  animation: rise 0.7s var(--ease-glide) 1.9s backwards;
}

.ob-begin {
  margin-top: var(--s-4);
  animation: rise 0.6s var(--ease-glide) 2.6s backwards;
}

/* ---------------------------------------------------------- */
/* Beat 2 · the pass gate                                      */
/* ---------------------------------------------------------- */

.ob-gate {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.ob-ticket {
  --ob-stub-w: 92px;
  position: relative;
  display: flex;
  align-items: stretch;
  border-radius: var(--r-l);
  background: var(--pane);
  border: 1px solid var(--hairline-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur-soft));
  backdrop-filter: blur(var(--glass-blur-soft));
  box-shadow: var(--glass-shadow-soft);
}

/* punched notches at the perforation */
.ob-ticket::before,
.ob-ticket::after {
  content: '';
  position: absolute;
  right: calc(var(--ob-stub-w) - 7px);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--world);
  border: 1px solid var(--hairline-strong);
  z-index: 1;
  pointer-events: none;
}

.ob-ticket::before {
  top: -8px;
}

.ob-ticket::after {
  bottom: -8px;
}

.ob-ticket-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
}

.ob-ticket-top {
  color: var(--accent-70);
}

.ob-ticket-stub {
  flex: none;
  width: var(--ob-stub-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  border-left: 1.5px dashed rgba(245, 245, 247, 0.22);
  transform-origin: bottom left;
}

.ob-stub-star {
  width: 15px;
  height: 22px;
  color: var(--accent-45);
}

.ob-stub-txt {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-label-wide);
  text-transform: uppercase;
  color: var(--fg-faint);
  writing-mode: vertical-rl;
}

.ob-ticket.is-torn .ob-ticket-stub {
  animation: ob-stub-tear 0.6s var(--ease-glide) forwards;
}

.ob-ticket.is-torn .ob-ticket-main {
  animation: ob-body-recoil 0.45s var(--ease-out);
}

@keyframes ob-stub-tear {
  0% { transform: none; opacity: 1; }
  30% { transform: translate(6px, -3px) rotate(3deg); }
  100% { transform: translate(58px, 30px) rotate(24deg); opacity: 0; }
}

@keyframes ob-body-recoil {
  0% { transform: none; }
  35% { transform: translateX(-5px) rotate(-0.6deg); }
  100% { transform: none; }
}

/* ---------------------------------------------------------- */
/* Beat 3 · the claim                                          */
/* ---------------------------------------------------------- */

.ob-claim {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.ob-avatar-row {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.ob-avatar-pick {
  position: relative;
  flex: none;
  width: 84px;
  height: 84px;
  border-radius: var(--r-pill);
  border: 1.5px dashed var(--hairline-strong);
  background: rgba(245, 245, 247, 0.04);
  display: grid;
  place-items: center;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}

.ob-avatar-pick:hover {
  border-color: var(--accent-45);
  background: var(--accent-06);
}

.ob-avatar-pick:active {
  transform: scale(0.94);
}

.ob-avatar-pick.has-img {
  border-style: solid;
  border-color: var(--accent-28);
}

.ob-avatar-star {
  width: 24px;
  height: 35px;
  color: var(--accent-28);
}

.ob-avatar-pick img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ob-avatar-plus {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 10px rgba(196, 181, 253, 0.45);
}

.ob-avatar-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}

.ob-avatar-t {
  font-size: var(--fs-body);
  font-weight: 600;
  letter-spacing: var(--tracking-title);
}

.ob-handle-wrap {
  position: relative;
}

.ob-at {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--fg-dim);
  pointer-events: none;
}

.ob-handle {
  padding-left: 34px;
}

.ob-avail {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  color: var(--fg-faint);
  min-height: 17px;
  font-variant-numeric: tabular-nums;
  transition: color var(--t-fast) var(--ease-out);
}

.ob-avail[data-state='checking'] {
  color: var(--fg-dim);
}

.ob-avail[data-state='open'] {
  color: var(--accent);
}

.ob-avail[data-state='taken'],
.ob-avail[data-state='bad'] {
  color: var(--fg-muted);
}

.ob-avail[data-state='clean'] {
  color: var(--fg-dim);
}

/* ---------------------------------------------------------- */
/* Beat 4 · the deal                                           */
/* ---------------------------------------------------------- */

.ob-b4-eyebrow {
  color: var(--accent-70);
}

.ob-card-slot {
  width: min(74vw, 300px);
  margin-inline: auto;
  perspective: 1100px;
}

.ob-b4.is-on .ob-card-slot {
  animation: ob-deal 0.95s var(--ease-glide) both;
}

@keyframes ob-deal {
  0% {
    transform: translateY(90vh) rotate(16deg) scale(0.8);
    opacity: 0;
  }
  55% {
    opacity: 1;
  }
  78% {
    transform: translateY(-14px) rotate(-2deg) scale(1.02);
  }
  100% {
    transform: none;
    opacity: 1;
  }
}

.ob-card {
  position: relative;
  aspect-ratio: 63 / 88;
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 70% at 20% 0%, rgba(196, 181, 253, 0.1), transparent 55%),
    linear-gradient(160deg, #17171f, #0b0b10 55%, #101018);
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65), 0 0 40px rgba(196, 181, 253, 0.12);
  /* holo writes only the custom props (data-holo-props); we compose */
  transform: perspective(980px) rotateX(var(--holo-rx, 0deg)) rotateY(var(--holo-ry, 0deg));
  will-change: transform;
}

.ob-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: var(--s-4) var(--s-4) 0;
}

/* wordmark stays lowercase despite .micro's uppercase */
.ob-card-brand {
  text-transform: none;
}

.ob-card-no {
  color: var(--accent-70);
}

.ob-card-watermark {
  position: absolute;
  right: -16%;
  bottom: -8%;
  width: 62%;
  height: auto;
  opacity: 0.05;
  transform: rotate(12deg);
  pointer-events: none;
}

.ob-card-id {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: var(--s-3) var(--s-4);
  min-height: 0;
}

.ob-card-avatar {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: var(--r-pill);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 30% 20%, #1b1b26, #0c0c11);
  border: 1px solid var(--accent-28);
  box-shadow: 0 0 24px rgba(196, 181, 253, 0.16);
  margin-bottom: 4px;
}

.ob-card-avatar-star {
  width: 28px;
  height: 41px;
  color: var(--accent-45);
}

.ob-card-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ob-card-name {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: var(--tracking-title);
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ob-card-handle {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  letter-spacing: 0.14em;
  color: var(--fg-dim);
}

.ob-card-id .tier {
  margin-top: 4px;
}

.ob-card-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 0 var(--s-4) var(--s-5);
}

/* the FOUNDING CAST foil chip (card foil: spectral finish allowed) */
.ob-founding {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: var(--tracking-label-wide);
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--fg);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--accent-45);
  background: linear-gradient(
    120deg,
    rgba(196, 181, 253, 0.18),
    rgba(103, 232, 249, 0.1) 50%,
    rgba(240, 171, 252, 0.16)
  );
  opacity: 0;
  transform: scale(0.55);
}

.ob-founding.is-in {
  animation: ob-founding-pop 0.6s var(--ease-glide) forwards;
}

@keyframes ob-founding-pop {
  0% {
    opacity: 0;
    transform: scale(0.55);
  }
  70% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* headline, sub, and ctas step in after the deal */
.ob-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease-out), transform 0.6s var(--ease-glide);
}

.ob-reveal.is-in {
  opacity: 1;
  transform: none;
}

.ob-b4-p {
  transition-delay: 0.06s;
}

.ob-cta {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  transition-delay: 0.12s;
}

/* short viewports: shrink the card so the deal stays composed */
@media (max-height: 700px) {
  .ob-card-slot {
    width: min(58vw, 236px);
  }

  .ob-card-avatar {
    width: 68px;
    height: 68px;
  }

  .ob-card-name {
    font-size: 18px;
  }
}

/* ---------------------------------------------------------- */
/* Desktop refinements                                         */
/* ---------------------------------------------------------- */

@media (min-width: 720px) {
  .ob-inner {
    max-width: 460px;
  }

  .ob-card-slot {
    width: 320px;
  }

  .ob-ticket {
    --ob-stub-w: 104px;
  }
}

/* ---------------------------------------------------------- */
/* Reduced motion: static composition                          */
/* ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .ob-star-fill {
    opacity: 1;
  }

  .ob-star-stroke {
    opacity: 0;
  }

  .ob-beat {
    transform: none;
  }

  .ob-reveal {
    transform: none;
  }

  .ob-b4.is-on .ob-card-slot {
    animation: none;
  }

  .ob-founding.is-in {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* The gate and claim CTAs are ALWAYS fully lit and tappable. A filled form must
   never sit under a faded button: mobile autofill, password managers, and some
   keyboards populate fields without firing an 'input' event, so a dim-until-ready
   state would read as broken. Validation happens on submit (shake + inline error).
   Force full opacity and pointer events so nothing upstream can grey these out. */
.ob-tear,
.ob-claim-btn {
  opacity: 1 !important;
  pointer-events: auto !important;
}
