:root {
  --navy: #0A2540;
  --blue: #0066FF;
  --teal: #00C2FF;
  --dt: #00D1B2;
  --soft: #E8F1F8;
  --mid: #CFE3F1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Montserrat','Cairo',system-ui,sans-serif;
  background: #fff;
  color: var(--navy);
}

/* ---------- hero: dark light-beam background, giant title behind, glass icon tiles rising from the bottom ---------- */
.contact-hero {
  --gfs: clamp(4rem,19vw,17rem);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  color: #fff;
  min-height: clamp(520px,46vw,760px);
  padding: clamp(1.5rem,4vh,3rem) 16px 0;
}

html[data-lang="ar"] .contact-hero {
  --gfs: clamp(3.8rem,16vw,14rem);
}

.contact-hero__bg {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background: url(../src/opt/clients-bg.webp) center/cover no-repeat var(--ct-bg);
  background-blend-mode: lighten;
}

/* slow "breathing": a light veil fades in and out (opacity is cheap, animating filter on this full-screen fixed layer repainted it every frame) */
.contact-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .1);
  opacity: 0;
  animation: contact-breath 14s ease-in-out infinite alternate;
}

@keyframes contact-breath {
  to {
    opacity: 1;
  }
}

.contact-hero__giant {
  margin: 73px;
  display: flex;
  justify-content: center;
  gap: .22em;
  font-family: 'Bebas Neue',Impact,sans-serif;
  font-weight: 400;
  font-size: var(--gfs);
  line-height: .9;
  letter-spacing: .06em;
  white-space: nowrap;
  text-transform: uppercase;
  user-select: none;
}

html[data-lang="ar"] .contact-hero__giant {
  font-family: 'Cairo',sans-serif;
  font-weight: 900;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
}

.contact-word {
  display: inline-flex;
  overflow: hidden;
  padding-top: .04em;
}

html[data-lang="ar"] .contact-word {
  padding: .12em .06em .3em;
}

.contact-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(110%);
  background: linear-gradient(180deg,rgba(255,255,255,.95),rgba(255,255,255,.78) 45%,rgba(0,194,255,.3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: contact-char 1.3s cubic-bezier(.22,1,.36,1) forwards;
  animation-delay: calc(.25s + var(--i)*.07s);
}

@keyframes contact-char {
  to {
    opacity: 1;
    transform: none;
  }
}

/* tiles: --x/--y position, --s size, --d delay (set per tile in the markup); sizes follow the screen width, capped at desktop size */
.contact-tiles {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 47px;
  width: min(1100px,100%);
  height: min(60%,430px);
  margin-left: calc(min(1100px,100%) / -2);
  pointer-events: none;
}

.contact-tile {
  --u: min(1vw,11px);
  position: absolute;
  left: var(--x);
  bottom: var(--y);
  display: grid;
  place-items: center;
  width: calc(var(--s)*var(--u));
  height: calc(var(--s)*var(--u));
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35);
  /* no backdrop-filter: 16 floating tiles each re-blurring what is behind them on every frame made the page stutter; own layer so the float is moved by the GPU */
  will-change: transform;
  color: rgba(255,255,255,.92);
  animation: contact-rise 1.6s cubic-bezier(.16,1,.3,1) var(--d) both,contact-float 6s ease-in-out calc(var(--d) + 1.6s) infinite alternate;
}

.contact-tile svg {
  width: 46%;
  height: 46%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-tile b {
  font: 600 calc(var(--s)*var(--u)*.48)/1 'Montserrat',sans-serif;
}

.contact-tile--blue {
  background: linear-gradient(145deg,rgba(0,102,255,.55),rgba(10,37,64,.55));
  box-shadow: 0 14px 30px -16px rgba(0,102,255,.8);
}

.contact-tile--teal {
  background: linear-gradient(145deg,rgba(0,209,178,.45),rgba(10,37,64,.5));
  box-shadow: 0 14px 30px -16px rgba(0,209,178,.8);
}

.contact-tile--cyan {
  background: linear-gradient(145deg,rgba(0,194,255,.5),rgba(255,255,255,.12));
  box-shadow: 0 14px 30px -16px rgba(0,194,255,.8);
}

@keyframes contact-rise {
  from {
    opacity: 0;
    transform: translateY(130%);
  }
}

@keyframes contact-float {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-9px);
  }
}

