/**
 * Kayan Smart — main stylesheet (v1.2)
 *
 * Fixes in this revision:
 *  - Hard horizontal overflow guards on html/body (no more side-scroll on mobile).
 *  - Language separation: Arabic uses Cairo, Latin uses Inter (no inheritance bleed).
 *  - Alternating section backgrounds (white ↔ blue) for a more dynamic feel.
 *  - Hero scroll indicator absolutely contained inside .hero only.
 *  - Floating WhatsApp bar guaranteed-visible above all content.
 *  - Counter and animations now actually trigger.
 *  - Single post / archive pages get proper readable spacing.
 */

/* ================================================================
 *  CSS Variables
 * ================================================================ */
:root {
    --ks-primary: #1a3a6e;
    --ks-secondary: #3b82d9;
    --ks-accent: #5fa8e8;
    --ks-bg-dark: #0d1421;
    --ks-bg-medium: #151c2e;
    --ks-bg-light: #f6f8fc;
    --ks-bg-light-soft: #eef2f8;
    --ks-text-on-dark: #e7ecf5;
    --ks-text-on-light: #1a2338;
    --ks-text-dim: #9aa4b8;
    --ks-text-dim-light: #5a6680;
    --ks-border: rgba(255, 255, 255, 0.08);
    --ks-border-light: rgba(26, 58, 110, 0.1);
    --ks-radius: 20px;
    --ks-radius-sm: 12px;
    --ks-radius-pill: 999px;
    --ks-transition: cubic-bezier(0.4, 0, 0.2, 1);
    --ks-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    --ks-shadow-light: 0 8px 32px rgba(26, 58, 110, 0.08);
    --ks-shadow-soft: 0 6px 24px rgba(59, 130, 217, 0.15);
    --ks-font-ar: 'Cairo', system-ui, -apple-system, sans-serif;
    --ks-font-en: 'Inter', system-ui, -apple-system, sans-serif;
    --ks-container: 1280px;
    --ks-container-narrow: 820px;
}

/* ================================================================
 *  Reset + Critical overflow guards
 * ================================================================ */
* { box-sizing: border-box; }

/* These two lines are the most important guard against the "site goes
   outside the screen" issue: regardless of any rogue child, the document
   itself can never scroll horizontally. */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--ks-font-ar);
    font-size: 16px;
    line-height: 1.7;
    color: var(--ks-text-on-dark);
    background: var(--ks-bg-dark);
    -webkit-font-smoothing: antialiased;
}

img, video, iframe { max-width: 100%; height: auto; display: block; }

/* ================================================================
 *  LANGUAGE SEPARATION — Arabic vs Latin character isolation
 *
 *  Problem (v1.1): Arabic body inherited Cairo into Latin children
 *  (or vice-versa), making English appear inside Arabic-shaped glyphs.
 *  Fix: lock fonts at the language level.
 * ================================================================ */

/* When the document is Arabic, only Arabic glyphs are rendered with Cairo;
   any inline Latin span explicitly opts back into Inter. */
html[lang^="ar"] body { font-family: var(--ks-font-ar); }
html[lang^="ar"] :lang(en),
html[lang^="ar"] [lang^="en"],
.text-en, .ks-en {
    font-family: var(--ks-font-en);
    direction: ltr;
    unicode-bidi: isolate;
}

html[lang^="en"] body { font-family: var(--ks-font-en); }
html[lang^="en"] :lang(ar),
html[lang^="en"] [lang^="ar"],
.text-ar, .ks-ar {
    font-family: var(--ks-font-ar);
    direction: rtl;
    unicode-bidi: isolate;
}

/* Numeric content (phone numbers, emails, URLs) should always render
   in LTR Inter — never in Arabic glyphs. We mark these explicitly
   instead of styling every <a href="tel:"> because that would also
   reverse the Arabic LABEL of buttons that happen to be tel: links
   (e.g. "اتصل بنا" → "انب لصتا"). */
.contact-card-value,
.ks-en-num,
a.tel-number,
a.email-link {
    font-family: var(--ks-font-en);
    direction: ltr;
    unicode-bidi: isolate-override;
    display: inline-block;
}

/* Headings */
h1, h2, h3, h4, h5 {
    font-family: inherit;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 .5em;
}
p { margin: 0 0 1rem; }

a { color: var(--ks-secondary); text-decoration: none; transition: color .2s var(--ks-transition); }
a:hover { color: var(--ks-accent); }

/* Container */
.container {
    width: 100%;
    max-width: var(--ks-container);
    margin: 0 auto;
    padding: 0 24px;
}
.container.narrow { max-width: var(--ks-container-narrow); }

@media (max-width: 640px) {
    .container { padding: 0 16px; }
}

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
.skip-link:focus {
    position: fixed;
    top: 8px; left: 8px;
    z-index: 999;
    padding: 8px 16px;
    background: var(--ks-primary);
    color: #fff;
    border-radius: 8px;
    width: auto; height: auto;
    clip: auto;
}

/* ================================================================
 *  Buttons
 * ================================================================ */
.ks-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    border-radius: var(--ks-radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .25s var(--ks-transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}
.ks-btn-primary {
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-primary));
    color: #fff;
    box-shadow: var(--ks-shadow-soft);
}
.ks-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(59, 130, 217, 0.35);
    color: #fff;
}
.ks-btn-ghost {
    background: transparent;
    color: var(--ks-text-on-dark);
    border-color: var(--ks-border);
}
.section-light .ks-btn-ghost { color: var(--ks-primary); border-color: var(--ks-border-light); }

