/* ==========================================================================
   Caliber Imports — style.css
   Single-page marketing site stylesheet
   Order: design system → base → components → header → hero → sections →
          services → expertise (dark) → footer → modals → 768px → 480px
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN SYSTEM — custom properties
   -------------------------------------------------------------------------- */
:root {
  /* Brand accents (two-tone, from the logo's true colours) */
  --accent-primary: #c20213;   /* logo crimson: buttons, service titles, nav underlines (light backgrounds) */
  --accent-light:   #dd4653;   /* reversed-logo arrow: dark-section titles/checkmarks, hovers */
  --accent-on-dark: #ee6b76;   /* small text on navy (footer headings, footer hovers): ≥4.5:1 on both brand darks */
  --accent-primary-rgb: 194, 2, 19;
  --accent-light-rgb:   221, 70, 83;

  /* Brand darks (derived from the logo crosshair slate) */
  --brand-dark-1: #0f1b2d;     /* dark section gradient start (navy) */
  --brand-dark-2: #1c2a3a;     /* dark section gradient end (slate) */
  --brand-slate:  #8a96a8;     /* muted slate for small labels */
  --brand-navy:   #001b43;     /* logo crosshair navy: header wordmark */

  /* Neutral palette */
  --white:      #ffffff;
  --neutral-50:  #f8f9fb;
  --neutral-100: #f1f3f6;
  --neutral-200: #e3e7ec;
  --neutral-300: #cfd5dd;
  --neutral-400: #a9b2bf;
  --neutral-500: #7d8796;
  --neutral-600: #5b6573;
  --neutral-700: #404956;
  --neutral-800: #28303b;
  --neutral-900: #161c25;

  /* Semantic */
  --color-text:        var(--neutral-800);
  --color-text-muted:  var(--neutral-600);
  --color-bg:          var(--white);
  --color-bg-alt:      var(--neutral-50);
  --color-border:      var(--neutral-200);
  --color-success:     #2e8b57;
  --color-error:       #c62828;

  /* Spacing scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Section rhythm */
  --section-padding-y: clamp(4rem, 8vw, 6.5rem);
  --section-gap:       clamp(2.5rem, 5vw, 4rem);

  /* Type scale (fluid) */
  --text-xs:   clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm:   clamp(0.875rem, 0.84rem + 0.17vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-md:   clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
  --text-lg:   clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --text-xl:   clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --text-2xl:  clamp(2.25rem, 1.6rem + 2.8vw, 3.5rem);
  --text-hero: clamp(2rem, 1.3rem + 3.2vw, 3.75rem);

  /* Font families */
  --font-heading: "Montserrat", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body:    "Inter", "Segoe UI", Helvetica, Arial, sans-serif;

  /* Layout */
  --header-height: 100px;
  --container-max: 1200px;
  --container-pad: clamp(1rem, 4vw, 2.5rem);

  /* Radii */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.06), 0 1px 3px rgba(15, 27, 45, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 27, 45, 0.08), 0 2px 4px rgba(15, 27, 45, 0.06);
  --shadow-lg: 0 14px 34px rgba(15, 27, 45, 0.14), 0 4px 10px rgba(15, 27, 45, 0.08);
  --shadow-xl: 0 28px 60px rgba(15, 27, 45, 0.28);

  /* Motion */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 180ms;
  --duration-base: 280ms;
  --duration-slow: 600ms;

  /* Z-index ladder (Rule 5) */
  --z-mobile-nav: 999;
  --z-header:     1000;
  --z-hamburger:  1001;
  --z-modal:      2000;
}

/* --------------------------------------------------------------------------
   2. BASE / RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.nav-open,
body.modal-open {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--space-4);
  color: var(--neutral-900);
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

a:hover {
  color: var(--accent-light);
}

ul, ol {
  margin: 0;
  padding: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

/* Accessibility: focus-visible outlines in accent primary */
:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: calc(var(--z-modal) + 1);
  padding: var(--space-3) var(--space-5);
  background: var(--accent-primary);
  color: var(--white);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: top var(--duration-fast) ease;
}

.skip-link:focus {
  top: var(--space-4);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   3. LAYOUT HELPERS
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

.section-light {
  background-color: var(--color-bg);
}

.section-alt {
  background-color: var(--color-bg-alt);
}

.section-header {
  container-type: inline-size;   /* single-phrase section titles size themselves to this width */
  max-width: 820px;
  margin: 0 auto var(--section-gap);
  text-align: center;
}

.section-title {
  font-size: var(--text-xl);
  color: var(--accent-primary);
  margin-bottom: var(--space-4);
}

/* Single-phrase section titles stay on one row on phones. The longest, "Why Clients
   Choose Us", is 12em wide; dividing by 12.3 leaves a 3% margin. min() only ever
   shrinks, so desktop sizes are unchanged. The three-phrase About headline is
   excluded: it is meant to span lines. */
.services-section .section-title,
.expertise-section .section-title,
.projects-section .section-title {
  font-size: min(var(--text-xl), 100cqi / 12.3);
}

.section-subtitle {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  margin: 0;
}

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-slate);
  margin-bottom: var(--space-3);
}

