/* Block 3 · Behandlungen, „Näher" (builder raum, docs/HOME-NEXT-BUILDERS.md; round 3 by Fable 2026-11-17, docs/HOME-NEXT.md
   „Hero and index, round 2"). The heading and the rail are v8's, on paper, locked; only the rail's „Ästhetik" card
   takes the studio still.
   Owner 2026-11-17, on his phone: "turn this block's ground fully into the blue of the 3D pictures, the 3D objects
   flying in front of it, no boxes"; then on the hero and this block: "there is weirdly much free space".
   Measured before this round: at 1920 the band ended in 458 px of empty blue (42 % of the window) and its type was
   27 / 40 / 20 px in a 923 px column; at 390 the four objects' rows were 200 px tall and half empty, the index ran 2.75
   screens for eight links.
   Concept: the contents page of the practice, set large on the specimens' blue; the object of the group you are
   reading comes forward out of a row of four.
     ≥ 810  the eight treatments in display type on the left. On the right one stage that holds beside the list (sticky
            in its own column, never the page): the four objects stand small in one row at the back; the lit one
            stands in front, large (Fahrt: one transform per object, the front one is the live 3D slot).
     < 810  each group's object is floated beside its name and first lines and grows a little when its group is read.
   Slots (.bx-fly) are the live-3D module's hosts (blocks/20-live3d.js): no ground, border, radius, clip or shadow of
   ours, nothing over them. Contrast on the band #49A9DA: ink 6.6 (names, links), ink 86 % 5.0 (lines, body sizes). */

