/* Builder sections: heroes and scenes (hero-word, hero-simple, rise, deck, number). Owner: FRONTEND (builder).
   Base looks come from the home page (site/pages.css) and the inner pages (site/pages-inner.css); this file only adapts them to
   editor content of any length and to any position on a page. */

/* ======================= hero-word (home .hero-scene) ======================= */
/* everything of the first screen sits in one frame, so the landing line can follow it when the scene does not pin */
.bk-hw__frame { position: absolute; inset: 0; overflow: hidden; }
.bk-hw { --swl: calc(clamp(.95rem, 2vw, 1.5rem) * 1.6 * var(--swn, 1)); }
.bk-hw .hero-scene__t2 { gap: 14px; }
.bk-hw__text { max-width: 46ch; margin-inline: auto; text-wrap: pretty; }
/* the landing line sits in the middle of the screen (on the home page the next scene's laptop fills the space under it) */
.bk-hw .hero-scene__fin { inset: 0; align-content: center; gap: 4px; }
.bk-hw .hero-scene__big { max-width: 16ch; margin: 0; text-wrap: balance; }
.bk-hw .hero-scene__run { margin-bottom: 0; }
.bk-hw .hero-scene__run b { margin-inline: .25em; }
.bk-hw .hero-scene__t1, .bk-hw .hero-scene__sw { text-wrap: balance; }
/* no landing line: the word turns into plain text and the whole title comes back over the glow */
.bk-hw--nofin .hero-scene__title, .bk-hw--nofin .hero-scene__t2 { opacity: max(calc(1 - var(--a) * 4), var(--b)); }
.bk-hw--nofin .hero-scene__t2 { pointer-events: auto; }
.bk-hw--nofin .hero-scene__word { color: rgba(242, 248, 247, var(--b)); }
@media (max-width: 760px) {
    .bk-hw { --swl: calc(.95rem * 1.6 * var(--swn-m, 1)); }
    .bk-hw .hero-scene__title { letter-spacing: .28em; }
    .bk-hw .hero-scene__title > span { text-indent: .28em; }
}
/* without motion: a still first screen, then the landing line as a calm block under it */
:root:not(.motion) .bk-hw .stage { height: auto; }
:root:not(.motion) .bk-hw__frame { position: relative; height: var(--stage-h); min-height: 560px; }
:root:not(.motion) .bk-hw .hero-scene__fin { position: relative; inset: auto; opacity: 1; padding-block: var(--bk-y); }
:root:not(.motion) .bk-hw .hero-scene__run { transform: none; white-space: normal; }

/* ======================= hero-simple (inner pages .page-hero) ======================= */
.bk-hs__text { position: relative; z-index: 1; }
.bk-hs__title { max-width: 18ch; text-wrap: balance; }
.page-hero__grid .bk-hs__title { font-size: clamp(2.4rem, 4.8vw, 4.4rem); }
.bk-hs .page-hero__lead { margin-bottom: 0; text-wrap: pretty; }
.bk-hs--center .bk-hs__title { margin-inline: auto; }
.bk-hs--center .bk-acts { justify-content: center; }
.bk-hs__media { max-width: 520px; }
/* not the first section of the page: no header to clear */
.bk-hs:not(:first-child) { padding-top: var(--bk-y); }

/* ======================= rise (home .services-scene) ======================= */
.bk-rise .services-scene__title { font-size: clamp(2rem, 5vw, 4rem); text-wrap: balance; }
.bk-rise__sub { max-width: 40ch; text-wrap: balance; }
.bk-rise__say { text-wrap: balance; }
.bk-rise__pic { position: absolute; z-index: 1; left: 50%; bottom: 5%; width: var(--pw); transform-origin: 50% 100%;
    transform: translate(-50%, calc((1 - var(--a)) * 34%)) scale(calc(.86 + var(--a) * .14)); filter: drop-shadow(0 0 70px rgba(0, 216, 193, .25)); }
