/* =====================================================================
   Arabian Hills Developers — main stylesheet (v3)
   Locked brand palette + Unbounded / Montserrat type + restrained motion.
   No framework and no build step: the reset lives in @layer reset and the
   utility classes are hand-authored in @layer utilities.
   ===================================================================== */

@layer reset, base, layout, components, animations, sections, utilities;

/* ---------- Tokens: the only colours allowed anywhere (Black / Red / White) ---------- */
:root {
  /* Brand core */
  --black:            #000000;
  --white:            #FFFFFF;
  --brand-red:        #ED0A0A;   /* logo red: eyebrows, buttons, active states, small accents */
  --brand-red-hover:  #C20808;
  --brand-red-pressed:#9A0606;

  /* Black surface scale: hero, stats band, footer, mobile menu, dark cards */
  --ink-950:          #0E0E0E;
  --ink-900:          #151515;
  --ink-800:          #1E1E1E;
  --ink-700:          #2A2A2A;

  /* Neutral greys: secondary text and icons on dark */
  --grey-300:         #D6D6D6;
  --grey-500:         #9A9A9A;
  --grey-600:         #6E6E6E;
  --grey-700:         #5C5C5C;   /* muted text on light surfaces */

  /* Light surfaces (unchanged) */
  --cream:            #F6F3F2;
  --ink:              #0D0D0D;   /* body text on cream and white */

  /* Hairlines */
  --line-light: color-mix(in srgb, var(--ink-950) 14%, transparent);
  --line-dark:  color-mix(in srgb, var(--grey-300) 22%, transparent);

  /* Type */
  --ff-display: "Unbounded", sans-serif;
  --ff-body:    "Montserrat", sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur-base: 300ms;
  --dur-slow: 400ms;
  --dur-hero: 700ms;

  /* Shape */
  --radius: 6px;
  --radius-pill: 999px;
  --header-h: 72px;

  /* Derived */
  --grad-ink:    linear-gradient(160deg, var(--ink-900) 0%, var(--ink-950) 100%);
  --shadow-card: 0 18px 40px color-mix(in srgb, var(--ink-950) 18%, transparent);

  /* Floating WhatsApp button keeps its brand green: the only non-palette colour */
  --whatsapp:    #25D366;

  /* Brand bronze (locked palette): hero eyebrow text on the photo */
  --bronze:      #C6AB95;

  /* Focus ring: ink on light surfaces; dark sections set their own red focus */
  --focus: var(--ink-700);
}

