:root {
    --gold-light: #F7D060;
    --gold-default: #DAA520;
    --gold-dark: #BD8C2D;
    --gold-soft: rgba(218, 165, 32, 0.14);
    --gold-border: rgba(218, 165, 32, 0.42);
    --font-sans: 'Poppins', 'Cairo', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --transition-fast: all 0.18s ease-out;
    --transition-medium: all 0.22s ease-out;
    --bg-primary: #101014;
    --bg-secondary: #16161c;
    --bg-surface: rgba(27, 27, 35, 0.88);
    --bg-surface-hover: rgba(38, 34, 26, 0.94);
    --bg-overlay: rgba(16, 16, 22, 0.72);
    --text-primary: #FAF7F0;
    --text-secondary: #D1CBC0;
    --border: rgba(218, 165, 32, 0.24);
    --shadow: rgba(0, 0, 0, 0.48);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition-medium);
    transition-property: background-color, color;
    overflow: hidden;
}

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-container {
    position: relative;
    display: flex;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 1;
}

.main-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url(../images/0.jpg) top center / cover no-repeat;
    z-index: -1;
    transition: transform 0.25s ease-out;
}

/* Let the background suit photo show faintly through the heavy smoked veil on non-Home sections */
body.non-home-active .main-content-overlay {
    opacity: 0;
}

html[dir="rtl"] .main-container::before {
    transform: scaleX(-1);
}

#sidebar {
    width: 256px;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    padding: 18px 12px;
    background-color: rgba(16, 16, 21, 0.92);
    border-right: 1px solid var(--border);
    box-shadow: 0 10px 28px var(--shadow);
    transition: transform 0.25s ease-out;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-default) var(--bg-secondary);
}

html[dir="rtl"] #sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.58);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

#main-content {
    flex-grow: 1;
    height: 100vh;
    height: 100dvh;
    position: relative;
    transition: margin 0.25s ease-out;
}

@media (min-width: 1025px) {
    html[dir="ltr"] #main-content {
        margin-left: 256px;
    }

    html[dir="rtl"] #main-content {
        margin-right: 256px;
    }

    #sidebar .main-nav {
        --nav-gap: 8px;
        flex: 1 1 auto;
        justify-content: center;
        gap: var(--nav-gap);
        margin-top: 0.8rem;
        margin-bottom: 0.45rem;
    }

    #sidebar .nav-btn {
        flex: 1 1 0;
        min-height: 38px;
        max-height: 50px;
        padding: 0 13px;
        font-size: 0.95rem;
    }

    #sidebar .nav-btn i {
        font-size: 1.04rem;
    }

    #sidebar .sidebar-footer {
        padding-top: 0.85rem;
    }
}

.main-content-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 25%, rgba(247, 208, 96, 0.06), transparent 55%),
        rgba(0, 0, 0, 0.26);
    pointer-events: none;
}

.person-photo {
    display: none;
}

.profile-container {
    text-align: center;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(218, 165, 32, 0.22);
}

.profile-image-wrapper {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    border-radius: 30%;
    padding: 3px;
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default), var(--gold-dark));
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.30);
}

.profile-image-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 30%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.09rem;
    font-weight: 800;
    margin-top: 0.72rem;
    color: var(--text-primary);
    letter-spacing: 0;
    white-space: nowrap;
    line-height: 1.25;
    width: 100%;
    display: block;
    text-align: center;
    font-family: Alegreya, serif !important;
}

html[dir="rtl"] .profile-name {
    font-size: 1.38rem;
    letter-spacing: 0;
    font-family: 'Cairo', sans-serif !important;
}

.social-links {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin-top: 0.72rem;
    width: 100%;
    direction: ltr;
}

.social-links a {
    color: var(--gold-light);
    transition: var(--transition-fast);
    border: 1.5px solid var(--gold-default);
    background-color: rgba(218, 165, 32, 0.08);
    border-radius: 9px;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    box-sizing: border-box;
    font-size: 0.82rem;
}

.social-links a:hover {
    transform: translateY(-2px);
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default));
    border-color: var(--gold-light);
    color: #0e0e11;
    box-shadow: 0 4px 16px rgba(218, 165, 32, 0.45);
}

.main-nav {
    --nav-gap: 6px;
    flex-grow: 1;
    margin-top: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: var(--nav-gap);
}

.nav-btn {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    font-weight: 600;
    padding: 8.5px 12px;
    background: none;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.93rem;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
    font-family: var(--font-sans);
    outline: none;
}

.nav-btn:focus-visible,
.sidebar-footer button:focus-visible,
.social-links a:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 2px;
}

.nav-btn:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: calc(-0.5 * var(--nav-gap, 6px) - 0.5px);
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(218, 165, 32, 0.46) 20%, rgba(247, 208, 96, 0.65) 50%, rgba(218, 165, 32, 0.46) 80%, transparent 100%);
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.nav-btn.active::after,
.nav-btn:hover::after {
    opacity: 0;
}

html[dir="rtl"] .nav-btn {
    text-align: right;
}

.nav-btn i {
    width: 24px;
    margin-right: 10px;
    font-size: 1.02rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    text-align: center;
}

html[dir="rtl"] .nav-btn i {
    margin-right: 0;
    margin-left: 10px;
}