/* ================================================================
 *  HEADER
 * ================================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 0;
    transition: all .25s var(--ks-transition);
}
.site-header.is-scrolled {
    background: rgba(13, 20, 33, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--ks-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(21, 28, 46, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-pill);
    padding: 8px 16px;
}

.site-branding { flex-shrink: 0; padding: 4px 8px; }
.custom-logo, .site-branding img { max-height: 42px; width: auto; display: block; }

.main-nav { display: none; }
@media (min-width: 992px) {
    .main-nav { display: block; flex: 1; }
    .primary-menu {
        display: flex;
        gap: 4px;
        list-style: none;
        margin: 0;
        padding: 0;
        justify-content: center;
    }
    .primary-menu a {
        display: block;
        padding: 8px 16px;
        color: var(--ks-text-on-dark);
        font-weight: 500;
        font-size: 15px;
        border-radius: var(--ks-radius-pill);
        transition: all .2s var(--ks-transition);
    }
    .primary-menu a:hover,
    .primary-menu .current-menu-item > a {
        background: rgba(59, 130, 217, 0.15);
        color: #fff;
    }
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.header-cta {
    font-size: 13px;
    padding: 10px 18px;
    display: none;
}
@media (min-width: 992px) { .header-cta { display: inline-flex; } }

/* Language switcher — Latin chars (AR/EN), Inter font */
.lang-switcher ul {
    display: flex;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--ks-radius-pill);
    font-family: var(--ks-font-en);
}
.lang-switcher a {
    display: block;
    padding: 5px 11px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ks-text-dim);
    border-radius: var(--ks-radius-pill);
    transition: all .2s var(--ks-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.lang-switcher a:hover { color: #fff; }
.lang-switcher li.active a,
.lang-switcher li.current-lang a {
    background: var(--ks-secondary);
    color: #fff;
}

/* Mobile hamburger */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px; height: 42px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--ks-border);
    border-radius: 50%;
    cursor: pointer;
    transition: all .25s var(--ks-transition);
}
.mobile-toggle-bar {
    display: block;
    width: 18px; height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all .25s var(--ks-transition);
}
.mobile-toggle[aria-expanded="true"] .mobile-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle[aria-expanded="true"] .mobile-toggle-bar:nth-child(2) { opacity: 0; }
.mobile-toggle[aria-expanded="true"] .mobile-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 992px) { .mobile-toggle { display: none; } }

/* ================================================================
 *  MOBILE DRAWER
 * ================================================================ */
.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    visibility: hidden;
}
.mobile-drawer.is-open { pointer-events: auto; visibility: visible; }
.mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity .35s var(--ks-transition);
}
.mobile-drawer.is-open .mobile-drawer-backdrop { opacity: 1; }

.mobile-drawer-panel {
    position: absolute;
    top: 0; bottom: 0;
    width: 86%;
    max-width: 380px;
    /* Subtle vertical gradient with a glow on top */
    background:
        radial-gradient(circle at 50% -10%, rgba(59, 130, 217, 0.18), transparent 50%),
        linear-gradient(180deg, var(--ks-bg-medium) 0%, var(--ks-bg-dark) 100%);
    box-shadow: -24px 0 80px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    transition: transform .45s var(--ks-transition);
    overflow-y: auto;
    overflow-x: hidden;
}
/* RTL: drawer slides in from the right; LTR: same direction visually
   (mobile-first design) */
html[dir="rtl"] .mobile-drawer-panel,
body.is-rtl .mobile-drawer-panel { right: 0; transform: translateX(100%); border-left: 1px solid var(--ks-border); }
html[dir="ltr"] .mobile-drawer-panel,
body:not(.is-rtl) .mobile-drawer-panel { right: 0; transform: translateX(100%); border-left: 1px solid var(--ks-border); }
.mobile-drawer.is-open .mobile-drawer-panel { transform: translateX(0); }

.mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid var(--ks-border);
    background: rgba(255, 255, 255, 0.02);
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    z-index: 2;
}
.mobile-drawer-head img { max-height: 38px; }

.mobile-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--ks-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    transition: all .2s var(--ks-transition);
}
.mobile-drawer-close:hover {
    background: rgba(231, 76, 94, 0.2);
    border-color: rgba(231, 76, 94, 0.4);
    transform: rotate(90deg);
}

.mobile-drawer-nav {
    flex: 1;
    padding: 28px 22px;
    /* Subtle radial glow behind the menu items for depth */
    background:
        radial-gradient(ellipse at 50% 0%, rgba(59, 130, 217, 0.06), transparent 70%);
}
.mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    counter-reset: ks-menu;        /* enable counter for ::before */
}
.mobile-menu li {
    position: relative;
    counter-increment: ks-menu;
}

/* Each menu item: glass-card with a soft gradient, a numbered indicator
   on the start edge, an animated arrow, and a glow-on-hover that gives
   the menu a premium feel. */
.mobile-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ks-text-on-dark);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--ks-border);
    border-radius: 16px;
    transition: all .35s var(--ks-transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(6px);
}

/* Numbered prefix — small chip of accent color before the label */
.mobile-menu a::before {
    content: counter(ks-menu, decimal-leading-zero);
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-end: 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(59, 130, 217, 0.18), rgba(91, 168, 232, 0.08));
    border: 1px solid rgba(91, 168, 232, 0.25);
    color: var(--ks-accent);
    font-family: var(--ks-font-en);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all .3s var(--ks-transition);
}

/* Arrow indicator at the end edge */
.mobile-menu a::after {
    content: '';
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--ks-text-dim);
    border-inline-end: 2px solid var(--ks-text-dim);
    transform: rotate(45deg);
    flex-shrink: 0;
    margin-inline-start: 8px;
    transition: all .25s var(--ks-transition);
    opacity: 0.5;
}
html[dir="rtl"] .mobile-menu a::after,
body.is-rtl .mobile-menu a::after { transform: rotate(-135deg); }

/* The label sits between ::before (number) and ::after (arrow). */
.mobile-menu a > * { flex: 1; }

/* Hover / active state — gradient glow + slide-in arrow */
.mobile-menu a:hover,
.mobile-menu .current-menu-item > a {
    background:
        linear-gradient(135deg, rgba(59, 130, 217, 0.22), rgba(91, 168, 232, 0.06));
    border-color: rgba(91, 168, 232, 0.45);
    color: #fff;
    box-shadow: 0 8px 28px rgba(59, 130, 217, 0.2);
    transform: translateX(0);
}
.mobile-menu a:hover::before,
.mobile-menu .current-menu-item > a::before {
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-accent));
    border-color: transparent;
    color: #fff;
    transform: scale(1.05);
}
.mobile-menu a:hover::after,
.mobile-menu .current-menu-item > a::after {
    opacity: 1;
    border-color: #fff;
    margin-inline-start: 12px;
}

