/* ---------- 04 · Wat ik maak — De diensten als bouwstenen ----------
   Four floating islands on a warm peach sky, each carrying its own small world (a browser, a pen with design pieces, a shop,
   a development screen) and a stone sign with the service on it. Everything here is scoped to .bs; nothing global changes.
   The islands are images (assets/img/bouwstenen/eiland-0x.webp, cut out with their signs left blank); the signs' text is
   real HTML laid over the stone, so it stays selectable, translatable and indexable.
   desktop (html.bs-h): the sky is pinned and the islands land one after another from left to right and stay;
   phones and low screens: the islands stack; reduced motion: the finished composition (desktop) or the stack, still. */
.bs { --bs-sky: #F4D3B7; --bs-sky-hi: #F8E2CF; --bs-ink: #18204A; --bs-ink-soft: rgba(24, 32, 74, .86); --bs-orange: #FE6A00; --bs-orange-deep: #C4520A;
  --bs-night: #070A16;
  position: relative; z-index: 4; color: var(--bs-ink); isolation: isolate; overflow-x: clip;
  background: radial-gradient(120% 70% at 50% 35%, var(--bs-sky-hi) 0%, var(--bs-sky) 55%, #EFC6A5 100%); }
.bs *, .bs *::before, .bs *::after { box-sizing: border-box; }
/* the reviews' surface (whatever colour it has at that moment) becomes the peach sky; the sky becomes the night of The Summit */
.bs-in { height: clamp(140px, 26svh, 280px); pointer-events: none; }
/* (when the reviews have darkened, the band starts from that same night and opens up to the services' warm sky) */
.bs-in { position: relative; }
.bs-in::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: calc(var(--to-services, 0) * .9);
  background: linear-gradient(180deg, #070A16 0%, rgba(7, 10, 22, .7) 35%, rgba(7, 10, 22, 0) 100%); }
/* (no colour block of its own: the reviews' surface — with the soft shade at their foot — melts into the sky behind it) */
.bs-in { background: linear-gradient(180deg, rgba(214, 160, 120, .19) 0%, rgba(214, 160, 120, 0) 100%), linear-gradient(180deg, var(--bs-in-top, #EDE3D7) 0%, rgba(244, 211, 183, 0) 100%); }

/* the heading */
.bs-head { position: relative; z-index: 2; display: grid; justify-items: center; gap: 10px; text-align: center; padding: clamp(84px, 11svh, 112px) max(16px, 4vw) 0; }
.bs-head .eyebrow { margin: 0; display: flex; align-items: center; gap: 12px; color: var(--bs-orange-deep); }
.bs-head .eyebrow::before, .bs-head .eyebrow::after { content: ""; width: 28px; height: 2px; background: var(--bs-orange); }
/* towards the portal: the sky darkens to the portal's night behind the islands (--to-portal, 0–1, follows the scroll:
   js/chapters/bouwstenen.js); the islands and their signs stay as they are, the heading turns light with the sky */
.bs-stage { position: relative; isolation: isolate; }
.bs-stage::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #121d52 0%, #0d1438 45%, #070A16 100%); opacity: calc(var(--to-portal, 0) * .92); }
/* the heading swaps from ink to light quickly around the middle, so it never has the sky's own colour */
.bs-head { --bs-light: calc(clamp(0, (var(--to-portal, 0) - .4) * 12, 1) * 100%); }
.bs-title { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(36px, 4vw, 64px); line-height: .98; letter-spacing: -.045em; text-wrap: balance;
  color: color-mix(in srgb, #F2ECE3 var(--bs-light), var(--bs-ink)); }
.bs-title em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; color: var(--bs-orange); }
.bs-intro { margin: 0; max-width: 40em; font-size: clamp(16px, 1.2vw, 19px); line-height: 1.5; text-wrap: balance;
  color: color-mix(in srgb, rgba(233, 223, 210, .86) var(--bs-light), rgba(24, 32, 74, .74)); }

/* ---------- one island ---------- */
.bs-list { list-style: none; margin: 0; padding: 0; }
.bs-isle { position: relative; container-type: inline-size; }
.bs-float { position: relative; }
.bs-isle img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
/* its soft shadow on the "ground" below */
.bs-isle::after { content: ""; position: absolute; z-index: -1; left: 18%; right: 18%; bottom: -7%; height: 9%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(70, 40, 40, .32), rgba(70, 40, 40, 0)); filter: blur(2px); }
/* the stone sign: the text sits where the image's slab is (per island, in % of the image), slightly turned with the stone */
.bs-sign { position: absolute; left: var(--sx); top: var(--sy); width: var(--sw); height: var(--sh); rotate: var(--sr, 0deg);
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1.1cqw; padding: 0 1cqw; }
.bs-n { margin: 0; display: inline-grid; place-items: center; min-width: 2.6em; padding: .16em .55em .12em; border-radius: 999px; background: var(--bs-orange); color: #fff;
  font-family: var(--f-display); font-weight: 800; font-size: max(13px, var(--fn)); line-height: 1; letter-spacing: -.02em;
  box-shadow: 0 .14em 0 #B9470A, 0 .3em .6em rgba(180, 70, 10, .35); }
.bs-isle h3 { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: max(17px, var(--ft)); line-height: .95; letter-spacing: -.02em; text-transform: uppercase;
  color: var(--bs-ink); text-wrap: balance; font-variation-settings: "opsz" 48; }
.bs-isle h3::after { content: ""; display: block; width: 3.2em; height: .09em; min-height: 2px; margin-top: .3em; border-radius: 2px; background: linear-gradient(90deg, var(--bs-orange), rgba(254, 106, 0, .25)); }
.bs-isle p.bs-t { margin: 0; font-size: max(13px, var(--fb)); line-height: 1.28; color: var(--bs-ink-soft); text-wrap: pretty; }
/* type in the island's own width (cqw), so text and stone scale together */
.bs-isle { --fn: 5cqw; --ft: 7.6cqw; --fb: 3.35cqw; }
.bs-isle.is-small { --fn: 6.1cqw; --ft: 8.6cqw; --fb: 3.95cqw; }

/* ---------- desktop: the pinned sky ---------- */
html.bs-h .bs-stage { position: relative; height: 100vh; height: 100svh; overflow: hidden; }
html.bs-h .bs-list { position: absolute; inset: 0; }
html.bs-h .bs-list > li { position: absolute; left: 0; top: 0; }
html.bs-h .bs-isle { visibility: hidden; }
html.bs-h .bs-isle.is-placed { visibility: visible; }
@keyframes bs-float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -4px, 0); } }
html.bs-h .bs-isle.is-landed .bs-float { animation: bs-float 7s ease-in-out infinite; animation-delay: var(--fd, 0s); }
html.bs-h .bs-hint { display: flex; position: absolute; z-index: 2; left: 50%; bottom: max(22px, 4svh); translate: -50% 0; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(24, 32, 74, .5); transition: opacity .4s ease; }
html.bs-h .bs-hint::before { content: ""; width: 1.5px; height: 22px; background: linear-gradient(var(--bs-orange), transparent); }
.bs-hint { display: none; }
@media (prefers-reduced-motion: reduce) { .bs .bs-float { animation: none !important; } }

/* ---------- tablets, small laptops, phones, no JavaScript: the islands in two columns or one ---------- */
html:not(.bs-h) .bs-list { display: grid; gap: clamp(30px, 7vw, 56px); max-width: 560px; margin: 0 auto;
  padding: clamp(36px, 8vw, 60px) max(18px, env(safe-area-inset-right, 0px)) clamp(60px, 12vw, 100px) max(18px, env(safe-area-inset-left, 0px)); }
html:not(.bs-h) .bs-list > li:nth-child(odd) .bs-isle { margin-right: 6%; }
html:not(.bs-h) .bs-list > li:nth-child(even) .bs-isle { margin-left: 6%; }
html.bs-js:not(.bs-h):not(.reduced) .bs-isle.is-pre { opacity: 0; transform: translate3d(var(--px, 30px), 22px, 0) scale(.92) rotate(var(--pr, 2deg)); }
html.bs-js:not(.bs-h) .bs-isle { transition: opacity .6s ease, transform .9s cubic-bezier(.3, 1.35, .55, 1); }
/* on a phone the text gets a little more room than the art gives it */
@media (max-width: 899px) {
  .bs-head { padding-top: clamp(76px, 11svh, 100px); }
  .bs-isle, .bs-isle.is-small { --fn: 5.6cqw; --ft: 8.2cqw; --fb: 3.9cqw; }
  .bs-isle.is-small { --ft: 9cqw; --fb: 4.3cqw; }
}
/* short desktop screens: a more compact heading, so the islands keep their size */
@media (min-width: 1200px) and (max-height: 820px) {
  .bs-head { gap: 6px; padding-top: 86px; }
  .bs-title { font-size: clamp(32px, 3.2vw, 46px); }
  .bs-intro { font-size: 15.5px; }
}
@media (min-width: 760px) {
  html:not(.bs-h) .bs-list { grid-template-columns: 1fr 1fr; max-width: 1080px; gap: 24px clamp(28px, 5vw, 64px); align-items: start; }
  html:not(.bs-h) .bs-list > li:nth-child(odd) .bs-isle, html:not(.bs-h) .bs-list > li:nth-child(even) .bs-isle { margin: 0; }
  html:not(.bs-h) .bs-list > li:nth-child(even) { margin-top: clamp(40px, 9vw, 110px); }
}

/* ---------- phones (< 760px): the four islands in a 2 × 2 grid (01 · 02 / 03 · 04) ----------
   The stones scale with their column; number and title stay on the stone, sized in the island's own width so they always fit
   the slab. The short description would be too small on a stone this size, so js/chapters/bouwstenen.js moves it right under
   its island (html.bs-cap); without JavaScript the single column above stays as it was. */
@media (max-width: 759px) {
  html.bs-cap:not(.bs-h) .bs-list { grid-template-columns: 1fr 1fr; gap: clamp(26px, 7vw, 34px) clamp(12px, 3.6vw, 18px); max-width: 560px;
    padding: clamp(28px, 7vw, 44px) max(16px, env(safe-area-inset-right, 0px)) clamp(52px, 12vw, 80px) max(16px, env(safe-area-inset-left, 0px)); align-items: start; }
  html.bs-cap:not(.bs-h) .bs-list > li:nth-child(n) .bs-isle { margin: 0; }
  html.bs-cap .bs-isle, html.bs-cap .bs-isle.is-small { --fn: 6.2cqw; --ft: 7.3cqw; }
  html.bs-cap .bs-sign { gap: 2.2cqw; }
  html.bs-cap .bs-n { font-size: max(10px, var(--fn)); }
  html.bs-cap .bs-isle h3 { font-size: var(--ft); }
  html.bs-cap .bs-isle h3::after { margin-top: .35em; }
  /* the island's soft shadow stays under the island itself, not under its description */
  html.bs-cap .bs-isle::after { content: none; }
  html.bs-cap .bs-float::after { content: ""; position: absolute; z-index: -1; left: 18%; right: 18%; bottom: -7%; height: 9%; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(70, 40, 40, .32), rgba(70, 40, 40, 0)); filter: blur(2px); }
  html.bs-cap .bs-cap { padding: 0 2px; margin-top: clamp(14px, 4vw, 20px); }
  html.bs-cap .bs-cap p.bs-t { font-size: clamp(12.5px, 3.4vw, 14px); line-height: 1.42; }
  /* each row lands together: the left stone from the left, the right one a beat later from the right */
  html.bs-cap:not(.bs-h) .bs-list > li:nth-child(even) .bs-isle { transition-delay: .12s; }
}