.nav-btn:hover {
    background-color: var(--gold-soft);
    border-color: var(--border);
    color: var(--gold-light);
}

.nav-btn:hover i {
    color: var(--gold-light);
}

.nav-btn.active {
    background-image: linear-gradient(135deg, var(--gold-default), var(--gold-light));
    color: #101013;
    border-color: transparent;
    box-shadow: 0 6px 20px -4px rgba(218, 165, 32, 0.55);
}

.nav-btn.active i {
    color: #101013;
}

.sidebar-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: auto;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(218, 165, 32, 0.22);
}

.sidebar-footer button {
    width: 100%;
    height: 42px;
    border-radius: 10px;
    outline: none;
    border: 1px solid var(--gold-border);
    background-image: linear-gradient(135deg, var(--gold-default), var(--gold-light));
    color: #101013;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 800;
    font-size: 0.92rem;
    letter-spacing: 0.05em;
}

.sidebar-footer button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.45);
}

main section {
    display: none;
    padding: 3rem 3.25rem;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    animation: fadeIn 0.2s ease-out;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-default) var(--bg-secondary);
}

main section.active {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

main section:not(#home).active {
    display: block;
}

main section:not(#home) {
    background-color: rgba(11, 11, 15, 0.62);
    background-image: radial-gradient(circle at top right, rgba(218, 165, 32, 0.05), transparent 46%),
        radial-gradient(circle at bottom left, rgba(247, 208, 96, 0.03), transparent 42%);
}

.section-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    flex-shrink: 0;
    background-color: var(--bg-overlay);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2.15rem;
    font-weight: 700;
    color: var(--gold-light);
    padding-bottom: 0.85rem;
    margin-bottom: 1.85rem;
    position: relative;
    display: inline-block;
    letter-spacing: 0.01em;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60%;
    height: 3px;
    background-image: linear-gradient(to right, var(--gold-default), transparent);
}

html[dir="rtl"] .section-title::after {
    left: auto;
    right: 0;
    background-image: linear-gradient(to left, var(--gold-default), transparent);
}

#home.active {
    justify-content: center;
}

#home .home-content {
    max-width: 60%;
}

html[dir="rtl"] #home .home-content {
    text-align: right;
}

#home .home-title {
    font-family: Alegreya, serif !important;
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
    line-height: 1.1;
    animation: fadeInDown 0.5s ease-out;
}

html[dir="rtl"] #home .home-title {
    font-family: 'Aref Ruqaa', serif !important;
    font-weight: 700;
    font-size: 3.7rem;
    line-height: 1.38;
    letter-spacing: 0;
}

#home .home-subtitle {
    font-size: 1.85rem;
    margin-top: 1rem;
    color: var(--text-secondary);
    animation: fadeInUp 0.1s ease-out 0.1s;
    animation-fill-mode: backwards;
    min-height: 2.6rem;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

#home .typing-text {
    font-weight: 900;
    background-image: linear-gradient(90deg, var(--gold-light) 0%, var(--gold-default) 55%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 10px rgba(218, 165, 32, 0.35));
}

#home .typing-cursor {
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    color: var(--gold-default);
}

html[dir="rtl"] #home .typing-cursor {
    margin-left: 0;
    margin-right: 2px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: flex-start;
}

@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 3fr 2fr;
    }
}

.about-subtitle {
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--gold-light);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.about-description {
    color: var(--text-secondary);
    line-height: 1.85;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-description strong {
    color: var(--gold-light);
    font-weight: 600;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 1.1rem;
}

.about-details-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.about-details-item i {
    width: 20px;
    text-align: center;
    color: var(--gold-default);
}

.about-details-item strong {
    color: var(--text-primary);
}

.about-details-item span {
    color: var(--text-secondary);
}

.skills-categories-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.category-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--gold-light);
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--gold-default);
}

html[dir="rtl"] .category-title {
    padding-left: 0;
    padding-right: 1rem;
    border-left: none;
    border-right: 3px solid var(--gold-default);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 1.15rem;
}

.skill-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 1.35rem 0.95rem;
    text-align: center;
    border-radius: 10px;
    transition: var(--transition-fast);
    border-bottom: 2.5px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.skill-card:hover {
    transform: translateY(-4px);
    background-color: var(--bg-surface-hover);
    border-color: var(--gold-border);
    border-bottom-color: var(--gold-default);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.skill-logo-wrap {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.85rem;
}

.skill-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    transition: transform 0.25s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.skill-logo-invert {
    filter: brightness(0) invert(1);
}

.skill-card:hover .skill-logo {
    transform: scale(1.08);
}

.skill-card i {
    font-size: 2.6rem;
    color: var(--gold-default);
    margin-bottom: 0;
}

.skill-card h4 {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.35;
}

.skill-card:hover h4 {
    color: var(--text-primary);
}

.cert-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.85rem;
    padding: 1rem 1.2rem;
    background-color: #1c1c23;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(305px, 1fr));
    gap: 1.45rem;
}

.cert-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    overflow: hidden;
    content-visibility: auto;
    contain-intrinsic-size: auto 340px;
}

