/* ===== خطوط ثمانية - مطابقة لمجلد font وأسماء الملفات الدقيقة ===== */
@font-face {
    font-family: 'Thmanyah Serif Display';
    src: url('font/thmanyahserifdisplay-Regular.otf') format('opentype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Serif Display';
    src: url('font/thmanyahserifdisplay-Medium.otf') format('opentype');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Serif Display';
    src: url('font/thmanyahserifdisplay-Bold.otf') format('opentype');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('font/thmanyahsans-Light.otf') format('opentype');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('font/thmanyahsans-Regular.otf') format('opentype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('font/thmanyahsans-Medium.otf') format('opentype');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('font/thmanyahsans-Bold.otf') format('opentype');
    font-weight: 700;
    font-display: swap;
}

/* ===== الألوان والمتغيرات العامة لكامل الموقع والمشاريع ===== */
:root {
    --bg-main: #fff;
    --ink: #0b0b0b;
    --muted: #8a8a8a;
    --line: #e9e9e9;
    --pink: #FFC8DD;
    --green: #3CCB7F;
    --font-display: 'Thmanyah Serif Display', 'Rakkas', serif;
    --font-heading: 'Thmanyah Serif Display', 'Rakkas', serif;
    --font-body: 'Thmanyah Sans', 'IBM Plex Sans Arabic', sans-serif;
    --header-text: #0b0b0b;
    --pastel-pink: #FFC8DD;
    --arabah-main: #D4A373;
    --arabah-dark: #8D5B2F;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-main);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.9;
    overflow-x: hidden;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

/* تطبيق خط العناوين على الرئيسية والمشاريع الداخلية */
.logo,
.hero h1,
.h2,
.work .h2,
.row h3,
.about-title,
.about-heading,
.item h4,
.cert-top h4,
.cta h2,
.marquee-track,
.project-header h1,
.content-area h2,
.page-title {
    font-family: var(--font-heading) !important;
}

/* ===== الهيدر ===== */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    max-width: 1150px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--ink);
}

nav {
    display: flex;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    font-weight: 400;
    font-size: 1.02rem;
}

nav a:hover,
nav a.active {
    text-decoration: underline;
    text-underline-offset: 6px;
}

#lang-btn {
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 500;
    background: var(--ink);
    color: #fff;
    border: 1px solid var(--ink);
    border-radius: 30px;
    padding: 5px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#lang-btn:hover {
    background: #333;
}

/* ===== الحاوية والعناوين ===== */
.container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    scroll-margin-top: 80px;
}

.kicker {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 8px;
}

.h2 {
    font-weight: 400;
    font-size: clamp(1.9rem, 4.2vw, 3rem);
    line-height: 1.4;
    margin-bottom: 40px;
}

.work .h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
}

/* ===== قسم Hero ===== */
.hero {
    text-align: center;
    padding: 90px 0 70px;
    animation: rise 0.9s ease-out both;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 40px;
    padding: 4px 18px;
    font-size: 0.92rem;
    margin-bottom: 34px;
}

.chip::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
}

.hero h1 {
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.8rem);
    line-height: 1.35;
    max-width: 980px;
    margin: 0 auto 28px;
}

.hero p {
    max-width: 640px;
    margin: 0 auto 38px;
    color: var(--muted);
    font-size: 1.15rem;
}

.btn-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    padding: 12px 34px;
    border-radius: 40px;
    border: 1.5px solid var(--ink);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-dark {
    background: var(--ink);
    color: #fff;
}

.btn-dark:hover {
    background: var(--pink);
    color: var(--ink);
    border-color: var(--pink);
}

.btn-line {
    background: transparent;
}

.btn-line:hover {
    background: var(--ink);
    color: #fff;
}

/* ===== Marquee ===== */
.marquee {
    border-block: 1px solid var(--line);
    overflow: hidden;
    padding: 16px 0;
    margin-bottom: 110px;
    direction: ltr;
}

.marquee-track {
    display: flex;
    gap: 48px;
    width: max-content;
    animation: slide 28s linear infinite;
    font-size: 1.5rem;
    white-space: nowrap;
}

.marquee-track span::after {
    content: "✺";
    margin-inline-start: 48px;
    color: var(--pink);
}

@keyframes slide {
    to {
        transform: translateX(-50%);
    }
}

/* ===== قائمة المشاريع في الرئيسية ===== */
.work {
    margin-bottom: 120px;
}

.row {
    display: grid;
    grid-template-columns: 110px 1fr auto auto;
    align-items: center;
    gap: 28px;
    padding: 18px 12px;
    border-top: 1px solid var(--line);
    text-decoration: none;
    transition: background 0.25s;
}

.row:last-of-type {
    border-bottom: 1px solid var(--line);
}

.row:hover {
    background: var(--pink);
}

