/* ==========================================================================
   DESIGN SYSTEM & GLOBAL STYLES (Mohamed Hesham GIS Portfolio)
   ========================================================================== */

:root {
    --bg-dark: #0b1120;
    --bg-card: rgba(17, 24, 39, 0.65);
    --bg-card-hover: rgba(31, 41, 55, 0.85);
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.3);
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.35);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(148, 163, 184, 0.08);
    --border-glow: rgba(16, 185, 129, 0.2);
    
    --header-bg: rgba(11, 17, 32, 0.6);
    --header-scrolled: rgba(11, 17, 32, 0.85);
    --lightbox-bg: rgba(3, 7, 18, 0.96);
    --footer-bg: #030712;
    --contact-side-bg: linear-gradient(135deg, rgba(3, 7, 18, 0.6), rgba(11, 17, 32, 0.3));
    
    --grid-color: rgba(148, 163, 184, 0.03);
    --topo-glow1: rgba(16, 185, 129, 0.04);
    --topo-glow2: rgba(6, 182, 212, 0.03);
    --topo-glow3: rgba(16, 185, 129, 0.03);

    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light Mode Variables Override */
body.light-mode {
    --bg-dark: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(241, 245, 249, 0.95);
    --accent-emerald: #059669; /* slightly darker emerald for text contrast */
    --accent-emerald-glow: rgba(5, 150, 105, 0.15);
    --accent-cyan: #0891b2; /* slightly darker cyan */
    --accent-cyan-glow: rgba(8, 145, 178, 0.15);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(15, 23, 42, 0.08);
    --border-glow: rgba(5, 150, 105, 0.2);
    
    --header-bg: rgba(248, 250, 252, 0.7);
    --header-scrolled: rgba(241, 245, 249, 0.95);
    --lightbox-bg: rgba(248, 250, 252, 0.98);
    --footer-bg: #e2e8f0;
    --contact-side-bg: linear-gradient(135deg, #f1f5f9, rgba(226, 232, 240, 0.4));
    
    --grid-color: rgba(15, 23, 42, 0.05);
    --topo-glow1: rgba(5, 150, 105, 0.06);
    --topo-glow2: rgba(8, 145, 178, 0.05);
    --topo-glow3: rgba(5, 150, 105, 0.05);
}

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

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    max-width: 100vw;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-glow);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-emerald);
}

/* ==========================================================================
   GRID & TOPOGRAPHIC BACKGROUNDS (The Wow Factor)
   ========================================================================== */

/* High-tech coordinate grid */
.topo-bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: 50px 50px;
    background-image: 
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    z-index: -2;
    pointer-events: none;
    transition: var(--transition-smooth);
}

/* CSS-based concentric topographic/contour glow curves */
.topo-bg-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, var(--topo-glow1) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, var(--topo-glow2) 0%, transparent 35%),
        radial-gradient(circle at 40% 70%, var(--topo-glow3) 0%, transparent 45%);
    z-index: -1;
    pointer-events: none;
    transition: var(--transition-smooth);
}

/* Container limits */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Helper Utilities */
.accent-text {
    color: var(--accent-emerald);
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.accent-dot {
    color: var(--accent-emerald);
}

/* ==========================================================================
   NAVIGATION BAR (Glassmorphic)
   ========================================================================== */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.main-header.scrolled {
    background: var(--header-scrolled);
    border-bottom: 1px solid var(--border-glow);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.logo-icon {
    color: var(--accent-emerald);
    font-size: 1.5rem;
    animation: rotateGlobe 20s linear infinite;
}

.logo-text {
    letter-spacing: 0.5px;
}

.sub-logo {
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--accent-emerald-glow);
    padding: 1px 4px;
    border-radius: 4px;
    margin-left: 5px;
    font-weight: 500;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.92rem;
    transition: var(--transition-smooth);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--accent-emerald), var(--accent-cyan));
    transition: var(--transition-smooth);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--accent-emerald);
}

.contact-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
    border: 1px solid var(--accent-emerald);
    color: var(--accent-emerald) !important;
    padding: 0.5rem 1.1rem;
    border-radius: 30px;
    font-weight: 600;
}

.contact-btn:hover {
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
    color: var(--bg-dark) !important;
    box-shadow: 0 0 15px var(--accent-emerald-glow);
    transform: translateY(-2px);
}

.contact-btn::after {
    display: none;
}

/* Language Switcher */
.lang-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-smooth);
    margin-left: 0.5rem;
}

.lang-toggle-btn:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

/* Theme Switcher Button Style */
.theme-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

