/* ==========================================================================
   Home — ported from Prestige Remodel Home.dc.html.

   The reference kept layout inline on elements; it lives here as classes so it
   can be re-laid-out at breakpoints. Values come from prestige-tokens.css.
   ========================================================================== */

/* --- Hero ---------------------------------------------------------------- */

[data-h="hero"] {
  /* Declared once: the photo hero paints it in the background shorthand, and
     the video hero repaints the same gradient in ::after because the shorthand
     sits under the <video>. Two copies drifting apart would cost the title its
     contrast on one variant only. */
  --pr-hero-scrim: linear-gradient(180deg, rgb(0, 0, 0) 0.96%, rgba(0, 0, 0, 0) 44.71%, rgb(0, 0, 0) 100.00%);

  position: relative;
  display: flex;
  flex-direction: column;
  /*
   * The height is derived from WIDTH (56.25vw = the photo's 16:9), so on a
   * wide-but-short screen it outgrew the viewport and pushed the CTAs under
   * the fold — measured at -23px on 1536x864 and -7px on 1920x1080, the two
   * commonest desktop sizes. The min() caps it against the viewport so the
   * whole hero is always reachable without scrolling (BugHerd #153).
   *
   * 100svh, not 100vh: on mobile Safari vh is the *expanded* viewport, so the
   * toolbar overlaps the bottom of the hero by its own height. svh is the
   * small viewport — the one actually visible with the toolbar showing.
   *
   * The 600px floor stays ahead of the min() so a short desktop window still
   * gets a usable hero rather than collapsing to nothing.
   */
  min-height: max(600px, min(56.25vw, 100svh));
  background:
    var(--pr-hero-scrim),
    var(--pr-hero-image) center / cover no-repeat,
    var(--surface);
}

/*
 * Optional background video, layered over the photo.
 *
 * The gradient in the background shorthand above paints UNDER this element, so
 * it cannot darken the video the way it darkens the photo. The ::after below
 * re-lays --pr-hero-scrim on top, which is why that value is a variable.
 *
 * The section carries data-hero-video when a file is set, rather than the CSS
 * asking :has(). Support for :has() is broad but not total, and the failure
 * mode is bad and invisible: no scrim, white title on whatever the video is
 * showing. An attribute PHP already knows how to write cannot fail that way.
 *
 * z-index: herovideo 0 < ::after 1 < herorow 2 (already set below).
 */
[data-h="herovideo"] {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  /* Fill the section without letterboxing, exactly as `cover` does for the
     photo. Without this a non-16:9 file is squashed to the box. */
  object-fit: cover;
  /* Not interactive: it is decoration, and a click should never pause it. */
  pointer-events: none;
}

[data-h="hero"][data-hero-video]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--pr-hero-scrim);
}

/*
 * Someone who has asked their system to reduce motion gets the photo. The
 * video element stays in the DOM but is not painted, so the background image
 * below it shows through and the gradient above is no longer doubled.
 */
@media (prefers-reduced-motion: reduce) {
  [data-h="herovideo"] { display: none; }
  [data-h="hero"][data-hero-video]::after { content: none; }
}

/* The header is rendered above this section, so the hero starts below it. */
/* The header is fixed and out of flow, so only the padding is needed. */
[data-h="hero"] { padding-top: var(--pr-header-height, 0px); }

/*
 * The spacer holds the row down against the top of the hero. `flex: 1 1 auto`
 * lets it absorb whatever is left, so its min-height only sets how far the
 * content sits from the logo — it is not what drives the hero's height.
 *
 * The floor came down from 120/15vw/290 because it was fighting the viewport
 * cap above: on a short screen the spacer claimed 290px that the content then
 * had to give back out of its own bottom padding (BugHerd #153).
 */
[data-h="herospacer"] {
  flex: 1 1 auto;
  min-height: clamp(80px, 9vw, 180px);
}

/*
 * Headline left, CTAs right, wrapping to a second line when they do not fit.
 *
 * The bottom padding is what keeps the buttons on screen once they wrap: that
 * extra line used to push them past the fold, measured 23px below it at
 * 1536x864 (BugHerd #153). It applies at every width, wrapped or not.
 */