.cert-card:hover {
    transform: translateY(-4px);
    background-color: var(--bg-surface-hover);
    border-color: var(--gold-default);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.cert-card-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #131318;
    border: 1px solid rgba(218, 165, 32, 0.2);
    border-radius: 8px;
    padding: 0.45rem;
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.cert-card-preview img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

.cert-preview-shield {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.cert-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.9rem;
}

.cert-org-logos {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.cert-org-logo-wrap {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(218, 165, 32, 0.45);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.cert-org-logo-wrap.is-wide {
    width: 82px;
    padding: 4px 6px;
}

.cert-org-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.cert-org-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}

.cert-card-header .issuer {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gold-light);
    line-height: 1.35;
}

.cert-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.cert-category-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gold-light);
    background-color: var(--gold-soft);
    border: 1px solid var(--gold-border);
    padding: 2px 8px;
    border-radius: 5px;
    line-height: 1.4;
}

.cert-date-meta {
    font-size: 0.74rem;
    color: var(--text-secondary);
    opacity: 0.88;
}

.cert-card-body {
    flex-grow: 1;
}

.cert-card-body h4 {
    font-size: 1.04rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.45;
}

.cert-card-footer {
    margin-top: auto;
}

.cert-card-footer .view-cert-btn {
    text-decoration: none;
    color: #101013;
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default));
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 700;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.92rem;
}

.cert-card-footer .view-cert-btn:hover {
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.48);
    transform: translateY(-2px);
}

.portfolio-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.15rem 1.25rem;
    background-color: #1c1c23;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.portfolio-filters {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.portfolio-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(218, 165, 32, 0.18);
}

.project-search-box {
    position: relative;
    flex: 1 1 250px;
    max-width: 420px;
}

.project-search-box i {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--gold-default);
    font-size: 0.9rem;
    pointer-events: none;
}

html[dir="rtl"] .project-search-box i {
    left: auto;
    right: 14px;
}

#project-search {
    width: 100%;
    padding: 0.65rem 2.4rem 0.65rem 2.5rem;
    background-color: #131318;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    transition: var(--transition-fast);
}

html[dir="rtl"] #project-search {
    padding: 0.65rem 2.5rem 0.65rem 2.4rem;
}

#project-search::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

#project-search:focus {
    outline: none;
    border-color: var(--gold-default);
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.22);
}

.search-clear-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

html[dir="rtl"] .search-clear-btn {
    right: auto;
    left: 8px;
}

.search-clear-btn:hover {
    color: var(--gold-light);
    background-color: var(--gold-soft);
}

.portfolio-stats-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
}

.projects-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 6px 8px 6px 15px;
    border: 1px solid var(--gold-border);
    border-radius: 999px;
    background-color: rgba(218, 165, 32, 0.10);
    color: var(--gold-light);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}

html[dir="rtl"] .projects-count {
    padding: 6px 15px 6px 8px;
}

.projects-count-accent {
    background-color: rgba(218, 165, 32, 0.18);
    border-color: rgba(218, 165, 32, 0.55);
}

.projects-count-label {
    color: var(--gold-light);
}

#projects-count-number,
#certs-count-number,
.count-pill-badge {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default));
    color: #101013;
    font-size: 0.82rem;
    font-weight: 800;
}

.filter-btn {
    padding: 0.46rem 1.05rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    color: var(--gold-light);
    border-color: var(--gold-default);
    background-color: var(--gold-soft);
}

.filter-btn.active {
    background-image: linear-gradient(135deg, var(--gold-default), var(--gold-light));
    color: #101013;
    border-color: var(--gold-light);
    box-shadow: 0 4px 16px rgba(218, 165, 32, 0.36);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.2rem;
}

.portfolio-empty-msg {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--text-secondary);
    font-size: 1rem;
    border: 1px dashed var(--gold-border);
    border-radius: 10px;
    margin-top: 1rem;
    background-color: #1c1c23;
}

.portfolio-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: var(--bg-secondary);
    box-shadow: 0 8px 20px var(--shadow);
    aspect-ratio: 16 / 10;
    transition: border-color 0.2s ease;
    content-visibility: auto;
    contain-intrinsic-size: auto 220px;
}

.portfolio-item:hover {
    border-color: var(--gold-default);
}

.portfolio-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.4s ease;
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(8, 8, 10, 0.78);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.35s ease;
    text-align: center;
    padding: 1rem;
}

.portfolio-item:hover .portfolio-overlay,
.portfolio-item:focus-within .portfolio-overlay {
    opacity: 1;
}

.portfolio-item:hover img {
    transform: scale(1.08);
}

.portfolio-overlay h4 {
    color: var(--gold-light);
    font-size: 1.1rem;
    margin-bottom: 0.9rem;
    transform: translateY(16px);
    transition: transform 0.35s ease;
}

.portfolio-item:hover .portfolio-overlay h4,
.portfolio-item:focus-within .portfolio-overlay h4 {
    transform: translateY(0);
}

.overlay-links {
    display: flex;
    gap: 1.15rem;
    transform: translateY(16px);
    transition: transform 0.35s ease 0.08s;
}

.portfolio-item:hover .overlay-links,
.portfolio-item:focus-within .overlay-links {
    transform: translateY(0);
}

.overlay-links a,
.view-design-btn {
    color: var(--text-primary);
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(201, 162, 63, 0.14);
    border: 1px solid var(--gold-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    text-decoration: none;
}

.view-design-btn {
    cursor: pointer;
}

.overlay-links a:hover,
.view-design-btn:hover {
    background-color: var(--gold-default);
    color: #08080a;
    border-color: var(--gold-light);
    transform: scale(1.1);
}

/* Styles for design portfolio items */
.portfolio-item.design-item {
    background-color: rgba(14, 14, 17, 0.85);
}

.portfolio-item.design-item img {
    object-fit: contain;
}


.resume-summary-banner {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold-default);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 2.25rem;
}

