/* ==========================================================================
   KTM Transformers Sdn Bhd
   Palette sampled from the company logo: royal blue #0f47ad, red #e00020.
   ========================================================================== */

:root {
  --blue: #0f47ad;
  --blue-600: #0d3d95;
  --blue-800: #0a2a68;
  --blue-900: #071c45;
  --blue-950: #05132f;

  --red: #d90420;
  --red-700: #b0031a;

  --ink: #101828;
  --slate: #4a5568;
  --slate-light: #6b7280;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f6f8fc;
  --bg-warm: #fbfcfe;
  --white: #fff;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(7, 28, 69, .06), 0 4px 12px rgba(7, 28, 69, .06);
  --shadow: 0 8px 24px rgba(7, 28, 69, .10);
  --shadow-lg: 0 24px 60px rgba(7, 28, 69, .18);

  --font-display: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --header-h: 86px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(3.5rem, 7vw, 6.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Anchored sections must clear the sticky header. */
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.14;
  letter-spacing: -.015em;
  color: var(--blue-900);
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 1.15rem + 1.9vw, 2.4rem); font-weight: 800; }
h3 { font-size: clamp(1.05rem, .98rem + .35vw, 1.25rem); font-weight: 700; }

p { margin: 0 0 1rem; color: var(--slate); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--blue); }
a:hover { color: var(--blue-600); }

ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
address { font-style: normal; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: min(1180px, 100% - var(--gutter) * 2); margin-inline: auto; }
.container.narrow { max-width: 780px; }
.center, .center h1, .center h2 { text-align: center; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--blue-900); color: #fff; padding: .8rem 1.2rem;
  border-radius: 0 0 var(--radius) 0; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------------------------- Buttons ---------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  line-height: 1; text-decoration: none; white-space: nowrap;
  padding: .85rem 1.5rem; border: 1px solid transparent; border-radius: 8px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-700); color: #fff; }

.btn-outline-light { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .18); color: #fff; }

.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " →"; transition: none; }
.link-arrow:hover { text-decoration: underline; }

/* ---------------------------- Header ---------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--blue-950);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; flex-shrink: 0; }
.brand-logo { width: auto; height: 52px; }
.brand-place {
  padding-left: .85rem; border-left: 1px solid rgba(255, 255, 255, .22);
  font-size: .68rem; color: rgba(255, 255, 255, .6);
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav a {
  text-decoration: none; color: rgba(255, 255, 255, .82); font-weight: 500; font-size: .94rem;
  padding: .35rem 0; border-bottom: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--red); font-weight: 600; }
.nav .nav-cta { border-bottom: 0; color: #fff; padding: .7rem 1.2rem; font-size: .9rem; }
.nav .nav-cta:hover { color: #fff; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 100%; height: 2px; background: #fff; border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----------------------------- Heroes ----------------------------- */

.hero, .page-hero {
  position: relative; isolation: isolate;
  display: flex; align-items: flex-end;
  color: #fff; overflow: hidden;
}
.hero { min-height: clamp(520px, 74vh, 760px); }
.page-hero { min-height: clamp(340px, 46vh, 460px); }

.hero-media, .page-hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img, .page-hero-media img { width: 100%; height: 100%; object-fit: cover; }

.hero::after, .page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(5, 19, 47, .45) 0%, rgba(5, 19, 47, .55) 40%, rgba(5, 19, 47, .93) 100%),
    linear-gradient(100deg, rgba(10, 42, 104, .82) 0%, rgba(10, 42, 104, .34) 58%, transparent 100%);
}

