/* —— Build intro: Hello World → timelapse site construction —— */
html.fp-build-pending,
html.fp-build-pending body {
  overflow: hidden;
  height: var(--fp-vv-height, 100dvh);
}

html.fp-build-pending body {
  position: fixed;
  inset: 0;
  width: 100%;
  overscroll-behavior: none;
}

.fp-build-overlay {
  position: fixed;
  top: var(--fp-vv-offset-top, 0px);
  left: 0;
  right: 0;
  height: var(--fp-vv-height, 100dvh);
  bottom: auto;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #050608;
  transition: background 0.6s ease, opacity 0.55s ease, visibility 0.55s;
  pointer-events: auto;
}

.fp-build-overlay.is-hud {
  background: transparent;
  pointer-events: none;
}

.fp-build-overlay.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.fp-hello {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: clamp(1.1rem, 4vw, 1.65rem);
  color: #e8d9b8;
  letter-spacing: 0.04em;
  text-align: center;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.fp-hello.is-out {
  opacity: 0;
  transform: scale(0.96);
}

.fp-hello-code {
  color: #b8926a;
}

.fp-hello-cursor {
  display: inline-block;
  width: 0.55em;
  animation: fp-cursor-blink 0.85s step-end infinite;
  color: #fff9ee;
}

@keyframes fp-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Bottom HUD — always on top during build */
#fp-build-hud.fp-build-hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--fp-vv-offset-bottom, 0px);
  z-index: 10100;
  padding: 0.65rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(5, 6, 8, 0) 0%, rgba(5, 6, 8, 0.88) 28%, rgba(5, 6, 8, 0.96) 100%);
  border-top: 1px solid rgba(184, 146, 106, 0.42);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.35s;
  pointer-events: none;
}

#fp-build-hud.fp-build-hud.is-live {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#fp-build-hud.fp-build-hud.is-done {
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
}

.fp-build-kicker {
  margin: 0 0 0.35rem;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(184, 146, 106, 0.95);
}

.fp-build-status {
  margin: 0 0 0.55rem;
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: clamp(0.625rem, 2.8vw, 0.75rem);
  letter-spacing: 0.04em;
  color: rgba(232, 217, 184, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.15em;
}

.fp-build-status::after {
  content: "▋";
  display: inline-block;
  margin-left: 1px;
  color: rgba(184, 146, 106, 0.75);
  animation: fp-cursor-blink 0.85s step-end infinite;
}

.fp-build-track {
  height: 4px;
  background: rgba(184, 146, 106, 0.22);
  border-radius: 2px;
  overflow: hidden;
}

.fp-build-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6e542c, #e8d9b8, #b8926a);
  transition: width 0.12s linear;
  box-shadow: 0 0 12px rgba(232, 217, 184, 0.35);
}

.fp-build-skip {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  z-index: 10101;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 217, 184, 0.55);
  background: rgba(12, 14, 18, 0.65);
  border: 1px solid rgba(184, 146, 106, 0.28);
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: color 0.2s, border-color 0.2s;
  pointer-events: auto;
}

.fp-build-skip:hover {
  color: #fff9ee;
  border-color: rgba(232, 217, 184, 0.45);
}

.fp-build-overlay.is-done .fp-build-skip {
  display: none;
}

/* Timelapse construction — reveal from ground up */
.fp-build-piece {
  position: relative;
}

html.fp-build-pending .fp-build-piece,
.fp-build-active .fp-build-piece {
  opacity: 0;
  clip-path: inset(100% 0 0 0);
  transform: translateY(6px);
  pointer-events: none;
  will-change: clip-path, opacity, transform;
}

.fp-build-active .fp-build-piece.is-timelapse-rise.is-rise-heavy {
  animation: fp-timelapse-rise-heavy 0.72s cubic-bezier(0.22, 0.85, 0.32, 1) forwards;
}

.fp-build-active .fp-build-piece.is-timelapse-rise.is-rise-slab {
  animation: fp-timelapse-rise-slab 0.52s cubic-bezier(0.22, 0.9, 0.36, 1) forwards;
}