html[dir="rtl"] .resume-summary-banner {
    border-left: 1px solid var(--border);
    border-right: 4px solid var(--gold-default);
}

.resume-role-title {
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 0.65rem;
    line-height: 1.45;
}

.resume-core-statement {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.resume-highlight-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    background: var(--gold-soft);
    border: 1px solid var(--gold-border);
    color: var(--gold-light);
    font-weight: 600;
    font-size: 0.94rem;
}

.resume-highlight-badge i {
    color: var(--gold-default);
}

.timeline-container {
    position: relative;
    padding: 1rem 0;
    margin-left: 1.5rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background-color: rgba(201, 162, 63, 0.28);
}

html[dir="rtl"] .timeline-container {
    margin-left: 0;
    margin-right: 1.5rem;
}

html[dir="rtl"] .timeline-container::before {
    left: auto;
    right: 20px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 60px;
}

html[dir="rtl"] .timeline-item {
    padding-left: 0;
    padding-right: 60px;
}

.timeline-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #08080a;
    font-size: 1.15rem;
    border: 4px solid var(--bg-primary);
}

html[dir="rtl"] .timeline-icon {
    left: auto;
    right: 0;
}

.timeline-date {
    color: var(--gold-light);
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
}

.timeline-content h4 {
    font-size: 1.22rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.timeline-content p {
    color: var(--text-secondary);
}

.cv-download-area {
    text-align: center;
    margin-top: 2.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.75rem;
}

.contact-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 12px 30px;
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    color: #08080a;
    text-decoration: none;
    font-weight: 800;
    border-radius: 8px;
    transition: var(--transition-fast);
    margin-top: 0;
}

.btn-download:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 24px rgba(218, 165, 32, 0.45);
}

.btn-download-secondary {
    background-image: none;
    background-color: rgba(218, 165, 32, 0.08);
    color: var(--gold-light);
    border: 1.5px solid var(--gold-default);
}

.btn-download-secondary:hover {
    background-color: rgba(218, 165, 32, 0.18);
    border-color: var(--gold-light);
    color: #fff6d6;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: #14141a;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

.form-input:focus {
    outline: none;
    background-color: #191922;
    border-color: var(--gold-default);
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.24);
}

.btn-submit {
    padding: 1rem 2rem;
    border: none;
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default));
    color: #101013;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    width: 100%;
}

.btn-submit:hover {
    box-shadow: 0 8px 24px rgba(218, 165, 32, 0.48);
    transform: translateY(-2px);
}

.scroll-animation {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.22s ease-out, transform 0.22s ease-out;
}

.scroll-animation.visible {
    opacity: 1;
    transform: translateY(0);
}

main section::-webkit-scrollbar {
    width: 10px;
}

main section::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

main section::-webkit-scrollbar-thumb {
    background-image: linear-gradient(to bottom, var(--gold-light), var(--gold-dark));
    border-radius: 10px;
    border: 2px solid var(--bg-secondary);
}

main section::-webkit-scrollbar-thumb:hover {
    background-image: linear-gradient(to bottom, #fff0a6, var(--gold-default));
}

#mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 50;
    width: 46px;
    height: 46px;
    background-color: rgba(20, 20, 25, 0.78);
    backdrop-filter: blur(8px);
    border: 1px solid var(--gold-default);
    border-radius: 12px;
    color: var(--gold-light);
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 6px 18px var(--shadow);
    transition: var(--transition-fast);
}

#mobile-menu-toggle:hover {
    background-color: var(--gold-default);
    color: #101013;
}

html[dir="rtl"] #mobile-menu-toggle {
    right: auto;
    left: 16px;
}

@media (max-width: 1280px) {
    main section {
        padding: 2.25rem;
    }

    .portfolio-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #home .home-content {
        max-width: 72%;
    }
}