.text-justify {
  text-align: justify;
  text-justify: inter-word;
}

/* The hero is a full-viewport block that starts under the fixed header
   (it carries padding-top: var(--header-height)). Anchor targets further
   down are offset by scroll-padding-top on <html>. */
.site-main {
  padding-top: 0;
}

/* --------------------------------------------------------------------------
   4. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.95rem 2.1rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  border: 2px solid transparent;
  transition:
    background-color var(--duration-base) ease,
    color var(--duration-base) ease,
    border-color var(--duration-base) ease,
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Primary: accent → hover accent-light */
.btn-primary {
  background-color: var(--accent-primary);
  color: var(--white);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 22px rgba(var(--accent-primary-rgb), 0.3);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--accent-light);
  border-color: var(--accent-light);
  color: var(--white);
  box-shadow: 0 12px 28px rgba(var(--accent-light-rgb), 0.38);
}

/* CTA: white pill → hover accent primary */
.btn-cta {
  background-color: var(--white);
  color: var(--neutral-900);
  border-color: var(--white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.btn-cta:hover,
.btn-cta:focus-visible {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--white);
  box-shadow: 0 14px 34px rgba(var(--accent-primary-rgb), 0.4);
}

.btn-block {
  width: 100%;
}

/* --------------------------------------------------------------------------
   5. STICKY HEADER
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--header-height);
  z-index: var(--z-header);
  background-color: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(15, 27, 45, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  transition:
    box-shadow var(--duration-base) ease,
    background-color var(--duration-base) ease;
}

.site-header.scrolled {
  background-color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 24px rgba(15, 27, 45, 0.1);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
}

.logo img {
  height: 81px;
  width: auto;
}

/* Horizontal lockup: icon, then "Caliber IMPORTS" on one row, sharing a baseline */
.logo-text {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.45em;
  line-height: 1;
  white-space: nowrap;
}

.logo-name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  color: var(--brand-navy);
}

/* The red tag sits beside the name; the breakpoint sizes keep the same ratio to .logo-name.
   The negative right margin cancels the letter-spacing added after the final letter. */
.logo-tag {
  margin-right: -0.12em;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

/* Desktop nav */
.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.6vw, 2.5rem);
  list-style: none;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: var(--space-2) 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neutral-800);
  transition: color var(--duration-fast) ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background-color: var(--accent-primary);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--duration-base) var(--ease-out);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active {
  color: var(--accent-primary);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left center;
}

/* Mobile menu footer (button + email): only shown inside the full-screen mobile panel */
.nav-panel-footer {
  display: none;
}

/* Hamburger (hidden on desktop) */
.nav-toggle {
  display: none;
  position: relative;
  z-index: var(--z-hamburger);
  pointer-events: auto;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-direction: column;
  gap: 5px;
}

.nav-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--neutral-900);
  border-radius: 2px;
  transition:
    transform var(--duration-base) var(--ease-out),
    opacity var(--duration-fast) ease;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   6. VIDEO HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--header-height);
  padding-bottom: var(--space-16);
  overflow: hidden;
  background-color: var(--brand-dark-1);
  background-image: url("../images/hero-fallback.jpg");
  background-size: cover;
  background-position: center;
  color: var(--white);
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
  will-change: opacity;
}

.hero-video.is-active {
  opacity: 1;
}

/* Video engine failure → hide videos and rely on CSS fallback image */
.hero.video-failed .hero-video,
.hero.video-fallback .hero-video {
  display: none;
}

/* Dark overlay gradient */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(15, 27, 45, 0.78) 0%,
      rgba(15, 27, 45, 0.55) 45%,
      rgba(15, 27, 45, 0.82) 100%
    );
  pointer-events: none;
}

