/* ===================================================
   PORTFOLIO - STYLE.CSS
   Mohamed Salah Abdelhamid
   =================================================== */

/* ── Root Variables (Obsidian & Liquid Gold Theme) ─────────── */
:root {
    /* ── Dark Mode (Obsidian + Metallic Gold) ── */
    --accent-color: #d4af37;
    --accent-secondary: #6ee7b7;
    --accent-glow: rgba(212, 175, 55, 0.22);
    --accent-glow-strong: rgba(212, 175, 55, 0.7);
    --bg-primary: #090a0f;
    --bg-secondary: #12141d;
    --section-overlay: rgba(9, 10, 15, 0.7);
    --body-overlay: rgba(9, 10, 15, 0.85);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --card-bg: rgba(18, 20, 29, 0.65);
    --card-border: rgba(212, 175, 55, 0.15);
    --card-inner-glow: inset 0 1px 1px rgba(212, 175, 55, 0.08);
    --nav-bg: rgba(9, 10, 15, 0.75);
    --gradient-primary: linear-gradient(135deg, #047857, #6ee7b7, #b38728, #a7f3d0, #065f46);
    --gradient-premium: linear-gradient(135deg, #d4af37, #6ee7b7);
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    --transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    --modal-bg: rgba(9, 10, 15, 0.98);
    --footer-bg: #050608;
    --footer-text: #e6edf3;

    --font-heading: 'Outfit', 'Cairo', sans-serif;
    --font-body: 'Inter', 'Cairo', sans-serif;
    --line-height-body: 1.8;
}

html.light {
    /* ── Light Mode (Pearl White + Deep Teal) — هوية مستقلة ── */
    --bg-primary: #f8fafc;
    --bg-secondary: #f0f9ff;
    --bg-alt: rgba(240, 249, 255, 0.85);
    --section-overlay: rgba(248, 250, 252, 0.88);
    --body-overlay: rgba(248, 250, 252, 0.97);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-color: #0d9488;
    --accent-secondary: #0891b2;
    --accent-glow: rgba(13, 148, 136, 0.18);
    --accent-glow-strong: rgba(13, 148, 136, 0.5);
    --gradient-primary: linear-gradient(135deg, #0d9488 0%, #0891b2 60%, #7c3aed 100%);
    --gradient-premium: linear-gradient(135deg, #0d9488 0%, #0891b2 100%);
    --card-bg: rgba(255, 255, 255, 0.88);
    --card-border: rgba(13, 148, 136, 0.18);
    --card-inner-glow: inset 0 1px 2px rgba(255, 255, 255, 1);
    --card-hover-shadow: 0 20px 40px rgba(13, 148, 136, 0.14);
    --nav-bg: rgba(248, 250, 252, 0.88);
    --modal-bg: rgba(255, 255, 255, 0.97);
    --footer-bg: #e0f2fe;
    --footer-text: #0f172a;
}

/* ── Reset ────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: inherit;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-primary); /* Base color moved here */
    /* Fallback system fonts while Google Fonts loads async */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: transparent; /* Transparent to reveal ::before */
    color: var(--text-primary);
    line-height: var(--line-height-body);
    overflow-x: hidden;
    transition: color 0.4s ease;
    letter-spacing: 0.01em;

    /* Professional Background Setup */
    background-attachment: fixed;
}

html.light body {
    background-image: none;
}

/* Subtle Film Grain Texture to remove AI feel */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.01;
    /* Removed will-change and transform to avoid creating unnecessary compositing layers */
}

html.light body::after {
    opacity: 0.03;
}

@keyframes backgroundOrbs {
    0% {
        transform: scale(1) translate(0, 0);
    }

    50% {
        transform: scale(1.1) translate(-2%, 2%);
    }

    100% {
        transform: scale(1) translate(2%, -2%);
    }
}

/* ── Background Elements ─────────────────────────── */
/* Animated/Static Matrix/Data Streams Background */
#data-flow-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    opacity: 0.15;
    will-change: transform;
}

html.light #data-flow-canvas {
    opacity: 0.05;
}

/* Subtle Animated Premium Orbs */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    /* Removed filter: blur(100px) because it causes severe lag.
       radial-gradient is already soft! */
    will-change: transform;
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
    transition: opacity 0.5s ease;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    top: -200px;
    left: -100px;
    opacity: 0.08;
    animation: orbFloat1 25s infinite ease-in-out alternate;
}