@media (max-width: 1024px) {
    #mobile-menu-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .sidebar-backdrop {
        display: block;
    }

    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.is-open {
        transform: translateX(0);
    }

    html[dir="rtl"] #sidebar {
        transform: translateX(100%);
    }

    html[dir="rtl"] #sidebar.is-open {
        transform: translateX(0);
    }

    #main-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    main section {
        padding: 2rem;
        padding-top: 4.75rem;
    }

    .section-container {
        padding: 2rem;
    }

    .person-photo {
        width: 56%;
    }

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

    .portfolio-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    main section {
        padding: 1.35rem;
        padding-top: 4.75rem;
    }

    .section-container {
        padding: 1.45rem;
    }

    .section-title {
        font-size: 1.85rem;
        margin-bottom: 1.45rem;
    }

    #home .home-title {
        font-size: 2.55rem;
    }

    html[dir="rtl"] #home .home-title {
        font-size: 3.15rem;
    }

    #home .home-subtitle {
        font-size: 1.35rem;
    }

    #home .home-tagline {
        font-size: 0.95rem;
        margin-left: auto;
        margin-right: auto;
    }

    #home .home-content {
        max-width: 100%;
        text-align: center;
    }

    html[dir="rtl"] #home .home-content {
        text-align: center;
    }

    #home.active {
        align-items: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-subtitle {
        font-size: 1.2rem;
    }

    .about-details {
        font-size: 0.98rem;
    }

    .contact-form-grid {
        grid-template-columns: 1fr;
    }

    .person-photo {
        width: 80%;
        opacity: 0.16;
    }

    .cert-filters {
        padding: 0.9rem;
    }

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

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
        gap: 0.9rem;
    }

    .portfolio-toolbar {
        padding: 0.95rem;
    }

    .portfolio-meta-row {
        flex-direction: column;
        align-items: stretch;
    }

    .project-search-box {
        max-width: 100%;
        flex-basis: auto;
    }

    .portfolio-stats-group {
        justify-content: flex-start;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .portfolio-item {
        aspect-ratio: 4 / 3;
    }

    .portfolio-overlay {
        padding: 0.65rem;
    }

    .portfolio-overlay h4 {
        font-size: 1.06rem;
        font-weight: 700;
        line-height: 1.25;
        margin-bottom: 0.65rem;
    }

    .overlay-links {
        gap: 0.75rem;
    }

    .overlay-links a,
    .view-design-btn {
        width: 42px;
        height: 42px;
        font-size: 1.15rem;
    }

    .filter-btn {
        padding: 0.4rem 0.9rem;
        font-size: 0.84rem;
    }

    .projects-count {
        font-size: 0.82rem;
        padding: 5px 7px 5px 12px;
    }

    html[dir="rtl"] .projects-count {
        padding: 5px 12px 5px 7px;
    }

    #projects-count-number,
    #certs-count-number,
    .count-pill-badge {
        min-width: 26px;
        height: 26px;
        font-size: 0.76rem;
    }

    html[dir="ltr"] .timeline-date,
    html[dir="rtl"] .timeline-date {
        position: static;
        display: inline-block;
        margin-bottom: 0.55rem;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.65rem;
    }

    #home .home-title {
        font-size: 2.05rem;
    }

    html[dir="rtl"] #home .home-title {
        font-size: 2.55rem;
    }

    #home .home-subtitle {
        font-size: 1.15rem;
    }

    main section {
        padding: 0.85rem;
        padding-top: 4.5rem;
    }

    .section-container {
        padding: 1.1rem;
        border-radius: 12px;
    }

    .person-photo {
        opacity: 0.1;
    }

    .resume-summary-banner {
        padding: 1.15rem;
    }

    .resume-role-title {
        font-size: 1.05rem;
    }

    .resume-highlight-badge {
        font-size: 0.84rem;
        padding: 0.4rem 0.75rem;
    }

    .timeline-container {
        margin-left: 0;
        padding-left: 0;
    }

    .timeline-container::before {
        left: 17px;
    }

    html[dir="rtl"] .timeline-container {
        margin-right: 0;
        padding-right: 0;
    }

    html[dir="rtl"] .timeline-container::before {
        right: 17px;
    }

    .timeline-item {
        padding-left: 46px;
    }

    html[dir="rtl"] .timeline-item {
        padding-left: 0;
        padding-right: 46px;
    }

    .timeline-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
        left: 0;
    }

    html[dir="rtl"] .timeline-icon {
        left: auto;
        right: 0;
    }

    .timeline-content {
        padding: 1.15rem;
    }

    .cert-card-header {
        flex-wrap: wrap;
    }

    .cert-org-logo-wrap {
        width: 42px;
        height: 42px;
    }

    .cert-org-logo-wrap.is-wide {
        width: 74px;
    }

    #contact-form {
        padding: 1.35rem;
        margin-top: 2.5rem;
    }

    #contact-form::before {
        font-size: 1.35rem;
        margin-bottom: 1.65rem;
    }
}

@media (max-width: 459px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .portfolio-item {
        aspect-ratio: 6 / 5;
    }

    .portfolio-overlay {
        padding: 0.5rem;
    }

    .portfolio-overlay h4 {
        font-size: 0.98rem;
        font-weight: 700;
        line-height: 1.22;
        margin-bottom: 0.55rem;
    }

    .overlay-links {
        gap: 0.6rem;
    }

    .overlay-links a,
    .view-design-btn {
        width: 38px;
        height: 38px;
        font-size: 1.08rem;
    }

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

    #sidebar {
        width: min(256px, 86vw);
        padding: 16px 10px;
    }

    .profile-name {
        font-size: clamp(0.94rem, 4.1vw, 1.08rem);
    }

    html[dir="rtl"] .profile-name {
        font-size: clamp(1.18rem, 5vw, 1.36rem);
    }

    .social-links {
        gap: 5px;
    }

    .social-links a {
        font-size: 0.78rem;
    }
}

.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1010;
    background: transparent;
    border: 0;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
    text-decoration: none;
}

/* ==========================================================
   VIEW-ONLY PROTECTED CERTIFICATE VIEWER MODAL
   Displays full original certificate image with original
   aspect ratio & maximum available quality. No zoom, no
   crop, no download/save/print toolbar.
========================================================== */
.cert-viewer-overlay {
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.92);
    padding: 1.5rem;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

html[dir="rtl"] .modal-close {
    right: auto;
    left: 35px;
}

