/* ============================================================
   "How We Build Your Website" — pinned, scroll-scrubbed sequence
   Five phases: Consultation, Discovery & Strategy, Design, Build,
   Launch & Grow. A browser frame assembles itself as the page scrolls;
   scroll up and it disassembles. Reuses the site's existing tokens
   (theme.css) — no new colors are introduced.
   ============================================================ */

.build { position: relative; height: 700vh; background: hsl(var(--background)); }

.build__sticky {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column;
  border-top: 1px solid hsl(var(--border) / 0.6);
  border-bottom: 1px solid hsl(var(--border) / 0.6);
}

.build__rail { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: hsl(var(--border)); z-index: 5; }
.build__railFill { display: block; height: 100%; width: 0%; background: hsl(var(--foreground)); }

.build__header {
  position: relative; z-index: 4;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem) 0;
}
.build__phasePill {
  font-size: .8125rem; font-weight: 500; font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border)); border-radius: 9999px;
  padding: .375rem .875rem;
  background: hsl(var(--card) / 0.6);
}

.build__inner {
  flex: 1; display: grid; grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
  max-width: 1240px; width: 100%; margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.build__copy { position: relative; min-height: 300px; }
.phasePanel {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  opacity: 0; pointer-events: none;
}
.phasePanel.is-live { pointer-events: auto; }
.phasePanel__eyebrow { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8125rem; color: hsl(var(--muted-foreground)); }
.phasePanel__title { margin-top: .625rem; font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; }
.phasePanel__body { margin-top: .875rem; color: hsl(var(--muted-foreground)); line-height: 1.65; max-width: 36ch; }
.phasePanel__link { margin-top: 1.25rem; display: inline-flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 500; color: hsl(var(--foreground)); }
.phasePanel__link:hover { color: hsl(var(--muted-foreground)); }

.build__stage { position: relative; display: grid; place-items: center; }
#buildScene { width: 100%; max-width: 560px; height: auto; overflow: visible; }

.build__cue { position: relative; z-index: 4; text-align: center; padding: 1rem 0 1.5rem; font-size: .8125rem; color: hsl(var(--muted-foreground)); }

/* ---- scene styling — all tokens, no invented colors ---- */
#buildScene .ink { stroke: hsl(var(--foreground)); }
#buildScene .inkMuted { stroke: hsl(var(--muted-foreground)); }
#buildScene .fillBlock { fill: hsl(var(--secondary)); }
#buildScene .fillMuted { fill: hsl(var(--muted-foreground)); }
#buildScene .fillFg { fill: hsl(var(--foreground)); }
#buildScene .fillBg { fill: hsl(var(--background)); }
#buildScene .cursorBlink { animation: buildCursorBlink 1.1s steps(1) infinite; }

@keyframes buildCursorBlink { 0%, 45% { opacity: 1; } 46%, 100% { opacity: 0; } }

@media (max-width: 1024px) {
  .build { height: 620vh; }
  .build__header { display: none; }
  .build__inner { grid-template-columns: 1fr; gap: 1.25rem; padding-top: .5rem; }
  .build__stage { order: -1; }
  #buildScene { max-height: 30svh; max-width: 420px; }
  .build__copy { min-height: 210px; }
}

@media (prefers-reduced-motion: reduce) {
  .build { height: auto; }
  .build__sticky { position: relative; height: auto; padding: 2.5rem 0; border: none; }
  .build__rail, .build__cue, .build__header { display: none; }
  .build__inner { grid-template-columns: 1fr; }
  .build__stage { display: none; }
  .phasePanel { position: relative; inset: auto; opacity: 1 !important; pointer-events: auto; margin-bottom: 2.5rem; }
  .phasePanel:last-child { margin-bottom: 0; }
}
