/* ============================================================
   إعدادات عامة
============================================================ */
:root {
    --bg: #0a0908;
    --bg-alt: #141210;
    --red: #ff3b3b;
    --red-deep: #8f1d1d;
    --text: #f5f2ee;
    --muted: #a39c95;
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --header-h: 76px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Sans Arabic', 'Cairo', sans-serif;
}

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

a {
    text-decoration: none;
    color: inherit;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================================
   الهيدر والتنقل
============================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-h);
    z-index: 1000;
    background: rgba(10, 9, 8, 0.55);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.3s ease;
}

.header-inner {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.logo-mark {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--red);
    letter-spacing: -0.02em;
}

.logo-tag {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--muted);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    position: relative;
    padding: 6px 0;
    transition: color 0.25s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0%;
    height: 2px;
    background: var(--red);
    transition: width 0.25s ease;
}

.nav-link:hover {
    color: var(--red);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-cta {
    background: var(--red);
    color: #0a0908;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 999px;
    transition: transform 0.25s ease, background 0.25s ease;
}

.nav-cta::after {
    display: none;
}

.nav-cta:hover {
    background: #ff5c5c;
    color: #0a0908;
    transform: translateY(-2px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   العنصر المميز: eyebrow + مؤشر وامض
============================================================ */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: var(--red);
    margin-bottom: 14px;
}

.eyebrow.center {
    justify-content: center;
    width: 100%;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--red);
    animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ============================================================
   أقسام التمرير (Hero / Skills / About)
============================================================ */
.scroll-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

/* تخطيط منقسم: صورة + نص */
.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
}

.split-section.reverse {
    direction: ltr;
}

.split-section.reverse .text-col,
.split-section.reverse .media-col {
    direction: rtl;
}

.media-col {
    position: relative;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.media-col .bg-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.media-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(10,9,8,0) 55%, rgba(10,9,8,0.9) 100%);
}

.split-section.reverse .media-fade {
    background: linear-gradient(270deg, rgba(10,9,8,0) 55%, rgba(10,9,8,0.9) 100%);
}

.text-col {
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 40px) 5% 40px;
    background: var(--bg);
}

.content {
    max-width: 560px;
    width: 100%;
}

.content h1,
.content h2 {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 18px;
}

.content .lead,
.content p {
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    line-height: 1.85;
    color: var(--muted);
    margin-bottom: 16px;
}

.cta-row {
    display: flex;
    gap: 16px;
    margin-top: 26px;
    flex-wrap: wrap;
}

.cta-row.center {
    justify-content: center;
}

.btn {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 14px 30px;
    border-radius: 999px;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--red);
    color: #0a0908;
    box-shadow: 0 8px 30px -8px rgba(255, 59, 59, 0.6);
}

.btn-primary:hover {
    background: #ff5c5c;
    transform: translateY(-3px);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
    border-color: var(--red);
    color: var(--red);
    transform: translateY(-3px);
}

.stats-row {
    display: flex;
    gap: 32px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--red);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}

/* مؤشر التمرير */
.scroll-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.4;
    animation: floatDown 2.4s ease-in-out infinite;
    pointer-events: none;
}

.scroll-hint span {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.5);
}

.scroll-hint .mouse {
    width: 20px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    position: relative;
}

.scroll-hint .mouse::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 7px;
    border-radius: 3px;
    background: var(--red);
    animation: scrollWheel 1.8s ease-in-out infinite;
}

@keyframes floatDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

@keyframes scrollWheel {
    0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.3; transform: translateX(-50%) translateY(10px); }
}

/* ============================================================
   قسم المهارات (Transition)
============================================================ */
.skills-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-h) + 30px) 5% 40px;
}

.skills-section .bg-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

.media-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 30%, rgba(10,9,8,0.35), rgba(10,9,8,0.92));
    z-index: 1;
}

.skills-content {
    position: relative;
    z-index: 5;
    max-width: 780px;
    width: 100%;
    text-align: center;
}

.skills-content h2 {
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 30px;
    text-align: right;
}

.skill-chip {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px 18px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.skill-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.skill-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.skill-pct {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--red);
}

.skill-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.skill-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--red-deep), var(--red));
    border-radius: 4px;
    transform-origin: right;
    transform: scaleX(0);
}

/* ============================================================
   قسم الخدمات
============================================================ */
#services {
    position: relative;
    width: 100%;
    padding: 100px 5%;
    overflow: hidden;
    background: var(--bg-alt);
}

#services .bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    filter: saturate(1.1) brightness(0.55) contrast(1.1);
}

.services-content {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.services-content h2 {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    margin-bottom: 46px;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    text-align: right;
}

.card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 30px 24px;
    border-radius: 18px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 59, 59, 0.4);
}

.card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(255, 59, 59, 0.1);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

.card h3 {
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.card p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ============================================================
   قسم التواصل والفوتر
============================================================ */
.contact-section {
    position: relative;
    padding: 110px 5% 40px;
    text-align: center;
    background: var(--bg);
}

.contact-inner {
    max-width: 640px;
    margin: 0 auto;
}

.contact-inner h2 {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: clamp(1.8rem, 3.2vw, 2.4rem);
    margin-bottom: 16px;
}

.lead.center {
    text-align: center;
}

.site-footer {
    margin-top: 80px;
    padding: 24px 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
}

/* واتساب عائم */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px -6px rgba(0,0,0,0.6);
    z-index: 900;
    transition: transform 0.25s ease;
}

.whatsapp-float:hover {
    transform: scale(1.08);
}

.whatsapp-float svg {
    width: 28px;
    height: 28px;
}

/* ============================================================
   الاستجابة: تابلت (≤ 1024px)
============================================================ */
@media (max-width: 1024px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   الاستجابة: موبايل (≤ 860px) — تكديس الصورة فوق النص
============================================================ */
@media (max-width: 860px) {
    .main-nav {
        position: fixed;
        top: var(--header-h);
        right: 0;
        width: 100%;
        height: calc(100dvh - var(--header-h));
        background: rgba(10, 9, 8, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 28px;
        transform: translateX(100%);
        transition: transform 0.35s ease;
    }

    .main-nav.open {
        transform: translateX(0);
    }

    .nav-toggle {
        display: flex;
    }

    .split-section,
    .split-section.reverse {
        grid-template-columns: 1fr;
        direction: rtl;
        min-height: auto;
    }

    .media-col {
        height: 46vh;
        height: 46dvh;
    }

    .media-col .bg-media {
        object-fit: contain;
        background: #000;
    }

    .media-fade,
    .split-section.reverse .media-fade {
        background: linear-gradient(180deg, rgba(10,9,8,0) 60%, rgba(10,9,8,1) 100%);
    }

    .text-col {
        padding: 28px 6% 46px;
    }

    .content {
        max-width: 100%;
        background: var(--glass);
        border: 1px solid var(--glass-border);
        border-radius: 20px;
        padding: 22px;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .stats-row {
        flex-wrap: wrap;
        gap: 20px;
    }

    .skills-section {
        min-height: auto;
        padding: calc(var(--header-h) + 24px) 6% 60px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        text-align: right;
    }

    #services {
        padding: 70px 6%;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }

    .cta-row {
        justify-content: center;
    }

    .scroll-hint {
        display: none;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 16px;
        left: 16px;
    }
}

@media (max-width: 480px) {
    .content h1, .content h2 {
        font-size: clamp(1.5rem, 6vw, 1.9rem);
    }
    .btn {
        padding: 12px 22px;
        font-size: 0.88rem;
    }
    .logo-tag {
        display: none;
    }
}