/* bottom edge fades into the page */
.contact-hero::after {
  content: none;
}

/* ---- responsive: --u scales the tiles with the screen, the title keeps clear of the (transparent) navbar ---- */
@media(max-width:1199.98px) {
  .contact-hero__giant {
    margin: calc(var(--atd-nav-h,57px) + 1rem) 0 0;
  }
}

/* tablet + phone: centre the title in the space between the navbar and the tiles */
@media(max-width:991.98px) {
  .contact-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--atd-nav-h,57px) + 1rem) 16px clamp(150px,40vw,250px);
  }

  .contact-hero__giant {
    margin: 0;
  }
}

@media(max-width:991.98px) {
  .contact-hero {
    min-height: clamp(460px,72vw,620px);
  }

  .contact-tiles {
    height: min(56%,340px);
    bottom: 34px;
  }

  .contact-tile {
    --u: min(1.25vw,11px);
  }
}

@media(max-width:767.98px) {
  .contact-hero {
    --gfs: clamp(3.4rem,18vw,8rem);
    min-height: clamp(430px,92vw,560px);
  }

  html[data-lang="ar"] .contact-hero {
    --gfs: clamp(3.4rem,17vw,7.5rem);
  }

  .contact-tiles {
    height: min(54%,300px);
    bottom: 26px;
  }

  .contact-tile {
    --u: min(1.5vw,11px);
  }
}

@media(max-width:575.98px) {
  .contact-hero {
    --gfs: clamp(3rem,19vw,5.5rem);
    min-height: clamp(400px,112vw,470px);
  }

  html[data-lang="ar"] .contact-hero {
    --gfs: clamp(3rem,18vw,5.2rem);
  }

  .contact-hero__giant {
    letter-spacing: .03em;
    gap: .18em;
  }

  html[data-lang="ar"] .contact-hero__giant {
    letter-spacing: 0;
  }

  .contact-tiles {
    height: min(56%,250px);
    bottom: 18px;
  }

  .contact-tile {
    --u: 1.65vw;
  }

  .contact-tile--extra {
    display: none;
  }
}

@media(max-width:359.98px) {
  .contact-hero {
    min-height: 390px;
  }

  .contact-tile {
    --u: 1.5vw;
  }
}

/* short landscape screens: do not let the hero be taller than the viewport */
@media(max-height:520px) and (orientation:landscape) {
  .contact-hero {
    min-height: 0;
    padding-bottom: 3rem;
  }

  .contact-tiles {
    height: 46%;
  }
}

@media(prefers-reduced-motion:reduce) {
  .contact-hero__bg,
  .contact-char,
  .contact-tile {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .contact-char {
    -webkit-text-fill-color: transparent;
  }
}

/* ---------- details + form on a dark page (Bootstrap grid: 5 / 7 columns, stacked on tablet and phone) ---------- */
:root {
  --ct-bg: #0a2540;
  --ct-line: rgba(255,255,255,.1);
  --ct-glass: rgba(11,43,66,.88);
  --ct-teal: #00D1B2;
  --ct-cyan: #00C2FF;
  --ct-ease: cubic-bezier(.22,1,.36,1);
  --rd: 0s;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

@supports (overflow:clip) {
  html,
  body {
    overflow-x: clip;
  }
}

body {
  background: var(--ct-bg);
  color: #fff;
  font-family: 'Montserrat','Cairo',system-ui,sans-serif;
}

img,
svg,
iframe {
  max-width: 100%;
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.contact-dark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.6rem,4vw,3rem) 0 clamp(3rem,7vw,5.5rem);
  background: #f4f9ff;
}

.contact-dark::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  width: min(900px,120%);
  height: 420px;
  margin-left: calc(min(900px,120%) / -2);
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(50% 60% at 50% 0%,rgba(0,194,255,.2),rgba(0,209,178,.08) 55%,transparent 75%);
}