[data-h="herorow"] {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(24px, 2.4vw, 46px);
  flex-wrap: wrap;
  padding: 0 var(--gutter-hero) clamp(76px, 8vw, 150px);
}

[data-h="herotitle"] {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--display-hero);
  line-height: 1.06;
  color: var(--paper);
  max-width: 1020px;
  text-wrap: pretty;
}

/* The headline and its optional line travel together in the row. */
[data-h="herohead"] { max-width: 1020px; }

[data-h="herolede"] {
  margin: clamp(10px, 0.94vw, 18px) 0 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--subhead);
  line-height: 1.3;
  color: var(--paper);
  text-wrap: balance;
}

/* Phones: each sentence of the headline on its own line, and the line under
   it kept to one line (BugHerd #136). */
@media (max-width: 575px) {
  [data-h="heroline"] { display: block; }
  [data-h="herolede"] { font-size: clamp(15px, 4.5vw, 20px); white-space: nowrap; }
}

[data-h="heroctas"] {
  display: flex;
  align-items: flex-end;
  gap: clamp(22px, 1.82vw, 35px);
  flex-wrap: wrap;
}
[data-h="heroctas"] .pr-cta {
  display: inline-block;
  min-width: 147px;
}

/*
 * Hero CTA hover: grey, not a fade.
 *
 * .pr-cta--light hovers by dropping opacity to .7, and Safari would not
 * animate it here — the hero is a compositing layer (the background video sits
 * behind these), and an opacity transition on a child of one is exactly what
 * Safari handles badly. It snapped instead of fading.
 *
 * Hero ONLY: the same class is on the service tile CTAs, where the opacity
 * fade is correct and does animate. Overriding the shared component would
 * change those too.
 *
 * --surface rather than --muted: 14.9:1 on the hero's scrim against --muted's
 * 4.4:1, which is under the 4.5:1 floor for body text in this build.
 */
[data-h="heroctas"] .pr-cta--light:hover {
  opacity: 1;
  color: var(--surface);
  text-decoration-color: var(--accent);
}

/* --- Intro --------------------------------------------------------------- */

[data-h="intro"] {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-section);
  padding: clamp(56px, 12.76vw, 245px) var(--gutter-page);
}

/*
 * The watermark is centred on the LOCKUP, at every width.
 *
 * It is a child of [data-h="lockup"] now (see front-page.php), so top/left 50%
 * with a -50% translate IS the lockup's centre — no offset to derive from the
 * section's padding, and nothing to re-tune when the layout stacks. Three
 * earlier attempts each fixed one breakpoint and broke another because the mark
 * was positioned against the section instead.
 *
 * z-index 0 against the lockup's own text: the mark sits behind the words
 * without needing a stacking context on every sibling.
 */
[data-h="lockup"] { position: relative; }

[data-h="lockup"] > :not([data-h="watermark"]) { position: relative; z-index: 1; }

[data-h="watermark"] {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  width: clamp(300px, 31.22vw, 599px);
  aspect-ratio: 599.435 / 599;
  pointer-events: none;
}

[data-h="split"] {
  position: relative;
  /* Capped at the content width and centred. Uncapped, the two fr columns kept
     stretching past 1920 while the lockup's type had stopped growing, so the
     gap between them ballooned (174px at 1920, 466px at 2560 — BugHerd #78).
     At 1920 the content box IS 1620px, so nothing moves at or below it. */
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: minmax(0, 660fr) minmax(0, 786fr);
  gap: clamp(36px, 9.06vw, 174px);
  align-items: center;
}

[data-h="lockup"] {
  width: fit-content;
  max-width: 100%;
}
[data-h="introtitle"] {
  font-size: var(--display-xl);
  /* The gap above "REMODELING" is set on the EYEBROW below, not here
     (BugHerd #146) — .pr-lockup__eyebrow owns the lockup's internal spacing
     sitewide, and a competing margin here just fights it. */
  margin: 0 0 -0.091em;
}
/* "Home" sits close under REMODELING (BugHerd #146, #153).
   :not([data-h="eyebrowend"]) — the lockup has TWO eyebrows, "Home" above the
   title and "& General Contractors" below it. Only the one above is set here.

   What matters here is the INK gap, not the margin. Both elements run
   line-height: 1, and the title's em box carries about 0.26em of empty space
   above its capitals — 24px at the desktop size. So a 0 margin still reads as
   a ~30px gap, and the margin has to go NEGATIVE to close it.

   That empty space scales with the TITLE (44-110px), so the ink gap narrows
   on its own as the screen shrinks: at a flat -0.18em it is 25px on desktop
   but only 12px on a phone, where the lockup also centres and the two lines
   sit directly over each other. Hence two values, not one clamp. */