/* Film grain overlay (CSS-only repeating noise) */
.hero-grain {
  position: absolute;
  inset: -50%;
  z-index: 2;
  width: 200%;
  height: 200%;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image:
    repeating-radial-gradient(circle at 17% 29%, rgba(255,255,255,0.9) 0, rgba(255,255,255,0.9) 1px, transparent 1px, transparent 3px),
    repeating-radial-gradient(circle at 63% 71%, rgba(0,0,0,0.9) 0, rgba(0,0,0,0.9) 1px, transparent 1px, transparent 4px),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.06) 0, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 2px);
  background-size: 160px 160px, 220px 220px, 3px 3px;
  animation: grain 0.9s steps(6) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -4%); }
  60%  { transform: translate(-4%, -1%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* Hero videos play even with reduced motion on (client decision, 2026-11-11):
   the motion is a slow, eased pan/zoom with no flashing. Only the grain stops. */
@media (prefers-reduced-motion: reduce) {
  .hero-grain {
    animation: none;
  }
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: var(--space-8) var(--container-pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: var(--space-5);
}

.hero-title {
  font-size: var(--text-hero);
  font-weight: 700;
  color: var(--white);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-6);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
  max-width: none;   /* the two rows below set the width */
}

/* The heading is always exactly two rows: "International Relations &" / "Strategic Partnerships".
   Each row never wraps; on narrow screens both shrink together so the longer row (12.5em, measured)
   fits the hero's content width (cqi = .hero-content). */
.hero-content {
  container-type: inline-size;
}

.hero-title .hero-title-row {
  display: block;
  white-space: nowrap;
  font-size: min(1em, 100cqi / 12.7);
}

.hero-title .hero-title-prefix {
  display: block;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 0.6em;
}

.hero-description {
  max-width: 640px;
  text-align: justify;
  text-justify: inter-word;
  font-size: var(--text-md);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
  margin-bottom: var(--space-8);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}

.hero-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: var(--space-8);
  z-index: 3;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  opacity: 0.8;
}

.hero-scroll-hint::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--white);
  animation: scrollhint 1.8s ease-in-out infinite;
}

@keyframes scrollhint {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* --------------------------------------------------------------------------
   7. OVERVIEW / ABOUT
   -------------------------------------------------------------------------- */
/* The About blocks slide in from the sides (AOS fade-left/right start 100px
   off-position). Clip that so the page can never be panned sideways; `clip`
   (unlike `hidden`) is not scrollable at all, including on iOS touch. */
.about-section {
  overflow-x: clip;
}

.about-section .section-title {
  font-size: var(--text-xl);
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.about-section .section-title .title-sep {
  color: var(--brand-slate);
  padding: 0 0.15em;
}

.content-image-grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.content-image-grid + .content-image-grid {
  margin-top: var(--section-gap);
}

.content-image-grid.reverse {
  direction: rtl;
}

.content-image-grid.reverse > * {
  direction: ltr;
}

/* About sub-headings stay on one row: sized to the text column's width (container
   query units). The longest, "Advisory Built on Relationships, Not Reports", is
   22.6em wide; dividing by 23.3 leaves a 3% margin. Capped at the old 1.75rem;
   floored at 14px for legibility on the very narrowest phones. */
.grid-text {
  container-type: inline-size;
}

.grid-text h3 {
  font-size: max(14px, min(1.75rem, 100cqi / 23.3));
  color: var(--neutral-900);
  margin-bottom: var(--space-4);
}

.grid-text p {
  text-align: justify;
  text-justify: inter-word;
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.grid-text p:last-child {
  margin-bottom: 0;
}

.grid-image {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--neutral-100);
  aspect-ratio: 4 / 3;
}

.grid-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.grid-image:hover img {
  transform: scale(1.03);
}

.grid-image::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(15, 27, 45, 0.08);
  pointer-events: none;
}

/* Credibility pillars under About — "The Caliber Standard" panel.
   The grid's 1px gap shows its background colour, giving hairline dividers
   between pillars that adapt to any column count. */
.stat-block {
  position: relative;
  margin-top: calc(var(--section-gap) + var(--space-4));
}

.stat-block-label {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: var(--space-2) var(--space-5);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--neutral-700);
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.stat-block-label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: var(--space-3);
  vertical-align: middle;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.18);
}

.stat-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(2.25rem, 4vw, 3rem) clamp(1.25rem, 2.2vw, 1.75rem) clamp(1.75rem, 3vw, 2.25rem);
  background: linear-gradient(180deg, var(--white) 0%, var(--neutral-50) 100%);
  transition: background-color var(--duration-base) ease;
}

/* Accent line that grows along the top edge on hover */
.stat::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-light));
  transform: translateX(-50%);
  transition: width var(--duration-slow) var(--ease-out);
}

.stat:hover::after {
  width: 100%;
}

/* Icon in a crosshair-style ring, echoing the logo */
.stat-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-bottom: var(--space-5);
  border-radius: 50%;
  color: var(--accent-primary);
  background: var(--white);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.22);
  box-shadow: 0 0 0 6px rgba(var(--accent-primary-rgb), 0.06);
  transition:
    background-color var(--duration-base) ease,
    color var(--duration-base) ease,
    box-shadow var(--duration-base) ease,
    transform var(--duration-base) var(--ease-out);
}

