/* HPS Engineering Solutions — site styles
   Brand: yellow #FFBD59, cyan #4AC0D8. Uses logical properties so the same CSS serves LTR and RTL. */
:root {
  --yellow: #FFBD59;
  --yellow-deep: #F2A532;
  --cyan: #4AC0D8;
  --cyan-deep: #1F8FA8;
  --ink: #0E2433;
  --ink-2: #33495A;
  --muted: #5F7383;
  --line: #DCE5EB;
  --bg: #FFFFFF;
  --bg-soft: #F4F8FA;
  --navy: #0E2433;
  --navy-2: #163447;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 36, 51, .06), 0 8px 24px rgba(14, 36, 51, .08);
  --wrap: 1180px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Segoe UI", Tahoma, "Noto Kufi Arabic", "Noto Sans Arabic", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 17px; }
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.8; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--ink); letter-spacing: -.01em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { letter-spacing: 0; line-height: 1.4; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 750; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 720; }
h3 { font-size: 1.2rem; font-weight: 680; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 52px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 1.35rem; letter-spacing: .04em; color: var(--cyan-deep); }
.brand-text span { font-size: .78rem; color: var(--ink-2); letter-spacing: .02em; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { color: var(--ink-2); font-weight: 560; font-size: .95rem; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--ink); background: #FFF4E0; box-shadow: inset 0 -2px 0 var(--yellow); }
.site-nav .lang-switch { margin-inline-start: 8px; border: 1px solid var(--line); font-weight: 600; }
.nav-group { position: relative; }
.nav-group-btn { font: inherit; color: var(--ink-2); font-weight: 560; font-size: .95rem; padding: 8px 12px; border-radius: 8px; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.nav-group-btn::after { content: ""; width: 7px; height: 7px; border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.nav-group-btn:hover, .nav-group.open .nav-group-btn { background: var(--bg-soft); color: var(--ink); }
.nav-group[data-current] .nav-group-btn { color: var(--ink); background: #FFF4E0; box-shadow: inset 0 -2px 0 var(--yellow); }
.nav-menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; min-width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: none; flex-direction: column; }
.nav-menu a { display: block; padding: 10px 12px; }
.nav-menu a[aria-current="page"] { box-shadow: none; background: #FFF4E0; }
.nav-group.open .nav-menu { display: flex; }
@media (hover: hover) and (min-width: 961px) { .nav-group:hover .nav-menu, .nav-group:focus-within .nav-menu { display: flex; } }
.footer-grid a.footer-strong { color: var(--yellow); font-weight: 600; margin-top: 6px; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { position: absolute; left: 11px; width: 20px; height: 2px; background: var(--ink); content: ""; transition: transform .2s; }
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { left: 0; top: -6px; }
.nav-toggle-bar::after { left: 0; top: 6px; }
.nav-open .nav-toggle-bar { background: transparent; }
.nav-open .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 72px; inset-inline: 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 16px; display: none; box-shadow: var(--shadow); }
  .nav-open .site-nav { display: flex; }
  .site-nav a { padding: 12px; font-size: 1rem; }
  .site-nav .lang-switch { margin: 8px 0 0; text-align: center; }
  .nav-group-btn { width: 100%; padding: 12px; font-size: 1rem; justify-content: space-between; }
  .nav-menu { position: static; display: flex; box-shadow: none; border: 0; padding: 0 0 4px; padding-inline-start: 12px; min-width: 0; }
  .nav-group .nav-group-btn::after { display: none; }
}

/* Division contact strip and team */
.division-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 22px 26px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.division-contact .who { flex: 1 1 240px; }
.division-contact .who strong { display: block; font-size: 1.08rem; }
.division-contact .who span { color: var(--muted); font-size: .95rem; }
.division-contact .ways { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .93rem; background: var(--bg-soft); }
.chip:hover { text-decoration: none; border-color: var(--cyan); }
.chip svg { width: 16px; height: 16px; flex: none; }
.chip.wa { background: #E9F9EF; border-color: #BFE9CD; color: #146C3A; }
.chip.wa:hover { border-color: #25D366; }
.team { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 860px) { .team { grid-template-columns: 1fr; } }
.person { display: flex; gap: 16px; align-items: flex-start; }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 1.15rem; color: var(--ink); background: var(--yellow); flex: none; }
.avatar.cyan { background: var(--cyan); color: #fff; }
.avatar.navy { background: var(--navy); color: var(--yellow); }
.person h3 { margin-bottom: 2px; font-size: 1.1rem; }
.person .role { color: var(--cyan-deep); font-weight: 650; font-size: .92rem; display: block; margin-bottom: 6px; }
.person p { color: var(--ink-2); font-size: .95rem; margin: 0; }
.division-card { display: flex; flex-direction: column; }
.division-card .num { font-size: .8rem; font-weight: 800; color: var(--yellow-deep); letter-spacing: .1em; }
.grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-5 { grid-template-columns: 1fr; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-weight: 650; font-size: .98rem; border: 2px solid transparent; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--yellow); color: var(--ink); box-shadow: 0 4px 14px rgba(242, 165, 50, .35); }
.btn-primary:hover { background: var(--yellow-deep); }
.btn-ghost { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-outline { border-color: var(--cyan); color: var(--cyan-deep); }
.btn-outline:hover { background: #EAF8FB; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.arrow::after { content: "→"; }
html[dir="rtl"] .arrow::after { content: "←"; }

/* Hero */
.hero { position: relative; color: #fff; background: var(--navy); overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .42; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(14, 36, 51, .96) 0%, rgba(14, 36, 51, .82) 45%, rgba(14, 36, 51, .35) 100%); }
html[dir="rtl"] .hero::after { background: linear-gradient(260deg, rgba(14, 36, 51, .96) 0%, rgba(14, 36, 51, .82) 45%, rgba(14, 36, 51, .35) 100%); }
.hero .wrap { position: relative; z-index: 1; padding-block: clamp(72px, 11vw, 140px); }
.hero h1 { color: #fff; max-width: 760px; }
.hero h1 em { font-style: normal; color: var(--yellow); }
.hero p.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #D6E3EB; max-width: 640px; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 14px; }
html[lang="ar"] .eyebrow { letter-spacing: 0; font-size: .95rem; }
.hero-compact .wrap { padding-block: clamp(56px, 8vw, 96px); }

/* Sections */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section-soft { background: var(--bg-soft); }
.section-dark { background: var(--navy); color: #D6E3EB; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.section-dark .section-head p { color: #B9CCD8; }

/* Grids and cards */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card h3 { margin-top: 4px; }
.card p { color: var(--ink-2); margin-bottom: 0; }
.card-media { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-media img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; background: var(--bg-soft); }
.card-media .card-body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-media .card-body .more { margin-top: auto; padding-top: 12px; font-weight: 650; }
.division-tag { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan-deep); }
html[lang="ar"] .division-tag { letter-spacing: 0; font-size: .9rem; }
.division-tag::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--yellow); }
.icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: #FFF4E0; color: var(--yellow-deep); margin-bottom: 14px; }
.icon svg { width: 24px; height: 24px; }
.icon.cyan { background: #E6F7FB; color: var(--cyan-deep); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 28px 24px; border-inline-end: 1px solid rgba(255, 255, 255, .12); }
.stat:last-child { border-inline-end: 0; }
.stat strong { display: block; font-size: 2.4rem; color: var(--yellow); line-height: 1.1; }
.stat span { color: #B9CCD8; font-size: .95rem; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat:nth-child(2) { border-inline-end: 0; } .stat:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, .12); } }

/* Split layout */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split.reverse > :first-child { order: 2; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split.reverse > :first-child { order: 0; } }
.frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--bg-soft); }
.frame img { width: 100%; }

/* Lists */
.checks { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
.checks li { position: relative; padding-inline-start: 30px; color: var(--ink-2); }
.checks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 18px; height: 18px; border-radius: 50%; background: #E6F7FB url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F8FA8' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.section-dark .checks li { color: #D6E3EB; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.tags li { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.section-dark .tags li { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); color: #E3EDF3; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gallery figure { margin: 0; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.gallery.contain img { object-fit: contain; background: #fff; padding: 10px; }
.gallery figcaption { padding: 10px 14px; font-size: .9rem; color: var(--ink-2); }
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } }

/* Project list */
.projects { display: grid; gap: 14px; }
.project { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.project .meta { color: var(--muted); font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }
.project .meta strong { color: var(--cyan-deep); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
html[lang="ar"] .project .meta strong { letter-spacing: 0; font-size: .92rem; }
.project h3 { font-size: 1.08rem; margin-bottom: 4px; }
.project p { margin: 0; color: var(--ink-2); }
@media (max-width: 640px) { .project { grid-template-columns: 1fr; gap: 8px; } }

/* Software */
.product-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .product-hero { grid-template-columns: 1fr; } }
.badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: rgba(74, 192, 216, .16); color: var(--cyan); border: 1px solid rgba(74, 192, 216, .4); }
.badge.soon { background: rgba(255, 189, 89, .14); color: var(--yellow); border-color: rgba(255, 189, 89, .45); }
.mock { background: #0B1D29; border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); overflow: hidden; font-size: .78rem; color: #CFE0EA; direction: ltr; text-align: left; }
.mock-bar { display: flex; gap: 6px; padding: 10px 12px; background: #10293A; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2C4A5E; }
.mock-tools { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.mock-tools span { padding: 4px 10px; border-radius: 6px; background: #14344A; }
.mock-tools span.on { background: var(--yellow); color: var(--ink); font-weight: 700; }
.mock table { width: 100%; border-collapse: collapse; }
@media (max-width: 560px) { .mock table { display: block; overflow-x: auto; } }
.mock th, .mock td { padding: 7px 12px; border-bottom: 1px solid rgba(255, 255, 255, .06); white-space: nowrap; }
.mock th { color: #8FB0C4; font-weight: 600; text-align: left; }
.mock td.edit { background: rgba(255, 189, 89, .22); color: #FFE2B0; }
.mock td.warn { color: #FFB4A8; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: #fff; }
.plan.pro { border: 2px solid var(--yellow); box-shadow: var(--shadow); }
.plan h3 { display: flex; align-items: center; justify-content: space-between; }

/* CTA band */
.cta { background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%); color: #D6E3EB; border-radius: 20px; padding: clamp(32px, 5vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; position: relative; overflow: hidden; }
.cta::after { content: ""; position: absolute; inset-inline-end: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(255, 189, 89, .18); }
.cta h2 { color: #fff; margin-bottom: 6px; }
.cta p { margin: 0; }
.cta > * { position: relative; z-index: 1; }

/* Contact */
.contact-list { display: grid; gap: 18px; }
.contact-item { display: flex; gap: 16px; align-items: flex-start; }
.contact-item .icon { margin: 0; flex: none; }
.contact-item strong { display: block; }
.contact-item a, .contact-item span { color: var(--ink-2); }

/* Prose (privacy etc.) */
.prose { max-width: 780px; }
.prose h2 { font-size: 1.45rem; margin-top: 2em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: start; vertical-align: top; }
.prose th { background: var(--bg-soft); }
.prose code { background: var(--bg-soft); padding: 2px 6px; border-radius: 5px; font-size: .88em; word-break: break-all; }
.prose ul { padding-inline-start: 1.3em; }
.prose li { margin-bottom: .4em; }
.note { border-inline-start: 4px solid var(--yellow); background: #FFF8EC; padding: 14px 18px; border-radius: 8px; color: var(--ink-2); }

/* Footer */
.site-footer { background: #0A1C28; color: #9DB4C3; margin-top: 0; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; padding-block: 56px 32px; }
.footer-grid h2 { font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: #fff; margin-bottom: 14px; }
html[lang="ar"] .footer-grid h2 { letter-spacing: 0; font-size: 1rem; }
.footer-grid a, .footer-grid span { display: block; color: #9DB4C3; padding-block: 3px; }
.footer-grid a:hover { color: #fff; }
.footer-brand img { width: 64px; margin-bottom: 12px; }
.footer-brand strong { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); padding-block: 18px 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .85rem; color: #6F8898; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* Utilities */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--muted); }
.lead { font-size: 1.12rem; color: var(--ink-2); }
.small { font-size: .9rem; }
.spacer { height: 24px; }