[data-h="lockup"] .pr-lockup__eyebrow:not([data-h="eyebrowend"]) {
  margin-bottom: -0.34em;
}
/* Centred under the title from here down: the ink gap is already much
   tighter at this type size, so ease off rather than pull further. */
@media (max-width: 991px) {
  [data-h="lockup"] .pr-lockup__eyebrow:not([data-h="eyebrowend"]) {
    margin-bottom: -0.1em;
  }
}

[data-h="eyebrowend"] {
  /* No bottom margin (BugHerd #152). It inherited .pr-lockup__eyebrow's
     sitewide -0.18em, which is there to tuck an eyebrow UNDER the title that
     follows it. Nothing follows this one — it is the last line of the lockup
     — so the negative value only pulled the lockup's box up inside its own
     text, leaving it overhanging by 5.5px and the gap to whatever sits below
     that much tighter than it measures. */
  margin-bottom: 0;
  align-self: stretch;
  text-align: right;
}

[data-h="center"] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(20px, 1.56vw, 30px);
}

/* --- Featured services --------------------------------------------------- */

[data-h="services"] {
  background: var(--paper);
  /* Was 56–121px. At desktop widths the section head sat in far more space than
     it needed; the floor is unchanged so phones are unaffected. */
  padding: clamp(48px, 4.2vw, 80px) 0 0;
}

[data-h="servicehead"] {
  gap: clamp(10px, 1.61vw, 31px);
  padding: 0 var(--gutter-page);
}

[data-h="tilegrid"] {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--ink);
  /* Was 40–110px. Together with the section padding above, the heading was
     floating in roughly 230px of space at 1920. */
  margin-top: clamp(32px, 3.2vw, 62px);
}

[data-h="tile"] {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 480 / 488;
  /* A fixed `min-height` here is dangerous: with an aspect-ratio the browser
     derives WIDTH from that height, so whenever a grid column is narrower than
     the min-height the tile overflows its column and the page scrolls
     sideways. It did so at 320px (334px wide) and again at 1200px, where four
     columns are ~299px each. Capping the floor at the column's own width keeps
     the ratio intact and lets height follow width, which is the direction the
     design intends. */
  min-height: min(340px, 100%);
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  transition: box-shadow .35s ease;
}
[data-h="tile"]:hover { color: var(--paper); }

/* The "View All Services" tile has no photo — it centres its title at the
   bottom the same way the others do. */
[data-h="tile"][data-h-all="1"] {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(24px, 1.875vw, 36px) clamp(24px, 1.875vw, 36px) clamp(28px, 2.08vw, 40px);
}

[data-h="tileimg"] {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: transform .6s cubic-bezier(.22, .61, .36, 1);
}

[data-h="tilewash"] {
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: var(--wash-tile);
  /* The wash and the foot gradient below cross-fade so the tile never goes
     bare between them: into hover the wash comes in fast while the foot
     leaves slowly; out of hover the reverse (the rest-state timing here
     runs on the way out, the hover-state timing on the way in). */
  transition: opacity .45s ease-in;
}

[data-h="tilefoot"] {
  position: absolute;
  inset: 0;
  background: var(--scrim-tile);
  /* Faded out by opacity, not by setting the background to transparent: a
     gradient cannot animate, so it vanished at once while the wash was still
     fading in, and the tile flashed bare (BugHerd #147). */
  transition: opacity .45s ease-out;
}

[data-h="tilebody"] {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(24px, 1.875vw, 36px) clamp(24px, 1.875vw, 36px) clamp(28px, 2.08vw, 40px);
}

[data-h="tiletitle"] {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--display-sm);
  line-height: 1.04;
  color: var(--paper);
  text-wrap: balance;
}

[data-h="reveal"] {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition:
    grid-template-rows .42s cubic-bezier(.22, .61, .36, 1),
    opacity .3s ease,
    margin-top .42s ease;
}
[data-h="reveal"] > div {
  overflow: hidden;
  min-height: 0;
}