/* Mobile Toggle Hamburger */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.mobile-nav-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-smooth);
}

/* ==========================================================================
   HERO SECTION (High-Tech Spatial Layout)
   ========================================================================== */

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 90px;
    padding-bottom: 2rem;
    position: relative;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: center;
}

.badge-gis {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--accent-emerald);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.05);
}

.icon-pulse {
    animation: beaconPulse 2s infinite;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 580px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

/* Button UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-bounce);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
    color: #0b1120; /* Keep it dark for maximum contrast on primary actions */
    border: none;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-emerald);
    transform: translateY(-3px);
}

/* Rotating profile frame (Spatial Visualizer) */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.profile-frame {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    padding: 12px;
}

.profile-image-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 3px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
    z-index: 5;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transform: scale(1.05);
    transition: var(--transition-smooth);
}

.profile-frame:hover .profile-img {
    transform: scale(1.15);
}

/* Outer Animated Rings */
.glowing-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.ring-1 {
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px dashed var(--accent-emerald);
    opacity: 0.65;
    animation: rotateCW 25s linear infinite;
}

.ring-2 {
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 1px solid var(--accent-cyan-glow);
    border-left-color: var(--accent-cyan);
    border-right-color: var(--accent-cyan);
    opacity: 0.8;
    animation: rotateCCW 15s linear infinite;
}

/* Lat / Lon Coordinate Pins */
.coordinate-marker {
    position: absolute;
    background: var(--header-scrolled);
    border: 1px solid var(--accent-emerald);
    color: var(--accent-emerald);
    font-family: monospace;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.coordinate-marker.top-left {
    top: 15px;
    left: -35px;
}

.coordinate-marker.bottom-right {
    bottom: 15px;
    right: -35px;
}

/* Scroll indicator link */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.mouse {
    width: 20px;
    height: 32px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 7px;
    background-color: var(--accent-emerald);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollMouse 1.5s infinite;
}

/* ==========================================================================
   PHILOSOPHY SECTION
   ========================================================================== */

.philosophy-section {
    padding: 6rem 0;
    position: relative;
}

.philosophy-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 3.5rem;
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.philosophy-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--accent-emerald-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.philosophy-icon {
    font-size: 2.2rem;
    color: var(--accent-emerald);
    margin-bottom: 1.5rem;
}

.philosophy-quote {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.55;
    font-style: italic;
}

.philosophy-author {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 2px;
}

/* ==========================================================================
   SECTION HEADER TEMPLATE
   ========================================================================== */

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-tag {
    color: var(--accent-emerald);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
}

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

.section-underline {
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--accent-emerald), var(--accent-cyan));
    margin: 0.5rem auto 0 auto;
    border-radius: 2px;
}

/* ==========================================================================
   ABOUT SECTION
   ========================================================================== */

.about-section {
    padding: 6rem 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.lead-text {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.about-info p {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    font-size: 0.98rem;
}

.info-badges {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
    flex: 1;
}

.info-badge i {
    font-size: 1.6rem;
    color: var(--accent-emerald);
}

.info-badge h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.info-badge p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Stat Cards */
.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2.2rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
    border-color: var(--accent-emerald-glow);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.08);
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-plus {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-emerald);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 0.4rem;
}

/* ==========================================================================
   SKILLS SECTION (Control Panel Glow Badges)
   ========================================================================== */

.skills-section {
    padding: 6rem 0;
    position: relative;
}

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

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2.2rem;
    border-radius: 16px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-glow);
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.15),
        inset 0 0 15px rgba(16, 185, 129, 0.05);
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-emerald), var(--accent-cyan));
    opacity: 0;
    transition: var(--transition-smooth);
}

.skill-card:hover::before {
    opacity: 1;
}

.skill-icon-wrapper {
    width: 50px;
    height: 50px;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    color: var(--accent-emerald);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(16, 185, 129, 0.15);
    transition: var(--transition-smooth);
}

.skill-card:hover .skill-icon-wrapper {
    background: var(--accent-emerald);
    color: #0b1120;
    box-shadow: 0 0 15px var(--accent-emerald-glow);
}

.skill-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.skill-description {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.skill-level-bar {
    width: 100%;
    height: 4px;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(to right, var(--accent-emerald), var(--accent-cyan));
    border-radius: 2px;
    width: 0;
}

/* ==========================================================================
   PORTFOLIO GALLERY (Tall Cards + Lightbox Triggers)
   ========================================================================== */

.portfolio-section {
    padding: 6rem 0;
}

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

.portfolio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-emerald-glow);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4; 
    overflow: hidden;
    background: var(--bg-dark);
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.portfolio-card:hover .card-img {
    transform: scale(1.08);
    filter: brightness(0.4) blur(1px);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(11, 17, 32, 0.95) 15%, rgba(11, 17, 32, 0.6) 60%, transparent 100%);
    opacity: 0;
    transition: var(--transition-smooth);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
}