.bk-rise { --room: calc(var(--stage-h) - 380px); }
.bk-rise--laptop .bk-rise__pic { --pw: min(860px, 84vw, calc(var(--room) * 1.45)); }
.bk-rise--monitor .bk-rise__pic { --pw: min(760px, 80vw, calc(var(--room) * 1.25)); }
.bk-rise--tablet .bk-rise__pic { --pw: min(640px, 80vw, calc(var(--room) * 1.22)); }
.bk-rise--phone .bk-rise__pic { --pw: min(250px, 50vw, calc(var(--room) * .43)); }
.bk-rise--frame .bk-rise__pic, .bk-rise--none .bk-rise__pic { width: max-content; max-width: min(900px, 88vw); }
.bk-rise--frame .bk-rise__pic img, .bk-rise--none .bk-rise__pic img { width: auto; max-width: 100%; max-height: var(--room); }
/* only a title and a picture: the title stays */
.bk-rise--solo .services-scene__copy { opacity: 1; }
@media (max-width: 760px) {
    .bk-rise { --room: calc(var(--stage-h) - 420px); }
    .bk-rise__pic { bottom: 16%; }
    .bk-rise--laptop .bk-rise__pic, .bk-rise--monitor .bk-rise__pic { --pw: 88vw; }
    .bk-rise--phone .bk-rise__pic { --pw: min(200px, 46vw, calc(var(--room) * .43)); }
}
/* without motion (and without a picture): title, names, then the picture, fully visible */
:root:not(.motion) .bk-rise .stage, .bk-rise--nopic .stage { height: auto; display: flex; flex-direction: column; align-items: center; gap: clamp(28px, 4vw, 48px); padding-block: var(--bk-y); }
:root:not(.motion) .bk-rise .services-scene__copy, .bk-rise--nopic .services-scene__copy { position: static; transform: none; opacity: 1; }
:root:not(.motion) .bk-rise .services-scene__say, .bk-rise--nopic .services-scene__say { position: static; opacity: 1; padding-inline: 20px; }
:root:not(.motion) .bk-rise .services-scene__say span { opacity: 1; }
:root:not(.motion) .bk-rise__pic { position: relative; left: auto; bottom: auto; transform: none; margin-top: clamp(12px, 2vw, 24px); }
:root:not(.motion) .bk-rise .stage::after { display: none; }

/* ======================= deck (home .lead-scene; one item = title + screen + text, in content order) ======================= */
.bk-deck .deck-big > * { font-size: clamp(1.8rem, 5.4vw, 4.6rem); line-height: 1.02; text-wrap: balance; }
.bk-deck .deck .c { overflow: hidden; }
.bk-deck .deck .c img { aspect-ratio: 640 / 420; }
.bk-deck__text { margin: 0; }
.motion .bk-deck > .stage { height: var(--stage-h); }
.motion .bk-deck .deck-big { position: absolute; left: 0; right: 0; top: 5%; height: 2.2em; font-size: clamp(1.8rem, 5.4vw, 4.6rem); overflow: visible; }
.motion .bk-deck .deck-big > * { font-size: 1em; white-space: normal; padding-inline: 20px; text-align: center; align-content: center; }
.motion .bk-deck .deck { position: absolute; left: 0; right: 0; top: 28%; height: 42%; z-index: calc(100 - max(var(--i) - var(--k), var(--k) - var(--i)) * 10); }
.motion .bk-deck .deck-desc { position: absolute; left: 20px; right: 20px; bottom: 3%; height: 24%; }
@media (max-width: 760px) {
    .motion .bk-deck .deck { top: 22%; height: 34%; }
    .motion .bk-deck .deck-desc { height: 38%; }
}
/* without motion: two columns of title, screen, text */
:root:not(.motion) .bk-deck .stage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 32px; padding-block: var(--bk-y); }
/* undo the home scene's fixed three-item reordering (site/pages.css): each item keeps title, screen, text in order */
:root:not(.motion) .bk-deck .deck-big { display: block; }
:root:not(.motion) .bk-deck :is(.deck-big > *, .deck .c, .deck-desc > *) { order: 0; margin-top: 0; }
:root:not(.motion) .bk-deck__item { display: grid; gap: 18px; align-content: start; }
:root:not(.motion) .bk-deck .deck-big > * { font-size: clamp(1.5rem, 3vw, 2.4rem); }
@media (max-width: 760px) { :root:not(.motion) .bk-deck .stage { grid-template-columns: minmax(0, 1fr); } }

/* ======================= number (home .proof) ======================= */
.bk-num__num { margin: 0; font-size: min(clamp(5rem, 19vw, 15rem), calc((100vw - 48px) / (var(--len) * .64))); white-space: nowrap; }
.bk-num__cap { text-transform: uppercase; max-width: 40ch; }
.bk-num--plain { background: radial-gradient(45% 60% at 0% 50%, rgba(0, 167, 149, .24), rgba(0, 167, 149, 0) 70%); }
.bk-num--plain::before, .bk-num--plain::after { display: none; }
