:root {
    /* Color Palette - Premium Navy & Gold */
    --blue: #3B82F6;
    --blue-light: #60A5FA;
    --blue-dark: #1D4ED8;
    --gold: #D97706;
    --gold-light: #F59E0B;
    --gold-pale: #FCD34D;
    --olive: #65A30D;
    --olive-light: #84CC16;

    /* Dark Mode Tokens (Default) */
    --bg-primary: #0C1220;
    --bg-secondary: #0F172A;
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-glass: rgba(15, 23, 42, 0.7);
    --card-border: rgba(59, 130, 246, 0.15);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --navbar-bg: rgba(12, 18, 32, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(15, 23, 42, 0.65);

    /* Effects */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --glow-blue: 0 0 30px rgba(59, 130, 246, 0.25);
    --glow-gold: 0 0 30px rgba(217, 119, 6, 0.15);
    --glass-blur: blur(12px);

    /* Gradients */
    --grad-primary: linear-gradient(135deg, var(--blue), #1E40AF);
    --grad-gold: linear-gradient(135deg, var(--gold), #92400E);
    --grad-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    --accent-gradient: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    --heading-gradient: linear-gradient(135deg, var(--blue-light) 0%, var(--gold-light) 100%);

    /* Transition */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.875rem;
    --radius-lg: 1.25rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;

    /* Fonts */
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
    --font-arabic: 'Noto Kufi Arabic', sans-serif;
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-primary: #F8FAFC;
    --bg-secondary: #F1F5F9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --card-border: rgba(59, 130, 246, 0.12);
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --navbar-bg: rgba(248, 250, 252, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.05);
}

/* ═══════════ Base Reset ═══════════ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    height: -webkit-fill-available;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
    min-height: 100vh;
    min-height: 100dvh;
}

html,
body {
    overflow-x: hidden;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

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

ul {
    list-style: none;
}

/* ═══════════ Typography ═══════════ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
}

h2 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    letter-spacing: 0.01em;
}

p {
    font-size: clamp(0.95rem, 0.5vw + 0.6rem, 1.05rem);
    line-height: 1.8;
    font-weight: 400;
}

/* RTL Support */
[dir="rtl"] {
    font-family: var(--font-arabic);
    text-align: right;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] p,
[dir="rtl"] body {
    font-family: var(--font-arabic) !important;
}

[dir="rtl"] .hero-subtitle,
[dir="rtl"] .section-subtitle {
    font-style: normal;
}

/* ═══════════ Layout ═══════════ */

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
}

.section {
    padding: clamp(4rem, 12vh, 8rem) 0;
    position: relative;
    z-index: 10;
}

/* ═══════════ Preloader ═══════════ */

.preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 2rem;
    position: relative;
    padding: 5px;
    background: var(--grad-primary);
    animation: rotate 2s linear infinite;
}

.loader-logo::after {
    content: '';
    position: absolute;
    inset: 5px;
    background: var(--bg-primary);
    border-radius: 50%;
}

.loader-logo img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Shimmer Text */
.shimmer-text {
    background: linear-gradient(90deg, var(--text-primary) 0%, var(--blue-light) 25%, var(--text-primary) 50%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerText 3s linear infinite;
}

@keyframes shimmerText {
    to {
        background-position: 200% center;
    }
}

.loader-text {
    font-size: 1.2rem;
    font-weight: 700;
}

/* ═══════════ Scroll Progress ═══════════ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--blue), var(--gold-light), var(--olive-light));
    z-index: 10001;
    transition: width 0.1s linear;
}

/* ═══════════ Background Blobs ═══════════ */

.blob-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: blobPrimary 20s ease-in-out infinite;
}

.blob:nth-child(1) {
    background: var(--blue);
    top: -10%;
    left: -5%;
}

.blob:nth-child(2) {
    background: var(--gold);
    bottom: -10%;
    right: -5%;
    animation-delay: -5s;
    animation-name: blobSecondary;
}

.blob:nth-child(3) {
    background: var(--olive);
    top: 50%;
    left: 40%;
    width: 300px;
    height: 300px;
    animation-delay: -10s;
}

@keyframes blobPrimary {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(10vw, -10vh) scale(1.1);
    }

    66% {
        transform: translate(-5vw, 20vh) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes blobSecondary {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-8vw, -15vh) scale(1.2);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* ═══════════ Navbar ═══════════ */

#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    background: transparent;
    border-bottom: 1px solid transparent;
    z-index: 1000;
    transition: all var(--transition-base);
}

#navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

#navbar.scrolled {
    height: 70px;
    background: var(--navbar-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 900;
    color: var(--text-primary);
    font-size: 1.1rem;
    white-space: nowrap;
}

.nav-logo img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    border: 2px solid var(--blue);
    object-fit: cover;
    transition: transform var(--transition-base);
    box-shadow: var(--glow-blue);
    flex-shrink: 0;
}

