/* ==========================================================================
   R3 Ã¢â‚¬â€ measured typography correction
   Work order: VR-DESIGN-B-R3-MEASURED-FIDELITY-20261107 Ã‚Â§4
   --------------------------------------------------------------------------
   Every value below is measured, and the measurement is in the repo:

     evidence/measurements/r3/loom-type-cascade.json   computed type, 7 viewports
     evidence/measurements/r3/loom-h1-cascade-proof.json  the winning declarations
     evidence/measurements/r3/loom-h1-lines.json       line widths at 1920/1440
     evidence/measurements/r3/type-r3-before.json      Design B before this file
     evidence/measurements/r3/type-r3-after.json       Design B after this file
     docs/R3-STAGE-0-TYPE-CASCADE.md                   the cascade resolution

   The reference, live and computed:

     h1  96px  @1920   / 57.6px  = 0.60    weight 800  tracking normal  uppercase
     h2  72px  @1920   / 43.2px  = 0.60
     h3  62px  @1920   / 37.2px  = 0.60

   Design B before this file: h1 136px at ratio 0.92, weight 900, tracking -0.04em;
   h2 ratio 1.06 weight 700 sentence case; h3 ratio 1.12 weight 700 sentence case.
   ========================================================================== */

:root {
  /*
   * ---- display leading ----------------------------------------------------
   * The single number that separates the reference from R2. Not a suggestion:
   * Ã‚Â§4.1 makes 0.60 Ã‚Â±0.01 the primary typography gate.
   */
  --r3-leading-display: 0.6;

  /* ---- display weight, tracking, case ------------------------------------ */
  --r3-weight-display: 800;
  --r3-tracking-display: normal;

  /*
   * ---- the h1 mechanism ---------------------------------------------------
   * Loom's win over `--h1` comes from `.banner--title-medium .banner__title`:
   *   (min-width: 671px)  font-size: min(6.375rem, 5vw)
   *   (max-width: 1700px) font-size: max(6.5vw, 1.875rem)
   * which resolves to 96px at 1920 and 93.6px at 1440 (root is 16px).
   * A monotonic clamp reproduces every measured width:
   *   clamp(1.875rem, 6.5vw, 6rem) -> 96 / 93.6 / 83.2 / 66.56 / 49.92 / 39 / 30
   * The reference's own 1700px discontinuity is deliberately not reproduced;
   * see docs/R3-STAGE-0-TYPE-CASCADE.md.
   */
  --r3-h1-min: 1.875rem;
  --r3-h1-fluid: 6.5vw;
  --r3-h1-max: 6rem;

  /* ---- h2 / h3 tokens, from the measured matrix --------------------------- */
  /*
   * Measured at 1920x945: h2 72px, h3 62px. The smaller values belong to the
   * narrower breakpoints below, not to the base rule.
   */
  --r3-h2: 4.5rem;    /* 72px  @1920 */
  --r3-h3: 3.875rem;  /* 62px  @1920 */

  /* ---- body ---------------------------------------------------------------*/
  --r3-leading-body: 1.33;
}

/* --------------------------------------------------------------------------
   Display headings Ã¢â‚¬â€ one weight, normal tracking, uppercase, 0.60 leading.
   Applied by role, not by tag: Ã‚Â§4.3 forbids flattening small functional
   headings, so the treatment lives on display classes.
   -------------------------------------------------------------------------- */