.cert-viewer-stage {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 94vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-viewer-image-frame {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 88vh;
    line-height: 0;
}

#cert-viewer-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 92vw;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
    opacity: 1;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

/* Transparent shield blocks direct image context-menu/drag targets */
.cert-viewer-shield {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}

@media (max-width: 768px) {
    .cert-viewer-overlay {
        padding: 0.75rem;
    }

    .modal-close {
        top: 10px;
        right: 16px;
        font-size: 34px;
    }

    html[dir="rtl"] .modal-close {
        right: auto;
        left: 16px;
    }

    #cert-viewer-image {
        max-width: 95vw;
        max-height: 82vh;
    }
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    margin-top: auto;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.5;
    line-height: 1.6;
}

.timeline-content {
    background-color: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold-default);
    transition: var(--transition-fast);
}

html[dir="rtl"] .timeline-content {
    border-left: 1px solid var(--border);
    border-right: 3px solid var(--gold-default);
}

.timeline-content:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--gold-border);
    border-left-color: var(--gold-default);
}

html[dir="rtl"] .timeline-content:hover {
    border-left-color: var(--gold-border);
    border-right-color: var(--gold-default);
}

.timeline-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.timeline-company {
    color: var(--gold-light);
    font-weight: 500;
    margin-bottom: 0.75rem;
    font-style: italic;
}

html[dir="ltr"] .timeline-date {
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default));
    color: #08080a;
    padding: 0.2rem 0.65rem;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    position: absolute;
    top: -10px;
    right: 1.5rem;
}

html[dir="rtl"] .timeline-date {
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default));
    color: #08080a;
    padding: 0.2rem 0.65rem;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    position: absolute;
    top: -10px;
    left: 1.5rem;
}

@media (max-width: 768px) {
    html[dir="ltr"] .timeline-date,
    html[dir="rtl"] .timeline-date {
        position: static;
        display: inline-block;
        margin-bottom: 0.55rem;
    }
}

.timeline-details {
    list-style-type: disc;
    padding-left: 1.25rem;
    margin-top: 0.85rem;
    color: var(--text-secondary);
}

html[dir="rtl"] .timeline-details {
    padding-left: 0;
    padding-right: 1.25rem;
}

.timeline-details li {
    margin-bottom: 0.5rem;
    line-height: 1.65;
}

#image-gallery-container {
    position: relative;
    width: 90%;
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gallery-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    opacity: 1;
}

#gallery-image.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(12, 12, 15, 0.78);
    backdrop-filter: blur(4px);
    color: var(--gold-light);
    border: 1px solid var(--gold-default);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: var(--transition-fast);
}

.gallery-nav-btn:hover {
    background-color: var(--gold-default);
    color: #08080a;
}

.gallery-nav-btn.prev {
    left: 10px;
}

.gallery-nav-btn.next {
    right: 10px;
}

html[dir="rtl"] .gallery-nav-btn.prev {
    left: auto;
    right: 10px;
}

html[dir="rtl"] .gallery-nav-btn.next {
    right: auto;
    left: 10px;
}

#gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(8, 8, 10, 0.85);
    border: 1px solid var(--border);
    color: var(--gold-light);
    padding: 5px 15px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 1020;
}

#contact .section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.contact-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    transition: var(--transition-medium);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.contact-card:hover {
    transform: translateY(-6px);
    background-color: var(--bg-surface-hover);
    border-color: var(--gold-default);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.contact-card i {
    font-size: 2.2rem;
    color: var(--gold-default);
    margin-bottom: 1rem;
}

.contact-card h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}

.contact-card p,
.contact-card p a {
    color: var(--text-secondary);
    text-decoration: none;
    word-break: break-word;
    transition: var(--transition-fast);
}

.contact-card p a:hover {
    color: var(--gold-light);
}

#contact-form::before {
    content: 'Or Send Me a Message Directly';
    display: block;
    text-align: center;
    font-size: 1.65rem;
    font-family: var(--font-serif);
    color: var(--gold-light);
    margin-bottom: 2rem;
}

html[dir="rtl"] #contact-form::before {
    content: 'أو أرسل لي رسالة مباشرة';
}

#contact-form {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 3rem;
    padding: 2.25rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

#form-status {
    min-height: 22px;
    font-weight: 600;
}

@media (max-width: 576px) {
    .timeline-content {
        padding: 1.15rem;
    }

    .contact-card {
        padding: 1.4rem 1.1rem;
    }

    #contact-form {
        padding: 1.35rem;
        margin-top: 2.25rem;
    }

    #contact-form::before {
        font-size: 1.35rem;
        margin-bottom: 1.5rem;
    }
}

/* ==========================================================
   SERVICES SECTION — 3D HERO EXPERIENCE & FULL-STACK CARDS
========================================================== */
.services-container {
    overflow: visible;
}

/* 3D Interactive Hero Stage (Zero backdrop-filter over WebGL) */
.services-hero-stage {
    position: relative;
    width: 100%;
    min-height: 360px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(218, 165, 32, 0.42);
    background: radial-gradient(circle at 75% 35%, rgba(218, 165, 32, 0.14), transparent 55%),
        linear-gradient(135deg, #111117 0%, #17151d 54%, #0f0f15 100%);
    box-shadow: 0 24px 52px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(247, 208, 96, 0.2);
    margin-bottom: 2.25rem;
    display: flex;
    align-items: center;
    padding: 2.25rem 2.6rem;
    isolation: isolate;
}

.services-3d-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.services-3d-webgl {
    display: block;
    width: 100%;
    height: 100%;
}

.services-hero-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(16, 16, 22, 0.95) 0%, rgba(16, 16, 22, 0.82) 40%, rgba(16, 16, 22, 0.1) 68%, rgba(16, 16, 22, 0.02) 100%);
}