.hero-inner, .page-hero-inner {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  max-width: 46rem;
}
.hero h1, .page-hero h1 { color: #fff; margin-bottom: .5em; }

.eyebrow {
  display: inline-block; margin: 0 0 1.2rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #fff; background: var(--red);
  padding: .4rem .85rem; border-radius: 999px;
}

.lede { font-size: clamp(1rem, .95rem + .3vw, 1.15rem); color: rgba(255, 255, 255, .9); max-width: 40rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.hero-tagline {
  margin-top: 2rem; padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, .22);
  font-family: var(--font-display); font-weight: 700; letter-spacing: .01em;
  color: rgba(255, 255, 255, .82); font-size: .95rem;
}

.contact-hero {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue) 100%);
  color: #fff; padding-block: clamp(3rem, 7vw, 5rem);
}
.contact-hero h1 { color: #fff; }

/* ---------------------------- Stats band ---------------------------- */

.stats-band { background: var(--blue-900); color: #fff; padding-block: clamp(2rem, 4vw, 2.75rem); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.stat { border-left: 3px solid var(--red); padding-left: 1rem; }
.stat strong {
  display: block; font-family: var(--font-display); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
  font-weight: 800; color: #fff; line-height: 1.1;
}
.stat-label { display: block; font-weight: 600; font-size: .92rem; color: rgba(255, 255, 255, .92); margin-top: .3rem; }
.stat-detail { display: block; font-size: .8rem; color: rgba(255, 255, 255, .6); margin-top: .15rem; }

/* ---------------------------- Sections ---------------------------- */

.section { padding-block: var(--section-y); }
.section-alt { background: var(--bg); }

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.center { max-width: 46rem; margin-inline: auto; text-align: center; }
.section-eyebrow {
  font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); margin-bottom: .7rem;
}
.section-lede { font-size: 1.05rem; }

.prose-columns { columns: 2; column-gap: 3rem; margin-bottom: 2.5rem; }
.prose-columns p { break-inside: avoid; }

.intro-text { font-size: 1.1rem; color: var(--slate); }
.note { font-size: .9rem; color: var(--slate-light); }

/* ------------------------------ Tiles ------------------------------ */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.tiles-3 { grid-template-columns: repeat(3, 1fr); }
.tile {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.5rem; text-decoration: none;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.tile:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-3px); }
.tile h3 { margin: 0; color: var(--blue-900); }
.tile p { font-size: .92rem; margin: 0; flex: 1; }
.tile-more { font-size: .84rem; font-weight: 600; color: var(--red); }
.tile-more::after { content: " →"; }
.tile-compact { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; }
.tile-compact h3 { font-size: 1rem; }

.tiles-footnote { margin-top: 1.5rem; }

/* ----------------------------- Pillars ----------------------------- */

.pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.pillar {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.pillar-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg); }
.pillar-media img { width: 100%; height: 100%; object-fit: cover; }
.pillar-body { padding: 1.5rem; }
.pillar-body h3 { color: var(--blue-900); }

/* --------------------- Split (copy + media) sections --------------------- */

.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.split-reverse .split-copy { order: 2; }
.split-reverse .split-media, .split-reverse .split-aside { order: 1; }
.split-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow); width: 100%; }
.sticky-media { position: sticky; top: calc(var(--header-h) + 2rem); }
.group-intro { font-size: 1.02rem; margin-bottom: 1.5rem; }

/* ----------------------------- Points ----------------------------- */

.about-points { display: grid; gap: 1rem; }
.points-4 { grid-template-columns: repeat(4, 1fr); }
.point {
  background: var(--white); border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius); padding: 1.25rem 1.4rem;
}
.point h3 { margin-bottom: .35rem; }
.point p { font-size: .92rem; margin: 0; }

/* --------------------------- Check lists --------------------------- */

.check-list { display: grid; gap: .55rem; }
.check-list-2 { grid-template-columns: repeat(2, 1fr); column-gap: 2.5rem; }
.check-list li {
  position: relative; padding-left: 1.7rem;
  font-size: .95rem; color: var(--slate);
}
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .52em;
  width: 8px; height: 8px; border-radius: 2px; background: var(--red);
}

.def-list { display: grid; gap: 1.4rem; }
.def h3 { margin-bottom: .3rem; }
.def p { font-size: .95rem; margin: 0; }

/* ------------------------- Mission / vision ------------------------- */

.mv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-top: 2.5rem; }
.mv-card {
  background: var(--bg); border-radius: var(--radius-lg); padding: 1.6rem;
  border-top: 4px solid var(--blue);
}
.mv-label {
  font-family: var(--font-display); font-weight: 800; font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--blue);
  margin-bottom: .5rem;
}

/* ---------------------------- Heritage ---------------------------- */