@media (max-width: 375px) {
    .nav-logo span {
        display: none;
    }
}

#navbar.scrolled .nav-logo img {
    height: 38px;
    width: 38px;
}

.nav-logo:hover img {
    transform: scale(1.1) rotate(5deg);
}

/* Nav Menu */
.nav-menu {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 50%;
    width: 0%;
    height: 2px;
    background: var(--grad-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-item:hover>.nav-link::after,
.nav-link:hover::after,
.nav-link.active::after,
.nav-item.nav-active>.nav-link::after {
    width: 80%;
}

.nav-link i.fa-chevron-down {
    font-size: 0.65rem;
    transition: transform var(--transition-base);
}

.nav-item:hover>.nav-link,
.nav-link:hover,
.nav-link.active {
    color: var(--blue);
}

.nav-item.nav-active>.nav-link {
    color: var(--blue);
}

/* Nav Dropdown */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 220px;
    padding: 0.5rem;
    background: var(--bg-card);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 100;
}

.nav-item:hover>.nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-item:hover>.nav-link i.fa-chevron-down {
    transform: rotate(180deg);
}

.nav-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-base);
}

.nav-dropdown a i {
    width: 20px;
    text-align: center;
    color: var(--olive);
    font-size: 0.85rem;
}

.nav-dropdown a:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--blue);
    transform: translateX(4px);
}

[dir="rtl"] .nav-dropdown a:hover {
    transform: translateX(-4px);
}

/* Nav Controls */
.nav-extra {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.nav-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: var(--glow-blue);
}

/* Hamburger Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all var(--transition-base);
}

.nav-toggle.active span:nth-child(1),
.nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2),
.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3),
.nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Ensure controls are visible on mobile */
@media (max-width: 992px) {
    .nav-extra {
        display: flex !important;
        position: relative;
        z-index: 1001;
        /* Higher than mobile-overlay potentially */
    }

    .nav-controls {
        display: flex !important;
    }

    .nav-btn {
        display: flex !important;
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
}

/* ═══════════ Mobile Overlay ═══════════ */

.mobile-overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    background: var(--bg-secondary);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 100px 2rem 2rem;
    gap: 0.5rem;
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.3);
}

.mobile-overlay.open {
    left: 0;
}

[dir="rtl"] .mobile-overlay {
    left: auto;
    right: -100%;
    border-right: none;
    border-left: 1px solid var(--glass-border);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

[dir="rtl"] .mobile-overlay.open {
    right: 0;
}

.mobile-overlay a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    text-decoration: none;
}

.mobile-overlay a:hover,
.mobile-overlay a.active {
    color: var(--blue);
    background: rgba(59, 130, 246, 0.08);
}

.mobile-overlay a i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

/* ═══════════ Buttons ═══════════ */

.btn {
    padding: 0.9rem 2.2rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    z-index: 1;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-md), var(--glow-blue);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.btn-primary:hover::before {
    animation: shimmer 1s infinite;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
}

.btn-secondary:hover {
    background: var(--gold);
    color: white;
    transform: translateY(-4px);
    box-shadow: var(--glow-gold);
}

/* ═══════════ Hero Section ═══════════ */

.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
    position: relative;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

[dir="rtl"] .hero-content {
    grid-template-columns: 1fr 1.2fr;
}

.hero-text {
    animation: fadeInUp 0.8s ease;
}

.title-greeting {
    display: block;
    font-size: 1.1rem;
    color: var(--olive-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.title-name {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    background: var(--heading-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.8vw, 1.5rem);
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 2rem;
    line-height: 1.4;
    max-width: 650px;
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    max-width: 650px;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3.5rem;
    flex-wrap: wrap;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-image {
    animation: fadeInRight 0.8s ease;
}

[dir="rtl"] .hero-image {
    animation: fadeInLeft 0.8s ease;
}

.image-wrapper {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 0 0 auto;
}

[dir="rtl"] .image-wrapper {
    margin: 0 auto 0 0;
}

.profile-img {
    width: 100%;
    aspect-ratio: 1 / 1.1;
    object-fit: cover;
    border-radius: var(--radius-xl);
    border: 3px solid transparent;
    background-image: linear-gradient(var(--bg-primary), var(--bg-primary)),
        linear-gradient(135deg, var(--blue), var(--gold));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 2;
    animation: float 6s ease-in-out infinite;
}

.image-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-xl);
    filter: blur(50px);
    opacity: 0.2;
    z-index: 1;
    animation: pulse 4s ease-in-out infinite;
}

/* ═══════════ About Section ═══════════ */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.about-img {
    width: 100%;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-slow);
    aspect-ratio: 1;
    object-fit: cover;
}

