/*
 * Hamat International Contracting Company — Brand & Bilingual RTL/LTR Layout Architecture
 * Built atop taste-skill system.css + layout.css without modifying kit files in assets/.
 * Brand palette: #0B0B0A canvas, #151513 surface, #F2EEE6 text, #F07D05 accent, #120C05 on-orange ink.
 * Engineered for Arabic RTL (index.html) and English LTR (en/index.html) across:
 * 1440x900, 1440x760 (laptop), 1024x768, 768x1024 (tablet), and 390x844 / 320px (mobile).
 */

:root {
  --hm-bg: #0B0B0A;
  --hm-surface-1: #151513;
  --hm-surface-2: #1D1C19;
  --hm-line: #2B2A28;
  --hm-text: #F2EEE6;
  --hm-text-soft: #D9D4CA;
  --hm-text-muted: #B3ACA1;
  --hm-orange: #F07D05;
  --hm-on-orange: #120C05;
  --hm-orange-deep: #8A3A0B;
  --hm-orange-shadow: #331606;
  --hm-orange-tint: #F8E2CC;

  /* Enforce Hamat square geometry & official typography */
  --r-sm: 0px;
  --r-md: 0px;
  --r-lg: 0px;
  --r-btn: 0px;
  --font-display: 'Montserrat', system-ui, sans-serif;
  --font-text: 'Lato', system-ui, sans-serif;
  --display-weight: 700;
  --display-tracking: -0.02em;
  --display-tracking-xl: -0.03em;
  --ly-scale: 1;
}

/* Override sharp radius tokens safely after system.css */
html[data-radius="sharp"] {
  --r-sm: 0px;
  --r-md: 0px;
  --r-lg: 0px;
  --r-btn: 0px;
}

html[data-buttons="block"] {
  --r-btn: 0px;
}

/* ---------- Arabic / RTL Typography & Bidirectional Overrides ---------- */
html[dir="rtl"] {
  --font-display: 'Readex Pro', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-text: 'IBM Plex Sans Arabic', 'Readex Pro', system-ui, sans-serif;
  --display-weight: 700;
  --display-tracking: 0em;
  --display-tracking-xl: 0em;
}

[dir="rtl"] body {
  line-height: 1.72;
}

/* Global heading & pull-quote hyphenation control (prevents awkward English mid-word splits) */
h1,
h2,
h3,
h4,
.hm-eyebrow,
.quote blockquote {
  hyphens: none;
  -webkit-hyphens: none;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4 {
  letter-spacing: 0 !important;
  text-wrap: wrap;
  text-align: start;
}

[dir="rtl"] h1,
[dir="rtl"] .t-h1 {
  line-height: 1.18;
}

[dir="rtl"] h2,
[dir="rtl"] .t-h2 {
  line-height: 1.24;
}

[dir="rtl"] .t-label {
  letter-spacing: 0;
}

[dir="rtl"] .section-head--center,
[dir="rtl"] .cta-type {
  text-align: right;
}

/* Automatic bidi isolation for Latin acronyms & international numbers inside Arabic prose */
[dir="rtl"] [dir="ltr"] {
  unicode-bidi: isolate;
}

[dir="rtl"] span[dir="ltr"] {
  white-space: nowrap;
}

/* Allow long Latin street addresses & email/domain links inside contact blocks to wrap safely */
[dir="rtl"] :is(address, a) span[dir="ltr"] {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ---------- Brand Buttons & Grounds (WCAG AAA 7.10:1 on #F07D05) ---------- */
.btn--primary {
  background: var(--hm-orange);
  color: var(--hm-on-orange);
  font-family: var(--font-display);
  font-weight: 600;
}

.btn--primary:hover {
  background: #F5922E;
  color: var(--hm-on-orange);
}

.ground-brand {
  --p-accent: #F07D05;
  --p-accent-ink: #120C05;
  background: var(--hm-orange);
  color: var(--hm-on-orange);
  --bg: var(--hm-orange);
  --surface: #D96E04;
  --ink: var(--hm-on-orange);
  --muted: #120C05;
  --card: var(--hm-on-orange);
  --action: #120C05;
  --action-ink: #F07D05;
  --line: rgba(18, 12, 5, 0.28);
  --line-strong: rgba(18, 12, 5, 0.56);
}

.ground-brand .btn--primary {
  background: var(--hm-on-orange);
  color: var(--hm-orange);
}

.ground-brand .btn--primary:hover {
  background: #2A1406;
  color: #F8E2CC;
}

.ground-brand .hm-eyebrow {
  color: var(--hm-on-orange);
}

.ground-brand .hm-eyebrow::before {
  background: var(--hm-on-orange);
}

/* ---------- Section Flow & Zero Vertical Clipping (Desktop >= 1024px) ----------
 * Keeps exact 1H/2H rhythm when content fits (1440x900), while letting shorter desktop
 * viewports (1440x760, 1024x768) expand smoothly instead of clipping bottom lines.
 * Scoped to >= 1024px so tablet & mobile (<= 1023px) flow naturally with zero min-height voids.
 */
@media (min-width: 1024px) {
  main > :is(section, .section):not(.hero, .section--hero, [data-moment="pinned-chapters"].is-live),
  footer.closing {
    height: auto;
    min-height: calc(var(--h, 1) * 100vh);
    min-height: calc(var(--h, 1) * 100svh);
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    overflow-y: visible;
  }

  main > :is(section, .section):not(.hero, .section--hero, [data-moment="pinned-chapters"].is-live) > :is(.wrap, .container),
  footer.closing > .wrap {
    flex: 1 0 auto;
    height: auto;
    min-height: 0;
  }

  main > :is(section, .section).g2 > :is(.wrap, .container),
  footer.closing.g2 > .wrap {
    grid-template-rows: minmax(min-content, 1fr) minmax(min-content, 1fr);
  }
}

/* Prevent horizontal bleed globally across all viewports without clipping vertical text */
main > :is(section, .section):not(.hero, .section--hero, [data-moment="pinned-chapters"].is-live),
footer.closing {
  overflow-x: clip;
  overflow-y: visible;
}

/* Preserve sticky positioning inside live pinned-chapters section */
main > [data-moment="pinned-chapters"].is-live {
  overflow: visible;
}

/* Legal subpages always expand naturally */
main > section.hm-legal-page {
  height: auto;
  min-height: calc(100svh - 200px);
}

/* Shorter desktop laptop viewports (e.g. MacBook 1440x760, 1280x720, 1024x768):
 * Never activates at 1440x900 so standard 1H/2H rhythm stays exact. */
@media (min-width: 1024px) and (max-height: 820px) {
  :root {
    --padt: 92px;
    --padb: 44px;
    --head-gap: 28px;
    --hgap: 28px;
    --hpadb: 36px;
  }
  #footprint {
    padding-top: 84px;
    padding-bottom: 36px;
  }
  #footprint .section-head {
    margin-bottom: var(--s-4);
    gap: var(--s-2);
  }
  #footprint .section-head h2 {
    font-size: clamp(28px, 2.2vw + 8px, 38px);
  }
  #footprint .stack-5 {
    gap: var(--s-3);
  }
  #footprint .stats {
    gap: var(--s-3) var(--s-5);
  }
  #footprint .stats .t-stat {
    font-size: clamp(24px, 1vw + 16px, 30px);
  }
  #footprint .stats dt {
    font-size: 13px;
    line-height: 1.35;
  }
  #footprint .rows {
    margin-top: var(--s-3);
  }
  #footprint .rows > li {
    padding-block: 7px;
  }
}

/* ---------- Navigation & Brand Logo ---------- */
.nav__logo img {
  height: 28px;
  width: auto;
  display: block;
}

.nav__link.is-current {
  color: var(--hm-orange);
}

.hm-lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--s-3);
  border: 1px solid var(--line-strong);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  transition: border-color var(--m-out) var(--m-ease), color var(--m-out) var(--m-ease), background-color var(--m-out) var(--m-ease);
}