.mobile-drawer-foot {
    padding: 24px 22px;
    border-top: 1px solid var(--ks-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
}
.mobile-drawer-cta {
    width: 100%;
    justify-content: center;
    text-align: center;
}
.mobile-drawer-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    padding: 14px;
    color: var(--ks-accent);
    font-weight: 700;
    background: rgba(91, 168, 232, 0.08);
    border: 1px solid rgba(91, 168, 232, 0.25);
    border-radius: 14px;
    font-family: var(--ks-font-en);
    direction: ltr;
    transition: all .25s;
}
.mobile-drawer-contact:hover {
    background: rgba(91, 168, 232, 0.18);
    color: #fff;
}

/* ================================================================
 *  Section scaffolding
 * ================================================================ */
section { position: relative; padding: 100px 0; }
@media (max-width: 768px) { section { padding: 60px 0; } }

.section-eyebrow {
    display: inline-block;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ks-accent);
    background: rgba(91, 168, 232, 0.12);
    border: 1px solid rgba(91, 168, 232, 0.3);
    border-radius: var(--ks-radius-pill);
    margin-bottom: 16px;
    font-family: var(--ks-font-en);
}
.section-title {
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1.2;
    margin-bottom: 16px;
    color: #fff;
}

/* Light section — bigger contrast, shadows for dimension */
.section-light {
    background: linear-gradient(180deg, var(--ks-bg-light), var(--ks-bg-light-soft));
    color: var(--ks-text-on-light);
}
.section-light h1, .section-light h2, .section-light h3, .section-light h4, .section-light .section-title {
    color: var(--ks-primary);
}
.section-light p { color: var(--ks-text-dim-light); }
.section-light .section-eyebrow {
    color: var(--ks-secondary);
    background: rgba(59, 130, 217, 0.1);
    border-color: rgba(59, 130, 217, 0.2);
}

/* ================================================================
 *  HERO
 *  - Scroll indicator ABSOLUTELY contained inside .hero (no leak).
 *  - Brand tagline "Kayan Smart / Engineering Consulting" included.
 * ================================================================ */
/* HERO — true full-screen takeover. The header sits transparently
   on top via position:sticky, so we don't need a negative margin. */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    /* Compensate for the sticky header's height so the hero starts
       at the very top of the viewport visually. */
    margin-top: calc(-1 * var(--ks-header-h, 78px));
    padding: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}
/* When the page starts with a hero, kill any default body top spacing. */
body.has-transparent-header { padding-top: 0; }
.hero-video, .hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero-bg { background-size: cover; background-position: center; }
.hero-bg-default {
    background:
        radial-gradient(ellipse at top right, rgba(59, 130, 217, 0.4), transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(26, 58, 110, 0.55), transparent 50%),
        linear-gradient(180deg, var(--ks-bg-dark), var(--ks-bg-medium));
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 20, 33, 0.4) 0%, rgba(13, 20, 33, 0.75) 100%);
    z-index: 1;
}
.hero-shapes { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.shape { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4; }
.shape-1 {
    width: 400px; height: 400px;
    background: var(--ks-secondary);
    top: -80px; right: -80px;
    animation: ks-float 8s ease-in-out infinite;
}
.shape-2 {
    width: 320px; height: 320px;
    background: var(--ks-accent);
    bottom: -80px; left: -80px;
    animation: ks-float 10s ease-in-out infinite reverse;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 140px 24px 100px;
    width: 100%;
}

/* On mobile, tighten the vertical breathing room so the image dominates
   the viewport instead of being squeezed into the middle. */
@media (max-width: 640px) {
    .hero-content { padding: 110px 20px 90px; }
}

.hero-eyebrow {
    display: inline-block;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    background: rgba(59, 130, 217, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--ks-radius-pill);
    margin-bottom: 24px;
    font-family: var(--ks-font-en);
}

.hero-title {
    font-size: clamp(34px, 6vw, 72px);
    line-height: 1.1;
    font-weight: 900;
    color: #fff;
    margin-bottom: 24px;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}
.hero-sub {
    font-size: clamp(15px, 1.7vw, 19px);
    color: rgba(255, 255, 255, 0.88);
    max-width: 700px;
    margin: 0 auto 40px;
}

/* NEW — Brand tagline block under the hero CTA */
.hero-brand {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-block;
    text-align: center;
}
.hero-brand-name {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 900;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}
.hero-brand-tagline {
    font-size: clamp(13px, 1.4vw, 15px);
    color: var(--ks-accent);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
}

.hero-cta { margin-bottom: 0; }

/* Scroll indicator — pinned to bottom of HERO ONLY */
.hero-scroll {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px; height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    padding-top: 7px;
    z-index: 4;
}
.hero-scroll-dot {
    width: 4px; height: 8px;
    background: var(--ks-accent);
    border-radius: 2px;
    animation: ks-scroll-bounce 1.8s ease-in-out infinite;
}
@keyframes ks-scroll-bounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(16px); opacity: 0.3; }
}
@keyframes ks-float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

/* ================================================================
 *  ABOUT
 * ================================================================ */
.about-grid {
    display: grid;
    gap: 48px;
    align-items: center;
    grid-template-columns: 1fr;
}
@media (min-width: 992px) {
    .about-grid { grid-template-columns: 1fr 1.1fr; gap: 80px; }
}

.about-image-wrap { position: relative; padding: 16px; }
.about-image-decor {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-primary));
    border-radius: var(--ks-radius);
    transform: rotate(-3deg);
    opacity: 0.12;
}
.about-image {
    position: relative;
    width: 100%;
    height: 460px;
    object-fit: cover;
    border-radius: var(--ks-radius);
    box-shadow: var(--ks-shadow-light);
}
.about-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff, var(--ks-bg-light-soft));
    color: var(--ks-secondary);
}
.about-text { font-size: 17px; line-height: 1.85; margin-bottom: 24px; }

@media (max-width: 767px) {
    .about-image { height: 280px; }
    .about-text { font-size: 15px; }
}

/* ================================================================
 *  STATS
 * ================================================================ */