.b-page .b-home-title,
.b-page h1.b-display,
.b-page h1.b-services-title,
.b-page h1.b-work-title,
.b-page h1.b-about-title,
.b-page h1.b-contact-title,
.b-page .b-section-title {
  font-family: var(--b-font-display);
  font-weight: var(--r3-weight-display);
  font-synthesis-weight: none;
  letter-spacing: var(--r3-tracking-display);
  line-height: var(--r3-leading-display);
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- h1 role */
/*
 * Size note, stated in the report as well as here.
 *
 * At Loom's own size (96px at 1920) our three lines would occupy 58 / 56 / 32vw,
 * because our copy carries 15 / 13 / 9 characters against their 20 / 21 / 11.
 * The line-width objective (80-85 / 76-82 / 38-48vw, Ã‚Â§13.1) and the reference's
 * font-size cannot both be satisfied by different words at one tracking value.
 * The composition gate was kept and the size difference is reported, per
 * "If different wording or typography metrics require a trade-off, report the
 * final measurements."
 *
 * The per-line sizes below are solved from measurement Ã¢â‚¬â€ see type-r3-after.json.
 */
/*
 * R6 §9.2 — the H1 matrix, superseding the single clamp that used to live here.
 *
 * That clamp produced 96 / 93.6 / 83.2 / 66.56 / 49.92 / 39 / 30. Home matched
 * at six of seven widths, but 390 measured 39px against a 30px target, and the
 * four inner routes were never on the matrix at all: Services ran 118.4 where
 * the reference wants 72, About 72 where it wants 93.6, Contact 95.04 where it
 * wants 132.
 *
 * Each value below is a COMPUTED px target read from the raw responsive JSON
 * (evidence: measurements/reference-h1-matrix.json), not a clamp to be
 * re-derived. Three measured families share the values:
 *
 *   A. Home + About     96 / 93.6 / 83.2 / 66.56 / 49.92 / 30 / 30
 *   B. Services         72 / 62   / 62   / 54    / 54    / 35.1 / 33.75
 *   C. Work + Contact   132/ 132  / 102  / 102   / 82    / 39 / 37.5
 *
 * Breakpoints come from the matrix, not from the layout grid. Values that are
 * identical across adjacent ranges are still declared at each step, so the
 * matrix stays the literal source rather than something inferred from a
 * clamp's arithmetic.
 */
.b-page .b-home-title,
.b-page h1.b-about-title {
  font-size: 96px;
}

.b-page h1.b-services-title {
  font-size: 72px;
}

.b-page h1.b-work-title,
.b-page h1.b-contact-title {
  font-size: 132px;
}

@media (max-width: 1440px) {
  .b-page .b-home-title,
  .b-page h1.b-about-title {
    font-size: 93.6px;
  }

  .b-page h1.b-services-title {
    font-size: 62px;
  }
}

@media (max-width: 1280px) {
  .b-page .b-home-title,
  .b-page h1.b-about-title {
    font-size: 83.2px;
  }

  .b-page h1.b-work-title,
  .b-page h1.b-contact-title {
    font-size: 102px;
  }
}

@media (max-width: 1024px) {
  .b-page .b-home-title,
  .b-page h1.b-about-title {
    font-size: 66.56px;
  }

  .b-page h1.b-services-title {
    font-size: 54px;
  }
}

@media (max-width: 768px) {
  .b-page .b-home-title,
  .b-page h1.b-about-title {
    font-size: 49.92px;
  }

  .b-page h1.b-work-title,
  .b-page h1.b-contact-title {
    font-size: 82px;
  }
}

@media (max-width: 670px) {
  .b-page .b-home-title,
  .b-page h1.b-about-title {
    font-size: 30px;
  }

  .b-page h1.b-services-title {
    font-size: 35.1px;
  }

  .b-page h1.b-work-title,
  .b-page h1.b-contact-title {
    font-size: 39px;
  }
}

/*
 * Below 600px the reference stops using fixed px and switches to viewport
 * units — its own stylesheet sets `--h1: 10vw` and `--h2: 9vw` there. That is
 * why the 390 and 375 columns differ at all:
 *
 *   390: 10vw = 39px   9vw = 35.1px      <- matches Work/Contact and Services
 *   375: 10vw = 37.5px 9vw = 33.75px     <- matches exactly
 *
 * So the two families that vary below 600px are expressed in vw, which
 * reproduces both columns precisely. Home and About stay fixed at 30px because
 * their measured value is 30 at both widths.
 */
@media (max-width: 600px) {
  .b-page h1.b-services-title {
    font-size: 9vw;
  }

  .b-page h1.b-work-title,
  .b-page h1.b-contact-title {
    font-size: 10vw;
  }
}

/*
 * The four display properties, restated at the same specificity as the R3
 * inner-page block in r2-composition.css, which still declares weight 900,
 * negative tracking and 0.88-0.94 leading on .b-work-title, .b-about-title,
 * .b-services-title and .b-contact-title. §9.1 requires 800, normal tracking,
 * uppercase and a 0.60 ratio on every route, so that block has to be
 * neutralised here rather than left to win on source order.
 */
.b-page h1.b-work-title,
.b-page h1.b-about-title,
.b-page h1.b-services-title,
.b-page h1.b-contact-title {
  font-weight: 800;
  letter-spacing: normal;
  text-transform: uppercase;
  line-height: 0.6;
}

/*
 * THE 0.60 / 0.95 SPLIT Ã¢â‚¬â€ measured, not assumed.
 *
 * Loom's h1 computes `line-height: 57.6px` (ratio 0.60) but RENDERS lines
 * 91.2px apart, because every word sits in an `inline-block` span carrying
 * `line-height: 95%`. An inline-block is atomic: its own line-height forms the
 * strut, so 0.95em is the real advance.
 *
 * Proof: evidence/measurements/r3/loom-line-advance.json and the ink-band probe
 * (loom-ink-bands-all.json), which finds 21/23px clear gaps between Loom's h1
 * bands. Applying a literal 0.60 here merges all three lines into one band of
 * continuous ink (screenshots/r3-ink/designb-h1.png).
 *
 * So the element keeps the gated 0.60, and the line box carries the reference's
 * own rendered 0.95. Both numbers are true, exactly as they are on the site.
 */
.b-hero-title__line {
  display: block;
  width: fit-content;
  margin-inline: auto;
  white-space: nowrap;
  line-height: 0.95;
}

/*
 * R8 §1 — line spans inherit the h1.
 *
 * The three per-line clamps that used to sit here are gone. They set each line
 * to its own viewport-derived size, which is why the rendered glyphs at 1920
 * were 134.4 / 130.4 / 128.8px while the h1 element itself was 96px: the child
 * overrode the parent, so the R6 matrix governed the box and nothing else.
 *
 * The line spans now take the h1's font-size by inheritance and carry only the
 * 0.95 line box above, which is the reference's measured rendered advance.
 * Expected block height: 273.6px at 1920, 266.8px at 1440.
 *
 * The phone/tablet clamps below 1024 went with them.
 */
/* ---------------------------------------------------------------- h2 role */
/*
 * Specificity note: `design-b.css` sets `.b-page h2` (0,1,1). A bare
 * `.b-section-title` (0,1,0) loses to it, which is why the first pass still
 * measured 76px / ratio 1.06. Prefixing with `.b-page` makes it (0,2,0) and the
 * role rule wins without `!important`.
 */
.b-page .b-section-title,
.b-page h2.b-section-title {
  font-size: var(--r3-h2);
}

/*
 * The same 0.60 / 0.95 split as the h1, using the word-wrapper this theme
 * already builds for the reveal animation.
 *
 * `design-b.js` splits every `.b-word-heading` into
 *   <span class="b-word"><span class="b-word__inner">word</span></span>
 * and both are `display: inline-block` Ã¢â‚¬â€ the identical structure Loom uses,
 * where the inline-block's own line-height forms the strut. Loom's h2 renders
 * its lines 68.4px apart at 72px font-size (0.95em) while its computed
 * line-height is 0.60; the probe found 20px and 25px clear gaps between its ink
 * bands. Setting 0.95 on the wrappers reproduces both facts at once.
 */
.b-page .b-section-title .b-word,
.b-page .b-section-title .b-word__inner {
  line-height: 0.95;
}

/*
 * R6 §9.1 — the same split, extended to the route H1s.
 *
 * `design-b.js` wraps every word of a `.b-word-heading` in
 * `<span class="b-word"><span class="b-word__inner">`. Both are
 * `display: inline-block`, so their own line-height forms the strut and the
 * h1's declared 0.60 is bypassed for LINE SPACING while remaining the value the
 * gate reads on the element.
 *
 * Without this rule the About h1 (a nine-word sentence across six lines at
 * 96px) rendered with its lines interpenetrating: the computed 0.60 was correct
 * and the visible result was unreadable. 0.95 is the reference's own rendered
 * advance, measured from its ink bands (measurements/r3/loom-line-advance.json).
 *
 * Home keeps its own `.b-hero-title__line` wrapper at 0.95 above, so this
 * covers the four inner routes without touching the home silhouette.
 */
.b-page .b-home-title .b-word,
.b-page .b-home-title .b-word__inner,
.b-page h1.b-about-title .b-word,
.b-page h1.b-about-title .b-word__inner,
.b-page h1.b-services-title .b-word,
.b-page h1.b-services-title .b-word__inner,
.b-page h1.b-work-title .b-word,
.b-page h1.b-work-title .b-word__inner,
.b-page h1.b-contact-title .b-word,
.b-page h1.b-contact-title .b-word__inner,
.b-page .b-service-row__title .b-word,
.b-page .b-service-row__title .b-word__inner {
  line-height: 0.95;
}

/* ---------------------------------------------------------------- h3 role */
/*
 * Editorial h3s that sit on a full-width row and can carry the monument.
 * Grid card headings are excluded on purpose (Ã‚Â§4.3) and keep sentence case at
 * tighter-than-before but readable leading Ã¢â‚¬â€ recorded in the report.
 */
.b-page .b-service-row__title {
  font-family: var(--b-font-display);
  font-weight: var(--r3-weight-display);
  letter-spacing: var(--r3-tracking-display);
  line-height: 0.95;
  margin-bottom: 16px;
  text-transform: uppercase;
  font-size: var(--r3-h3);
}

/* Card headings: same weight and tracking vocabulary, readable leading. */
.b-page .b-principle__title,
.b-page .b-process__title,
.b-page .b-empty-work__title {
  font-family: var(--b-font-display);
  font-weight: var(--r3-weight-display);
  letter-spacing: var(--r3-tracking-display);
  line-height: 1.0;
}

/* --------------------------------------------------------------------------
   Body Ã¢â‚¬â€ R6 Â§7.1/Â§7.2 supersede the R3 1.33 ratio.
   R6 sets the reference's measured 1.50 editorial leading and explicit
   supporting sizes in place of the old fluid clamp.

   Leading is shared; SIZE is per role, so the hero lead stays on the LARGE
   role while body paragraphs take the EDITORIAL role. Getting this wrong is
   what makes a "hero lead" quietly shrink to body size.

   Forms, helper text, legal copy and button labels are excluded: R3 Â§4.6 and
   R6 Â§7.3 both carve them out, and R6 Â§7.2 says a component's own line-height
   governs its label.
   -------------------------------------------------------------------------- */
.b-page .b-lead,
.b-section-lede,
.b-principles p,
.b-service-row p,
.b-service-row__content p,
.b-faq > .wp-block-paragraph,
.b-cta-band p {
  line-height: var(--b-leading-editorial);
}

/* The hero/lead role keeps its LARGE size; only its leading changes here. */
.b-page .b-lead,
.b-section-lede {
  font-size: var(--b-type-large);
}

/* Editorial body copy takes the EDITORIAL size and leading. */
.b-page p,
.b-principles p,
.b-service-row p,
.b-service-row__content p,
.b-faq > .wp-block-paragraph,
.b-cta-band p {
  line-height: var(--b-leading-editorial);
  font-size: var(--b-type-editorial);
}

/* Restore comfortable leading where a paragraph is functional, not editorial. */
.contact-field,
.contact-field input,
.contact-field textarea,
.contact-form__help,
.contact-form__mail-note,
.contact-form__privacy,
.contact-form__feedback,
.b-caption,
.b-footer,
.site-footer p,
.site-footer a,
.footer-links__list a,
.b-capsule__title,
.b-collage__label,
.b-capability__label {
  line-height: 1.5;
}

/*
 * R6 §7.2: a button label's line-height belongs to its owning component.
 * R3 added .btn__txt here at 1.5, which at a 16px label produced a 24px line
 * box and inflated the standard button from 60px to 64px. The split-pill
 * stylesheet owns this property and declares 20px; removing the override
 * restores the 60px geometry without touching the component's animation.
 */

/* --------------------------------------------------------------------------
   Responsive steps, from the measured matrix
   -------------------------------------------------------------------------- */

/*
 * R8 §3 — the missing 1440 step.
 *
 * The reference measures 72px at 1920 and 62px at 1440, but this build jumped
 * straight from 72 to 62 at 1280, so every width from 1281 to 1440 inherited
 * the 72px role. That is why 1440 measured 72/43.2 against a 62/37.2 target.
 *
 * The step is added here rather than by shrinking the base, so 1920 keeps 72.
 */
@media (max-width: 1440px) {
  :root {
    --r3-h2: 3.875rem; /* 62px @1440 */
  }
}

@media (max-width: 1280px) {
  :root {
    --r3-h2: 3.875rem; /* 62px  1281-1700 in the reference; held 100px lower here */
    --r3-h3: 3.25rem;  /* 52px */
  }
}

@media (max-width: 1024px) {
  :root {
    --r3-h2: 3.375rem; /* 54px */
    --r3-h3: 2.75rem;  /* 44px */
  }
}

@media (max-width: 767px) {
  .b-hero-title__line {
    white-space: normal;
  }

  /*
   * R8 §1 — the phone line clamps are removed too; the spans inherit the 30px
   * h1 matrix value and keep the 0.95 line box.
   */
}

@media (max-width: 600px) {
  :root {
    /* The reference switches to viewport units below 600px: 9vw / 8vw. */
    --r3-h2: 9vw;
    --r3-h3: 8vw;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion needs nothing here: this file carries no transitions.
   -------------------------------------------------------------------------- */