/* ============================================================
   Hero · The Blueprint
   The first screen is an architect's drawing sheet: warm paper,
   a drafting grid, registration marks, a headline annotated with
   a dimension line, and a title block carrying the facts. The
   Scale Tower (js/hero-blueprint.js) is drawn in ink hairlines on
   the right. On scroll the sheet lifts off into the dark world.

   Every element is visible in its final state by default — the
   entrance (HeroBlueprint.compose/enter) only pre-poses and plays.
   ============================================================ */

.hero-bp {
  --paper: #f3efe6;
  --paper-hi: #f8f5ee;
  --paper-lo: #e9e3d5;
  --ink: #141c1a;
  --ink-80: rgba(20, 28, 26, 0.8);
  --ink-64: rgba(20, 28, 26, 0.64);
  --ink-28: rgba(20, 28, 26, 0.28);
  --ink-14: rgba(20, 28, 26, 0.14);
  --ink-08: rgba(20, 28, 26, 0.075);
  --ink-04: rgba(20, 28, 26, 0.04);
  --rust: #7a5a24; /* text-safe on paper (≈5.5:1) */
  --rust-line: rgba(138, 106, 48, 0.6);
  --frame: 0.75rem;

  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr) auto;
  column-gap: clamp(1rem, 2vw, 2rem);
  row-gap: clamp(1rem, 2.5vh, 2rem);
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(5.4rem + 1.5vh) var(--pad-x) clamp(1.5rem, 3.5vh, 2.5rem);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 72% 38%, var(--paper-hi) 0%, var(--paper) 52%, var(--paper-lo) 100%);
}

.hero-bp ::selection {
  background: var(--ink);
  color: var(--paper);
}

/* ─── Drafting sheet ─── */
.bp-sheet {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.bp-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--ink-08) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-08) 1px, transparent 1px),
    linear-gradient(var(--ink-04) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-04) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: calc(var(--frame) - 1px) calc(var(--frame) - 1px);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 62% 44%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 80% at 62% 44%, #000 35%, transparent 100%);
}
.bp-frame {
  position: absolute;
  inset: var(--frame);
  border: 1px solid var(--ink-14);
}
.bp-reg {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px;
}
.bp-reg::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--rust-line);
  border-radius: 50%;
}
.bp-reg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--rust-line), var(--rust-line)) center / 100% 1px no-repeat,
    linear-gradient(var(--rust-line), var(--rust-line)) center / 1px 100% no-repeat;
}
.bp-reg-tl { top: 0; left: 0; }
.bp-reg-tr { top: 0; right: 0; }
.bp-reg-bl { bottom: 0; left: 0; }
.bp-reg-br { bottom: 0; right: 0; }
.bp-edge {
  position: absolute;
  left: calc(var(--frame) + 0.85rem);
  top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-64);
}

/* ─── The Scale Tower stage ─── */
/* Full-bleed: where the tower sits is purely a camera framing, so the
   loader can glide it from centre stage to its hero spot. */
.bp-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--stage-o, 1);
}
body.loading .hero-bp {
  --stage-o: 1;
}
.bp-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.bp-labels {
  position: absolute;
  inset: 0;
}
.bp-tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  opacity: 0;
  will-change: transform, opacity;
}
.bp-tag-lead {
  position: relative;
  width: 42px;
  height: 1px;
  background: var(--rust-line);
}
.bp-tag-lead::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rust);
  box-shadow: 0 0 0 4px rgba(138, 106, 48, 0.14);
}
.bp-tag-txt {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transform: translateY(0.45rem);
}
.bp-tag em {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--ink);
}
.bp-tag b {
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--rust);
}
.bp-tag small {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-64);
}


/* ─── Content layers sit above the sheet and the tower ─── */
.hero-bp > .hero-top,
.hero-bp > .hero-content,
.hero-bp > .hero-scroll {
  position: relative;
  z-index: 2;
}

