/* HRT Group — site styles beyond Tailwind utilities. Identity from the 2025 company profile:
   navy #1C2E5B (logo), royal #25408F, graphite #4D4D4F, logo grey #848789, mist #DCDDDE. */
:root { color-scheme: light; }
html { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
::selection { background: #25408F; color: #fff; }

/* Header gains a shadow once the page scrolls */
#siteHeader.is-scrolled { box-shadow: 0 8px 24px -16px rgba(28,46,91,.35); }
.nav-link.is-active { position: relative; }
.nav-link.is-active::after { content: ""; position: absolute; inset-inline: .875rem; bottom: .15rem; height: 2px; background: #25408F; }
.lang-switch:lang(ar) { font-family: "Readex Pro", system-ui, sans-serif; }
.lang-switch:lang(en) { font-family: "Open Sans", system-ui, sans-serif; }

/* Blueprint grid + glow */
.hero-grid {
  background-image:
    linear-gradient(rgba(220,221,222,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220,221,222,.07) 1px, transparent 1px),
    linear-gradient(rgba(220,221,222,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220,221,222,.035) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 70% 60%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 90% 80% at 70% 60%, #000 30%, transparent 100%);
}
.hero-glow { background: radial-gradient(ellipse 70% 60% at 80% 100%, rgba(37,64,143,.9), transparent 70%); }
[dir=rtl] .hero-glow { background: radial-gradient(ellipse 70% 60% at 20% 100%, rgba(37,64,143,.9), transparent 70%); }

/* Skyline sits at the far edge; mirrored in Arabic */
.skyline { right: 0; transform: translateX(8%); }
[dir=rtl] .skyline { right: auto; left: 0; transform: translateX(-8%) scaleX(-1); }
@media (min-width: 1024px) { .skyline { transform: none; } [dir=rtl] .skyline { transform: scaleX(-1); } }

/* The one orchestrated moment: the skyline draws itself, text settles in */
.skyline path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.65,0,.35,1) forwards; }
.skyline g:first-of-type path:nth-child(2) { animation-delay: .1s }
.skyline g:first-of-type path:nth-child(n+4) { animation-delay: .35s }
.skyline g:first-of-type path:nth-child(n+8) { animation-delay: .7s }
.skyline g:last-of-type path { animation-delay: 1.6s; animation-duration: 1s }
.skyline .flame { fill: rgba(247,148,29,.2); }
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero-in { opacity: 0; transform: translateY(14px); animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; } }
.eyebrow:lang(en) { letter-spacing: .18em; }

/* Metrics plate: dividers between cells, direction-aware */
.metric { border-color: rgba(255,255,255,.15); }
.metric:nth-child(even) { border-inline-start-width: 1px; padding-inline-start: 1.25rem; }
.metric:nth-child(n+3) { border-top-width: 1px; }
@media (min-width: 640px) { .metric:nth-child(even) { padding-inline-start: 2rem; } }
@media (min-width: 1024px) {
  .metric:nth-child(n+2) { border-inline-start-width: 1px; padding-inline-start: 2rem; }
  .metric:nth-child(n+3) { border-top-width: 0; }
}

/* Profile device: chapter numbers and the blue corner line */
.sec-head { position: relative; }
.sec-num {
  display: block; margin-bottom: .25rem; font-family: "Open Sans", system-ui, sans-serif;
  font-weight: 800; font-size: clamp(3.5rem, 8vw, 5.5rem); line-height: .9; letter-spacing: -.04em; color: #DCDDDE;
}
.sec-head--dark .sec-num { color: rgba(255,255,255,.14); }
.sec-num::after {
  content: ""; display: block; width: 5.5rem; height: 2.25rem; margin-top: -.6rem; margin-inline-start: 4.2rem;
  border-top: 2px solid #25408F; border-inline-end: 2px solid #25408F;
}
.sec-head--dark .sec-num::after { border-color: rgba(255,255,255,.55); }

/* Scroll reveal (only when JS is on) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Cards */
.svc-card, .why-card, .co-card { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.svc-card:hover, .why-card:hover, .co-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(28,46,91,.35); }
.why-card:hover, .co-card:hover, .svc-card:not(.svc-lead):hover { border-color: #25408F; }

/* Inner-page hero: navy wash over the photo (mirrored in Arabic) + the profile's corner line */
.hero-wash { background: linear-gradient(100deg, rgba(28,46,91,.96) 0%, rgba(28,46,91,.86) 45%, rgba(28,46,91,.55) 100%); }
[dir=rtl] .hero-wash { background: linear-gradient(-100deg, rgba(28,46,91,.96) 0%, rgba(28,46,91,.86) 45%, rgba(28,46,91,.55) 100%); }
.hero-wash--strong { background: linear-gradient(100deg, rgba(28,46,91,.97) 0%, rgba(28,46,91,.9) 50%, rgba(28,46,91,.62) 100%); }
[dir=rtl] .hero-wash--strong { background: linear-gradient(-100deg, rgba(28,46,91,.97) 0%, rgba(28,46,91,.9) 50%, rgba(28,46,91,.62) 100%); }
.hero-corner { position: absolute; bottom: 2rem; inset-inline-end: 2rem; width: 6rem; height: 3rem; border-bottom: 2px solid rgba(255,255,255,.5); border-inline-end: 2px solid rgba(255,255,255,.5); pointer-events: none; }
@media (max-width: 639px) { .hero-corner { display: none; } }

/* Framed photo: the blue corner-line from the profile */
.framed { isolation: isolate; }
.framed::before { content: ""; position: absolute; z-index: -1; top: -1rem; inset-inline-end: -1rem; width: 45%; height: 45%; border-top: 2px solid #25408F; border-inline-end: 2px solid #25408F; }
.framed::after { content: ""; position: absolute; z-index: -1; bottom: -1rem; inset-inline-start: -1rem; width: 30%; height: 30%; background: #DCDDDE; }

/* Whole card clickable through its heading link */
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-link:focus-visible::after { outline: 2px solid #25408F; outline-offset: 2px; }
.co-card { position: relative; }

/* Draggable, scroll-snapping strip */
.strip { overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab;
  --gut: 1.25rem; padding-inline: var(--gut); scroll-padding-inline: var(--gut); }
@media (min-width: 640px) { .strip { --gut: max(2rem, calc((100vw - 76rem) / 2 + 2rem)); } }
.strip::-webkit-scrollbar { display: none; }
.strip:focus-visible { outline: 2px solid #25408F; outline-offset: 4px; }
.strip.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.strip.is-dragging a { pointer-events: none; }
.strip-track { display: flex; gap: 1.25rem; width: max-content; }
.strip-item { scroll-snap-align: start; width: min(82vw, 22rem); flex: none; }
@media (min-width: 1024px) { .strip-item { width: 24rem; } }
.strip img { -webkit-user-drag: none; }

/* Timeline */
.timeline-dot { display: block; width: .875rem; height: .875rem; margin-bottom: 1.25rem; background: #25408F; outline: 4px solid #F5F6F7; position: relative; z-index: 1; }
@media (min-width: 1024px) {
  .timeline { position: relative; }
  .timeline::before { content: ""; position: absolute; top: .4rem; inset-inline: 0; height: 2px; background: #DCDDDE; }
}

/* Gallery */
.gal-filter { min-height: 2.75rem; padding: .5rem 1rem; font-size: .875rem; font-weight: 700; color: #1C2E5B; border: 1px solid #DCDDDE; background: #fff; transition: background .2s, color .2s, border-color .2s; }
.gal-filter:hover { border-color: #25408F; color: #25408F; }
.gal-filter.is-on { background: #25408F; border-color: #25408F; color: #fff; }
.gal-filter:focus-visible { outline: 2px solid #25408F; outline-offset: 2px; }
.gal-item[hidden] { display: none; }
.gal-item { min-height: 160px; }
@media (min-width: 640px) { .gal-item { min-height: 220px; } }

/* Lightbox */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 4.5rem 1rem 1.5rem; border: 0; background: rgba(17,28,56,.96); color: #fff; overscroll-behavior: contain; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; animation: fade .2s ease; }
.lightbox::backdrop { background: rgba(17,28,56,.9); }
.lightbox-figure { max-width: min(1200px, 100%); margin: 0; touch-action: pan-y; }
.lightbox-img { display: block; max-width: 100%; max-height: calc(100dvh - 9rem); margin-inline: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-btn { position: absolute; display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); transition: background .2s; }
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-close { top: 1rem; inset-inline-end: 1rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { inset-inline-start: 1rem; }
.lb-next { inset-inline-end: 1rem; }
@media (max-width: 639px) { .lb-prev, .lb-next { top: auto; bottom: 1rem; transform: none; } }
@keyframes fade { from { opacity: 0; } }
html.lb-lock { overflow: hidden; }

/* Long-form text */
.prose-hrt p + p { margin-top: 1rem; }

/* Arabic: no letter-spacing (it breaks joining) and taller line-height */
[lang=ar] body, [lang=ar] h1, [lang=ar] h2, [lang=ar] h3, [lang=ar] p, [lang=ar] span, [lang=ar] a, [lang=ar] li, [lang=ar] dt, [lang=ar] dd { letter-spacing: 0 !important; }
[lang=ar] h1 { line-height: 1.3; }
[lang=ar] h2 { line-height: 1.4; }
[lang=ar] h3 { line-height: 1.45; }
[lang=ar] .text-lg { line-height: 1.9; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .skyline path { stroke-dashoffset: 0; }
  .hero-in, .js .reveal { opacity: 1; transform: none; }
}
