/* Home direction B (REQ-126): the hero zoom, 01 / From product to project and 02 / Industrial construction
   ecosystem. Colours and spacing are the tokens of design-system.css; drawing colours are in home-drawing.css.
   Each block fits the window at desktop sizes (WEB-HOME-033); the tall tracks only give the scroll room to change
   the sheet, the page itself scrolls normally. Nothing is positioned over a drawing (REQ-028). */

.hb-hero, .hb-p2p, .hb-eco { --hb-top: var(--header-height, 80px); --hb-pad: var(--bc-space-3); }
.hb-hero.section, .hb-p2p.section, .hb-eco.section { padding-block: 0; }

/* Sheet frame shared by the three figures. */
.hb-sheet, .hb-sys, .hb-graph { margin: 0; background: var(--bc-draw-sheet); border: 1px solid var(--bc-line);
  border-radius: 0; }
.hb-sheet-head, .hb-sheet-foot, .hb-graph-foot { display: flex; justify-content: space-between; align-items: center;
  gap: var(--bc-space-2); padding: 7px 12px; font: 10px/1.5 var(--bc-mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--bc-muted); }
.hb-sheet-head { border-bottom: 1px solid var(--bc-draw-rule); }
.hb-sheet-foot { border-top: 1px solid var(--bc-draw-rule); text-transform: none; letter-spacing: .02em;
  font-size: 11px; }
.hb-drawing, .hb-graph-svg { display: block; width: 100%; height: auto; margin-inline: auto; overflow: hidden; }

.hb-step { min-height: 36px; padding: 0 8px; border: 0; border-top: 1px solid var(--bc-line); background: transparent;
  color: var(--bc-muted); font: 500 10px/1.2 var(--bc-mono); letter-spacing: .04em; text-align: left;
  cursor: pointer; transition: color var(--bc-motion-fast) var(--bc-ease-out); }
.hb-step:hover { color: var(--bc-ink); }
.hb-step[aria-pressed="true"] { border-top: 2px solid var(--bc-blue); color: var(--bc-ink); }

.hb-disclosure { margin: 0; font-size: 12px; line-height: 1.55; color: var(--bc-muted); }
.hb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bc-space-1) var(--bc-space-3);
  margin-top: 0; }

/* ---------- Hero: FIG. 01 with the zoom inside the configuration box ---------- */
.hb-hero-track { position: relative; }
.hb-hero-stage { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 48px;
  align-items: center; padding-block: var(--hb-pad); box-sizing: border-box; }
.hb-hero-copy { display: flex; flex-direction: column; gap: var(--bc-space-2); padding: 0; }
.hb-hero-copy > * { margin: 0; }
/* The BIM line sits directly under the headline (WEB-HOME-030). */
.hb-hero .hero-bim { padding-left: 14px; border-left: 2px solid var(--bc-blue); font: 500 13px/1.7 var(--bc-mono);
  color: var(--bc-ink); max-width: 56ch; }
.hb-hero .hero-description { font-size: 17px; line-height: 1.6; color: var(--bc-muted); max-width: 56ch; }
.hb-hero .hero-supporting { font-size: 14px; color: var(--bc-muted); }
.hb-hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bc-space-1) var(--bc-space-3); }

.hb-sys-body { display: flex; flex-direction: column; padding: 10px 14px 12px; }
.hb-sys-nodes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--bc-space-1); margin: 0;
  padding: 0; list-style: none; }
.hb-sys-nodes li { display: flex; align-items: center; justify-content: center; gap: var(--bc-space-1);
  min-height: 42px; padding: 6px 8px; border: 1px solid var(--bc-line); background: var(--bc-surface);
  color: var(--bc-ink); font: 600 13px/1.3 var(--bc-font); text-align: center; }
.hb-sys-nodes svg { flex: none; color: var(--bc-muted); }
.hb-sys-flow { display: block; width: 100%; height: 22px; }
.hb-sys-core { border: 1px solid var(--bc-blue); background: var(--bc-draw-sheet); }
.hb-sys-core-head { display: flex; justify-content: space-between; gap: var(--bc-space-2); padding: 6px 12px;
  font: 500 10px/1.5 var(--bc-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--bc-blue); }
.hb-sys-core-head span:last-child { color: var(--bc-muted); }
.hb-sys .hb-drawing { border-block: 1px solid var(--bc-draw-rule); }
.hb-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 0 8px 6px; }
.hb-sys .sheet-block { margin: 0; border-width: 1px 0 0; }