html[dir="ltr"] .hm-lang-link {
  font-family: 'IBM Plex Sans Arabic', 'Readex Pro', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.hm-lang-link:hover {
  border-color: var(--hm-orange);
  color: var(--hm-orange);
}

/* Optional standalone mobile language switcher hook for integrators (hidden on desktop) */
.hm-lang-link--mobile {
  display: none;
}

/* RTL Navigation Fixes for system.css physical left/right offsets */
[dir="rtl"] .nav__toggle {
  margin-left: 0;
  margin-inline-start: auto;
}

[dir="rtl"] .nav:not(.is-open) .nav__actions {
  margin-left: 0;
  margin-inline-start: auto;
}

[dir="rtl"] .nav:not(.is-open) .nav__actions + .nav__toggle {
  margin-left: 0;
  margin-inline-start: 0;
}

[dir="rtl"] .nav__link .chev {
  margin-inline-start: 2px;
}

[dir="rtl"] .nav__link::before {
  transform-origin: left;
}

[dir="rtl"] .nav__link:hover::before,
[dir="rtl"] .nav__link:focus-visible::before,
[dir="rtl"] .nav__item:hover > .nav__link::before,
[dir="rtl"] .nav__item:focus-within > .nav__link::before {
  transform-origin: right;
}

/* Keep 1-tap EN / العربية switcher visible in tablet & mobile top bar (overrides system.css L759) */
@media (max-width: 1023px) {
  .nav:not(.is-open) .nav__actions {
    gap: var(--s-2);
  }
  .nav:not(.is-open) .nav__actions > .hm-lang-link,
  .hm-lang-link--mobile {
    display: inline-flex;
  }
  .nav.is-open .nav__actions .hm-lang-link {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    order: 2;
  }
  .nav.is-open .hm-lang-link--mobile {
    display: none;
  }
}

@media (max-width: 639px) {
  .nav__bar {
    gap: 6px;
  }
  .nav__logo img {
    height: 20px;
  }
  .nav:not(.is-open) .nav__actions {
    gap: 6px;
  }
  .nav:not(.is-open) .nav__actions > .hm-lang-link,
  .hm-lang-link--mobile {
    min-width: 44px;
    height: 44px;
    padding: 0 8px;
    font-size: 13px;
  }
  .nav:not(.is-open) .nav__actions .btn {
    height: 44px;
    padding-inline: 10px;
    font-size: 13px;
    gap: 6px;
  }
}

@media (max-width: 374px) {
  .nav > .wrap.nav__bar {
    width: auto;
    padding-inline: 12px;
    gap: 4px;
  }
  .nav__logo img {
    height: 16px;
  }
  .nav:not(.is-open) .nav__actions {
    gap: 4px;
  }
  .nav:not(.is-open) .nav__actions > .hm-lang-link,
  .hm-lang-link--mobile {
    min-width: 38px;
    padding: 0 6px;
    font-size: 12px;
  }
  .nav:not(.is-open) .nav__actions .btn {
    padding-inline: 7px;
    font-size: 11.5px;
    gap: 4px;
  }
  .nav__toggle {
    width: 40px;
  }
}

/* Directional Arrows & Animated Underlines in RTL */
[dir="rtl"] .m-arrow {
  transform: scaleX(-1);
  margin-right: 0;
  margin-left: -2px;
}

[dir="rtl"] .link::after {
  transform: scaleX(-1);
}

html[dir="rtl"]:not([data-motion="off"]) .link,
html[dir="rtl"]:not([data-motion="off"]) .link:is(:hover, :focus-visible) {
  background-position: 100% 100%, 100% 100%;
}

@media (hover: hover) and (pointer: fine) {
  [dir="rtl"] :is(.btn--arrow, .link):hover::after {
    transform: scaleX(-1) translateX(3px);
  }
  [dir="rtl"] :is(a, button):hover > .m-arrow .m-arrow__head {
    transform: translateX(3px);
  }
}

/* ---------- Hamat Eyebrow & Accent Helpers ---------- */
.hm-eyebrow,
.card > .hm-eyebrow {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-label);
  line-height: 1.15;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
  max-width: none;
}

.hm-eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  margin-top: 0.48em;
  background: var(--hm-orange);
  flex: none;
}

/* Flush-start eyebrow with overhead architectural rail (clears SR-6 container-edges x=80) */
#qhse .hm-eyebrow {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-inline-start: 0;
  line-height: 1.2;
}

#qhse .hm-eyebrow::before {
  width: 28px;
  margin-top: 0;
}

[dir="rtl"] .hm-eyebrow {
  letter-spacing: 0;
  text-transform: none;
}

.hm-accent-text {
  color: var(--hm-orange);
}

.hm-item-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-body);
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 4px;
}

/* ---------- 1. Hero (Hero Split) ---------- */
.hero--split .hero__media {
  background: var(--hm-surface-1);
  border: 1px solid var(--hm-line);
}

/* Override layout.css flex on .hero__kicker so inline <span dir="ltr">(AMD Corp.)</span> stays
 * part of one continuous paragraph instead of splitting into a detached flex column, and dot anchors to line 1. */
.hero--split .hero-copy > .hero__kicker {
  display: block;
  position: relative;
  padding-inline-start: 18px;
  margin-top: 0;
  line-height: 1.5;
  color: var(--hm-text-soft);
}

.hero--split .hero-copy > .hero__kicker .dot {
  position: absolute;
  inset-inline-start: 0;
  top: 0.48em;
}

[dir="rtl"] .hero--split .hero-copy > .hero__kicker .dot {
  top: 0.56em;
}

.hero--split .hero-copy > .hero__kicker + h1 {
  margin-top: var(--s-4);
}

.hero--split .hero-copy h1 {
  font-size: clamp(32px, 2.7vw + 20px, 58px);
  line-height: 1.06;
}

[dir="rtl"] .hero--split .hero-copy h1 {
  font-size: clamp(30px, 2.35vw + 18px, 52px);
  line-height: 1.22;
}

@media (min-width: 1024px) {
  .hero--split .hero-copy {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .hero--split .hero-copy > .hero-facts {
    margin-top: auto;
    padding-top: var(--s-5);
    border-top: 1px solid var(--hm-line);
  }
}

@media (min-width: 1024px) and (max-height: 820px) {
  .hero--split .hero-copy > * + * {
    margin-top: var(--s-4);
  }
  .hero--split .hero-copy > .btn-row {
    margin-top: var(--s-5);
  }
  .hero--split .hero-copy > .hero-facts {
    padding-top: var(--s-4);
  }
}

.hm-float-amd {
  background: rgba(11, 11, 10, 0.94);
  border: 1px solid var(--hm-line);
}

[dir="rtl"] .hm-float-amd {
  left: auto;
  right: var(--s-5);
}

/* ---------- Decorative Orbit Rings (Neutralized — removed from HTML for SR-6/flush hygiene) ---------- */
.hm-orbit-bg {
  position: relative;
}

.hm-orbit-decor {
  display: none !important;
}

/* ---------- 2. About (#about), Developing Photo & Ruled Rows ---------- */
.develop {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--hm-line);
  background: var(--hm-surface-1);
  height: min(560px, var(--ly-fit));
}

.develop > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Align Arabic split-pair photo frames cleanly with eyebrow text top (SR-8 <= 8px) */
@media (min-width: 1024px) {
  [dir="rtl"] #about .develop,
  [dir="rtl"] #projects .hm-case-frame {
    margin-top: 4px;
  }
}

@media (min-width: 1024px) and (max-height: 820px) {
  .develop {
    height: min(490px, var(--ly-fit));
  }
}

@media (max-width: 1023px) {
  .develop {
    height: auto;
    aspect-ratio: 4 / 3;
    margin-top: var(--s-5);
  }
}

#about .section-head {
  margin-bottom: var(--s-5);
}

/* Inline prose links inside #about (and explicit .hm-inline-link): stay inline with text,
 * zero inline-flex line break, zero floating arrow, zero 44px mobile block gap */
#about .section-head p > a.link,
a.hm-inline-link {
  display: inline;
  min-height: 0;
  gap: 0;
  padding-bottom: 0;
  background-image: none;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  transition: color var(--m-out) var(--m-ease), text-decoration-color var(--m-out) var(--m-ease);
}