html[dir="rtl"] .services-hero-vignette {
    background: linear-gradient(270deg, rgba(16, 16, 22, 0.95) 0%, rgba(16, 16, 22, 0.82) 40%, rgba(16, 16, 22, 0.1) 68%, rgba(16, 16, 22, 0.02) 100%);
}

.services-hero-content {
    position: relative;
    z-index: 3;
    max-width: 52%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.services-hero-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-light);
    background-color: #1f1b13;
    border: 1px solid rgba(218, 165, 32, 0.45);
    padding: 0.34rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

html[dir="rtl"] .services-hero-eyebrow {
    letter-spacing: 0.02em;
    text-transform: none;
}

.services-hero-title {
    margin-bottom: 1rem;
    font-size: 2.45rem;
}

.services-intro {
    color: var(--text-secondary);
    font-size: 1.02rem;
    line-height: 1.75;
    max-width: 540px;
    margin-bottom: 1.55rem;
}

.services-hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hero-highlight-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    padding: 0.5rem 0.92rem;
    border-radius: 10px;
    background-color: #1b1b24;
    border: 1px solid rgba(218, 165, 32, 0.34);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.hero-highlight-chip i {
    color: var(--gold-light);
    font-size: 0.88rem;
    transition: color 0.2s ease;
}

.hero-highlight-chip:hover {
    transform: translateY(-2px);
    border-color: var(--gold-light);
    background-color: #262218;
    box-shadow: 0 6px 16px rgba(218, 165, 32, 0.24);
}

.hero-highlight-chip.is-active {
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default));
    border-color: var(--gold-light);
    color: #101014;
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.42);
}

.hero-highlight-chip.is-active i {
    color: #101014;
}

/* Choreographed staggered entrance for hero elements */
@keyframes servicesHeroSlideUp {
    from {
        opacity: 0;
        transform: translate3d(0, 22px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

#services.active .services-hero-eyebrow {
    animation: servicesHeroSlideUp 0.52s cubic-bezier(0.22, 1, 0.36, 1) 0.04s both;
}

#services.active .services-hero-title {
    animation: servicesHeroSlideUp 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

#services.active .services-intro {
    animation: servicesHeroSlideUp 0.62s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

#services.active .services-hero-highlights {
    animation: servicesHeroSlideUp 0.66s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

/* 6-Column Grid: 3 Cards on Row 1 (span 2 each) + 2 Wide Cards on Row 2 (span 3 each) */
.services-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.4rem;
    perspective: 1200px;
}

.service-card {
    grid-column: span 2;
    position: relative;
    background: linear-gradient(160deg, #22222c 0%, #191922 100%);
    border: 1px solid rgba(218, 165, 32, 0.26);
    border-radius: 16px;
    padding: 1.85rem 1.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    overflow: hidden;
    transform-style: preserve-3d;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.24s ease,
        box-shadow 0.28s ease;
    will-change: transform, opacity;
}

/* Shimmering golden top accent beam on card hover */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--gold-default) 30%, var(--gold-light) 50%, var(--gold-default) 70%, transparent 100%);
    opacity: 0;
    transform: scaleX(0.35);
    transition: opacity 0.32s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2;
}

.service-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

.service-card-wide {
    grid-column: span 3;
}

/* Moving radial gold hover spotlight */
.service-card-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 30%), rgba(247, 208, 96, 0.16), transparent 65%);
    transition: opacity 0.25s ease;
}

.service-card:hover .service-card-glow {
    opacity: 1;
}

/* Staggered 3D Scroll / Reveal Animation */
.service-reveal {
    opacity: 0;
    transform: translate3d(0, 38px, -30px) rotateX(9deg) scale(0.965);
}

.service-reveal.is-revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0deg) scale(1);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
        transform 0.72s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms),
        border-color 0.24s ease,
        box-shadow 0.28s ease;
}

/* 3D Lift & Interactive Tilt on Hover (with multi-layer internal Z-depth) */
.service-card.is-revealed:hover {
    border-color: var(--gold-default);
    transform: perspective(1100px)
        translate3d(0, -10px, 18px)
        rotateX(var(--tilt-x, 0deg))
        rotateY(var(--tilt-y, 0deg));
    box-shadow: 0 26px 48px rgba(0, 0, 0, 0.62),
        0 0 0 1px rgba(247, 208, 96, 0.28),
        0 0 34px rgba(218, 165, 32, 0.18);
    transition: transform 0.14s ease-out, border-color 0.2s ease, box-shadow 0.24s ease;
}

.service-card-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.15rem;
    transform: translateZ(14px);
}

.service-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background-color: #262116;
    border: 1px solid var(--gold-border);
    color: var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        background-image 0.22s ease,
        box-shadow 0.26s ease,
        color 0.22s ease;
}