.stats {
    background:
        radial-gradient(ellipse at center top, rgba(59, 130, 217, 0.15), transparent 60%),
        linear-gradient(180deg, var(--ks-bg-dark), var(--ks-bg-medium));
}

.stats-head { text-align: center; margin-bottom: 56px; }
.stats-text { max-width: 600px; margin: 0 auto; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (min-width: 768px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
}

.stat-card {
    text-align: center;
    padding: 32px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    transition: all .35s var(--ks-transition);
}
.stat-card:hover {
    transform: translateY(-6px);
    border-color: rgba(59, 130, 217, 0.4);
    box-shadow: var(--ks-shadow-soft);
}

/* The actual counter number — uses Inter for clean numerals */
.stat-value {
    font-family: var(--ks-font-en);
    font-size: clamp(32px, 4.5vw, 52px);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--ks-accent), var(--ks-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Show even before animation kicks in */
    min-height: 1em;
}
.stat-label {
    font-size: 14px;
    color: var(--ks-text-dim);
    font-weight: 500;
}

/* ================================================================
 *  SERVICES
 * ================================================================ */
.services-head { text-align: center; margin-bottom: 56px; max-width: 720px; margin-inline: auto; }
.services-sub { font-size: 16px; }

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 640px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .services-grid { grid-template-columns: repeat(4, 1fr); } }

.service-card {
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
    background: #fff;
    border: 1px solid var(--ks-border-light);
    border-radius: var(--ks-radius);
    text-decoration: none;
    color: inherit;
    transition: all .35s var(--ks-transition);
    box-shadow: 0 1px 2px rgba(26, 58, 110, 0.04);
}
/* In dark sections, services get a dark surface */
section:not(.section-light) .service-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    border-color: var(--ks-border);
    color: var(--ks-text-on-dark);
}
.service-card:hover {
    transform: translateY(-6px);
    border-color: var(--ks-secondary);
    box-shadow: var(--ks-shadow-light);
    color: inherit;
}
.service-icon {
    width: 56px; height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-primary));
    color: #fff;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: var(--ks-shadow-soft);
}
.service-title { font-size: 18px; margin-bottom: 10px; color: #fff; }
.section-light .service-title { color: var(--ks-primary); }
.service-excerpt { font-size: 14px; line-height: 1.65; margin-bottom: 16px; flex: 1; color: var(--ks-text-dim); }
.section-light .service-excerpt { color: var(--ks-text-dim-light); }
.service-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ks-secondary);
    font-weight: 700;
    font-size: 14px;
    margin-top: auto;
}

/* ================================================================
 *  PROJECTS
 * ================================================================ */
.projects-head { text-align: center; margin-bottom: 56px; }
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 640px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .projects-grid { grid-template-columns: repeat(3, 1fr); } }

/* "View all projects" centered CTA */
.projects-cta {
    text-align: center;
    margin-top: 48px;
}

/* Admin-only empty state when no projects exist yet */
.projects-empty {
    text-align: center;
    padding: 60px 20px;
    border: 2px dashed var(--ks-border-light);
    border-radius: var(--ks-radius);
    background: rgba(255, 255, 255, 0.4);
}
.projects-empty svg { opacity: 0.3; margin-bottom: 16px; color: var(--ks-secondary); }
.projects-empty h3 { color: var(--ks-primary); margin-bottom: 8px; }
.projects-empty p { color: var(--ks-text-dim-light); margin: 0; }
.projects-empty a { color: var(--ks-secondary); font-weight: 700; text-decoration: underline; }

.project-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    overflow: hidden;
    transition: all .35s var(--ks-transition);
}
.section-light .project-card {
    background: #fff;
    border-color: var(--ks-border-light);
    box-shadow: var(--ks-shadow-light);
}
.project-card:hover { transform: translateY(-6px); border-color: var(--ks-secondary); }

.project-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--ks-bg-medium);
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ks-transition); }
.project-card:hover .project-thumb img { transform: scale(1.06); }

.project-status-chip {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    padding: 6px 14px;
    background: rgba(13, 20, 33, 0.85);
    backdrop-filter: blur(10px);
    color: #fff;
    border-radius: var(--ks-radius-pill);
    font-size: 12px;
    font-weight: 700;
}

.project-body { padding: 22px; }
.project-body-title { font-size: 19px; margin-bottom: 12px; }
.section-light .project-body-title { color: var(--ks-primary); }
section:not(.section-light) .project-body-title { color: #fff; }
.project-body-title a { color: inherit; }

.project-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ks-text-dim);
    font-size: 13px;
    margin-bottom: 14px;
}
.section-light .project-location { color: var(--ks-text-dim-light); }

/* ================================================================
 *  VIDEO SECTION
 * ================================================================ */
.video-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }

.video-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--ks-radius);
    overflow: hidden;
    box-shadow: var(--ks-shadow);
    cursor: pointer;
    background: var(--ks-bg-medium);
    max-width: 1100px;
    margin: 0 auto;
}
.video-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ks-transition), filter .35s;
}
.video-poster-default {
    background:
        radial-gradient(ellipse at center, rgba(91, 168, 232, 0.4), transparent 70%),
        linear-gradient(135deg, var(--ks-primary), var(--ks-bg-dark));
}
.video-wrap:hover .video-poster { transform: scale(1.03); filter: brightness(0.7); }

.video-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 88px; height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-primary));
    border: 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-inline-start: 6px;
    box-shadow: 0 12px 40px rgba(59, 130, 217, 0.5);
    transition: transform .25s;
}
.video-play-btn:hover { transform: translate(-50%, -50%) scale(1.1); }
.video-play-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--ks-accent);
    animation: ks-video-pulse 2s infinite;
}
@keyframes ks-video-pulse {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* ================================================================
 *  TESTIMONIALS
 * ================================================================ */
.testimonials { overflow: hidden; }
.testimonials-head { text-align: center; margin-bottom: 48px; }

/* The slider WRAPPER is the visible viewport — it clips the scrolling
   track. Use a negative margin on the inner track to compensate for the
   container's horizontal padding so the cards align with the page edge
   when scrolled, but never spill out of the section. */
.testimonials-slider {
    position: relative;
    overflow: hidden;
    /* Add safety padding so card shadows aren't visually clipped */
    padding: 4px 0 12px;
}
.testimonials-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 88%;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px;
    /* Prevent any overscroll bounce on iOS that visually leaks cards */
    overscroll-behavior-x: contain;
}
.testimonials-track::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .testimonials-track { grid-auto-columns: calc(50% - 8px); } }
@media (min-width: 992px) { .testimonials-track { grid-auto-columns: calc(33.333% - 11px); } }

