/* ─── CINEMATIC BUILD SEQUENCE ───────────────────── */
/* Tall scroll track; inner stage pins while the build scrubs */
#bseq {
  position: relative;
  height: 480vh;
  background: #0B0B0A;
}

.bs-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bs-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#bs-svg {
  width: min(94vw, 1400px);
  height: min(76vh, 700px);
  margin-top: 6vh;
}

/* Canvas frame player: hidden until a frame sequence is enabled in buildseq.js */
#bs-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
}
#bseq.bs-frames #bs-canvas { display: block; }
#bseq.bs-frames #bs-svg { display: none; }

/* Soft vignette so UI text always reads */
.bs-vig {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(11, 11, 10, 0.9), transparent 22%),
    linear-gradient(to top, rgba(11, 11, 10, 0.92), transparent 30%);
}

/* Persistent section header */
.bs-head {
  position: absolute;
  top: calc(155px + 26px);
  left: 56px;
  z-index: 2;
  pointer-events: none;
}
.bs-head h2 {
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 900;
  color: #F5F5F5;
  letter-spacing: -1.2px;
  line-height: 1.02;
}
.bs-head h2 span { color: var(--beige); }

/* Stage captions (crossfade) */
.bs-caps {
  position: absolute;
  left: 56px;
  bottom: 60px;
  z-index: 2;
  width: 560px;
  max-width: calc(100vw - 112px);
  min-height: 130px;
  pointer-events: none;
}
.bs-c {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.bs-c.on {
  opacity: 1;
  transform: translateY(0);
}
.bs-c .bs-cn {
  font-size: 10px;
  font-weight: 800;
  color: var(--beige);
  letter-spacing: 3px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 10px;
}
.bs-c h3 {
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 900;
  color: #F5F5F5;
  letter-spacing: -0.6px;
  line-height: 1.05;
  margin-bottom: 10px;
}
.bs-c p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.7;
  font-weight: 400;
}

/* Progress rail */
.bs-rail {
  position: absolute;
  right: 56px;
  top: 50%;
  transform: translateY(-50%);
  height: 220px;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 2;
}
.bs-rail-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--beige);
  transform-origin: top;
  transform: scaleY(0);
}
.bs-tick {
  position: absolute;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0B0B0A;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transform: translate(-50%, -50%);
  transition: background 0.3s, border-color 0.3s;
}
.bs-tick.on {
  background: var(--beige);
  border-color: var(--beige);
}

/* Scroll hint */
.bs-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: opacity 0.4s;
  pointer-events: none;
}
.bs-hint span {
  font-size: 14px;
  animation: bsbob 1.6s ease-in-out infinite;
}
.bs-hint.h { opacity: 0; }
@keyframes bsbob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Direction status: flashes ASSEMBLING on the way down, DISMANTLING on the way back up */
.bs-mode {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 8px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.bs-mode.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.bs-mode-tag {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--beige);
  animation: bsflash 1.1s ease-in-out infinite;
}
.bs-mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--beige);
}
.bs-mode-sub {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}
@keyframes bsflash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ─── WHY MODULAR BAND ───────────────────────────── */
.wmband {
  background: var(--dark);
  padding: 110px 56px;
  border-top: 1px solid rgba(229, 213, 183, 0.08);
}
.wm-inner { max-width: 1080px; margin: 0 auto; }
.wmband h2 {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 900;
  color: #F5F5F5;
  letter-spacing: -1.5px;
  line-height: 1.02;
  margin-bottom: 24px;
}
.wmband h2 span { color: var(--beige); }
.wm-lede {
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.85;
  max-width: 620px;
  margin-bottom: 56px;
}
.wm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}
.wm-stat {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 30px 26px;
}
.wm-stat .n {
  font-size: 34px;
  font-weight: 900;
  color: var(--beige);
  line-height: 1;
  display: block;
  margin-bottom: 10px;
}
.wm-stat .l {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
}

/* ─── MODULAR HOMES COMING-SOON BANNER (services) ── */
.sc-wide {
  grid-column: 1 / -1;
  background: var(--dark);
  border-left: 3px solid var(--beige);
  padding: 38px 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  cursor: pointer;
  transition: background 0.3s;
}
.sc-wide:hover { background: #1e1e1e; }
.scw-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  color: var(--beige);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  border: 1px solid rgba(229, 213, 183, 0.3);
  padding: 5px 12px;
  margin-bottom: 14px;
}
.sc-wide h3 {
  font-size: 21px;
  font-weight: 800;
  color: #F5F5F5;
  margin-bottom: 8px;
}
.sc-wide p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.7;
  max-width: 560px;
}

/* ─── SCROLL REVEAL ──────────────────────────────── */
.rv {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.rv-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1024px) {
  .bs-head { top: calc(120px + 20px); left: 36px; }
  .bs-caps { left: 36px; }
  .bs-rail { right: 30px; }
  .wmband { padding: 80px 36px; }
  .wm-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  #bseq { height: 420vh; }
  .bs-head { top: calc(90px + 16px); left: 24px; right: 24px; }
  /* keep the caption block and the status tag clearly separated on phones:
     captions sit higher, the assembling/dismantling tag hugs the bottom edge */
  .bs-caps { left: 24px; right: 24px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; }
  .bs-rail { display: none; }
  /* the scene is a wide canvas: render it larger than the screen and crop the
     empty sides so the house reads big; flex centering keeps it centred */
  #bs-svg { width: 150vw; max-width: none; height: 62vh; margin-top: 0; margin-bottom: 16vh; }
  .bs-hint { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .bs-mode { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .wmband { padding: 64px 24px; }
  .sc-wide { flex-direction: column; align-items: flex-start; padding: 30px 26px; }
}

@media (max-width: 480px) {
  #bseq { height: 380vh; }
  .bs-head { top: calc(72px + 14px); }
  .bs-head h2 { font-size: 24px; }
  #bs-svg { width: 160vw; height: 56vh; margin-bottom: 18vh; }
  .bs-c h3 { font-size: 19px; }
  .wmband { padding: 48px 16px; }
  .wm-stats { grid-template-columns: 1fr 1fr; }
  .wm-stat { padding: 22px 18px; }
  .wm-stat .n { font-size: 26px; }
}

/* Reduced motion: show the finished build, no pinning */
@media (prefers-reduced-motion: reduce) {
  #bseq { height: auto; }
  .bs-pin { position: relative; height: 100vh; }
  .bs-hint { display: none; }
}