/* Crosshair ticks at 12, 3, 6 and 9 o'clock */
.stat-icon::before {
  content: "";
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  background:
    linear-gradient(var(--brand-slate), var(--brand-slate)) top center / 1.5px 6px no-repeat,
    linear-gradient(var(--brand-slate), var(--brand-slate)) bottom center / 1.5px 6px no-repeat,
    linear-gradient(var(--brand-slate), var(--brand-slate)) left center / 6px 1.5px no-repeat,
    linear-gradient(var(--brand-slate), var(--brand-slate)) right center / 6px 1.5px no-repeat;
  opacity: 0.55;
  transition: opacity var(--duration-base) ease, transform var(--duration-slow) var(--ease-out);
}

.stat-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat:hover .stat-icon {
  color: var(--white);
  background: var(--accent-primary);
  box-shadow: 0 0 0 6px rgba(var(--accent-primary-rgb), 0.14);
  transform: translateY(-2px);
}

.stat:hover .stat-icon::before {
  opacity: 1;
  transform: rotate(45deg);
}

.stat-title {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--neutral-900);
  margin: 0 0 var(--space-3);
  white-space: nowrap;
}

.stat-title::after {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin: var(--space-3) auto 0;
  border-radius: 2px;
  background: var(--accent-primary);
}

.stat-label {
  max-width: 30ch;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .stat::after,
  .stat-icon,
  .stat-icon::before {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   8. SERVICES
   -------------------------------------------------------------------------- */
.services-section .section-title {
  text-align: center;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding-top: var(--space-6);
}

.service-card {
  container-type: inline-size;   /* .service-title sizes itself to the card's content width */
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) ease,
    border-color var(--duration-base) ease;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(1.75rem, 3vw, 2.5rem);
  right: clamp(1.75rem, 3vw, 2.5rem);
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-light));
  opacity: 0;
  transition: opacity var(--duration-base) ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--accent-primary-rgb), 0.3);
}

.service-card:hover::before {
  opacity: 1;
}

.service-index {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--brand-slate);
  margin-bottom: var(--space-3);
}

/* Service titles stay on one row: sized to the card's content width (the card is
   the size container). The longest, "Government & International Relations", is
   19.4em wide; dividing by 20 leaves a 3% margin. Same cap and floor as above. */
.service-title {
  font-size: max(14px, min(1.75rem, 100cqi / 20));
  color: var(--accent-primary);
  margin-bottom: var(--space-3);
}

.service-card > p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.service-list li {
  position: relative;
  padding-left: 1.75rem;
  color: var(--neutral-700);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.service-list li::before {
  content: "\2713"; /* ✓ */
  position: absolute;
  left: 0;
  top: 0;
  width: 1.2rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent-primary);
  -webkit-text-fill-color: var(--accent-primary);
}

/* --------------------------------------------------------------------------
   9. "WHY CLIENTS CHOOSE US" — dark expertise section
   -------------------------------------------------------------------------- */
.expertise-section {
  position: relative;
  background: linear-gradient(160deg, var(--brand-dark-1) 0%, var(--brand-dark-2) 100%);
  color: var(--white);
  overflow: hidden;
}

.expertise-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(var(--accent-light-rgb), 0.12) 0, transparent 38%),
    radial-gradient(circle at 10% 90%, rgba(138, 150, 168, 0.12) 0, transparent 40%);
  pointer-events: none;
}

.expertise-section .container {
  position: relative;
  z-index: 1;
}

.expertise-section .section-title {
  color: var(--accent-light);
  text-align: center;
}

.expertise-section .section-eyebrow {
  color: rgba(255, 255, 255, 0.6);
}

.expertise-section .section-subtitle {
  color: rgba(255, 255, 255, 0.78);
}

.trust-wrapper {
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}

.trust-list {
  display: inline-block;
  text-align: left;
  list-style: none;
  margin: 0 0 var(--space-8);
  padding: 0;
}

.trust-list li {
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: var(--space-4);
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--white);
  line-height: 1.55;
}

.trust-list li:last-child {
  margin-bottom: 0;
}

.trust-list li strong {
  font-weight: 700;
  color: var(--white);
}

/* Rule 4: belt-and-suspenders checkmark color on dark background */
.trust-list li::before {
  content: "\2714"; /* ✔ */
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1em;
  color: var(--accent-light) !important;
  -webkit-text-fill-color: var(--accent-light) !important;
}

.expertise-section .trust-list li::before {
  color: var(--accent-light) !important;
  -webkit-text-fill-color: var(--accent-light) !important;
}

.trust-closing {
  max-width: 720px;
  margin: 0 auto var(--space-8);
  font-size: var(--text-md);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.85);
}

.trust-closing + .btn,
.trust-wrapper .btn-primary {
  margin-top: var(--space-2);
}

/* --------------------------------------------------------------------------
   9b. PROJECTS — auto-scrolling carousel
   Without JS (or with reduced motion) the strip is a swipeable, snap-scrolling
   row. script.js adds .is-animated, repeats the cards for a seamless loop and
   sets --marquee-distance (one set of cards, px) and --marquee-duration.
   -------------------------------------------------------------------------- */