#about .section-head p > a.link::after,
a.hm-inline-link::after {
  content: none;
  display: none;
}

#about .section-head p > a.link:hover,
a.hm-inline-link:hover {
  color: var(--hm-orange);
  text-decoration-color: var(--hm-orange);
}

/* Allow standalone Arabic AMD URL link in #about to wrap cleanly on narrow mobile screens */
#about > .wrap p > a.link {
  flex-wrap: wrap;
}

/* Standard key/value ruled rows */
[dir="rtl"] .rows__value {
  text-align: left;
}

.rows > li {
  padding-block: var(--s-3);
}

.rows > li:first-child {
  padding-top: 0;
}

.rows .rows__name small {
  display: block;
  font-weight: 400;
  color: var(--hm-text-soft);
  font-size: var(--t-small);
  line-height: 1.48;
  margin-top: 3px;
}

/* Unnumbered single-column ruled rows (.rows--plain) for #about, #fleet, & sectors */
.rows.rows--plain > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding-block: var(--s-3);
  border-bottom: 1px solid var(--line);
}

.rows.rows--plain > li:first-child {
  padding-top: 0;
}

.rows.rows--plain .rows__name {
  display: block;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.rows.rows--plain > li > p {
  grid-column: 1;
  margin: 0;
  color: var(--hm-text-soft);
  font-size: var(--t-body);
  line-height: 1.48;
  max-width: 60ch;
}

.rows.rows--plain .rows__name small {
  display: block;
  font-weight: 400;
  color: var(--hm-text-soft);
  font-size: var(--t-small);
  line-height: 1.48;
  margin-top: 3px;
  max-width: 60ch;
}

@media (min-width: 1024px) and (max-height: 820px) {
  .rows.rows--plain > li {
    padding-block: 10px;
  }
}

/* ---------- 3. Global Footprint (#footprint) & Animated Map Frames ---------- */
#footprint .section-head {
  margin-bottom: var(--s-6);
}

#footprint .stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4) var(--s-5);
}

#footprint .stats .t-stat {
  color: var(--hm-orange);
}

#footprint .rows {
  margin-top: var(--s-5);
}

.hm-map-frame {
  position: relative;
  border: 1px solid var(--hm-line);
  background: var(--hm-bg);
  padding: var(--s-3);
  overflow: hidden;
  height: auto;
}

/* Seamless mount harmony with css/map-global.css (.hm-gmap) & css/map-saudi.css (.hm-saudi-map) */
.hm-map-frame:has(> [data-animated-map]) {
  padding: 0;
  background: var(--hm-bg);
}

.hm-map-frame > img,
.hm-map-frame > svg {
  width: 100%;
  height: auto;
  display: block;
}

.hm-map-frame > .hm-gmap,
.hm-map-frame > .hm-saudi-map {
  width: 100%;
  height: auto;
  border: 0;
}

/* ---------- 4. Founder Portrait Pedestal & Core Values (#leadership) ---------- */
#leadership .section-head {
  margin-bottom: var(--s-5);
}

#leadership .hm-leadership-grid {
  align-items: start;
}

#leadership .quote blockquote {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: clamp(18px, 1.05vw + 10px, 21px);
  line-height: 1.58;
  letter-spacing: 0;
  color: var(--hm-text);
}

[dir="rtl"] #leadership .quote blockquote {
  line-height: 1.72;
}

/* Sculpted 2-zone architectural portrait pedestal: zero awkward empty black box;
 * full-width symmetrical #F07D05 top and bottom rails across entire card */
.hm-portrait-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 268px);
  align-items: stretch;
  background: var(--hm-surface-1);
  border: 1px solid var(--hm-line);
  border-top: 2px solid var(--hm-orange);
  border-bottom: 2px solid var(--hm-orange);
  overflow: hidden;
}

.hm-portrait-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-5);
  border-inline-end: 1px solid var(--hm-line);
  background-color: var(--hm-surface-1);
  background-image: linear-gradient(180deg, rgba(29, 28, 25, 0.55) 0%, rgba(21, 21, 19, 1) 100%);
}

.hm-portrait-accent {
  display: block;
  width: 32px;
  height: 2px;
  background: var(--hm-orange);
  margin-bottom: var(--s-1);
}

.hm-founder-meta {
  display: grid;
  gap: 4px;
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--hm-line);
}

.hm-founder-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 1.15vw + 6px, 21px);
  line-height: 1.3;
  color: var(--hm-text);
}

.hm-founder-role {
  font-size: var(--t-small);
  line-height: 1.5;
  color: var(--hm-text-soft);
}

.hm-portrait-frame {
  position: relative;
  width: 100%;
  min-height: 344px;
  aspect-ratio: 5 / 6;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(84% 76% at 54% 64%, rgba(240, 125, 5, 0.28) 0%, rgba(240, 125, 5, 0.10) 44%, rgba(14, 13, 12, 0.96) 80%),
    linear-gradient(180deg, #171614 0%, #0D0C0B 100%);
}

/* Subtle architectural orbital halo behind founder bust */
.hm-portrait-frame::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: 210px;
  height: 210px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(240, 125, 5, 0.34);
  box-shadow: 0 0 0 24px rgba(240, 125, 5, 0.05);
  pointer-events: none;
  z-index: 0;
}

/* Grounding bottom gradient seam (bottom orange rail sits full-width on .hm-portrait-card) */
.hm-portrait-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 36px;
  background: linear-gradient(to top, rgba(11, 11, 10, 0.45), transparent);
  pointer-events: none;
  z-index: 2;
}

/* Portrait cutout (900x1273, cropped right shoulder): anchored right+bottom at 105% height
 * eliminates transparent top padding and grounds bust cleanly with zero floating edge */
.hm-portrait-frame img {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: auto;
  height: 105%;
  max-width: none;
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.42));
}

/* Core Values & Service Icon Discs */
.hm-icon-disc {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--hm-orange);
  color: var(--hm-on-orange);
}

.hm-icon-disc svg {
  width: 20px;
  height: 20px;
  display: block;
}

.hm-values-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s-4);
  margin-top: var(--s-6);
}

/* Fill #leadership desktop screen evenly (78-84%) so #leadership -> #framework gap stays near median ~310px */
@media (min-width: 1024px) {
  #leadership .hm-values-grid {
    margin-top: auto;
    padding-top: var(--s-6);
  }
}

.hm-value-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--hm-line);
}

.hm-value-item h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.hm-value-item p {
  font-size: var(--t-small);
  color: var(--hm-text-soft);
  line-height: 1.5;
}

@media (min-width: 1024px) and (max-height: 820px) {
  .hm-portrait-frame {
    min-height: 256px;
  }
  .hm-portrait-meta {
    padding: var(--s-4);
  }
  #leadership .hm-values-grid {
    margin-top: var(--s-5);
    padding-top: 0;
  }
  .hm-value-item {
    gap: var(--s-2);
    padding-top: var(--s-3);
  }
}

/* ---------- 5. Pinned Chapters Moment (#framework) RTL & Dark Mode Contrast ---------- */
[dir="rtl"] [data-moment="pinned-chapters"] .mo-pc__step {
  padding-left: 0;
  border-left: 0;
  padding-right: var(--s-5);
  border-right: 2px solid var(--line);
}

[dir="rtl"] [data-moment="pinned-chapters"].is-live .mo-pc__step.is-on {
  border-right-color: var(--hm-orange);
}

[dir="rtl"] [data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step {
  border-right: 0;
  padding-right: 0;
}

[data-moment="pinned-chapters"].is-live .mo-pc__step.is-on {
  border-left-color: var(--hm-orange);
}

[data-moment="pinned-chapters"].is-live .mo-pc__step h3 {
  font-family: var(--font-display);
  font-weight: 700;
}

[data-moment="pinned-chapters"] .mo-pc__step p {
  color: var(--hm-text-soft);
}

#framework .mo-pc__visuals.frame {
  border: 1px solid var(--hm-line);
  background: var(--hm-surface-1);
}