/* Light mode overlay overrides */
body.light-mode .card-overlay {
    background: linear-gradient(to top, rgba(248, 250, 252, 0.98) 15%, rgba(248, 250, 252, 0.7) 60%, transparent 100%);
}

.portfolio-card:hover .card-overlay {
    opacity: 1;
}

.card-overlay-content {
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.portfolio-card:hover .card-overlay-content {
    transform: translateY(0);
}

.card-category {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-emerald);
    font-weight: 700;
    display: block;
    margin-bottom: 0.4rem;
}

.card-project-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    line-height: 1.25;
}

.card-project-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.card-action-hint {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-cyan);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.card-info {
    padding: 1.8rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-cyan);
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.card-info h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-info p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   CERTIFICATIONS & EDUCATION TIMELINE
   ========================================================================== */

.certifications-section {
    padding: 6rem 0;
}

.certifications-timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding-left: 30px;
}

.certifications-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 4px;
    width: 2px;
    height: 100%;
    background: rgba(148, 163, 184, 0.15);
}

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

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -30px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 3px solid var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald-glow);
    transition: var(--transition-smooth);
}

.timeline-item:hover .timeline-dot {
    background: var(--accent-emerald);
    transform: scale(1.3);
}

.timeline-date {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-emerald);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.4rem;
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.8rem;
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.timeline-content:hover {
    border-color: var(--border-glow);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.timeline-content h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   CONTACT SECTION
   ========================================================================== */

.contact-section {
    padding: 6rem 0 8rem 0;
}

.contact-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.contact-info-side {
    padding: 4rem;
    background: var(--contact-side-bg);
    border-right: 1px solid var(--border-color);
}

.contact-info-side h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.contact-info-side p {
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.contact-detail-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.contact-detail-item i {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-emerald);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.contact-detail-item span {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
}

.contact-detail-item p {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0;
    font-weight: 500;
}

/* Actions Side */
.contact-actions-side {
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
}

.action-card {
    background: rgba(11, 17, 32, 0.2);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    transition: var(--transition-smooth);
    position: relative;
}

body.light-mode .action-card {
    background: rgba(255, 255, 255, 0.5);
}

.action-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-emerald-glow);
}

.whatsapp-icon {
    font-size: 2.2rem;
    color: #25d366;
    margin-bottom: 0.8rem;
}

.linkedin-icon {
    font-size: 2rem;
    color: #0077b5;
    margin-bottom: 0.8rem;
}

.action-card h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.action-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.whatsapp-btn {
    background: #25d366;
    color: #000;
}

.whatsapp-btn:hover {
    background: #20ba59;
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.4);
}

.linkedin-btn {
    background: #0077b5;
    color: #fff;
}

.linkedin-btn:hover {
    background: #006396;
    box-shadow: 0 0 15px rgba(0, 119, 181, 0.4);
}

/* ==========================================================================
   MAIN FOOTER
   ========================================================================== */