/* ---------- Reset ---------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; border: 0 solid; border-color: var(--line-light); }
  html, body { margin: 0; overflow-x: clip; }
  h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
  ol, ul { padding: 0; list-style: none; }
  img, svg, video { display: block; max-width: 100%; }
  img { height: auto; }
  a { color: inherit; text-decoration: inherit; }
  button, input, textarea, select { font: inherit; color: inherit; margin: 0; }
  button { background: transparent; cursor: pointer; padding: 0; }
  textarea { resize: vertical; }
}

/* ---------- Base ---------- */
@layer base {
  html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
  body {
    font-family: var(--ff-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
  }
  p { max-width: 65ch; text-wrap: pretty; }

  h1, h2, h3, h4 { font-family: var(--ff-display); line-height: 1.15; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
  h1, .t-h1 { font-family: var(--ff-display); font-weight: 700; font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.15; letter-spacing: -0.02em; max-width: 16ch; }
  h2, .t-h2 { font-family: var(--ff-display); font-weight: 700; font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.15; letter-spacing: -0.02em; max-width: 22ch; }
  h3, .t-h3 { font-family: var(--ff-display); font-weight: 500; font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.15; }
  h4, .t-h4 { font-family: var(--ff-display); font-weight: 300; font-size: 1.05rem; line-height: 1.3; }
  .t-small { font-size: 0.875rem; }
  .t-label { font-family: var(--ff-body); font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: var(--grey-700); }
  .t-quote { font-family: var(--ff-body); font-weight: 500; font-size: 1.35rem; line-height: 1.5; color: var(--cream); }
  .t-ui { font-family: var(--ff-body); font-weight: 500; }

  /* Focus: instant, never animated */
  :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; transition: none; }
}

/* ---------- Layout ---------- */
@layer layout {
  .container { width: 100%; max-width: 80rem; margin-inline: auto; padding-inline: 1rem; }
  @media (min-width: 640px) { .container { padding-inline: 1.5rem; } }
  @media (min-width: 1024px) { .container { padding-inline: 2rem; } }
  .section { padding-block: 5rem; }
  @media (min-width: 640px) { .section { padding-block: 7rem; } }
}

/* ---------- Components ---------- */
@layer components {

  /* Logo (reversed: white mark, red HILLS) */
  /* min-height lifts the tap target to 44px; the 40px mark stays visually centred,
     so nothing moves in the 72px header bar. */
  .logo { display: inline-flex; align-items: center; min-height: 44px; gap: .75rem; color: var(--white); }
  .logo__mark { width: 40px; height: 40px; flex: none; }
  .logo__word { font-family: var(--ff-display); font-weight: 500; font-size: 1rem; line-height: 1.1; text-transform: uppercase; letter-spacing: .02em; color: var(--white); }
  .logo__hills { color: var(--brand-red); }
  /* Supplied logo artwork. 44px matches the lockup it replaced, so the header bar
     and footer keep their exact dimensions and the nav does not move. */
  .logo__img { display: block; height: 48px; width: auto; }
  /* The footer brand block has vertical room the 72px header bar does not, so the
     stacked wordmark gets to be legible there. */
  .site-footer .logo__img { height: 72px; }
  /* Logo always renders in its original colours: no filter, opacity or blend on any logo element */
  img.logo, .logo__img, .site-logo, header .logo img, header .logo { filter: none !important; opacity: 1 !important; mix-blend-mode: normal !important; }
  /* The artwork is black + red, which disappears on navy. Reverse it to white on
     dark surfaces until a proper reversed logo file exists. */
  /* logo colour filters removed: see the override below */

  .logo--light, .logo--light .logo__word { color: var(--ink); }
  .logo--light .logo__sub { color: var(--grey-700); }
  .logo__sub { display: block; font-family: var(--ff-body); font-weight: 500; font-size: .8125rem; color: var(--grey-300); text-transform: none; letter-spacing: 0; margin-top: 2px; }

  /* Header — solid white resting state on every page */
  .site-header {
    position: sticky; top: 0; z-index: 70;
    background: var(--white);
    border-bottom: 1px solid var(--line-dark);
    --focus: var(--ink-700);
    transition: background-color 300ms ease, border-color 300ms ease, transform var(--dur-base) var(--ease-out);
  }
  .site-header::after { /* soft, low shadow fades in via opacity only */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    box-shadow: 0 4px 18px color-mix(in srgb, var(--ink-950) 10%, transparent);
    opacity: 0; transition: opacity 300ms ease;
  }
  /* Header contents on white: black menu, dark grey region label, original logo colours */
  .site-header .logo, .site-header .logo__word { color: #000000; }
  .site-header .logo__sub { color: #333333; }
  .site-header .menu-toggle { color: #000000; }
  .site-header .nav__link { color: #000000; }
  .site-header .nav__link:hover,
  .site-header .nav__link[aria-current="page"] { color: #000000; }

  /* Static region label — plain informational text, never a menu */
  .header-region {
    display: none; align-items: center; white-space: nowrap;
    font-family: var(--ff-body); font-weight: 500; font-size: .75rem;
    letter-spacing: .1em; color: #333333;
    padding-left: 1rem; margin-left: -.5rem;
    border-left: 1px solid var(--line-dark);
    transition: color 300ms ease;
  }
  @media (min-width: 1024px) { .header-region { display: inline-flex; } }
  /* The bar is tightest right where the desktop nav appears: keep the label and the
     logo lockup on one line each between 1024 and 1200 instead of letting them wrap. */
  .site-header .logo__word { white-space: nowrap; }
  @media (min-width: 1024px) and (max-width: 1199.98px) {
    .header-region { padding-left: .75rem; margin-left: -.35rem; letter-spacing: .06em; }
  }
  /* The bar sits above the mobile panel and its overlay, so logo and close button stay crisp */
  .site-header__bar { position: relative; z-index: 65; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; transition: transform var(--dur-base) var(--ease-out); }
  @media (min-width: 1024px) {
    /* 72px → 64px visible height using transform only */
    .site-header.is-scrolled { transform: translateY(-8px); }
    .site-header.is-scrolled .site-header__bar { transform: translateY(4px); }
  }
  .site-header.is-scrolled::after { opacity: 1; }

  .nav { display: none; align-items: center; gap: 2.25rem; }
  @media (min-width: 1024px) { .nav { display: flex; } }
  /* Tighten the gap in the band where the bar is most crowded. Must come after the
     rule above: same specificity, so source order decides. */
  @media (min-width: 1024px) and (max-width: 1199.98px) { .nav { gap: 1.5rem; } }
  /* .6rem of vertical padding takes the tap target to 44px (25.1px line box + 2 x 9.6px).
     The bar is a fixed 72px and centres its contents, so the text does not move. */
  .nav__link { position: relative; display: inline-block; padding: .6rem 0; font-weight: 500; font-size: .95rem; color: var(--ink-700); transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
  .nav__link::after {
    /* hover: bronze underline growing left-to-right; current page keeps the red marker */
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--brand-red);
    transform: scaleX(0); transform-origin: left; transition: transform 250ms var(--ease-in-out);
  }
  .nav__link:hover { transform: translateY(-2px); color: var(--ink-900); }
  .nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }
  .nav__link[aria-current="page"] { color: var(--ink-900); }
  .nav__link[aria-current="page"]::after { background: var(--brand-red); }

  .menu-toggle { display: none; color: var(--ink); width: 44px; height: 44px; align-items: center; justify-content: center; margin-right: -.5rem; border-radius: var(--radius); position: relative; z-index: 2; }
  .js .menu-toggle { display: inline-flex; }
  @media (min-width: 1024px) { .js .menu-toggle { display: none; } }

  /* Mobile menu: without JS it is a plain expanded list below the bar */
  .mobile-menu { background: var(--ink-950); border-top: 1px solid var(--line-dark); --focus: var(--brand-red); }
  /* No-JS on small screens: the header holds the expanded list, so it scrolls away instead of sticking */
  @media (max-width: 1023.98px) { html:not(.js) .site-header { position: relative; } }
  /* With JS: a white panel that slides in from the right over a dimmed overlay */
  .js .mobile-menu {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto;
    width: min(86vw, 22rem); z-index: 60;
    border-top: 0; border-left: 1px solid var(--line-dark);
    padding-top: calc(var(--header-h) + .25rem);
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    display: flex; flex-direction: column;
    visibility: hidden; transform: translateX(100%);
    transition: transform 300ms ease, visibility 0s linear 300ms;
    overflow-y: auto; overscroll-behavior: contain;
  }
  .js .mobile-menu.is-open { visibility: visible; transform: none; transition-delay: 0s; }
  /* Desktop: the panel is removed outright, not just hidden. This has to come after the
     `.js .mobile-menu` rules above — same specificity (0,2,0), so source order decides. */
  @media (min-width: 1024px) { .mobile-menu, .js .mobile-menu { display: none; } }
  .mobile-menu__link { display: block; padding: .95rem 0 .95rem .9rem; color: var(--white); font-weight: 500; font-size: 1.05rem; border-bottom: 1px solid var(--line-light); border-left: 2px solid transparent; }
  .mobile-menu__link[aria-current="page"] { color: var(--white); border-left-color: var(--brand-red); }
  /* Region label at the top of the panel */
  .mobile-menu__region {
    font-family: var(--ff-body); font-weight: 500; font-size: .75rem;
    letter-spacing: .1em; color: var(--white);
    padding-bottom: .9rem; margin-bottom: .25rem;
    border-bottom: 1px solid var(--line-dark);
  }
  /* Dimming overlay (decorative; only exists with JS) */
  .menu-overlay { display: none; }
  .js .menu-overlay {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: var(--ink-950);
    opacity: 0; visibility: hidden;
    transition: opacity 300ms ease, visibility 0s linear 300ms;
  }
  .js .menu-overlay.is-open { opacity: .55; visibility: visible; transition-delay: 0s; }
  @media (min-width: 1024px) { .js .menu-overlay { display: none; } }
  body.menu-open { overflow: hidden; }

  /* Buttons: fill sweep via a pseudo-element */
  .btn {
    position: relative; isolation: isolate; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    min-height: 48px; padding: .8rem 1.5rem;
    font-family: var(--ff-body); font-weight: 500; font-size: .875rem; line-height: 1.2;
    text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
    border-radius: var(--radius); border: 1px solid transparent;
    transition: color var(--dur-base) var(--ease-in-out), border-color var(--dur-base) var(--ease-in-out), transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
  }
  .btn::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    transform: scaleX(0); transform-origin: left;
    transition: transform var(--dur-base) var(--ease-in-out);
  }
  .btn:hover::before { transform: scaleX(1); }
  @media (hover: hover) {
    .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px color-mix(in srgb, var(--ink-950) 16%, transparent); }
  }
  .btn:active { transform: translateY(1px); box-shadow: none; }
  .btn svg { width: 1.15rem; height: 1.15rem; flex: none; }
  .btn__arrow { display: inline-block; transition: transform var(--dur-base) var(--ease-out); }
  .btn:hover .btn__arrow { transform: translateX(4px); }
  .btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
  .btn--lg { min-height: 52px; padding: .9rem 1.75rem; }
  .btn--sm { min-height: 44px; padding: .55rem 1.15rem; }

  .btn--primary { background: var(--brand-red); color: var(--white); }
  .btn--primary::before { background: var(--brand-red-hover); }

  .btn--outline-ink { border-color: var(--ink); color: var(--ink); }
  .btn--outline-ink::before { background: var(--ink-950); }
  .btn--outline-ink:hover { color: var(--white); border-color: var(--ink-950); }

  .btn--outline-cream { border-color: var(--cream); color: var(--cream); }
  .btn--outline-cream::before { background: var(--cream); }
  .btn--outline-cream:hover { color: var(--ink); }

  /* Ghost link */
  .ghost-link { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 500; color: var(--ink); }
  .ghost-link span:first-child { border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
  .ghost-link .btn__arrow { color: var(--ink); transition: transform var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out); }
  .ghost-link:hover .btn__arrow { color: var(--grey-600); transform: translateX(4px); }

  /* Hairline rule */
  .rule { display: block; width: 72px; height: 2px; background: var(--brand-red); }
  .rule--ink { background: var(--ink); }

  /* Badges */
  .badge { display: inline-flex; align-items: center; font-family: var(--ff-body); font-weight: 500; font-size: .8125rem; line-height: 1; padding: .5rem .75rem; border-radius: var(--radius); }
  .badge--bronze { background: var(--ink-950); color: var(--brand-red); }
  .badge--navy { background: var(--ink-700); color: var(--white); }
  .badge--cream { background: var(--cream); color: var(--ink); border: 1px solid var(--line-light); }

  /* Icons */
  .icon { width: 1.5rem; height: 1.5rem; flex: none; }
  .icon-tile { width: 3.5rem; height: 3.5rem; border-radius: var(--radius); background: var(--ink-700); color: var(--brand-red); display: inline-flex; align-items: center; justify-content: center; }

  /* Cards on light */
  .card { position: relative; background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; }
  .card--flat { box-shadow: none; }
  /* Interactive cards: lift, bronze top hairline, image scale */
  .card--lift { box-shadow: none; transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out); }
  .card--lift::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 2; background: var(--brand-red);
    transform: scaleX(0); transform-origin: left; transition: transform var(--dur-slow) var(--ease-out);
  }
  /* Lift only where a real pointer can hover; touch taps get no sticky hover state */
  @media (hover: hover) {
    .card--lift:hover { transform: translateY(-6px); box-shadow: 0 12px 30px color-mix(in srgb, var(--ink-950) 12%, transparent); }
    .card--lift:hover::before { transform: scaleX(1); }
    .card--lift:hover .media img { transform: scale(1.03); }
    /* press feedback: eases back down without fully returning to rest */
    .card--lift:active { transform: translateY(-2px); }
  }

  /* Cards on dark */
  .card-dark { background: var(--ink-700); border: 1px solid var(--line-dark); border-radius: var(--radius); }

  /* Image slot: navy-toned placeholder treatment */
  .media { position: relative; overflow: hidden; background: var(--ink-700); }
  .media img { width: 100%; height: 100%; object-fit: cover; filter: none; mix-blend-mode: normal; opacity: 1; transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-slow) var(--ease-out); }
  .media__badge { position: absolute; top: 1rem; left: 1rem; z-index: 1; }
  .media__caption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 1.5rem; background: var(--ink-950); color: var(--cream); }
  .media__caption h3, .media__caption .t-h3 { color: var(--white); }

  /* Project card text */
  .project__code { font-size: .875rem; font-weight: 500; color: var(--grey-700); }
  .project__meta { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--grey-700); }

  /* Filters */
  .filter-btn {
    min-height: 44px; padding: .55rem 1.1rem; border-radius: var(--radius-pill);
    border: 1px solid var(--grey-700); color: var(--ink); font-weight: 500; font-size: .95rem;
    transition: background-color var(--dur-base) var(--ease-in-out), color var(--dur-base) var(--ease-in-out), border-color var(--dur-base) var(--ease-in-out);
  }
  .filter-btn:hover { border-color: var(--ink-700); }
  .filter-btn[aria-pressed="true"] { background: var(--ink-700); border-color: var(--ink-700); color: var(--white); }
  .project-card[hidden] { display: none; }

  /* Form */
  .label { display: block; font-weight: 500; color: var(--ink); }
  .field {
    width: 100%; min-height: 48px; margin-top: .5rem; padding: .75rem 1rem;
    background: var(--white); color: var(--ink);
    border: 1px solid var(--grey-700); border-radius: var(--radius);
    transition: border-color var(--dur-fast) var(--ease-out);
  }
  .field:hover { border-color: var(--ink-700); }
  .field:focus { outline: 2px solid var(--ink-700); outline-offset: 1px; border-color: var(--ink-700); }
  .field[aria-invalid="true"] { border-color: var(--brand-red); }
  .field:disabled { background: var(--cream); cursor: not-allowed; }
  .field-error { margin-top: .35rem; color: var(--brand-red); font-size: .875rem; font-weight: 500; }
  .js .field-error:not(.hidden) { animation: error-in var(--dur-base) var(--ease-out); }

  /* Timeline */
  .timeline { position: relative; }
  .timeline__line { position: absolute; left: 7px; top: .5rem; bottom: .5rem; width: 2px; background: var(--brand-red); transform-origin: top; }
  .timeline__item { position: relative; padding-left: 3rem; }
  .timeline__dot { position: absolute; left: 0; top: .3rem; width: 16px; height: 16px; border-radius: 50%; background: var(--white); border: 3px solid var(--brand-red); }

  /* Contact details list on dark */
  .detail { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; padding-block: 1.25rem; border-bottom: 1px solid var(--line-dark); }
  .detail:last-child { border-bottom: 0; }

  /* Social */
  .social { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--ink-700); color: var(--grey-500); transition: background-color var(--dur-base) var(--ease-in-out), color var(--dur-base) var(--ease-in-out); }
  .social:hover { background: var(--brand-red); color: var(--white); }

  /* Floating WhatsApp button (all pages). The green is this icon's brand colour only. */
  .wa-float {
    position: fixed; z-index: 45;
    right: calc(1rem + env(safe-area-inset-right, 0px));
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    width: 54px; height: 54px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--whatsapp); color: var(--white);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--ink-950) 26%, transparent);
    --focus: var(--ink-700);
    transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), opacity 400ms var(--ease-out);
  }
  .wa-float svg { width: 28px; height: 28px; }
  @media (min-width: 640px) {
    .wa-float { width: 60px; height: 60px; }
    .wa-float svg { width: 31px; height: 31px; }
  }
  /* Entrance: one gentle fade + rise, added by JS so the link is visible without it */
  .js .wa-float { opacity: 0; transform: translateY(12px); }
  .js .wa-float.is-in { opacity: 1; transform: none; }
  @media (hover: hover) {
    .js .wa-float.is-in:hover, html:not(.js) .wa-float:hover {
      transform: translateY(-3px);
      box-shadow: 0 14px 28px color-mix(in srgb, var(--ink-950) 34%, transparent);
    }
  }
  .js .wa-float.is-in:active, html:not(.js) .wa-float:active { transform: translateY(1px); }

  /* Back to top: stacked above the WhatsApp button so the two never overlap */
  .to-top {
    position: fixed; right: calc(1rem + env(safe-area-inset-right, 0px));
    bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px)); z-index: 40;
    width: 48px; height: 48px; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    background: var(--ink-900); color: var(--white); border: 1px solid var(--line-dark);
    box-shadow: var(--shadow-card); --focus: var(--brand-red);
  }
  .js .to-top { display: inline-flex; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
  .js .to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
  .to-top:hover { color: var(--brand-red); }
  .js .to-top.is-visible:hover { transform: translateY(-2px); box-shadow: 0 14px 30px color-mix(in srgb, var(--ink-950) 22%, transparent); }

  /* Stats band. tabular-nums keeps the numerals a fixed width so a counting
     number cannot jitter its own layout as the digits change. */
  .stat { border-top: 2px solid var(--brand-red); padding-top: 1.25rem; }
  .stat__value {
    font-family: var(--ff-display); font-weight: 700;
    font-size: clamp(2.1rem, 4.4vw, 3rem); line-height: 1.1;
    letter-spacing: -0.02em; color: var(--white);
    font-variant-numeric: tabular-nums; max-width: none;
  }
  .stat__label {
    margin-top: .6rem;
    font-family: var(--ff-body); font-weight: 500; font-size: .8125rem;
    text-transform: uppercase; letter-spacing: .12em; color: var(--grey-500);
    max-width: none;
  }

  /* Design-system specimens */
  .swatch { height: 7rem; border-radius: var(--radius); border: 1px solid var(--line-light); display: flex; align-items: flex-end; padding: .9rem; font-weight: 500; font-size: .875rem; }
}

