/* KAS Contractors. One stylesheet for both directions: logical properties only (inline-start/end),
   so the Arabic pages mirror without a second file. Directional glyphs flip under [dir="rtl"]. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-latin);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[lang="ar"] body, body:lang(ar) { font-family: var(--font-arabic); line-height: 1.8; }
/* Arabic letters must join: no tracking anywhere inside Arabic text. */
[lang="ar"], [lang="ar"] * { letter-spacing: 0 !important; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3 { font-weight: 700; line-height: 1.4; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
/* On the dark bands the accent ink is about 2.6:1: use the light accent there. */
.hero :focus-visible, .cta-band :focus-visible, .site-footer :focus-visible { outline-color: #E9B58F; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--ground); padding: 10px 14px; border-radius: 6px; text-decoration: none; }
.skip:focus { top: 12px; }
[dir="rtl"] .arrow { transform: scaleX(-1); }

/* ---------- buttons, labels ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  background: var(--accent-ink); color: var(--surface);
  font-weight: 500; font-size: 1rem; text-decoration: none;
  padding: .85em 1.4em; border-radius: 999px; border: 1px solid var(--accent-ink);
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); }
.btn--small { padding: .5em 1.05em; font-size: .9375rem; }
.btn--light { background: var(--surface); color: var(--ink); border-color: var(--surface); }
.btn--light:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn--ghost-light { background: transparent; color: var(--surface); border-color: rgba(251, 248, 243, .55); }
.btn--ghost-light:hover { background: rgba(251, 248, 243, .12); border-color: var(--surface); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: .8125rem; font-weight: 500; text-transform: uppercase; letter-spacing: .16em;
  color: var(--accent-ink); margin-bottom: 1.1rem;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); flex: none; }
[lang="ar"] .eyebrow { font-size: .9375rem; font-weight: 600; }
.lead { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); color: var(--muted); max-width: 38em; margin-top: 1.2rem; }
.note { color: var(--muted); font-size: .9375rem; margin-top: 2rem; padding-inline-start: 14px; border-inline-start: 2px solid var(--accent); }
.more-link { margin-top: 2rem; }
.more-link a { display: inline-flex; align-items: center; gap: .5em; font-weight: 500; color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(243, 238, 230, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex: none; }
.brand__mark { width: 36px; height: 36px; border-radius: 8px; }
.brand__name { font-size: 1.125rem; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.brand__name b { font-weight: 700; }
[lang="ar"] .brand__name { font-weight: 700; font-size: 1.25rem; text-transform: none; }
.brand--light { color: var(--surface); }

.nav { margin-inline-start: auto; }
.nav__list { display: flex; gap: 4px; }
.nav__list a { display: block; padding: 8px 12px; border-radius: 999px; text-decoration: none; font-size: .9688rem; color: var(--ink); }
.nav__list a:hover { background: rgba(31, 29, 27, .06); }
.nav__list a[aria-current="page"] { color: var(--accent-ink); font-weight: 600; }
.site-header__actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { font-size: .9375rem; text-decoration: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; }
.lang-switch:hover { border-color: var(--ink); }
.lang-switch[lang="ar"] { font-family: var(--font-arabic); }
.lang-switch[lang="en"] { font-family: var(--font-latin); }

.menu { position: static; display: none; }
.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line); }
.menu summary::-webkit-details-marker { display: none; }
.menu__bars { width: 18px; height: 2px; background: var(--ink); box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink); }
.menu[open] .menu__bars { box-shadow: none; transform: rotate(45deg); }
.menu[open] .menu__bars::after { content: ""; display: block; width: 18px; height: 2px; background: var(--ink); transform: rotate(-90deg); }
.menu__label { font-size: .9375rem; }
.menu__panel { position: absolute; inset-inline: 0; top: 100%; background: var(--ground); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 24px; box-shadow: 0 24px 40px -24px rgba(31, 29, 27, .35); }
.menu__panel ul { margin-bottom: 16px; }
.menu__panel li a { display: block; padding: 13px 0; font-size: 1.125rem; text-decoration: none; border-bottom: 1px solid var(--line); }
.menu__panel li a[aria-current="page"] { color: var(--accent-ink); font-weight: 600; }

@media (max-width: 1080px) {
  .nav { display: none; }
  .menu { display: block; }
  .site-header__actions { margin-inline-start: auto; }
  .site-header__actions > .btn { display: none; }
}
@media (max-width: 420px) {
  .brand { gap: 8px; }
  .brand__mark { width: 30px; height: 30px; }
  .brand__name, [lang="ar"] .brand__name { font-size: .875rem; }
  .menu__label { display: none; }
  .site-header__inner { gap: 12px; }
}
/* 320 px: the EN header ran 1.3 px wide (brand + language pill + menu). */
@media (max-width: 360px) {
  .site-header__inner { gap: 8px; }
  .site-header__actions { gap: 6px; }
  .lang-switch { padding-inline: 10px; }
}

/* ---------- home hero ---------- */
.hero { position: relative; min-height: min(88vh, 820px); display: flex; align-items: flex-end; color: var(--surface); overflow: hidden; background: var(--ink); }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(23, 21, 19, .86) 0%, rgba(23, 21, 19, .6) 42%, rgba(23, 21, 19, .08) 78%); }
[dir="rtl"] .hero__shade { background: linear-gradient(270deg, rgba(23, 21, 19, .86) 0%, rgba(23, 21, 19, .6) 42%, rgba(23, 21, 19, .08) 78%); }
.hero__body { position: relative; padding-block: 120px 88px; }
.hero__body > * { max-width: 34rem; }
.hero .eyebrow { color: #E9B58F; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); font-weight: 600; max-width: 14em; }
.hero__lead { margin-top: 1.3rem; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: rgba(251, 248, 243, .86); }
/* Phone: the photo would vanish behind the text, so stack it - photo on top, text on charcoal below. */
@media (max-width: 720px) {
  .hero { display: block; min-height: 0; }
  .hero__img { position: relative; height: 280px; object-position: 50% 55%; }
  .hero__shade { display: none; }
  .hero__body { padding-block: 32px 44px; }
}

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 9vw, 112px); }
.section--tight { padding-block: clamp(32px, 5vw, 64px); }
.section--surface { background: var(--surface); border-block: 1px solid var(--line); }
.section__head { display: grid; gap: 1rem; max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }
.section__head h2, .section__title { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.section__title { margin-bottom: 1.75rem; }
.section__head p { color: var(--muted); font-size: 1.125rem; }

/* line cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .25s, box-shadow .25s; }
.card__link:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -22px rgba(31, 29, 27, .45); }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card__link:hover .card__media img { transform: scale(1.04); }
.card__body { display: flex; flex-direction: column; gap: 8px; padding: 20px 20px 22px; flex: 1; }
.card__title { font-size: 1.25rem; font-weight: 600; }
.card__text { color: var(--muted); font-size: .9688rem; flex: 1; }
.card__more { display: inline-flex; align-items: center; gap: .5em; color: var(--accent-ink); font-weight: 500; font-size: .9375rem; margin-top: 6px; }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* steps */
.steps { display: grid; gap: 20px; counter-reset: s; }
.steps--four { grid-template-columns: repeat(4, 1fr); }
.step { padding-top: 20px; border-top: 2px solid var(--ink); }
.step__num { display: block; font-size: .875rem; font-weight: 600; color: var(--accent-ink); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.step h3 { font-size: 1.1875rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .9688rem; }
@media (max-width: 900px) { .steps--four { grid-template-columns: repeat(2, 1fr); row-gap: 32px; } }
@media (max-width: 520px) { .steps--four { grid-template-columns: 1fr; } }

/* why */
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 48px); }
.why li { padding-inline-start: 20px; border-inline-start: 2px solid var(--accent); }
.why h3 { font-size: 1.25rem; margin-bottom: 10px; }
.why p { color: var(--muted); }
@media (max-width: 820px) { .why { grid-template-columns: 1fr; } }

