﻿/* ==========================================================================
   R2 composition layer â€” VR-DESIGN-B-R2-COMPOSITION-MOTION-REV2 Â§4â€“Â§7, Â§11
   --------------------------------------------------------------------------
   Loaded after design-b.css and split-pill.css. Everything here is either a
   measured value, or a value the work order specifies that measurement could
   not contradict. Where the order and the live reference disagree, the comment
   says so and names the file holding the evidence.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Â§4.1 colour tokens the composition layer relies on
   The build's existing palette is reused; only the navigation band value is
   new, because R1 had no band.
   -------------------------------------------------------------------------- */
:root {
  --b-nav-band: var(--p-nav-band, #FFFFFF);
  --b-nav-inset-top: 10px;
  --b-nav-inset-side: 12px;
  --b-nav-height: 80px;
  --b-nav-radius: 14px;
  --b-display-tight: 0.9;
}

/* --------------------------------------------------------------------------
   Â§6 Global navigation â€” an inset colour field, not a full-bleed bar
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  z-index: 100;
  top: var(--b-nav-inset-top);
  height: var(--b-nav-height);
  margin: var(--b-nav-inset-top) var(--b-nav-inset-side) 0;
  border: 0;
  border-radius: var(--b-nav-radius);
  background: var(--b-nav-band);
  backdrop-filter: none;
}

.site-header__inner {
  display: flex;
  height: 100%;
  min-height: 0;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  width: 100%;
  max-width: none;
  margin: 0;
  padding-inline: clamp(20px, 2.8vw, 40px);
}

.site-brand {
  width: clamp(146px, 17.36vw, 250px);
  flex: 0 0 auto;
}

.primary-nav {
  margin-left: auto;
}

.primary-nav__list {
  gap: clamp(24px, 2.4vw, 32px);
}

.primary-nav__list a {
  padding-block: 6px;
  /*
   * R6 §5 assigns navigation TYPOGRAPHY to r3-nav.css and this file to
   * section spacing/layout. The type declarations moved there rather than
   * being stacked on top of these; only layout remains here.
   */
  letter-spacing: 0;
}

.header-cta {
  display: none;
}

.site-header__cta {
  flex: 0 0 auto;
}

.site-header__cta > span {
  min-height: 40px;
}

.site-header__cta .btn__txt {
  padding: 0 15px;
  font-size: 0.875rem;
  font-weight: 600;
}

.site-header__cta .btn__icon {
  width: 40px;
  flex-basis: 40px;
}

