/* ============================================================
   Unified Link Solutions — stylesheet
   LTR + RTL, light + dark, responsive.
   ============================================================ */

:root {
    --bg:        #ffffff;
    --bg-alt:    #f3f6fb;
    --surface:   #ffffff;
    --text:      #16202e;
    --muted:     #566579;
    --border:    #e0e6ef;
    --brand:     #b4191b;
    --brand-600: #8f1315;
    --brand-050: #fbeaea;
    --accent:    #0b6ea8;
    --danger:    #d64550;
    --ok:        #0f9d78;
    --radius:    14px;
    --shadow:    0 12px 32px rgba(16, 40, 80, 0.08);
    --maxw:      1120px;
    --nav-h:     72px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[dir="rtl"] {
    --font: "Segoe UI", Tahoma, "Geeza Pro", "Noto Naskh Arabic", "Noto Sans Arabic", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:        #14100f;
        --bg-alt:    #1d1615;
        --surface:   #221a19;
        --text:      #f0e9e8;
        --muted:     #c2b0ae;
        --border:    #3a2b2a;
        --brand:     #e8595a;
        --brand-600: #ef7273;
        --brand-050: #2c1c1c;
        --accent:    #4fa8d6;
        --shadow:    0 12px 32px rgba(0, 0, 0, 0.5);
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

[dir="rtl"] body { line-height: 1.9; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

ul { padding-inline-start: 1.1rem; }

:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Layout helpers ---------- */
.container { width: min(var(--maxw), 100% - 2.5rem); margin-inline: auto; }
.narrow { max-width: 760px; margin-inline: auto; }
.section { padding-block: clamp(2.75rem, 1.5rem + 5vw, 5rem); }
.section-alt { background: var(--bg-alt); }
.muted { color: var(--muted); }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .76rem;
    font-weight: 700;
    color: var(--brand);
    margin: 0 0 .6rem;
}
[dir="rtl"] .eyebrow { letter-spacing: 0; }

.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; inset-inline-start: -9999px; top: 0; z-index: 200;
    background: var(--brand); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 8px 8px;
}
.skip-link:focus { inset-inline-start: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--brand); color: #fff; border: 1.5px solid var(--brand);
    padding: .62rem 1.25rem; border-radius: 999px; font: inherit; font-weight: 600;
    cursor: pointer; transition: background .14s ease, transform .14s ease, box-shadow .14s ease;
}
.btn:hover { background: var(--brand-600); border-color: var(--brand-600); text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn-lg { padding: .85rem 1.7rem; font-size: 1.02rem; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-050); color: var(--brand); }