/* ---------- 6. Five Engineering Divisions (#divisions, .g2) ---------- */
#divisions .section-head {
  margin-bottom: var(--s-5);
}

/* Stop system.css L243-244 from over-stretching card rows and Trojena case grid to empty 1H voids */
@media (min-width: 1024px) {
  main > section#divisions.g2 > .wrap > .group > .grid:last-child,
  main > section#projects.g2 > .wrap > .group > .grid:last-child {
    align-self: auto;
    flex: 0 0 auto;
    align-items: stretch;
  }
}

.hm-div-card {
  background: var(--hm-surface-1);
  border: 1px solid var(--hm-line);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  height: 100%;
}

.hm-div-media {
  position: relative;
  overflow: clip;
  aspect-ratio: 16 / 10;
  max-height: 210px;
  background: var(--hm-surface-2);
}

#divisions .group:last-child .hm-div-media {
  aspect-ratio: 16 / 9;
  max-height: 230px;
}

.hm-div-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--m-image-out) var(--m-ease);
}

.hm-div-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: 2px;
}

.hm-div-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-h3);
  color: var(--hm-orange);
  line-height: 1;
}

.hm-div-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-card);
  line-height: 1.25;
  margin-top: 0;
}

/* Beat assets/ui/cards.css (.card > p { margin: 8px 0 0; max-width: 46ch }) cleanly
 * without overriding .hm-eyebrow or .hm-div-tags sizing inside cards (e.g. Trojena card) */
.card.hm-div-card > p:not(.hm-eyebrow):not(.hm-div-tags),
.hm-div-card > p:not(.hm-eyebrow):not(.hm-div-tags) {
  font-size: var(--t-body);
  color: var(--hm-text-soft);
  line-height: 1.48;
  margin: 0;
  max-width: none;
}

.card.hm-div-card > .hm-div-tags,
.card.hm-div-card > p.hm-div-tags,
.hm-div-card > .hm-div-tags {
  width: 100%;
  max-width: none;
  margin: auto 0 0;
  padding-top: var(--s-2);
  border-top: 1px solid var(--hm-line);
  font-size: var(--t-small);
  color: var(--muted);
  line-height: 1.42;
}

#divisions .hm-sector-strip {
  margin-top: var(--s-5);
  gap: var(--s-5);
}

#divisions .rows {
  margin-top: var(--s-4);
}

#divisions .rows > li {
  padding-block: 10px;
}

@media (min-width: 1024px) and (max-height: 820px) {
  #divisions .section-head {
    margin-bottom: var(--s-4);
  }
  .hm-div-media {
    max-height: 176px;
  }
  #divisions .group:last-child .hm-div-media {
    max-height: 190px;
  }
  .hm-div-card {
    padding: 14px;
    gap: 6px;
  }
  #divisions .hm-sector-strip {
    margin-top: var(--s-4);
  }
}

/* ---------- 7. Projects Map & Trojena Case Study (#projects, .g2) ---------- */
#projects .group:first-child .section-head {
  margin-bottom: var(--s-5);
}

#projects .group:first-child .rows > li {
  padding-block: 10px;
}

#projects .hm-case-frame {
  --ratio: 75%;
  border: 1px solid var(--hm-line);
  background: var(--hm-surface-1);
}

#projects .hm-trojena-grid {
  align-items: stretch;
}

#projects .hm-trojena-grid > .card {
  height: auto;
}

/* Keep #projects Trojena H3 within unified 18-20px H3 heading scale across AR & EN */
#projects .hm-trojena-grid h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.28;
}

#projects .hm-trojena-grid .frame--photo {
  --ratio: 75%;
  border: 1px solid var(--hm-line);
}

@media (min-width: 1024px) and (max-height: 820px) {
  #projects .group:first-child .section-head {
    margin-bottom: var(--s-4);
  }
  #projects .group:first-child .rows > li {
    padding-block: 7px;
  }
  #projects .hm-case-frame,
  #projects .hm-trojena-grid .frame--photo {
    --ratio: 66%;
  }
}

/* ---------- 8. Makkah Hotels (#makkah-hotels) Uniform 3-Card Showcase & Sectors ---------- */
#makkah-hotels .section-head {
  margin-bottom: var(--s-4);
  gap: var(--s-3);
}

#makkah-hotels-grid {
  align-items: stretch;
}

.hm-hotel-card {
  background: var(--hm-bg);
  border: 1px solid var(--hm-line);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  height: 100%;
}

/* Uniform 16:10 media box across all 3 cards (including Card 1 Hamat International Hotel).
 * Absolute-positioned img prevents portrait intrinsic height (767x1024) from inflating the 16:10 box. */
.hm-hotel-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 204px;
  overflow: clip;
  background: var(--hm-surface-2);
  border: 1px solid var(--hm-line);
  flex: none;
}

.hm-hotel-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Card 1 (.hm-hotel-card--hotel): edge-to-edge full-bleed cover matching Cards 2 & 3;
 * focal point at 50% 34% frames the upper architectural facade and HAMAT signage cleanly */
.hm-hotel-card--hotel .hm-hotel-card__media img {
  object-fit: cover;
  object-position: 50% 34%;
}

.hm-hotel-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-top: 4px;
}

.hm-hotel-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-card);
  line-height: 1.28;
  margin-top: 0;
}

.hm-hotel-card p {
  color: var(--hm-text-soft);
  font-size: var(--t-body);
  line-height: 1.48;
  margin-top: 0;
}

/* Sector strips (4-col default for #makkah-sectors, 3-col modifier for #divisions trust pillars)
 * Individual sibling top borders preserve clean architectural rhythm and avoid full-width divider lines */
.hm-sector-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-5);
  margin-top: var(--s-4);
}

.hm-sector-strip--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hm-sector-item {
  padding-top: var(--s-3);
  border-top: 1px solid var(--hm-line);
  display: grid;
  gap: 4px;
  align-content: start;
}

.hm-sector-item h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0;
}

.hm-sector-item p {
  font-size: var(--t-small);
  color: var(--hm-text-soft);
  line-height: 1.48;
}

/* Compatibility for 2-column sector rows markup */
#makkah-hotels .hm-sector-grid {
  margin-top: var(--s-5);
}

#makkah-hotels .hm-sector-rows > li {
  padding-block: 8px;
}

@media (min-width: 1024px) and (max-height: 820px) {
  #makkah-hotels .section-head {
    margin-bottom: var(--s-4);
  }
  .hm-hotel-card {
    padding: 14px;
  }
  .hm-hotel-card__media {
    max-height: 185px;
  }
  #makkah-hotels .hm-sector-strip,
  #makkah-hotels .hm-sector-grid {
    margin-top: var(--s-4);
  }
}

/* ---------- 9. Heavy Equipment Fleet (#fleet — Dedicated 1-Screen Section) ---------- */
#fleet .section-head {
  margin-bottom: var(--s-5);
}

#fleet .rows > li {
  padding-block: 10px;
}

.hm-fleet-grid,
.hm-fleet-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  align-content: start;
}

.hm-fleet-tile,
.hm-fleet-photos > img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--hm-surface-1);
  border: 1px solid var(--hm-line);
}

/* 3-photo editorial collage (1 full-width 16:9 hero tile above 2 equal 16:10 companion tiles) */
.hm-fleet-grid > :first-child:nth-last-child(3),
.hm-fleet-photos > :first-child:nth-last-child(3) {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

@media (min-width: 1024px) {
  .hm-fleet-grid > :first-child:nth-last-child(3),
  .hm-fleet-photos > :first-child:nth-last-child(3) {
    width: 100%;
    height: 266px;
    aspect-ratio: auto;
  }
  .hm-fleet-grid > :nth-child(n + 2):nth-last-child(-n + 2),
  .hm-fleet-photos > :nth-child(n + 2):nth-last-child(-n + 2) {
    width: 100%;
    height: 174px;
    aspect-ratio: auto;
  }
}

@media (min-width: 1024px) and (max-height: 820px) {
  #fleet .section-head {
    margin-bottom: var(--s-3);
    gap: var(--s-2);
  }
  #fleet .rows.rows--plain > li {
    padding-block: 6px;
  }
  .hm-fleet-grid > :first-child:nth-last-child(3),
  .hm-fleet-photos > :first-child:nth-last-child(3) {
    height: 200px;
  }
  .hm-fleet-grid > :nth-child(n + 2):nth-last-child(-n + 2),
  .hm-fleet-photos > :nth-child(n + 2):nth-last-child(-n + 2) {
    height: 140px;
  }
}