.projects-section {
  background:
    radial-gradient(circle at 12% 0%, rgba(var(--accent-primary-rgb), 0.05) 0, transparent 40%),
    var(--color-bg-alt);
  overflow: hidden;
}

.projects-marquee {
  --card-width: min(82vw, 25rem);
  --card-gap: 1.25rem;
  position: relative;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--container-pad);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.projects-marquee::-webkit-scrollbar {
  display: none;
}

.projects-track {
  list-style: none;
  margin: 0;
  padding: var(--space-3) var(--container-pad) var(--space-6);
  display: flex;
  gap: var(--card-gap);
  width: max-content;
}

/* Animated mode: hidden overflow, soft fade at both edges, endless drift */
.projects-marquee.is-animated {
  overflow: hidden;
  scroll-snap-type: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.projects-marquee.is-animated .projects-track {
  padding-left: 0;
  padding-right: 0;
  animation: projects-scroll var(--marquee-duration, 60s) linear infinite;
  will-change: transform;
}

.projects-marquee.is-animated:hover .projects-track,
.projects-marquee.is-animated:focus-within .projects-track,
.projects-marquee.is-held .projects-track,
.projects-marquee.is-paused .projects-track {
  animation-play-state: paused;
}

@keyframes projects-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--marquee-distance, 50%))); }
}

/* Card */
.project-card {
  flex: 0 0 var(--card-width);
  width: var(--card-width);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) ease,
    border-color var(--duration-base) ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--accent-primary-rgb), 0.35);
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--brand-dark-1);
}

.project-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform var(--duration-slow) var(--ease-out);
}

.project-card:hover .project-media img {
  transform: scale(1.03);
}

/* Gentle navy fade for mood only; legibility comes from the text block below */
.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(15, 27, 45, 0.35) 0%, transparent 60%);
  pointer-events: none;
}

/* The text block carries its own navy backing (solid 80% behind the text, fading
   in over the 2.5rem above the label), so it grows with the text: however long a
   title runs, the label and title always sit on shading. Measured worst case, over
   a pure-white patch of photo: label 6:1, title 9:1. */
.project-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 2.5rem var(--space-5) var(--space-5);
  background: linear-gradient(0deg, rgba(15, 27, 45, 0.82) 0, rgba(15, 27, 45, 0.8) calc(100% - 2.5rem), transparent 100%);
}

.project-eyebrow {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffc2c8;   /* pale crimson tint: stays ≥4.5:1 over the 80% navy backing even on white photo areas */
}

/* Sized so the widest row ("Copper Mining Concession") fits the 360px card text
   width on desktop (needs <= 26.4px; capped at 25.6px). */
.project-title {
  margin: var(--space-2) 0 0;
  font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.6rem);
  line-height: 1.15;
  color: var(--white);
}

.project-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
}

.project-summary {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-muted);
}

/* Card footer: location (muted, with pin) above the "Explore Opportunity" button.
   Always stacked, so every card looks the same at every width; pinned to the
   bottom of the (equal-height) cards, so the four buttons line up. */
.project-footer {
  margin-top: auto;
  padding-top: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.project-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neutral-600);
}

.project-meta::before {
  content: "";
  width: 0.85em;
  height: 1.1em;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 30'%3E%3Cpath d='M12 0C5.4 0 0 5.2 0 11.7 0 20.4 12 30 12 30s12-9.6 12-18.3C24 5.2 18.6 0 12 0zm0 16.5a4.8 4.8 0 1 1 0-9.6 4.8 4.8 0 0 1 0 9.6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 30'%3E%3Cpath d='M12 0C5.4 0 0 5.2 0 11.7 0 20.4 12 30 12 30s12-9.6 12-18.3C24 5.2 18.6 0 12 0zm0 16.5a4.8 4.8 0 1 1 0-9.6 4.8 4.8 0 0 1 0 9.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: var(--space-2) 0;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: none;
  border: 0;
  border-bottom: 2px solid rgba(var(--accent-primary-rgb), 0.25);
  border-radius: 0;
  cursor: pointer;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.project-cta svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--duration-base) var(--ease-out);
}

.project-cta:hover,
.project-cta:focus-visible {
  border-bottom-color: var(--accent-primary);
}

.project-card:hover .project-cta svg,
.project-cta:focus-visible svg {
  transform: translateX(4px);
}

/* Pause / play control */
.projects-controls {
  display: flex;
  justify-content: center;
  margin-top: var(--space-6);
}

.projects-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neutral-700);
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.projects-toggle[hidden] {
  display: none;
}

.projects-toggle:hover {
  color: var(--accent-primary);
  border-color: rgba(var(--accent-primary-rgb), 0.4);
}

