:root{--paper:#F7F8F6;--ink:#14201B;--muted:#5B6B66;--line:#DCE3DF;--accent:#0F5C55;--accent-dark:#0b4a45;--card:#fff;--tint:#E3F1EE;--on-accent:#fff}
*{box-sizing:border-box}
html{scroll-padding-top:4.5rem}
@media(prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}
body{margin:0;background:var(--paper);color:var(--ink);font:400 1.0625rem/1.9 "IBM Plex Sans Arabic",Tahoma,sans-serif}
a{color:inherit}
:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.wrap{max-width:46rem;margin:0 auto;padding:0 1.5rem}
header{position:sticky;top:0;background:var(--paper);border-bottom:1px solid var(--line);z-index:5}
header .wrap{display:flex;justify-content:space-between;align-items:center;min-height:3.5rem}
.logo{font-weight:700;text-decoration:none}
nav{display:flex;gap:1.4rem;font-size:.95rem}
nav a{text-decoration:none;color:var(--muted)}
nav a:hover{color:var(--accent)}
.hero{padding:5rem 0 3rem}
.hero small{color:var(--muted);font-size:1rem}
h1{font-size:clamp(2.8rem,10vw,5.5rem);line-height:1.15;font-weight:700;margin:.4rem 0 1.2rem;border-inline-start:.4rem solid var(--accent);padding-inline-start:1.2rem}
.tags{display:flex;flex-wrap:wrap;gap:.6rem;margin:0 0 1.5rem;padding:0;list-style:none}
.tags li{border:1px solid var(--line);border-radius:2rem;padding:.1rem 1rem;font-size:.9rem;background:var(--card)}
.lead{max-width:38rem;color:var(--muted)}
section{padding:3rem 0;border-top:1px solid var(--line)}
h2{font-size:1.7rem;margin:0 0 .5rem}
.sub{color:var(--muted);margin:0 0 1.5rem}
.post{display:block;text-decoration:none;padding:1.1rem 0;border-bottom:1px solid var(--line)}
.post:hover h3{color:var(--accent)}
.post h3{margin:.2rem 0;font-size:1.25rem}
.meta{display:flex;gap:1rem;font-size:.85rem;color:var(--muted)}
form{display:grid;gap:1rem;max-width:34rem}
label{font-size:.9rem;color:var(--muted)}
input,textarea{width:100%;font:inherit;padding:.7rem .9rem;border:1px solid var(--line);border-radius:.5rem;background:var(--card);color:var(--ink)}
textarea{min-height:8rem;resize:vertical}
.hp{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);opacity:0;pointer-events:none}
html,body{overflow-x:hidden}
button{font:inherit;font-weight:600;background:var(--accent);color:var(--on-accent);border:0;border-radius:.5rem;padding:.8rem 1.6rem;cursor:pointer;justify-self:start}
button:hover{background:var(--accent-dark)}
.note{padding:.8rem 1rem;border-radius:.5rem;margin:0 0 1rem;max-width:34rem}
.ok{background:var(--tint);color:var(--accent-dark)}.err{background:#FBE9E7;color:#8a2a1f}
footer{padding:2rem 0 3rem;border-top:1px solid var(--line);color:var(--muted);font-size:.9rem}
footer .wrap{display:flex;justify-content:space-between;flex-wrap:wrap;gap:1rem}
footer a{margin-inline-end:1rem}
article{padding:4rem 0}
article h1{font-size:clamp(2rem,6vw,3rem);border:0;padding:0}
article p{max-width:38rem}
@media(max-width:560px){header{position:static}html{scroll-padding-top:1rem}header .wrap{flex-wrap:wrap;justify-content:center;row-gap:0;padding-top:.5rem;padding-bottom:.4rem;min-height:0}.logo{width:100%;text-align:center;white-space:nowrap}nav{width:100%;justify-content:space-between;gap:.4rem;font-size:.9rem;padding-bottom:.2rem}nav a{white-space:nowrap}}
nav a[aria-current]{color:var(--accent);font-weight:600}
.job{display:grid;grid-template-columns:9.5rem 1fr;gap:1rem;padding:1.3rem 0;border-bottom:1px solid var(--line)}
.job .when{color:var(--muted);font-size:.9rem}
.job h3{margin:0;font-size:1.15rem;line-height:1.6}
.job .org{color:var(--accent);font-size:.95rem}
.job ul{margin:.5rem 0 0;padding-inline-start:1.2rem;color:var(--muted);font-size:.98rem;line-height:1.8}
.list{padding:0;margin:0;list-style:none}
.list li{padding:.6rem 0;border-bottom:1px solid var(--line)}
.list small{display:block;color:var(--muted)}
.empty{padding:1.5rem 0;color:var(--muted)}
.more{display:inline-block;margin-top:.5rem;color:var(--accent);font-weight:600}
@media(max-width:560px){.job{grid-template-columns:1fr;gap:.2rem}}
.statement{font-size:clamp(1.4rem,4vw,2rem);font-weight:600;line-height:1.6;margin:0 0 1.2rem;max-width:36rem}
.flow{list-style:none;margin:2.8rem 0 0;padding:0;display:grid;grid-template-columns:repeat(5,1fr);gap:.9rem}
.flow li{position:relative;padding-top:1.7rem}
.flow li::before{content:"";position:absolute;top:0;right:0;width:.85rem;height:.85rem;border-radius:50%;background:var(--accent)}
.flow li::after{content:"";position:absolute;top:.4rem;right:1rem;left:-.9rem;height:2px;background:var(--line)}
.flow li:last-child::after{display:none}
.flow b{display:block;font-size:1rem}
.flow span{display:block;font-size:.82rem;line-height:1.7;color:var(--muted)}
@media(max-width:600px){
.flow{grid-template-columns:1fr;gap:1.3rem}
.flow li{padding-top:0;padding-right:1.7rem}
.flow li::before{top:.55rem}
.flow li::after{top:1.4rem;bottom:-1.3rem;left:auto;right:.4rem;width:2px;height:auto}
}

.statement{text-wrap:balance}
.flow span{font-size:.9rem}

.steps{margin:.5rem 0 0;color:var(--muted);font-size:.95rem;line-height:1.8}

.hero-grid{display:grid;grid-template-columns:1fr 14rem;gap:2rem;align-items:center}
.hero-grid h1{font-size:clamp(2.6rem,7vw,4.4rem)}
.hero-photo{width:100%;height:auto;aspect-ratio:1/1;object-fit:cover;object-position:top;border-radius:1rem;display:block;background:var(--tint)}
.about-photo{float:left;width:9.5rem;height:9.5rem;object-fit:cover;object-position:top;border-radius:1rem;margin:.4rem 1.5rem 1rem 0}
@media(max-width:600px){
.hero-grid{grid-template-columns:1fr;gap:1.2rem}
.hero-photo{order:-1;width:9rem}
.about-photo{float:none;display:block;margin:0 0 1.2rem}
}

/* ===== محتوى ديناميكي ===== */
.tabs{display:flex;flex-wrap:wrap;gap:.6rem;margin:0 0 1rem}
.tabs a{border:1px solid var(--line);border-radius:2rem;padding:.1rem 1rem;font-size:.9rem;background:var(--card);text-decoration:none}
.tabs a[aria-current]{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.exc{margin:.2rem 0 .4rem;color:var(--muted);font-size:.98rem}
.pager{display:flex;gap:1rem;justify-content:space-between;padding-top:1rem}
.pager a{color:var(--accent);font-weight:600}
article .meta{margin-bottom:.4rem}
.post-cover{width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;border-radius:1rem;margin:1rem 0}
.prose{max-width:38rem}
.prose h2{font-size:1.45rem;margin:2rem 0 .4rem}
.prose h3{font-size:1.2rem;margin:1.6rem 0 .3rem}
.prose blockquote{margin:1rem 0;padding:.2rem 1rem;border-inline-start:.3rem solid var(--accent);color:var(--muted)}
.prose ul{padding-inline-start:1.3rem}
.prose a{color:var(--accent)}
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(10rem,1fr));gap:.9rem}
.gallery figure{margin:0}
.gallery a{display:block;aspect-ratio:1/1;overflow:hidden;border-radius:.7rem;background:var(--tint)}
.gallery img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .3s}
.gallery a:hover img{transform:scale(1.04)}
@media(prefers-reduced-motion:reduce){.gallery img{transition:none}}
.gallery figcaption{font-size:.85rem;color:var(--muted);padding:.3rem .1rem;line-height:1.6}
.lb{position:fixed;inset:0;background:rgba(10,20,17,.93);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:50;padding:1rem}
.lb[hidden]{display:none}
.lb img{max-width:94vw;max-height:78vh;border-radius:.5rem}
.lb-c{color:#e6ece9;margin:.8rem 0 0;text-align:center;max-width:40rem}
.lb button{position:absolute;background:rgba(255,255,255,.12);color:#fff;border:0;border-radius:50%;width:2.8rem;height:2.8rem;font-size:1.6rem;line-height:1;padding:0;cursor:pointer;justify-self:auto}
.lb button:hover{background:rgba(255,255,255,.25)}
.lb-x{top:1rem;left:1rem}.lb-n{left:1rem;top:50%}.lb-p{right:1rem;top:50%}

/* ===== المظهر ===== */
body.is-dark .err{background:#3a1f1c;color:#f3b8b0}
body.has-bg::before{content:"";position:fixed;inset:0;z-index:-1;background:var(--bgimg) center/cover no-repeat}
body.has-bg::after{content:"";position:fixed;inset:0;z-index:-1;background:var(--paper);opacity:var(--ov)}
body.has-bg header{background:color-mix(in srgb,var(--paper) 88%,transparent);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
@media(prefers-reduced-motion:no-preference){
body.anim-bg::before{animation:drift 45s ease-in-out infinite alternate}
@keyframes drift{from{transform:scale(1)}to{transform:scale(1.09) translate(-1.2%,1%)}}
body.anim-hero .hero small,body.anim-hero .hero h1,body.anim-hero .hero .tags,body.anim-hero .hero .lead,body.anim-hero .hero-photo{animation:rise .9s cubic-bezier(.2,.7,.2,1) both}
body.anim-hero .hero h1{animation-delay:.1s}body.anim-hero .hero .tags{animation-delay:.2s}body.anim-hero .hero .lead{animation-delay:.3s}body.anim-hero .hero-photo{animation-delay:.15s}
@keyframes rise{from{opacity:0;transform:translateY(22px)}to{opacity:1;transform:none}}
.rv{opacity:0;transform:translateY(20px);transition:opacity .8s ease,transform .8s ease}
.rv.in{opacity:1;transform:none}
}

/* ===== شاشات الكمبيوتر ===== */
@media(min-width:960px){
.wrap{max-width:74rem;padding:0 3rem}
header .wrap{min-height:4rem}
nav{gap:2rem;font-size:1rem}
.hero{padding:6rem 0 4.5rem}
.hero-grid{grid-template-columns:1fr 21rem;gap:5rem}
.hero-grid h1{font-size:clamp(3.6rem,6vw,5.6rem)}
.hero .lead{max-width:46rem;font-size:1.15rem}
.hero .flow{margin-top:3.5rem}
section{padding:4rem 0}
section:has(>h2){display:grid;grid-template-columns:14rem minmax(0,1fr);column-gap:4rem;align-items:start}
section:has(>h2)>h2{grid-column:1;grid-row:1/span 6;position:sticky;top:5.5rem;margin:0;font-size:1.5rem}
section:has(>h2)>:not(h2){grid-column:2;max-width:none}
section:has(>h2)>p,section:has(>h2)>.sub{max-width:46rem}
section:has(>h2)>form{max-width:44rem}
section:has(>h2)>.list:not(#how .list),section:has(>h2)>.job{max-width:56rem}
#how .list{display:grid;grid-template-columns:1fr 1fr;column-gap:3rem}
.list li{padding:.8rem 0}
.posts{display:grid;grid-template-columns:repeat(auto-fill,minmax(16rem,1fr));gap:1.3rem}
.posts .post{border:1px solid var(--line);border-radius:1rem;padding:1.4rem 1.5rem;background:var(--card);transition:border-color .2s,transform .2s}
.posts .post:hover{border-color:var(--accent);transform:translateY(-2px)}
.posts .post h3{font-size:1.2rem;line-height:1.7}
.posts .post .meta{margin-top:.8rem}
.gallery{grid-template-columns:repeat(auto-fill,minmax(14rem,1fr));gap:1.2rem}
article{max-width:48rem;margin:0 auto}
.post-cover{border-radius:1.2rem}
footer .wrap{padding-top:.5rem}
}
@media(min-width:1500px){
html{font-size:106%}
.wrap{max-width:80rem}
.hero-grid{grid-template-columns:1fr 24rem}
}