/* contact cards */
.contact-info {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: .85rem;
}

.contact-card {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--ct-line);
  border-radius: 18px;
  background: #0f2f52;
  transition: transform .4s var(--ct-ease),border-color .3s,background .3s;
}

.contact-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,209,178,.45);
  background: #16385f;
}

.contact-card__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 14px;
  background: rgba(0,209,178,.16);
  transition: background .3s;
}

.contact-card:hover .contact-card__icon {
  background: #0a2540;
}

.contact-card__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--ct-teal);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-card__text {
  flex: 1;
  min-width: 0;
}

.contact-card h3 {
  margin: 0 0 .25rem;
  font-size: 1.02rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.contact-card p {
  margin: 0;
  font-size: .9rem;
  line-height: 1.7;
  color: rgba(255,255,255,.62);
  overflow-wrap: anywhere;
}

.contact-card a {
  color: inherit;
  text-decoration: none;
}

.contact-card a:hover {
  color: var(--ct-teal);
}

.contact-go {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ct-line);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  transition: background .3s,border-color .3s,transform .3s;
}

.contact-go svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[dir="rtl"] .contact-go svg {
  transform: scaleX(-1);
}

.contact-card .contact-go:hover {
  background: var(--ct-teal);
  border-color: var(--ct-teal);
  transform: rotate(45deg);
}

.contact-card .contact-go:hover svg {
  stroke: #06232a;
}

/* form panel */
.contact-panel {
  height: 100%;
  padding: 1.65rem;
  border: 1px solid var(--ct-line);
  border-radius: 22px;
  background: rgb(15 47 82);
}