@media (max-width: 1023px) {
  .site-header__cta {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Â§5 Homepage hero â€” the headline owns the viewport
   -------------------------------------------------------------------------- */

/*
 * Reference for the three targets below: Â§5.1 / Â§16 require the visible ink of
 * line 1 to reach 80â€“85vw, line 2 76â€“82vw, line 3 38â€“48vw at 1440Ã—900, in
 * exactly three lines, at weight 900, uppercase, 0.90 leading.
 *
 * A single font-size cannot satisfy three different target widths, because the
 * lines have different character counts (15 / 13 / 9). Each line is therefore
 * its own block with its own size, which the order explicitly permits:
 * "The exact line widths are more important than blindly retaining the initial
 * font-size value." This is per-line font-size, NOT a transform, so no
 * horizontal font scaling takes place.
 */
.b-hero--home {
  padding: clamp(56px, 5.6vw, 92px) 0 clamp(28px, 3vw, 48px);
}

.b-hero--home .b-hero__copy {
  max-width: none;
}

.b-hero--home .b-eyebrow {
  margin-bottom: clamp(18px, 1.6vw, 26px);
}

.b-home-title {
  margin: 0;
  font-family: var(--b-font-display);
  font-size: clamp(2.6rem, 8.9vw, 8.75rem);
  font-weight: 900;
  font-synthesis-weight: none;
  letter-spacing: -0.03em;
  line-height: var(--b-display-tight);
  text-transform: uppercase;
}

/*
 * `design-b.css` pins `.b-page h1` to weight 700 (specificity 0,1,1). The
 * monumental setting needs 900, so the override has to be at least as specific
 * rather than relying on source order alone.
 */
.b-page .b-home-title,
.b-hero .b-home-title {
  font-weight: 900;
}

/*
 * Each line shrinks to its ink. Without `width: fit-content` the block-level
 * span fills the column and the measured width is the container, not the
 * headline â€” which is exactly the number the acceptance gate needs.
 */
.b-hero-title__line {
  display: block;
  width: fit-content;
  margin-inline: auto;
  white-space: nowrap;
}

/*
 * R8 §1 — the per-line sizes are removed.
 *
 * These clamps made each line span a different size from its h1 (134.4 / 130.4
 * / 128.8 at 1920 against an h1 of 96), inflating the rendered glyphs by about
 * 1.37x and the block to 374px where the reference is 273.6px.
 *
 * They were introduced in R2 to hit a hero line-width target that no longer
 * applies: the R6 matrix now owns the h1 size and the R8 order makes the line
 * spans inherit it. The 0.95 line box lives in r3-type.css.
 *
 * NOTE (R9): this block previously left an orphaned declaration set behind -
 * the `.b-home-title .b-hinge` selector line was consumed by the edit while its
 * three declarations and closing brace survived. That produced invalid CSS and
 * Chrome discarded the following rule as error recovery, which is why the R9
 * underline-retirement rule appeared to be served but was not applied. The
 * orphan is gone and the region parses cleanly.
 */

/*
 * R9 §3 — the hero underline is retired.
 *
 * `RIGHT` now carries the hand-drawn loop instead. The `::after` pseudo-element
 * is switched off and the old external stroke no longer loads for the hero, so
 * only one marker can ever be visible. Section-level `.b-hinge` words keep their
 * underline untouched — this is scoped to `.b-home-title`.
 */
.b-home-title .b-hinge::after {
  content: none;
  background: none;
}

.b-home-title .b-hinge__stroke {
  display: none;
}

/* Â§5.2 vertical rhythm: the subtitle and both actions stay above the fold. */
.b-hero--home .b-lead {
  /*
   * R6 §7.3: at 26px a 62ch measure runs to ~77 characters per line, past the
   * 45-70 target. The base .b-lead measure (56ch) resolves to ~70, so the
   * home override simply stops widening it.
   */
  max-width: 56ch;
  margin: clamp(20px, 2vw, 30px) auto 0;
}

.b-hero--home .b-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: clamp(24px, 2.4vw, 34px);
}

.b-hero--home .b-hero__note {
  margin: 14px 0 0;
  color: var(--b-text-muted);
  font-size: 0.9375rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Â§7 Homepage collage â€” rotated at rest, straightens on hover
   --------------------------------------------------------------------------
   Mechanism measured on www.loomdigital.co.uk
   (evidence/measurements/loom-r2/loom-collage.json, loom-collage-geometry.json):

     frame  .diamond-links__item-img   rotate(45deg) scale(1.1), radius 30px,
                                       overflow hidden
     image  img inside                 rotate(-45deg) scale(1.37)
     hover  frame -> rotate(0) scale(1.1); image -> matrix(1.5, 0, 0, 1.5, 0, 0)
     tween  transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1)

   So the silhouette at rest is a rounded DIAMOND, and hovering straightens it
   to a rounded SQUARE while the image resolves to exactly 1.5 scale with zero
   rotation. That hover target is reproduced exactly.

   Deviation, recorded: addendum Â§3 reports the resting image at "roughly 8
   degrees at roughly 1.477 scale" and says the wrapper is `transform: none`
   throughout. The live page's settled rest state is âˆ’45Â° / 1.37 inside a +45Â° /
   1.1 frame (net upright, net 1.507). The 8Â° / 1.477 pair matches a frame
   captured mid-transition (my own 125 ms sample reads âˆ’11.9Â° at 1.466, and the
   314 ms sample âˆ’2.3Â° at 1.493), which is why the two readings differ. The
   mechanism below is the measured one; the underlying point â€” rotated at rest,
   upright and 1.5 on hover â€” is identical either way.
   -------------------------------------------------------------------------- */
.b-collage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: min(100%, 1264px);
  margin: clamp(34px, 4vw, 58px) auto 0;
  padding-block: clamp(18px, 3vw, 46px);
}