.testimonial-card {
    scroll-snap-align: start;
    padding: 28px 24px;
    background: #fff;
    border: 1px solid var(--ks-border-light);
    border-radius: var(--ks-radius);
    box-shadow: var(--ks-shadow-light);
    position: relative;
    transition: all .35s var(--ks-transition);
}
section:not(.section-light) .testimonial-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border-color: var(--ks-border);
    box-shadow: none;
}
.testimonial-card:hover { transform: translateY(-4px); border-color: var(--ks-secondary); }

.testimonial-quote-mark {
    position: absolute;
    top: 12px;
    inset-inline-end: 22px;
    font-size: 64px;
    font-weight: 900;
    line-height: 1;
    color: rgba(91, 168, 232, 0.18);
    font-family: Georgia, serif;
}
.rating-stars {
    display: flex;
    gap: 2px;
    color: #f5b841;
    margin-bottom: 14px;
}
.testimonial-text {
    font-size: 15px;
    line-height: 1.8;
    margin: 0 0 22px;
    color: var(--ks-text-on-light);
}
section:not(.section-light) .testimonial-text { color: var(--ks-text-on-dark); }
.testimonial-text p { margin: 0; color: inherit; }

.testimonial-author { display: flex; align-items: center; gap: 14px; }
.testimonial-avatar {
    width: 46px; height: 46px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
}
.testimonial-avatar img { width: 100%; height: 100%; object-fit: cover; }
.testimonial-name { font-weight: 700; font-size: 15px; }
.section-light .testimonial-name { color: var(--ks-primary); }
section:not(.section-light) .testimonial-name { color: #fff; }
.testimonial-role { font-size: 13px; color: var(--ks-text-dim); }
.section-light .testimonial-role { color: var(--ks-text-dim-light); }

.testimonials-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
}
.testimonials-prev, .testimonials-next {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 1px solid var(--ks-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ks-text-on-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .25s;
}
.section-light .testimonials-prev,
.section-light .testimonials-next {
    background: #fff;
    border-color: var(--ks-border-light);
    color: var(--ks-primary);
    box-shadow: var(--ks-shadow-light);
}
.testimonials-prev:hover, .testimonials-next:hover {
    background: var(--ks-secondary);
    border-color: var(--ks-secondary);
    color: #fff;
}

/* ================================================================
 *  BLOG SECTION — REDESIGNED, more polished
 * ================================================================ */
.blog-section { }
.blog-head { text-align: center; margin-bottom: 56px; }
.blog-head-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 48px;
}
.blog-head-row > div:first-child { text-align: start; max-width: 600px; }
.blog-head-row .section-title { margin-bottom: 4px; }
.blog-head-row .section-eyebrow { margin-bottom: 12px; }

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 640px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.blog-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--ks-border-light);
    border-radius: var(--ks-radius);
    overflow: hidden;
    transition: all .35s var(--ks-transition);
    box-shadow: var(--ks-shadow-light);
    height: 100%;
}
section:not(.section-light) .blog-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border-color: var(--ks-border);
    box-shadow: none;
}

.blog-card:hover {
    transform: translateY(-6px);
    border-color: var(--ks-secondary);
    box-shadow: 0 16px 48px rgba(26, 58, 110, 0.15);
}

.blog-card-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, var(--ks-bg-light-soft), #fff);
}
section:not(.section-light) .blog-card-thumb { background: var(--ks-bg-medium); }
.blog-card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ks-transition);
}
.blog-card:hover .blog-card-thumb img { transform: scale(1.06); }

.blog-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ks-secondary);
    opacity: 0.4;
}

.blog-card-cat {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    padding: 5px 12px;
    background: var(--ks-secondary);
    color: #fff;
    border-radius: var(--ks-radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: var(--ks-font-en);
}

.blog-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--ks-text-dim);
    margin-bottom: 12px;
    font-family: var(--ks-font-en);
}
.section-light .blog-card-meta { color: var(--ks-text-dim-light); }
.blog-card-meta span { display: flex; align-items: center; gap: 4px; }

.blog-card-title {
    font-size: 19px;
    line-height: 1.35;
    margin-bottom: 12px;
    transition: color .2s;
}
.section-light .blog-card-title { color: var(--ks-primary); }
section:not(.section-light) .blog-card-title { color: #fff; }
.blog-card-title a { color: inherit; }
.blog-card:hover .blog-card-title { color: var(--ks-secondary); }

.blog-card-excerpt {
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 16px;
    flex: 1;
}
.blog-card-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ks-secondary);
    font-weight: 700;
    font-size: 14px;
    margin-top: auto;
}

/* ================================================================
 *  PARTNERS MARQUEE
 * ================================================================ */
.partners {
    padding-bottom: 100px;
    overflow: hidden;
}
.partners-head { text-align: center; margin-bottom: 48px; }

.marquee-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.marquee-track { display: flex; overflow: hidden; }

/* Marquee scroll speeds — fast enough that the row always looks
   continuously populated with no perceived gaps.
   `animation-delay: -2s` starts the animation 2 seconds into its
   cycle, eliminating the dead "startup pause" users would otherwise
   see before the first transform tick. */
.marquee-inner {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
    padding-inline: 10px;
    /* Smooth, faster scroll so users don't notice "gaps" while waiting */
    animation: ks-marquee-ltr 22s linear infinite;
    animation-delay: -2s;
    will-change: transform;
}
.marquee-rtl .marquee-inner {
    animation: ks-marquee-rtl 26s linear infinite;
    animation-delay: -3s;
}
.marquee-wrap:hover .marquee-inner { animation-play-state: paused; }