/* ---------- 01 / From product to project ---------- */
.hb-p2p { background: var(--bc-surface); }
.hb-p2p-stage { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center;
  padding-block: var(--hb-pad); box-sizing: border-box; }
.hb-p2p-copy, .hb-eco-copy, .hb-eco-side { display: flex; flex-direction: column; gap: var(--bc-space-2);
  min-width: 0; }
.hb-p2p-copy > *, .hb-eco-copy > *, .hb-eco-side > * { margin: 0; }
.hb-p2p .section-intro, .hb-eco .section-intro { margin: 0; font-size: 16px; line-height: 1.6; }
.hb-p2p h2, .hb-eco h2 { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.12; }
.hb-levels { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hb-level { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--bc-line); border-left: 3px solid var(--bc-line); background: var(--bc-surface);
  color: var(--bc-ink); font: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--bc-motion-fast) var(--bc-ease-out),
  background var(--bc-motion-fast) var(--bc-ease-out); }
.hb-level:hover { border-color: var(--bc-blue); }
.hb-level[aria-pressed="true"] { border-left-color: var(--bc-blue); background: var(--bc-selected); }
.hb-level-icon { flex: none; color: var(--bc-blue); }
.hb-level-text { display: flex; flex-direction: column; gap: 2px; }
.hb-level-name { font-weight: 600; font-size: 15px; }
.hb-level-items { font: 11px/1.4 var(--bc-mono); letter-spacing: .04em; color: var(--bc-muted); }
.hb-p2p .sheet-block { margin: 0; }

/* ---------- 02 / Industrial construction ecosystem ---------- */
.hb-eco { background: var(--bc-paper); }
.hb-eco-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center;
  padding-block: var(--hb-pad); box-sizing: border-box; }
.hb-graph-foot { border-top: 1px solid var(--bc-draw-rule); justify-content: flex-start; flex-wrap: wrap;
  text-transform: none; letter-spacing: 0; font: 13px/1.4 var(--bc-font); }
.hb-graph-foot .hb-step { min-height: 32px; padding: 0 12px; border: 1px solid var(--bc-line); }
.hb-graph-foot .hb-step[aria-pressed="true"] { border-color: var(--bc-blue); }
.hb-eco .sheet-block { margin: 0; }

/* Desktop: each block fills the window under the header; hero and 01 pin while their sheets change. The condition is
   the DESKTOP query of home-b.mjs; in shorter windows the blocks flow normally and the drawings keep the column width
   (a height-based width there collapsed them to a few pixels on 125 % and 150 % laptop screens). */
@media (min-width: 901px) and (min-height: 720px) {
  .hb-hero-track { height: 300vh; }
  .hb-p2p-track { height: 230vh; }
  .hb-hero-stage, .hb-p2p-stage { position: sticky; top: var(--hb-top); height: calc(100vh - var(--hb-top)); }
  .hb-eco-stage { min-height: calc(100vh - var(--hb-top)); }
  /* The drawings take the height the chrome around them leaves. */
  .hb-sys .hb-drawing { width: min(100%, calc((100vh - var(--hb-top) - 360px) * 640 / 520)); }
  .hb-p2p-sheet .hb-drawing { width: min(100%, calc((100vh - var(--hb-top) - 110px) * 640 / 520)); }
  .hb-eco-side .hb-drawing { width: min(100%, calc((100vh - var(--hb-top) - 230px) * 640 / 520)); }
  .hb-graph-svg { width: min(100%, calc((100vh - var(--hb-top) - 370px) * 592 / 388)); }
}
/* Short windows: tighter rhythm so each block still fits without scrolling inside it. */
@media (min-width: 901px) and (max-height: 820px) {
  .hb-hero, .hb-p2p, .hb-eco { --hb-pad: var(--bc-space-2); }
  .hb-hero-copy, .hb-p2p-copy, .hb-eco-copy, .hb-eco-side { gap: 12px; }
  .hb-p2p .section-intro, .hb-eco .section-intro { font-size: 15px; line-height: 1.5; }
  .hb-p2p h2, .hb-eco h2 { font-size: clamp(26px, 2.4vw, 32px); }
  .hb-level { min-height: 40px; padding-block: 5px; }
  .hb-p2p .sheet-figures > div, .hb-p2p .sheet-block > span { padding-block: 5px; }
  .hb-hero .hero-supporting { display: none; }
}

/* Laptop windows under about 740 px tall (a 1366 × 768 screen with browser chrome): 01 folds its title block
   figures into one row and its levels into one line each, so the pinned block still shows its action and notes. */