.row img {
    width: 110px;
    height: 76px;
    object-fit: cover;
    border-radius: 10px;
    background: #f3f3f3;
    display: block;
}

.row h3 {
    font-weight: 400;
    font-size: 1.6rem;
    line-height: 1.4;
}

.row small {
    color: var(--muted);
    font-size: 0.92rem;
}

.row:hover small {
    color: var(--ink);
}

.row .go {
    font-size: 1.5rem;
}

.more {
    text-align: center;
    margin-top: 36px;
}

/* ===== قسم عنّي ===== */
.about {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 60px;
    margin-bottom: 100px;
    align-items: center;
}

.about-title {
    font-weight: 700;
    font-size: clamp(1.4rem, 2.3vw, 1.8rem);
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: 12px;
}

.about-intro {
    font-size: 1.08rem;
    font-weight: 300;
    line-height: 1.85;
    margin-bottom: 22px;
    color: var(--ink);
}

.about-heading {
    font-weight: 400;
    font-size: clamp(1.35rem, 2.1vw, 1.7rem);
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: 12px;
}

.about p {
    font-size: 1.05rem;
    margin-bottom: 18px;
    max-width: 58ch;
}

/* ===== شارات المهارات (Badges) ===== */
.skills-stack-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
    perspective: 1200px;
}

.skills-stack {
    position: relative;
    width: 290px;
    height: 380px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.badge {
    position: absolute;
    width: 265px;
    padding: 13px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.22rem;
    font-weight: 500;
    user-select: none;
    direction: ltr;
    z-index: calc(10 - var(--i));
    transform: translateY(calc(var(--i) * 11px)) rotate(var(--rot-idle));
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.skills-stack:hover .badge,
.skills-stack.is-open .badge {
    transform: translateY(calc((var(--i) - 2) * 62px)) rotate(var(--rot-open)) scale(1.02);
}

.skills-stack .badge:hover,
.skills-stack.is-open .badge:active {
    transform: translateY(calc((var(--i) - 2) * 62px)) rotate(0deg) scale(1.06) !important;
    z-index: 25 !important;
}

.badge-blue {
    background: #EAF2FF;
    color: #2D68C4;
    border: 2px solid #C8DDFF;
    box-shadow: 0 10px 20px rgba(45, 104, 196, 0.12), inset 0 2px 4px #ffffff, inset 0 -3px 5px rgba(45, 104, 196, 0.12);
}

.badge-green {
    background: #ECF8EE;
    color: #2E8B57;
    border: 2px solid #C9F0D6;
    box-shadow: 0 10px 20px rgba(46, 139, 87, 0.12), inset 0 2px 4px #ffffff, inset 0 -3px 5px rgba(46, 139, 87, 0.12);
}

.badge-pink {
    background: #FFF0F4;
    color: #C94277;
    border: 2px solid #FFD0E2;
    box-shadow: 0 10px 20px rgba(201, 66, 119, 0.12), inset 0 2px 4px #ffffff, inset 0 -3px 5px rgba(201, 66, 119, 0.12);
}

.badge-yellow {
    background: #FEF9E7;
    color: #B58500;
    border: 2px solid #FDF0B8;
    box-shadow: 0 10px 20px rgba(181, 133, 0, 0.12), inset 0 2px 4px #ffffff, inset 0 -3px 5px rgba(181, 133, 0, 0.12);
}

.badge-purple {
    background: #F3EDFF;
    color: #6C4AB6;
    border: 2px solid #E0D3FF;
    box-shadow: 0 10px 20px rgba(108, 74, 182, 0.12), inset 0 2px 4px #ffffff, inset 0 -3px 5px rgba(108, 74, 182, 0.12);
}

/* ===== شريط الشاشات ===== */
.screens {
    margin-bottom: 120px;
}

.screens-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    direction: ltr;
    padding: 15px 0 25px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.screens-viewport::-webkit-scrollbar {
    height: 6px;
}

.screens-viewport::-webkit-scrollbar-thumb {
    background: #d8d8d8;
    border-radius: 10px;
}

.screens-track {
    display: flex;
    width: max-content;
    gap: 20px;
    padding: 0 24px;
}

.screens-track img {
    height: 380px;
    width: auto;
    min-width: 160px;
    border-radius: 22px;
    border: 1px solid var(--line);
    display: block;
    background: #f3f3f3;
    scroll-snap-align: center;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    user-select: none;
}

/* ===== الشهادات والمسيرة ===== */
.resume {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    margin-bottom: 120px;
}

.item {
    padding: 20px 0;
    border-top: 1px solid var(--line);
}

.item time {
    color: var(--muted);
    font-size: 0.9rem;
}

.item h4 {
    font-weight: 400;
    font-size: 1.35rem;
    line-height: 1.5;
}

.item p {
    color: var(--muted);
    font-size: 0.98rem;
}

.cert-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.cert-top h4 {
    font-weight: 400;
    font-size: 1.35rem;
    line-height: 1.5;
    direction: ltr;
}

.cert-top .btn {
    padding: 5px 20px;
    font-size: 0.9rem;
}

.cert-list {
    list-style: none;
    counter-reset: c;
}

.cert {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 13px 4px;
    border-top: 1px solid var(--line);
    text-decoration: none;
    counter-increment: c;
}

.cert::before {
    content: counter(c);
    color: var(--muted);
    font-size: 0.9rem;
    min-width: 20px;
}

.cert span {
    flex: 1;
    direction: ltr;
    text-align: right;
    font-weight: 400;
    font-size: 0.97rem;
}

html[lang="en"] .cert span {
    text-align: left;
}

a.cert:hover {
    background: var(--pink);
}

/* ===== تواصل معي ===== */
.cta {
    text-align: center;
    padding: 100px 0;
    border-top: 1px solid var(--line);
}

.cta h2 {
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.35;
    margin-bottom: 20px;
}

.cta p {
    color: var(--muted);
    max-width: 520px;
    margin: 0 auto 34px;
    font-size: 1.1rem;
}

.socials {
    display: flex;
    justify-content: center;
    gap: 26px;
    flex-wrap: wrap;
    margin-top: 34px;
}

.socials a {
    text-underline-offset: 5px;
}

footer {
    text-align: center;
    padding: 28px;
    color: var(--muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--line);
}

/* ===== تنسيق صفحات المشاريع (Projects Pages) ===== */
.page-title {
    text-align: center;
    font-size: clamp(2.2rem, 5vw, 3rem);
    margin: 30px 0 10px;
}

.page-subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 50px;
}

.all-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 35px;
    padding-bottom: 60px;
}