/* ---------- Animations ---------- */
@layer animations {
  @keyframes error-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

  /* Scroll reveals: hidden state is only applied by JS (.reveal-armed) */
  .reveal-armed { opacity: 0; transform: translateY(30px); transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1); transition-delay: var(--delay, 0ms); }
  .reveal-armed.is-visible { opacity: 1; transform: none; }

  /* Hairlines draw with their section */
  .rule-armed { transform: scaleX(0); transform-origin: left; transition: transform var(--dur-slow) var(--ease-out) 120ms; }
  .rule-armed.is-drawn { transform: scaleX(1); }

  /* Timeline line draws downward */
  .timeline.line-armed .timeline__line { transform: scaleY(0); transition: transform 1.2s var(--ease-out); }
  .timeline.line-armed.is-drawn .timeline__line { transform: scaleY(1); }

  /* Hero entrance (index only). Hidden states are set by JS adding .hero-ready */
  .hero-line { display: block; overflow: hidden; padding: .08em 0 .18em; margin: -.08em 0 -.18em; }
  .hero-line > span { display: block; }
  /* .hero-pending is set in <head> so nothing flashes before main.js runs; a 1.5s failsafe removes it */
  .hero-pending [data-hero] [data-hero-step]:not([data-hero-step="title"]) { opacity: 0; }
  .hero-pending [data-hero] .hero-line > span { transform: translateY(100%); }
  /* Hidden states apply only between .hero-ready and .hero-in, so the final state is the plain default */
  .hero-ready:not(.hero-in) [data-hero-step="eyebrow"] { opacity: 0; transform: translateY(10px); }
  .hero-ready:not(.hero-in) [data-hero-step="sub"] { opacity: 0; transform: translateY(12px); }
  .hero-ready:not(.hero-in) [data-hero-step="btn"] { opacity: 0; transform: translateY(8px); }
  .hero-ready:not(.hero-in) [data-hero-step="rule"] { opacity: 0; transform: scaleX(0); }
  .hero-ready:not(.hero-in) .hero-line > span { transform: translateY(100%); }
  .hero-in [data-hero-step] { transition: opacity var(--dur-hero) var(--ease-out) var(--delay, 0ms), transform var(--dur-hero) var(--ease-out) var(--delay, 0ms), color var(--dur-base) var(--ease-in-out), border-color var(--dur-base) var(--ease-in-out); }
  .hero-in .hero-line > span { transition: transform var(--dur-hero) var(--ease-out); transition-delay: var(--delay, 0ms); }

  /* Lazy images fade in once loaded */
  .js .media img.img-armed { opacity: 0; }
  .js .media img.img-armed.is-loaded { opacity: 1; }

  /* Filter re-render */
  .card-enter { animation: card-enter var(--dur-slow) var(--ease-out) both; animation-delay: var(--delay, 0ms); }
  @keyframes card-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* ---------- Section surfaces ---------- */
