:root{
    --bg:#020617;
    --bg-soft:#0f172a;
    --card:#111c31;
    --card-2:#16233d;
    --text:#ffffff;
    --muted:#cbd5e1;
    --line:rgba(255,255,255,.08);
    --primary:#22d3ee;
    --primary-2:#3b82f6;
    --shadow:0 20px 60px rgba(0,0,0,.35);
}

*{
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
    background-color:#020617;
    min-height:100%;
}

html[lang="en"] .main-nav a{
    font-size:13px;
}

body{
    margin:0;
    min-height:100vh;
    min-height:100dvh;
    font-family:Arial, sans-serif;
    background-color:#020617;
    background:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        radial-gradient(circle at top right, rgba(34,211,238,.10), transparent 25%),
        radial-gradient(circle at top left, rgba(59,130,246,.10), transparent 30%),
        linear-gradient(180deg, #020617 0%, #081120 100%);
    background-size: 30px 30px, 30px 30px, 100% 100%, 100% 100%, 100% 100%;
    background-position: center top;
    background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat;
    color:var(--text);
    overflow-x:hidden;
}

body::before{
    content:"";
    position:fixed;
    inset:0;
    z-index:-1;
    background-color:#020617;
}

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

a:hover{
    color:#fff;
}

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

.container{
    width:min(1180px, calc(100% - 32px));
    margin:auto;
}

/* Header */
header{
    position:fixed;
    top:0;
    right:0;
    left:0;
    z-index:1000;
    padding:16px 0;
    transition:.3s ease;
    background:transparent;
}

header.scrolled{
    background:rgba(2,6,23,.72);
    backdrop-filter:blur(14px);
    border-bottom:1px solid var(--line);
}

.header-wrap{
    display:grid;
    grid-template-columns:auto 1fr auto;
    align-items:center;
    gap:20px;
}

.logo{
    font-size:20px;
    font-weight:800;
    letter-spacing:.3px;
    color:#fff;
    display:flex;
    align-items:center;
    gap:8px;
    white-space:nowrap;
}

.logo::before{
    content:"◆";
    color:var(--primary);
    font-size:14px;
}

.main-nav{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:16px;
    flex-wrap:wrap;
}

.main-nav a{
    color:#e2e8f0;
    font-size:14px;
    transition:.25s;
    white-space:nowrap;
}

.nav-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
}

.lang-btn{
    padding:10px 14px;
    border-radius:999px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.05);
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:52px;
}

.mail-btn{
    padding:12px 18px;
    border-radius:14px;
    background:linear-gradient(135deg, var(--primary), var(--primary-2));
    color:#03111f;
    font-weight:700;
    box-shadow:0 10px 30px rgba(34,211,238,.18);
}

/* Generic */
.section{
    padding:60px 0;
    scroll-margin-top:100px;
}

.section-title{
    font-size:36px;
    margin:0 0 12px;
    font-weight:800;
}

.section-subtitle{
    max-width:760px;
    color:var(--muted);
    line-height:1.9;
    margin:0 auto;
    opacity: .85;
}

.text{
    color:var(--muted);
    line-height:1.95;
}

/* Hero homepage */
.hero{
    padding: 120px 0 70px;
}

.hero-card{
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 32px;
    align-items: center;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.hero-content{
    display: flex;
    flex-direction: column;
    gap: 18px;
}


.hero-badge{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin-bottom: 0;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.05);
    color: #dbeafe;
    font-size: 14px;
}

.hero-badge::before{
    content:"";
    width:10px;
    height:10px;
    border-radius:50%;
    background:var(--primary);
    box-shadow:0 0 18px var(--primary);
}

.hero h1{
    margin:0;
    font-size:56px;
    line-height:1.15;
}

.hero .subtitle{
    margin: 0;
    font-size: 20px;
    line-height: 2;
    color: var(--text);
    max-width: 100%;
}

.hero-media{
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-actions{
    display:flex;
    justify-content:center;
    flex-wrap:wrap;
    gap:14px;
    margin-top:28px;
}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:14px 22px;
    border-radius:16px;
    font-weight:700;
    transition:.25s ease;
}

.btn-primary{
    background:linear-gradient(135deg, var(--primary), var(--primary-2));
    color:#03111f;
    box-shadow:0 12px 30px rgba(34,211,238,.18);
}

.btn-secondary{
    background:rgba(255,255,255,.05);
    border:1px solid var(--line);
    color:#fff;
}

.btn:hover{
    transform:translateY(-2px);
    box-shadow: 0 15px 40px rgba(34,211,238,.25);
}

.profile-card{
    position: relative;
    padding: 14px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 290px;
    margin: 0;
}

.profile-frame{
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.08);
    background: #0b1322;
}

.profile-frame img{
    width: 100%;
    aspect-ratio: 4 / 4.7;
    object-fit: cover;
}

.floating-chip{
    position: static;
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 18px;
    background: rgba(2,6,23,.8);
    border: 1px solid var(--line);
    color: #e2e8f0;
    font-size: 14px;
    text-align: center;
    backdrop-filter: blur(10px);
    max-width: 100%;
}