/* ─── Top rule: availability + services ─── */
.hero-bp .hero-top {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--ink-14);
}
.hero-bp .hero-eyebrow,
.hero-bp .hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-64);
}
.hero-bp .hero-meta {
  letter-spacing: 0.1em;
}
.hero-bp .dot-sep {
  color: var(--rust);
  opacity: 0.8;
}

/* ─── Headline ─── */
.hero-bp .hero-content {
  grid-column: 1 / span 8;
  grid-row: 2 / span 2;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.bp-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 clamp(2.6rem, 5.2vh, 3.4rem);
  font-size: clamp(3rem, min(7.4vw, 12.5vh), 8.25rem);
  line-height: 0.9;
  color: var(--ink);
  text-shadow: none;
}
.bp-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-bottom: clamp(1rem, 2.6vh, 1.6rem);
  font-family: var(--font-sans);
  font-size: clamp(0.85rem, 0.95vw, 1rem);
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}
.bp-kicker-rule {
  width: 28px;
  height: 1px;
  margin-right: 0.2rem;
  background: var(--rust);
}
.bp-kicker-name {
  font-weight: 700;
  color: var(--ink);
}
.bp-kicker-sep {
  color: var(--rust);
}
.bp-kicker-role {
  font-family: var(--font-mono);
  font-size: 0.74em;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
}

.bp-title .cht-line {
  position: relative;
  display: flex;
  align-items: baseline;
  width: max-content;
  max-width: 100%;
}
.bp-title .cht-mask {
  display: block;
  overflow: hidden;
  /* room for italic overhang and descenders inside the mask */
  padding: 0.04em 0.08em 0.14em;
  margin: -0.04em -0.08em -0.14em;
}
.bp-title .cht-word {
  display: inline-block;
  will-change: transform;
}
.bp-title .cht-sans {
  font-family: var(--font-sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.045em;
}
.bp-title .cht-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.04em;
  letter-spacing: -0.025em;
  color: var(--rust);
}
.bp-title .cht-serif-line {
  padding-left: 0.95em;
}

/* Dimension line under "at scale." — the claim, measured */
.bp-dim {
  position: absolute;
  left: 0;
  right: 0.12em;
  top: 100%;
  margin-top: 0.14em;
  height: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}
.bp-dim-rule {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--rust-line);
  transform-origin: center;
}
.bp-dim-rule::before,
.bp-dim-rule::after {
  content: "";
  position: absolute;
  bottom: -0.45rem;
  width: 1px;
  height: 1.3rem;
  background: var(--rust-line);
}
.bp-dim-rule::before {
  left: 0;
}
.bp-dim-rule::after {
  right: 0;
}
.bp-dim-label {
  position: relative;
  padding: 0 0.7rem;
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 0.7vw, 0.7rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
  background: var(--paper);
}
/* Label drawn from an attribute so it is not part of the h1 text */
.bp-dim-label::before {
  content: attr(data-label);
}

/* ─── Lede + actions ─── */
.hero-bp .hero-lede {
  max-width: 35rem;
  margin: 0 0 clamp(1.4rem, 3vh, 2rem);
  font-size: clamp(1rem, 1.15vw, 1.14rem);
  line-height: 1.62;
  color: var(--ink-80);
}
.hero-bp .hero-lede strong {
  font-weight: 600;
  color: var(--ink);
}
.hero-bp .hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.hero-bp .btn {
  border-color: var(--ink-28);
}
.hero-bp .btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.hero-bp .btn-primary:hover {
  background: var(--rust);
  border-color: var(--rust);
  color: #fffaf0;
  box-shadow: 0 14px 30px rgba(122, 90, 36, 0.26);
}
.hero-bp .btn-ghost {
  background: rgba(255, 255, 255, 0.38);
  color: var(--ink);
}
.hero-bp .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--ink);
  color: var(--ink);
}
.hero-bp .btn-ghost::before {
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(138, 106, 48, 0) 35%,
    rgba(138, 106, 48, 0.14) 50%,
    rgba(138, 106, 48, 0) 65%,
    transparent 100%
  );
}
.hero-bp a:focus-visible,
.hero-bp button:focus-visible {
  outline-color: var(--rust);
}