/* ---- the rail's „Ästhetik" card: the specimen still, cover-fitted, on the band it was rendered on ---- */
.bh-card--2 { --ph-bg: var(--band); }
.bh-card--2 .bh-ph .bx-card-pic { inset: 0; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---- the band: from under the rail to the block's foot, edge to edge ---- */
.bh.bx-on { padding-bottom: 0; }
.bx-band { margin-top: var(--gap-stack-l); padding-block: 72px 96px; background: var(--band); color: var(--on-band); }
.bh.bx-on .bh-ix.bx { margin-top: 0; }

/* ---- the list: group name small on its hairline, the treatments in display type ---- */
.bh.bx-on .bx-g { display: block; padding-block: 20px 44px; border-top: 1px solid var(--on-band-line); }
.bh.bx-on .bx-g:last-child { padding-bottom: 0; border-bottom: 0; }
.bh.bx-on .bx-g .bh-ix-h {
  margin-bottom: 20px; font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: 0;
  font-weight: var(--fw-statement); color: var(--on-band);
}
.bh.bx-on .bx-g .bh-ix-list { display: grid; gap: 18px; }
.bh.bx-on .bx-g .bh-ix-e { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 2px; align-items: baseline; }
.bh.bx-on .bx-g .bh-ix-a {
  font-size: var(--fs-h2); line-height: 1.12; letter-spacing: var(--ls-h2); color: var(--on-band);
  text-decoration-thickness: 1px; text-underline-offset: .14em; text-decoration-color: var(--on-band-line);
}
.bh.bx-on .bx-g .bh-ix-a::after { inset: -8px 0; }
.bh.bx-on .bx-g .bh-ix-l { max-width: 34em; color: var(--on-band-2); }
.bh.bx-on .bh-ix-e:has(.bh-ix-a:focus-visible) { outline-color: var(--ink); }
@media (hover: hover) { .bh.bx-on .bh-ix-e:hover .bh-ix-a { text-decoration-color: var(--on-band); } }

/* ---- a slot: the object alone on the band ---- */
.bx-fly { position: relative; margin: 0; aspect-ratio: 4 / 5; }
.bx-fly-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
/* the live object takes the picture's place by a short dissolve, so nothing blinks while a slot is on its way */
.bx-fly .bx-fly-img { transition: opacity .3s var(--ease-ui); }
.bx-fly.is-live3d .bx-fly-img { opacity: 0; }

/* ---- ≥ 810: list and stage ---- */
@media (min-width: 810px) {
  .bh.bx-on .bh-ix.bx {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-grid); align-items: start;
    --fly-h: min(74svh, 100svh - var(--nav-bottom) - 32px);          /* the stage: about three quarters of the window */
    --fly-top: calc(var(--nav-bottom) + (100svh - var(--nav-bottom) - var(--fly-h)) / 2);
  }
  .bx-groups { grid-column: 1 / 8; min-width: 0; }
  .bx-g > .bx-fly { display: none; }                                  /* the group's own slot is the phone's */
  .bx-stage { grid-column: 8 / 13; align-self: stretch; min-width: 0; }
  /* the stage rides beside the list and stops with it: no empty foot under the last group */
  .bx-hold {
    position: sticky; top: var(--fly-top); aspect-ratio: 4 / 5;
    width: min(100% + var(--side), var(--fly-h) * .8);                /* may run into the right margin, never into the list */
    margin: 0 calc(-1 * var(--side)) 0 auto;
  }
  /* back row: four places across the stage's top, each object at a quarter of its size */
  .bx-hold .bx-fly {
    position: absolute; inset: 0; z-index: 1; pointer-events: none; transform-origin: 50% 50%;
    transform: translate3d(var(--bx-x, 0%), -41%, 0) scale(.25);
  }
  .bx-hold .bx-fly[data-g="0"] { --bx-x: -37.5%; }
  .bx-hold .bx-fly[data-g="1"] { --bx-x: -12.5%; }
  .bx-hold .bx-fly[data-g="2"] { --bx-x: 12.5%; }
  .bx-hold .bx-fly[data-g="3"] { --bx-x: 37.5%; }
  /* front: the lit object, large, under the row */
  .bx-hold .bx-fly.is-on { z-index: 2; pointer-events: auto; transform: translate3d(0, 9%, 0) scale(.92); }
  /* purpose: Fahrt — the object of the group being read comes forward, the one before it returns to its place in
     the row. One transform each, .8 s, two-way; the incoming one starts a moment later so the two never swap through
     each other at full size. */
  html.motion:not(.rm) .bx-hold .bx-fly { transition: transform .8s var(--ease-scroll); }
  html.motion:not(.rm) .bx-hold .bx-fly.is-on { transition-delay: .12s; }
}

/* D: wider list; from 1600 the treatment's line stands beside its name on one baseline (the printed contents page) */
@media (min-width: 1200px) {
  .bx-band { padding-block: 88px 112px; }
  .bx-groups { grid-column: 1 / 9; }
  .bx-stage { grid-column: 9 / 13; }
}
@media (min-width: 1600px) {
  .bh.bx-on .bx-g .bh-ix-list { gap: 12px; }
  .bh.bx-on .bx-g .bh-ix-e { grid-template-columns: calc(var(--fs-h2) * 9.3) minmax(0, 1fr); column-gap: var(--gap-grid); }
}

/* P: the object floated right of the group's name and first lines, a little into the page margin; the text runs
   beside it and then full width. Nothing is laid over anything: the float keeps the lines clear by itself. */