.heritage-section { background: var(--white); }
.heritage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.heritage-item { margin: 0; }
.heritage-media {
  aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--shadow-sm);
}
.heritage-media img { width: 100%; height: 100%; object-fit: cover; }
.heritage-item figcaption { display: flex; flex-direction: column; gap: .15rem; padding-top: .7rem; }
.heritage-year {
  font-family: var(--font-display); font-weight: 800; font-size: .78rem;
  letter-spacing: .1em; color: var(--red);
}
.heritage-caption { font-size: .86rem; color: var(--slate); line-height: 1.45; }

/* -------------------------- Certifications -------------------------- */

.cert-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.cert {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 4px solid var(--blue); padding: 1.6rem;
}
.cert h3 { color: var(--blue); margin-bottom: .25rem; }
.cert-issuer { font-weight: 600; color: var(--ink); font-size: .92rem; margin-bottom: .25rem; }
.cert-ref {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: .78rem; color: var(--slate-light); margin-bottom: .75rem;
  overflow-wrap: anywhere;
}
.cert p:last-child { font-size: .93rem; margin: 0; }

.type-tests {
  margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line-strong);
}
.tt-heading { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.6rem); }
.tt-lede { margin-bottom: 1.75rem; }
.tt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2.5rem; margin-bottom: 1.75rem; }
.tt-item h3 { font-size: 1rem; margin-bottom: .3rem; }
.tt-item p { font-size: .92rem; margin: 0; }

/* ----------------------------- Services ----------------------------- */

.services-list { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
.service {
  display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: stretch; scroll-margin-top: calc(var(--header-h) + 2rem);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden;
}
/* The photo is taken out of flow so a portrait source cannot stretch the card;
   the copy column sets the height and the image crops to fill it. */
.service-media { position: relative; min-height: 280px; overflow: hidden; }
.service-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.service-body { padding: 1.75rem 1.75rem 1.75rem 0; }
.service-index {
  font-family: var(--font-display); font-weight: 800; font-size: .8rem;
  color: var(--red); letter-spacing: .1em; margin-bottom: .4rem;
}
.service-body h2 { font-size: clamp(1.2rem, 1.05rem + .55vw, 1.5rem); margin-bottom: .5rem; }

.scope { margin-top: 1.1rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.scope summary {
  cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--blue);
  list-style: none; display: flex; align-items: center; gap: .4rem;
}
.scope summary::-webkit-details-marker { display: none; }
.scope summary::before { content: "+"; font-weight: 700; font-size: 1.05rem; line-height: 1; }
.scope[open] summary::before { content: "–"; }
.scope summary:hover { color: var(--blue-600); }
.scope .check-list { margin-top: .9rem; }

/* ----------------------------- Projects ----------------------------- */

.features { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
}
.feature:nth-child(even) .feature-media { order: 2; }
.feature-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow); width: 100%; }
.project-client {
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--red); margin-bottom: .4rem;
}

.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.project-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.project-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg); }
.project-media img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 1.35rem; }
.project-body h3 { font-size: 1.02rem; margin-bottom: .45rem; }
.project-body p { font-size: .9rem; margin: 0; }

/* --------------------------- Sectors served --------------------------- */

.sector-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.sector {
  display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
  padding: 1.5rem 1.35rem;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.sector:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-3px); }
.sector-icon {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-bottom: .85rem;
  border-radius: 10px; color: var(--blue);
  background: rgba(15, 71, 173, .08);
}
.sector-icon .icon { width: 24px; height: 24px; }
.sector-name {
  font-family: var(--font-display); font-weight: 700; font-size: .98rem;
  color: var(--blue-900); line-height: 1.25;
}
.sector-detail { font-size: .84rem; color: var(--slate-light); margin-top: .25rem; }

/* ----------------------------- Client wall ----------------------------- */