.projects-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.projects-toggle .icon-play { display: none; fill: currentColor; }
.projects-toggle[aria-pressed="true"] .icon-pause { display: none; }
.projects-toggle[aria-pressed="true"] .icon-play { display: block; }

@media (prefers-reduced-motion: reduce) {
  .project-card,
  .project-media img {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   10. FOOTER
   -------------------------------------------------------------------------- */
/* Background photo (world map, skyline, port at dusk) under a navy wash that keeps
   the small footer text legible over the skyline lights. The solid colour is the
   fallback while the image loads. */
.site-footer {
  position: relative;
  background:
    linear-gradient(180deg, rgba(15, 27, 45, 0.62) 0%, rgba(15, 27, 45, 0.68) 55%, rgba(15, 27, 45, 0.9) 100%),
    url("../images/footer-bg.jpg") center 30% / cover no-repeat,
    var(--brand-dark-1);
  color: rgba(255, 255, 255, 0.82);
  padding-top: var(--space-16);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  margin-bottom: var(--space-12);
}

.footer-brand img {
  height: 92px;
  width: auto;
  margin-bottom: var(--space-4);
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-2);
  letter-spacing: 0.02em;
}

.footer-tagline {
  max-width: 560px;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.68);
  margin: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-contact-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-base);
}

.footer-contact-item a {
  color: rgba(255, 255, 255, 0.85);
}

/* Footer sits on navy: accents use --accent-on-dark (logo crimson is too dark to read there) */
.footer-contact-item a:hover {
  color: var(--accent-on-dark);
}

.footer-contact-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: currentColor;
}

.footer-email {
  color: rgba(255, 255, 255, 0.85);
  word-break: break-word;
}

.footer-email:hover {
  color: var(--accent-on-dark);
}

.footer-address {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.72);   /* 0.6 dipped below 4.5:1 over the footer photo's skyline lights on phones */
  margin: var(--space-2) 0 0;
  line-height: 1.6;
}

.footer-column {
  text-align: left;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
  margin-bottom: var(--space-5);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--text-sm);
  transition: color var(--duration-fast) ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--accent-on-dark);
}

/* Three columns: copyright (left), Powered by Thrive (exact centre), privacy (right) */
.footer-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-6) 0;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.55);
}

.footer-bottom-links {
  justify-self: end;
}

.footer-powered {
  display: block;
  justify-self: center;
  line-height: 0;
  border-radius: var(--radius-sm);
  opacity: 0.9;
  transition: opacity var(--duration-fast) ease;
}

.footer-powered:hover,
.footer-powered:focus-visible {
  opacity: 1;
}

.footer-powered img {
  height: 40px;
  width: auto;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.footer-bottom-links a,
#privacy-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 3px;
}

.footer-bottom-links a:hover,
#privacy-link:hover,
#privacy-link:focus-visible {
  color: var(--accent-on-dark);
  text-decoration-color: var(--accent-on-dark);
}

/* --------------------------------------------------------------------------
   11. MODALS
   -------------------------------------------------------------------------- */
.modal {
  display: none; /* toggled to flex by JS */
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(15, 27, 45, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal.is-open {
  display: flex;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 3rem);
  max-height: calc(100svh - 3rem);
  overflow-y: auto;
  background: var(--white);
  color: var(--color-text);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: clamp(1.75rem, 4vw, 3rem);
  margin: auto;
  animation: modalIn var(--duration-base) var(--ease-out);
}

.modal-dialog.modal-wide {
  max-width: 760px;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .modal-dialog {
    animation: none;
  }
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--neutral-600);
  background: var(--neutral-100);
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--accent-primary);
  color: var(--white);
  transform: rotate(90deg);
}

.modal-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.modal-logo img {
  width: clamp(132px, 18vw, 211px);
  height: auto;
}

.modal-title {
  font-size: var(--text-lg);
  text-align: center;
  color: var(--neutral-900);
  margin-bottom: var(--space-2);
}

