/* ============================================
   responsive.css — Breakpoints and motion preferences

   The ladder, widest first. Each step exists because a *layout* changes
   there, not because a font size does: the display type is one clamp per
   heading in sections.css, so nothing here restates it.
     1100  the four service cards stop fitting side by side
     1000  header and hero leave the desktop proportions
      900  the section heading, the approach and the contact layout stack
      840  the navigation becomes the menu sheet
      760  phone: one column everywhere
      430  narrow phone: the field row stacks, the button goes full width
      370  the last step, for a 320–360 device
   ============================================ */
@media (max-width: 1100px) {
  /* Baseline for the four service cards, for browsers without container
     queries. Measured at 1024 the four columns are 232px wide with 14px copy
     inside them — six words to a line. Two-up from here is the layout; the
     @container block at the end of this file refines it by the grid's own
     width where the query is supported. */
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1000px) {
  /* The header drops to 86px here and sits 8px below the top of the viewport,
     so the scroll offset has to drop with it. base.css's 110px is tuned to the
     98px header + its 8px inset + a 4px gap; left alone, every in-page anchor
     landed 15px too low at this width. */
  html {
    scroll-padding-top: 98px;
  }
  .header-inner {
    height: 86px;
  }
  .brand {
    width: 220px;
    flex-basis: 220px;
  }
  .primary-nav {
    gap: 20px;
  }
  .hero-content {
    grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
    gap: 18px;
  }
  /* Below the desktop hero the two actions no longer fit side by side on one
     line. Let the secondary wrap as a whole instead of breaking its label. */
  .hero-actions {
    flex-wrap: wrap;
  }
  .text-link {
    white-space: nowrap;
  }
  .visual-label {
    font-size: var(--text-sm);
  }
  .approach-layout {
    gap: var(--space-xl);
  }
  .contact-layout {
    gap: var(--space-xl);
  }
  .service-card {
    padding: var(--space-lg) var(--space-md) var(--space-md);
  }
}
/* Tablet — the step the ladder never had. At 768 the section heading sat beside
   its intro in a 253px column and broke into five lines, the approach copy was
   307px wide, and the contact form was 350px wide carrying two 103px field
   columns. All three stack from here down; the widths above 900 still have the
   room for two columns, and the column-query rules at the end of this file deal
   with the form's own width wherever it lands. */
@media (max-width: 900px) {
  .section-heading {
    display: block;
    margin-bottom: var(--space-lg);
  }
  .section-intro {
    margin-top: 22px;
  }
  .approach-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-xl);
  }
  .contact-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: var(--space-xl);
  }
  .contact-copy,
  .contact-details,
  .contact-form {
    grid-column: 1;
    grid-row: auto;
  }
}
/* 840, not 900: the sheet is the navigation below the width where a horizontal
   bar has room for the brand, three links and the CTA without crowding them.
   navigation.js still tests 900 — see the note beside the shim in footer.php. */