.client-groups { display: grid; gap: 2.5rem; margin-bottom: 1.5rem; }
.client-group-label {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--font-display); font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--red);
  margin-bottom: 1.1rem;
}
/* Hairline rule that fills the space to the right of the label. */
.client-group-label::after {
  content: ""; flex: 1; height: 1px; background: var(--line-strong);
}
.client-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; }
.client-card {
  display: flex; align-items: center; justify-content: center;
  min-height: 84px; padding: 1rem 1.1rem; text-align: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.client-card:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.client-name {
  font-size: .9rem; font-weight: 600; line-height: 1.35; color: var(--blue-900);
}
/* Used once the client supplies logo artwork they are licensed to display. */
.client-logo { max-height: 46px; width: auto; object-fit: contain; }

.chip-list { display: flex; flex-wrap: wrap; gap: .6rem; }
.chip-list.center-list { justify-content: center; }
.chip-list li {
  background: var(--white); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: .5rem 1.1rem; font-size: .9rem; font-weight: 500; color: var(--ink);
}
.chip-list li a { text-decoration: none; }
.sectors { background: var(--bg); }

/* ------------------------------ Gallery ------------------------------ */

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: .85rem; }
.gallery-item {
  position: relative; display: block; padding: 0; overflow: hidden; cursor: pointer;
  background: var(--bg); border: 0; border-radius: var(--radius);
  aspect-ratio: 4 / 3;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-caption {
  position: absolute; inset-inline: 0; bottom: 0;
  padding: 1.6rem .8rem .7rem; text-align: left;
  font-size: .8rem; font-weight: 500; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(5, 19, 47, .88));
}

/* Applied to <body> while the lightbox is open. */
.is-scroll-locked { overflow: hidden; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(5, 19, 47, .95);
}
.lightbox[hidden] { display: none; }
.lightbox-figure { margin: 0; max-width: min(1100px, 100%); text-align: center; }
.lightbox-figure img {
  max-height: 78vh; width: auto; margin-inline: auto;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.lightbox-figure figcaption { color: rgba(255, 255, 255, .85); font-size: .92rem; margin-top: 1rem; }
.lightbox-close, .lightbox-nav {
  background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .24); }
.lightbox-close { position: absolute; top: 1.25rem; right: 1.25rem; width: 44px; height: 44px; font-size: 1.75rem; }
.lightbox-nav { width: 52px; height: 52px; font-size: 2rem; flex-shrink: 0; }

/* ---------------------------- Back to top ---------------------------- */

.back-to-top {
  position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem);
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0;
  color: #fff; background: var(--blue-950);
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%;
  box-shadow: var(--shadow); cursor: pointer;
  /* Hidden until the page has been scrolled; opacity and transform animate,
     visibility keeps it out of the tab order while it is invisible. */
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s, background .18s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--blue); }
.back-to-top .icon { width: 22px; height: 22px; stroke-width: 2; }

@media (max-width: 640px) {
  .back-to-top { width: 44px; height: 44px; }
}

@media print {
  .back-to-top { display: none !important; }
}

/* ----------------------------- CTA band ----------------------------- */

.cta-band {
  background:
    radial-gradient(900px 400px at 80% 0%, rgba(217, 4, 32, .35), transparent 65%),
    linear-gradient(135deg, var(--blue-900) 0%, var(--blue) 100%);
  color: #fff; padding-block: clamp(3rem, 6vw, 4.5rem);
}
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: .4rem; }
.cta-band p { color: rgba(255, 255, 255, .85); max-width: 40rem; }
.cta-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ------------------------------ Contact ------------------------------ */

.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-details h2, .contact-form-wrap h2 { font-size: 1.35rem; }
.contact-details address { color: var(--slate); margin-bottom: 1.5rem; line-height: 1.7; }

.contact-dl { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.25rem; margin-bottom: 2rem; }
.contact-dl dt {
  font-family: var(--font-display); font-weight: 700; font-size: .78rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--blue);
  padding-top: .15rem;
}
.contact-dl dd { color: var(--slate); font-size: .95rem; }

.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map-wrap iframe { display: block; width: 100%; height: 320px; border: 0; }
.map-link { margin-top: .7rem; font-size: .88rem; }

.contact-form-wrap {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow);
}
.form-intro { font-size: .9rem; margin-bottom: 1.5rem; }

.contact-form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .35rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field label { font-size: .85rem; font-weight: 600; color: var(--blue-900); }
.field label span { color: var(--red); }

.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; font-size: .95rem; width: 100%;
  padding: .75rem .9rem; color: var(--ink);
  background: var(--bg-warm); border: 1px solid var(--line-strong); border-radius: 8px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.contact-form textarea { resize: vertical; min-height: 8rem; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; background: var(--white);
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(15, 71, 173, .16);
}
.contact-form [aria-invalid="true"] { border-color: var(--red); }
.contact-form [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(217, 4, 32, .16); }

.field-error { font-size: .82rem; color: var(--red-700); margin: 0; }

/* Off-screen rather than display:none so bots still fill it in. */
.hp-field {
  position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden;
}