.orb-2 {
    width: 700px;
    height: 850px;
    background: radial-gradient(circle, #78350f 0%, transparent 70%);
    bottom: -250px;
    right: -100px;
    opacity: 0.12;
    animation: orbFloat2 35s infinite ease-in-out alternate;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: var(--accent-color);
    top: 40%;
    left: 60%;
    opacity: 0.1;
    animation: orbPulse 18s infinite ease-in-out alternate;
}

@keyframes orbFloat1 {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    100% {
        transform: translate(200px, 150px) rotate(90deg) scale(1.1);
    }
}

@keyframes orbFloat2 {
    0% {
        transform: translate(0, 0) scale(1.2);
    }

    100% {
        transform: translate(-200px, -200px) scale(0.9);
    }
}

@keyframes orbPulse {
    0% {
        transform: scale(1);
        opacity: 0.08;
    }

    100% {
        transform: scale(1.4);
        opacity: 0.15;
    }
}

html.light .bg-orb {
    opacity: 0.05;
    /* Even more subtle in light mode */
}

/* ── RTL (Arabic) Support ─────────────────────────── */
body.dir-rtl {
    direction: rtl;
    text-align: right;
}

body.dir-rtl .nav-links {
    flex-direction: row; /* Keep links in original order */
}

.navbar {
    direction: ltr !important; /* Force overall navbar layout to stay LTR */
}

body.dir-rtl .timeline-dot {
    left: auto;
    right: -37px;
}

body.dir-rtl .timeline {
    border-left: none;
    border-right: 2px solid var(--card-border);
    padding-left: 0;
    padding-right: 30px;
}

body.dir-rtl .contact-info-grid .info-item i,
body.dir-rtl .contact-item .icon-box {
    margin-right: 0;
    margin-left: 1rem;
}

body.dir-rtl .hero-desc,
body.dir-rtl .section-header p {
    margin-left: auto;
    margin-right: 0;
}

body.dir-rtl .section-header.text-center p,
body.dir-rtl .section-header.text-center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

body.dir-rtl .hero-btns i {
    margin-right: 0;
    margin-left: 8px;
}

body.dir-rtl .timeline-item ul li {
    padding-left: 0;
    padding-right: 20px;
}

body.dir-rtl .timeline-item ul li::before {
    left: auto;
    right: 0;
    content: "◁";
}

body.dir-rtl .service-card::after {
    left: auto;
    right: var(--mouse-x);
}

/* ── Loader ───────────────────────────────────────── */
.loader-wrapper {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Services Section ────────────────────────────── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.service-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        800px circle at var(--mouse-x) var(--mouse-y),
        rgba(212, 175, 55, 0.15),
        transparent 40%
    );
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: var(--bg-secondary);
}

html.light .service-card:hover {
    background: rgba(255, 255, 255, 0.98);
}

.service-icon {
    width: 65px;
    height: 65px;
    background: var(--accent-glow);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.service-card h3 {
    font-size: 1.45rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    flex: 1;
}

.service-card .btn-more {
    width: 100%;
    justify-content: center;
}

.modal-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 25px;
    justify-content: center;
}

.btn-service-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    color: #000000 !important;
}

.btn-khamsat {
    background-color: #FCB62E;
}

.btn-mostaql {
    background-color: #2386c8;
}

.btn-upwork {
    background-color: #6fda44;
}

.btn-fiverr {
    background-color: #1dbf73;
}

.btn-direct {
    background: var(--gradient-primary);
}

.btn-service-link:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* ── Utility ──────────────────────────────────────── */
.hidden {
    display: none !important;
}

.section-padding {
    padding: 120px 5%;
    background-color: transparent; /* Rely on section wrappers */
}

/* Glass Section Transition System */
section {
    background: linear-gradient(to bottom, var(--section-overlay), var(--bg-primary));
    /* تقليل backdrop-filter على الـ sections لتحسين الأداء */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    
    /* Performance Optimizations */
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
}