@media (max-width: 840px) {
  /* Matches the 76px header + its 8px inset + the same 4px gap. Without it the
     inherited 110px put every anchor 25px below the header. The ≤760px step
     already declares 88px, so the two narrow steps now agree. */
  html {
    scroll-padding-top: 88px;
  }
  /* The dropdown floats over the page, so the page must not scroll under it.
     `scrollbar-gutter: stable` keeps the space the scrollbar occupied, so
     hiding it does not shift the layout sideways on a desktop-width browser. */
  html.menu-open {
    overflow: hidden;
    scrollbar-gutter: stable;
  }
  /* The header is inset by 8px on each side (glass.css), so the gutter *inside*
     it has to be 8px smaller than the page's own gutter for the logo to sit on
     the same left edge as every section below. At 761–840 the container gutter
     is 28px, so the inner gutter is 40px total; the old 36px put the brand 2px
     inside the grid here, and the old ≤760px 36px put it 6px inside it. */
  .header-inner {
    width: calc(100% - 40px);
    height: 76px;
    gap: 10px;
  }
  .brand {
    width: 200px;
    min-width: 0;
    max-width: none;
    flex: 0 1 200px;
  }
  .js .menu-toggle {
    display: flex;
    /* 44, not the 42 it shipped with: the sheet's only trigger was 2px under
       the thumb target, which is exactly the size that misses. */
    flex: 0 0 44px;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    cursor: pointer;
  }
  .js .menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin-inline: auto;
    background: var(--ink);
    transition: transform var(--duration-fast), opacity var(--duration-fast);
  }
  .js .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
  }
  .js .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .js .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }
  .js .primary-nav {
    position: absolute;
    z-index: 1;
    top: 76px;
    left: 0;
    right: 0;
    display: none;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 18px;
    background: var(--surface-header);
    border-bottom: 1px solid var(--border-strong);
  }
  .js .primary-nav.is-open {
    display: flex;
    flex-direction: column;
    animation: nav-enter var(--duration-fast) ease-out both;
  }
  .js .primary-nav>a {
    padding: 14px 5px;
    border-bottom: 1px solid var(--border);
  }
  .js .primary-nav .nav-cta {
    margin-top: 10px;
    padding: 13px 15px;
    border: 0;
    /* The sheet stretches its rows, so this one becomes a full-width red bar.
       Its label was left-aligned inside it — a red slab with "TALK TO OUR TEAM"
       hugging the left edge and ~85px of empty fill to the right of the arrow,
       which reads as a broken button. Every other button on the site centres
       its label; so does this one now. */
    display: flex;
    justify-content: center;
    text-align: center;
  }
  .js .primary-nav [data-theme-toggle] {
    align-self: flex-start;
    margin: 12px 5px;
  }
  html:not(.js) .header-inner {
    height: auto;
    flex-wrap: wrap;
    padding-block: 12px;
  }
  html:not(.js) .menu-toggle,
  html:not(.js) [data-theme-toggle] {
    display: none;
  }
  html:not(.js) .primary-nav {
    position: static;
    display: flex;
    flex: 1 0 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
    padding: 12px 0 0;
  }

  /* The same fallback for the narrower failure where navigation.js itself does
     not load: the inline bootstrap has already added .js, so the rules above
     do not match, `.primary-nav` stays display:none and the hamburger is a dead
     control. Keying on .js-nav-ready — which only navigation.js adds — makes a
     broken script indistinguishable from JS being off, which is already handled.
     It also removes the one-frame flash of the expanded panel on a slow device,
     because the dropdown is never styled open before navigation.js runs. */
  .js:not(.js-nav-ready) .primary-nav {
    position: static;
    display: flex;
    flex: 1 0 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
    padding: 12px 0 0;
  }
  .js:not(.js-nav-ready) .menu-toggle {
    display: none;
  }
  /* The fallback nav is `position: static` and ~131px tall, but `.header-inner`
     above is pinned to `height: 76px` and the header is `position: fixed`, so
     the nav overflowed 28px ABOVE the top of the viewport — and because the
     hamburger is hidden here, there was no way to collapse it. Measured box
     y = -19.7 → 111.7 inside a 77px header. It was a faint smear at the old
     0.50 fill and an opaque white slab once the panel fill went up, so the
     raised alpha made a latent bug much more visible. Mirror the
     `html:not(.js)` twin so the header grows to fit its contents. */
  .js:not(.js-nav-ready) .header-inner {
    height: auto;
    flex-wrap: wrap;
    padding-block: 12px;
  }
}
@media (max-width: 760px) {
  html {
    scroll-padding-top: 88px;
  }
  .container {
    width: min(100% - 40px, var(--container));
  }
  /* Single column well before the 370px breakpoint. Between 371px and 760px
     the grid stayed two-up, which left each card about 200px wide with 14px
     body copy inside it — cramped on a 375px or 390px phone, while a 360px
     device got the clean single column. That inconsistency was backwards.
     The declaration that actually takes effect is further down this same
     block; this comment marks the intent. */
  .header-inner {
    /* 24px total, not 36: the container's gutter is 20px at this width and the
       header is already inset 8px, so the logo lands on the same edge as the
       section copy (measured 20px before, 26px after the old rule). */
    width: calc(100% - 24px);
    height: 76px;
    gap: 10px;
  }
  .brand {
    width: 200px;
    min-width: 0;
    max-width: none;
    flex: 0 1 200px;
  }
  .hero {
    min-height: 0;
  }
  .hero {
    padding-top: var(--space-2xl);
  }
  .hero-content {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    padding-top: var(--space-xl);
    padding-bottom: var(--space-2xl);
  }
  .hero-copy {
    max-width: 580px;
  }
  .hero-lead {
    font-size: var(--text-base);
  }
  .hero-note {
    margin-top: var(--space-lg);
  }
  .hero-visual {
    width: min(78vw, 370px);
    margin: 22px auto 0;
  }
  .hero-bottom {
    padding-inline: 20px;
    font-size: var(--text-xs);
  }
  .hero-bottom span:nth-child(2) {
    display: none;
  }
  .trust-inner {
    min-height: var(--space-2xl);
  }
  .trust-inner ul {
    flex-wrap: wrap;
  }
  .trust-inner li {
    flex: 0 0 50%;
    min-height: 36px;
    font-size: var(--text-sm);
  }
  .trust-inner li:nth-child(2) {
    border-right: 0;
  }
  .trust-inner li:nth-child(-n+2) {
    border-bottom: 1px solid color-mix(in srgb, var(--surface) 22%, transparent);
  }
  .section {
    padding: var(--space-2xl) 0;
  }
  .service-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .service-card {
    min-height: 300px;
    padding: var(--space-lg) var(--space-md) var(--space-md);
  }
  .approach-section {
    padding: var(--space-2xl) 0;
  }
  .approach-art {
    min-height: 0;
    aspect-ratio: 1.55;
  }
  .approach-art .approach-feature {
    gap: 20px;
    padding: 42px 16px;
  }
  .approach-art .approach-feature img {
    width: 105px;
  }
  .contact-section {
    padding: var(--space-2xl) 0;
  }
  .contact-details {
    margin-top: 0;
  }
  .contact-form {
    padding: var(--space-lg) var(--space-md);
  }
  /* No hero on the not-found page, so its clearance shrinks with the header
     (76px from 840 down) rather than staying at the desktop figure. */
  .not-found {
    padding-block: calc(var(--space-2xl) + var(--space-md)) var(--space-2xl);
  }
  .footer-main {
    padding-block: var(--space-lg);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
  }
  .footer-main nav {
    grid-column: 1/-1;
    flex-wrap: wrap;
    gap: 15px 22px;
  }
  .footer-main>p {
    justify-self: end;
  }
  .footer-bottom {
    gap: 10px;
    font-size: var(--text-sm);
  }
}
@media (max-width: 430px) {
  .brand {
    width: 175px;
    flex-basis: 175px;
  }
  /* The label column is subgrid now (sections.css), so the gap lives on the
     list, not the row: the old fixed 96px here was what broke "Operating
     hours" across two lines. */
  .contact-details dl {
    column-gap: 10px;
  }
  .contact-details dl>div {
    gap: 10px;
  }
  .approach-art .approach-feature {
    gap: 13px;
  }
  .approach-art .approach-feature img {
    width: 83px;
  }
  /* The feature copy plus the 62px caption need more than the 1.55 aspect
     gives at this width; without the floor "PREPARE." sits under the caption. */
  .approach-art {
    min-height: calc(var(--space-3xl) * 2 + var(--space-sm));
  }
  .approach-feature p {
    font-size: var(--text-2xl);
  }
  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-sm);
  }
  .hero-bottom span:first-child {
    display: none;
  }
  .hero-bottom {
    justify-content: flex-end;
  }
  .trust-inner li { font-size: var(--text-sm); }
  .service-card {
    min-height: 325px;
  }
  .service-card p {
    font-size: var(--text-base);
  }
  .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .form-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
  .form-bottom .button {
    width: 100%;
  }
  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: var(--space-sm);
    font-size: var(--text-xs);
  }
}
@media (max-width: 370px) {
  .service-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .service-card {
    min-height: 0;
    /* Horizontal padding returns here. It was zeroed while the cards were
       divided by shared rules, which made card text sit flush against the
       viewport edge at exactly the narrowest widths. */
    padding: var(--space-md) var(--space-sm);
  }
  .contact-form label {
    font-size: var(--text-md);
  }
  .contact-form input:not([type="checkbox"]):not([type="radio"]),
  .contact-form textarea {
    font-size: var(--text-lead);
  }
  .contact-form .consent {
    font-size: var(--text-md);
  }
  .footer-main {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer-main>p {
    justify-self: start;
  }
}
/* ---------------------------------------------------------------------------
   Touch — a thumb needs 44px, a pointer does not
   ---------------------------------------------------------------------------
   The inline links below are 24–25px tall by default (WCAG 2.5.8's floor,
   measured: .text-link 42.9, .map-link 25.4, footer links 24). That is right
   for a mouse and wrong for a thumb, so from 840 down they get a real target.
   The height is added as min-height, not fixed height, so a wrapped label grows
   instead of clipping. The primary button (54), the theme toggle (44), the form
   controls (46) and the sheet rows (48) already clear it.
   ------------------------------------------------------------------------- */
@media (max-width: 840px) {
  /* Measured at 768, the button (216) plus the text link (143) plus their 27px
     gap came to 385.5px inside a 386px column — one font substitution away from
     overflowing. Wrap rather than overflow. */
  .hero-actions {
    flex-wrap: wrap;
  }
  .text-link,
  .map-link,
  .contact-details a,
  .service-card>a,
  .footer-main nav a {
    min-height: 44px;
  }
}

/* ---------------------------------------------------------------------------
   Container queries — a block reflows by its own width, not the viewport's
   ---------------------------------------------------------------------------
   The viewport is a proxy for the space a block actually gets, and on this page
   it is a poor one: the service grid is 687px wide at 768 and 1200px at 1440,
   while the same viewport widths give the contact form 683px and 511px.

   Each block below names itself an inline-size container, and the rules that
   depend on its width move into @container. The viewport rules above stay as
   the **baseline** — they are what a browser without container queries uses,
   and they are correct at every width, just less finely tuned. Nothing here is
   required for the layout to hold together.
   ------------------------------------------------------------------------- */

/* The four service cards. 980px is where four cards stop leaving room for a
   14px line of copy (measured 232px columns at 1024, six words per line);
   560px is where two stop being enough. */
.services-section .container {
  container-type: inline-size;
  container-name: services;
}
@container services (max-width: 980px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container services (max-width: 560px) {
  .service-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The enquiry form's field row. Measured at 768 the form was 350px wide and the
   two columns inside it were 103px each; below 452px of form width — which is
   every phone, and nothing at 1024 or above — the pair stacks. */
.contact-form {
  container-type: inline-size;
  container-name: enquiry;
}
@container enquiry (max-width: 452px) {
  .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/* ---------------------------------------------------------------------------
   Display type measured against its own column
   ---------------------------------------------------------------------------
   A vw clamp cannot be right for a heading whose column is half the viewport at
   768 and the full container at 900. `cqi` is a percentage of the container's
   inline size, so a heading sized in cqi keeps its proportion to the column it
   actually sits in at every width: 15.5cqi of a 350px copy column is 54px, of a
   610px one it is 95px — no jumps at a breakpoint, and no 78px heading crammed
   into a 511px column (which is what `.contact-copy h2` was doing: measured
   624px of word in a 511px column at 1440).

   The clamps in sections.css remain the baseline and stay in use where
   container units are unknown. This is an enhancement; the layout does not
   depend on it.
   ------------------------------------------------------------------------- */
@supports (container-type: inline-size) {
  .hero-copy,
  .section-heading>div,
  .approach-copy,
  .contact-copy,
  .not-found .container {
    container-type: inline-size;
  }
  .hero h1 {
    font-size: clamp(40px, 15.5cqi, 96px);
  }
  .section-heading h2,
  .approach-copy h2,
  .contact-copy h2,
  .not-found h1 {
    font-size: clamp(34px, 12cqi, 64px);
  }
}

/* Consolidated reduced-motion handling for every animated element. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .js-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-copy > *,
  .hero-visual,
  .hero-bottom,
  .visual-label,
  .trust-inner li,
  .section-heading,
  .service-card,
  .approach-art,
  .approach-copy,
  .approach-feature,
  .contact-copy,
  .contact-details,
  .contact-form,
  .contact-details dl > div,
  .footer-main {
    animation: none !important;
    transition: none !important;
  }
  .eyebrow-dot,
  .visual-orbit,
  .visual-core,
  .contact-glow,
  .hero-grid,
  .hero::before,
  .approach-art::before {
    animation: none !important;
  }
  .service-card:hover,
  .button:hover,
  .nav-cta:hover,
  .primary-nav > a:not(.nav-cta):hover,
  .service-card > a:hover,
  /* The card's icon lead is its own hover target — it lifts 4px and scales by
     8% — and it is a descendant, so nulling the card above did not reach it. */
  .service-card:hover .service-icon img,
  .approach-art:hover,
  .contact-form:hover,
  .brand:hover,
  /* Was missing while `.approach-feature` kept its `translate: 0 -4px` lift and
     its red border on hover — the last animated element not gated here. */
  .approach-feature:hover,
  [data-theme-toggle]:hover {
    transform: none !important;
    box-shadow: none !important;
    /* The hover lifts moved to the independent transform properties, which
       `transform: none` above does not touch. */
    translate: none !important;
    scale: none !important;
    rotate: none !important;
  }
}
