/* ============================================================
   GELTAN — Design System
   Brand: #2a5fb4 blue / #1c3255 navy / #47a2de sky / #e52538 red
   Fonts: Tajawal (AR) + Hanken Grotesk (LATIN)
   ============================================================ */

:root {
  --g-blue: #2a5fb4;
  --g-navy: #1c3255;
  --g-sky: #47a2de;
  --g-red: #e52538;
  --g-ice: #eef4fb;
  --g-ice-2: #e2edf9;
  --ease-soft: cubic-bezier(0.23, 0.01, 0.08, 0.95);
  --ease-slide: cubic-bezier(0.52, 0.16, 0.24, 1);
}

html { scroll-behavior: smooth; }

html[lang="ar"] body { font-family: "Tajawal", "Hanken Grotesk", sans-serif; }
html[lang="en"] body { font-family: "Hanken Grotesk", "Tajawal", sans-serif; }

body {
  background: #ffffff;
  color: var(--g-navy);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(71, 162, 222, 0.35); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--g-ice); }
::-webkit-scrollbar-thumb { background: var(--g-blue); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--g-navy); }

/* ---------- Brand geometric pattern (quarter-circle tiles) ---------- */
.pattern-band {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg%3E%3Crect width='120' height='120' fill='none'/%3E%3Cpath d='M0 60 A60 60 0 0 1 60 0 L60 60 Z' fill='%2347a2de'/%3E%3Cpath d='M60 60 A60 60 0 0 1 0 120 L0 60 Z' fill='%231c3255'/%3E%3Cpath d='M60 0 A60 60 0 0 1 120 60 L60 60 Z' fill='%232a5fb4'/%3E%3Cpath d='M120 60 A60 60 0 0 1 60 120 L60 60 Z' fill='%23e52538'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 90px 90px;
}
.pattern-band-lg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg%3E%3Cpath d='M0 80 A80 80 0 0 1 80 0 L80 80 Z' fill='%2347a2de'/%3E%3Cpath d='M80 80 A80 80 0 0 1 0 160 L0 80 Z' fill='%231c3255'/%3E%3Cpath d='M80 0 A80 80 0 0 1 160 80 L80 80 Z' fill='%232a5fb4'/%3E%3Cpath d='M160 80 A80 80 0 0 1 80 160 L80 80 Z' fill='%23e52538'/%3E%3Ccircle cx='80' cy='80' r='14' fill='%231c3255'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 130px 130px;
}
.pattern-faint {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg opacity='0.06'%3E%3Cpath d='M0 80 A80 80 0 0 1 80 0 L80 80 Z' fill='%232a5fb4'/%3E%3Cpath d='M80 80 A80 80 0 0 1 0 160 L0 80 Z' fill='%231c3255'/%3E%3Cpath d='M80 0 A80 80 0 0 1 160 80 L80 80 Z' fill='%2347a2de'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ---------- Header ---------- */
.site-header {
  transition: transform 0.4s var(--ease-soft), box-shadow 0.3s ease, background 0.3s ease;
}
.site-header.is-hidden { transform: translateY(-110%); }
.site-header.is-solid {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 6px 24px rgba(28, 50, 85, 0.08);
}

.nav-link {
  position: relative;
  transition: color 0.35s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--g-red);
  transition: width 0.35s var(--ease-soft);
}
.nav-link:hover { color: var(--g-blue); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--g-blue); font-weight: 700; }
.nav-link.active::after { width: 100%; }

/* Language switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(42, 95, 180, 0.35);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  background: #fff;
}
.lang-switch button {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--g-blue);
  transition: all 0.3s ease;
  line-height: 1.4;
}
.lang-switch button.on {
  background: var(--g-blue);
  color: #fff;
}

/* Mobile menu */
.mobile-menu {
  transition: clip-path 0.45s var(--ease-slide);
  clip-path: inset(0 0 100% 0);
}
.mobile-menu.open { clip-path: inset(0 0 0 0); }

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s var(--ease-soft);
  transition-delay: var(--d, 0ms);
}
[data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--g-blue);
  color: #fff;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 700;
  transition: background 0.3s ease, transform 0.3s var(--ease-soft), box-shadow 0.3s ease;
}
.btn-primary:hover {
  background: var(--g-navy);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(28, 50, 85, 0.22);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--g-blue);
  color: var(--g-blue);
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 700;
  transition: all 0.3s ease;
}
.btn-ghost:hover { background: var(--g-blue); color: #fff; }

.btn-primary .arrow, .btn-ghost .arrow, .link-arrow .arrow {
  transition: transform 0.3s var(--ease-soft);
}
.btn-primary:hover .arrow, .btn-ghost:hover .arrow, .link-arrow:hover .arrow {
  transform: translateX(var(--arrow-shift, 4px));
}
html[lang="ar"] { --arrow-shift: -4px; }
html[lang="ar"] .flip-ar { transform: scaleX(-1); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--g-blue);
  transition: color 0.3s ease;
}
.link-arrow:hover { color: var(--g-red); }