/* Cards */
.cards{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:18px;
    margin-top:34px;
}

.card{
    display:block;
    padding:24px;
    border-radius:24px;
    border:1px solid var(--line);
    background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
    transition: all .3s ease;
    box-shadow:var(--shadow);
}

.card:hover{
    transform: translateY(-8px) scale(1.02);
    border-color:rgba(34,211,238,.40); /* زيادة وضوح الإطار قليلاً */
    background:linear-gradient(180deg, rgba(34,211,238,.10), rgba(255,255,255,.03));
    /* الإضافة الجديدة: توهج ناعم يعكس الهوية التقنية */
    box-shadow: 0 15px 35px rgba(34,211,238, 0.15), var(--shadow);
}

.card .icon{
    width:58px;
    height:58px;
    border-radius:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:26px;
    background:rgba(34,211,238,.10);
    border:1px solid rgba(34,211,238,.18);
    margin-bottom:18px;
}

.card h3{
    margin:0 0 12px;
    font-size:22px;
}

.card p{
    margin:0;
    color:var(--muted);
    line-height:1.9;
    font-size:15px;
}

/* Inner pages */
.inner-hero{
    padding:150px 0 70px;
}

.inner-hero-box{
    position:relative;
    overflow:hidden;
    border:1px solid var(--line);
    border-radius:34px;
    padding:44px;
    background:
        radial-gradient(circle at top right, rgba(34,211,238,.12), transparent 26%),
        radial-gradient(circle at bottom left, rgba(59,130,246,.12), transparent 26%),
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
    box-shadow:var(--shadow);
}

.eyebrow{
    display:inline-block;
    margin-bottom:12px;
    color:var(--primary);
    font-size:14px;
    font-weight:700;
    letter-spacing:.4px;
}

.inner-hero h1{
    margin:0 0 12px;
    font-size:52px;
    line-height:1.15;
}

.inner-hero p{
    margin:0;
    max-width:820px;
    color:var(--muted);
    line-height:1.95;
    font-size:18px;
}

.quick-stats{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:18px;
    margin-top:28px;
}

.stat-box{
    padding:20px;
    border-radius:22px;
    border:1px solid var(--line);
    background:rgba(2,6,23,.34);
}

.stat-box strong{
    display:block;
    margin-bottom:8px;
    font-size:18px;
}

.stat-box span{
    color:var(--muted);
    line-height:1.8;
    font-size:14px;
}

/* content layout */
.content-grid{
    display:grid;
    grid-template-columns:300px 1fr;
    gap:24px;
    align-items:start;
}

.side-card{
    position:sticky;
    top:110px;
    padding:24px;
    border-radius:26px;
    border:1px solid var(--line);
    background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
    box-shadow:var(--shadow);
}

.side-card h3{
    margin:0 0 16px;
    font-size:22px;
}

.side-card ul{
    margin:0;
    padding:0;
    list-style:none;
}

.side-card li{
    padding:12px 0;
    border-bottom:1px solid rgba(255,255,255,.06);
    color:#dbeafe;
}

.side-card li:last-child{
    border-bottom:none;
}

.article-wrap{
    display:grid;
    gap:20px;
}

.article-card{
    padding:28px;
    border-radius:28px;
    border:1px solid var(--line);
    background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
    box-shadow:var(--shadow);
}

.article-card h2{
    margin:0 0 14px;
    font-size:28px;
}

.article-card p{
    margin:0;
    color:var(--muted);
    line-height:2;
    font-size:17px;
}

.cta-box{
    margin-top:22px;
    padding:30px;
    border-radius:30px;
    border:1px solid rgba(34,211,238,.18);
    background:linear-gradient(135deg, rgba(34,211,238,.12), rgba(59,130,246,.10));
    box-shadow:var(--shadow);
}

.cta-box h3{
    margin:0 0 10px;
    font-size:28px;
}

.cta-box p{
    margin:0 0 20px;
    color:#dbeafe;
    line-height:1.9;
}

/* footer */
footer{
    padding:30px 0 40px;
    border-top:1px solid var(--line);
    color:#94a3b8;
    text-align:center;
    margin-top:40px;
}

/* animation */
.fade{
    opacity:0;
    transform:translateY(30px);
    transition:.7s ease;
}

.fade.show{
    opacity:1;
    transform:translateY(0);
}