@media (min-width: 901px) and (max-height: 740px) {
  .hb-p2p h2 { font-size: 24px; }
  .hb-p2p .section-intro { font-size: 14px; }
  .hb-p2p-copy { gap: 8px; }
  .hb-level { min-height: 34px; padding-block: 3px; }
  .hb-level-text { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: var(--bc-space-1); }
  .hb-p2p .sheet-figures { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .hb-p2p .sheet-figures > div:nth-child(n) { border-top: 0; border-left: 1px solid var(--bc-line); }
  .hb-p2p .sheet-figures > div:first-child { border-left: 0; }
}
/* Where nothing pinned can fit (under 720 px of window height), the blocks of the home scroll as normal sections
   and their drawings take the full column, so their text stays readable; the same condition is DESKTOP in
   home-b.mjs. */
@media (min-width: 901px) and (max-height: 719px) {
  .hb-hero-track, .hb-p2p-track { height: auto; }
  .hb-hero-stage, .hb-p2p-stage { position: static; height: auto; }
}

/* Small laptops (about 1024 px wide): the narrow text column of 01 wraps more, so its type tightens. */
@media (min-width: 901px) and (max-width: 1180px) and (max-height: 820px) {
  .hb-p2p h2 { font-size: 24px; }
  .hb-p2p .section-intro { font-size: 14px; }
  .hb-p2p-copy { gap: 10px; }
  .hb-level-name { font-size: 14px; }
  .hb-eco h2 { font-size: 24px; }
  .hb-eco .section-intro { font-size: 14px; }
  .hb-eco-copy, .hb-eco-side { gap: 10px; }
  .hb-eco .hb-actions { flex-wrap: nowrap; column-gap: var(--bc-space-2); white-space: nowrap; }
  .hb-eco .hb-actions .button { gap: var(--bc-space-1); padding-inline: 14px; }
  .hb-eco .hb-graph-foot { flex-wrap: nowrap; }
  .hb-eco [data-eco-hint] { display: none; }
}

/* Narrow windows: the blocks stack and every drawing scales to the width (no sideways scroll). In the hero the
   figure pins under the header, inside its own track, while its five sheets change. */
@media (max-width: 900px) {
  .hb-hero, .hb-p2p, .hb-eco { --hb-pad: var(--bc-space-4); }
  .hb-hero-stage, .hb-p2p-stage, .hb-eco-stage { grid-template-columns: minmax(0, 1fr); gap: var(--bc-space-4); }
  .hb-hero-stage { align-items: start; }
  .hb-sys-track { height: 230vh; }
  .hb-sys { position: sticky; top: calc(var(--hb-top) + 8px); }
  .hb-sys-body { padding: 8px 8px 10px; }
  .hb-sys-nodes li { flex-direction: column; gap: 4px; min-height: 0; padding: 6px 4px; font-size: 11px; }
  .hb-sys-nodes svg { width: 16px; height: 16px; }
  .hb-steps { gap: 2px; padding: 0 4px 4px; }
  .hb-step { padding: 0 3px; font-size: 9px; letter-spacing: 0; }
  .hb-hero .hero-supporting { display: none; }
}
/* Narrow windows held sideways (phones, small tablets): the hero figure is taller than the window,
   so it scrolls with the page instead of pinning; its buttons still change the sheet. */
@media (max-width: 900px) and (min-aspect-ratio: 1/1) {
  .hb-sys-track { height: auto; }
  .hb-sys { position: static; }
}
@media (max-width: 600px) {
  .hb-sheet-head { font-size: 9px; letter-spacing: .06em; }
}
/* Narrow windows: the text inside FIG. 02, FIG. 03 and the connections graphic must stay readable (at least about
   7 px on screen), so each keeps a minimum drawing width and pans sideways inside its own frame; the page itself
   never scrolls sideways. */
@media (max-width: 900px), (max-width: 1180px) and (max-height: 719px) {
  .hb-p2p-sheet, .hb-eco-side .hb-sheet, .hb-graph { overflow-x: auto; overscroll-behavior-x: contain; }
  .hb-p2p-sheet .hb-drawing, .hb-eco-side .hb-drawing { min-width: 560px; }
  .hb-graph-svg { min-width: 520px; }
  .hb-p2p-sheet:focus-visible, .hb-eco-side .hb-sheet:focus-visible, .hb-graph:focus-visible {
    outline: 3px solid var(--bc-blue); outline-offset: 2px; }
}


/* ---------- REQ-131 stage 6: the enquiry says what the visitor was looking at (WEB-FORM-024) ---------- */
.enquiry-context:not([hidden]) { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 4px var(--bc-space-2); margin: var(--bc-space-1) 0 var(--bc-space-2); padding: var(--bc-space-1) 12px;
  border-left: 2px solid var(--bc-blue); background: var(--bc-selected); font-size: 14px; color: var(--bc-ink); }
.enquiry-context button { padding: 0; border: 0; background: none; font: 600 14px var(--bc-font); cursor: pointer; }

/* REQ-131 stage 5 (WEB-NAV-008): pages of this site cross-fade on navigation where the browser supports it. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* ---------- REQ-134: a drawing beside each text item after A-201; nothing moves after A-201 ---------- */
.item-fig { position: relative; z-index: 1; min-width: 0; margin: 0;
  background: var(--bc-draw-sheet); border: 1px solid var(--bc-line); }
.item-fig svg { display: block; width: 100%; height: auto; }
/* 03: each step reads number, text, drawing. */
#problem .problem-item { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 340px);
  align-items: start; gap: var(--bc-space-2); }