.about-img:hover {
    transform: scale(1.05);
}

.highlights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Highlight Cards */
.highlight-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    margin-bottom: 0;
    transition: var(--transition-base);
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.highlight-card:hover {
    transform: translateX(10px);
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
}

[dir="rtl"] .highlight-card:hover {
    transform: translateX(-10px);
}

.highlight-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.highlight-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.highlight-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.highlight-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-light);
}

.highlight-icon.gold {
    background: rgba(217, 119, 6, 0.15);
    color: var(--gold-light);
}

.highlight-icon.olive {
    background: rgba(101, 163, 13, 0.15);
    color: var(--olive-light);
}

/* ═══════════ Skills Section ═══════════ */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.skill-category {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--olive-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.skill-category:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--glow-blue);
    border-color: rgba(59, 130, 246, 0.3);
}

.skill-category:hover::before {
    transform: scaleX(1);
}

.skill-category h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.skill-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    list-style: none;
}

.skill-list li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    padding-left: 0.3rem;
}

.skill-list li::before {
    content: '▹';
    color: var(--olive);
    font-weight: bold;
    flex-shrink: 0;
}

.skill-list li:hover {
    color: var(--olive-light);
    transform: translateX(6px);
}

[dir="rtl"] .skill-list li {
    padding-left: 0;
    padding-right: 0.3rem;
}

[dir="rtl"] .skill-list li:hover {
    transform: translateX(-6px);
}

/* ═══════════ Experience - Timeline ═══════════ */

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--blue), var(--gold));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-marker {
    position: absolute;
    left: -3.625rem;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold-light);
    box-shadow: 0 0 0 4px var(--bg-primary), var(--glow-gold);
}

.timeline-year {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: rgba(217, 119, 6, 0.12);
    color: var(--gold-light);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.timeline-content {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    transition: all var(--transition-base);
}

.timeline-content:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-lg), var(--glow-blue);
}

.timeline-content h3 {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.timeline-content .place {
    color: var(--blue);
    font-weight: 600;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* RTL Timeline */
[dir="rtl"] .timeline {
    padding-left: 0;
    padding-right: 3rem;
}

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

[dir="rtl"] .timeline-marker {
    left: auto;
    right: -3.625rem;
}

[dir="rtl"] .timeline-content:hover {
    transform: translateX(-8px);
}

/* ═══════════ Education ═══════════ */

.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.edu-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    transition: all var(--transition-base);
}

.edu-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--glow-blue);
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(15, 23, 42, 0.8);
}

.edu-card.featured {
    border-color: var(--gold);
}

.edu-card.featured:hover {
    border-color: var(--gold-light);
    box-shadow: var(--shadow-lg), var(--glow-gold);
}

.edu-card .year {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: rgba(101, 163, 13, 0.12);
    color: var(--olive-light);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.edu-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.edu-card .place {
    color: var(--blue);
    font-weight: 600;
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
}

.edu-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.edu-card .grade {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-light);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
}

/* ═══════════ Achievements / Services Grid ═══════════ */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    transition: all var(--transition-base);
}

.service-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--glow-gold);
    border-color: var(--gold-light);
    background: rgba(15, 23, 42, 0.8);
}

.service-card:hover .service-icon {
    transform: rotate(10deg) scale(1.1);
}

.service-icon {
    width: 55px;
    height: 55px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--blue), var(--olive));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: all var(--transition-bounce);
}

.service-icon i {
    font-size: 1.4rem;
    color: white;
}

.service-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.7rem;
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* ═══════════ Career Objective ═══════════ */

.career-box {
    background: var(--accent-gradient);
    border-radius: var(--radius-xl);
    padding: clamp(2.5rem, 5vw, 4rem);
    position: relative;
    overflow: hidden;
}

.career-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><circle cx="30" cy="30" r="1" fill="rgba(255,255,255,0.08)"/></svg>');
    opacity: 0.5;
}

.career-box blockquote {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.85;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.career-box blockquote::before {
    content: '"';
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.25);
    display: block;
    margin-bottom: -1.5rem;
    font-family: Georgia, serif;
}