.b-collage__tile {
  position: relative;
  flex: 0 0 auto;
  margin-inline: clamp(-34px, -2.6vw, -22px);
}

.b-collage__tile:nth-child(1) {
  z-index: 1;
}

.b-collage__tile:nth-child(2) {
  z-index: 3;
}

.b-collage__tile:nth-child(3) {
  z-index: 2;
}

.b-collage__frame {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: transparent;
  transform: none;
}

.b-collage__tile--centre .b-collage__frame {
  transform: none;
}

.b-collage__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
}

.b-collage__tile--centre .b-collage__frame img {
  transform: none;
}

.b-collage__tile:hover .b-collage__frame,
.b-collage__tile:focus-within .b-collage__frame {
  transform: none;
}

.b-collage__tile:hover .b-collage__frame img,
.b-collage__tile:focus-within .b-collage__frame img {
  transform: none;
}

/* Tiles are links to the real service routes; the whole tile is the target. */
.b-collage__link {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: 30px;
  text-decoration: none;
}

.b-collage__link:focus-visible {
  outline: 3px solid var(--b-focus);
  outline-offset: 4px;
}

/*
 * Text overlays. They sit OUTSIDE the rotated frame so the label stays
 * horizontal while the artwork turns â€” which is what the reference does: the
 * diamond turns, the type does not.
 */
.b-collage__label {
  position: absolute;
  z-index: 5;
  bottom: 8%;
  left: 50%;
  width: 88%;
  padding: 12px 16px;
  transform: translateX(-50%);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(4, 22, 25, 0) 0%, rgba(4, 22, 25, 0.82) 62%);
  color: var(--b-text-inverse);
  text-align: center;
  pointer-events: none;
}