@layer sections {
  .s-white { background: var(--white); color: var(--ink); }
  .s-cream { background: var(--cream); color: var(--ink); }
  .muted { color: var(--grey-700); }
  .icon-muted { color: var(--grey-700); }

  .s-dark { background: var(--ink-900); color: var(--cream); --focus: var(--brand-red); }
  .s-dark h1, .s-dark h2, .s-dark h3 { color: var(--white); }
  .s-dark .accent { color: var(--brand-red); }
  .s-dark--ruled { border-top: 1px solid var(--line-dark); }

  .s-deep { background: var(--ink-950); color: var(--cream); --focus: var(--brand-red); }
  .s-deep h2, .s-deep h3 { color: var(--white); }

  .s-bronze { background: var(--ink-950); color: var(--white); }
  .s-bronze h2 { color: var(--white); }
  .s-bronze .btn--outline-ink { color: var(--white); border-color: var(--white); }
  .s-bronze .btn--outline-ink::before { background: var(--white); }
  .s-bronze .btn--outline-ink:hover { color: var(--ink-950); border-color: var(--white); }
  /* The cream contact card inside the black band keeps its own dark outline button */
  .s-bronze .inset-card .btn--outline-ink { color: var(--ink); border-color: var(--ink); }
  .s-bronze .inset-card .btn--outline-ink::before { background: var(--ink-950); }
  .s-bronze .inset-card .btn--outline-ink:hover { color: var(--white); border-color: var(--ink-950); }
  .inset-card { background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: 1.75rem; }
  /* Phone and email links in the CTA card: 44px tap targets */
  .inset-card a.t-ui { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; }
  @media (min-width: 640px) { .inset-card { padding: 2.25rem; } }

  /* Inner page heroes */
  .page-hero { position: relative; overflow: hidden; background: var(--grad-ink); color: var(--cream); --focus: var(--brand-red); }
  .page-hero h1 { color: var(--white); }
  .page-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: 1; mix-blend-mode: normal; filter: none; }
  .page-hero > .container { position: relative; z-index: 2; }
  .page-hero .t-label { color: var(--grey-300); }
  .page-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.72) 100%); }

  /* Stand-in photography credit: small, muted, never competing with the heading */
  .photo-credit { font-size: .75rem; line-height: 1.5; color: var(--grey-300); max-width: 46ch; }

  /* HERO (homepage only). Full-bleed background (muted slideshow video, poster fallback) with a
     navy legibility overlay, one left-anchored text column, and minimal slider controls.
     Hero tokens from the locked hero palette; no other colours. */
  .hero {
    --navy-950: #122238; --navy-900: #16283F;
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; flex-direction: column;
    min-height: min(660px, 88vh);
    background: var(--ink-950); color: var(--cream); --focus: var(--brand-red);
  }
  @media (min-width: 768px) { .hero { min-height: min(92vh, 820px); } }
  .hero h1 { color: var(--white); margin: 0; }
  .hero > .pillars { margin-top: auto; position: relative; z-index: 2; }

  /* Background layer: poster photo with the video above it. Static framing only */
  .hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background-color: var(--navy-600, #2A4361); }
  .hero-poster, .hero-video {
    position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
    object-fit: cover; object-position: center;
  }
  /* The video and its wrapper stay untransformed: no transform, filter, animation or will-change */
  .hero-video { max-width: 100%; }
  .hero-video.is-failed { display: none; }
  /* Reduced-motion users: poster photo only, no video (phones play the small mobile file) */
  @media (prefers-reduced-motion: reduce) { .hero-video { display: none; } }

  /* Legibility overlay, above the image and below the text: a left-to-right navy gradient
     that keeps the text column dark, plus a bottom-up fade */
  .hero-scrim {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
      linear-gradient(100deg, rgba(18,34,56,.95) 0%, rgba(18,34,56,.82) 34%, rgba(18,34,56,.45) 62%, rgba(18,34,56,.18) 100%),
      linear-gradient(to top, rgba(18,34,56,.88) 0%, rgba(18,34,56,.30) 46%, transparent 76%);
  }

  /* Slider: slides share one grid cell, so the hero is as tall as its tallest slide and no text clips */
  .hero-slider { position: relative; z-index: 2; flex: 1 1 auto; display: grid; touch-action: pan-y; }
  .hero-slide {
    grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 1400ms ease-in-out, visibility 0s linear 1400ms;
  }
  .hero-slide.is-active {
    opacity: 1; visibility: visible;
    transition: opacity 1400ms ease-in-out, visibility 0s;
  }

  /* One left-aligned text column, anchored to the bottom-left. Eyebrow chip, headline, rule,
     subline, CTAs, in that order, all on one left edge. */
  .hero-content {
    position: relative; text-align: left;
    box-sizing: content-box; max-width: 660px;
    padding-left: clamp(20px, 7vw, 112px);
    padding-right: clamp(20px, 6vw, 90px);
    padding-bottom: 0;
  }
  /* Optical centring: desktop sits 2% above the exact middle; tablet and phone keep 88px clear
     below the text so the centred stack never reaches the dots or the label row */
  @media (min-width: 1025px) { .hero-content { transform: translateY(-2%); } }
  @media (min-width: 640px) and (max-width: 1023.98px) { .hero-content { max-width: 560px; padding-bottom: 88px; } }
  @media (max-width: 639.98px) { .hero-content { max-width: none; padding-left: 20px; padding-right: 20px; padding-bottom: 88px; } }

  .hero-content .hero__eyebrow {
    display: inline-block; margin: 0 0 18px; padding: .45rem .8rem; border-radius: var(--radius-pill);
    font-family: var(--ff-body); font-weight: 500; font-size: .75rem; line-height: 1.2;
    letter-spacing: .14em; text-transform: uppercase; color: var(--bronze);
    background: rgba(18,34,56,.55); border: 1px solid rgba(255,255,255,.35);
  }
  .hero-headline {
    font-family: var(--ff-display); font-weight: 700;
    font-size: clamp(1.85rem, 9vw, 2.55rem); line-height: 1.08; letter-spacing: -0.01em;
    hyphens: none; overflow-wrap: normal; word-break: keep-all;
    color: #FFFFFF; margin: 0 0 18px; max-width: none; text-wrap: balance;
  }
  @media (min-width: 640px) { .hero-headline { font-size: clamp(1.9rem, 4.8vw, 3rem); } }
  /* Capped so each intended line fits the 660px text measure (two lines on desktop) */
  @media (min-width: 1025px) { .hero-headline { font-size: clamp(2.2rem, 3vw, 3.1rem); } }
  .hero-rule {
    display: block; width: 56px; height: 2px; margin: 0 0 16px;
    background: var(--bronze); transform-origin: left center;
  }
  .hero-subline {
    margin: 0 0 28px; max-width: 54ch;
    font-family: var(--ff-body); font-weight: 400; font-size: .9375rem; line-height: 1.65;
    color: rgba(255,255,255,.86);
  }
  @media (min-width: 768px) { .hero-subline { font-size: clamp(.95rem, 1.4vw, 1.06rem); } }

  .hero-ctas { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
  @media (min-width: 640px) { .hero-ctas { flex-direction: row; align-items: center; } }
  .hero-ctas .btn { min-height: 48px; padding: 12px 24px; border-radius: 10px; font-size: .875rem; letter-spacing: .06em; justify-content: center; }
  /* Secondary: transparent, 1px white-55 border, white text, white-10 fill on hover */
  .hero-ctas .btn--outline-cream { border: 1px solid rgba(255,255,255,.55); color: var(--white); }
  .hero-ctas .btn--outline-cream::before { background: rgba(255,255,255,.1); }
  .hero-ctas .btn--outline-cream:hover { color: var(--white); }

  /* Slide 2+ text reveal: fades up with a short stagger once its slide is active */
  .js .hero-reveal { transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
  .js .hero-slide:not(.is-active) .hero-reveal { opacity: 0; transform: translateY(22px); }
  .js .hero-slide.is-active .hero-reveal {
    opacity: 1; transform: none;
    transition: opacity 900ms cubic-bezier(.22,.61,.36,1) var(--rd, 0ms), transform 900ms cubic-bezier(.22,.61,.36,1) var(--rd, 0ms);
  }
  .hero-reveal--1 { --rd: 0ms; }
  .hero-reveal--2 { --rd: 130ms; }
  .hero-reveal--3 { --rd: 260ms; }
  .hero-reveal--4 { --rd: 390ms; }
  .hero-reveal--5 { --rd: 520ms; }
  @media (prefers-reduced-motion: reduce) {
    .hero-slide, .hero-slide.is-active { transition: none; }
    .hero-reveal, .js .hero-reveal { transition: none !important; }
    .js .hero-slide:not(.is-active) .hero-reveal { opacity: 1; transform: none; }
  }

  /* Controls. Dots bottom-right (bottom-centre on phones), 28px from the slider's foot;
     arrows on the edges from 640px, low-contrast until hover or focus */
  .hero-controls { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
  .hero-controls[hidden] { display: none; }
  .hero-dots {
    position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; pointer-events: auto;
  }
  @media (min-width: 1025px) {
    .hero-dots { left: auto; transform: none; right: clamp(20px, 5vw, 56px); bottom: 30px; }
  }
  .hero-dot {
    position: relative; width: 44px; height: 44px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .hero-dot::before {
    content: ""; width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255,255,255,.45);
    transition: background-color 250ms ease, width 250ms ease, height 250ms ease, box-shadow 250ms ease;
  }
  .hero-dot[aria-current="true"]::before {
    width: 12px; height: 12px; background: var(--white); box-shadow: 0 0 0 2px rgba(255,255,255,.35);
  }
  .hero-dot:focus-visible, .hero-arrow:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
  .hero-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); pointer-events: auto;
    display: none; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0; border: 0; background: transparent;
    color: var(--white); opacity: .7; transition: opacity 200ms ease;
  }
  .hero-arrow::before {
    content: ""; position: absolute; inset: 5px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.5); background: rgba(18,34,56,.35);
    transition: border-color 200ms ease;
  }
  .hero-arrow svg { position: relative; width: 18px; height: 18px; }
  .hero-arrow--prev { left: 18px; }
  .hero-arrow--next { right: 18px; }
  /* Arrows only on desktop (1024px and wider); swipe and dots cover tablet and phone */
  @media (min-width: 1025px) { .hero-arrow { display: inline-flex; } }
  /* Bottom label row: 75% white on navy; hidden at 768px and below */
  .hero > .pillars .pillars__item { color: rgba(255,255,255,.75); }
  @media (max-width: 768px) { .hero > .pillars { display: none; } }
  .hero-arrow:hover, .hero-arrow:focus-visible { opacity: 1; }
  .hero-arrow:hover::before { border-color: rgba(255,255,255,.9); }

  /* Hero pillar row: four informational labels, not links */
  .pillars { border-top: 1px solid var(--line-dark); }
  .pillars__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  @media (min-width: 768px) { .pillars__list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .pillars__item {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    min-height: 48px; padding: .9rem .6rem; text-align: center;
    font-family: var(--ff-body); font-weight: 500; font-size: .6875rem;
    text-transform: uppercase; letter-spacing: .12em;
    color: var(--cream);
  }
  .pillars__item + .pillars__item { border-left: 1px solid var(--line-dark); }
  @media (max-width: 767.98px) {
    .pillars__item:nth-child(odd) { border-left: 0; }
    .pillars__item:nth-child(n + 3) { border-top: 1px solid var(--line-dark); }
  }
  .pillars__item::after {
    content: ""; position: absolute; left: .6rem; right: .6rem; bottom: .45rem; height: 1px;
    background: var(--brand-red);
    transform: scaleX(0); transition: transform 250ms var(--ease-in-out);
  }
  @media (hover: hover) { .pillars__item:hover::after { transform: scaleX(1); } }

  /* Footer */
  .site-footer { background: var(--ink-950); color: var(--cream); --focus: var(--brand-red); }
  .site-footer__heading { font-family: var(--ff-body); font-weight: 500; font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; color: var(--cream); }
  .site-footer__link { font-size: .92rem; color: var(--cream); transition: color var(--dur-fast) var(--ease-out); }
  .site-footer__link:hover { color: var(--brand-red); }
  /* Footer list rows are 44px tap targets. The row height now carries the rhythm that
     the lists' 12px gaps used to, so the columns grow by 14px per row, not 44px.
     Plain-text rows get the same height so the columns stay evenly spaced. */
  .site-footer li { display: flex; align-items: center; min-height: 44px; }
  .site-footer li > a.site-footer__link { display: inline-flex; align-items: center; min-height: 44px; }
  .site-footer__fine { font-size: .875rem; color: var(--grey-500); }
  .site-footer__bar { border-top: 1px solid var(--line-dark); background: var(--black); }
}

/* ---------- Utilities ----------
   Hand-authored replacements for the Tailwind CDN utilities the markup uses.
   Tailwind is gone; these are the only utility classes that exist, so adding a
   new one to the HTML means adding it here too. Values follow Tailwind v3's
   default scales (1 unit = 0.25rem) and breakpoints (sm 640, md 768, lg 1024,
   xl 1280) so the markup did not have to change. Colours come from the tokens.
   This layer is last, so a utility still beats a component rule, exactly as the
   CDN did — the one deliberate exception is the unlayered footer rule below. */
@layer utilities {
  .nowrap { white-space: nowrap; }

  /* Display and position */
  .block { display: block; }
  .inline-block { display: inline-block; }
  .flex { display: flex; }
  .inline-flex { display: inline-flex; }
  .grid { display: grid; }
  .hidden { display: none; }
  .relative { position: relative; }
  .invisible { visibility: hidden; }

  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
  }
  .focus\:not-sr-only:focus {
    position: static; width: auto; height: auto; padding: 0; margin: 0;
    overflow: visible; clip: auto; white-space: normal;
  }
  .focus\:fixed:focus { position: fixed; }
  .focus\:top-3:focus { top: .75rem; }
  .focus\:left-3:focus { left: .75rem; }
  .focus\:z-\[60\]:focus { z-index: 60; }

  /* Flex and grid */
  .flex-col { flex-direction: column; }
  .flex-wrap { flex-wrap: wrap; }
  .flex-1 { flex: 1 1 0%; }
  .shrink-0 { flex-shrink: 0; }
  .items-start { align-items: flex-start; }
  .items-center { align-items: center; }
  .justify-center { justify-content: center; }
  .justify-between { justify-content: space-between; }
  .self-start { align-self: flex-start; }
  .min-w-0 { min-width: 0; }
  .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-cols-\[auto_minmax\(0\,1fr\)\] { grid-template-columns: auto minmax(0, 1fr); }

  /* Gap */
  .gap-2 { gap: .5rem; }
  .gap-3 { gap: .75rem; }
  .gap-4 { gap: 1rem; }
  .gap-5 { gap: 1.25rem; }
  .gap-6 { gap: 1.5rem; }
  .gap-8 { gap: 2rem; }
  .gap-10 { gap: 2.5rem; }
  .gap-12 { gap: 3rem; }
  .gap-14 { gap: 3.5rem; }
  .gap-x-10 { column-gap: 2.5rem; }
  .gap-y-12 { row-gap: 3rem; }

  /* Margin */
  .mt-1 { margin-top: .25rem; }
  .mt-2 { margin-top: .5rem; }
  .mt-2\.5 { margin-top: .625rem; }
  .mt-3 { margin-top: .75rem; }
  .mt-4 { margin-top: 1rem; }
  .mt-5 { margin-top: 1.25rem; }
  .mt-6 { margin-top: 1.5rem; }
  .mt-8 { margin-top: 2rem; }
  .mt-10 { margin-top: 2.5rem; }
  .mt-12 { margin-top: 3rem; }
  .mt-14 { margin-top: 3.5rem; }

  /* Padding */
  .p-5 { padding: 1.25rem; }
  .p-6 { padding: 1.5rem; }
  .p-8 { padding: 2rem; }
  .px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
  .px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .py-4 { padding-top: 1rem; padding-bottom: 1rem; }
  .py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .py-16 { padding-top: 4rem; padding-bottom: 4rem; }
  .py-20 { padding-top: 5rem; padding-bottom: 5rem; }
  .py-24 { padding-top: 6rem; padding-bottom: 6rem; }
  .pt-6 { padding-top: 1.5rem; }
  .pb-5 { padding-bottom: 1.25rem; }
  .pb-6 { padding-bottom: 1.5rem; }
  .pl-8 { padding-left: 2rem; }

  /* Size */
  .w-1\.5 { width: .375rem; }
  .w-4 { width: 1rem; }
  .w-5 { width: 1.25rem; }
  .w-6 { width: 1.5rem; }
  .w-7 { width: 1.75rem; }
  .w-8 { width: 2rem; }
  .w-9 { width: 2.25rem; }
  .w-12 { width: 3rem; }
  .w-20 { width: 5rem; }
  .w-full { width: 100%; }
  .h-full { height: 100%; }
  .object-cover { object-fit: cover; }
  .h-px { height: 1px; }
  .h-1\.5 { height: .375rem; }
  .h-4 { height: 1rem; }
  .h-5 { height: 1.25rem; }
  .h-6 { height: 1.5rem; }
  .h-7 { height: 1.75rem; }
  .h-8 { height: 2rem; }
  .h-9 { height: 2.25rem; }
  .h-12 { height: 3rem; }
  .h-16 { height: 4rem; }
  .h-20 { height: 5rem; }
  .h-24 { height: 6rem; }
  .h-28 { height: 7rem; }
  .max-w-xs { max-width: 20rem; }
  .max-w-sm { max-width: 24rem; }
  .max-w-md { max-width: 28rem; }
  .min-h-\[calc\(100svh-136px\)\] { min-height: calc(100svh - 136px); }
  .aspect-\[4\/3\] { aspect-ratio: 4 / 3; }
  .aspect-\[5\/4\] { aspect-ratio: 5 / 4; }

  /* Leadership portraits: 4:5 frame, crop keeps the top of each photo (faces never cut at the chin) */
  .team-card__media { aspect-ratio: 4 / 5; overflow: hidden; }
  .team-card__media img { object-position: center top; }

  /* Certifications: cards wrap to as many columns as fit (never wider than the row, so the
     fifth card cannot clip); one row of five from 1200px */
  .certs-grid { list-style: none; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); }
  .certs-grid > * { min-width: 0; }
  @media (min-width: 1200px) { .certs-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
  .cert-card { display: flex; flex-direction: column; justify-content: center; gap: .375rem; min-height: 7rem; padding: 1.25rem 1rem; background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius); text-align: center; }
  .cert-card__name { font-family: var(--ff-display); font-weight: 500; font-size: 1rem; line-height: 1.25; color: var(--ink); }
  .cert-card__desc { font-size: .8125rem; line-height: 1.4; color: var(--grey-700); }

  /* Type */
  .text-sm { font-size: .875rem; line-height: 1.25rem; }
  .text-base { font-size: 1rem; line-height: 1.5rem; }
  .text-lg { font-size: 1.125rem; line-height: 1.75rem; }
  .text-xl { font-size: 1.25rem; line-height: 1.75rem; }
  .font-display { font-family: var(--ff-display); }
  .font-medium { font-weight: 500; }
  .uppercase { text-transform: uppercase; }
  .text-center { text-align: center; }
  .underline { text-decoration-line: underline; }
  .underline-offset-4 { text-underline-offset: 4px; }
  .tracking-\[\.08em\] { letter-spacing: .08em; }
  .\[overflow-wrap\:anywhere\] { overflow-wrap: anywhere; }

  /* Colour (tokens only) */
  .text-white { color: var(--white); }
  .text-cream { color: var(--cream); }
  .text-bronze { color: var(--brand-red); }
  .text-steel { color: var(--grey-300); }
  .hover\:text-bronze:hover { color: var(--brand-red); }
  .hover\:text-white:hover { color: var(--white); }
  .bg-white { background-color: var(--white); }
  .bg-cream { background-color: var(--cream); }
  .bg-bronze { background-color: var(--brand-red); }
  .bg-navy-700 { background-color: var(--ink-700); }
  .bg-navy-900 { background-color: var(--ink-900); }
  .border-bronze { border-color: var(--brand-red); }
  .border-slate { border-color: var(--grey-700); }
  .border-steel { border-color: var(--grey-300); }

  /* Border and radius (the reset already sets border-style: solid, width 0) */
  .border { border-width: 1px; }
  .border-2 { border-width: 2px; }
  .border-t { border-top-width: 1px; }
  .border-b { border-bottom-width: 1px; }
  .border-l { border-left-width: 1px; }
  .border-t-2 { border-top-width: 2px; }
  .border-dashed { border-style: dashed; }
  .rounded-md { border-radius: .375rem; }
  .rounded-full { border-radius: 9999px; }

  /* Stacked spacing */
  .space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: .5rem; }
  .space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: .75rem; }
  .space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }
  .space-y-8 > :not([hidden]) ~ :not([hidden]) { margin-top: 2rem; }
  .space-y-12 > :not([hidden]) ~ :not([hidden]) { margin-top: 3rem; }

  /* Responsive variants */
  @media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:items-center { align-items: center; }
    .sm\:items-end { align-items: flex-end; }
    .sm\:self-auto { align-self: auto; }
    .sm\:gap-8 { gap: 2rem; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:p-10 { padding: 2.5rem; }
    .sm\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
    .sm\:py-32 { padding-top: 8rem; padding-bottom: 8rem; }
    .sm\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
  }
  @media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }
  @media (min-width: 1024px) {
    .lg\:flex-row { flex-direction: row; }
    .lg\:items-center { align-items: center; }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    /* Arbitrary values: every comma AND every decimal point must be escaped —
       an unescaped dot would start a new class selector and the rule would never match. */
    .lg\:grid-cols-\[minmax\(0\,1fr\)_minmax\(0\,1fr\)\] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .lg\:grid-cols-\[minmax\(0\,1\.1fr\)_minmax\(0\,1fr\)\] { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
    .lg\:grid-cols-\[minmax\(0\,1\.15fr\)_minmax\(0\,1fr\)\] { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    .lg\:grid-cols-\[minmax\(0\,1fr\)_minmax\(0\,1\.4fr\)\] { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
    .lg\:grid-cols-\[minmax\(0\,14rem\)_minmax\(0\,1fr\)\] { grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); }
    .lg\:grid-cols-\[minmax\(0\,1\.2fr\)_minmax\(0\,\.6fr\)_minmax\(0\,1\.5fr\)_minmax\(0\,\.8fr\)\] {
      grid-template-columns: minmax(0, 1.2fr) minmax(0, .6fr) minmax(0, 1.5fr) minmax(0, .8fr);
    }
  }
  @media (min-width: 1280px) {
    .xl\:flex-row { flex-direction: row; }
    .xl\:items-center { align-items: center; }
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }
}

/* ---------- Unlayered overrides ----------
   These sit outside @layer on purpose: unlayered rules beat layered ones whatever
   their specificity, so this wins over the .py-6 utility on the same element.
   Without it the floating WhatsApp button lands on the footer bar text. */
/* Contact detail links: 44px tap targets. Three of the five carry .block or
   .inline-block display utilities, so this has to be unlayered to win. Block-level
   flex keeps each link on its own line exactly as those utilities did, and
   width: fit-content keeps the target on the text rather than the whole column. */
.detail a {
  display: flex; width: fit-content; max-width: 100%;
  align-items: center; min-height: 44px;
}

.site-footer__bar > .container { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 640px) {
  .site-footer__bar > .container { padding-bottom: 1.5rem; padding-right: 6rem; }
}

/* ---------- Reduced motion: everything static, everything visible ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-armed, .hero-ready [data-hero-step] { opacity: 1 !important; transform: none !important; }
  .hero-ready .hero-line > span, .rule-armed, .timeline.line-armed .timeline__line { transform: none !important; }
  .js .media img.img-armed { opacity: 1 !important; }
  .card--lift:hover, .card--lift:hover .media img, .nav__link:hover, .btn:active, .btn:hover, .btn:hover .btn__arrow { transform: none !important; }
  /* New motion elements land on their final state immediately */
  .js .wa-float { opacity: 1 !important; transform: none !important; }
  .hero__link:hover .btn__arrow, .pillars__item::after, .js .mobile-menu, .js .menu-overlay { transform: none !important; }
  .pillars__item::after { transform: scaleX(0) !important; }
  .js .mobile-menu { transform: translateX(100%) !important; }
  .js .mobile-menu.is-open { transform: none !important; }
}