.fp-build-active .fp-build-piece.is-timelapse-rise.is-rise-light {
  animation: fp-timelapse-rise-light 0.42s cubic-bezier(0.22, 0.92, 0.38, 1) forwards;
}

@keyframes fp-timelapse-rise-heavy {
  0% {
    opacity: 0.15;
    clip-path: inset(100% 0 0 0);
    transform: translateY(10px);
    filter: brightness(0.85);
  }
  35% {
    opacity: 0.75;
    filter: brightness(1.05);
  }
  72% {
    clip-path: inset(0 0 0 0);
    transform: translateY(2px);
  }
  88% {
    transform: translateY(-1px);
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
    filter: brightness(1);
    pointer-events: auto;
  }
}

@keyframes fp-timelapse-rise-slab {
  0% {
    opacity: 0.2;
    clip-path: inset(100% 0 0 0);
    transform: translateY(8px);
  }
  45% {
    opacity: 0.85;
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
    pointer-events: auto;
  }
}

@keyframes fp-timelapse-rise-light {
  0% {
    opacity: 0.25;
    clip-path: inset(100% 0 0 0);
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* Construction shimmer at base while rising */
.fp-build-active .fp-build-piece.is-timelapse-rise::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(232, 217, 184, 0.55), transparent);
  opacity: 0;
  animation: fp-timelapse-shimmer 0.72s ease forwards;
  pointer-events: none;
}

@keyframes fp-timelapse-shimmer {
  0%, 55% { opacity: 0; transform: scaleX(0.2); }
  70% { opacity: 0.9; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1.05); }
}

/* Creation — let there be light */
.fp-creation-light {
  animation: fp-creation-light 0.65s ease;
}