.b-collage__label-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--p-accent-on-dark);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.b-collage__label-title {
  display: block;
  font-family: var(--b-font-display);
  font-size: clamp(1.35rem, 1.9vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Per-tile sizes, chosen so the three silhouettes overlap by ~60px while the
   centre tile visibly sits above both. */
.b-collage__tile--left {
  --b-tile-size: clamp(210px, 23.6vw, 336px);
  margin-top: 26px;
}

.b-collage__tile--centre {
  --b-tile-size: clamp(240px, 26.6vw, 380px);
  margin-top: -18px;
}

.b-collage__tile--right {
  --b-tile-size: clamp(210px, 23.6vw, 336px);
  margin-top: 26px;
}

/* --------------------------------------------------------------------------
   Inner-page display type — base weight correction only.

   R6 §9.2 supersedes the per-route sizes, weights and leading that used to be
   declared here. §5 assigns editorial type roles and H1 route modifiers to
   r3-type.css, and the measured H1 matrix is implemented there against the same
   selectors. Keeping a second owner for the same properties is exactly the
   cascade fault this pass exists to remove, so the route blocks are gone and
   only the base display weight remains.
   -------------------------------------------------------------------------- */
.b-page h1.b-display {
  font-weight: 800;
  letter-spacing: normal;
}

.b-capability {
  padding-block: clamp(26px, 2.8vw, 40px);
  border-block: 1px solid var(--p-line, var(--b-border));
  background: var(--p-pale, #F4F4F6);
}

.b-capability__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px clamp(24px, 4vw, 64px);
}

.b-capability__label {
  margin: 0;
  color: var(--b-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.b-capability__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px clamp(20px, 3vw, 46px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.b-capability__list li {
  position: relative;
  margin: 0;
  padding: 0 0 0 14px;
  color: var(--b-ink);
  font-family: var(--b-font-display);
  font-size: clamp(1.05rem, 1.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* Every item carries the marker flush inside the item's left edge. */
.b-capability__list li::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 4px;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--b-focus);
  content: "";
}
/* --------------------------------------------------------------------------
   R7 — floating contact capsule
   --------------------------------------------------------------------------
   Rebuilt to the reference's measured anatomy. The owner's brief: the reference
   "looks so defined and properly spaced out", ours did not.

   The reference, measured live:

     group      property            desktop     1280    1024/768  390/375
     capsule    height              98px        98px    94px      68px
                max-width           588px       588px   588px     92vw
                gap                 30px        10px    10px      13px
                padding             0 21px      0 21px  0 21px    0 10px 0 15px
                offset r/b          30/30       30/30   30/30     15/15
                radius              999px
                fill                dark @ ~0.8 alpha + blur(10px)
                shadow              none
     avatar     outer               86px        86px    82px      56px
                image               80px        80px    76px      52px
                ring                3px pale, margin-left -15px
     identity   name                20/30 700
                role                16/24 400
     button     height              60px        60px    60px      46px
                label               20/20 400, padding 21/20/19
                icon half           60×60       60×60   60×60     46×46

   What changed from R2's capsule: it was a 390×80.5 two-line toast with a 14px
   gap, a 46px button, an 18px/44px shadow and no identity object — and it was
   `display: none` below 768px, which the owner noticed first.

   Content is the honest substitution, not the reference's:
     avatar  -> the Visibility Ridge ridge mark, decorative
     name    -> "SEO REVIEW"
     role    -> "A practical next step"
     action  -> "Request a review" -> /contact/?intent=review

   No person, photograph, role title, Calendly URL, Loom colour or Loom asset.

   Motion is untouched: the wrapper keeps
   `transform 0.5s cubic-bezier(0.76, 0.09, 0.215, 1)` and the inner split-pill
   keeps its own 0.25s/0.6s pair. Two animations, never collapsed.
   -------------------------------------------------------------------------- */

:root {
  --r7-cap-height: 74px;
  --r7-cap-gap: 18px;
  --r7-cap-pad: 0 14px 0 18px;
  --r7-cap-offset: 24px;
  --r7-cap-max: 480px;
  --r7-av-outer: 62px;
  --r7-av-image: 58px;
}

.b-capsule {
  position: fixed;
  z-index: 90;
  right: var(--r7-cap-offset);
  bottom: var(--r7-cap-offset);
  display: flex;
  width: auto;
  max-width: min(var(--r7-cap-max), calc(100vw - (2 * var(--r7-cap-offset))));
  height: var(--r7-cap-height);
  align-items: center;
  gap: var(--r7-cap-gap);
  padding: var(--r7-cap-pad);
  border-radius: 1000px;
  /*
   * Surface token fill with backdrop blur in Visibility Ridge's dark surface.
   */
  background: color-mix(in srgb, var(--p-dark) 80%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  /* No shadow: definition comes from the fill and the silhouette. */
  box-shadow: none;
  color: var(--r3-on-dark, #F8F8F2);
  visibility: visible;
  transform: translateY(0);
  transition:
    transform 0.5s cubic-bezier(0.76, 0.09, 0.215, 1),
    opacity 0.5s cubic-bezier(0.76, 0.09, 0.215, 1),
    visibility 0s linear 0s;
}

/* Hidden at the top of the page; slides in past the hero and out near the
   footer so it never covers it. Delays visibility collapse until the 0.5s
   exit slide completes so keyboard Tab never hits the hidden link. */
.b-capsule[data-b-state="hidden"] {
  transform: translateY(calc(100% + 40px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.5s cubic-bezier(0.76, 0.09, 0.215, 1),
    opacity 0.5s cubic-bezier(0.76, 0.09, 0.215, 1),
    visibility 0s linear 0.5s;
}

body.b-footer-reveal-starting .b-capsule,
body.b-services-reveal-active .b-capsule {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---- the circular identity object ------------------------------------- */

.b-capsule__mark {
  position: relative;
  display: grid;
  flex: 0 0 var(--r7-av-outer);
  width: var(--r7-av-outer);
  height: var(--r7-av-outer);
  margin-left: -12px;
  place-items: center;
  border-radius: 50%;
  /*
   * 3px pale ring, as measured. Rendered as a padded circle rather than a
   * border so the ring is part of the 86px outer box and the 80px image sits
   * exactly inside it.
   */
  background: var(--p-pale);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.b-capsule__avatar {
  display: block;
  width: var(--r7-av-image);
  height: var(--r7-av-image);
  border-radius: 50%;
  background-color: var(--p-dark);
  background-image: url('../images/inner-pages/fahim-capsule-avatar.jpg');
  background-image: image-set(
    url('../images/inner-pages/fahim-capsule-avatar.webp') type('image/webp'),
    url('../images/inner-pages/fahim-capsule-avatar.jpg') type('image/jpeg')
  );
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: none;
  mix-blend-mode: normal;
}

.b-capsule__avatar-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 50%;
  background: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* ---- the two-line identity block -------------------------------------- */

.b-capsule__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.b-capsule__name {
  display: block;
  margin: 0;
  color: inherit;
  font-family: var(--b-font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 21px;
  white-space: nowrap;
}

.b-capsule__role {
  display: block;
  margin: 0;
  color: inherit;
  font-family: var(--b-font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 17px;
  white-space: nowrap;
  opacity: 0.92;
}

/*
 * The short role line exists only for phones. "A practical next step" measures
 * 125px at 13px, which does not fit the identity slot beside a full-width
 * button on a 390px capsule; "Next step" measures 58px and keeps the two-line
 * identity rhythm the order asks for (§4: shorten only within the existing
 * claim, and record it).
 */
.b-capsule__role--short {
  display: none;
}

/* ---- the action -------------------------------------------------------- */

/*
 * The button is the shared split-pill at its standard size. R2 gave the capsule
 * a private 46px/14px variant; that is the duplication this pass removes, so
 * there are no capsule-specific dimension overrides here at all. It is pushed
 * right by `margin-left: auto` and must never be squeezed — a compressed pill
 * breaks the radius geometry.
 */
.b-capsule .btn {
  flex: 0 0 auto;
  margin-left: auto;
}

.b-capsule .btn:focus-visible {
  outline: 3px solid var(--btn-focus, var(--p-focus));
  outline-offset: 3px;
}

@media (min-width: 671px) {
  .b-capsule .btn > span {
    min-height: 44px;
  }

  .b-capsule .btn__txt {
    padding: 0 16px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1;
  }

  .b-capsule .btn__icon {
    width: 44px;
    flex-basis: 44px;
  }
}

/* ---- desktop steps ----------------------------------------------------- */

@media (max-width: 1440px) {
  :root {
    --r7-cap-gap: 18px;
  }
}

/* 1280 tightens the gap to 12px. */
@media (max-width: 1280px) {
  :root {
    --r7-cap-gap: 12px;
  }
}

/* 1024 and 768: 70px high, 58px avatar outer, 54px image. */
@media (max-width: 1024px) {
  :root {
    --r7-cap-height: 70px;
    --r7-cap-gap: 12px;
    --r7-av-outer: 58px;
    --r7-av-image: 54px;
  }
}

/*
 * 670 and below: 60px high, 10px gap, 0 9px 0 13px, 48px avatar, 44px image,
 * 40px button, 14px offsets.
 */
@media (max-width: 670px) {
  :root {
    --r7-cap-height: 60px;
    --r7-cap-gap: 10px;
    --r7-cap-pad: 0 9px 0 13px;
    --r7-cap-offset: 14px;
    --r7-av-outer: 48px;
    --r7-av-image: 44px;
  }

  .b-capsule {
    max-width: min(92vw, calc(100vw - 28px));
  }

  .b-capsule__mark {
    margin-left: -7px;
  }

  /*
   * Phone name size — 13px, from the RAW reference stylesheet, not the order.
   *
   * The order's phone row says "Name 16px". The raw CSS says otherwise: the
   * reference sets `--text-tiny: 0.8125rem` (13px) below 670px and its name line
   * consumes that token, so its phone name computes to 13px.
   *
   * That also resolves the arithmetic. At 16px the name needs 96px, and
   * 56 avatar + 96 name + 156.5 button + 26 gaps + 25 padding = 359.5px, which
   * cannot fit a 345px capsule at 375. At 13px it needs 78px and the bar fits.
   *
   * Per the standing rule (raw files beat the report), 13px wins.
   *
   * NOTE: CSS comments do not nest. This block must not contain a second
   * comment opener, or the first closer would end it early and leak the rest as
   * declarations.
   */
  .b-capsule__name {
    font-size: 13px;
    line-height: 20px;
  }

  /*
   * The label's own padding is reduced on phones only for this component, by
   * 4px per side. That is enough to return 8px to the identity column at 375
   * without changing the button's height, its radii, its animation or its
   * hit target — the geometry the split-pill gate measures is untouched.
   */

  /*
   * Phone identity block. The long role line is swapped for the short one here
   * rather than truncated with overflow:hidden — the order forbids letting the
   * text collapse, and a clipped ellipsis would read as a rendering fault.
   */
  .b-capsule__role {
    display: none;
  }

  .b-capsule__role--short {
    display: block;
    font-size: 13px;
    line-height: 18px;
  }

  /* The button keeps the component's own 46px phone step; it only gives up the
     label-glide slack so the identity block keeps a readable column. */
  .b-capsule .btn > span {
    min-height: 40px;
  }

  .b-capsule .btn__txt {
    padding-inline: 11px;
    font-size: 0.82rem;
  }

  .b-capsule .btn__icon {
    width: 40px;
    flex-basis: 40px;
  }

  .b-capsule .b-capsule__copy {
    flex: 1 1 auto;
  }
}

/*
 * The last guard the reference also has: below 360px there is no room for a
 * three-group bar, so it is hidden rather than crushed.
 */
@media (max-width: 359px) {
  .b-capsule {
    display: none;
  }
}

/* Reduced motion: no slide, no morph beyond what the split-pill already does. */
@media (prefers-reduced-motion: reduce) {
  .b-capsule {
    transition-duration: 0.01ms;
  }
}


/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .site-header {
    --b-nav-height: 72px;
  }

  .b-hero-title__line {
    white-space: normal;
  /* R8 §1 — line spans inherit the h1 size; only wrapping changes here. */
  .b-hero-title__line {
    white-space: normal;
  }
  }
}

@media (max-width: 767px) {
  .site-header {
    --b-nav-inset-top: 8px;
    --b-nav-inset-side: 8px;
    --b-nav-height: 56px;
    --b-nav-radius: 10px;
  }

  .site-header__inner {
    padding-inline: 16px;
  }

  .site-brand {
    width: clamp(160px, 47vw, 185px);
  }

  .b-hero--home {
    padding-top: 40px;
  }

  .b-home-title {
    letter-spacing: -0.025em;
  }

/*
 * R8 §1 — tablet and phone line sizes also removed.
 *
 * Same reason as the desktop block above: these clamps overrode the h1 matrix
 * on the child spans, so the glyphs rendered at 68.35px at 768 against an h1 of
 * 49.92, and 35.88/41.34px at 390 against an h1 of 30.
 *
 * The line spans now inherit. `white-space: normal` is retained below 1024 so
 * the three lines can still wrap inside the column instead of overflowing.
 */
  /* Mobile collage: centre tile first, the rest stacked. No tiny three-up. */
  .b-collage {
    flex-direction: column;
    gap: 18px;
    margin-top: 26px;
    padding-block: 0;
  }

  .b-collage__tile {
    width: min(100%, 340px);
    margin-inline: 0;
  }

  .b-collage__tile--centre {
    order: -1;
    margin-top: 0;
  }

  .b-collage__tile--left,
  .b-collage__tile--right {
    margin-top: 0;
  }

  .b-collage__tile--left,
  .b-collage__tile--centre,
  .b-collage__tile--right {
    --b-tile-size: min(74vw, 300px);
  }

  .b-collage__label-title {
    font-size: 1.35rem;
  }

  .b-capability__inner {
    display: block;
  }

  .b-capability__label {
    margin-bottom: 12px;
  }
}

/* The capsule must never cover the contact form. */
.b-page--contact .b-capsule,
.b-page--contact .b-capsule[data-b-state="shown"] {
  display: none;
}

.b-mid6-stories__cta {
  margin: 24px 0 0;
}

.b-services-geo {
  margin-top: clamp(34px, 4vw, 54px);
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid rgba(15, 16, 20, 0.12);
  background: var(--p-cream, #F4F4F6);
}

.b-services-geo__head .b-eyebrow {
  margin: 0 0 10px;
}

.b-services-geo__title {
  margin: 0 0 12px;
  color: var(--p-ink, #0F1014);
  font-family: var(--b-font-display);
  font-size: clamp(1.38rem, 2.05vw, 1.85rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 34ch;
}

.b-services-geo__head > p:last-child {
  margin: 0;
  max-width: 68ch;
  color: var(--p-on-pale-muted, #4E515C);
  font-size: 0.98rem;
  line-height: 1.62;
}

.b-services-geo__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(15, 16, 20, 0.12);
}

.b-services-geo__list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px 4px 0;
  padding-left: 16px;
  border-right: 1px solid rgba(15, 16, 20, 0.12);
}

.b-services-geo__list li:first-child {
  padding-left: 0;
}

.b-services-geo__list li:last-child {
  border-right: 0;
  padding-right: 0;
}

.b-services-geo__list strong {
  color: var(--p-ink, #0F1014);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.3;
}

.b-services-geo__list span {
  color: var(--p-on-pale-muted, #4E515C);
  font-size: 0.82rem;
  line-height: 1.48;
}

@media (max-width: 960px) {
  .b-services-geo__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .b-services-geo__list li:nth-child(2n) {
    border-right: 0;
    padding-right: 0;
  }

  .b-services-geo__list li:nth-child(odd) {
    padding-left: 0;
  }

  .b-services-geo__list li:nth-child(-n+2) {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(15, 16, 20, 0.12);
  }
}

@media (max-width: 560px) {
  .b-services-geo__list {
    grid-template-columns: 1fr;
  }

  .b-services-geo__list li {
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(15, 16, 20, 0.12);
  }

  .b-services-geo__list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
}

/* Diagnostic Ticket Card inside Services > Inside a Diagnostic */
.b-diag-ticket {
  min-width: 0;
  max-width: 100%;
  background: #FBF9F6;
  border: 1px solid rgba(15, 16, 20, 0.14);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(15, 16, 20, 0.06);
}

.b-diag-ticket__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(15, 16, 20, 0.025);
  border-bottom: 1px solid rgba(15, 16, 20, 0.10);
}

.b-diag-ticket__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0F1014;
}

.b-diag-ticket__dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--p-accent, #D9381E);
  box-shadow: 0 0 0 3px rgba(217, 56, 30, 0.16);
}

.b-diag-ticket__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--p-on-pale-muted, #4E515C);
}

.b-diag-ticket__steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.b-diag-ticket__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(15, 16, 20, 0.09);
}

.b-diag-ticket__row--action {
  background: rgba(217, 56, 30, 0.045);
}

.b-diag-ticket__step {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--p-accent, #D9381E);
}

.b-diag-ticket__text {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.5;
  color: #3A3D46;
}

.b-diag-ticket__text strong {
  color: #0F1014;
  font-weight: 700;
}

.b-diag-ticket__text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(15, 16, 20, 0.07);
  color: #0F1014;
}

.b-diag-ticket__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #5A5E6A;
  background: rgba(15, 16, 20, 0.02);
}

@media (max-width: 640px) {
  .b-diag-ticket__head,
  .b-diag-ticket__foot {
    padding: 12px 16px;
  }

  .b-diag-ticket__row {
    padding: 14px 16px;
  }

  .b-diag-ticket__text {
    font-size: 0.88rem;
  }
}