.main-footer {
    background: var(--footer-bg);
    padding: 2.5rem 0;
    border-top: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-links a:hover {
    color: var(--accent-emerald);
}

/* ==========================================================================
   CUSTOM LIGHTBOX SYSTEM (Detailed cartographic explorer)
   ========================================================================== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--lightbox-bg);
    z-index: 2000;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    font-size: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 2100;
    transition: var(--transition-smooth);
}

body.light-mode .lightbox-close {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.lightbox-close:hover {
    background: var(--accent-emerald);
    color: #0b1120;
    transform: scale(1.1);
}

.lightbox-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-grow: 1;
    max-height: calc(100vh - 180px);
    position: relative;
}

.lightbox-nav {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 2050;
    transition: var(--transition-smooth);
}

body.light-mode .lightbox-nav {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.lightbox-nav:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
}

.lightbox-image-container {
    width: 80%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    touch-action: none;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    cursor: grab;
    transition: transform 0.15s ease-out;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border-radius: 4px;
}

.lightbox-img:active {
    cursor: grabbing;
}

.lightbox-meta {
    width: 100%;
    max-width: 900px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.2rem 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    z-index: 2100;
}

#lightbox-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

#lightbox-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

.lightbox-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.82rem;
}

.control-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

body.light-mode .control-btn {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.08);
}

.control-btn:hover {
    background: var(--accent-emerald);
    color: #0b1120;
}

.control-hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   SCROLL REVEAL ANIMATIONS (Intersection Observer classes)
   ========================================================================== */

.section-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: 
        opacity 0.8s ease-out,
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Custom Keyframe Animations */
@keyframes beaconPulse {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

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

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

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

@keyframes scrollMouse {
    0% { transform: translate(-50%, 0); opacity: 1; }
    50% { transform: translate(-50%, 8px); opacity: 0.3; }
    100% { transform: translate(-50%, 0); opacity: 1; }
}

/* ==========================================================================
   ARABIC RTL CONFIGURATION & TRANSLATIONS OVERRIDES
   ========================================================================== */

body.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.rtl .nav-menu {
    margin-right: auto;
    margin-left: 0;
}

body.rtl .lang-toggle-btn {
    margin-right: 0.5rem;
    margin-left: 0;
}

body.rtl .hero-content,
body.rtl .about-info,
body.rtl .skill-card,
body.rtl .timeline-content,
body.rtl .contact-info-side {
    text-align: right;
}

body.rtl .hero-actions {
    justify-content: flex-start;
}

body.rtl .certifications-timeline {
    padding-right: 30px;
    padding-left: 0;
}

body.rtl .certifications-timeline::before {
    right: 4px;
    left: auto;
}

body.rtl .timeline-dot {
    right: -30px;
    left: auto;
}

body.rtl .contact-info-side {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

body.rtl .info-badge {
    text-align: right;
}

body.rtl .info-badge i {
    order: 0;
}

body.rtl .lightbox-meta {
    text-align: center;
}

body.rtl .control-hint {
    margin-left: 0;
    margin-right: 10px;
}

/* ==========================================================================
   RESPONSIVE DESIGN — Tablet (max 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
    .container { padding: 0 2rem; }

    .hero-title { font-size: 3rem; }
    .hero-container {
        grid-template-columns: 1fr !important;
        gap: 3rem;
        text-align: center;
    }
    .hero-visual { order: -1; }
    .hero-actions { justify-content: center; }
    .hero-description { margin: 0 auto; max-width: 100%; }

    .about-grid {
        grid-template-columns: 1fr !important;
        gap: 3rem;
    }

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

    .contact-box { grid-template-columns: 1fr !important; }
    .contact-info-side {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
    }

    body.rtl .contact-info-side {
        border-left: none !important;
        border-bottom: 1px solid var(--border-color);
    }

    body.rtl .hero-section { text-align: center; }
    body.rtl .hero-actions { justify-content: center; }
}

/* ==========================================================================
   RESPONSIVE DESIGN — Mobile (max 768px)
   ========================================================================== */

@media (max-width: 768px) {

    /* --- Navigation --- */
    .mobile-nav-toggle { display: flex !important; }

    .nav-menu {
        position: fixed !important;
        top: 70px !important;
        left: -100vw !important;
        right: auto !important;
        width: 100vw !important;
        height: calc(100vh - 70px) !important;
        background: var(--header-scrolled) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding-top: 2rem !important;
        gap: 0 !important;
        margin: 0 !important;
        transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
        border-top: 1px solid var(--border-color) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 9999 !important;
    }

    .nav-menu.active {
        left: 0 !important;
    }

    body.rtl .nav-menu {
        right: -100vw !important;
        left: auto !important;
    }
    body.rtl .nav-menu.active {
        right: 0 !important;
        left: auto !important;
    }

    .nav-link {
        font-size: 1.1rem !important;
        padding: 1rem 1.5rem !important;
        width: 100% !important;
        text-align: center !important;
        border-bottom: 1px solid var(--border-color) !important;
        border-radius: 0 !important;
    }
    .nav-link.contact-btn {
        margin: 1rem 2rem !important;
        width: calc(100% - 4rem) !important;
        border-radius: 8px !important;
        border-bottom: none !important;
    }

    .lang-toggle-btn,
    .theme-toggle-btn {
        margin: 0.5rem auto !important;
    }

    /* Hamburger X animation */
    .mobile-nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .mobile-nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .mobile-nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* --- Hero --- */
    .hero-section {
        text-align: center !important;
        padding-top: 90px !important;
        min-height: auto !important;
    }
    body.rtl .hero-section { text-align: center !important; }
    .hero-container {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    .hero-visual { order: -1; }
    .hero-title { font-size: 2.4rem !important; line-height: 1.15 !important; }
    .hero-subtitle { font-size: 1rem !important; }
    .hero-description {
        font-size: 0.9rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
    }
    .hero-actions {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 0.8rem !important;
    }
    body.rtl .hero-actions { justify-content: center !important; }
    .coordinate-marker { display: none !important; }
    .scroll-indicator { display: none !important; }
    .badge-gis { margin-left: auto; margin-right: auto; }

    /* --- Profile Frame --- */
    .profile-frame { width: 220px !important; height: 220px !important; }

    /* --- Sections general --- */
    .philosophy-section,
    .about-section,
    .skills-section,
    .portfolio-section,
    .certifications-section { padding: 3.5rem 0 !important; }
    .contact-section { padding: 3.5rem 0 5rem !important; }

    .philosophy-card { padding: 2.5rem 1.5rem !important; }
    .philosophy-quote { font-size: 1.2rem !important; }

    .section-header { margin-bottom: 2rem !important; }
    .section-title { font-size: 1.9rem !important; }

    /* --- About --- */
    .about-grid { grid-template-columns: 1fr !important; gap: 2.5rem !important; }
    .info-badges { flex-direction: column !important; gap: 0.8rem !important; }
    .about-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 1rem !important; }
    .stat-card { padding: 1.5rem 1rem !important; }
    .stat-num { font-size: 2.2rem !important; }

    /* --- Skills --- */
    .skills-grid { grid-template-columns: 1fr !important; gap: 1.2rem !important; }
    .skill-card { padding: 1.5rem !important; }

    /* --- Portfolio --- */
    .portfolio-grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
    .card-image-wrapper { aspect-ratio: 4 / 3 !important; }

    /* --- Contact --- */
    .contact-box {
        grid-template-columns: 1fr !important;
        border-radius: 16px !important;
    }
    .contact-info-side {
        padding: 2rem !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    body.rtl .contact-info-side {
        border-left: none !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    .contact-actions-side { padding: 2rem !important; }
    .contact-info-side h3 { font-size: 1.5rem !important; }

    /* --- Footer --- */
    .footer-container {
        flex-direction: column !important;
        gap: 0.8rem !important;
        text-align: center !important;
    }

    /* --- Lightbox --- */
    .lightbox { padding: 10px !important; }
    .lightbox-content-wrapper { max-height: calc(100vh - 190px) !important; }
    .lightbox-nav { width: 36px !important; height: 36px !important; font-size: 0.9rem !important; }
    .lightbox-image-container { width: 80% !important; }
    .lightbox-meta { padding: 0.9rem 1rem !important; }
    #lightbox-title { font-size: 1rem !important; }
    #lightbox-desc { font-size: 0.78rem !important; }
    .control-hint { display: none !important; }
}

/* ==========================================================================
   RESPONSIVE DESIGN — Small Mobile (max 480px)
   ========================================================================== */

@media (max-width: 480px) {
    .container { padding: 0 1rem !important; }

    .hero-title { font-size: 2rem !important; }
    .hero-subtitle { font-size: 0.95rem !important; }
    .hero-description { font-size: 0.85rem !important; }
    .btn { padding: 0.7rem 1.4rem !important; font-size: 0.85rem !important; }

    .profile-frame { width: 190px !important; height: 190px !important; }

    .section-title { font-size: 1.7rem !important; }
    .philosophy-quote { font-size: 1.1rem !important; }
    .philosophy-card { padding: 2rem 1rem !important; }

    .stat-num { font-size: 1.9rem !important; }
    .stat-plus { font-size: 1.5rem !important; }
    .stat-card { padding: 1.2rem 0.8rem !important; }

    .skill-card { padding: 1.3rem !important; }
    .card-image-wrapper { aspect-ratio: 1 / 1 !important; }
    .card-info { padding: 1rem !important; }

    .contact-info-side,
    .contact-actions-side { padding: 1.2rem !important; }

    .lightbox-image-container { width: 100% !important; }
    .lightbox-nav { display: none !important; }
    .lightbox-meta { padding: 0.7rem 0.8rem !important; border-radius: 8px !important; }
}

/* ==========================================================================
   RESPONSIVE DESIGN — Extra Small (max 360px)
   ========================================================================== */

@media (max-width: 360px) {
    .container { padding: 0 0.8rem !important; }
    .hero-title { font-size: 1.75rem !important; }
    .logo-text { font-size: 0.9rem !important; }
    .about-stats { grid-template-columns: 1fr !important; }
    .hero-actions { flex-direction: column !important; align-items: center !important; }
    .btn { width: 100% !important; justify-content: center !important; }
    .profile-frame { width: 170px !important; height: 170px !important; }
}