.hm-fleet-tile img,
.hm-fleet-photos > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- 10. QHSE & Regulatory Compliance (#qhse — Full-Width Brand Orange Band, NO Map) ---------- */
/* Subtle pure-CSS architectural blueprint drafting grid over #F07D05 (preserves 7.10:1 AAA ink contrast) */
#qhse.ground-brand {
  background-color: var(--hm-orange);
  background-image:
    repeating-linear-gradient(0deg, rgba(18, 12, 5, 0.055) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(18, 12, 5, 0.055) 0 1px, transparent 1px 48px);
}

#qhse .section-head {
  margin-bottom: var(--s-6);
}

#qhse .section-head p {
  color: var(--hm-on-orange);
}

#qhse .section-head .link {
  color: var(--hm-on-orange);
}

/* 5-Card Compliance Grid (SBC, MOTLS, NWC, ISO, OSHA) */
.hm-qhse-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s-4);
  align-items: stretch;
}

.hm-qhse-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5) var(--s-4);
  background: var(--hm-on-orange);
  color: var(--hm-text);
  border: 1px solid rgba(18, 12, 5, 0.92);
  transition: transform var(--m-out) var(--m-ease), box-shadow var(--m-out) var(--m-ease);
}

@media (hover: hover) and (pointer: fine) {
  .hm-qhse-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -16px rgba(18, 12, 5, 0.65);
  }
}

.hm-qhse-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid rgba(242, 238, 230, 0.16);
}

.hm-qhse-code {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 1.3vw + 6px, 26px);
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: var(--hm-orange);
  direction: ltr;
  unicode-bidi: isolate;
}

.hm-qhse-card__icon {
  width: 20px;
  height: 20px;
  color: var(--hm-orange);
  flex: none;
}

.hm-qhse-tag {
  width: 8px;
  height: 8px;
  background: var(--hm-orange);
  flex: none;
}

.hm-qhse-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.32;
  color: var(--hm-text);
  margin-top: 2px;
}

.hm-qhse-card p {
  font-size: var(--t-small);
  line-height: 1.52;
  color: var(--hm-text-soft);
}

/* 3-Pillar Operational Assurance Strip */
.hm-qhse-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
  margin-top: var(--s-6);
}

.hm-qhse-pillar {
  display: grid;
  gap: var(--s-2);
  align-content: start;
  padding-top: var(--s-4);
  border-top: 2px solid var(--hm-on-orange);
}

.hm-qhse-pillar h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-lead);
  line-height: 1.3;
  color: var(--hm-on-orange);
}

.hm-qhse-pillar p {
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--hm-on-orange);
}

@media (min-width: 1024px) and (max-height: 820px) {
  #qhse .section-head {
    margin-bottom: var(--s-4);
  }
  .hm-qhse-card {
    padding: var(--s-4) 14px;
  }
  .hm-qhse-pillars {
    margin-top: var(--s-5);
  }
  .hm-qhse-pillar {
    padding-top: var(--s-3);
  }
}

/* ---------- 11. Inquiry Form & Official Offices (#inquire) ---------- */
#inquire .section-head {
  max-width: none;
  margin-bottom: var(--s-4);
  gap: var(--s-2);
}

#inquire .section-head p {
  max-width: none;
}

.hm-form-box {
  background: var(--hm-surface-1);
  border: 1px solid var(--hm-line);
  padding: var(--s-5);
}

#inquire .form {
  position: relative;
}

.hm-hp {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  pointer-events: none;
}

#inquire .form__status:not(:empty) {
  font-size: var(--t-small);
  font-weight: 500;
  line-height: 1.5;
  color: var(--hm-accent);
  padding: 10px 12px;
  border: 1px solid rgba(240, 125, 5, 0.45);
  background: rgba(240, 125, 5, 0.08);
}

#inquire .field textarea {
  min-height: 82px;
}

/* Field-operations photography banner above offices stack (satisfies >=16% visual presence inside 1H) */
.hm-inquire-photo {
  --ratio: 0px;
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  width: 100%;
  height: clamp(246px, 27.6svh, 254px);
  border: 1px solid var(--hm-line);
  background: var(--hm-surface-1);
  overflow: hidden;
}

.hm-inquire-photo::before {
  content: none;
}

.hm-inquire-photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
}

/* Custom high-contrast select dropdown chevron with safe RTL/LTR inline-end padding */
.form .field select,
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-start: var(--s-3);
  padding-inline-end: 42px;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.25L6 7.75L9.5 4.25' stroke='%23F2EEE6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 12px 12px;
  background-position: right 14px center;
  cursor: pointer;
}

[dir="rtl"] .form .field select,
[dir="rtl"] .field select {
  background-position: left 14px center;
}

.form .field select option,
.field select option {
  background-color: var(--hm-bg);
  color: var(--hm-text);
}

.hm-offices-stack {
  display: grid;
  gap: 10px;
  align-content: start;
}

.hm-office-card {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hm-line);
  display: grid;
  gap: 2px;
}

.hm-office-card:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hm-office-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.24;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.hm-office-card h3 svg {
  flex: none;
  color: var(--hm-orange);
}

.hm-office-card address,
.hm-office-card p {
  font-style: normal;
  color: var(--hm-text-soft);
  font-size: var(--t-small);
  line-height: 1.4;
}

@media (min-width: 1024px) and (max-height: 820px) {
  #inquire {
    padding-top: 84px;
    padding-bottom: 32px;
  }
  #inquire .section-head {
    margin-bottom: var(--s-3);
    gap: 4px;
  }
  .hm-inquire-photo {
    height: 174px;
  }
  .hm-form-box {
    padding: var(--s-4);
  }
  #inquire .form {
    gap: 10px;
  }
  #inquire .field textarea {
    min-height: 58px;
  }
  .hm-offices-stack {
    gap: 8px;
  }
  .hm-office-card {
    padding-bottom: 7px;
    gap: 1px;
  }
  .hm-office-card address,
  .hm-office-card p {
    font-size: 13px;
    line-height: 1.34;
  }
}

.hm-office-card a:not(.link) {
  color: var(--hm-text);
  transition: color var(--m-out) var(--m-ease);
}

.hm-office-card a:not(.link):hover {
  color: var(--hm-orange);
}

[dir="rtl"] .field__error::before {
  margin-right: 0;
  margin-inline-end: var(--s-2);
}

[dir="rtl"] .credits > summary::after {
  margin-left: 0;
  margin-inline-start: var(--s-2);
}

/* ---------- 12. Closing CTA & Footer (footer.closing) — Zero Overlap & Clean RTL/LTR Legal ---------- */
footer.closing > .wrap {
  display: grid;
  grid-template-rows: minmax(min-content, 1fr) auto;
  row-gap: clamp(var(--s-6), 4.5svh, var(--s-8));
}

footer.closing .closing__cta {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

footer.closing .closing__cta h2 {
  max-width: 24ch;
}

footer.closing .closing__cta > .close__media {
  position: relative;
  flex: 1 1 auto;
  min-height: clamp(140px, 20svh, 205px);
  max-height: 270px;
  border: 1px solid var(--hm-line);
  background: var(--hm-surface-1);
  overflow: clip;
}

footer.closing .closing__links {
  position: relative;
  z-index: 2;
  background: var(--bg);
  display: grid;
  gap: var(--s-5);
}

footer.closing .closing__links > .grid,
footer.closing .footer__grid {
  row-gap: var(--s-5);
  align-items: start;
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3) var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--hm-line);
  font-size: var(--t-label);
  color: var(--muted);
}

.footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
}