.contact-form input,
.contact-form textarea,
.contact-news input {
  display: block;
  width: 100%;
  border: 1px solid var(--ct-line);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  padding: .95rem 1.1rem;
  font: inherit;
  font-size: .95rem;
  color: #fff;
  outline: 0;
  transition: border-color .3s,background .3s;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder,
.contact-news input::placeholder {
  color: rgba(255,255,255,.5);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-news input:focus {
  border-color: var(--ct-teal);
  background: rgba(255,255,255,.07);
}

.contact-form textarea {
  min-height: 210px;
  resize: vertical;
}

html[dir="rtl"] .contact-form input[type="tel"] {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .contact-form input[type="tel"]::placeholder {
  text-align: right;
}

.contact-form__submit {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: auto;
  border: 1px solid #1c7c97;
  border-radius: 6px;
  padding: .55rem 1.7rem;
  font: inherit;
  font-weight: 500;
  font-size: 1.02rem;
  color: #fff;
  background: #00c8e270;
  box-shadow: 0 10px 30px -10px rgb(82 82 82);
  cursor: pointer;
  transition: transform .4s var(--ct-ease),box-shadow .4s var(--ct-ease),background .3s,border-color .3s,color .3s;
}

.contact-form__submit:hover {
  color: #fff;
  background: #087fae;
  border-color: #0690c1;
  transform: translateY(-3px);
  box-shadow: 0 18px 38px -10px rgb(26 41 63);
}

.contact-form__submit::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg,transparent,rgba(255,255,255,.45),transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}

.contact-form__submit:hover::before {
  animation: contact-shine .9s var(--ct-ease);
}

@keyframes contact-shine {
  to {
    left: 140%;
  }
}

.contact-form .col-12:has(>.contact-form__submit) {
  text-align: right;
}

.contact-news__form .contact-form__submit {
  order: 2;
}

html[dir="rtl"] .contact-form .col-12:has(>.contact-form__submit) {
  text-align: left;
}

html[dir="rtl"] .contact-news__form .contact-form__submit {
  order: 2;
}

.contact-form__success {
  display: none;
  color: #35e0a4;
  font-weight: 600;
  padding: .2rem .3rem;
}

/* newsletter + map */
.contact-news {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.2rem;
  padding: 1.3rem 1.5rem;
  border: 1px solid var(--ct-line);
  border-radius: 18px;
  background: linear-gradient(45deg, #0c2a46, #193656);
}

.contact-news__text {
  flex: 1 1 260px;
}

.contact-news h3 {
  margin: 0 0 .3rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.contact-news p {
  margin: 0;
  font-size: .92rem;
  line-height: 1.7;
  color: rgba(255,255,255,.72);
}

.contact-news__form {
  flex: 1 1 360px;
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.contact-news__form input {
  flex: 1 1 200px;
  width: auto;
}

.contact-news__form .contact-form__submit {
  flex: 0 0 auto;
}

.contact-map {
  height: clamp(260px,36vw,380px);
  border: 1px solid var(--ct-line);
  border-radius: 20px;
  overflow: hidden;
}

.contact-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(.35) contrast(1.05) brightness(.9);
}

/* entrance: fade up, one after another (only when the script has switched it on) */
.contact-ready [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
}

.contact-ready [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity .8s var(--ct-ease) var(--rd),transform .9s var(--ct-ease) var(--rd),border-color .3s,background .3s;
}

.contact-ready .contact-card.is-in:hover {
  transform: translateY(-3px);
  transition-delay: 0s;
}

@media(max-width:991.98px) {
  .contact-info {
    grid-template-columns: 1fr;
  }

  .contact-form textarea {
    min-height: 170px;
  }
}

@media(max-width:575.98px) {
  .contact-card {
    padding: .9rem;
    gap: .8rem;
  }

  .contact-card__icon {
    width: 46px;
    height: 46px;
  }

  .contact-go {
    width: 36px;
    height: 36px;
  }

  .contact-news {
    padding: 1.1rem;
  }

  .contact-news__form .contact-form__submit {
    width: 100%;
  }
}

@media(prefers-reduced-motion:reduce) {
  .contact-card,
  .contact-form__submit,
  .contact-go {
    transition: none;
  }
}

.contact-card h3.ltr,
.contact-card p.ltr {
  display: block;
  text-align: start;
}

html[dir="rtl"] .contact-card h3.ltr,
html[dir="rtl"] .contact-card p.ltr {
  text-align: end;
}

/* hero height identical to the Our Clients page (desktop only; phones and tablets keep their own heights) */
@media(min-width:992px) {
  .contact-hero {
    min-height: clamp(520px,41vw,760px);
  }
}

/* contact form: labels, organisation/service selects, validation message */
.contact-form__label {
  display: block;
  margin: 0 0 .4rem;
  padding: 0 .2rem;
  font-size: .88rem;
  font-weight: 600;
  color: #fff;
}

.contact-form__label b {
  color: var(--ct-teal);
  margin-inline-start: 2px;
}

.contact-form select {
  display: block;
  width: 100%;
  border: 1px solid var(--ct-line);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  padding: .95rem 1.1rem;
  font: inherit;
  font-size: .95rem;
  color: #fff;
  outline: 0;
  transition: border-color .3s,background .3s;
}

.contact-form select:focus {
  border-color: var(--ct-teal);
  background: rgba(255,255,255,.07);
}

.contact-form select option {
  color: #0A2540;
  background: #fff;
}

.contact-form textarea {
  min-height: 140px;
}

.contact-form__error {
  display: none;
  color: #ff9b9b;
  font-weight: 600;
  padding: .2rem .3rem;
}

.contact-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 16px;
  background-position: right 1.1rem center;
  padding-inline-end: 2.8rem;
  cursor: pointer;
}

html[dir="rtl"] .contact-form select {
  background-position: left 1.1rem center;
}

/* phone / email / website stay on one line */
.contact-card h3.ltr,
.contact-card p.ltr {
  white-space: nowrap;
  overflow-wrap: normal;
}

@media(min-width:992px) {
  .contact-card h3.ltr {
    font-size: clamp(.8rem,1.3vw,1.02rem);
  }

  .contact-card p.ltr {
    font-size: clamp(.76rem,1.1vw,.9rem);
  }
}

html[data-lang="ar"] body {
  font-family: 'Cairo', 'Montserrat', system-ui, sans-serif;
}