/* CTA band */
.cta-band { background: var(--ink); color: var(--surface); }
.cta-band__inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: clamp(48px, 7vw, 80px); }
.cta-band h2 { font-size: clamp(1.6rem, 2.8vw, 2.25rem); }
.cta-band p { color: rgba(251, 248, 243, .75); margin-top: .75rem; max-width: 36em; }
.cta-band .btn { flex: none; }
@media (max-width: 760px) { .cta-band__inner { flex-direction: column; align-items: flex-start; } }

/* ---------- line pages ---------- */
.page-hero { padding-block: clamp(40px, 6vw, 80px) clamp(48px, 7vw, 88px); }
.page-hero__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.page-hero h1, .page-intro h1 { font-size: clamp(2.1rem, 4.2vw, 3.5rem); }
.page-hero + .section { padding-top: clamp(24px, 4vw, 48px); }
.page-hero__media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--line); }
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) { .page-hero__grid { grid-template-columns: 1fr; } .page-hero__media { order: -1; } }

.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.features li { background: var(--ground); padding: clamp(22px, 3vw, 34px); }
.features h3 { font-size: 1.1875rem; margin-bottom: 8px; }
.features p { color: var(--muted); }
@media (max-width: 680px) { .features { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.split--figure { grid-template-columns: 1.1fr .6fr 1fr; }
.profile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; align-self: center; }
.profile img { max-height: 380px; width: auto; margin-inline: auto; }
.install p { color: var(--muted); font-size: 1.0625rem; }
@media (max-width: 900px) { .split, .split--figure { grid-template-columns: 1fr; } .profile img { max-height: 300px; } }

.ticks li { position: relative; padding: 12px 0; padding-inline-start: 30px; border-bottom: 1px solid var(--line); }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 1.15em; width: 12px; height: 7px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg); }
/* A tick reads the same in Arabic: physical borders on purpose, so it is never mirrored into a chevron. */
[lang="ar"] .ticks li::before { top: 1.35em; }