.footer__legal-meta {
  color: var(--muted);
  text-align: end;
}

.footer__legal .socials:empty {
  display: none;
}

.footer__legal a {
  color: var(--hm-text-soft);
  transition: color var(--m-out) var(--m-ease);
}

.footer__legal a:hover {
  color: var(--hm-orange);
}

[dir="rtl"] .footer__legal {
  text-align: start;
}

@media (min-width: 1024px) and (max-height: 820px) {
  footer.closing {
    padding-top: 84px;
    padding-bottom: 36px;
  }
  footer.closing > .wrap {
    row-gap: var(--s-5);
  }
  footer.closing .closing__cta {
    gap: var(--s-4);
  }
  footer.closing .closing__cta > .close__media {
    min-height: 136px;
    max-height: 180px;
  }
  footer.closing .closing__links {
    gap: var(--s-4);
  }
  .footer__legal {
    padding-top: var(--s-4);
  }
}

/* ---------- Small Laptop Breakpoint (1024px – 1279px, e.g. 1024x768) ---------- */
@media (min-width: 1024px) and (max-width: 1279px) {
  .hm-portrait-card {
    grid-template-columns: minmax(0, 1fr) 210px;
  }
  .hm-portrait-meta {
    padding: var(--s-4);
  }
  .hm-portrait-frame {
    min-height: 252px;
  }
  .hm-portrait-frame::before {
    width: 168px;
    height: 168px;
  }
  #divisions .section-head,
  #fleet .section-head {
    margin-bottom: var(--s-4);
    gap: var(--s-2);
  }
  #divisions .hm-div-card {
    padding: var(--s-3);
    gap: 6px;
  }
  #divisions .hm-div-media,
  #divisions .group:last-child .hm-div-media {
    aspect-ratio: 16 / 9;
    max-height: 146px;
  }
  #divisions .hm-icon-disc {
    width: 32px;
    height: 32px;
  }
  #divisions .hm-icon-disc svg {
    width: 16px;
    height: 16px;
  }
  #divisions .hm-div-num {
    font-size: 20px;
  }
  #divisions .hm-div-card h3 {
    font-size: 16px;
    line-height: 1.25;
  }
  #divisions .hm-div-card p {
    font-size: 14px;
    line-height: 1.4;
  }
  #divisions .hm-div-tags {
    font-size: var(--t-label);
  }
  .hm-qhse-grid {
    gap: var(--s-3);
  }
  .hm-qhse-card {
    padding: var(--s-4) var(--s-3);
  }
  .hm-qhse-code {
    font-size: 20px;
  }
  .hm-qhse-card h3 {
    font-size: 14px;
  }
  .hm-qhse-card p {
    font-size: 13px;
    line-height: 1.45;
  }
  #about .rows > li,
  #footprint .rows > li,
  #fleet .rows > li {
    padding-block: 8px;
  }
}

/* ---------- Tablet & Mobile Shared Flow (<= 1023px): Fixed-Header Clearance + Zero Voids ---------- */
@media (max-width: 1023px) {
  main > :is(section, .section):not(.hero, .section--hero),
  main > :is(section, .section):not(.hero, .section--hero, [data-moment="pinned-chapters"].is-live),
  main > #framework[data-moment="pinned-chapters"][data-moment]:not(.is-live),
  footer.closing,
  footer.closing:has(> .wrap > .closing__cta > .close__media) {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: calc(var(--nav, 56px) + clamp(28px, 6vw, 44px));
    padding-bottom: clamp(44px, 7vw, 68px);
  }

  [id^="div-"] {
    scroll-margin-top: calc(var(--nav, 56px) + 16px);
  }

  main > :is(section, .section):not(.hero, .section--hero):has(> :is(.wrap, .container)),
  footer.closing {
    display: block;
  }

  main > :is(section, .section).g2 > :is(.wrap, .container),
  main > :is(section, .section).g2:not(.g2m) > :is(.wrap, .container),
  footer.closing.g2 > .wrap {
    display: flex;
    flex-direction: column;
    row-gap: var(--s-6);
  }

  main > :is(section, .section).g2:not(.g2m) > :is(.wrap, .container) > :last-child {
    margin-block: 0;
  }

  footer.closing > .wrap,
  footer.closing:has(> .wrap > .closing__cta > .close__media) > .wrap {
    display: grid;
    grid-template-rows: auto auto;
    row-gap: var(--s-6);
  }

  footer.closing .closing__cta > .close__media {
    flex: 0 0 auto;
    aspect-ratio: 16 / 10;
    min-height: 170px;
    max-height: none;
  }

  /* Static #framework pillar styling on tablet & phone (beats dynamically injected moment.css) */
  #framework[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__text {
    gap: var(--s-5);
  }

  #framework[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__steps {
    gap: var(--s-5);
  }

  #framework[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step {
    border-left: 0;
    border-right: 0;
    padding-inline: 0;
    border-top: 2px solid var(--hm-orange);
    padding-top: var(--s-4);
    gap: var(--s-2);
  }

  #framework[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.3;
    color: var(--hm-text);
  }

  #framework[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step p {
    color: var(--hm-text-soft);
  }
}

/* ---------- Tablet Breakpoint (640px – 1023px, e.g. 768x1024 & 820x1180) ---------- */
@media (min-width: 640px) and (max-width: 1023px) {
  /* 2-screen .g2 sections keep 200svh minimum so zero neighbour/screen-short findings occur at 768 & 820 */
  main > section#divisions.g2,
  main > section#projects.g2 {
    min-height: 200vh;
    min-height: 200svh;
  }

  #footprint .hm-map-frame,
  #projects .hm-map-frame,
  #fleet .hm-fleet-grid,
  #fleet .hm-fleet-photos,
  #leadership .hm-portrait-card {
    margin-top: var(--s-4);
  }

  /* Exact --gutter (24px) column gaps align every multi-column item to 12-col grid starts (0 edge-left) */
  .hm-values-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
    row-gap: var(--s-4);
  }
  .hm-values-grid > :last-child {
    grid-column: 1 / -1;
  }

  /* Divisions: balanced 2-up + full-width horizontal last card */
  #divisions > .wrap {
    row-gap: var(--s-6);
  }
  #divisions .hm-div-card.span-4,
  #divisions .hm-div-card.span-6 {
    grid-column: auto / span 6;
  }
  #divisions .hm-div-card.span-4:last-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
    column-gap: var(--s-4);
    row-gap: 4px;
    align-items: start;
  }
  #divisions .hm-div-card.span-4:last-child .hm-div-media {
    grid-column: 1;
    grid-row: 1 / span 4;
    height: 100%;
    max-height: none;
    aspect-ratio: 4 / 3;
  }
  #divisions .hm-div-card.span-4:last-child > :not(.hm-div-media) {
    grid-column: 2;
  }

  /* Projects: 2-column region list on tablet for crisp scan */
  #projects > .wrap {
    row-gap: var(--s-6);
  }
  #projects .group:first-child .rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
  }
  #projects .group:first-child .rows > li:nth-child(2) {
    padding-top: 0;
  }
  #projects .hm-case-frame,
  #projects .hm-trojena-grid .frame--photo {
    --ratio: 56.25%;
    margin-top: var(--s-4);
  }

  /* Makkah Hotels: uniform horizontal cards across all 3 slots */
  #makkah-hotels-grid {
    row-gap: var(--s-3);
  }
  #makkah-hotels-grid > .hm-hotel-card.span-4 {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: var(--s-4);
    row-gap: 4px;
    align-content: center;
    padding: var(--s-3) var(--s-4);
  }
  #makkah-hotels-grid > .hm-hotel-card.span-4 .hm-hotel-card__media {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 200px;
    aspect-ratio: 16 / 10;
    align-self: center;
  }
  #makkah-hotels-grid > .hm-hotel-card.span-4 > :not(.hm-hotel-card__media) {
    grid-column: 2;
  }

  .hm-sector-strip,
  .hm-sector-strip--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
    row-gap: var(--s-4);
  }
  .hm-sector-strip--3 > :last-child {
    grid-column: 1 / -1;
  }

  /* Fleet: 3-photo editorial collage (1 full-width + 2 below) matching desktop */
  .hm-fleet-grid,
  .hm-fleet-photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-3);
  }
  .hm-fleet-grid > :first-child:nth-last-child(3),
  .hm-fleet-photos > :first-child:nth-last-child(3) {
    max-height: 240px;
  }

  /* QHSE: 3-up top + 2-up balanced bottom row + exact --gutter 3-col pillars (k=0, 4, 8) */
  .hm-qhse-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--s-3);
  }
  .hm-qhse-grid > .hm-qhse-card {
    grid-column: auto / span 2;
  }
  .hm-qhse-grid > .hm-qhse-card:nth-child(4),
  .hm-qhse-grid > .hm-qhse-card:nth-child(5) {
    grid-column: auto / span 3;
  }
  .hm-qhse-pillars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--gutter);
    row-gap: var(--s-4);
  }

  .hm-inquire-photo {
    height: 220px;
    margin-bottom: var(--s-2);
  }
}