.modal-intro {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

/* Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-4);
}

.form-group label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neutral-700);
  margin-bottom: var(--space-2);
}

.required-mark {
  color: var(--accent-primary);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: var(--text-base);
  line-height: 1.4;
  color: var(--neutral-900);
  background: var(--neutral-50);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background-color var(--duration-fast) ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.18);
}

.form-control::placeholder {
  color: var(--neutral-400);
}

select.form-control {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--neutral-600) 50%),
    linear-gradient(135deg, var(--neutral-600) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 15px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
  cursor: pointer;
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.form-control.is-invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.14);
}

.field-error {
  display: none;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-error);
  line-height: 1.4;
}

.field-error.is-visible {
  display: block;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.form-check input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.form-check label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}

.form-check label a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-check label a:hover {
  color: var(--accent-light);
}

.form-check-wrap {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-6);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-note {
  font-size: var(--text-xs);
  color: var(--neutral-500);
  text-align: center;
  margin: 0;
}

/* Form status (success / failure) */
.form-status {
  display: none;
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.form-status.is-visible {
  display: block;
}

.form-status.success {
  background: rgba(46, 139, 87, 0.1);
  color: #1f6b42;
  border: 1px solid rgba(46, 139, 87, 0.3);
}

.form-status.error {
  background: rgba(198, 40, 40, 0.08);
  color: #9c1f1f;
  border: 1px solid rgba(198, 40, 40, 0.3);
}

.form-success-panel {
  display: none;
  text-align: center;
  padding: var(--space-6) 0 var(--space-2);
}

.form-success-panel.is-visible {
  display: block;
}

.form-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(46, 139, 87, 0.12);
  color: var(--color-success);
  font-size: 1.8rem;
  font-weight: 700;
}

.form-success-panel h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.form-success-panel p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

/* Privacy modal body */
.privacy-body {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--neutral-700);
}

.privacy-body h3 {
  font-size: var(--text-base);
  color: var(--neutral-900);
  margin: var(--space-6) 0 var(--space-2);
}

.privacy-body h3:first-of-type {
  margin-top: var(--space-4);
}

.privacy-body p {
  margin-bottom: var(--space-3);
}

.privacy-body ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: var(--space-3);
}

.privacy-body li {
  margin-bottom: var(--space-1);
}

.privacy-body a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.privacy-meta {
  font-size: var(--text-xs);
  color: var(--neutral-500);
  text-align: center;
  margin-bottom: var(--space-2);
}

/* --------------------------------------------------------------------------
   12. AOS graceful fallbacks
   If the AOS library fails to load, elements with [data-aos] stay visible.
   script.js adds .aos-ready to <html> once AOS has initialised.
   -------------------------------------------------------------------------- */
html:not(.aos-ready) [data-aos] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* --------------------------------------------------------------------------
   13. UTILITIES
   -------------------------------------------------------------------------- */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--color-text-muted) !important; }
.hidden { display: none !important; }

/* ==========================================================================
   14. RESPONSIVE — TABLET / SMALL LAPTOP  (≤ 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }

  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Phones and tablets (incl. landscape phones): the hamburger menu replaces the desktop links,
     which no longer fit beside the one-row logo below ~1024px. */
  /* Hamburger visible */
  .nav-toggle {
    display: inline-flex;
  }

  /* Nav becomes a full-screen panel below the header.
     The header is a GPU layer (Rule 3), which makes it the containing block for this fixed panel,
     so the height is set explicitly instead of relying on bottom: 0. The background is solid:
     a translucent or blurred panel nested inside the header's blur lets page content show through.
     Closed, the panel is visibility:hidden so its links can't be reached by keyboard. */
  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: stretch;   /* desktop .main-nav centres its children; the panel needs full-width rows */
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--white);
    border-top: 1px solid var(--color-border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition:
      opacity var(--duration-base) ease,
      transform var(--duration-base) var(--ease-out),
      visibility 0s linear var(--duration-base);
  }

  .main-nav.active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition:
      opacity var(--duration-base) ease,
      transform var(--duration-base) var(--ease-out),
      visibility 0s linear 0s;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-4) 0;
  }

  /* Bottom of the panel: consultation button + email */
  .nav-panel-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    margin-top: auto;
    padding: var(--space-8) var(--container-pad);
    padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom, 0px));
    background: var(--neutral-50);
    border-top: 1px solid var(--color-border);
  }

  .nav-panel-footer .btn {
    width: 100%;
    max-width: 360px;
    white-space: normal;
  }

  .nav-panel-email {
    font-size: var(--text-sm);
    color: var(--neutral-600);
  }

  .nav-list li {
    width: 100%;
  }

  .nav-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: var(--space-5) var(--container-pad);
    font-size: var(--text-md);
    border-bottom: 1px solid var(--neutral-100);
  }

  .nav-list li:last-child .nav-link {
    border-bottom: 0;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link:hover,
  .nav-link:focus-visible {
    background-color: var(--neutral-50);
  }

}