.marquee-item {
    flex-shrink: 0;
    width: 170px; height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: #fff;
    border: 1px solid var(--ks-border-light);
    border-radius: 14px;
    color: var(--ks-text-dim-light);
    font-weight: 600;
    font-size: 13px;
    box-shadow: var(--ks-shadow-light);
    transition: all .25s;
}
section:not(.section-light) .marquee-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--ks-border);
    color: var(--ks-text-dim);
    box-shadow: none;
}
.marquee-item:hover {
    border-color: var(--ks-secondary);
    color: var(--ks-secondary);
}
.marquee-item img { max-width: 100%; max-height: 56px; object-fit: contain; }

/* PHP prints each row TWICE (2×). Translating by -50% moves one full
   copy width per cycle → perfectly seamless loop at any viewport size. */
@keyframes ks-marquee-ltr {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes ks-marquee-rtl {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* ================================================================
 *  CONTACT SECTION (NO FORM — removed per user request)
 * ================================================================ */
.contact-section { }
.contact-head { text-align: center; margin-bottom: 48px; max-width: 720px; margin-inline: auto; }
.contact-subtitle { font-size: 16px; }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}
@media (min-width: 992px) {
    .contact-grid { grid-template-columns: 1.3fr 1fr; }
}

.contact-map {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--ks-radius);
    overflow: hidden;
    border: 1px solid var(--ks-border-light);
    background: var(--ks-bg-light-soft);
    box-shadow: var(--ks-shadow-light);
}
section:not(.section-light) .contact-map {
    background: var(--ks-bg-medium);
    border-color: var(--ks-border);
}
.contact-map iframe {
    width: 100%; height: 100%;
    border: 0;
}
section:not(.section-light) .contact-map iframe {
    filter: invert(0.92) hue-rotate(180deg) saturate(0.8);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-card {
    /* Always horizontal: icon on the start, text on the rest.
       The !important + min-width ensures this layout never collapses
       to a vertical stack even on narrow mobile screens. */
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--ks-border-light);
    border-radius: var(--ks-radius-sm);
    color: inherit;
    transition: all .25s;
    box-shadow: var(--ks-shadow-light);
    text-decoration: none;
    width: 100%;
}
.contact-card > div:not(.contact-card-icon) {
    flex: 1;
    min-width: 0;          /* lets long text truncate cleanly */
}
section:not(.section-light) .contact-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--ks-border);
    box-shadow: none;
}
.contact-card:hover {
    border-color: var(--ks-secondary);
    color: inherit;
    transform: translateY(-2px);
}
.contact-card-icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 217, 0.12);
    color: var(--ks-secondary);
    border-radius: 12px;
}
.contact-card-whatsapp .contact-card-icon { background: rgba(37, 211, 102, 0.15); color: #25d366; }
.contact-card-label { font-size: 12px; color: var(--ks-text-dim); font-weight: 500; margin-bottom: 4px; }
.section-light .contact-card-label { color: var(--ks-text-dim-light); }
.contact-card-value {
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
    font-family: var(--ks-font-en);
    direction: ltr;
}
.section-light .contact-card-value { color: var(--ks-primary); }
section:not(.section-light) .contact-card-value { color: #fff; }

/* For text values that should remain Arabic (like address), opt back in */
.contact-card-value.is-text {
    font-family: var(--ks-font-ar);
    direction: rtl;
}
html[dir="ltr"] .contact-card-value.is-text { direction: ltr; }

/* ================================================================
 *  FOOTER
 * ================================================================ */
.site-footer {
    position: relative;
    background:
        linear-gradient(180deg, rgba(13, 20, 33, 0.95), var(--ks-bg-dark)),
        linear-gradient(135deg, var(--ks-primary), var(--ks-bg-dark));
    color: var(--ks-text-on-dark);
    padding: 80px 0 0;
    overflow: hidden;
}
/* Decorative background image (set by inline style from PHP) */
.footer-bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: 0;
}
.footer-glow {
    position: absolute;
    top: -200px; left: 50%;
    transform: translateX(-50%);
    width: 800px; height: 400px;
    background: radial-gradient(ellipse, rgba(59, 130, 217, 0.2), transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.footer-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    padding-bottom: 60px;
}
@media (min-width: 640px) { .footer-inner { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 60px; } }

.footer-logo img { max-height: 56px; margin-bottom: 20px; filter: brightness(1.1); }
.footer-about { font-size: 14px; line-height: 1.8; margin-bottom: 20px; color: var(--ks-text-dim); }

.footer-social { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-social a {
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--ks-border);
    border-radius: 50%;
    color: var(--ks-text-dim);
    transition: all .25s;
}
.footer-social a:hover {
    background: var(--ks-secondary);
    border-color: var(--ks-secondary);
    color: #fff;
    transform: translateY(-3px);
}

.footer-title { font-size: 16px; color: #fff; margin-bottom: 20px; }
.footer-menu, .footer-contact {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-menu a { color: var(--ks-text-dim); font-size: 14px; transition: color .2s; }
.footer-menu a:hover { color: var(--ks-accent); padding-inline-start: 4px; }

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--ks-text-dim);
    font-size: 14px;
}
.footer-contact svg { flex-shrink: 0; margin-top: 3px; color: var(--ks-accent); }
.footer-contact a {
    color: inherit;
    font-family: var(--ks-font-en);
    direction: ltr;
}
.footer-contact a:hover { color: var(--ks-accent); }

.footer-bottom {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--ks-border);
    padding: 24px 0;
    background: rgba(0, 0, 0, 0.25);
}
.footer-bottom-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--ks-text-dim);
}

/* The credit line — centered, with heart icon and clickable name */
.footer-credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ks-text-dim);
}
.footer-credit-heart {
    color: #e74c5e;
    animation: ks-heart-pulse 1.6s ease-in-out infinite;
    display: inline-block;
    font-style: normal;
    font-size: 15px;
    line-height: 1;
}
@keyframes ks-heart-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}
.footer-credit a {
    color: var(--ks-accent);
    font-weight: 700;
    transition: color .2s;
}
.footer-credit a:hover { color: var(--ks-secondary); }

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    align-items: center;
}
.footer-reg { font-family: var(--ks-font-en); }
.footer-reg strong { color: var(--ks-text-on-dark); font-weight: 600; }