/* ---------- Section headers ---------- */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--g-blue);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.section-eyebrow::before {
  content: "";
  width: 34px;
  height: 2px;
  background: var(--g-red);
}

/* ---------- Arch image (brand signature) ---------- */
.arch-img {
  border-radius: 999px 999px 18px 18px;
  overflow: hidden;
  position: relative;
}
.arch-frame {
  border-radius: 999px 999px 18px 18px;
  border: 2px solid rgba(71, 162, 222, 0.55);
  padding: 8px;
  background: linear-gradient(180deg, rgba(71,162,222,0.12), rgba(42,95,180,0.05));
}
.arch-frame img { display: block; width: 100%; height: auto; }

/* ---------- Cards ---------- */
.card-soft {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 10px 34px rgba(28, 50, 85, 0.07);
  transition: transform 0.4s var(--ease-soft), box-shadow 0.4s ease;
}
.card-soft:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 44px rgba(28, 50, 85, 0.13);
}

/* ---------- Services tree ---------- */
.tree-view { position: relative; }

.tree-node-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: start;
  background: #fff;
  border: 1.5px solid var(--g-ice-2);
  border-radius: 18px;
  padding: 18px 22px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  cursor: pointer;
}
.tree-category-image {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--g-ice);
}
.tree-node-head:hover {
  border-color: var(--g-sky);
  box-shadow: 0 12px 30px rgba(42, 95, 180, 0.10);
}
.tree-branch.open > .tree-node-head {
  border-color: var(--g-blue);
  background: linear-gradient(120deg, #fff 60%, var(--g-ice));
}

.tree-index {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--g-ice);
  color: var(--g-blue);
  font-weight: 800;
  font-size: 15px;
  transition: all 0.35s ease;
}
.tree-branch.open > .tree-node-head .tree-index,
.tree-node-head:hover .tree-index {
  background: var(--g-blue);
  color: #fff;
}

.tree-chevron {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1.5px solid var(--g-ice-2);
  display: grid;
  place-items: center;
  color: var(--g-blue);
  transition: transform 0.45s var(--ease-soft), background 0.3s ease, color 0.3s ease;
}
.tree-branch.open .tree-chevron {
  transform: rotate(180deg);
  background: var(--g-blue);
  color: #fff;
  border-color: var(--g-blue);
}

/* expand animation: grid-rows 0fr -> 1fr */
.tree-children {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease-slide);
}
.tree-children > div { overflow: hidden; }
.tree-branch.open > .tree-children { grid-template-rows: 1fr; }

/* connector lines (RTL-aware using logical properties) */
.tree-branch { position: relative; }
.tree-children-inner { position: relative; padding-inline-start: 34px; }
.tree-children-inner::before {
  content: "";
  position: absolute;
  inset-inline-start: 11px;
  top: -14px;
  bottom: 22px;
  width: 2px;
  background: linear-gradient(180deg, var(--g-sky), rgba(71, 162, 222, 0.15));
}
.tree-leaf { position: relative; }
.tree-leaf::before {
  content: "";
  position: absolute;
  inset-inline-start: -23px;
  top: 30px;
  width: 20px;
  height: 2px;
  background: var(--g-sky);
  opacity: 0.65;
}
.tree-leaf::after {
  content: "";
  position: absolute;
  inset-inline-start: -27px;
  top: 26px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #fff;
  border: 2.5px solid var(--g-blue);
  transition: background 0.3s ease, transform 0.3s ease;
}
.tree-leaf.active::after { background: var(--g-red); border-color: var(--g-red); transform: scale(1.25); }

.tree-leaf-btn {
  width: 100%;
  text-align: start;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--g-navy);
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}
.tree-leaf-btn:hover { background: var(--g-ice); color: var(--g-blue); }
.tree-leaf.active .tree-leaf-btn {
  background: #fff;
  border-color: var(--g-blue);
  color: var(--g-blue);
  box-shadow: 0 8px 22px rgba(42, 95, 180, 0.10);
}

/* detail panel */
.svc-detail {
  border-radius: 26px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 50px rgba(28, 50, 85, 0.10);
}
.svc-detail-img { position: relative; }
.svc-detail-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.svc-detail-body .svc-fade { animation: svcIn 0.55s var(--ease-soft) both; }
@keyframes svcIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.svc-check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(71, 162, 222, 0.18);
  color: var(--g-blue);
}