[data-h="tile"]:hover [data-h="reveal"],
[data-h="tile"]:focus-within [data-h="reveal"] {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: clamp(14px, 1.04vw, 20px);
}

[data-h="tile"]:hover [data-h="tilewash"],
[data-h="tile"]:focus-within [data-h="tilewash"] { opacity: var(--wash-tile-hover); transition-timing-function: ease-out; }

[data-h="tile"]:hover [data-h="tilefoot"],
[data-h="tile"]:focus-within [data-h="tilefoot"] { opacity: 0; transition-timing-function: ease-in; }

[data-h="tile"]:hover [data-h="tileimg"] { transform: scale(1.06); }

[data-h="tile"]:hover,
[data-h="tile"]:focus-within {
  box-shadow: var(--shadow-tile-hover);
  z-index: 2;
}

/* Tile reveal copy: prose rhythm would add margins the tile does not want. */
.pr-prose--tile > * { margin: 0; }
.pr-prose--tile p {
  color: var(--paper);
  max-width: 420px;
}
[data-h="tilecta"] {
  display: inline-block;
  margin-top: clamp(12px, 0.94vw, 18px);
  text-decoration-color: var(--accent);
}

/* No hover on touch: show the reveal copy at rest. */
@media (hover: none) {
  [data-h="reveal"] {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 16px;
  }
  [data-h="tilewash"] { opacity: var(--wash-tile-hover); }
  [data-h="tilefoot"] { opacity: 0; }
}

/* --- Service area -------------------------------------------------------- */

[data-h="service-area"] {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: flex-end;
  background: var(--pr-area-image) center / cover no-repeat, var(--paper);
  padding: clamp(56px, 14.17vw, 272px) var(--gutter-page) clamp(56px, 15.05vw, 289px);
}

[data-h="arealens"] {
  position: absolute;
  left: -4.79vw;
  top: -1.82vw;
  width: 59.48vw;
  height: 57.60vw;
  min-width: 420px;
  min-height: 406px;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(217, 217, 217, 0) 82.69%, rgba(115, 115, 115, 0.5) 100%);
  pointer-events: none;
}

[data-h="areacard"] {
  position: relative;
  width: 100%;
  max-width: 850px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(32px, 6.88vw, 132px) clamp(28px, 3.23vw, 62px);
}
/* The copy block is centred in the card, so the space either side of it
   matches; the words stay left-aligned within it (BugHerd #86). */
[data-h="areacard"] [data-h="center"] {
  gap: clamp(18px, 1.25vw, 24px);
  max-width: 630px;
  margin: 0 auto;
}

/* --- Portfolio / before-after -------------------------------------------- */

[data-h~="portfolio"] {
  display: grid;
  grid-template-columns: minmax(0, 473fr) minmax(0, 1128fr);
  gap: clamp(32px, 8.80vw, 169px);
  align-items: center;
  background: var(--paper);
  padding: clamp(56px, 4.27vw, 82px) 0 clamp(56px, 4.27vw, 82px) var(--gutter-page);
}

[data-h-portfoliocopy="1"] { padding-right: 20px; }

/*
 * The eyebrow and the title read as one lockup, but this column is a flex
 * container with gap: clamp(20px, 1.56vw, 30px) — and FLEX GAP IGNORES MARGINS,
 * so the negative margin on .pr-lockup__eyebrow moved this by 1px. Cancelling
 * the container's own gap for this one pair is what actually closes it; every
 * other child of the column keeps its spacing.
 */
[data-h-portfoliocopy="1"] .pr-lockup__eyebrow + [data-h="portfoliotitle"] {
  margin-top: calc(-1 * clamp(20px, 1.56vw, 30px));
}

[data-h="portfoliotitle"] {
  font-size: var(--display-xl);
  /* Top margin 0: the eyebrow above owns the gap now (see .pr-lockup__eyebrow).
     The -0.06em that used to be here scaled with THIS title, which is why the
     gap here measured 17px while the same pair elsewhere measured -5px. */
  /* Bottom 0: the column gap alone sets PORTFOLIO to its copy, as in the
     mock (gap about 0.85 of the cap height; gap plus a margin was 1.4). */
  margin: 0;
}

