/* Masthead: a full-width navy band carrying the white logo,
   followed by a silver + blue sliver taken from the X in the mark. */
.masthead {
  --mh-band: 84px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.mh-band { position: relative; background: var(--navy); transition: box-shadow .3s var(--ease); }
.mh-band::after { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: linear-gradient(to left, var(--blue) 0%, #9aa3b2 55%, transparent 100%); opacity: .55; pointer-events: none; }
.masthead.is-scrolled .mh-band { box-shadow: 0 16px 34px rgb(7 21 46 / 20%); }
.mh-inner { height: var(--mh-band); display: flex; align-items: center; gap: clamp(22px, 2.4vw, 38px); }

.mh-brand { position: relative; flex-shrink: 0; height: var(--mh-band); display: flex; align-items: center; }
.mh-brand::before, .mh-brand::after { content: ''; position: absolute; top: 0; width: 34px; height: var(--mh-band); clip-path: polygon(22px 0,100% 0,calc(100% - 22px) 100%,0 100%); pointer-events: none; }
.mh-brand::before { inset-inline-end: -46px; background: linear-gradient(160deg, #eef1f6 0%, #9aa3b2 45%, #d9dee8 60%, #7d8594 100%); }
.mh-brand::after { inset-inline-end: -68px; background: linear-gradient(160deg, #118aff 0%, var(--blue) 50%, var(--blue-deep) 100%); }
.mh-brand img { width: 112px; transition: transform .3s var(--ease); }
.mh-brand:hover img { transform: scale(1.04); }

.mh-nav { flex: 1; align-self: stretch; display: flex; align-items: center; gap: clamp(22px, 2.6vw, 42px); margin-inline-start: 58px; }
.mh-link { position: relative; padding-block: 8px; color: #c3cce0; font-size: 15px; font-weight: 700; white-space: nowrap; transition: color .2s; }
.mh-link::after { content: ''; position: absolute; inset-inline: 0; bottom: -3px; height: 3px; background: #9aa3b2; clip-path: polygon(3px 0,100% 0,calc(100% - 3px) 100%,0 100%); transform: scaleX(0); transform-origin: right; transition: transform .3s var(--ease), background .2s; }
html[dir="ltr"] .mh-link::after { transform-origin: left; }
.mh-link:hover { color: #fff; }
.mh-link:hover::after { transform: scaleX(1); }
.mh-link.is-active { color: #fff; }
.mh-link.is-active::after { transform: scaleX(1); background: var(--blue); }
.mh-drawer-extras { display: none; }

/* Services mega menu: opens on hover, or with the chevron for touch and keyboard. */
.mh-has-mega { align-self: stretch; display: flex; align-items: center; gap: 6px; }
.mh-mega-toggle { width: 22px; height: 30px; display: grid; place-items: center; background: transparent; color: #8d9ab5; font-size: 10px; transition: color .2s; }
.mh-mega-toggle i { transition: transform .3s var(--ease); }
.mh-has-mega:hover .mh-mega-toggle, .mh-has-mega.is-open .mh-mega-toggle { color: #fff; }
.mh-has-mega:hover .mh-mega-toggle i, .mh-has-mega.is-open .mh-mega-toggle i { transform: rotate(180deg); }
.mh-mega { position: absolute; top: 100%; inset-inline: calc((100% - min(100% - var(--gutter) * 2, 1320px)) / 2); display: grid; grid-template-columns: 1fr 320px; background: #fff; border-top: 3px solid var(--blue); box-shadow: 0 30px 60px rgb(7 21 46 / 18%); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .22s var(--ease), transform .22s var(--ease), visibility 0s linear .22s; }
.mh-has-mega:hover .mh-mega, .mh-has-mega.is-open .mh-mega { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.mh-mega-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 24px; }
.mh-mega-item { display: flex; align-items: flex-start; gap: 13px; padding: 15px 14px; background: transparent; color: var(--ink); text-align: start; transition: background .2s; }
.mh-mega-item:hover, .mh-mega-item:focus-visible { background: #f1f5ff; }
.mh-mega-icon { width: 42px; height: 42px; flex-shrink: 0; display: grid; place-items: center; background: #eaf0ff; color: var(--blue); font-size: 16px; clip-path: polygon(8px 0,100% 0,calc(100% - 8px) 100%,0 100%); transition: background .2s, color .2s; }
.mh-mega-item:hover .mh-mega-icon, .mh-mega-item:focus-visible .mh-mega-icon { background: var(--blue); color: #fff; }
.mh-mega-text { display: block; }
.mh-mega-title { display: flex; align-items: baseline; gap: 6px; font-size: 15px; font-weight: 800; line-height: 1.5; }
.mh-mega-num { color: #9aa3b2; font: 700 10px Arial, sans-serif; }
.mh-mega-desc { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.mh-mega-side { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; padding: 26px; color: #fff; background: var(--navy) var(--mega-bg, none) center / cover; }
.mh-mega-side::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgb(7 21 46 / 95%) 15%, rgb(7 84 255 / 35%)); }
.mh-mega-kicker { color: #8abaff; font: 700 10px Arial, sans-serif; letter-spacing: .12em; }
.mh-mega-side strong { margin-top: 6px; font-size: 22px; font-weight: 900; line-height: 1.4; }
.mh-mega-side p { margin: 6px 0 16px; color: #c9d1e4; font-size: 13px; line-height: 1.8; }
.mh-mega-wa { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 14px; font-weight: 800; border-bottom: 1px solid rgb(255 255 255 / 35%); padding-bottom: 2px; }
.mh-mega-wa i { color: #3ddc84; font-size: 17px; }
.mh-mega-wa:hover { border-color: #fff; }


.mh-actions { display: flex; align-items: center; gap: 22px; flex-shrink: 0; }
.mh-phone { display: flex; align-items: center; gap: 12px; padding-inline-start: 24px; border-inline-start: 1px solid rgb(255 255 255 / 12%); color: #fff; line-height: 1.3; }
.mh-phone-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #13254a; color: #7fa6ff; font-size: 15px; flex-shrink: 0; transition: background .2s, color .2s; }
.mh-phone:hover .mh-phone-icon { background: var(--blue); color: #fff; }
.mh-phone-label { display: block; color: #8d9ab5; font-size: 11px; font-weight: 600; }
.mh-phone bdi { font: 800 17px/1.3 Arial, sans-serif; letter-spacing: .02em; }
/* Language switch: a single slanted chip with the other language's letter (visual only for now). */
.mh-lang { display: inline-grid; place-items: center; min-width: 40px; height: 32px; padding: 0 10px; background: rgb(255 255 255 / 8%); color: #fff; font: 800 13px/1 Arial, sans-serif; letter-spacing: .04em; clip-path: polygon(7px 0,100% 0,calc(100% - 7px) 100%,0 100%); text-decoration: none; transition: background .2s; }
.mh-lang:hover, .mh-lang:focus-visible { background: var(--blue); color: #fff; }
.mh-cta { min-height: 50px; padding-block: 5px; gap: 18px; font-size: 14px; }
.mh-cta .button-orb, .mh-drawer-extras .button-orb { width: 36px; height: 36px; font-size: 13px; box-shadow: 0 0 0 4px var(--navy); }

.mh-toggle { display: none; width: 48px; height: 42px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: var(--blue); clip-path: polygon(10px 0,100% 0,calc(100% - 10px) 100%,0 100%); }
.mh-toggle span { width: 18px; height: 2px; background: #fff; transition: transform .25s var(--ease), opacity .2s, width .25s; }
.mh-toggle span:nth-child(2) { width: 12px; }
.mh-toggle[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
.mh-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mh-toggle[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }
.mh-backdrop { position: fixed; inset: 0; z-index: 45; background: rgb(7 21 46 / 45%); backdrop-filter: blur(3px); }

html[dir="ltr"] .mh-band::after { background: linear-gradient(to right, var(--blue) 0%, #9aa3b2 55%, transparent 100%); }
html[dir="ltr"] .mh-link { font-size: 14px; }

@media (max-width: 1279px) {
  .mh-brand img { width: 100px; }
  .mh-nav { gap: 22px; }
  .mh-mega { grid-template-columns: 1fr; }
  .mh-mega-side { display: none; }
  .mh-mega-grid { padding: 18px; }
  .mh-link { font-size: 14px; }
  .mh-actions { gap: 16px; }
  .mh-phone { padding-inline-start: 16px; }
  .mh-phone-text { display: none; }
}

/* Below 1024px the navigation becomes a navy drawer under the band. */
@media (max-width: 1023px) {
  .masthead { --mh-band: 68px; }
  .mh-brand img { width: 86px; }
  .mh-brand::before, .mh-brand::after { width: 28px; clip-path: polygon(18px 0,100% 0,calc(100% - 18px) 100%,0 100%); }
  .mh-brand::before { inset-inline-end: -38px; }
  .mh-brand::after { inset-inline-end: -56px; }
  .mh-actions { margin-inline-start: auto; gap: 14px; }
  .mh-phone { border: 0; padding: 0; }
  .mh-cta { display: none; }
  .mh-toggle { display: flex; }
  /* The drawer slides and fades in; its rows follow one after another. */
  .mh-nav { display: flex; visibility: hidden; opacity: 0; transform: translateY(-12px); pointer-events: none; transition: opacity .3s var(--ease), transform .35s var(--ease), visibility 0s linear .35s; position: absolute; top: 100%; inset-inline: 0; z-index: 1; max-height: calc(100dvh - var(--mh-band)); overflow-y: auto; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 18px var(--gutter) 26px; background: var(--navy); border-top: 1px solid #1d2c4d; box-shadow: 0 30px 50px rgb(7 21 46 / 30%); }
  .mh-nav.is-open { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s; }
  .mh-nav.is-open > * { animation: mh-row-in .4s var(--ease) both; }
  .mh-nav.is-open > :nth-child(2) { animation-delay: .04s; }
  .mh-nav.is-open > :nth-child(3) { animation-delay: .08s; }
  .mh-nav.is-open > :nth-child(4) { animation-delay: .12s; }
  .mh-nav.is-open > :nth-child(5) { animation-delay: .16s; }
  .mh-nav.is-open > :nth-child(6) { animation-delay: .2s; }
  .mh-link { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid #1d2c4d; color: #fff; font-size: 20px; font-weight: 800; }
  .mh-link::after { display: none; }
  .mh-link.is-active { color: #7fa6ff; }
  .mh-has-mega { flex-wrap: wrap; gap: 0; border-bottom: 1px solid #1d2c4d; }
  .mh-has-mega > .mh-link { flex: 1; border: 0; }
  .mh-mega-toggle { width: 44px; height: 44px; margin-inline-start: 6px; background: #13254a; color: #fff; font-size: 12px; }
  .mh-has-mega:hover .mh-mega-toggle i { transform: none; }
  .mh-has-mega.is-open .mh-mega-toggle i { transform: rotate(180deg); }
  /* Services dropdown opens by growing its height (0fr -> 1fr) and fading in. */
  .mh-mega, .mh-has-mega:hover .mh-mega { position: static; display: grid; grid-template-rows: 0fr; grid-template-columns: 1fr; flex-basis: 100%; background: transparent; border: 0; box-shadow: none; opacity: 0; visibility: visible; transform: none; transition: grid-template-rows .35s var(--ease), opacity .3s; }
  .mh-has-mega.is-open .mh-mega { grid-template-rows: 1fr; opacity: 1; }
  .mh-mega-grid { min-height: 0; overflow: hidden; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0; transition: padding .35s var(--ease); }
  .mh-has-mega.is-open .mh-mega-grid { padding: 4px 0 16px; }
  .mh-mega-item { align-items: center; gap: 10px; padding: 10px; background: #0f1f40; color: #fff; }
  .mh-mega-item:hover, .mh-mega-item:focus-visible { background: #1b3263; }
  .mh-mega-icon { width: 32px; height: 32px; font-size: 13px; background: #1b3263; color: #7fa6ff; }
  .mh-mega-title { font-size: 13px; line-height: 1.4; }
  .mh-mega-num, .mh-mega-desc { display: none; }
  .mh-drawer-extras { display: block; margin-top: 22px; }
  .mh-drawer-extras .angle-button { width: 100%; min-height: 54px; font-size: 15px; }
  html[dir="ltr"] .mh-link { font-size: 18px; }
}
@media (max-width: 767px) {
  .masthead { --mh-band: 64px; }
  .mh-brand img { width: 80px; }
  .mh-phone-icon { width: 38px; height: 38px; }
  .mh-mega-grid { grid-template-columns: 1fr; }
}
@media (max-width: 374px) {
  .mh-phone { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mh-link::after, .mh-brand img, .mh-toggle span { transition: none; }
}
@keyframes mh-row-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .mh-nav, .mh-mega, .mh-mega-grid { transition: none; }
  .mh-nav.is-open > * { animation: none; }
}