@keyframes fp-creation-light {
  0% { background: #050608; }
  35% { background: #1a1510; filter: brightness(1.45); }
  100% { background: #0c0e12; filter: brightness(1); }
}

body.fp-gold-light-flash {
  animation: fp-gold-light-flash 0.32s ease;
}

@keyframes fp-gold-light-flash {
  0%, 100% { filter: brightness(1); }
  40% { filter: brightness(1.75); }
}

.fp-build-active.fp-canvas-live {
  background: #0c0e12;
}

.fp-build-active.fp-atmosphere-live #fp-gold-rain,
.fp-gold-rain.is-live {
  opacity: 1;
}

.fp-build-active .premier-hero {
  min-height: min(92vh, 860px);
}

.fp-build-flash {
  animation: fp-build-pop 0.28s ease;
}

@keyframes fp-build-pop {
  0% { filter: brightness(1.35); }
  100% { filter: brightness(1); }
}

/* Crew layer — scaffolds + tiny stick builders */
#fp-build-crew-layer.fp-build-crew-layer {
  position: fixed;
  top: var(--fp-vv-offset-top, 0px);
  left: 0;
  right: 0;
  height: var(--fp-vv-height, 100dvh);
  bottom: auto;
  z-index: 9200;
  pointer-events: none;
  overflow: hidden;
}

.fp-build-scaffold {
  position: fixed;
  box-sizing: border-box;
  border: 1.5px dashed rgba(232, 217, 184, 0.62);
  box-shadow: inset 0 0 0 1px rgba(184, 146, 106, 0.2), 0 0 18px rgba(184, 146, 106, 0.12);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(184, 146, 106, 0.06) 0,
      rgba(184, 146, 106, 0.06) 14px,
      transparent 14px,
      transparent 22px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(184, 146, 106, 0.05) 0,
      rgba(184, 146, 106, 0.05) 18px,
      transparent 18px,
      transparent 28px
    );
  opacity: 0;
  transform: scale(0.98);
  animation: fp-scaffold-in 0.28s ease forwards;
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.fp-build-scaffold.is-dismantling {
  opacity: 0;
  transform: scale(1.02) translateY(-4px);
}

@keyframes fp-scaffold-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.fp-scaffold-pole {
  position: absolute;
  width: 3px;
  background: linear-gradient(180deg, rgba(232, 217, 184, 0.9), rgba(184, 146, 106, 0.55));
  box-shadow: 0 0 8px rgba(232, 217, 184, 0.25);
}

.fp-scaffold-pole--tl,
.fp-scaffold-pole--tr {
  top: 0;
  height: 100%;
}

.fp-scaffold-pole--bl,
.fp-scaffold-pole--br {
  bottom: 0;
  height: 42%;
}

.fp-scaffold-pole--tl,
.fp-scaffold-pole--bl { left: 0; }
.fp-scaffold-pole--tr,
.fp-scaffold-pole--br { right: 0; }

.fp-scaffold-plank {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(232, 217, 184, 0.55), transparent);
  opacity: 0.85;
}

.fp-scaffold-plank--a { top: 28%; }
.fp-scaffold-plank--b { top: 52%; }
.fp-scaffold-plank--c { top: 76%; }

.fp-build-crew {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  min-height: 1.4rem;
}

.fp-stick-wrap {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  width: clamp(14px, 5vw, 22px);
  height: clamp(20px, 7vw, 32px);
  opacity: 0.95;
  filter: drop-shadow(0 0 4px rgba(232, 217, 184, 0.45));
}

.fp-stick-man {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.fp-stick-man circle,
.fp-stick-man line,
.fp-stick-man rect {
  fill: none;
  stroke: #fff3dc;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fp-stick-man .fp-stick-crate {
  fill: rgba(184, 146, 106, 0.35);
  stroke: #e8d9b8;
}

.fp-stick-wrap--hammer {
  animation: fp-stick-bob 0.55s ease-in-out infinite;
}

.fp-stick-wrap--hammer .fp-stick-arms--hammer {
  transform-origin: 7px 8.2px;
  animation: fp-stick-hammer 0.42s ease-in-out infinite;
}

.fp-stick-wrap--carry {
  animation: fp-stick-bob 0.72s ease-in-out infinite;
}

.fp-stick-wrap--carry .fp-stick-arms--carry {
  transform-origin: 7px 8.2px;
  animation: fp-stick-lift 0.85s ease-in-out infinite;
}

.fp-stick-wrap--climb {
  animation: fp-stick-climb 0.48s ease-in-out infinite;
}

.fp-stick-wrap--paint {
  animation: fp-stick-bob 0.62s ease-in-out infinite;
}

.fp-stick-wrap--paint .fp-stick-arms--paint {
  transform-origin: 7px 8.2px;
  animation: fp-stick-paint 0.58s ease-in-out infinite;
}

.fp-stick-wrap--walk .fp-stick-legs--walk .fp-stick-leg--l {
  transform-origin: 7px 13.5px;
  animation: fp-stick-step-l 0.38s ease-in-out infinite;
}

.fp-stick-wrap--walk .fp-stick-legs--walk .fp-stick-leg--r {
  transform-origin: 7px 13.5px;
  animation: fp-stick-step-r 0.38s ease-in-out infinite;
}

@keyframes fp-stick-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-2px); }
}

@keyframes fp-stick-hammer {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(-28deg); }
  55% { transform: rotate(8deg); }
}

@keyframes fp-stick-lift {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-12deg) translateY(-1px); }
}

@keyframes fp-stick-climb {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  25% { transform: translateX(calc(-50% - 1px)) translateY(-3px); }
  75% { transform: translateX(calc(-50% + 1px)) translateY(-1px); }
}

@keyframes fp-stick-paint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(16deg); }
}

@keyframes fp-stick-step-l {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(14deg); }
}

@keyframes fp-stick-step-r {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-14deg); }
}

@media (max-width: 480px) {
  #fp-build-hud.fp-build-hud {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .fp-build-kicker {
    font-size: 0.5625rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fp-build-overlay,
  #fp-build-hud.fp-build-hud,
  #fp-build-crew-layer.fp-build-crew-layer { display: none !important; }
}