/* ─── Title block: the facts, as an architect files them ─── */
.bp-titleblock {
  grid-column: 8 / -1;
  grid-row: 3;
  justify-self: end;
  align-self: end;
  position: relative;
  z-index: 3;
  width: min(100%, 27rem);
  background: rgba(248, 245, 238, 0.86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--ink-28);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}
.tb-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--ink-28);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-64);
}
.tb-head span:last-child {
  color: var(--rust);
}
.bp-titleblock dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
}
.tb-cell {
  padding: 0.55rem 0.85rem 0.6rem;
  border-right: 1px solid var(--ink-14);
  border-bottom: 1px solid var(--ink-14);
}
.tb-cell:nth-child(2n) {
  border-right: 0;
}
.tb-cell:nth-last-child(-n + 2) {
  border-bottom: 0;
}
.tb-cell dt {
  margin-bottom: 0.22rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-64);
}
.tb-cell dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* ─── Scroll cue ─── */
.hero-bp .hero-scroll {
  position: absolute;
  left: calc(var(--pad-x) + 0.1rem);
  bottom: clamp(1.4rem, 3.4vh, 2.4rem);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-64);
}
.hero-bp .hero-scroll svg {
  height: 28px;
  animation: bpScrollBob 2.4s ease-in-out infinite;
}
@keyframes bpScrollBob {
  0%,
  100% {
    transform: translateY(-2px);
  }
  50% {
    transform: translateY(4px);
  }
}

/* No WebGL: the sheet still composes — just without the tower */
.hero-bp.bp-no3d .bp-stage {
  display: none;
}

/* ─── Short desktop viewports ─── */
@media (max-height: 760px) and (min-width: 761px) {
  .hero-bp .hero-scroll,
  .bp-edge {
    display: none;
  }
}

/* ─── Tablet ─── */
@media (max-width: 1100px) {
  .bp-tag {
    display: none;
  }
}
@media (max-width: 1023px) {
  .hero-bp .hero-content {
    grid-column: 1 / span 11;
  }
  .bp-title {
    font-size: clamp(3rem, min(10.5vw, 11vh), 7rem);
  }
  .hero-bp {
    --stage-o: 0.42;
  }
  .bp-edge {
    display: none;
  }
  .bp-titleblock {
    grid-column: 6 / -1;
  }
  .hero-bp .hero-meta {
    display: none;
  }
}

/* ─── Phone: one column, tower drawn faintly behind the headline ─── */
@media (max-width: 760px) {
  .hero-bp {
    --frame: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 6.1rem 1.25rem 1.75rem;
  }
  .hero-bp .hero-top {
    padding-bottom: 0.75rem;
  }
  .hero-bp .hero-eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }
  .hero-bp .hero-content {
    flex: 1;
    justify-content: center;
  }
  .bp-title {
    font-size: clamp(2.6rem, 12.4vw, 4.2rem);
    margin-bottom: 2.4rem;
  }
  .bp-title .cht-serif-line {
    padding-left: 0.6em;
  }
  .bp-kicker {
    font-size: 0.82rem;
  }
  .hero-bp .hero-lede {
    font-size: 0.98rem;
    line-height: 1.58;
  }
  .hero-bp .hero-cta-row {
    width: 100%;
  }
  .hero-bp .hero-cta-row .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .hero-bp {
    --stage-o: 0.36;
  }
  .bp-titleblock {
    width: 100%;
    align-self: stretch;
  }
  .tb-cell dd {
    font-size: 0.8rem;
  }
  .bp-edge,
  .hero-bp .hero-scroll {
    display: none;
  }
}

/* ─── Reduced motion: a still drawing ─── */
@media (prefers-reduced-motion: reduce) {
  .hero-bp .hero-scroll svg {
    animation: none;
  }
}