section.bg-alt {
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary), var(--bg-primary));
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.bg-alt {
    background-color: var(--bg-secondary);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.section-header {
    margin-bottom: 3rem;
}

.section-header.text-center {
    text-align: center;
}

.section-header h2 {
    font-size: 4.2rem; /* More authoritative title */
    font-family: var(--font-heading);
    font-weight: 950; /* Ultra-bold for pro look */
    margin-bottom: 0.5rem;
    letter-spacing: -1.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    text-shadow: 0 10px 20px var(--accent-glow);
}

.section-header h2 span:not(.highlight) {
    -webkit-text-fill-color: var(--text-primary);
}

.highlight {
    color: var(--accent-color);
}

.header-line {
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 4px;
    box-shadow: 0 4px 12px var(--accent-glow);
    margin-bottom: 2rem;
}

.header-line.center {
    margin: 0 auto 1.5rem;
}

/* Cleaner Section Header */
.section-header h2 {
    display: inline-block;
    position: relative;
    text-transform: uppercase;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin-top: 0.5rem;
}

body.dir-rtl .section-header h2::after {
    right: auto;
    left: -50px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 620px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.section-header.text-center p {
    margin: 0 auto;
}

h1,
h2,
h3,
h4,
.logo,
.nav-links a,
.btn {
    font-family: var(--font-heading);
}

/* ── Navbar ───────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 18px 0;
    z-index: 1000;
    background: transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 13px 0;
    border-bottom: 1px solid var(--card-border);
}

html.dark .navbar.scrolled {
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}

html.light .navbar.scrolled {
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.06);
    border-bottom: 1px solid rgba(13, 148, 136, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
}

.logo {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 1px;
    position: relative;
    padding: 5px 0;
    display: flex;
    align-items: center;
    transition: var(--transition);
    direction: ltr !important; /* Force LTR to prevent flipping in Arabic mode */
}

.logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    margin-left: 2px;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.4s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

.logo:hover::after {
    width: 100%;
}

.logo:hover {
    transform: scale(1.02);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    /* Ensures no overflow outside navbar on desktop */
}

/* === MOBILE NAV FIX: Hide links on small screens === */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100vh;
        background: rgba(9, 10, 15, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transition: right 0.45s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        z-index: 999;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
        /* Invisible when off-screen */
        visibility: hidden;
        opacity: 0;
    }

    html.light .nav-links {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: -10px 0 40px rgba(13, 148, 136, 0.1);
    }

    .nav-links.active {
        right: 0;
        visibility: visible;
        opacity: 1;
    }

    body.dir-rtl .nav-links {
        right: auto;
        left: -100%;
        flex-direction: column !important;
    }

    body.dir-rtl .nav-links.active {
        left: 0;
        right: auto;
    }

    .nav-links a {
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--text-primary);
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .nav-links.active a {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered entry for menu links */
    .nav-links.active li:nth-child(1) a { transition-delay: 0.08s; }
    .nav-links.active li:nth-child(2) a { transition-delay: 0.16s; }
    .nav-links.active li:nth-child(3) a { transition-delay: 0.24s; }
    .nav-links.active li:nth-child(4) a { transition-delay: 0.32s; }
    .nav-links.active li:nth-child(5) a { transition-delay: 0.40s; }
    .nav-links.active li:nth-child(6) a { transition-delay: 0.48s; }
    .nav-links.active li:nth-child(7) a { transition-delay: 0.56s; }
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
    transition: var(--transition);
    position: relative;
    padding-bottom: 4px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Controls */
.controls-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.control-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(212, 175, 55, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.lang-btn {
    font-weight: 800;
    font-size: 0.85rem;
    font-family: var(--font-heading);
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-primary);
    transition: var(--transition);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

/* ── Hero ─────────────────────────────────────────── */
.lightning-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

.letter-glitch-outer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(circle, rgba(9,10,15,0) 40%, rgba(9,10,15,1) 100%);
}

html.light .letter-glitch-outer {
    background: radial-gradient(circle, rgba(244,244,249,0) 40%, rgba(244,244,249,1) 100%);
}

.letter-glitch-center {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(circle, rgba(9,10,15,0.8) 0%, rgba(9,10,15,0) 60%);
}

html.light .letter-glitch-center {
    background: radial-gradient(circle, rgba(244,244,249,0.8) 0%, rgba(244,244,249,0) 60%);
}

.hero {
    min-height: 100vh;
    padding: 180px 5% 80px;
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Hero is always above the fold - override the section default */
    content-visibility: visible;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 4rem;
    position: relative;
    z-index: 10;
}

.hero-content {
    flex: 0.9;
    position: relative;
    z-index: 10;
    animation: slideInLeft 0.9s ease-out forwards;
    /* Added subtle text shadow for global legibility */
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}

body.dir-rtl .hero-content {
    animation: slideInRight 0.9s ease-out forwards;
}

.greeting {
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.greeting::before {
    content: '';
    width: 30px;
    height: 2px;
    background: var(--accent-color);
    display: inline-block;
}

body.dir-rtl .greeting::before {
    display: none;
}

body.dir-rtl .greeting::after {
    content: '';
    width: 30px;
    height: 2px;
    background: var(--accent-color);
    display: inline-block;
}.name {
    transition: letter-spacing 0.3s ease;
    font-size: 4.2rem;
    font-weight: 800;
    line-height: 1.05;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(212, 175, 55, 0.2), 0 2px 10px rgba(0, 0, 0, 0.8);
    letter-spacing: -1px;
    margin-bottom: 0.6rem;
    position: relative;
    z-index: 1;
}

body.dir-rtl .name {
    letter-spacing: 0;
}

.name br {
    display: block;
    content: "";
    margin-top: -10px;
}

.title {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    min-height: 1.2em;
    /* Ensure space for typed cursor even if temporary empty */
}

@keyframes fadeInUpPro {
    0% {
        opacity: 0;
        transform: translateY(15px);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.fade-in-up {
    animation: fadeInUpPro 0.8s cubic-bezier(0.2, 1, 0.3, 1) forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    max-width: 650px;
    line-height: 1.8;
    background: rgba(9, 10, 15, 0.4);
    padding: 1.2rem;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

html.light .hero-desc {
    background: rgba(13, 148, 136, 0.05);
    border-color: rgba(13, 148, 136, 0.15);
    text-shadow: none;
    color: var(--text-primary);
}

/* ── Action Area Coordination ───────────────────── */
.hero-action-area {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    margin-top: 1.5rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.hero-cv-btn {
    display: none;
    /* Removed as it's now inside .hero-btns */
}

@media (max-width: 1024px) {
    .hero-cv-btn {
        justify-content: center;
    }
}

.btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 800;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem; /* Slightly smaller + spaced = premium */
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    cursor: pointer;

    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #000000 !important; /* Pure black for maximum contrast on gold */
    box-shadow: 0 4px 18px var(--accent-glow);
    border: none;
    letter-spacing: 0.5px;
    font-weight: 800;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.35);
    filter: brightness(1.15);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.15);
}

/* CV Button - always lit, stronger hover */
.btn-cv {
    background: rgba(212, 175, 55, 0.10);
    color: var(--accent-color);
    border: 1.5px solid var(--accent-color);
    font-size: 0.95rem;
    box-shadow: 0 0 14px var(--accent-glow);
}

.btn-cv:hover {
    background: var(--accent-color);
    color: #000000 !important;
    border-color: var(--accent-color);
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 24px var(--accent-glow);
}

/* Social hero icons - Branded SVG support */
.social-links-hero {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
    z-index: 10;
}

.social-links-hero a {
    background: var(--card-bg);
    width: 44px; /* Slightly larger for SVGs */
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: 1px solid var(--card-border);
    padding: 10px; /* Space for the logo */
}

.social-links-hero a svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* ── Removed duplicate hero-content, greeting, name, title, hero-desc, hero-action-area, btn blocks (already defined above) ── */

.btn-cv:hover {
    background: var(--accent-color);
    color: #000000 !important;
    border-color: var(--accent-color);
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 24px var(--accent-glow);
}

/* Social hero icons - Branded SVG support */
.social-links-hero {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
    z-index: 10;
}

.social-links-hero a {
    background: var(--card-bg);
    width: 44px; /* Slightly larger for SVGs */
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: 1px solid var(--card-border);
    padding: 10px; /* Space for the logo */
}

.social-links-hero a svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: var(--transition);
}

.social-links-hero a:hover {
    transform: translateY(-4px) scale(1.1);
    background: rgba(255, 255, 255, 0.05);
}

/* Individual Brand Styling */
.social-icon-linkedin { color: #0077b5; }
.social-icon-github { color: #f0f6fc; }
.social-icon-mostaql { color: #2d77d7; }
.social-icon-khamsat { color: #b38728; }
.social-icon-freelancer { color: #29b2fe; }
.social-icon-email { color: var(--accent-color); }

/* Light Mode Visibility Overrides */
html.light .social-icon-github { color: #24292f; }
html.light .social-icon-email { color: var(--accent-color); }
html.light .social-links-hero a,
html.light .footer-social a {
    background: rgba(13, 148, 136, 0.06);
    border-color: rgba(13, 148, 136, 0.15);
}
html.light .social-links-hero a:hover {
    background: rgba(13, 148, 136, 0.12);
}

.social-links-hero a:hover.social-icon-linkedin { box-shadow: 0 0 15px rgba(0, 119, 181, 0.4); border-color: #0077b5; }
.social-links-hero a:hover.social-icon-github { box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); border-color: #ffffff; }
.social-links-hero a:hover.social-icon-mostaql { box-shadow: 0 0 15px rgba(45, 119, 215, 0.4); border-color: #2d77d7; }
.social-links-hero a:hover.social-icon-khamsat { box-shadow: 0 0 15px rgba(22, 160, 133, 0.4); border-color: #b38728; }
.social-links-hero a:hover.social-icon-freelancer { box-shadow: 0 0 15px rgba(41, 178, 254, 0.4); border-color: #29b2fe; }
.social-links-hero a:hover.social-icon-email { box-shadow: 0 0 15px var(--accent-glow); border-color: var(--accent-color); }

/* Footer social icons scaling */
.footer-social a svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: var(--transition);
}

/* Hero Image */
.hero-image {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    animation: slideInRight 0.9s ease-out forwards;
}

body.dir-rtl .hero-image {
    animation: slideInLeft 0.9s ease-out forwards;
}

.image-wrapper.competition-grade {
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: transparent;
    padding: 0;
    box-shadow: 0 0 50px var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    overflow: hidden;
    border: 4px solid var(--accent-color);
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
    animation: float-image 4s ease-in-out infinite;
}

.image-wrapper.competition-grade img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

@keyframes float-image {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.image-wrapper.competition-grade::after {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.image-wrapper.competition-grade:hover::after {
    opacity: 1;
}

@keyframes luxury-shimmer {
    0% { transform: translateY(-30%) rotate(30deg); }
    50% { transform: translateY(30%) rotate(30deg); }
    100% { transform: translateY(-30%) rotate(30deg); }
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.8s ease, filter 0.8s ease;
    
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
}

.cursor-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
    margin-left: -3px;
    margin-top: -3px;
    box-shadow: 0 0 10px var(--accent-color);
}

.cursor-ring {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--accent-color);
    border-radius: 50%;
    margin-left: -20px;
    margin-top: -20px;
    transition: width 0.3s cubic-bezier(0.2, 1, 0.3, 1), height 0.3s cubic-bezier(0.2, 1, 0.3, 1), border-color 0.3s;
    box-shadow: 0 0 15px var(--accent-glow);
    mix-blend-mode: difference;
}

.custom-cursor.hover .cursor-ring {
    width: 70px;
    height: 70px;
    margin-left: -35px;
    margin-top: -35px;
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 25px var(--accent-glow-strong);
}

.custom-cursor.active .cursor-ring {
    width: 30px;
    height: 30px;
    margin-left: -15px;
    margin-top: -15px;
}

.cursor-ping {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    animation: cursor-ping 0.6s ease-out forwards;
}

@keyframes cursor-ping {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(4); opacity: 0; }
}

@media (max-width: 768px) {
    .custom-cursor { display: none; }
}

/* ── Pagination Styles ────────────────────────────────────────── */
.pagination-container, .pagination-controls {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    width: 100%;
}

.pagination-wrapper {
    display: flex;
    gap: 0.8rem;
    padding: 8px 16px;
    background: rgba(212, 175, 55, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.page-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.page-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.1);
}

.page-btn.active {
    background: var(--gradient-primary);
    color: #000000 !important;
    border-color: transparent;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* ── Typing & High-End Interactions ────────────────────────── */
.typed-cursor {
    display: inline-block;
    color: var(--accent-color);
    font-weight: 200;
    margin-left: 3px;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-desc {
    min-height: 5.5rem; /* Prevents layout shift during typing */
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 800px;
}

/* Smooth Transitions for JS-based Interactions */
.project-card, .service-card, .skill-card, .stat-card {
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
    will-change: transform;
}

.social-links-hero a, .navbar-brand, .btn-primary, .theme-btn {
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

/* ─── Competition-Ready Polish ────────────────────────────────── */

/* Premium text selection */
::selection {
    background: var(--accent-color);
    color: #000;
}

/* Smooth scroll indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
    z-index: 9999;
    transition: width 0.1s linear;
}

/* Focus outline for accessibility */
*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Image hover: golden border glow */
.image-wrapper.competition-grade:hover {
    filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.5));
}

/* Name hover effects */
.name:hover {
    letter-spacing: 0px;
}

/* Responsive: mobile fix for image */
@media (max-width: 768px) {
    .image-wrapper.competition-grade {
        width: 280px;
        height: 320px;
    }
}


/* ── Professional Experience ────────────────── */
.experience {
    position: relative;
    padding: 100px 0;
}

.experience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.experience-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2.5rem;
    border-radius: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.experience-card:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: var(--bg-secondary);
}

.exp-date {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 1rem;
    display: inline-block;
    background: rgba(212, 175, 55, 0.1);
    padding: 4px 14px;
    border-radius: 20px;
}

.exp-role {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.exp-company {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.exp-tasks {
    list-style: none;
    padding: 0;
}

.exp-tasks li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.exp-tasks li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

body.dir-rtl .exp-tasks li {
    padding-left: 0;
    padding-right: 25px;
}

body.dir-rtl .exp-tasks li::before {
    left: auto;
    right: 0;
    content: '←';
}

/* ── Skills & Services ────────────────────── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2rem;
    border-radius: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.skill-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    background: var(--bg-secondary);
}

.skill-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.skill-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skill-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Projects ────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: var(--bg-secondary);
}

.project-media {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-media img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-category {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex: 1;
}

/* ── Contact ─────────────────────────────── */
.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 32px;
    padding: 5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.contact-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

.contact-info {
    position: relative;
    z-index: 1;
}

.contact-info h2 {
    font-size: 3.5rem;
    margin-bottom: 2.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(10px);
    border-color: var(--accent-color);
}

body.dir-rtl .contact-item:hover {
    transform: translateX(-10px);
}

.contact-item h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.contact-item a {
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.contact-item:hover a {
    color: var(--accent-color);
}

.icon-box {
    width: 54px;
    height: 54px;
    background: var(--accent-glow);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 1.4rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* ── Footer ──────────────────────────────── */
footer {
    padding: 60px 0 30px;
    border-top: 1px solid var(--card-border);
    text-align: center;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-social a {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer-social a:hover {
    color: var(--accent-color);
}

/* ── Animations ──────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 1024px) {
    .contact-card {
        grid-template-columns: 1fr;
        padding: 2.5rem;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 60px 5%;
    }

    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 3rem;
        padding-top: 2rem;
    }
    
    .name {
        font-size: 2.6rem;
        line-height: 1.1;
        margin-bottom: 1rem;
    }

    .title {
        font-size: 1.5rem;
        margin-bottom: 1.2rem;
    }

    .hero-desc {
        font-size: 0.95rem;
        padding: 1rem;
        margin: 0 auto 2rem;
        max-width: 100%;
    }
    
    .image-wrapper.competition-grade {
        width: 240px;
        height: 240px;
        margin: 0 auto;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    .hero-btns .btn {
        width: 100%;
        justify-content: center;
    }

    /* Show hamburger on mobile */
    .hamburger {
        display: flex;
    }
}

/* ── Hero Stats HUD Grid ────────────────────────────────── */
.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
    max-width: 800px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1.5rem 1rem;
    text-align: center;
    position: relative;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 85% 100%, 0 100%);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
    opacity: 0.8;
}

body.dir-rtl .stat-card {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 15% 100%, 0 85%);
}

body.dir-rtl .stat-card::before {
    left: auto;
    right: 0;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    background: rgba(212, 175, 55, 0.05);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 900;
    display: block;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .hero-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

/* ── Certifications Section ────────────────── */
.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3.5rem;
}

.cert-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.cert-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 15px 35px var(--accent-glow);
}

.cert-card::after {
    content: '';
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px var(--accent-color);
}

.cert-card:hover::after {
    opacity: 1;
}

.cert-issuer {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.cert-issuer i {
    font-size: 1.4rem;
}

/* Specific Issuer Colors - Can be overridden by theme if desired */
.cert-google { color: #4285F4; }
.cert-microsoft { color: #00A4EF; }
.cert-ibm { color: #052FAD; }
.cert-aws { color: #FF9900; }

.cert-body h4 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.cert-platform {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.cert-platform i {
    color: var(--accent-color);
    font-size: 0.8rem;
}

.cert-verify-btn {
    margin-top: auto;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 1rem;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: 0.95rem;
    font-weight: 700;
    transition: var(--transition);
}

.cert-verify-btn:hover {
    background: var(--accent-color);
    color: #000 !important;
    border-color: transparent;
    transform: scale(1.02);
}

body.dir-rtl .cert-card::after {
    right: auto;
    left: 15px;
}

/* Certifications Header Polish */
#certifications .section-header p {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0.8;
}

#certifications .header-line {
    margin: 1.5rem auto;
}

/* ========================================================
   PROFESSIONAL SUMMARY SECTION - PREMIUM REDESIGN
   ======================================================== */
.about.section-padding {
    position: relative;
    background: var(--bg-primary) !important;
    overflow: hidden;
}

.about::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(212, 175, 55, 0.06) 1px, transparent 0);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

.about .section-container {
    position: relative;
    z-index: 1;
}

.about .section-header h2 .highlight-summary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.about .header-line {
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
    margin-bottom: 2.5rem;
    box-shadow: 0 0 18px var(--accent-glow);
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.85;
    margin-bottom: 1.5rem;
    max-width: 900px;
}

/* ── Summary Info Grid ── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-top: 3.5rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg);
    padding: 1.1rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    transition: all 0.35s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.summary-item:hover {
    transform: translateY(-4px);
    background: var(--bg-secondary);
    border-color: var(--accent-color);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.summary-icon-box {
    width: 46px;
    height: 46px;
    min-width: 46px;
    background: var(--accent-glow);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 1.15rem;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.summary-item:hover .summary-icon-box {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow-strong);
}

.summary-info h4 {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.summary-info span {
    font-size: 0.98rem;
    color: var(--text-primary);
    font-weight: 700;
    display: block;
    line-height: 1.3;
}

/* Light Mode Support */
html.light .about.section-padding {
    background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 50%, #f8fafc 100%) !important;
}

html.light .about::before {
    background-image: radial-gradient(circle at 1px 1px, rgba(13, 148, 136, 0.08) 1px, transparent 0);
}

html.light .about-text p {
    color: var(--text-secondary);
}

html.light .summary-item {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--card-border);
}

html.light .summary-item:hover {
    background: rgba(255, 255, 255, 0.95);
}

html.light .summary-info h4 {
    color: var(--text-secondary);
}

html.light .summary-info span {
    color: var(--text-primary);
}

/* RTL support */
body.dir-rtl .summary-item {
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.9rem;
    }
    .about-text p { font-size: 1rem; }
}

@media (max-width: 480px) {
    .summary-grid { grid-template-columns: 1fr; }
}

/* ========================================================
   SKILL PROGRESS BARS - ENHANCED
   ======================================================== */
.skill-progress-item {
    margin-bottom: 1.2rem;
}

.skill-progress-item > span {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.07);
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #047857, #d4af37, #34d399);
    border-radius: 10px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* ========================================================
   SECTION GENERAL IMPROVEMENTS
   ======================================================== */
.section-header h2 {
    line-height: 1.1;
}

.section-category-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.08);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    margin-bottom: 0.8rem;
}

/* ========================================================
   PROJECT CARD - ENHANCED
   ======================================================== */
.project-card {
    border-radius: 18px;
}

.project-card .project-category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.08);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 0.7rem;
}

/* ========================================================
   TESTIMONIALS - IMPROVED MARQUEE
   ======================================================== */
.testimonials-slider {
    width: 100%;
    overflow: hidden;
    padding: 1rem 0;
    position: relative;
}

.testimonials-slider::before,
.testimonials-slider::after {
    content: '';
    position: absolute;
    top: 0;
    width: 120px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.testimonials-slider::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary), transparent);
}

.testimonials-slider::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary), transparent);
}

.slider-track {
    display: flex;
    gap: 0; /* Use consistent margins on slides instead of gap for marquee stability */
    padding: 0;
    width: max-content;
    will-change: transform;
}

@keyframes scroll-left {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-25%, 0, 0); }
}

@keyframes scroll-right {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(25%, 0, 0); }
}

.testimonial-slide {
    min-width: 340px;
    max-width: 340px;
    margin-inline-end: 1.5rem; /* Ensure every slide has the same trailing space */
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.testimonial-content p {
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1.2rem;
    position: relative;
}

/* Removed quotation mark icon */

.testimonial-author {
    border-top: 1px solid var(--card-border);
    padding-top: 1rem;
}

/* ========================================================
   FILTER BUTTONS - ENHANCED
   ======================================================== */
.filter-btn {
    padding: 8px 20px;
    border-radius: 25px;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.project-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 480px) {
    .name {
        font-size: 2rem;
    }
    
    .title {
        font-size: 1.1rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .hero-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .cert-card {
        padding: 1.2rem;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .summary-grid {
        gap: 0.8rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .contact-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .contact-info h2 {
        font-size: 2rem;
    }

    .hero {
        padding: 130px 5% 60px;
    }
}

/* ========================================================
   CONTACT - BIG BUTTONS
   ======================================================== */
.contact-visual {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    min-height: 300px;
}

.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 320px;
    z-index: 2;
}

.big-contact-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2rem;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    transition: var(--transition);
    font-family: var(--font-heading);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-email {
    background: var(--gradient-primary);
    color: #000 !important;
}

.btn-whatsapp {
    background: #25D366;
    color: #fff !important;
}

.big-contact-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.4);
    filter: brightness(1.15);
}

.btn-whatsapp:hover {
    box-shadow: 0 20px 40px rgba(37, 211, 102, 0.4);
}

.pulse-ring {
    position: absolute;
    width: 280px;
    height: 280px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    animation: pulseRing 3s ease-out infinite;
    opacity: 0;
}

@keyframes pulseRing {
    0%   { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ========================================================
   FOOTER - ENHANCED
   ======================================================== */
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 900;
    font-family: var(--font-heading);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

footer {
    background: var(--footer-bg);
}

.footer-social a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: var(--transition);
}

.footer-social a:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.2);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

/* ========================================================
   MODAL - GLASSMORPHISM PREMIUM
   ======================================================== */
.unified-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.unified-modal.show {
    display: flex;
    opacity: 1;
}

.glass-modal {
    background: var(--modal-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    max-width: 700px; /* More compact width */
    width: 95%;
    max-height: 85vh; /* Keep it within viewport height */
    overflow-y: auto; /* Enable internal scroll if content is long */
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

/* Custom Scrollbar for Modal */
.glass-modal::-webkit-scrollbar {
    width: 6px;
}

.glass-modal::-webkit-scrollbar-track {
    background: transparent;
}

.glass-modal::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

/* Constrain Modal Media Size */
.glass-modal img, 
.glass-modal video {
    width: 100%;
    max-height: 350px; /* Constrain image height as requested */
    object-fit: cover;
    border-radius: 15px;
    margin: 1.5rem 0;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.unified-modal.show .glass-modal {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: var(--transition);
}

.close-modal:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* ================================================================
   LIGHT MODE (Pearl White + Deep Teal) — Comprehensive Overrides
   ================================================================ */

/* ── Buttons ── */
html.light .btn-primary:hover {
    box-shadow: 0 12px 30px rgba(13, 148, 136, 0.35);
}

html.light .btn-secondary:hover {
    background: rgba(13, 148, 136, 0.06);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.15);
}

html.light .btn-cv {
    background: rgba(13, 148, 136, 0.08);
    box-shadow: 0 0 14px rgba(13, 148, 136, 0.2);
}

html.light .btn-cv:hover {
    background: var(--accent-color);
    color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
}

/* ── Filter Buttons ── */
html.light .filter-btn:hover,
html.light .filter-btn.active {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

/* ── Pagination ── */
html.light .page-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(13, 148, 136, 0.08);
}

html.light .page-btn.active {
    background: var(--gradient-primary);
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(13, 148, 136, 0.3);
}

/* ── Nav Links ── */
html.light .nav-links a:hover {
    color: var(--accent-color);
}

html.light .control-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(13, 148, 136, 0.08);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

/* ── Stat Cards ── */
html.light .stat-card:hover {
    border-color: var(--accent-color);
    background: rgba(13, 148, 136, 0.05);
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.15);
}

/* ── Footer ── */
html.light .footer-social a:hover {
    border-color: var(--accent-color);
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.2);
}

/* ── Modal ── */
html.light .close-modal:hover {
    background: rgba(13, 148, 136, 0.1);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* ── Scroll Progress Bar ── */
html.light .scroll-progress {
    background: linear-gradient(90deg, #0d9488, #0891b2);
}

/* ── Cert Verify Button ── */
html.light .cert-verify-btn:hover {
    background: var(--accent-color);
    color: #fff !important;
}

/* ── Header Lines & Highlights ── */
html.light .header-line {
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

/* ── Testimonial slider fade masks ── */
html.light .testimonials-slider::before {
    background: linear-gradient(to right, #f8fafc, transparent);
}
html.light .testimonials-slider::after {
    background: linear-gradient(to left, #f8fafc, transparent);
}

/* ── Big Contact Buttons (Email) ── */
html.light .btn-email {
    background: var(--gradient-primary);
    color: #fff !important;
}

/* ================================================================
   NAME VISIBILITY FIX — High contrast, vibrant gradient
   ================================================================ */

/* Dark Mode: Bright Gold → Cream → Amber — يظهر بوضوح على الخلفية الداكنة */
.name {
    background: linear-gradient(135deg,
        #ffd700 0%,
        #fff8dc 40%,
        #f59e0b 75%,
        #ffd700 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: none !important;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.35));
}

/* Light Mode: Deep Teal → Blue — يظهر بوضوح على الخلفية الفاتحة */
html.light .name {
    background: linear-gradient(135deg,
        #0d9488 0%,
        #0891b2 60%,
        #7c3aed 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: none !important;
    filter: drop-shadow(0 0 15px rgba(13, 148, 136, 0.3));
}

/* ================================================================
   TITLE OVERFLOW FIX — prevent long typing text from overflowing
   ================================================================ */
.title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (max-width: 900px) {
    .title {
        font-size: 1.4rem;
        white-space: normal;
        overflow: visible;
        word-break: break-word;
    }
}

/* ================================================================
   RTL (ARABIC) MOBILE FIXES
   ================================================================ */
body.dir-rtl .hero-btns {
    justify-content: center;
}

body.dir-rtl .hero-stats-grid {
    direction: rtl;
}

body.dir-rtl .stat-card::before {
    left: auto;
    right: 0;
}

body.dir-rtl .greeting {
    justify-content: flex-start;
}

@media (max-width: 768px) {
    body.dir-rtl .hero-content {
        text-align: center;
    }

    body.dir-rtl .greeting {
        justify-content: center;
    }

    body.dir-rtl .hero-desc {
        margin-left: auto;
        margin-right: auto;
    }

    body.dir-rtl .hero-btns {
        justify-content: center;
    }

    body.dir-rtl .social-links-hero {
        justify-content: center;
    }

    /* Contact card RTL fix on mobile */
    body.dir-rtl .contact-item:hover {
        transform: translateX(0);
    }
}

/* ================================================================
   SOCIAL LINKS HERO — center on mobile
   ================================================================ */
@media (max-width: 768px) {
    .social-links-hero {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-stats-grid {
        margin: 1.5rem auto;
        justify-items: center;
    }

    .hero-action-area {
        align-items: center;
    }

    .section-header h2 {
        font-size: 2.2rem;
    }

    /* Fix project cards on mobile */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Fix services grid on mobile */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Fix certifications grid on mobile */
    .certs-grid {
        grid-template-columns: 1fr;
    }

    /* Make experience cards full width */
    .experience-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   PERFORMANCE — reduce motion for users who prefer it
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .orb-1,
    .orb-2,
    .orb-3 {
        animation: none;
    }

    #data-flow-canvas {
        display: none;
    }
}

/* ================================================================
   LIGHT MODE HERO TEXT FIX
   ================================================================ */
html.light .hero-desc {
    background: rgba(13, 148, 136, 0.05);
    border: 1px solid rgba(13, 148, 136, 0.15);
    text-shadow: none;
    color: var(--text-primary);
}

html.light .title {
    color: var(--text-secondary);
    text-shadow: none;
}

/* ================================================================
   HAMBURGER BUTTON — better tap target on mobile
   ================================================================ */
@media (max-width: 768px) {
    .hamburger {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
}

/* ================================================================
   CONTACT CARD — fix light mode
   ================================================================ */
html.light .contact-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(13, 148, 136, 0.15);
    box-shadow: 0 40px 100px rgba(13, 148, 136, 0.08);
}

html.light .contact-item {
    background: rgba(13, 148, 136, 0.03);
    border-color: rgba(13, 148, 136, 0.1);
}

html.light .contact-item:hover {
    background: rgba(13, 148, 136, 0.07);
    border-color: var(--accent-color);
}

html.light .icon-box {
    border-color: rgba(13, 148, 136, 0.2);
}

/* ================================================================
   PAGINATION — better mobile touch targets
   ================================================================ */
.page-btn {
    min-width: 38px;
    min-height: 38px;
}

@media (max-width: 480px) {
    .pagination-wrapper {
        gap: 0.4rem;
    }

    .page-btn {
        min-width: 34px;
        min-height: 34px;
        font-size: 0.85rem;
    }

    .filter-btn {
        padding: 6px 14px;
        font-size: 0.82rem;
    }
}

/* ================================================================
   NAVBAR — ensure controls stay properly spaced on mobile
   ================================================================ */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 4%;
    }

    .controls-container {
        gap: 8px;
    }

    .logo {
        font-size: 1.6rem;
    }
}