.service-card:hover .service-icon {
    transform: translateZ(24px) scale(1.06);
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default));
    border-color: var(--gold-light);
    color: #101014;
    box-shadow: 0 8px 22px rgba(218, 165, 32, 0.48);
}

.service-num {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: rgba(247, 208, 96, 0.45);
    letter-spacing: 0.04em;
    transition: color 0.22s ease, transform 0.26s ease;
}

.service-card:hover .service-num {
    color: var(--gold-light);
    transform: translateZ(18px);
}

.service-title {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    transform: translateZ(16px);
}

.service-desc {
    position: relative;
    z-index: 1;
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.68;
    transform: translateZ(10px);
}

.service-points {
    position: relative;
    z-index: 1;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    margin: 0.15rem 0 0.2rem;
    padding: 0;
    flex-grow: 1;
    transform: translateZ(12px);
}

.service-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.52rem;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #e6e0d5;
}

.service-points li i {
    color: var(--gold-light);
    font-size: 0.74rem;
    margin-top: 0.34rem;
    flex-shrink: 0;
}

/* Official Technology Logo Chips */
.service-tech-list {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.54rem;
    padding-top: 0.9rem;
    margin-top: 0.15rem;
    border-top: 1px solid rgba(218, 165, 32, 0.2);
    transform: translateZ(14px);
}

.tech-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.36rem 0.72rem;
    border-radius: 9px;
    background-color: #131319;
    border: 1px solid rgba(218, 165, 32, 0.28);
    color: var(--text-primary);
    font-size: 0.81rem;
    font-weight: 600;
    line-height: 1.1;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.tech-chip img {
    width: 19px;
    height: 19px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    transition: transform 0.2s ease;
}

.tech-logo-invert {
    filter: invert(1) brightness(1.18);
}

.service-card:hover .tech-chip {
    border-color: rgba(218, 165, 32, 0.45);
    background-color: #1a1815;
}

.tech-chip:hover {
    transform: translateY(-2px);
    border-color: var(--gold-light) !important;
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.25);
}

.tech-chip:hover img {
    transform: scale(1.12);
}

/* Workflow Strip with Golden Pipeline Line */
.workflow-section {
    margin-top: 2.75rem;
    padding-top: 2.3rem;
    border-top: 1px solid rgba(218, 165, 32, 0.22);
}

.workflow-heading {
    font-family: var(--font-serif);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 1.5rem;
}

.workflow-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.15rem;
}

.workflow-step {
    position: relative;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 1.38rem 1.25rem;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.22s ease,
        background-color 0.22s ease,
        box-shadow 0.25s ease;
}

.workflow-step:hover {
    border-color: var(--gold-default);
    background-color: var(--bg-surface-hover);
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45), 0 0 18px rgba(218, 165, 32, 0.14);
}

.workflow-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 30px;
    padding: 0 0.55rem;
    border-radius: 8px;
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default));
    color: #101014;
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.workflow-step h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}

.workflow-step p {
    font-size: 0.87rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Bottom CTA Bar */
.services-cta {
    margin-top: 2.4rem;
    padding: 1.85rem 2rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #21212a 0%, #1a1816 100%);
    border: 1px solid var(--gold-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.services-cta-text h3 {
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 0.3rem;
}

.services-cta-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.services-cta-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.services-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.78rem 1.45rem;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1.5px solid transparent;
}

.services-cta-btn.primary {
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-default));
    color: #101014;
}

.services-cta-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(218, 165, 32, 0.45);
}

.services-cta-btn.secondary {
    background-color: transparent;
    border-color: var(--gold-default);
    color: var(--gold-light);
}

.services-cta-btn.secondary:hover {
    background-color: var(--gold-soft);
    transform: translateY(-2px);
}

/* Tablet & Mobile Responsive Rules for Upgraded Services Section */
@media (max-width: 1180px) {
    .services-hero-stage {
        min-height: 320px;
        padding: 2rem;
    }

    .services-hero-content {
        max-width: 62%;
    }

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

    .service-card,
    .service-card-wide {
        grid-column: span 1;
    }

    .service-card-wide:last-child {
        grid-column: span 2;
    }

    .workflow-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .services-hero-stage {
        min-height: 295px;
        padding: 1.55rem 1.25rem;
        align-items: flex-end;
    }

    .services-hero-vignette,
    html[dir="rtl"] .services-hero-vignette {
        background: linear-gradient(0deg, rgba(16, 16, 22, 0.95) 0%, rgba(16, 16, 22, 0.72) 55%, rgba(16, 16, 22, 0.25) 100%);
    }

    .services-hero-content {
        max-width: 100%;
    }

    .services-hero-title {
        font-size: 1.85rem;
    }

    .services-intro {
        font-size: 0.94rem;
        margin-bottom: 1.1rem;
    }

    .services-grid,
    .workflow-steps {
        grid-template-columns: 1fr;
    }

    .service-card-wide:last-child {
        grid-column: span 1;
    }

    .service-card {
        padding: 1.4rem 1.2rem;
    }

    .services-cta {
        padding: 1.4rem 1.25rem;
    }

    .services-cta-actions {
        width: 100%;
    }

    .services-cta-btn {
        flex: 1;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    #services.active .services-hero-content {
        animation: none;
    }

    .service-reveal,
    .service-reveal.is-revealed {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .service-card.is-revealed:hover {
        transform: translateY(-4px) !important;
    }
}