/* ---------- Header / nav ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; gap: 1rem;
    min-height: var(--nav-h);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); flex: none; margin-inline-end: auto; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.02rem; }
.brand-tag { font-size: .72rem; color: var(--muted); }

.site-nav { display: flex; align-items: center; }

.nav-toggle {
    display: none; width: 44px; height: 44px; padding: 0;
    background: none; border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.nav-toggle span:not(.sr-only) { display: block; width: 22px; height: 2px; margin: 4px auto; background: var(--text); transition: .2s; }

.menu { display: flex; align-items: center; }
.menu-list {
    display: flex; align-items: center; gap: .3rem;
    list-style: none; margin: 0; padding: 0;
}
.menu-list > li { position: relative; }
.menu-list > li > a {
    display: flex; align-items: center; gap: .3rem;
    padding: .55rem .7rem; border-radius: 8px;
    color: var(--muted); font-weight: 600; font-size: .93rem; white-space: nowrap;
}
.menu-list > li > a:hover,
.menu-list > li.active > a { color: var(--text); background: var(--brand-050); text-decoration: none; }

.caret { font-size: .7rem; }
.sub-toggle { display: none; }

.submenu {
    list-style: none; margin: 0; padding: .4rem;
    position: absolute; inset-inline-start: 0; top: calc(100% + 6px);
    min-width: 240px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: .16s;
    z-index: 20;
}
.menu-list > li.has-sub:hover .submenu,
.menu-list > li.has-sub:focus-within .submenu {
    opacity: 1; visibility: visible; transform: none;
}
.submenu a {
    display: block; padding: .5rem .7rem; border-radius: 8px;
    color: var(--text); font-size: .92rem; white-space: nowrap;
}
.submenu a:hover { background: var(--brand-050); text-decoration: none; }

/* ---------- Language switch ---------- */
.lang-switch { display: flex; gap: .1rem; flex: none; border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.lang-switch-menu { display: none; }
.lang-opt {
    padding: .3rem .62rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
    color: var(--muted); white-space: nowrap;
}
.lang-opt:hover { text-decoration: none; color: var(--text); }
.lang-opt.is-active { background: var(--brand); color: #fff; }
.lang-abbr { display: none; }

@media (max-width: 940px) {
    .brand-tag { display: none; }
    .nav-toggle { display: block; order: 2; }
    .site-nav { margin-inline-start: auto; }
    .lang-switch-header { display: none; }
    .lang-switch-menu { display: flex; align-self: flex-start; margin-bottom: .8rem; }
    .menu {
        position: fixed; inset-block: var(--nav-h) 0; inset-inline-end: 0;
        width: min(330px, 84vw);
        flex-direction: column; align-items: stretch;
        background: var(--surface); border-inline-start: 1px solid var(--border);
        padding: 1.1rem; overflow-y: auto;
        transform: translateX(105%); transition: transform .22s ease;
        box-shadow: var(--shadow);
    }
    [dir="rtl"] .menu { transform: translateX(-105%); }
    .menu.open { transform: none; }
    .menu-list { flex-direction: column; align-items: stretch; gap: 0; }
    .menu-list > li > a { padding: .85rem .5rem; font-size: 1rem; }
    .menu-list > li { border-bottom: 1px solid var(--border); }
    .has-sub { display: grid; grid-template-columns: 1fr auto; align-items: center; }
    .has-sub > a { grid-column: 1; }
    .caret { display: none; }
    .sub-toggle {
        display: block; grid-column: 2; background: none; border: 0; cursor: pointer;
        font-size: 1rem; color: var(--muted); padding: .5rem .6rem; transition: transform .18s ease;
    }
    .submenu {
        grid-column: 1 / -1; position: static; min-width: 0; box-shadow: none;
        border: 0; border-radius: 0; opacity: 1; visibility: hidden; transform: none;
        height: 0; overflow: hidden; padding: 0; transition: none;
    }
    .has-sub.sub-open .submenu { visibility: visible; height: auto; padding-block: .2rem .5rem; }
    .has-sub.sub-open .sub-toggle { transform: rotate(180deg); }
}

/* ---------- Hero ---------- */
.hero { background: radial-gradient(120% 120% at 100% 0%, var(--brand-050), transparent 60%); }
.hero-inner {
    display: grid; grid-template-columns: 1.2fr .8fr; gap: 2.5rem; align-items: center;
    padding-block: clamp(2.5rem, 1rem + 6vw, 5rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0; }
.hero-stats {
    display: flex; flex-wrap: wrap; gap: 1.5rem 2.2rem;
    list-style: none; margin: 1.8rem 0 0; padding: 0;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.15rem; }
.hero-stats span { font-size: .85rem; color: var(--muted); }

.hero-art { display: flex; justify-content: center; }
.hero-illus { width: 100%; max-width: 540px; height: auto; }

@media (max-width: 860px) {
    .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; }
    .hero-art { order: -1; }
    .hero-illus { max-width: 420px; }
}

/* ---------- Section headers ---------- */
.section-head { margin-bottom: 2rem; max-width: 70ch; }
.section-head h2 { margin-bottom: .4rem; }
.section-intro { color: var(--muted); font-size: 1.05rem; margin: 0; }
.section-head-row {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem;
}
.link-more { font-weight: 600; white-space: nowrap; }
.section-cta { margin-top: 2rem; }

.section h3 { margin-top: 1.6rem; }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
    scroll-margin-top: calc(var(--nav-h) + 20px);
}
.card h3 { margin: 0 0 .35rem; }
.card p { margin: 0; color: var(--muted); font-size: .96rem; }
.card-outline { box-shadow: none; border-inline-start: 4px solid var(--brand); }

/* Cards that lead with an illustration */
.card-media-card { display: flex; flex-direction: column; }
.card-media {
    display: block; width: 100%; height: auto; aspect-ratio: 8 / 5;
    object-fit: contain; border-radius: 10px; margin-bottom: 1rem;
}
.card-row { flex-direction: row; align-items: center; gap: 1.3rem; }
.card-row > div { flex: 1; }
.card-media-sm { width: 40%; max-width: 190px; flex: none; margin-bottom: 0; aspect-ratio: 8 / 5; }
@media (max-width: 560px) {
    .card-row { flex-direction: column; align-items: stretch; }
    .card-media-sm { width: 100%; max-width: none; }
}

/* About / section media split */
.media-split {
    display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center;
}
.media-split-img { width: 100%; height: auto; }
.media-split .section-head { margin-bottom: 1.5rem; }
@media (max-width: 820px) {
    .media-split { grid-template-columns: 1fr; gap: 1.5rem; }
    .media-split-img { order: -1; max-width: 360px; }
}

.feature { display: flex; gap: .8rem; align-items: flex-start; }
.feature-check {
    flex: none; width: 26px; height: 26px; border-radius: 50%;
    background: var(--brand-050); color: var(--brand);
    display: grid; place-items: center; font-weight: 800; font-size: .9rem;
}
.feature h3 { margin: 0 0 .2rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: .6rem 0 0; }
.chip {
    padding: .35rem .9rem; border-radius: 999px; font-size: .88rem; font-weight: 600;
    border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
a.chip:hover { color: var(--text); text-decoration: none; border-color: var(--brand); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-solid .chip { background: var(--brand-050); color: var(--brand); border-color: transparent; }
.filter-row { margin-bottom: 2rem; }

/* ---------- Split (about + CEO quote) ---------- */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; margin-top: 1.5rem; }
.split-aside blockquote {
    margin: 0; padding: 1.4rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    border-inline-start: 4px solid var(--brand);
}
.split-aside blockquote p { font-style: italic; color: var(--text); }
.split-aside blockquote footer { color: var(--muted); font-style: normal; font-size: .9rem; }
.split-aside .link-more { display: inline-block; margin-top: .8rem; }
@media (max-width: 780px) { .split { grid-template-columns: 1fr; } }

/* ---------- CEO page ---------- */
.ceo-card { display: flex; align-items: center; gap: 1rem; margin: 1.2rem 0 2rem; }
.ceo-avatar {
    width: 64px; height: 64px; border-radius: 50%; background: var(--brand-050);
    display: grid; place-items: center; font-size: 1.8rem; flex: none;
}
.ceo-name { margin: 0; }
.ceo-role { margin: 0; color: var(--muted); }

/* ---------- Prose ---------- */
.prose { max-width: 68ch; }
.prose p { color: var(--text); }
[dir="rtl"] .prose { max-width: 60ch; }

/* ---------- Blog ---------- */
.blog-grid { margin-top: .5rem; }
.post-card {
    display: flex; flex-direction: column; gap: .5rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow);
    color: var(--text); transition: transform .14s ease, border-color .14s ease;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--brand); text-decoration: none; }