/* ==========================================================================
   15. RESPONSIVE — MOBILE  (≤ 768px)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 70px;
    --section-padding-y: clamp(3rem, 10vw, 4rem);
    --section-gap: clamp(2rem, 7vw, 2.75rem);
    --container-pad: 1.25rem;
  }

  /* Rule 3: hardened fixed header for iOS Safari */
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  .logo img {
    height: 56px;
  }

  .logo {
    gap: var(--space-2);
  }

  .logo-name {
    font-size: 1.2rem;
  }

  .logo-tag {
    font-size: 0.825rem;
  }

  /* Hero */
  .hero {
    min-height: 100vh;
    min-height: 100svh;
    padding-bottom: var(--space-14);
  }

  .hero-content {
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
  }

  .hero-title {
    max-width: none;
  }

  .hero-description {
    line-height: 1.65;
    font-size: var(--text-base);
  }

  .hero-scroll-hint {
    display: none;
  }

  /* Content grids collapse to 1 column, rows un-reverse */
  .content-image-grid,
  .content-image-grid.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: var(--space-6);
  }

  .content-image-grid .grid-image {
    order: -1;
  }

  .grid-image {
    aspect-ratio: 16 / 10;
  }

  /* Services grid 1 column */
  .services-grid {
    grid-template-columns: 1fr;
    padding-top: var(--space-4);
  }

  /* Rule 4: re-assert dark-section checkmark color */
  .trust-list li::before,
  .expertise-section .trust-list li::before {
    color: var(--accent-light) !important;
    -webkit-text-fill-color: var(--accent-light) !important;
  }

  .trust-list li {
    font-size: var(--text-base);
  }

  /* Footer */
  .footer-brand {
    width: 100%;
    text-align: center;
    align-items: center;
  }

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

  .footer-contact {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-contact-item {
    justify-content: center;
  }

  .footer-column {
    text-align: center;
  }

  .footer-bottom {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: var(--space-4);
  }

  .footer-bottom-links {
    justify-self: center;
    justify-content: center;
  }

  /* Modals */
  .modal {
    padding: var(--space-4);
    align-items: flex-start;
  }

  .modal-dialog {
    max-height: calc(100vh - 2rem);
    max-height: calc(100svh - 2rem);
    padding: var(--space-8) var(--space-6) var(--space-6);
  }
}

/* ==========================================================================
   16. RESPONSIVE — SMALL PHONES  (≤ 480px)
   ========================================================================== */
@media (max-width: 480px) {
  :root {
    --section-padding-y: 2.75rem;
    --container-pad: 1rem;
  }

  .logo img {
    height: 50px;
  }

  .logo-name {
    font-size: 1.08rem;
  }

  .logo-tag {
    font-size: 0.743rem;
  }

  .btn {
    padding: 0.85rem 1.6rem;
    width: 100%;
    max-width: 360px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-title {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .hero-description {
    font-size: var(--text-sm);
  }

  .service-card {
    padding: var(--space-6) var(--space-5);
  }

  /* Project titles: slightly smaller so two-row titles stay two rows on narrow cards */
  .project-title {
    font-size: 1.15rem;
  }

  /* Narrowest phones (card text width ~222px at 320px): the widest row,
     "Copper Mining Concession", wraps at 16px in real rendering; 15.2px fits */
  @media (max-width: 360px) {
    .project-title {
      font-size: 0.95rem;
    }
  }

  /* Pillars: one column, icon beside the text */
  .stat-strip {
    grid-template-columns: 1fr;
  }

  .stat {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: var(--space-5);
    align-items: start;
    text-align: left;
    padding: var(--space-6) var(--space-5);
  }

  /* Clear the "Caliber Standard" label that sits on the panel's top edge */
  .stat:first-child {
    padding-top: calc(var(--space-6) + var(--space-5));
  }

  .stat-icon {
    grid-row: span 2;
    width: 48px;
    height: 48px;
    margin: 4px 0 0 4px;
  }

  .stat-icon::before {
    inset: -9px;
  }

  .stat-icon svg {
    width: 22px;
    height: 22px;
  }

  .stat-title {
    margin-bottom: var(--space-2);
  }

  .stat-title::after {
    margin-left: 0;
  }

  .stat-block-label {
    letter-spacing: 0.16em;
  }

  /* Single-column footer — keep columns centered (do NOT revert to left) */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-column {
    text-align: center;
  }

  .footer-brand img {
    height: 80px;
  }

  .trust-list li {
    padding-left: 1.9rem;
  }

  /* Modals */
  .modal {
    padding: var(--space-3);
  }

  .modal-dialog {
    padding: var(--space-8) var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
  }

  .modal-close {
    top: var(--space-3);
    right: var(--space-3);
    width: 36px;
    height: 36px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-control {
    padding: 0.75rem 0.9rem;
  }
}

/* ==========================================================================
   17. PRINT
   ========================================================================== */
@media print {
  .site-header,
  .hero-media,
  .hero-overlay,
  .hero-grain,
  .nav-toggle,
  .modal,
  .btn,
  .hero-scroll-hint {
    display: none !important;
  }

  .hero {
    min-height: auto;
    background: none;
    color: var(--neutral-900);
    padding-top: 0;
  }

  .hero-title,
  .hero-description {
    color: var(--neutral-900);
    text-shadow: none;
  }

  .expertise-section,
  .site-footer {
    background: none;
    color: var(--neutral-900);
  }
}
