/* Qala layer on top of the Yohaku hero: local fonts, Arabic (RTL), phone menu, the describe-it box. */

@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-400-600.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
/* lane 1: a local fallback with Inter's metrics, so the swap to Inter moves nothing (CLS) */
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Helvetica"); ascent-override: 90.2%; descent-override: 22.48%; line-gap-override: 0%; size-adjust: 107.4%; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --accent: #b48e52; /* Qala gold */
  --font: "Inter", "Inter Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[lang="ar"] { --font: "Plex Arabic", "Inter", "Inter Fallback", Tahoma, sans-serif; }

body, .btn, .tf-word, .brand, h1, .ask-field textarea, .ask-go, .chip, .lang, .menu { font-family: var(--font); }
h1 { font-weight: 600; letter-spacing: -0.035em; }
.brand { font-weight: 500; letter-spacing: -0.01em; }
[lang="ar"] h1 { letter-spacing: 0; line-height: 1.15; font-weight: 600; }
[lang="ar"] .brand, [lang="ar"] .tf-word, [lang="ar"] .eyebrow { letter-spacing: 0; }
[lang="ar"] .tf-word { text-transform: none; }

.brand-mark { object-fit: contain; }

/* ---------- nav ---------- */
.nav-end { gap: .75rem; }
.lang {
  min-height: 2.75rem; height: 2.75rem; line-height: 1; /* lane 1: the Arabic web font arriving must not change the nav height (CLS) */ padding: 0 .875rem; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink); font-size: .9375rem; font-weight: 500; cursor: pointer;
}
.lang:hover { background: rgb(18 18 18 / .05); }
/* lane 1: on English pages the only Arabic text is the language button: a 3 kB subset (just «عربي») instead of
   two 45 kB Arabic fonts in the first view */