/* ================================================================
 *  FLOATING WHATSAPP + CALL BAR — guaranteed visible
 * ================================================================ */
.floating-bar {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    animation: ks-float-in .6s .4s backwards var(--ks-transition);
    /* Smooth hide/show when drawer opens */
    transition: opacity .25s, transform .25s;
}
/* Hide when mobile drawer is open */
.floating-bar[data-drawer-open] {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}
@keyframes ks-float-in {
    from { opacity: 0; transform: translateX(-50%) translateY(40px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.floating-bar-inner {
    position: relative;
    display: flex;
    align-items: stretch;
    background: rgba(21, 28, 46, 0.78);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--ks-radius-pill);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(59, 130, 217, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Soft glow behind the bar */
.floating-bar-inner::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.4), rgba(59, 130, 217, 0.4));
    filter: blur(14px);
    opacity: 0.45;
    z-index: -1;
    animation: ks-soft-pulse 4s ease-in-out infinite;
}
@keyframes ks-soft-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.floating-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    transition: all .25s;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-decoration: none;
}
.floating-btn:hover { color: #fff; }
.floating-btn-whatsapp svg { color: #25d366; }
.floating-btn-call svg { color: var(--ks-accent); }
.floating-btn-whatsapp:hover { background: rgba(37, 211, 102, 0.12); }
.floating-btn-call:hover { background: rgba(59, 130, 217, 0.12); }

.floating-bar-divider {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.3), transparent);
}

@media (max-width: 480px) {
    .floating-bar { bottom: 12px; width: calc(100% - 24px); max-width: 360px; }
    .floating-bar-inner { width: 100%; }
    .floating-btn { flex: 1; justify-content: center; padding: 13px 12px; font-size: 13px; }
}

/* ================================================================
 *  SINGLE POST / CONTENT PAGES — improved typography
 * ================================================================ */
.single-post-main, .single-service-main { padding: 80px 0; }

.single-post-header {
    text-align: center;
    margin-bottom: 40px;
}
.single-post-meta {
    font-size: 13px;
    color: var(--ks-text-dim);
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.single-post-meta .sep { opacity: 0.5; }
.single-post-meta a { color: var(--ks-accent); }

.single-post-title {
    font-size: clamp(28px, 4vw, 44px);
    color: #fff;
    line-height: 1.25;
    margin-bottom: 20px;
}
.single-post-excerpt {
    font-size: 18px;
    color: var(--ks-text-dim);
    line-height: 1.7;
    max-width: 720px;
    margin: 0 auto;
}

.single-post-thumb {
    margin: 40px 0;
    border-radius: var(--ks-radius);
    overflow: hidden;
    box-shadow: var(--ks-shadow);
    aspect-ratio: 16 / 9;
}
.single-post-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Content typography */
.entry-content {
    font-size: 17px;
    line-height: 1.95;
    color: var(--ks-text-on-dark);
}
.entry-content > * + * { margin-top: 1.2em; }
.entry-content p { color: var(--ks-text-on-dark); margin: 0 0 1.2em; }
.entry-content h2 {
    font-size: 28px;
    margin: 1.8em 0 0.6em;
    color: #fff;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(91, 168, 232, 0.2);
}
.entry-content h3 { font-size: 22px; margin: 1.5em 0 0.5em; color: #fff; }
.entry-content h4 { font-size: 18px; margin: 1.2em 0 0.4em; color: var(--ks-accent); }
.entry-content a { color: var(--ks-accent); text-decoration: underline; text-decoration-color: rgba(91, 168, 232, 0.3); text-underline-offset: 3px; }
.entry-content a:hover { color: var(--ks-secondary); text-decoration-color: var(--ks-secondary); }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em; padding-inline-start: 24px; }
.entry-content ul li, .entry-content ol li { margin-bottom: 10px; line-height: 1.75; }
.entry-content ul li::marker { color: var(--ks-accent); }
.entry-content ol li::marker { color: var(--ks-accent); font-weight: 700; }
.entry-content strong { color: #fff; font-weight: 700; }
.entry-content em { color: var(--ks-accent); font-style: normal; }
.entry-content blockquote {
    margin: 28px 0;
    padding: 24px 28px;
    border-inline-start: 4px solid var(--ks-accent);
    background: linear-gradient(135deg, rgba(59, 130, 217, 0.08), rgba(91, 168, 232, 0.04));
    border-radius: 0 14px 14px 0;
    font-style: italic;
    font-size: 18px;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content img {
    border-radius: var(--ks-radius-sm);
    margin: 24px auto;
    box-shadow: var(--ks-shadow-light);
}
.entry-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--ks-accent);
}
.entry-content pre {
    background: var(--ks-bg-medium);
    padding: 20px;
    border-radius: var(--ks-radius-sm);
    overflow-x: auto;
    border: 1px solid var(--ks-border);
}

.single-post-tags {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--ks-border);
    font-size: 13px;
}
.tag-label { font-weight: 700; color: #fff; margin-inline-end: 8px; }
.single-post-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-pill);
    color: var(--ks-text-dim);
    margin: 0 4px 6px;
    transition: all .2s;
}
.single-post-tags a:hover { background: var(--ks-secondary); color: #fff; border-color: var(--ks-secondary); }

/* Post navigation */
.post-navigation {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--ks-border);
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 640px) { .post-navigation { grid-template-columns: 1fr 1fr; } }
.post-navigation a {
    display: block;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-sm);
    transition: all .25s;
}
.post-navigation a:hover {
    border-color: var(--ks-secondary);
    transform: translateY(-2px);
    background: rgba(59, 130, 217, 0.08);
}
.post-navigation .nav-sub {
    display: block;
    font-size: 12px;
    color: var(--ks-accent);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--ks-font-en);
}
.post-navigation .nav-title { font-size: 15px; font-weight: 600; color: #fff; }

/* Service single page */
.service-single-header { text-align: center; margin-bottom: 32px; padding: 60px 0 0; }
.service-single-icon {
    width: 88px; height: 88px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--ks-secondary), var(--ks-primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: var(--ks-shadow-soft);
}
.service-single-title { font-size: clamp(28px, 4vw, 42px); color: #fff; }
.service-single-excerpt { font-size: 18px; max-width: 640px; margin: 16px auto 0; color: var(--ks-text-dim); }
.service-single-thumb { margin: 32px 0; border-radius: var(--ks-radius); overflow: hidden; }
.service-single-cta {
    margin-top: 56px;
    text-align: center;
    padding: 48px 32px;
    background: linear-gradient(135deg, rgba(59, 130, 217, 0.12), rgba(26, 58, 110, 0.25));
    border: 1px solid rgba(59, 130, 217, 0.3);
    border-radius: var(--ks-radius);
}
.service-single-cta h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #fff;
    border: 0;
    padding: 0;
}
.service-single-cta p { margin-bottom: 24px; color: var(--ks-text-dim); }

/* Single project hero */
.project-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 180px 0 80px;
    margin-top: -78px;
}
.project-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(4px);
    transform: scale(1.05);
}
.project-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 20, 33, 0.7), rgba(13, 20, 33, 0.95));
}
.project-hero-content { position: relative; z-index: 2; }
.project-title { font-size: clamp(28px, 5vw, 48px); color: #fff; margin-bottom: 16px; }

.project-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding: 28px;
    background: var(--ks-bg-medium);
    border-radius: var(--ks-radius);
    border: 1px solid var(--ks-border);
    margin: -40px auto 40px;
    position: relative;
    z-index: 2;
}
.project-stat-value { font-size: 26px; font-weight: 900; color: var(--ks-accent); font-family: var(--ks-font-en); }
.project-stat-label { font-size: 13px; color: var(--ks-text-dim); }
.project-progress-bar { height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.project-progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--ks-secondary), var(--ks-accent)); border-radius: 3px; transition: width 1.2s var(--ks-transition); }