/* responsive */
@media (max-width: 1100px){
    .hero-card{
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content{
        align-items: center;
    }

    .hero-badge{
        margin-inline: auto;
    }

    .cards{
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-stats{
        grid-template-columns: 1fr;
    }

    .content-grid{
        grid-template-columns: 1fr;
    }

    .side-card{
        position: static;
        top: auto;
    }
}

@media (max-width: 760px){
    html, body{
        overflow-x: hidden;
    }

    .container{
        width: calc(100% - 24px);
    }

    header{
        padding: 12px 0;
    }

    .header-wrap{
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .logo{
        font-size: 16px;
        white-space: nowrap;
    }

    .main-nav{
        display: none;
    }

    .nav-actions{
        justify-content: flex-end;
    }

    .lang-btn{
        min-width: 48px;
        padding: 9px 12px;
    }

    .hero{
        padding: 100px 0 50px;
    }

    .hero-card{
        padding: 22px;
        border-radius: 24px;
        gap: 22px;
    }

    .hero .subtitle{
        font-size: 17px;
        line-height: 1.9;
    }

    .profile-card{
        max-width: 250px;
    }

    .section{
        padding: 50px 0;
    }

    .section-title{
        font-size: 28px;
        line-height: 1.25;
    }

    .section-subtitle{
        font-size: 15px;
        line-height: 1.9;
    }

    .cards{
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 24px;
    }

    .card{
        width: 100%;
        min-width: 0;
        padding: 20px;
    }

    .card h3{
        font-size: 24px;
        line-height: 1.25;
    }

    .card p{
        font-size: 15px;
        line-height: 1.8;
    }

    .inner-hero{
        padding: 100px 0 40px;
    }

    .inner-hero-box{
        padding: 22px;
        border-radius: 24px;
    }

    .inner-hero h1{
        font-size: 34px;
        line-height: 1.2;
    }

    .inner-hero p{
        font-size: 16px;
        line-height: 1.9;
    }

    .quick-stats{
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 20px;
    }

    .content-grid{
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .side-card{
        padding: 20px;
        border-radius: 22px;
    }

    .side-card h3{
        font-size: 24px;
    }

    .side-card li{
        padding: 10px 0;
        font-size: 15px;
        line-height: 1.7;
    }

    .article-wrap{
        gap: 16px;
    }

    .article-card{
        padding: 20px;
        border-radius: 22px;
        min-width: 0;
    }

    .article-card h2{
        font-size: 24px;
        line-height: 1.3;
    }

    .article-card p{
        font-size: 16px;
        line-height: 1.9;
        word-break: break-word;
    }

    .cta-box{
        padding: 22px;
        border-radius: 22px;
    }

    .cta-box h3{
        font-size: 24px;
        line-height: 1.3;
    }

    .cta-box p{
        font-size: 15px;
        line-height: 1.8;
    }
}
.menu-toggle{
    display:none;
    width:52px;
    height:52px;
    min-width:52px;
    border:none;
    border-radius:16px;
    background:rgba(255,255,255,.05);
    border:1px solid var(--line);
    color:#fff;
    font-size:26px;
    line-height:1;
    cursor:pointer;
}

.mobile-menu{
    display:none;
}

@media (max-width: 760px){
    header{
        padding:12px 0;
        overflow:visible;
    }

    .header-wrap{
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:10px;
    }

    .main-nav{
        display:none;
    }

    .menu-toggle{
        display:inline-flex;
        align-items:center;
        justify-content:center;
    }

    .mobile-menu{
        display:none;
        width:calc(100% - 24px);
        margin:12px auto 0;
        padding:16px;
        border:1px solid var(--line);
        border-radius:22px;
        background:rgba(2,6,23,.96);
        backdrop-filter:blur(14px);
        box-shadow:var(--shadow);
    }

    .mobile-menu.open{
        display:grid;
        gap:10px;
    }

    .mobile-menu a{
        display:flex;
        align-items:center;
        justify-content:center;
        min-height:50px;
        padding:14px 16px;
        border-radius:16px;
        color:#e2e8f0;
        background:rgba(255,255,255,.03);
        border:1px solid rgba(255,255,255,.05);
        font-size:16px;
        text-align:center;
    }

    .mobile-menu a:hover{
        background:rgba(34,211,238,.08);
    }
}

/* تأثير المؤشر البرمجي للنص التعريفي */
.hero .subtitle::after {
    content: '_';
    display: inline-block;
    color: var(--primary); /* نفس اللون السماوي الخاص بك */
    margin-left: 6px;
    font-weight: 800;
    animation: techBlink 1s step-end infinite;
}

/* حركة الوميض */
@keyframes techBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* حركة نبض خفيفة لزر التواصل */
.mail-btn {
    animation: softPulse 2.5s infinite;
}

@keyframes softPulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(34, 211, 238, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

/* ============================================
   الهيرو التفاعلي — خلفية ظفارية متحركة
   ============================================ */
.hero {
    position: relative;
    overflow: hidden;
    background: #050810; /* احتياطي قبل تحميل الـ canvas */
}

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5,8,16,0.1) 0%, rgba(5,8,16,0.25) 100%);
    pointer-events: none;
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

/* تحسينات لتباين النص فوق الخلفية المتحركة */
.hero .hero-content .subtitle,
.hero .hero-content .hero-note {
    color: #e8eef0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.hero .hero-badge {
    background: rgba(29, 158, 117, 0.12);
    border: 0.5px solid rgba(93, 202, 165, 0.4);
    color: #9FE1CB;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero .profile-frame {
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.hero .floating-chip {
    background: rgba(10, 10, 10, 0.6);
    border: 0.5px solid rgba(93, 202, 165, 0.25);
    color: #9FE1CB;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@media (prefers-reduced-motion: reduce) {
    .hero-canvas { animation: none; }
}
