/* Builder: the styles, all inside #builder.
   The builder is work/lumi/builder.js and builder.css, whole: the same controls, the same behaviour.
   This file takes its grey off, inside #builder only: the builder's own page colour (--color-bg) reads
   #f5f5f5 and its stage and look tiles are #ececec cards, while the case study is white. Go Pro keeps its card.
   FULL BLEED, AS THE ENDING: the section spans the row and keeps the Ending's side air (--g, counted
   from the section's own width). Type sizes stay counts of --u, so they match the sections above.
   Nothing here crops, masks or clips Lumi or its glow. */
#builder {
  .b8 {
    --hh: clamp(40rem, 100svh, 54rem); --fh: 60; --u: min(1cqw, calc(var(--hh) / var(--fh)));
    --g: var(--cs-side);                    /* the Ending's side air (page.css) */
    --title: 6.72;                          /* the size of the sections above; under the hero's title (7.19) */
    --body: 2;                              /* the lead, as Rulebook's */
    box-sizing: border-box;
    display: grid; grid-template-columns: minmax(0, 1fr);
    padding-inline: var(--g);
    color: var(--neutral-950);
    scroll-margin-top: var(--section-padding);
  }
  .b8-title {
    margin: 0; max-width: 60%;
    font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: calc(var(--title) * var(--u)); line-height: var(--line-display); letter-spacing: var(--display-tight);
    text-wrap: balance;
  }
  .b8-lead {
    margin: calc(var(--body) * var(--u) * 0.8) 0 0; max-width: 60%;
    font-size: calc(var(--body) * var(--u)); font-weight: var(--weight-medium); line-height: var(--line-snug);
    color: var(--neutral-600); text-wrap: pretty;
  }
  /* Heading centred over the builder */
  .b8 :is(.b8-title, .b8-lead) { justify-self: center; text-align: center; }

  .b8-stage { margin-top: calc(5 * var(--u)); min-width: 0; }

  /* ---- THE BUILDER ON WHITE: the section's ground shows through, so Lumi sits on the page ---- */
  /* Its own page colour is the page's white. Lumi pins under the site's fixed header (page.js publishes
     its height), never behind it: on a phone the header covered the top of the pinned Lumi (25 Nov 2026). */
  .lbd { --color-bg: var(--color-surface); --lbd-pin-top: var(--site-head-h, 0px); background: none; }
  /* Lumi sits centred beside the controls, so no gap shows under it (his pick, 25 Nov 2026: "fill
     the height in that area a bit better", option 3 of four). */
  .lbd-in { padding-inline: 0; align-items: center; }
  /* Lumi's square grows to its column, up to about three quarters of the screen, so the whole tool
     (Lumi, every control, Go Pro shut) still fits in one view on a computer. */
  .lbd-stage { width: min(100%, 78svh); margin-inline: auto; background: none; }   /* lint-ok: Lumi's cap, measured at 1280, 1440 and 1920 wide */
  /* Look tiles: no plate; the picked one keeps its outline (work/lumi/builder.css) */
  .lbd-look { background: none; }
  /* Go Pro: the builder's grey card with no lines (his note, 25 Nov 2026), its icon on a white disc */
  .lbd-pro-box .lbd-pro-head { padding-inline: var(--space-500); border-radius: var(--radius-xl); }
  .lbd-pro-box > .lbd-pro-panel { padding-inline: var(--space-500); }
  .lbd-pro-box .lbd-pro-ic { background: var(--color-surface); box-shadow: none; }

  /* ---- PHONE: the phone's unit and sizes (Rulebook's). The builder runs the row's full width so
     its own phone layout (Lumi pinned on top) has room; its pinned bar is the page's white. ---- */
  @container row (max-width: 1000px) {
    .b8 { --hh: clamp(48rem, 122svh, 76rem); --fh: 230; --title: 12; --body: 4.27; }
    .b8-title, .b8-lead { max-width: none; }
    /* 100cqw is the row itself (a % inside a margin reads the stage's own parent) */
    .b8-stage { margin-top: calc(8 * var(--u)); margin-inline: calc((100% - 100cqw) / 2); }
    .lbd-in { padding-inline: var(--g); }
    .lbd-stage { width: 100%; }
  }
}

/* The whole page fade (case/trip.js): on a phone the pinned view paints the page's ground, fixed to the
   screen as the page's is, and Have a play's tints while they show, so it never shows an edge. */
@container (max-width: 640px) { /* lint-ok: the builder's own phone width (builder.css) */
  html[data-cs-fade="page"] #builder .lbd-view { background-color: var(--cs-g); background-attachment: fixed; }
  html[data-cs-fade="page"][data-cs-wash] #builder .lbd-view { animation: pp-shift 24s linear infinite; background-image: var(--cs-tints); } /* lint-ok: Have a play's own drift timing (play.css) */
}