/* ================================================================
 *  PAGE TEMPLATE — used for Contact Us, About, Privacy, etc.
 * ================================================================ */

/* Branded header strip with two soft glow shapes — matches the
   theme's hero aesthetic without taking the full viewport. */
.page-header {
    position: relative;
    overflow: hidden;
    padding: 140px 0 70px;
    margin-top: calc(-1 * var(--ks-header-h, 78px));
    background:
        radial-gradient(ellipse at top right, rgba(59, 130, 217, 0.18), transparent 55%),
        radial-gradient(ellipse at bottom left, rgba(26, 58, 110, 0.45), transparent 55%),
        linear-gradient(180deg, var(--ks-bg-dark) 0%, var(--ks-bg-medium) 100%);
    border-bottom: 1px solid var(--ks-border);
    text-align: center;
}
.page-header-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.page-header-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
}
.page-header-shape-1 {
    width: 320px; height: 320px;
    background: var(--ks-secondary);
    top: -100px; right: -80px;
}
.page-header-shape-2 {
    width: 260px; height: 260px;
    background: var(--ks-accent);
    bottom: -100px; left: -60px;
}
.page-header > .container { position: relative; z-index: 1; }

.page-breadcrumbs {
    font-size: 13px;
    color: var(--ks-text-dim);
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-pill);
    backdrop-filter: blur(10px);
}
.page-breadcrumbs a {
    color: var(--ks-accent);
    transition: color .2s;
}
.page-breadcrumbs a:hover { color: #fff; }
.page-breadcrumbs-sep { opacity: 0.4; }

.page-header-title {
    font-size: clamp(28px, 5vw, 44px);
    color: #fff;
    line-height: 1.2;
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}
.page-header-excerpt {
    font-size: 17px;
    line-height: 1.7;
    color: var(--ks-text-dim);
    max-width: 680px;
    margin: 0 auto;
}

/* Page body main area */
.page-main { padding: 70px 0 90px; }

.page-thumb {
    margin: 0 0 48px;
    border-radius: var(--ks-radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: var(--ks-shadow);
}
.page-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Article content block — gets the same .entry-content typography but
   with a card-like background for separation from the page bg. */
.page-article.entry-content {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: 40px 36px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
@media (max-width: 640px) {
    .page-article.entry-content { padding: 28px 22px; }
}

/* If the page is empty (no content), don't show an empty card. */
.page-article.entry-content:empty { display: none; }

/* When a contact section is appended automatically, give it some breathing
   room and make it look continuous with the page article above. */
.page-main .contact-section { margin-top: 0; }


.archive-title { font-size: clamp(28px, 5vw, 44px); color: #fff; }
.archive-description { font-size: 16px; max-width: 640px; margin: 12px auto 0; color: var(--ks-text-dim); }

/* ----- Single post meta inside the branded header ----- */
.single-post-header .single-post-meta {
    margin-top: 18px;
    font-size: 14px;
    color: var(--ks-text-dim);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.single-post-header .single-post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.single-post-header .single-post-meta .sep { opacity: 0.4; }
.single-post-header .single-post-meta a { color: var(--ks-accent); }
.single-post-header .single-post-meta a:hover { color: #fff; }

/* ----- Tag chips at the bottom of an article ----- */
.single-post-tags {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--ks-border);
    font-size: 13px;
}
.tag-label { font-weight: 700; color: #fff; margin-inline-end: 8px; }
.single-post-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-pill);
    color: var(--ks-text-dim);
    margin: 0 4px 6px;
    transition: all .2s;
}
.single-post-tags a:hover { background: var(--ks-secondary); color: #fff; border-color: var(--ks-secondary); }

/* ----- "No posts found" empty state for archives ----- */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--ks-text-dim);
}
.no-posts h2 { color: #fff; margin: 16px 0 8px; }
.no-posts svg { opacity: 0.3; margin: 0 auto; }
.no-posts form { max-width: 360px; margin: 24px auto 0; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px; height: 40px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--ks-border);
    border-radius: 10px;
    color: var(--ks-text-on-dark);
    font-weight: 600;
    transition: all .2s;
    font-family: var(--ks-font-en);
}
.pagination .page-numbers:hover,
.pagination .current {
    background: var(--ks-secondary);
    border-color: var(--ks-secondary);
    color: #fff;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