/* ═══════════ Contact Section ═══════════ */

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
}

.contact-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    padding: 1.2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    transition: all var(--transition-base);
    margin-bottom: 1rem;
}

.contact-method:hover {
    transform: translateX(8px);
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
}

[dir="rtl"] .contact-method:hover {
    transform: translateX(-8px);
}

.contact-method i {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.contact-method:hover i {
    background: var(--accent-gradient);
    color: #fff;
}

.contact-method span {
    font-weight: 500;
    color: var(--text-primary);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 0.7rem;
    margin-top: 1.5rem;
}

.social-link {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.social-link:hover {
    transform: translateY(-4px) rotate(5deg);
    border-color: transparent;
    box-shadow: var(--glow-blue);
}

.social-link:has(.fa-linkedin-in):hover {
    background: #0077B5;
    color: white;
}

.social-link:has(.fa-whatsapp):hover {
    background: #25D366;
    color: white;
}

.social-link:has(.fa-youtube):hover {
    background: #FF0000;
    color: white;
}

/* Contact Form */
.contact-form {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--blue);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #ef4444;
}

.error-message {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 0.3rem;
}

/* ═══════════ Section Headers ═══════════ */

.section-header {
    text-align: center;
    margin-bottom: clamp(3rem, 8vh, 5rem);
}

.section-tag {
    padding: 0.5rem 1.2rem;
    background: rgba(101, 163, 13, 0.15);
    color: var(--olive-light);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1rem;
    letter-spacing: 1.5px;
    border: 1px solid rgba(101, 163, 13, 0.2);
}

[data-theme="light"] .section-tag {
    background: rgba(163, 230, 53, 0.2);
    color: #3F6212;
    border-color: rgba(163, 230, 53, 0.3);
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--heading-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title span {
    color: var(--blue);
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ═══════════ Footer ═══════════ */

.footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--blue), var(--gold-light), var(--olive-light)) 1;
    margin-top: 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-tagline {
    font-style: italic;
    color: var(--gold) !important;
}

/* ═══════════ Grid Systems ═══════════ */

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

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* ═══════════ Animations ═══════════ */

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: inherit;
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: inherit;
}

.reveal-zoom {
    opacity: 0;
    transform: scale(0.9);
    transition: inherit;
}

.reveal-left.active,
.reveal-right.active,
.reveal-zoom.active {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* Stagger */
.stagger-children>* {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.active>*:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-children.active>*:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-children.active>*:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-children.active>*:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-children.active>* {
    opacity: 1;
    transform: translateY(0);
}

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

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-18px);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 0.35;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

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

/* Spinner for forms */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

.btn-loading .spinner {
    display: block;
}

/* Magnetic Effect */
.magnetic {
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--blue), var(--blue-dark));
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--blue-light);
}

/* ═══════════ Toast Notifications ═══════════ */

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.toast {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-left: 4px solid var(--blue);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 280px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.success {
    border-left-color: #22c55e;
}

/* ═══════════ Responsive ═══════════ */

@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    [dir="rtl"] .hero-content {
        grid-template-columns: 1fr;
    }

    .hero-text {
        order: 2;
    }

    .hero-image {
        order: 1;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
        font-size: 1rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .image-wrapper {
        margin: 0 auto;
        max-width: 320px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-img {
        max-width: 300px;
        margin: 0 auto;
    }

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

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

@media (max-width: 992px) {
    .nav-menu {
        display: none;
    }

    .nav-toggle {
        display: flex !important;
        position: relative;
        z-index: 1002;
        padding: 5px;
        margin-left: 5px;
    }

    [dir="rtl"] .nav-toggle {
        margin-left: 0;
        margin-right: 5px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 3.5rem 0;
    }

    .title-name {
        font-size: 2.2rem;
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .stat-item {
        align-items: center;
        text-align: center;
    }

    .stat-number {
        font-size: 2rem;
    }

    .skills-grid,
    .services-grid,
    .edu-grid,
    .highlights-grid {
        grid-template-columns: 1fr;
    }

    .timeline {
        padding-left: 2rem;
    }

    .timeline-marker {
        left: -2.625rem;
    }

    [dir="rtl"] .timeline {
        padding-right: 2rem;
    }

    [dir="rtl"] .timeline-marker {
        right: -2.625rem;
    }

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

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }

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

@media (max-height: 700px) {
    .hero {
        min-height: auto;
        padding: 120px 0 60px;
    }

    .title-name {
        font-size: 3rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}