/* Skip link: hidden until keyboard focus */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { left: 1rem; top: 1rem; width: auto; height: auto; overflow: visible; z-index: 1000; padding: .75rem 1rem; background: var(--white); color: var(--ink-950); outline: 2px solid var(--brand-red); outline-offset: 2px; }

/* ===================================================================
   AH — certs grid (About)
   Seal cards for #certifications. Unlayered, so these win over the
   @layer rules above; every selector is in the ah- namespace.
   =================================================================== */
.ah-certs { background: var(--cream); color: var(--ink); }
.ah-certs__head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.ah-certs__eyebrow {
  font: 500 12px/1.4 "Montserrat", system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: .14em; color: var(--slate, #516D8D); margin: 0 0 12px;
}
.ah-certs__title { font-family: "Unbounded", system-ui, sans-serif; font-weight: 500; color: var(--ink); margin: 0; }
.ah-certs__intro { margin: 14px auto 0; max-width: 65ch; font-size: 1.05rem; line-height: 1.6; color: var(--slate, #516D8D); }

.ah-certs__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); align-items: stretch;
}
@media (min-width: 768px)  { .ah-certs__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .ah-certs__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Informational card: no link, so no pointer cursor and no focus ring */
.ah-cert {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  min-width: 0; background: #fff; border: 1px solid rgba(36,61,91,.16); border-radius: 12px;
  padding: 24px 22px; box-shadow: 0 8px 24px rgba(18,34,56,.08); overflow: hidden;
  transition: transform 300ms ease, box-shadow 300ms ease;
}
/* 2px bronze hairline that scales in from the centre on hover */
.ah-cert::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--bronze); transform: scaleX(0); transition: transform 300ms ease;
}
.ah-cert:hover { transform: translateY(-5px); box-shadow: 0 16px 36px rgba(18,34,56,.14); }
.ah-cert:hover::before { transform: scaleX(1); }
/* Seals are identity marks: no grayscale */
.ah-cert__seal { display: block; max-width: 150px; max-height: 110px; width: auto; height: auto; object-fit: contain; margin: 0 auto 14px; }
.ah-cert__icon { display: block; flex: none; width: 30px; height: 30px; margin: 40px auto 54px; color: var(--slate, #516D8D); }
.ah-cert__body { display: flex; flex-direction: column; flex: 1 1 auto; width: 100%; }
.ah-cert__title { font-family: "Unbounded", system-ui, sans-serif; font-weight: 500; font-size: 1.1rem; line-height: 1.3; color: var(--ink); margin: 0; }
.ah-cert__scope { margin: 6px 0 0; font-size: .95rem; line-height: 1.5; color: var(--slate, #516D8D); }
/* Caption pinned to the card bottom so captions line up across a row */
.ah-cert__fact { margin: auto 0 0; padding-top: 14px; font-size: .8rem; line-height: 1.55; color: var(--slate, #516D8D); }

/* Stagger the existing reveal at 80ms per card (main.js applies a fixed 100ms step) */
.ah-certs__grid > .reveal-armed:nth-child(2) { transition-delay: 80ms; }
.ah-certs__grid > .reveal-armed:nth-child(3) { transition-delay: 160ms; }
.ah-certs__grid > .reveal-armed:nth-child(4) { transition-delay: 240ms; }
.ah-certs__grid > .reveal-armed:nth-child(5) { transition-delay: 320ms; }
.ah-certs__grid > .reveal-armed:nth-child(6) { transition-delay: 400ms; }

.ah-certs__note { max-width: 80ch; margin: 32px auto 0; text-align: center; font-size: .8rem; line-height: 1.6; color: var(--slate, #516D8D); }
.ah-certs__cta-wrap { margin-top: 24px; text-align: center; }
.ah-certs__cta {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 22px;
  border: 1px solid var(--ink); border-radius: 999px; color: var(--ink);
  font: 500 14px/1.2 "Montserrat", system-ui, sans-serif; text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease;
}
.ah-certs__cta-arrow { display: inline-block; transition: transform 200ms ease; }
.ah-certs__cta:hover { background: var(--navy-950, #122238); border-color: var(--navy-950, #122238); color: var(--white); }
.ah-certs__cta:hover .ah-certs__cta-arrow { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
  .ah-cert, .ah-cert::before, .ah-certs__cta, .ah-certs__cta-arrow { transition: none; }
  .ah-cert:hover, .ah-certs__cta:hover .ah-certs__cta-arrow { transform: none; }
}

/* ===================================================================
   AH — contractors carousel (Home): light strip
   White band, no tiles, full-colour logos at rest; hover only enlarges.
   Set B in the markup is an exact copy of Set A, so animating the track
   to translateX(-50%) lands Set B exactly where Set A started.
   =================================================================== */
.ah-partners { background: #ffffff; padding: 72px 0 64px; border-top: 1px solid rgba(36,61,91,.10); overflow: hidden; }

.ah-marquee { overflow: hidden; }
/* Spacing between items is a trailing margin rather than flex `gap`: with gap,
   -50% of the track falls half a gap short of Set B and the loop jumps 4px.
   Margin keeps both halves identical, so the loop closes exactly. */
.ah-marquee__track { display: flex; align-items: center; width: max-content; animation: ah-partners-scroll 34s linear infinite; will-change: transform; }
.ah-marquee:hover .ah-marquee__track,
.ah-marquee:focus-within .ah-marquee__track { animation-play-state: paused; }
@keyframes ah-partners-scroll { to { transform: translateX(-50%); } }

/* Display-only trust mark: no link, no button, no tile */
.ah-partner {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: transparent; border: 0; padding: 14px 30px; margin-right: 8px; text-align: center; min-width: 190px; box-sizing: border-box;
}
.ah-partner img {
  display: block; height: 64px; width: auto; max-width: 190px; object-fit: contain;
  filter: none; opacity: 1; margin: 0 auto 10px;
  transition: transform .35s ease, opacity .35s ease;
}
.ah-partner:hover img { transform: scale(1.1); }
.ah-partner span { font: 500 12.5px/1.4 "Montserrat", system-ui, sans-serif; color: var(--slate, #516D8D); text-align: center; }
/* Missing-logo fallback (main.js adds .is-text): label only, no broken-image icon */
.ah-partner.is-text img { display: none; }
.ah-partner.is-text span { font-weight: 600; color: var(--navy-800, #1E3451); font-size: 13px; min-height: 64px; display: flex; align-items: center; }

@media (max-width: 767px) {
  .ah-partners { padding: 48px 0 44px; }
  .ah-partner { min-width: 150px; padding: 10px 18px; margin-right: 4px; }
  .ah-partner img { height: 52px; max-width: 150px; }
  .ah-marquee__track { animation-duration: 30s; }
}
/* Reduced motion: no scrolling. Set A becomes a static, centred, wrapped grid
   in full colour, and the duplicate Set B is removed so nothing shows twice. */
@media (prefers-reduced-motion: reduce) {
  .ah-marquee__track { animation: none; flex-wrap: wrap; width: 100%; justify-content: center; }
  .ah-partner { min-width: 180px; }
  .ah-partner--dup { display: none; }
  .ah-partner img { filter: none; opacity: 1; transition: none; }
  .ah-partner:hover img { transform: none; }
}

/* ===================================================================
   AH — partners heading block: editorial treatment
   Eyebrow with bronze hairlines, Unbounded 700 title with a short
   red-to-bronze rule, slate subtitle. Placed after the carousel rules
   so it wins the cascade; marquee/logo rules above are untouched.
   =================================================================== */
.ah-partners__head {
  text-align: center;
  max-width: 840px;
  margin: 0 auto 48px;
  padding: 0 20px;
}

.ah-partners__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font: 600 11px/1 "Montserrat", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .24em;
  color: var(--red-800, #7E1C1C);
}
.ah-partners__eyebrow::before,
.ah-partners__eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--bronze, #C6AB95);
  opacity: .55;
}

.ah-partners__title {
  margin: 0 0 16px;
  font: 700 clamp(1.9rem, 4vw, 2.85rem)/1.15 "Unbounded", system-ui, sans-serif;
  letter-spacing: -.01em;
  color: var(--navy-950, #122238);
  text-wrap: balance; /* even line lengths when the title wraps on phones */
}
.ah-partners__title::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin: 16px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--red-800, #7E1C1C), var(--bronze, #C6AB95));
}

.ah-partners__sub {
  margin: 18px auto 0;
  max-width: 66ch;
  font: 500 16px/1.65 "Montserrat", system-ui, sans-serif;
  color: var(--slate, #516D8D);
}

/* Subtle entrance, played once. */
.ah-partners__head > * { animation: ah-partners-head-rise .7s ease both; }
.ah-partners__title { animation-delay: .08s; }
.ah-partners__sub { animation-delay: .16s; }
@keyframes ah-partners-head-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* The head carries the site's data-reveal (main.js arms it below the fold).
   Keep the block itself still so there is only one motion, and hold the
   children's rise until the observer marks it visible. With JS off, the
   rise simply plays on load. */
.ah-partners__head.reveal-armed { opacity: 1; transform: none; transition: none; }
.ah-partners__head.reveal-armed:not(.is-visible) > * { animation-play-state: paused; }

@media (max-width: 767px) {
  .ah-partners__head { margin-bottom: 36px; }
  .ah-partners { padding-top: 56px; }
  .ah-partners__eyebrow { letter-spacing: .18em; gap: 9px; }
  .ah-partners__eyebrow::before,
  .ah-partners__eyebrow::after { width: 20px; }
  .ah-partners__sub { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .ah-partners__head > * { animation: none; }
}

/* ---------- Pakistan Office: real office photo card (index + projects) ----------
   Photo of Al Harmain Plaza, Faisal Town Phase 1. Bottom navy gradient keeps the
   caption legible without an opaque panel over the building. No filter, no zoom. */
.pk-office__media {
  position: relative; overflow: hidden; margin: 0;
  border-radius: 16px; aspect-ratio: 3 / 2;
  background: #E9EEF3;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-base) var(--ease-out);
}
.pk-office__media:hover { transform: translateY(-3px); }
.pk-office__media img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: center 35%;
  filter: none;
}
.pk-office__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 48px 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
  background: linear-gradient(180deg, rgba(18,34,56,0) 0%, rgba(18,34,56,.72) 40%, rgba(18,34,56,.9) 100%);
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}
.pk-office__caption-title { font: 600 16px/1.3 var(--ff-body), system-ui, sans-serif; color: var(--white); }
.pk-office__caption-address { font: 400 13px/1.5 var(--ff-body), system-ui, sans-serif; color: var(--cream); }
/* Missing-photo fallback: soft navy/cream panel, caption still shown */
.pk-office__media.is-missing { background: linear-gradient(160deg, #16283F 0%, #122238 100%); }
.pk-office__media.is-missing img { display: none; }
@media (max-width: 767px) {
  .pk-office__media { aspect-ratio: 4 / 3; border-radius: 14px; }
  .pk-office__caption-address { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .pk-office__media, .pk-office__media:hover { transform: none !important; transition: none !important; }
}
#pakistan-office { scroll-margin-top: calc(var(--header-h) + 24px); }
