/*
 * Responsive layer — loaded last so its media queries override the desktop-first
 * compositions above without needing higher specificity.
 *
 * Breakpoints (report §C): desktop 900px+, tablet 640–899px, mobile 320–639px.
 * Extra 1120px step keeps the 4-up service grid and header from crowding on small
 * laptops. Everything below 900px collapses to single-column with touch-sized controls.
 */

@media (max-width: 1120px) {
  .header-shell {
    grid-template-columns: 190px minmax(0, 1fr) auto;
    gap: var(--space-5);
  }

  .desktop-nav {
    gap: 18px;
  }

  /* The contact CTA is still reachable from the nav and the footer. */
  .header-cta {
    display: none;
  }

  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-card {
    min-block-size: 320px;
  }

  .section-heading,
  .intro-layout,
  .trust-layout,
  .story-layout {
    gap: 54px;
  }

  .service-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-main {
    grid-template-columns: 1.2fr 0.7fr 0.9fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  :root {
    --header-h: var(--header-h-mobile);
    --header-h-scrolled: var(--header-h-mobile);
  }

  .header-shell {
    inline-size: min(calc(100% - var(--gutter-narrow)), var(--container-wide));
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand {
    inline-size: 158px;
    block-size: 44px;
  }

  .desktop-nav,
  .header-actions .language-switch {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }

  .section-heading,
  .intro-layout,
  .trust-layout,
  .story-layout,
  .group-panel,
  .closing-cta__inner,
  .founder-panel,
  .presence-panel,
  .contact-layout,
  .legal-layout,
  .focus-panel,
  .sector-focus,
  .sectors-showcase {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-heading {
    gap: var(--space-6);
  }

  .section-heading__copy p,
  [dir="rtl"] .section-heading__copy p {
    margin-inline: 0;
  }

  .intro-layout__aside {
    position: static;
  }

  .intro-layout__aside p {
    max-inline-size: 620px;
  }

  .focus-panel__visual,
  .focus-panel__content,
  .sector-focus__visual,
  .sector-focus__content {
    min-block-size: 480px;
  }

  /* Process becomes a readable vertical sequence with the rail on the inline start. */
  .process {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
  }

  .process::before,
  [dir="rtl"] .process::before {
    inset-inline: auto;
    inset-inline-start: 39px;
    inset-block: 39px;
    inline-size: 1px;
    block-size: auto;
    background: var(--rule-navy);
  }

  .process-step {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: var(--space-6);
    padding: 0;
    text-align: start;
  }

  .process-step__number {
    margin: 0;
  }

  .process-step__copy {
    padding-block-start: var(--space-3);
  }

  .sector-feature {
    min-block-size: 430px;
  }

  .group-panel__mark {
    display: none;
  }

  .closing-cta__actions {
    justify-content: flex-start;
  }

  .founder-panel__portrait {
    min-block-size: 390px;
  }

  .founder-panel__content {
    min-block-size: 0;
  }

  .service-detail,
  .service-detail--reverse {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-detail--reverse .service-detail__visual {
    order: initial;
  }

  .service-detail__visual {
    min-block-size: 300px;
  }

  .sector-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .legal-toc {
    position: static;
  }

  .legal-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  :root {
    --section: 4.75rem;
    --section-tight: 3.5rem;
    --gutter: var(--gutter-narrow);
  }

  h1 {
    font-size: clamp(2.35rem, 11vw, 4rem);
  }

  h2 {
    font-size: clamp(1.9rem, 8.5vw, 2.8rem);
  }

  .hero {
    min-block-size: 820px;
  }

  /* Shift the focal point so the subject stays visible in a narrow crop. */
  .hero .media-cover img {
    object-position: 67% center;
  }

  /* Text sits at the bottom on mobile, so the scrim runs bottom-to-top in both
     directions rather than side-to-side. */
  .hero__overlay,
  [dir="rtl"] .hero__overlay {
    background: linear-gradient(0deg, rgba(4, 18, 30, 0.98) 0%, rgba(4, 18, 30, 0.78) 63%, rgba(4, 18, 30, 0.3) 100%);
  }

  .hero__inner {
    padding-block: 150px 44px;
  }

  .hero__content {
    margin-block-start: auto;
  }

  .hero__lead {
    margin-block-start: var(--space-6);
    font-size: 1rem;
  }

  .hero__actions,
  .not-found__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero__actions .button,
  .not-found__actions .button {
    inline-size: 100%;
  }

  .hero__facts {
    margin-block-start: var(--space-9);
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-fact,
  .hero-fact + .hero-fact {
    padding: 14px 0;
    border-inline-start: 0;
    border-block-end: 1px solid rgba(255, 255, 255, 0.14);
  }

  .page-hero {
    padding-block: 132px 66px;
  }

  .page-hero h1 {
    font-size: clamp(2.35rem, 10vw, 4rem);
  }

  .page-hero::before {
    inline-size: 380px;
    block-size: 380px;
    inset-block-start: -240px;
    inset-inline-end: -120px;
    border-width: 80px;
  }

  .breadcrumb {
    margin-block-end: 28px;
  }

  .services-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-card {
    min-block-size: 0;
  }

  .service-card .icon-box,
  .sector-card .icon-box {
    margin-block-end: var(--space-7);
  }

  .focus-panel__visual,
  .sector-focus__visual {
    min-block-size: 320px;
  }

  .focus-panel__content,
  .sector-focus__content {
    min-block-size: 0;
    padding: 36px 26px;
  }

  .focus-panel__visual .media-cover img,
  .sector-focus__visual .media-cover img {
    object-position: 68% center;
  }

  .trust-list,
  .principles,
  .value-strip,
  .group-list,
  .sector-cards,
  .service-detail__points,
  .form-grid,
  .legal-toc ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .principle--feature {
    min-block-size: 360px;
    grid-row: auto;
  }

  .principle__number {
    margin-block-end: var(--space-9);
  }

  .value-item + .value-item {
    border-inline-start: 0;
    border-block-start: 1px solid var(--line);
  }

  .group-company,
  .group-company:nth-child(even) {
    padding-inline: 0;
    border-inline-start: 0;
  }

  .field--full {
    grid-column: auto;
  }

  .service-detail__content {
    padding: 34px 26px;
  }

  .contact-info__top,
  .contact-list,
  .contact-form-shell {
    padding-inline: 26px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .button {
    inline-size: 100%;
  }

  .form-note {
    max-inline-size: none;
  }

  .map-placeholder {
    min-block-size: 320px;
  }

  .legal-content {
    padding: 28px 22px;
  }

  .presence-map,
  .presence-copy {
    min-block-size: 360px;
  }

  .presence-copy {
    padding: 32px 26px;
  }

  .footer-main {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-8);
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-brand img {
    inline-size: 174px;
    block-size: 62px;
  }

  .footer-legal {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-block: var(--space-6);
  }
}

/* 320px: the narrowest supported viewport — nothing may overflow horizontally. */
@media (max-width: 380px) {
  :root {
    --gutter: 24px;
  }

  .hero__inner,
  .page-hero__inner {
    inline-size: calc(100% - var(--gutter));
  }

  .mobile-nav a {
    font-size: 1.35rem;
  }

  .trust-item {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: var(--space-3);
  }

  .service-detail__visual svg {
    inline-size: 72px;
    block-size: 72px;
  }
}

/*
 * Touch devices: enlarge the dense text-link lists to a 44px tap target.
 *
 * These lists (footer columns, the legal table of contents, breadcrumbs, the service-detail
 * aside) already clear WCAG 2.2 AA's 24px minimum at 32px, but 32px is a small target for a
 * thumb. Scoped to `pointer: coarse` so the approved desktop spacing is untouched — the extra
 * height only appears where a finger is actually doing the pointing.
 */
@media (pointer: coarse) {
  .footer-column a,
  .footer-legal a,
  .legal-toc a,
  .service-body__aside a,
  .breadcrumb a {
    min-block-size: 44px;
    align-items: center;
  }

  .breadcrumb a {
    display: inline-flex;
  }
}

/* Forced-colors / high-contrast: keep structure legible when colours are overridden. */
@media (forced-colors: active) {
  .icon-box,
  .status-pill,
  .status-tag,
  .product-chip,
  .sector-row__arrow,
  .trust-item__number,
  .process-step__number {
    border: 1px solid CanvasText;
  }

  .button {
    border: 1px solid ButtonText;
  }
}

/*
 * Reduced motion. Lives here, in the last-loaded stylesheet, so it wins the cascade over the
 * hover transforms declared in components.css at equal specificity — putting it in base.css
 * looked correct but silently lost, leaving the hover lift applying instantly.
 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js-reveal .reveal,
  .js-reveal .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  /*
   * Zeroing transition-duration is not enough on its own: the hover lift, the arrow nudge and
   * the service-card medallion are transforms, so they still applied — just instantly, which is
   * a harder jolt than the animation it replaced. Suppress the movement and let colour carry
   * the hover state. RTL keeps its mirror, which is direction, not motion.
   */
  .button:hover,
  .button:active,
  .button:hover .button__arrow,
  .text-link:hover svg,
  .service-card:hover::after,
  .service-card:focus-within::after {
    transform: none;
  }

  [dir="rtl"] .button:hover .button__arrow,
  [dir="rtl"] .text-link:hover svg {
    transform: scaleX(-1);
  }
}