@font-face { font-family: "Plex Arabic Button"; src: url("../fonts/plex-arabic-500-lang-button.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
:root[lang="en"] .lang, :root[lang="en"] .ft-lang.ft-lang { font-family: "Plex Arabic Button", "Plex Arabic", sans-serif; }
.btn-nav .btn-text { position: relative; }
.btn-nav { color: var(--bg); }

.menu-btn {
  display: none; position: relative; width: 2.75rem; height: 2.75rem; border: 1px solid var(--line);
  border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer;
}
.menu-btn span { position: absolute; inset-inline: .8rem; height: 1.6px; border-radius: 2px; background: currentColor; transition: transform .3s var(--ease), top .3s var(--ease); }
.menu-btn span:first-child { top: 1.05rem; }
.menu-btn span:last-child { top: 1.5rem; }
.menu-btn[aria-expanded="true"] span:first-child { top: 1.3rem; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 1.3rem; transform: rotate(-45deg); }

.menu {
  position: absolute; z-index: 20; inset-inline: var(--gutter); top: 4.5rem; display: grid; gap: .25rem;
  padding: .75rem; border: 1px solid var(--line); border-radius: 1.25rem; background: #fff;
  box-shadow: 0 20px 50px rgb(18 18 18 / .14);
}
.menu[hidden] { display: none; }
.menu ul { margin: 0; padding: 0; list-style: none; display: grid; }
.menu a { display: block; padding: .85rem 1rem; border-radius: .75rem; font-size: 1.0625rem; color: var(--ink); }
.menu a:hover { background: rgb(18 18 18 / .05); }
.menu-cta { margin-top: .25rem; text-align: center; background: var(--ink); color: var(--bg) !important; font-weight: 500; }
.hero { position: relative; }

/* ---------- describe-it box ---------- */
.ask { display: grid; justify-items: center; gap: .7rem; width: min(100%, 46rem); }
.ask-label { font-size: 1rem; color: var(--muted); text-align: center; }
.ask-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; max-width: 100%; min-height: 2.25rem; /* lane 1: one row of chips reserved before JS fills it (CLS) */ }
.chip {
  min-height: 2.25rem; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 999px; background: rgb(255 255 255 / .6);
  color: var(--ink); font-size: .9rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.chip:hover { border-color: rgb(18 18 18 / .3); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.ask-field {
  display: flex; align-items: flex-end; gap: .5rem; width: 100%; padding: .4rem; padding-inline-start: 1.1rem;
  border: 1px solid var(--line); border-radius: 1.6rem; background: #fff;
  box-shadow: 0 1px 0 rgb(18 18 18 / .04), 0 12px 32px rgb(18 18 18 / .08);
  transition: box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.ask-field:focus-within { border-color: rgb(18 18 18 / .35); box-shadow: 0 0 0 4px rgb(180 142 82 / .2), 0 12px 32px rgb(18 18 18 / .08); }
.ask-icon { width: 1.15rem; height: 1.15rem; flex: none; align-self: center; color: var(--accent); }
.ask-field textarea {
  flex: 1; min-width: 0; min-height: 2.75rem; max-height: 7.6rem; padding: .7rem 0; border: 0; outline: 0; resize: none;
  background: transparent; color: var(--ink); font-size: 1.0625rem; line-height: 1.4; overflow-y: auto;
}
.ask-field textarea::placeholder { color: #8f8b82; }
/* lane 1: phones show the rotating example on two lines; reserve them so the box never grows after load (CLS) */
@media (max-width: 760px) { .ask-field textarea { min-height: calc(2 * 1.0625rem * 1.4 + 1.4rem); } }
.ask-field textarea[aria-invalid="true"]::placeholder { color: #b4533f; }
.ask-go {
  display: inline-flex; align-items: center; gap: .5rem; height: 2.75rem; padding: 0 1.25rem; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 1rem; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: transform .4s var(--ease-hover);
}
.ask-go svg { width: 1rem; height: 1rem; }
[dir="rtl"] .ask-go svg { transform: scaleX(-1); }
.ask-go:active { transform: scale(.96); }
.ask-meta { display: flex; justify-content: center; gap: 1rem; width: 100%; margin: 0; padding-inline: 1.1rem; font-size: .875rem; color: var(--muted); }
.ask-count { font-variant-numeric: tabular-nums; }
.ask-error { margin: 0; font-size: .9rem; color: #a4402c; }
.ask-saved {
  width: 100%; padding: 1rem 1.25rem; border-radius: 1.25rem; background: #fff; border: 1px solid rgb(180 142 82 / .45);
  text-align: start; outline: none;
}
.ask-saved-title { margin: 0 0 .25rem; font-weight: 600; }
.ask-saved-text, .ask-saved-echo { margin: 0; font-size: .9375rem; color: var(--muted); }
.ask-saved-echo { margin-top: .5rem; color: var(--ink); }
.ask-edit { margin-top: .6rem; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 500; text-decoration: underline; cursor: pointer; }
.ask.is-saved .ask-chips, .ask.is-saved .ask-field, .ask.is-saved .ask-meta, .ask.is-saved .ask-error { display: none; }
.ask-alt { margin: 0; font-size: .9375rem; color: var(--muted); }
.ask-alt .link-arrow { min-height: 2rem; color: var(--ink); }
.ask-alt .link-arrow::before, .ask-alt .link-arrow::after { bottom: .375rem; }

/* the tunnel does not open pages yet, so the pointer stays a hand-for-dragging */
.tf-root[data-tf-hover] .tf-bl { color: var(--ink); }
.tf-root[data-tf-hover]:not([data-dragging]) { cursor: pointer; }
.stage .tf-bl { max-width: calc(70% - var(--tf-pad)); }
/* the fixed Ask Qala button sits on the inline-end corner: that corner word moves inward past it */
html:not([dir="rtl"]) .tf-root .tf-br { right: max(var(--tf-pad), var(--qa-clear, 0px)); }
[dir="rtl"] .tf-root .tf-bl { left: max(var(--tf-pad), var(--qa-clear, 0px)); }
[dir="rtl"] .stage .tf-bl { max-width: calc(70% - var(--qa-clear, var(--tf-pad))); }

/* picture labels: a short word above each card, placed every frame by the tunnel engine (transform, size, opacity) */
.tf-labels { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.tf-label {
  position: absolute; left: 0; top: 0; width: max-content; text-align: center; line-height: 1.12;
  font-family: var(--font); font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); will-change: transform, opacity;
}
.tf-label::before { /* a small gold tick ties the word to its picture */
  content: ""; display: block; width: 1.6em; height: 2px; margin: 0 auto .55em; border-radius: 1px; background: var(--accent);
}
.tf-label[hidden] { display: none; }
[lang="ar"] .tf-label { letter-spacing: 0; text-transform: none; font-weight: 600; }

/* the line under the client logos: what the pictures are for */
.tf-pick {
  position: absolute; z-index: 2; left: 50%; bottom: calc(var(--tf-band) / 2); transform: translate(-50%, 50%);
  max-width: min(36rem, calc(100% - 2 * var(--tf-pad))); margin: 0; text-align: center; pointer-events: none;
  font-family: var(--font); font-size: max(.8125rem, min(1.05cqw, 1rem)); line-height: 1.35; color: var(--muted);
}
@media (max-width: 760px) {
  /* phone cards are narrow: tighter letters so the word fits its picture */
  .tf-label { letter-spacing: .01em; text-transform: none; }
  .tf-label::before { width: 1.3em; height: 1.5px; margin-bottom: .45em; }
  /* the hint sits between the logos and the corner words, which share the bottom edge on a phone */
  .tf-pick { bottom: calc(var(--tf-band) / 2 + 1.9rem); font-size: .8125rem; max-width: calc(100% - 2 * var(--tf-pad)); }
}

/* ---------- layout ---------- */
.intro { gap: 1rem; }
@media (min-width: 1000px) and (min-aspect-ratio: 3/2), (min-width: 1000px) and (max-height: 820px) {
  .intro { gap: .9rem; padding-top: clamp(1.5rem, .5rem + 4svh, 4rem); }
  h1 { font-size: min(6rem, 8.5svh, 5.4vw); }
}
.status { white-space: nowrap; }
@media (max-width: 1560px) { .status { display: none; } }
@media (max-width: 1080px) { .links li:nth-child(n+5) { display: none; } }
@media (max-width: 760px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav > nav, .btn-nav { display: none; }
  .menu-btn { display: block; }
  .nav-contact { display: none !important; }
  .intro { gap: .75rem; padding-top: .5rem; }
  .ask-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; width: calc(100% + 2 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 1rem, #000 calc(100% - 1rem), transparent); mask-image: linear-gradient(90deg, transparent, #000 1rem, #000 calc(100% - 1rem), transparent); }
  .ask-chips::-webkit-scrollbar { display: none; }
  .ask-meta { font-size: .8125rem; }
}
@media (max-width: 480px) {
  .ask-go span { display: none; }
  .ask-go { width: 2.75rem; padding: 0; justify-content: center; }
  .ask-label { font-size: .9375rem; }
  .brand span { font-size: 1.0625rem; }
}

/* the eyebrow dot sits before the text in both directions */
.eyebrow::before { margin-right: 0; margin-inline-end: .5rem; }


/* ---------- Qala Assistant (architect avatar) ---------- */
.qa { position: fixed; z-index: 60; inset-inline-end: 1.25rem; bottom: 1.25rem; font-family: var(--font); }
.qa-fab { display: flex; align-items: center; gap: .6rem; padding: .35rem 1.1rem .35rem .35rem; border: 0; border-radius: 999px; background: #121212; color: #fff;
  box-shadow: 0 12px 34px rgb(18 18 18 / .28); cursor: pointer; font: 500 .9375rem/1 var(--font); transition: transform .3s var(--ease-hover); }
[dir="rtl"] .qa-fab { padding: .35rem .35rem .35rem 1.1rem; }
.qa-fab-face, .qa-avatar { position: relative; flex: none; display: block; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent); }
.qa-fab-face { width: 3rem; height: 3rem; }
.qa-fab-face img, .qa-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: #eee; }
.qa-online { position: absolute; inset-inline-end: 0; bottom: 0; width: .7rem; height: .7rem; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 2px #121212; }
.qa-fab:hover { transform: translateY(-2px); }
.qa.is-open .qa-fab { display: none; }
.qa-panel { width: min(24rem, calc(100vw - 2rem)); height: min(36rem, calc(100svh - 2.5rem)); display: flex; flex-direction: column; overflow: hidden;
  border-radius: 1.25rem; background: #fff; box-shadow: 0 24px 60px rgb(18 18 18 / .25); border: 1px solid var(--line); }
.qa-panel[hidden] { display: none; }
.qa-head { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; background: #121212; color: #fff; }
.qa-avatar { width: 2.75rem; height: 2.75rem; }
.qa-intro { display: grid; grid-template-columns: 5.5rem 1fr; gap: .8rem; align-items: start; max-width: 100%; padding: .7rem .9rem .7rem .7rem; }
.qa-intro img { width: 5.5rem; height: 6.875rem; object-fit: cover; border-radius: .7rem; background: #efede8; display: block; }
.qa-who { display: grid; flex: 1; } .qa-who small { color: #b9b5ac; font-size: .78rem; }
.qa-x { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgb(255 255 255 / .1); color: #fff; cursor: pointer; }
.qa-x svg { width: 1rem; height: 1rem; }
.qa-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: #f7f6f2; }
.qa-msg { max-width: 88%; padding: .7rem .9rem; border-radius: 1rem; line-height: 1.5; font-size: .9375rem; white-space: pre-line; }
.qa-bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-start-start-radius: .3rem; color: var(--ink); }
.qa-me { align-self: flex-end; background: #121212; color: #fff; border-start-end-radius: .3rem; }
.qa-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.qa-link { padding: .4rem .75rem; border-radius: 999px; background: #f2f0eb; border: 1px solid var(--line); color: var(--ink); font-size: .85rem; font-weight: 500; }
.qa-wa { background: #1f9d55; color: #fff; border-color: #1f9d55; }
.qa-typing { display: flex; gap: .3rem; } .qa-typing span { width: .45rem; height: .45rem; border-radius: 50%; background: #b9b5ac; animation: qa-b 1s infinite; }
.qa-typing span:nth-child(2) { animation-delay: .15s; } .qa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes qa-b { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
.qa-chips { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem 1rem; border-top: 1px solid var(--line); scrollbar-width: none; }
.qa-chip { flex: none; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: 500 .82rem/1.2 var(--font); cursor: pointer; white-space: nowrap; }
.qa-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); }
.qa-in { flex: 1; min-width: 0; height: 2.75rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: 999px; font: 400 .9375rem var(--font); outline: none; }
.qa-in:focus { border-color: rgb(18 18 18 / .4); }
.qa-send { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border: 0; border-radius: 50%; background: #121212; color: #fff; cursor: pointer; }
.qa-send svg { width: 1rem; height: 1rem; } [dir="rtl"] .qa-send svg { transform: scaleX(-1); }
@media (max-width: 480px) { .qa-fab-label { display: none; } .qa-fab { padding: .3rem; } .qa { inset-inline-end: .9rem; bottom: .9rem; } }
@media (prefers-reduced-motion: reduce) { .qa-typing span { animation: none; } }

/* sentence completion in the hero box (js/ask-complete.js) */
.ask-input { position: relative; flex: 1; min-width: 0; display: flex; }
.ask-input textarea { width: 100%; }
.ask-input textarea { position: relative; z-index: 1; }
.ask-ghost { position: absolute; inset: 0; padding: .7rem 0; text-align: start; font-size: 1.0625rem; line-height: 1.4; color: #a9a49b; white-space: pre-wrap; overflow-wrap: anywhere; overflow: hidden; pointer-events: none; }
.ask-ghost span { color: transparent; }
.ask-ghost[hidden] { display: none; }
.ask-sug { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: .6rem; }
.ask-sug:empty { display: none; }
.ask-sug-chip { min-height: 2.5rem; padding: .45rem .9rem; border: 1px dashed rgb(18 18 18 / .22); border-radius: 999px; background: rgb(255 255 255 / .8); color: var(--ink); font: .875rem/1.3 var(--font); cursor: pointer; text-align: start; max-width: 100%; }
.ask-sug-chip:hover, .ask-sug-chip:focus-visible { border-style: solid; border-color: var(--ink); outline: none; }
.ask.is-saved .ask-sug { display: none; }
/* assistant answers with paragraphs, lists and links (js/assistant.js fmt) */
.qa-msg.qa-bot:not(.qa-intro):not(.qa-typing) { white-space: normal; }
.qa-msg p { margin: 0 0 .55rem; } .qa-msg p:last-child { margin-bottom: 0; }
.qa-msg ul { margin: .2rem 0 .55rem; padding-inline-start: 1.1rem; } .qa-msg li { margin: .15rem 0; }
.qa-msg a:not(.qa-link) { color: inherit; text-decoration: underline; text-decoration-color: rgb(180 142 82 / .7); text-underline-offset: 2px; font-weight: 500; }
.qa-link.qa-3d { background: var(--ink); color: #fff; border-color: var(--ink); }

/* tablets: one scrolling row of chips as on phones, so the row count never changes when the font arrives (CLS at 768) */
@media (min-width: 761px) and (max-width: 1080px) { .ask-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; width: calc(100% + 2 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 1rem, #000 calc(100% - 1rem), transparent); mask-image: linear-gradient(90deg, transparent, #000 1rem, #000 calc(100% - 1rem), transparent); } }

/* the narrowest phones: name, language and menu button still fit one row (the button was cut off at 320 px) */
@media (max-width: 359.98px) {
  .nav { gap: .75rem; padding-inline: 1rem; }
  .brand { gap: .5rem; font-size: 1.0625rem; }
  .nav-end { gap: .5rem; }
  .lang { padding: 0 .7rem; }
}

/* small desktops: the eight links, the language and "Book a visit" on one row, none cut off (the button left the
   screen from 1081 to about 1180 px) */
@media (min-width: 1081px) and (max-width: 1279.98px) {
  .nav { grid-template-columns: auto 1fr auto; gap: .75rem; padding-inline: 1.5rem; }
  .nav > nav { justify-self: center; }
  .links { gap: 0; }
  .links a { padding-inline: .5rem; font-size: .9375rem; }
}