/* ---------- Mobile Breakpoint (<= 639px, e.g. 390x844 & 320px) ---------- */
@media (max-width: 639px) {
  /* Crisp heading hierarchy: H1 (32-34px) > H2 (25px uniform) > H3 (17-18px uniform) */
  .hero--split .hero-copy h1 {
    font-size: clamp(32px, 8.2vw, 36px);
  }
  [dir="rtl"] .hero--split .hero-copy h1 {
    font-size: clamp(32px, 8vw, 35px);
  }
  main h2,
  footer.closing h2 {
    font-size: clamp(24px, 6.4vw, 26px);
  }

  /* 2-Bucket Phone Height Discipline (844px screen: Bucket A 100svh <= 1255px, Bucket B 200svh = 1688px):
   * Uniform ~152px-220px inter-section gaps across all seams + >=84px fixed-header clearance */
  main > :is(section#about, section#footprint, section#leadership, section#framework[data-moment="pinned-chapters"][data-moment]:not(.is-live), section#fleet, section#qhse) {
    min-height: 100vh;
    min-height: 100svh;
    height: auto;
    padding-top: calc(var(--nav, 56px) + 28px);
    padding-bottom: 68px;
  }

  main > :is(section#divisions, section#projects, section#makkah-hotels, section#inquire) {
    min-height: 200vh;
    min-height: 200svh;
    padding-top: calc(var(--nav, 56px) + 28px);
    padding-bottom: 36px;
  }

  footer.closing,
  footer.closing:has(> .wrap > .closing__cta > .close__media) {
    min-height: 0;
    padding-top: calc(var(--nav, 56px) + 28px);
    padding-bottom: 44px;
  }

  .hm-eyebrow,
  .card > .hm-eyebrow {
    font-size: 12px;
    letter-spacing: 0.08em;
    gap: var(--s-2);
  }
  .hm-eyebrow::before {
    width: 18px;
  }

  /* Hero mobile tightening */
  .hero--split .hero-copy > * + * {
    margin-top: var(--s-4);
  }
  .hero--split .hero__media {
    margin-top: var(--s-4);
    min-height: 196px;
  }
  .hm-float-amd {
    padding: var(--s-2) var(--s-3);
    left: var(--s-3);
    right: var(--s-3);
    bottom: var(--s-3);
    width: auto;
  }
  .hm-float-amd .ly-float__title {
    font-size: var(--t-small);
  }

  /* About mobile (Bucket A: ~990px <= 1260px) */
  #about .develop {
    aspect-ratio: 16 / 10;
    margin-top: var(--s-4);
  }
  #about .rows.rows--plain > li {
    padding-block: 10px;
  }

  /* Footprint mobile (Bucket A: ~900-1040px <= 1260px) */
  #footprint .section-head {
    margin-bottom: var(--s-4);
    gap: var(--s-2);
  }
  #footprint .stats {
    gap: var(--s-3) var(--s-4);
  }
  #footprint .stats .t-stat {
    font-size: 26px;
  }
  #footprint .rows {
    margin-top: var(--s-4);
  }
  #footprint .rows > li {
    padding-block: 10px;
  }
  #footprint .hm-map-frame {
    margin-top: var(--s-4);
  }
  #footprint .hm-gmap__stage {
    min-height: 190px;
  }

  /* Leadership mobile (Bucket A: compact 2-zone executive card matching desktop DNA + 5 values <= 1255px) */
  #leadership .stack-4 > * + * {
    margin-top: 10px;
  }
  #leadership .quote blockquote {
    font-size: 15.5px;
    line-height: 1.48;
  }
  [dir="rtl"] #leadership .quote blockquote {
    line-height: 1.58;
  }
  .hm-portrait-card {
    grid-template-columns: minmax(0, 1fr) 152px;
    margin-top: var(--s-4);
  }
  .hm-portrait-frame {
    order: 0;
    aspect-ratio: auto;
    height: auto;
    min-height: 214px;
    background:
      radial-gradient(88% 78% at 54% 58%, rgba(240, 125, 5, 0.28) 0%, rgba(240, 125, 5, 0.10) 44%, rgba(14, 13, 12, 0.96) 80%),
      linear-gradient(180deg, #171614 0%, #0D0C0B 100%);
  }
  .hm-portrait-frame::before {
    width: 136px;
    height: 136px;
    left: 52%;
    top: 52%;
  }
  .hm-portrait-frame img {
    height: 105%;
  }
  .hm-portrait-meta {
    border-inline-end: 1px solid var(--hm-line);
    border-top: 0;
    padding: 14px 12px;
    gap: 6px;
  }
  .hm-founder-name {
    font-size: 16.5px;
  }
  .hm-founder-role {
    font-size: 12.5px;
    line-height: 1.4;
  }
  .hm-values-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 14px;
  }
  .hm-value-item {
    flex-direction: row;
    align-items: flex-start;
    padding-top: 8px;
    gap: 10px;
  }
  .hm-value-item .hm-icon-disc {
    width: 32px;
    height: 32px;
  }
  .hm-value-item .hm-icon-disc svg {
    width: 16px;
    height: 16px;
  }
  .hm-value-item h3 {
    font-size: 17px;
    margin-bottom: 2px;
  }
  .hm-value-item p {
    font-size: 13px;
    line-height: 1.36;
  }

  /* Framework mobile (Bucket A: compact 3-stage stack <= 1255px, >=82% fill, 0 oversized images) */
  #framework[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__text {
    gap: 14px;
  }
  #framework[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__steps {
    gap: 14px;
  }
  #framework[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step {
    padding-top: 10px;
    gap: 6px;
  }
  #framework[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step p {
    font-size: 14px;
    line-height: 1.4;
  }
  #framework[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__visual {
    margin-top: 6px;
  }
  #framework[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__visual > img {
    width: 100%;
    height: 156px;
    max-height: 156px;
    aspect-ratio: auto;
  }

  /* Divisions mobile (Bucket B: full-width 318x100px panoramic cards — 0 oversized images & <= 1688px) */
  #divisions .section-head {
    margin-bottom: var(--s-3);
    gap: 6px;
  }
  #divisions .section-head p {
    font-size: 14.5px;
    line-height: 1.36;
  }
  #divisions > .wrap,
  #divisions .grid {
    row-gap: 8px;
  }
  #divisions .hm-div-card {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    gap: 3px;
    height: auto;
  }
  #divisions .hm-div-media,
  #divisions .group:last-child .hm-div-media {
    width: 100%;
    height: 92px;
    max-height: 92px;
    aspect-ratio: auto;
  }
  #divisions .hm-div-head {
    margin-top: 2px;
    gap: var(--s-2);
  }
  #divisions .hm-icon-disc {
    width: 24px;
    height: 24px;
  }
  #divisions .hm-icon-disc svg {
    width: 13px;
    height: 13px;
  }
  #divisions .hm-div-num {
    font-size: 16px;
  }
  #divisions .hm-div-card h3 {
    font-size: 17px;
    line-height: 1.24;
  }
  #divisions .hm-div-card > p:not(.hm-eyebrow):not(.hm-div-tags) {
    font-size: 13.5px;
    line-height: 1.34;
  }
  #divisions .hm-div-card > .hm-div-tags,
  #divisions .hm-div-card > p.hm-div-tags {
    font-size: 12px;
    line-height: 1.3;
    padding-top: 4px;
    margin-top: 2px;
  }
  #divisions .hm-sector-strip,
  #divisions .hm-sector-strip--3 {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: var(--s-3);
  }
  #divisions .hm-sector-item {
    padding-top: 6px;
    gap: 2px;
  }
  #divisions .hm-sector-item h3 {
    font-size: 17px;
  }
  #divisions .hm-sector-item p {
    font-size: 12.5px;
    line-height: 1.34;
  }
  #divisions .rows {
    margin-top: var(--s-3);
  }
  #divisions .rows > li {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-2);
    padding-block: var(--s-3);
  }
  #divisions .rows .rows__value {
    grid-column: 1;
    grid-row: 2;
    text-align: start;
    max-width: none;
    white-space: normal;
  }

  /* Projects mobile (Bucket B: ~1470-1530px content inside 1688px -> balanced seam gap <= 215px) */
  #projects > .wrap {
    row-gap: var(--s-6);
  }
  #projects .group:first-child .section-head {
    margin-bottom: var(--s-3);
    gap: 6px;
  }
  #projects .group:first-child .rows > li {
    padding-block: 8px;
  }
  #projects .group:last-child .rows > li {
    padding-block: 8px;
  }
  #projects .group:last-child .rows__value {
    max-width: 24ch;
  }
  #projects .hm-trojena-grid h3 {
    font-size: 18px;
  }
  #projects .hm-map-frame {
    margin-top: var(--s-3);
  }
  #projects .hm-case-frame,
  #projects .hm-trojena-grid .frame--photo {
    --ratio: 72%;
    margin-top: var(--s-4);
  }

  /* Makkah Hotels mobile (Bucket B: full-width 16:10 cards ~1490px content inside 1688px -> balanced seam gap ~195px) */
  #makkah-hotels .section-head {
    margin-bottom: var(--s-3);
    gap: 6px;
  }
  #makkah-hotels .section-head p {
    font-size: 15px;
    line-height: 1.4;
  }
  #makkah-hotels-grid {
    row-gap: 12px;
  }
  #makkah-hotels .hm-hotel-card {
    padding: 12px;
    gap: 6px;
  }
  #makkah-hotels .hm-hotel-card__media {
    aspect-ratio: 16 / 10;
    max-height: 170px;
  }
  #makkah-hotels .hm-hotel-card h3 {
    font-size: 18px;
    line-height: 1.25;
  }
  #makkah-hotels .hm-hotel-card p {
    font-size: 14px;
    line-height: 1.38;
  }
  #makkah-hotels .hm-sector-strip {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: var(--s-4);
  }
  #makkah-hotels .hm-sector-item {
    padding-top: 8px;
    gap: 2px;
  }
  #makkah-hotels .hm-sector-item h3 {
    font-size: 17px;
  }
  #makkah-hotels .hm-sector-item p {
    font-size: 13px;
    line-height: 1.38;
  }

  /* Fleet mobile (Bucket A: ~960-1150px <= 1260px; symmetric 24px side edges, 3-photo 1+2 collage) */
  #fleet .section-head {
    margin-bottom: var(--s-3);
    gap: 6px;
  }
  #fleet .rows.rows--plain > li {
    padding-block: 8px;
    gap: 2px;
  }
  #fleet .hm-fleet-grid,
  #fleet .hm-fleet-photos {
    margin-top: var(--s-3);
    gap: var(--s-3);
  }
  #fleet .hm-fleet-tile,
  #fleet .hm-fleet-photos > img {
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: none;
  }
  #fleet .hm-fleet-grid > :first-child:nth-last-child(3),
  #fleet .hm-fleet-photos > :first-child:nth-last-child(3) {
    aspect-ratio: 16 / 9;
  }

  /* QHSE mobile (Bucket A: clean compact 1-col stack <= 1255px — zero row-gap & balanced ~152px seam) */
  #qhse .section-head {
    margin-bottom: 12px;
    gap: 6px;
  }
  #qhse .section-head p {
    font-size: 14px;
    line-height: 1.38;
  }
  .hm-qhse-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .hm-qhse-grid > .hm-qhse-card:nth-child(5) {
    grid-column: auto;
  }
  .hm-qhse-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    row-gap: 4px;
    padding: 9px 12px;
  }
  .hm-qhse-card__head {
    grid-column: 1;
    grid-row: 1;
    padding-bottom: 0;
    border-bottom: 0;
    gap: 6px;
  }
  .hm-qhse-code {
    font-size: 17px;
  }
  .hm-qhse-card__icon {
    width: 20px;
    height: 20px;
  }
  .hm-qhse-card h3 {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
    font-size: 17px;
    line-height: 1.22;
  }
  .hm-qhse-card p {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 4px;
    border-top: 1px solid rgba(242, 238, 230, 0.14);
    font-size: 13px;
    line-height: 1.34;
  }
  .hm-qhse-pillars {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 14px;
  }
  .hm-qhse-pillar {
    padding-top: 8px;
    gap: 2px;
  }
  .hm-qhse-pillar h3 {
    font-size: 17px;
    line-height: 1.24;
  }
  .hm-qhse-pillar p {
    font-size: 13.5px;
    line-height: 1.36;
  }

  /* Inquiry form & offices mobile (Bucket B: fits <= 1688px WITH .hm-inquire-photo + 44px tap targets) */
  #inquire .section-head {
    margin-bottom: var(--s-3);
    gap: 6px;
  }
  #inquire .section-head p {
    font-size: 15px;
    line-height: 1.4;
  }
  .hm-form-box {
    padding: var(--s-3);
  }
  #inquire .form {
    gap: 8px;
  }
  #inquire .field {
    gap: 4px;
  }
  #inquire .field :is(input, select) {
    height: 44px;
  }
  #inquire .field textarea {
    min-height: 54px;
  }
  .hm-inquire-photo {
    height: 276px;
    min-height: 270px;
    margin-bottom: 4px;
  }
  .hm-offices-stack {
    margin-top: var(--s-4);
    gap: var(--s-3);
  }
  .hm-office-card {
    padding-bottom: var(--s-3);
    gap: 2px;
  }
  .hm-office-card h3 {
    font-size: 17px;
  }
  .hm-office-card address,
  .hm-office-card p {
    font-size: 14px;
    line-height: 1.4;
  }
  #inquire .hm-office-card a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: 4px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  /* Footer mobile: compact gap and inline subsidiary credit (no orphaned "Subsidiary of" break) */
  footer.closing > .wrap,
  footer.closing:has(> .wrap > .closing__cta > .close__media) > .wrap {
    row-gap: var(--s-5);
  }
  .footer__legal {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
  }
  .footer__legal-meta {
    text-align: start;
  }
  footer.closing .footer__legal .footer__legal-meta {
    display: block;
    line-height: 1.6;
  }
  footer.closing .footer__legal .footer__legal-meta a:not(.btn) {
    display: inline;
    min-height: 0;
    min-width: 0;
    padding-block: 6px;
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
  }
}

@media (max-width: 374px) {
  .hero--split {
    --hgap: 10px;
  }
  .hero--split .hero-copy h1,
  [dir="rtl"] .hero--split .hero-copy h1 {
    font-size: clamp(28px, 8.2vw, 31px);
  }
  main h2,
  footer.closing h2 {
    font-size: 23px;
  }
  .hero--split .hero__lead {
    font-size: 15px;
    line-height: 1.45;
  }
  .hero--split .hero-copy > * + * {
    margin-top: var(--s-3);
  }
  .hero--split .hero__media {
    margin-top: var(--s-3);
    min-height: 170px;
  }
}

/* ---------- Reduced Motion Safety ---------- */
@media (prefers-reduced-motion: reduce) {
  .hm-qhse-card:hover {
    transform: none;
  }
}