/* 04: each capability reads number, text and scope, drawing. */
#solutions .systems-capability { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 440px);
  column-gap: var(--bc-space-3); }
#solutions .systems-capability ul { grid-column: 2; grid-row: auto; margin-top: var(--bc-space-2); }
#solutions .systems-capability .item-fig { grid-column: 3; grid-row: 1 / span 4; align-self: start; }
/* 05: the three layers stand one above the other, each with its drawing beside it. */
.integration-figure .systems-flow { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); align-items: stretch; }
.integration-figure .systems-flow > * { grid-column: 1; }
.integration-figure .systems-flow > .item-fig { grid-column: 2; }
.integration-figure .systems-flow > .systems-arrow { grid-column: 1; justify-self: center; }
/* 06: each service reads title, text, drawing. */
#bim-services .bim-grid article { grid-template-columns: minmax(0, 240px) minmax(0, 1fr) minmax(0, 480px); }
#bim-services .bim-grid article > :not(h3, .item-fig) { grid-column: 2; grid-row: auto; }
#bim-services .bim-grid article .item-fig { grid-column: 3; grid-row: 1 / span 5; align-self: start; }
/* 07: each step carries its drawing above its text. */
.methodology .item-fig { margin-bottom: var(--bc-space-2); }
/* Narrow screens: every drawing follows its text at full width. */
@media (max-width: 900px) {
  #problem .problem-item { grid-template-columns: auto minmax(0, 1fr); }
  #problem .problem-item .item-fig { grid-column: 1 / -1; }
  #solutions .systems-capability, #bim-services .bim-grid article { grid-template-columns: minmax(0, 1fr); }
  #solutions .systems-capability > :is(*, .item-fig), #bim-services .bim-grid article > :is(*, .item-fig),
  #solutions .systems-capability ul { grid-column: 1; grid-row: auto; }
  .integration-figure .systems-flow { grid-template-columns: minmax(0, 1fr); }
  .integration-figure .systems-flow > .item-fig { grid-column: 1; }
  /* 07: the drawing takes the full first row, then the number and the text share the second one. */
  #methodology .methodology li { grid-template-columns: 37px minmax(0, 1fr); }
  #methodology .methodology .item-fig { grid-column: 1 / -1; }
  #methodology .methodology .step-number { grid-column: 1; grid-row: 2; }
  #methodology .methodology li > div { grid-column: 2; grid-row: 2; }
  /* The timeline line is a grid item of the number column, from under the number to the next step: it never
     crosses the text. */
  #methodology .methodology li:not(:last-child)::after {
    position: static;
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    align-self: stretch;
    width: 1px;
    height: auto;
    margin: 44px 0 -28px; /* under the 37 px number, through the 28 px gap to the next step */
  }
}

/* The RFI sheet beside the contact form. */
.sf { min-width: 0; max-width: 100%; margin: var(--bc-space-3) 0 0; }
.sf-svg { display: block; width: 100%; height: auto; }
.contact-copy { min-width: 0; }
/* The contact section fits one window on laptops: the form speaks for itself, the RFI sheet stays beside it. */
#contact.section { padding-block: var(--bc-space-4); }
.contact-copy .sf { max-width: 400px; }
@media (max-width: 900px) {
  .contact-copy .sf { max-width: none; }
}