[data-h="portfoliomedia"] {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  touch-action: none;
  cursor: ew-resize;
  user-select: none;
}

[data-compare="before"] {
  width: 100%;
  aspect-ratio: 1137 / 569;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

[data-compare="after"] {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  clip-path: inset(0 0 0 50%);
}

[data-compare="line"] {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(-1px);
}

[data-compare="handle"] {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  cursor: ew-resize;
}
[data-compare="arrow-l"],
[data-compare="arrow-r"] {
  display: block;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
}
[data-compare="arrow-l"] {
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
[data-compare="arrow-r"] {
  border-right: 2px solid var(--ink);
  border-top: 2px solid var(--ink);
}

/* --- Testimonials -------------------------------------------------------- */

[data-h="testimonials"] {
  background:
    linear-gradient(rgba(0, 0, 0, 0.90), rgba(0, 0, 0, 0.90)),
    var(--pr-testimonials-image) center / cover no-repeat,
    var(--ink);
  box-shadow: var(--shadow-band);
  padding: clamp(40px, 5.57vw, 107px) clamp(16px, 5.05vw, 97px) clamp(40px, 4.84vw, 93px);
}

[data-h="testimonialframe"] {
  border: 2px solid var(--paper);
  border-radius: clamp(12px, 1.30vw, 25px);
  padding: clamp(44px, 7.86vw, 151px) clamp(20px, 2.03vw, 39px) clamp(40px, 5.21vw, 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

[data-h="testimonialtitle"] {
  color: var(--paper);
  text-align: center;
}

/* All slides occupy ONE grid cell, so the stack is as tall as the TALLEST
   quote and the frame stops resizing as you page through. Previously each
   slide was shown/hidden, so the band jumped by up to 281px at 320px wide.
   The inactive ones are hidden from assistive tech and taken out of the tab
   order, but still contribute their height. */
[data-h="testimonialstack"] {
  display: grid;
  width: 100%;
}
[data-h="testimonialslide"] {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity .32s ease, visibility .32s;
}
[data-h="testimonialslide"][data-active="1"] {
  opacity: 1;
  visibility: visible;
}

[data-h="quote"] {
  margin-top: clamp(20px, 1.77vw, 34px);
  max-width: 949px;
  font-size: var(--quote);
  line-height: 1.42;
  color: var(--paper);
  text-align: center;
  text-wrap: pretty;
}

[data-h="client"] {
  margin-top: clamp(26px, 2.60vw, 50px);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--client-name);
  line-height: 1.1;
  color: var(--paper);
  text-transform: uppercase;
  text-align: center;
}

[data-h="tdots"] {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: clamp(26px, 2.40vw, 46px);
}

/* Active dot is the OUTLINED one; inactive are filled. */
[data-h="tdot"] {
  width: 13px;
  height: 13px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--paper);
  background: var(--paper);
  cursor: pointer;
  /* 44px hit area without changing the painted size. */
  position: relative;
}
[data-h="tdot"]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
[data-h="tdot"][aria-selected="true"] { background: transparent; }

/*
 * Carousel arrows — touch only. They REPLACE the dots.
 *
 * The dots are 13px with a 9px gap, and each claims a 44px hit area via
 * ::before — so at that spacing the hit areas OVERLAP and a tap near a dot's
 * edge activates its neighbour. On touch the arrows take over entirely: the
 * dots are hidden and the arrow row sits in exactly their place, carrying the
 * same margin-top so nothing above or below shifts.
 *
 * Gated on `pointer: coarse` rather than a width: it is the input device that
 * makes a 13px target hard to hit, not the viewport.
 */
[data-h="tnav"],
[data-h="nnav"] { display: none; }

@media (pointer: coarse) {
  /* The dots are hidden at the END of this file — see "Hide the dots on touch".
     Doing it here did not work: [data-h="ndots"] is DEFINED further down, and
     at equal specificity the later rule won, so the news dots reappeared under
     the arrows. */

  [data-h="tnav"],
  [data-h="nnav"] {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(20px, 6vw, 40px);
  }

  /* Each nav inherits the margin-top of the dot row it replaces, so the space
     between the carousel and what follows is unchanged. */
  [data-h="tnav"] { margin-top: clamp(26px, 2.40vw, 46px); }
  [data-h="nnav"] { margin-top: clamp(32px, 4.79vw, 92px); }
}

[data-h="tprev"], [data-h="tnext"],
[data-h="nprev"], [data-h="nnext"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* The accessibility floor is 44px and these are now the ONLY control on
     touch, so they take the full square. */
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}
[data-h="tprev"] svg, [data-h="tnext"] svg,
[data-h="nprev"] svg, [data-h="nnext"] svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* The news band sits on paper, not on the dark photo panel. */
[data-h="nprev"], [data-h="nnext"] { color: var(--ink); }

/* --- In the news --------------------------------------------------------- */

/* The floor-plan pattern from the mock, in place of the washed photo
   (BugHerd #88). */
[data-h="news"] {
  background: var(--wash-plan), var(--pr-news-image) center / cover no-repeat, var(--paper);
  padding: clamp(48px, 8.44vw, 162px) 0 0;
}

[data-h="newshead"] {
  gap: clamp(8px, 0.83vw, 16px);
  padding: 0 var(--gutter-page);
}

[data-h="newsviewport"] {
  overflow-x: hidden;
  overflow-y: visible;
  padding: 60px 0;
  margin-top: calc(clamp(36px, 3.70vw, 71px) - 60px);
  margin-bottom: -60px;
}

[data-h="newstrack"] {
  display: flex;
  gap: clamp(12px, 1.875vw, 36px);
  align-items: center;
  width: max-content;
  transition: transform .62s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

[data-h="newscard"] {
  flex: 0 0 clamp(300px, 50.36vw, 967px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: var(--radius-lg);
  aspect-ratio: 967 / 607;
  background: var(--ink);
  box-shadow: var(--shadow-feature);
  padding: clamp(20px, 2.66vw, 51px) clamp(20px, 2.66vw, 51px) clamp(20px, 2.14vw, 41px);
}

[data-h="newsimg"] {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

[data-h="newswash"] {
  position: absolute;
  inset: 0;
  background: var(--scrim-peek);
  opacity: 0;
  transition: opacity .5s ease;
}

[data-h="newsscrim"] {
  position: absolute;
  inset: 0;
  background: var(--scrim-card);
}

[data-h="newsbody"] {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 0.47vw, 9px);
  transition: opacity .5s ease;
}

[data-h="newstitle"] {
  font-family: var(--font-editorial);
  font-weight: 500;
  font-size: var(--card-title);
  line-height: 1.1;
  max-width: 600px;
  text-wrap: pretty;
}
[data-h="newstitle"] a {
  color: var(--paper);
  text-decoration: none;
  transition: color .25s ease;
}
/*
 * No underline on hover. This card is a photo tile, not body prose, and the
 * rule stays off on hover as well — an underline appearing under a 2-line
 * display title was the reported problem.
 *
 * It still has to signal it is a link, though, and this card is a plain
 * <article>: no .pr-photocard, so no lift or zoom to fall back on. The colour
 * shift is that signal, matching what the blog card already does
 * ([data-b="card"]:hover [data-b="cardtitle"]). Keyboard focus is unaffected —
 * the :focus-visible outline floor in prestige-components.css still applies.
 */
[data-h="newstitle"] a:hover { color: var(--accent); }

[data-h="newsdesc"] {
  font-family: var(--font-editorial);
  font-weight: 400;
  font-size: var(--body);
  line-height: var(--leading-card);
  color: var(--paper);
  max-width: 600px;
  text-wrap: pretty;
  transition: opacity .4s ease;
}

/* Peeking cards are dimmed. */
[data-h="newscard"][data-peek="1"] [data-h="newswash"] { opacity: 1; }
[data-h="newscard"][data-peek="1"] [data-h="newsbody"] { opacity: 0.5; }
[data-h="newscard"][data-peek="1"] [data-h="newsdesc"] { opacity: 0; }
[data-h="newscard"][data-peek="1"] { box-shadow: var(--shadow-peek); }

[data-h="ndots"] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(32px, 4.79vw, 92px);
}
[data-h="ndot"] {
  position: relative;
  width: 13px;
  height: 13px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: var(--ink);
  cursor: pointer;
}
[data-h="ndot"]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
[data-h="ndot"][aria-selected="true"] { background: transparent; }

/* --- Get in touch card (straddles the footer edge) ----------------------- */

[data-h="ctawrap"] {
  position: relative;
  z-index: 5;
  margin-top: clamp(40px, 4.95vw, 95px);
  /* site.js overwrites margin-bottom with the measured half-height. This is the
     pre-JS value, matching the reference. */
  margin-bottom: clamp(-128px, -6.67vw, -52px);
  padding: 0 var(--gutter-page);
}

[data-h="cta-row"] {
  max-width: 1620px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(24px, 3.02vw, 58px);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-cta);
  /* The same padding on every side (BugHerd #90). */
  padding: clamp(28px, 4.06vw, 78px);
}

/* The copy takes the row's free space, so the link sits at the card's right
   edge, one padding in from it, as the copy sits one padding in on the left. */
[data-h-ctacopy="1"] {
  gap: clamp(12px, 0.94vw, 18px);
  flex: 1 1 0;
  min-width: 0;
}
[data-h-ctacopy="1"] .pr-prose { max-width: 786px; }

/* The link at its own width, so it ends one padding in from the card's right
   edge (BugHerd #90). The block CTA's 420px box left it floating mid-card. */
[data-h="cta-row"] > .pr-cta { flex: 0 0 auto; width: auto; }

/* ==========================================================================
   Breakpoints
   ========================================================================== */

@media (max-width: 1439px) {
  [data-h~="portfolio"] {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(32px, 4vw, 60px);
    padding-right: var(--gutter-page);
  }
  [data-h-portfoliocopy="1"] {
    text-align: center;
    align-items: center;
    padding-right: 0;
  }
  [data-h-portfoliocopy="1"] [data-h="rule"] {
    margin-left: auto;
    margin-right: auto;
  }
  [data-h="portfoliomedia"] { border-radius: var(--radius-sm); }
}

@media (max-width: 1199px) {
  [data-h="tilegrid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
  [data-h="center"] {
    text-align: center;
    align-items: center;
    justify-content: center;
  }
  [data-h="center"] [data-h="rule"] {
    margin-left: auto;
    margin-right: auto;
  }
  [data-h="lockup"] {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  [data-h="lockup"] p { text-align: center; }
  [data-h~="split"] {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(36px, 4vw, 60px);
  }
  /*
   * Once the column stacks, the watermark centres on the page and sits behind
   * the lockup rather than above it.
   *
   * Its desktop position is a fixed left/top tuned for the two-column layout —
   * when the grid collapses the lockup moves down and the mark stays put, so it
   * floated above the text (measured +81px vertically, and 58px left of centre
   * horizontally). Centring it with transforms keeps it behind the words at any
   * stacked height.
   */
  /*
   * The mark sits behind the LOCKUP, centred on it.
   *
   * Two earlier attempts missed: the desktop rule pins a fixed top, so when the
   * column stacks the lockup moves down and the mark floats above it (+81px).
   * Switching to top: 50% was worse (+249px) — that is half the SECTION, which
   * also holds the body copy and the CTA.
   *
   * `top` is measured from [data-h="intro"], the SECTION — not from the stacked
   * column — and the section's own padding pushes the lockup down before it
   * starts. So the mark's centre has to clear that padding first, then drop by
   * half the lockup.
   *
   * Measured at four widths and the arithmetic is exactly that: 90 = 56+34,
   * 98 = 64+34, 123 = 89+34, 152 = 115+37. The first term is the section's
   * padding-top clamp restated, the second is half the lockup's height.
   *
   * Two earlier guesses missed because they ignored the padding: 4.5rem rode
   * high and drifted with width (-18px at 400 but -80px at 900), and halving it
   * to 2.25rem made it worse, not better.
   */
  /* Only the opacity changes when stacked — the centring is in the base rule
     now and holds at every width. */
  [data-h="watermark"] { opacity: 0.5; }
  [data-h="herorow"] {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  /* The row centres itself when it stacks, but the button group keeps its own
     flex alignment — the CTAs stayed left while the headline above them was
     centred. */
  [data-h="heroctas"] {
    justify-content: center;
    width: 100%;
  }
  [data-h="newstrack"] > article {
    flex: 0 0 calc(100vw - clamp(40px, 15.62vw, 300px));
  }
  [data-h="cta-row"] {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  [data-h="cta-row"] > a {
    max-width: 420px;
    text-align: center;
  }
  [data-h="cta-row"] > div { flex: 0 1 auto; }
  [data-h="areacard"] {
    margin-left: auto;
    margin-right: auto;
  }
  [data-h="service-area"] { justify-content: center; }
}

@media (max-width: 767px) {
  /*
   * The card keeps its 967x607 proportion all the way down, which at ~300px
   * wide leaves about 188px of height. Title (two lines) + description +
   * padding already claims over three quarters of that, and a three-line title
   * overflows it. Taller and narrower at phone sizes gives the copy room; the
   * photo simply crops, which it is set up to do (background-size: cover).
   */
  [data-h="newscard"] { aspect-ratio: 4 / 5; }

  [data-h="portfoliomedia"] [data-compare="before"] { aspect-ratio: 4 / 3; }
  [data-compare="handle"] {
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 576px) {
  [data-h="tilegrid"] { grid-template-columns: minmax(0, 1fr); }

  /*
   * "View All Services" as an outline button, centred.
   *
   * At one tile per row this card is a tall black rectangle with its label in
   * the bottom-left corner, which reads as an unfinished tile rather than the
   * last step in the list. Only at this width: in the multi-column grid the
   * bottom-left label matches the tiles beside it, which is the design.
   *
   * The label is an <h3>, so the button look is applied to it directly rather
   * than by adding markup — the heading is the only thing in the card.
   */
  [data-h="tile"][data-h-all="1"] {
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 6vw, 44px);
    /*
     * Shorter than the service tiles. Those are 480/488 with a 340px floor
     * because they hold a photo, a title and reveal copy; this one holds a
     * single button, and at that height it was a large empty black panel.
     * `auto` lets the padding and the button set the height instead.
     */
    aspect-ratio: auto;
    min-height: 0;
  }

  [data-h="tile"][data-h-all="1"] [data-h="tiletitle"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px clamp(22px, 6vw, 38px);
    border: 1px solid var(--paper);
    color: var(--paper);
    /* The tile titles are display-face and large; as a button this wants the
       CTA treatment at the CTA's size. */
    font-family: var(--font-cta);
    font-size: var(--cta);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .03em;
    text-align: center;
    transition: color .22s ease, background-color .22s ease;
  }

  [data-h="tile"][data-h-all="1"]:hover [data-h="tiletitle"],
  [data-h="tile"][data-h-all="1"]:focus-visible [data-h="tiletitle"] {
    background: var(--paper);
    color: var(--ink);
  }


}

/*
 * The resize cursor across the whole comparison widget.
 *
 * Setting it on the container alone was not enough, and neither was adding a
 * descendant selector: the handle is a <button role="slider">, and Safari keeps
 * NATIVE CONTROL styling on a button — including its own cursor — until
 * `appearance: none` is set. An author `cursor` at ordinary specificity does
 * not displace that, so the handle kept an arrow in Safari while Chrome (which
 * has no such native styling here) looked correct.
 *
 * So: reset the appearance on the handle, and mark every layer !important. The
 * !important is doing real work against a UA control style, not papering over
 * an author-order problem.
 */
[data-compare="root"],
[data-compare="root"] * {
  cursor: ew-resize !important;
}

[data-compare="handle"] {
  -webkit-appearance: none;
  appearance: none;
}

/* Dragging: keep the resize cursor even as the pointer leaves the widget, so it
   does not flicker back to an arrow mid-drag. */
[data-compare="root"][data-dragging="1"],
[data-compare="root"][data-dragging="1"] * {
  cursor: ew-resize !important;
}

/*
 * Hide the dots on touch.
 *
 * Last in the file on purpose. The arrows replace the dots (see the carousel
 * arrows block above), but [data-h="ndots"] is defined AFTER that block, and
 * two rules of equal specificity are settled by source order — so hiding the
 * dots up there left the news dots visible beneath the arrows on a phone while
 * the testimonial dots, defined earlier, disappeared correctly.
 */
@media (pointer: coarse) {
  [data-h="tdots"],
  [data-h="ndots"] { display: none; }
}