.project-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    transition: background 0.25s, transform 0.25s;
}

.project-card:hover {
    background: #fff7fa;
    transform: translateY(-4px);
}

.card-image {
    height: 200px;
    overflow: hidden;
    background: #f3f3f3;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-content {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-category {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.card-content p {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
    flex-grow: 1;
    line-height: 1.7;
}

.card-link {
    text-decoration: underline;
    text-underline-offset: 5px;
    align-self: flex-start;
    font-weight: 500;
}

.view-all-btn {
    display: inline-block;
    text-decoration: none;
    border: 1.5px solid var(--ink);
    padding: 11px 34px;
    border-radius: 40px;
    transition: 0.2s;
}

.view-all-btn:hover {
    background: var(--ink);
    color: #fff;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.fade-in {
    animation: rise 0.8s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== التجاوب المخصص لشاشات الجوال ===== */
@media (max-width: 860px) {
    .header-inner {
        padding: 14px 18px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        font-size: 1.45rem;
    }

    nav {
        display: flex;
        align-items: center;
        gap: 14px;
    }

    /* إخفاء الروابط الإضافية في الجوال ليبقى أنيقاً بسطر واحد */
    nav a[href="#about"],
    nav a[href="#certs"],
    nav a[href="#contact"] {
        display: none;
    }

    nav a[href="#work"],
    nav a[href="index.html"] {
        font-size: 0.95rem;
        font-weight: 500;
    }

    #lang-btn {
        padding: 4px 12px;
        font-size: 0.78rem;
    }

    .hero {
        padding: 50px 0 40px;
    }

    .hero h1 {
        font-size: 1.85rem;
        line-height: 1.45;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 10px;
    }

    .work {
        margin-bottom: 75px;
    }

    .row {
        grid-template-columns: 75px 1fr auto;
        gap: 14px;
        padding: 14px 6px;
    }

    .row img {
        width: 75px;
        height: 55px;
    }

    .row small {
        display: none;
    }

    .row h3 {
        font-size: 1.15rem;
    }

    .about {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 70px;
    }

    .about-title {
        font-size: 1.5rem !important;
    }

    .about-heading {
        font-size: 1.35rem !important;
    }

    .about-intro, .about p {
        font-size: 1rem !important;
        line-height: 1.8;
    }

    .skills-stack-wrapper {
        padding: 20px 0 40px;
    }

    .skills-stack {
        width: 250px;
        height: 330px;
    }

    .badge {
        width: 240px;
        padding: 11px 16px;
        font-size: 1.05rem;
    }

    .skills-stack:hover .badge,
    .skills-stack.is-open .badge {
        transform: translateY(calc((var(--i) - 2) * 52px)) rotate(var(--rot-open)) scale(1);
    }

    .screens {
        margin-bottom: 75px;
    }

    .screens-track {
        padding: 0 16px;
        gap: 14px;
    }

    .screens-track img {
        height: 270px;
        min-width: 135px;
        border-radius: 16px;
    }

    .resume {
        grid-template-columns: 1fr;
        gap: 45px;
        margin-bottom: 80px;
    }

    .all-projects-grid {
        grid-template-columns: 1fr;
    }
}
