/* Responsive recomposition for the approved homepage spatial hero.
   Wide desktop (>1240px) intentionally inherits the approved composition unchanged.

   Stage surfaces keep stable proportions at every width. Each responsive profile owns
   both its stage positions and its orthogonal route geometry so the network cannot drift
   away from the cards as the composition recomposes. */

/* Preserve the physical proportions established by the approved wide-desktop composition. */
.spatial-stage{height:auto!important;overflow:hidden}
.spatial-stage-brief{aspect-ratio:1.19}
.spatial-stage-structure{aspect-ratio:1.03}
.spatial-stage-review{aspect-ratio:1.11}
.spatial-stage-output{aspect-ratio:.94}

/* Desktop route is the default. Other route geometries are present but hidden until their
   matching layout profile becomes active. */
.spatial-route-profile-tablet,.spatial-route-profile-mobile{display:none}

@media (min-width:1001px) and (max-width:1240px){
  .home-block-hero .block-hero-grid{
    grid-template-columns:minmax(0,1.06fr) minmax(410px,.94fr);
    gap:clamp(2rem,3vw,3.5rem);
  }
  .home-block-hero .block-hero-visual{
    width:100%;
    max-width:590px;
  }
  .spatial-hero-scene{
    inset:2% 0 13%;
    transform:translateY(-10px) rotateY(-6deg) rotateX(2deg) rotateZ(-.7deg);
  }
  .spatial-stage-heading{font-size:.47rem}

}

/* Tablet / compact desktop: copy first, then a full-width spatial composition.
   This profile has its own network path and keeps a protected decision zone between
   Review and Production so stage 04 cannot cover the decision marker. */
@media (min-width:641px) and (max-width:1000px){
  .home-block-hero .block-hero-grid{
    grid-template-columns:1fr!important;
    align-items:start;
    gap:3.25rem;
  }
  .home-block-hero .block-hero-visual{
    width:100%;
    max-width:none;
    justify-self:stretch;
    align-self:auto;
    margin:0;
    display:block;
  }
  .spatial-hero{
    width:100%;
    height:auto;
    aspect-ratio:3/2;
  }
  .spatial-hero-scene{
    inset:2% 1% 15%;
    transform:translateY(-6px) rotateY(-4deg) rotateX(1.25deg) rotateZ(-.35deg);
  }

  .spatial-route-profile-desktop,.spatial-route-profile-mobile{display:none}
  .spatial-route-profile-tablet{display:inline}

  .spatial-stage-structure{left:31%;top:2%;width:31%}
  .spatial-stage-brief{left:5%;top:55%;width:19%}
  .spatial-stage-review{left:51%;top:64%;width:22%}
  .spatial-stage-output{right:1%;top:17%;width:17%}

  .hero-decision-cluster{left:77.78%;top:57.8%}
  .spatial-stage-heading{font-size:.52rem}
  .spatial-stage-brief-body,.review-layout{padding:10px}
  .structure-grid{padding:11px;gap:9px}
  .hero-decision-cluster{--hero-decision-diamond-side:26px;--hero-decision-clearance:6px}
  .hero-decision-label{
    left:calc(var(--hero-decision-diamond-side) * .35);
    top:calc(var(--hero-decision-diamond-side) * .708 + 6px);
    transform:none;font-size:.62rem;
  }

}

/* Mobile: deliberately smaller and more open than tablet. The visual is capped instead of
   filling every available pixel, and the four stages move into a tighter zig-zag route. */
@media (max-width:640px){
  .home-block-hero .block-hero-grid{gap:2.5rem}
  .home-block-hero .block-hero-visual{
    width:min(100%,430px);
    max-width:430px;
    justify-self:center;
    margin-inline:auto;
  }
  .spatial-hero{
    width:100%;
    height:auto;
    aspect-ratio:1/1;
  }
  .spatial-hero-scene{
    inset:2% 1% 14%;
    transform:translateY(-4px) rotateY(-2deg) rotateX(.6deg) rotateZ(-.1deg);
  }
  .spatial-stage{box-shadow:0 8px 20px color-mix(in oklab,var(--foreground) 6%,transparent)}

  .spatial-route-profile-desktop,.spatial-route-profile-tablet{display:none}
  .spatial-route-profile-mobile{display:inline}

  /* Mobile art direction: pull Structure left and lift Production enough to leave the
     decision node fully exposed, with clear air around the route transition. */
  .spatial-stage-structure{left:24%;top:2%;width:43%}
  .spatial-stage-brief{left:1%;top:48%;width:29%}
  .spatial-stage-review{left:38%;top:64%;width:34%}
  .spatial-stage-output{right:1%;top:14%;width:24%}
  /* Centre the mobile decision cluster on the horizontal route span from x=680 to x=805. */
  .hero-decision-cluster{left:82.5%;top:54.69%}

  .spatial-stage-heading{
    padding:7px 7px 6px;
    gap:5px;
    font-size:.42rem;
    white-space:nowrap;
  }
  .spatial-stage-brief .spatial-stage-heading strong,
  .spatial-stage-structure .spatial-stage-heading strong,
  .spatial-stage-review .spatial-stage-heading strong,
  .spatial-stage-output .spatial-stage-heading strong{font-size:0}
  .spatial-stage-brief .spatial-stage-heading strong::after{content:"BRIEF";font-size:.42rem}
  .spatial-stage-structure .spatial-stage-heading strong::after{content:"STRUCTURE";font-size:.42rem}
  .spatial-stage-review .spatial-stage-heading strong::after{content:"REVIEW";font-size:.42rem}
  .spatial-stage-output .spatial-stage-heading strong::after{content:"PRODUCTION";font-size:.42rem}
  .structure-grid{padding:6px;gap:5px}
  .structure-path{font-size:.29rem;gap:3px 4px}
  .structure-notes{gap:3px}
  .spatial-stage-brief-body{padding:6px;gap:5px}
  .review-layout{grid-template-columns:1fr 22px;padding:6px;gap:5px}
  .review-candidates{gap:3px}
  .review-decision span{width:9px;height:9px}
  .output-frames{padding:6px 5px 3px;gap:3px}
  .spatial-stage-output>.spatial-lines{padding:3px 5px 0;gap:3px}
  .spatial-lines{gap:3px}
  .hero-decision-cluster{--hero-decision-diamond-side:22px;--hero-decision-clearance:5px}
  /* Narrow layout: place the word below the route and just right of the
     diamond centre. This protects it from the right canvas edge. */
  .hero-decision-label{
    left:2px;
    top:calc(var(--hero-decision-diamond-side) * .708 + 7px);
    transform:none;
    font-size:.55rem;
    letter-spacing:.025em;
  }

}

@media (max-width:390px){
  .home-block-hero .block-hero-visual{width:100%;max-width:none}
  .spatial-stage-heading{font-size:.39rem}
  .spatial-stage-brief .spatial-stage-heading strong::after,
  .spatial-stage-structure .spatial-stage-heading strong::after,
  .spatial-stage-review .spatial-stage-heading strong::after,
  .spatial-stage-output .spatial-stage-heading strong::after{font-size:.39rem}

  .hero-decision-label{font-size:.52rem}
}