.form-status { font-size: .92rem; margin: 0; min-height: 1.4em; }
.form-status.is-ok { color: #0f7a3d; font-weight: 500; }
.form-status.is-error { color: var(--red-700); font-weight: 500; }
.form-fallback { font-size: .86rem; color: var(--slate-light); margin: 0; }

/* ------------------------------ Footer ------------------------------ */

.site-footer { background: var(--blue-950); color: rgba(255, 255, 255, .72); padding-top: clamp(3rem, 6vw, 4.5rem); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 2.5rem;
  padding-bottom: 3rem;
}
.footer-logo { width: auto; height: 56px; margin-bottom: 1.1rem; }
.footer-reg { font-size: .82rem; color: rgba(255, 255, 255, .5); margin-bottom: .9rem; }
.footer-tagline { font-size: .9rem; color: rgba(255, 255, 255, .6); }

.footer-col h2 {
  font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #fff; margin-bottom: 1rem;
}
.footer-col ul { display: grid; gap: .55rem; }
.footer-col a { color: rgba(255, 255, 255, .72); text-decoration: none; font-size: .92rem; }
.footer-col a:hover { color: #fff; text-decoration: underline; }

.footer-contact address, .footer-contact p { font-size: .92rem; color: rgba(255, 255, 255, .72); margin-bottom: .6rem; line-height: 1.7; }
.footer-hours { color: rgba(255, 255, 255, .5) !important; font-size: .86rem !important; }

.footer-legal {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-block: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .1);
}
.footer-legal p { font-size: .84rem; color: rgba(255, 255, 255, .45); margin: 0; }

.error-page { padding-block: clamp(4rem, 10vw, 8rem); }
.error-page .chip-list { margin: 2rem 0; }

/* ---------------------------- Responsive ---------------------------- */

@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2rem; }
  .tiles, .tiles-3 { grid-template-columns: repeat(2, 1fr); }
  .project-grid, .project-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .sector-grid, .client-wall { grid-template-columns: repeat(3, 1fr); }
  .points-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .heritage-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .5rem var(--gutter) 1.5rem;
    background: var(--blue-950); border-bottom: 1px solid rgba(255, 255, 255, .1);
    box-shadow: var(--shadow-lg);
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .nav.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a { padding: .95rem .25rem; border-bottom: 1px solid rgba(255, 255, 255, .12); }
  .nav a[aria-current="page"] { border-bottom-color: rgba(255, 255, 255, .12); }
  .nav .nav-cta { margin-top: 1rem; }

  .prose-columns { columns: 1; }
  .split, .feature, .contact-grid, .pillars, .mv-grid, .cert-grid, .tt-grid { grid-template-columns: 1fr; }
  .split-reverse .split-copy, .split-reverse .split-media, .split-reverse .split-aside,
  .feature:nth-child(even) .feature-media { order: initial; }
  .sticky-media { position: static; }
  .service { grid-template-columns: 1fr; }
  /* The photo is out of flow, so nothing inside this box props it open and its
     height can only come from aspect-ratio. Safari gives a stretched grid item
     a definite block size that beats aspect-ratio, collapsing the box to zero
     and hiding the photo -- so opt out of the stretch, and keep a floor as a
     second line of defence in case aspect-ratio is ignored entirely. */
  .service-media { position: relative; align-self: start; min-height: 180px; aspect-ratio: 16 / 9; }
  .service-body { padding: 0 1.5rem 1.75rem; }
  .check-list-2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .brand-place { display: none; }
  .brand-logo { height: 40px; }
  .stats-grid { grid-template-columns: 1fr; }
  .tiles, .tiles-3, .project-grid, .project-grid-3, .points-4 { grid-template-columns: 1fr; }
  .sector-grid, .client-wall { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .gallery, .heritage-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-actions .btn, .cta-actions .btn { flex: 1 1 auto; }
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.6rem; }
}

@media print {
  .site-header, .nav, .cta-band, .lightbox, .map-wrap, .hero-actions { display: none !important; }
  body { color: #000; }
  .hero, .page-hero { min-height: 0; color: #000; }
  .hero::after, .page-hero::after, .hero-media, .page-hero-media { display: none; }
  .hero h1, .page-hero h1, .lede { color: #000; }
}