.post-cover { font-size: 1.8rem; }
.post-cat {
    align-self: flex-start; font-size: .74rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--brand); background: var(--brand-050);
    padding: .2rem .6rem; border-radius: 999px;
}
[dir="rtl"] .post-cat { letter-spacing: 0; }
.post-card h3 { margin: 0; }
.post-card p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.post-date { font-size: .82rem; color: var(--muted); }

.post-meta { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.post-body { margin-bottom: 2rem; }

.pager { display: flex; align-items: center; gap: 1rem; justify-content: center; margin-top: 2.5rem; }
.pager-count { color: var(--muted); font-size: .9rem; }

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: 1.4fr .8fr; gap: 2.5rem; margin-top: 1.5rem; }
@media (max-width: 820px) { .contact-layout { grid-template-columns: 1fr; } }

.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field input, .field textarea {
    width: 100%; padding: .7rem .9rem; font: inherit;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 10px;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); outline: none; }
.field textarea { resize: vertical; }
.field-error { display: block; min-height: 1.1em; margin-top: .3rem; font-size: .85rem; color: var(--danger); }
.form-status { font-weight: 600; margin-top: 1rem; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }

.contact-info {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.contact-info h3 { margin-top: 0; }
.contact-info ul { list-style: none; padding: 0; margin: 0; }
.contact-info li { display: flex; gap: .6rem; padding: .45rem 0; align-items: flex-start; }

/* ---------- CTA band ---------- */
.cta { background: var(--brand); color: #fff; }
.cta-inner { text-align: center; padding-block: clamp(2.5rem, 1rem + 5vw, 4rem); }
.cta-inner h2 { color: #fff; max-width: 40ch; margin-inline: auto; }
.cta .btn { background: #fff; color: var(--brand); border-color: #fff; }
.cta .btn:hover { background: #eaf2fb; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); }
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 2rem;
    padding-block: 3rem 2rem;
}
.footer-col h4 { font-size: .95rem; margin-bottom: .6rem; }
.footer-brand { display: flex; align-items: center; gap: .55rem; margin-bottom: .6rem; }
.footer-logo { width: 34px; height: 34px; object-fit: contain; flex: none; }
.footer-about { color: var(--muted); font-size: .92rem; max-width: 42ch; }
.footer-links, .footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-links li, .footer-contact li { padding: .22rem 0; }
.footer-links a, .footer-contact a, .footer-contact li { color: var(--muted); font-size: .92rem; }
.footer-links a:hover, .footer-contact a:hover { color: var(--text); }
.footer-bar { border-top: 1px solid var(--border); }
.footer-bar-inner {
    display: flex; justify-content: space-between; gap: .5rem 1.5rem; flex-wrap: wrap;
    padding-block: 1.1rem; font-size: .85rem; color: var(--muted);
}
.footer-bar-inner p { margin: 0; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- Motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    html { scroll-behavior: auto; }
}
