/* Page CSS: only what sits inside a visual and the kit lacks (the kit's system.css owns the rest). */

/* the wordmark: the client's own, Khayt in capitals with its Arabic name set above the line */
.nav__logo { gap: 8px; }
.logo-en { font-family: "Outfit", var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: .16em; text-transform: uppercase; }
.logo-ar { font-family: "Aref Ruqaa", "Geeza Pro", serif; font-weight: 400; font-size: 30px; line-height: 1; color: var(--accent); position: relative; top: -7px; letter-spacing: 0; }
/* a frame that holds UI on the lit ground: the ground only, the fragment keeps its own colours */
.frame--ground { background: var(--ground-bg); border-color: transparent; }

/* hero window: the agent console (centred hero) */
.d-win { background: #17191c; color: #eceef0; border-radius: 12px; overflow: hidden; font: 400 14px/1.4 var(--font-text);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .08), 0 30px 70px -30px rgb(0 0 0 / .8); text-align: left; }
.d-win__bar { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-bottom: 1px solid rgb(255 255 255 / .07); font-size: 13px; color: #9aa0a6; }
.d-win__bar b { color: #eceef0; font-weight: 500; }
.d-win__bar .sp { flex: 1; }
.d-win__dots { display: flex; gap: 6px; }
.d-win__dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3e43; }
.d-win__body { display: grid; grid-template-columns: 250px 1fr; min-height: 420px; }
.inbox { border-right: 1px solid rgb(255 255 255 / .07); padding: 10px; display: grid; align-content: start; gap: 2px; }
.inbox .q { height: 34px; margin-bottom: 6px; border-radius: 9px; background: rgb(255 255 255 / .06); display: flex; align-items: center; padding: 0 10px; color: #8d9399; font-size: 13px; }
.inbox .t { display: grid; grid-template-columns: 30px 1fr auto; gap: 1px 10px; padding: 9px 8px; border-radius: 9px; font-size: 13px; }
.inbox .t.is-on { background: rgb(255 255 255 / .07); }
.inbox .t i { grid-row: 1 / span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 13px/1 var(--font-text); font-style: normal; color: #0c0d0f; }
.inbox .t b { font-weight: 500; color: #eceef0; }
.inbox .t time { color: #8d9399; font-size: 13px; }
.inbox .t span { grid-column: 2 / -1; color: #8d9399; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo { display: grid; min-width: 0; align-content: start; }
.d-chat { display: grid; gap: 8px; align-content: start; padding: 10px 18px 14px; font-size: 14px; }
.d-msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; line-height: 1.45; }
.d-msg--me { justify-self: end; background: #f2f2f0; color: #121314; border-bottom-right-radius: 6px; }
.d-msg--bot { max-width: 86%; background: #22262b; color: #e9ecee; border-bottom-left-radius: 6px; }
.d-msg small { display: inline; margin-left: 8px; font-size: 13px; opacity: .7; white-space: nowrap; }
.d-tool { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #9aa0a6; }
.d-tool::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; }
.acts { display: flex; gap: 8px; }
.acts span { height: 30px; padding: 0 12px; border-radius: 8px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; background: #f2f2ee; color: #0a0a0a; }
.acts span + span { background: #26282b; color: #e9ecee; }
@media (max-width: 639px) {
  .d-win__body { grid-template-columns: 1fr; }
  .inbox, .d-win__bar .sp ~ span, .d-msg--bot small, .d-tool { display: none; }
  .d-chat { font-size: 13px; padding: 12px 14px; }
}

/* app-frame: one window across the wrap, the queue beside the open case (sections-library.md) */
.app.ui { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: var(--s-7); background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); box-shadow: var(--u-shadow); }
.app > .app__pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.app > .app__pane + .app__pane { border-left: 1px solid var(--u-line); }
.app > .app__pane > .ui-panel { width: 100%; border: 0; border-radius: 0; box-shadow: none; }
.app > .app__pane::after { content: ""; position: absolute; inset: auto 0 0 0; height: 64px; background: linear-gradient(transparent, var(--u-bg)); pointer-events: none; }
@media (min-width: 1024px) and (max-width: 1279px) { .app.ui { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
@media (max-width: 1023px) {
  .app.ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app > .app__pane--list { max-height: 252px; }
  .app > .app__pane--list::after { display: none; }
  .app .ui-win__side { display: none; }
  .app .ui-win__body { grid-template-columns: minmax(0, 1fr); }
  .app > .app__pane + .app__pane { border-left: 0; border-top: 1px solid var(--u-line); }
}
@media (max-width: 639px) {
  .app.ui { grid-template-rows: minmax(0, 1fr); }
  .app > .app__pane--list { display: none; }
  .app > .app__pane + .app__pane { border-top: 0; }
}

/* one panel height per card group */
.cards-3 .panel { --p-h: 336px; }
.nav__menu .menu-card .panel { --p-h: 160px; }
@media (max-width: 639px) { .cards-3 .panel { --p-h: 200px; } }

/* a diagram on a lit panel of the dark page: its captions take the lit ground's ink */
.card .panel > .dg .dg-cap { --dg-ink: var(--ground-ink); --dg-muted: var(--ground-muted); color: var(--ground-muted); }

/* text people read keeps 7:1 on this palette (the palette's muted is for labels) */
.hero .hero__lead, section[data-moment] .mo-la__sub, main .t-lead, .section-head > p { color: color-mix(in oklab, var(--ink) 86%, var(--bg)); }


/* three cards stay three across from 1024, so no card stands alone on a row */
@media (min-width: 1024px) and (max-width: 1279px) { .cards-3 > .card { grid-column: auto / span 4; } }
/* tablet: the card groups take two screens */
@media (min-width: 640px) and (max-width: 1023px) { #services, #approach { --h: 2; } }
/* phone: a split keeps its heading, its lines and its picture; the fact rows are the desktop's */
@media (max-width: 639px) { .rows--desk { display: none; } }

/* a FAQ that continues in a second group: its first row keeps the list's rhythm */
.faq--cont > .faq__item:first-child { padding-top: var(--s-5); }
/* the pause disc on the lit hero frame: a focus ring that reads on the light ground */
.hero__window .loop-pause:focus-visible { outline: 2px solid #0a0a0a; outline-offset: 2px; }
/* phone: a three-question FAQ fits one screen without its intro line */
@media (max-width: 639px) { .faq-short .span-5 > p { display: none; } }
.cards-2x2 .panel { --p-h: 300px; }
.cards-6 .panel { --p-h: 250px; }
@media (max-width: 639px) { .cards-2x2 .panel, .cards-6 .panel { --p-h: 200px; } }

/* the contact form's panel and the legal pages' list, inside the hero's right column */
.contact-card { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-7); align-self: start; }
.contact-card textarea { min-height: 112px; resize: vertical; }
.legal .faq { align-self: start; }
@media (max-width: 639px) { .contact-card { padding: var(--s-5); } }

.contact-card .form { grid-template-columns: minmax(0, 1fr); }
.cards-6 .card--row > p { min-height: 4lh; }
@media (max-width: 1023px) { .cards-6 .card--row > p { min-height: 0; } }

/* any control inside the hero's console keeps a ring that reads on the dark window and on the lit ground */
.hero__window :is(button, .loop-pause, .ui-pause):focus-visible { outline: 2px solid #f2f2f0; outline-offset: 2px; box-shadow: 0 0 0 5px #0a0a0a; }
/* phone: the statement fills its screen; the card groups fill their two */
@media (max-width: 639px) {
  #services .panel { --p-h: 222px; }
  #approach .panel { --p-h: 270px; }
}

/* phone: the FAQ shows its first three questions on one screen */
@media (max-width: 639px) { .faq-more .faq__item:last-child { display: none; } .faq-more .faq__item:first-child { border-bottom: 0; } }

.hero-copy > .pill { align-self: flex-start; width: max-content; max-width: 100%; }

/* the lit ground in the black and white palette: a neutral bone, no tint */
html[data-ground] { --ground-bg: #e6e6e1; --ground-surface: #f2f2ee; --ground-ink: #111111; --ground-muted: #55554f; --ground-accent: #111111; }

/* the particle globe (globe.js draws the canvas): the heading top left, the line and its button bottom right */
.globe { position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(120% 55% at 50% 108%, #1f6f55 0%, #123a44 38%, transparent 72%) var(--bg); }
.globe > canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.globe > .wrap { position: relative; z-index: 1; height: 100%; pointer-events: none; }
.globe h2 em { display: block; font-weight: 400; }
.globe__foot { position: absolute; inset: auto 0 0 0; }
.globe__close { display: grid; gap: var(--s-5); justify-items: start; }
.globe__close .btn { pointer-events: auto; }

/* ---------------------------------------------------------------- Arabic (the /ar/ pages, html lang="ar" dir="rtl")
   The kit is written left to right; these lines turn what does not follow dir="rtl" by itself. Flex and grid rows,
   grid line numbers (span-6 start-7) and text alignment flip on their own. */
/* the Arabic text face first; Latin product names inside Arabic lines fall back to it too */
:root[lang="ar"] { --font-display: "IBM Plex Sans Arabic", "Instrument Sans", system-ui, sans-serif; --font-text: "IBM Plex Sans Arabic", "Instrument Sans", system-ui, sans-serif;
  --display-tracking: 0; --display-tracking-xl: 0; --display-stretch: 100%; }
:root[lang="ar"] .ui { --ui-font: "IBM Plex Sans Arabic", system-ui, sans-serif; text-align: right; }
/* Arabic is joined script: no tracking anywhere (the Latin wordmark keeps its own) */
:root[lang="ar"] body :not(.logo-en) { letter-spacing: 0 !important; }
/* taller lines for Arabic's ascenders and marks */
:root[lang="ar"] :is(h1, .t-h1) { line-height: 1.3; }
:root[lang="ar"] .hero h1 { line-height: 1.25; }
:root[lang="ar"] :is(h2, .t-h2) { line-height: 1.35; }
:root[lang="ar"] :is(h3, .t-h3) { line-height: 1.4; }
:root[lang="ar"] .footer__lede { line-height: 1.5; }
/* Arabic has no italic: a browser would only slant it; emphasis keeps the lighter weight alone */
:root[lang="ar"] :is(em, i, cite) { font-style: normal; }

/* the header: the main button and the menu button go to the inline end (the left) */
@media (max-width: 1023px) {
  [dir="rtl"] .nav__toggle { margin-left: 0; margin-right: auto; }
  [dir="rtl"] .nav:not(.is-open) .nav__actions { margin-left: 0; margin-right: auto; }
  [dir="rtl"] .nav:not(.is-open) .nav__actions + .nav__toggle { margin-right: 0; }
  [dir="rtl"] .nav.is-open .nav__link[aria-current="page"]::after { left: auto; right: 0; }
}
/* the hover line draws from the start of the word (the right) and leaves to the left */
[dir="rtl"] .nav__link::before { transform-origin: left; }
[dir="rtl"] :is(.nav__link:hover, .nav__link:focus-visible, .nav__item:hover > .nav__link, .nav__item:focus-within > .nav__link)::before { transform-origin: right; }

/* arrows point the way Arabic reads */
[dir="rtl"] :is(.m-arrow, .card__link svg) { transform: scaleX(-1); }
@media (hover: hover) and (pointer: fine) { [dir="rtl"] .card__link:hover svg { transform: scaleX(-1) translateX(2px); } }
[dir="rtl"] .link::after { content: "\2190"; }
@media (hover: hover) and (pointer: fine) { [dir="rtl"] .link:hover::after { transform: translateX(-3px); } }

/* the hero console and the UI pictures: bubbles keep their tail on the speaker's side, hairlines on the inner edge */
[dir="rtl"] .d-win { text-align: right; }
[dir="rtl"] .inbox { border-right: 0; border-left: 1px solid rgb(255 255 255 / .07); }
[dir="rtl"] .d-msg--me { border-bottom-right-radius: 16px; border-bottom-left-radius: 6px; }
[dir="rtl"] .d-msg--bot { border-bottom-left-radius: 16px; border-bottom-right-radius: 6px; }
[dir="rtl"] .d-msg small { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .d-tool::before { border-right-color: currentColor; border-left-color: transparent; }
[dir="rtl"] .ui-msg--me { border-radius: 14px 14px 14px 4px; }
[dir="rtl"] .ui-checks__bar i { transform-origin: right; }
[dir="rtl"] .ui-check__label::after { transform-origin: right; }
/* a piece anchored in a corner sits in the top-right one and is cut by the left and bottom edges */
@media (min-width: 640px) {
  [dir="rtl"] .stage > .at-corner { left: auto; right: var(--ax, 32px); }
  [dir="rtl"] .stage--fade-br {
    -webkit-mask: linear-gradient(to bottom, #000 calc(100% - var(--fade-h)), transparent calc(100% - 4px)), linear-gradient(to left, #000 calc(100% - 72px), transparent calc(100% - 4px));
    mask: linear-gradient(to bottom, #000 calc(100% - var(--fade-h)), transparent calc(100% - 4px)), linear-gradient(to left, #000 calc(100% - 72px), transparent calc(100% - 4px));
    -webkit-mask-composite: source-in; mask-composite: intersect;
  }
}
/* a diagram is drawn by coordinates: it keeps the left-to-right box it was measured in */
[dir="rtl"] .dg { direction: ltr; }
