:root { --motion-settle: cubic-bezier(.2,.8,.2,1); }

.brand-boot {
  --boot-glow: #341712;
  --boot-ground: #111010;
  position: fixed;
  inset: 0;
  z-index: 150;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: #f6f5f2;
}

[data-theme=light] .brand-boot {
  --boot-glow: #ffe6df;
  --boot-ground: var(--color-bg-page);
  color: var(--color-text-primary);
}

.brand-boot::before, .brand-boot::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: radial-gradient(ellipse at 52% 46%, var(--boot-glow), var(--boot-ground) 63%);
}

.brand-boot::before { clip-path: polygon(0 0,100% 0,100% 45%,0 55%); }
.brand-boot::after { clip-path: polygon(0 calc(55% - 1px),100% calc(45% - 1px),100% 100%,0 100%); }

.brand-boot-lockup {
  --mark-size: clamp(52px, 7.6vw, 88px);
  display: inline-flex;
  align-items: center;
  gap: calc(var(--mark-size) * .13);
  position: relative;
}

.brand-boot-mark { display: grid; width: var(--mark-size); aspect-ratio: 1; }
.brand-boot-mark img { grid-area: 1/1; width: 100%; height: 100%; }
.brand-boot-mark img:first-child { clip-path: polygon(0 0,100% 0,100% 31%,0 74%); }
.brand-boot-mark img:last-child { clip-path: polygon(0 calc(74% - 1px),100% calc(31% - 1px),100% 100%,0 100%); }
.brand-boot-word { display: block; overflow: hidden; padding-right: .05em; font: 685 clamp(54px, 8vw, 94px)/1.04 var(--display); letter-spacing: -.032em; }
.brand-boot-word b { display: block; font: inherit; letter-spacing: inherit; }

@keyframes boot-mark-head {
  from { opacity: 0; transform: translate(18%,-19%); }
  to { opacity: 1; transform: none; }
}
@keyframes boot-mark-tail {
  from { opacity: 0; transform: translate(-18%,19%); }
  to { opacity: 1; transform: none; }
}
@keyframes boot-logotype {
  from { transform: translateY(103%); }
  to { transform: none; }
}
@keyframes boot-depart {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes boot-open-top { to { transform: translateY(-17%); } }
@keyframes boot-open-bottom { to { transform: translateY(17%); } }
@keyframes boot-lockup-out {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-5px); }
}

@keyframes brand-enter {
  from { opacity: .52; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .desk-cover h1, .guide-index h1, .workspace-poster h1 {
    animation: workspace-heading-in 270ms var(--motion-settle) backwards;
  }
  .desk-order > h2, .workspace-poster .poster-caption {
    animation: workspace-heading-in 240ms var(--motion-settle) 35ms backwards;
  }
  :is(#wallet-dialog, #asset-dialog)[open]::backdrop {
    animation: sheet-scrim-in 180ms ease-out backwards;
  }
  .guide-questions details[open] > p {
    animation: answer-in 175ms var(--motion-settle) backwards;
  }
  @keyframes workspace-heading-in { from { opacity: .72; transform: translateY(7px); } }
  @keyframes sheet-scrim-in { from { opacity: 0; } }
  @keyframes answer-in { from { opacity: .68; transform: translateY(-3px); } }
  .route-print::before {
    transform-origin: right center;
    transition: transform 900ms cubic-bezier(.2,.8,.2,1);
    animation: print-arrival 1150ms cubic-bezier(.2,.76,.17,1) both;
  }
  .signal-hero:has(#asset-from use[href="#network-ton"]) .route-print::before {
    transform: scale(1.045);
  }
  .hero-guide svg { transition: transform 220ms ease; }
  .hero-guide:is(:hover,:focus-visible) svg { transform: translateY(3px); }
  .brand-boot-mark img:first-child { animation: boot-mark-head 470ms cubic-bezier(.16,.83,.2,1) backwards; }
  .brand-boot-mark img:last-child { animation: boot-mark-tail 470ms cubic-bezier(.16,.83,.2,1) backwards; }
  .brand-boot-word b { animation: boot-logotype 450ms 105ms cubic-bezier(.14,.82,.2,1) backwards; }
  .brand-boot.is-releasing { animation: boot-depart 270ms ease-in both; }
  .brand-boot.is-releasing::before { animation: boot-open-top 270ms cubic-bezier(.38,0,.72,1) both; }
  .brand-boot.is-releasing::after { animation: boot-open-bottom 270ms cubic-bezier(.38,0,.72,1) both; }
  .brand-boot.is-releasing .brand-boot-lockup { animation: boot-lockup-out 160ms ease-out both; }
  .brand-entered {
    animation: brand-enter 520ms cubic-bezier(.18, .75, .22, 1) backwards;
  }

  [data-brand-enter].brand-entered:nth-child(2) { animation-delay: 45ms; }
  [data-brand-enter].brand-entered:nth-child(3) { animation-delay: 85ms; }
  [data-brand-enter].brand-entered:nth-child(n+4) { animation-delay: 115ms; }

  [data-brand-arrow] {
    display: inline-block;
    transition: translate 230ms cubic-bezier(.19, 1, .22, 1);
  }

  [data-brand-cta]:focus-visible [data-brand-arrow] { translate: 3px -2px; }
}

@keyframes print-arrival {
  from { opacity: .45; translate: 5% -55%; }
  to { opacity: 1; translate: 0 -50%; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  [data-brand-cta]:hover [data-brand-arrow] { translate: 3px -2px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-boot { display: none; }
}