/* view toggle */
.view-toggle {
  display: inline-flex;
  background: var(--g-ice);
  border-radius: 999px;
  padding: 5px;
  gap: 4px;
}
.view-toggle button {
  padding: 9px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: var(--g-blue);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.view-toggle button.on { background: var(--g-blue); color: #fff; box-shadow: 0 8px 18px rgba(42,95,180,0.25); }

/* services card grid */
.svc-card {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(28, 50, 85, 0.08);
  transition: transform 0.4s var(--ease-soft), box-shadow 0.4s ease;
  cursor: pointer;
}
button.svc-card {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: start;
}
.svc-card:hover { transform: translateY(-8px); box-shadow: 0 26px 52px rgba(28, 50, 85, 0.15); }
.svc-card .svc-card-img { height: 220px; overflow: hidden; }
.svc-card .svc-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-soft); }
.svc-card:hover .svc-card-img img { transform: scale(1.06); }

[data-services-explorer]:not(.services-loaded) [data-tree-view],
[data-services-explorer]:not(.services-loaded) [data-cards-view] {
  visibility: hidden;
}

/* ---------- Page hero ---------- */
.page-hero {
  position: relative;
  background: linear-gradient(135deg, var(--g-navy) 0%, var(--g-blue) 70%, #3169c4 100%);
  overflow: hidden;
}
.page-hero .pattern-band-lg {
  opacity: 0.08;
  -webkit-mask-image: radial-gradient(ellipse 90% 100% at 80% 20%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 100% at 80% 20%, #000 30%, transparent 75%);
}

/* ---------- Stats ---------- */
.stat-num {
  font-weight: 800;
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  line-height: 1;
  color: var(--g-blue);
}

/* ---------- Projects ---------- */
.project-card {
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 14px 40px rgba(28, 50, 85, 0.09);
  transition: transform 0.4s var(--ease-soft), box-shadow 0.4s ease;
}
.project-card:hover { transform: translateY(-6px); box-shadow: 0 26px 54px rgba(28, 50, 85, 0.16); }
.project-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  transition: transform 0.5s var(--ease-soft), filter 0.4s ease;
  cursor: pointer;
}
.project-gallery img:hover { transform: scale(1.03); filter: brightness(1.06); }

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 26, 46, 0.9);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: min(92vw, 1000px);
  max-height: 84vh;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: svcIn 0.4s var(--ease-soft) both;
}

/* ---------- Clients ---------- */
.client-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid var(--g-ice-2);
  border-radius: 18px;
  padding: 22px 16px;
  font-weight: 700;
  color: var(--g-navy);
  text-align: center;
  transition: all 0.35s var(--ease-soft);
}
.marquee-chip {
  min-width: 150px;
  padding-block: 12px;
}
.client-chip:hover {
  border-color: var(--g-sky);
  color: var(--g-blue);
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(42, 95, 180, 0.10);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--g-navy);
  color: #cfdcef;
  position: relative;
  overflow: hidden;
}
.footer-link { transition: color 0.3s ease, padding 0.3s ease; }
.footer-link:hover { color: #fff; }

/* ---------- Forms ---------- */
.field {
  width: 100%;
  background: var(--g-ice);
  border: 1.5px solid transparent;
  border-radius: 14px;
  padding: 14px 18px;
  color: var(--g-navy);
  transition: all 0.3s ease;
  outline: none;
}
.field:focus {
  background: #fff;
  border-color: var(--g-blue);
  box-shadow: 0 0 0 4px rgba(42, 95, 180, 0.12);
}
.field::placeholder { color: #8ea3c2; }

/* Continuous client belt */
.marquee {
  position: relative;
  overflow: hidden;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  top: -52px;
  margin-block-end: -52px;
  padding-block: 22px 28px;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 34s linear infinite;
}
.marquee-group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 18px;
  padding-inline-end: 18px;
  transform: rotate(359deg);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation-duration: 70s; }
}

/* snowflake float in hero */
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}
.floaty { animation: floaty 7s ease-in-out infinite; }
.floaty-2 { animation: floaty 9s ease-in-out 1.2s infinite; }

/* value card red marker */
.value-card { position: relative; }
.value-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 22px;
  bottom: 22px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--g-red), var(--g-blue));
}

/* timeline (about) */
.tl-item { position: relative; padding-inline-start: 34px; }
.tl-item::before {
  content: "";
  position: absolute;
  inset-inline-start: 8px;
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--g-blue);
  box-shadow: 0 0 0 5px rgba(42, 95, 180, 0.15);
}
.tl-item::after {
  content: "";
  position: absolute;
  inset-inline-start: 12.5px;
  top: 26px;
  bottom: -18px;
  width: 2px;
  background: var(--g-ice-2);
}
.tl-item:last-child::after { display: none; }
