/* FORGE launch — cutout anvil floats up, then lockup: [anvil] FORGE.
   FORGE emerges from the anvil's RIGHT edge (never stacked / never under logo).
   Adaptive for mobile + desktop. O fly-through uses vector mask (no scale pixelation). */

@property --hole-r {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

#launch-overlay {
  display: none;
}

html.launch-locked,
html.launch-locked body {
  overflow: hidden;
}

html.launch-on #launch-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000000;
  opacity: 1;
  --o-x: 50%;
  --o-y: 50%;
  --hole-r: 0px;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity, clip-path;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Vector hole punch — transparent disk grows from the O; UI shows through */
  -webkit-mask-image: radial-gradient(
    circle at var(--o-x) var(--o-y),
    transparent 0,
    transparent var(--hole-r),
    #000 calc(var(--hole-r) + 0.5px)
  );
  mask-image: radial-gradient(
    circle at var(--o-x) var(--o-y),
    transparent 0,
    transparent var(--hole-r),
    #000 calc(var(--hole-r) + 0.5px)
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition:
    opacity 0.4s ease,
    --hole-r 0.65s cubic-bezier(0.7, 0, 0.84, 0);
}

html.launch-on #launch-overlay.is-exiting {
  opacity: 0;
  pointer-events: none;
}

/* Stage stays native resolution — never CSS-scaled (avoids bitmap ripping) */
#launch-stage {
  position: relative;
  width: min(92vw, 560px);
  max-width: min(92vw, 560px);
  padding: clamp(12px, 3vh, 28px) clamp(8px, 2vw, 16px);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate3d(0, 0, 0);
  transform-style: flat;
  will-change: transform, opacity, clip-path;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: visible;
}

/* Centered horizontal lockup: [cutout anvil] FORGE */
.launch-lockup {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.14em;
  max-width: 100%;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity, clip-path;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.anvil-mark {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity, clip-path;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Transparent cutout — no black plate behind the SVG */
.anvil-svg {
  display: block;
  width: clamp(56px, 14vmin, 96px);
  height: auto;
  max-height: clamp(56px, 14vmin, 96px);
  fill: #ffffff;
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  will-change: transform, opacity, clip-path;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition:
    opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

html.launch-on #launch-overlay.is-anvil-in .anvil-svg {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Horizontal-only clip: FORGE starts inside anvil, opens out the RIGHT edge */
.wordmark-reveal {
  z-index: 1;
  display: grid;
  grid-template-columns: 0fr;
  align-items: center;
  overflow: hidden;
  min-height: 1.15em;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity, clip-path;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: grid-template-columns 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

html.launch-on #launch-overlay.is-reveal .wordmark-reveal {
  grid-template-columns: 1fr;
}

.wordmark-inner {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity, clip-path;
  backface-visibility: hidden;
}

.launch-wordmark {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0.08em 0 0.08em 0.05em;
  white-space: nowrap;
  width: max-content;
  color: #ffffff;
  font-family: "Syne", sans-serif !important;
  font-weight: 800 !important;
  font-size: clamp(1.65rem, 7.2vmin, 3.75rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.15;
  user-select: none;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity, clip-path;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.launch-wordmark .letter {
  display: inline-block;
  font-family: "Syne", sans-serif !important;
  font-weight: 800 !important;
  line-height: 1.15;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity, clip-path;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

html.launch-on #site-root {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  will-change: transform, opacity, clip-path;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

html.launch-on #site-root.is-entering {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

html.launch-on #navbar,
html.launch-on .launch-stagger {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  will-change: transform, opacity, clip-path;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

html.launch-on #navbar.is-entering,
html.launch-on .launch-stagger.is-entering {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

html.launch-after #site-root,
html.launch-after #navbar,
html.launch-after .launch-stagger {
  opacity: 1;
  transform: none;
}

@media (max-width: 480px) {
  #launch-stage {
    width: min(94vw, 420px);
    padding: 16px 10px;
  }

  .launch-wordmark {
    font-size: clamp(1.45rem, 8.5vw, 2.4rem);
    letter-spacing: 0.1em;
  }

  .anvil-svg {
    width: clamp(48px, 16vw, 72px);
    max-height: clamp(48px, 16vw, 72px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #launch-overlay {
    display: none !important;
  }
}