@media (max-width: 809.98px) {
  .bx-band { margin-top: var(--gap-stack); padding-block: 24px 56px; }
  .bx-stage { display: none; }
  .bh.bx-on .bx-g { display: flow-root; padding-block: 20px 32px; }
  .bh.bx-on .bx-g > .bx-fly {
    float: right; width: 152px; margin: -6px -14px 0 6px; shape-outside: margin-box;
    transform: scale(.86); transform-origin: 60% 45%;
  }
  .bh.bx-on .bx-g > .bx-fly.is-on { transform: none; }
  /* purpose: Fahrt, small — the object of the group at the reading line comes a step nearer; transform only */
  html.motion:not(.rm) .bh.bx-on .bx-g > .bx-fly { transition: transform .6s var(--ease-scroll); }
  .bh.bx-on .bx-g .bh-ix-h { margin-bottom: 12px; font-size: 15px; line-height: 1.45; }
  .bh.bx-on .bx-g .bh-ix-list, .bh.bx-on .bx-g .bh-ix-e { display: block; }
  .bh.bx-on .bx-g .bh-ix-e + .bh-ix-e { margin-top: 18px; }
  .bh.bx-on .bx-g .bh-ix-a { display: inline-block; font-size: 26px; line-height: 1.2; letter-spacing: var(--ls-h3); }
  .bh.bx-on .bx-g .bh-ix-a::after { inset: -4px 0; }
  .bh.bx-on .bx-g .bh-ix-l { display: block; margin-top: 2px; font-size: 15px; line-height: 1.45; }
}

/* ---- ≥ 1000 × 620 with motion: the pinned scene (owner 2026-11-17: "show it all nice, smooth and ux-wise"). The list
   and the stage stand still in the window while the scroll steps through the four groups, each owning 60 % of a window
   height, so the object of the group being read stays as long as it is read. The block lets go after the fourth.
   Run = 100svh + 4 × 60vh; the inner element is sticky at top 0. blocks/03-raum.js reads the run's progress. */
@media (min-width: 1000px) and (min-height: 700px) {
  html.motion:not(.rm) .bx-band { height: calc(100svh + 4 * 60vh); padding-block: 0; }
  html.motion:not(.rm) .bh.bx-on .bh-ix.bx {
    position: sticky; top: 0; height: 100svh; box-sizing: border-box;
    padding-top: calc(var(--nav-h, 68px) + 24px); padding-bottom: 24px; align-items: center;
    --u: min(1vw, 1.25vh);                  /* the type and the gaps follow the window's height: the list fits at 810 and up */
  }
  html.motion:not(.rm) .bx-stage { align-self: center; }
  html.motion:not(.rm) .bx-hold { position: relative; top: auto; }
  html.motion:not(.rm) .bh.bx-on .bx-g { padding-block: calc(var(--u) * .6) calc(var(--u) * 1.2); }
  html.motion:not(.rm) .bh.bx-on .bx-g:last-child { padding-bottom: 0; }
  html.motion:not(.rm) .bh.bx-on .bx-g .bh-ix-h { margin-bottom: calc(var(--u) * .6); font-size: max(15px, calc(var(--u) * 1.5)); line-height: 1.45; }
  html.motion:not(.rm) .bh.bx-on .bx-g .bh-ix-list { gap: calc(var(--u) * .9); }
  html.motion:not(.rm) .bh.bx-on .bx-g .bh-ix-a { font-size: max(26px, calc(var(--u) * 2.9)); line-height: 1.08; }
  html.motion:not(.rm) .bh.bx-on .bx-g .bh-ix-l { max-width: 44em; font-size: max(15px, calc(var(--u) * 1.5)); line-height: 1.45; }
  @media (min-width: 1600px) {
    html.motion:not(.rm) .bh.bx-on .bx-g .bh-ix-e { grid-template-columns: calc(var(--u) * 27) minmax(0, 1fr); }
  }
  /* purpose: the eye is led to the group whose object is shown; the other three step back to 38 %. Opacity sits on the
     group's name and list, not on the group, because the group itself carries its reveal (data-rise). */
  html.motion:not(.rm) .bh.bx-on .bx-g > .bh-ix-h,
  html.motion:not(.rm) .bh.bx-on .bx-g > .bh-ix-list { transition: opacity .3s var(--ease-ui); }
  html.motion:not(.rm) .bh.bx-on .bx-g:not(.is-act) > .bh-ix-h,
  html.motion:not(.rm) .bh.bx-on .bx-g:not(.is-act) > .bh-ix-list { opacity: .38; }
}