.gallery__note { color: var(--muted); font-size: .9375rem; margin: -1rem 0 1.25rem; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gallery li { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--line); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
/* 5 photos: a tall first photo beside a 2 x 2 block. 3 and 6 photos fill whole rows as they are. */
.gallery--5 li:first-child { grid-row: span 2; aspect-ratio: auto; }
@media (max-width: 760px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery--5 li:first-child, .gallery--3 li:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 4 / 3; }
}

/* ---------- inner pages ---------- */
.page-intro { padding-block: clamp(48px, 7vw, 96px) clamp(16px, 3vw, 32px); }
/* .prose sits on .wrap: limit the line length on the children, never on the centred wrap itself. */
.prose > * { max-width: 46rem; }
.prose p { font-size: 1.125rem; margin-bottom: 1.2em; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips a { display: inline-block; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--surface); }
.chips a:hover { border-color: var(--ink); }

.timeline { display: grid; gap: 0; max-width: 52rem; }
.timeline__item { display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding-block: 28px; border-top: 1px solid var(--line); }
.timeline__item:last-child { border-bottom: 1px solid var(--line); }
.timeline__num { font-size: 2rem; font-weight: 300; color: var(--accent-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.timeline h2 { font-size: 1.375rem; margin-bottom: 8px; }
.timeline p { color: var(--muted); }
@media (max-width: 520px) { .timeline__item { grid-template-columns: 48px 1fr; gap: 12px; } .timeline__num { font-size: 1.5rem; } }

.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
.contact__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); }
.contact__card dl { margin: 0 0 28px; display: grid; gap: 6px; }
.contact__card dt { font-size: .875rem; color: var(--muted); margin-top: 14px; }
.contact__card dt:first-child { margin-top: 0; }
.contact__card dd { margin: 0; font-size: 1.125rem; }
.contact__email { font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--accent); overflow-wrap: anywhere; }
.contact__send h2 { font-size: 1.5rem; margin-bottom: 12px; }
@media (max-width: 820px) { .contact { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { background: #171513; color: rgba(251, 248, 243, .78); font-size: .9688rem; }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px; padding-block: 64px 40px; }
.site-footer__about p { margin-top: 16px; max-width: 26em; }
.site-footer__area { color: #E9B58F; }
.site-footer__h { font-size: .8125rem; text-transform: uppercase; letter-spacing: .14em; color: rgba(251, 248, 243, .55); font-weight: 500; margin-bottom: 14px; }
[lang="ar"] .site-footer__h { font-size: .9375rem; }
.site-footer ul li { margin-bottom: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--surface); text-decoration: underline; }
.site-footer__base { border-top: 1px solid rgba(251, 248, 243, .12); padding-block: 20px 28px; font-size: .875rem; color: rgba(251, 248, 243, .55); }
@media (max-width: 860px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__about { grid-column: 1 / -1; } }
@media (max-width: 440px) { .site-footer__grid { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.notfound { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 48px; max-width: var(--wrap); margin-inline: auto; padding: 48px var(--gutter); }
.notfound__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.notfound h1, .notfound h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); margin-bottom: 12px; }
.notfound p { color: var(--muted); margin-bottom: 24px; }
.notfound [lang="ar"] { font-family: var(--font-arabic); }
@media (max-width: 720px) { .notfound__pair { grid-template-columns: 1fr; } }
