/* ============================
   Ahmed Mubaraki Portfolio
   style.css
   ============================ */

/* ==========================================================================
           1. CSS Variables & Theme Setup
           ========================================================================== */
        :root {
            --bg-main: #0a0a0f;
            --bg-card: rgba(255, 255, 255, 0.03);
            --bg-card-hover: rgba(255, 255, 255, 0.05);
            --border-color: rgba(255, 255, 255, 0.08);
            --border-hover: rgba(108, 99, 255, 0.5);
            
            --primary: #6c63ff;
            --primary-glow: rgba(108, 99, 255, 0.2);
            --cyan: #22d3ee;
            --green: #4ade80;
            --pink: #f472b6;
            --orange: #fb923c;
            
            --text-main: #ffffff;
            --text-muted: #94a3b8;
            
            --font-title: 'Cairo', sans-serif;
            --font-body: 'IBM Plex Sans Arabic', sans-serif;
            --font-mono: 'JetBrains Mono', monospace;
            
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* ==========================================================================
           2. Reset & Base Styles
           ========================================================================== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background-color: var(--bg-main);
            color: var(--text-main);
            font-family: var(--font-body);
            line-height: 1.7;
            overflow-x: hidden;
            position: relative;
        }

        h1, h2, h3, h4, h5, h6 {
            font-family: var(--font-title);
            font-weight: 700;
            line-height: 1.3;
        }

        a {
            text-decoration: none;
            color: inherit;
        }

        .en-text, .number, .tech-tag {
            font-family: var(--font-mono);
            direction: ltr;
            display: inline-block;
        }

        /* ==========================================================================
           3. Background Effects (Noise, Grid, Blobs)
           ========================================================================== */
        .bg-noise {
            position: fixed;
            top: 0; left: 0; width: 100vw; height: 100vh;
            background: url('data:image/svg+xml;utf8,%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="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)" opacity="0.04"/%3E%3C/svg%3E');
            pointer-events: none;
            z-index: -1;
        }

        .bg-grid {
            position: fixed;
            top: 0; left: 0; width: 100vw; height: 100vh;
            background-image: 
                linear-gradient(rgba(108, 99, 255, 0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(108, 99, 255, 0.03) 1px, transparent 1px);
            background-size: 40px 40px;
            pointer-events: none;
            z-index: -2;
        }

        .blobs {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            pointer-events: none;
            z-index: -3;
            overflow: hidden;
        }

        .blob {
            position: absolute;
            border-radius: 50%;
            filter: blur(100px);
            opacity: 0.4;
            animation: float 20s infinite ease-in-out alternate;
        }

        .blob-1 {
            top: -10%; right: -5%;
            width: 400px; height: 400px;
            background: rgba(108, 99, 255, 0.3);
        }

        .blob-2 {
            bottom: -10%; left: -10%;
            width: 500px; height: 500px;
            background: rgba(34, 211, 238, 0.15);
            animation-delay: -5s;
        }

        @keyframes float {
            0% { transform: translate(0, 0) scale(1); }
            50% { transform: translate(30px, 50px) scale(1.1); }
            100% { transform: translate(-20px, 20px) scale(0.9); }
        }

        /* ==========================================================================
           4. Utilities & Layout
           ========================================================================== */
        .container {
            max-width: 1100px;
            margin: 0 auto;
            padding: 0 5%;
        }

        section {
            padding: 6rem 0;
            position: relative;
        }

        .section-label {
            font-family: var(--font-mono);
            color: var(--primary);
            font-size: 0.9rem;
            letter-spacing: 2px;
            margin-bottom: 1.5rem;
            display: inline-block;
            text-transform: uppercase;
        }

        .section-title {
            font-size: 2.5rem;
            margin-bottom: 3rem;
            color: var(--text-main);
        }

        .card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 2rem;
            backdrop-filter: blur(10px);
            transition: var(--transition);
            position: relative;
            overflow: hidden;
        }

        .card:hover {
            background: var(--bg-card-hover);
            border-color: var(--border-hover);
            transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(0,0,0,0.2), 0 0 20px var(--primary-glow);
        }

        /* Scroll Reveal Animation */
        .reveal {
            opacity: 0;
            transform: translateY(40px);
            transition: opacity 0.8s ease-out, transform 0.8s ease-out;
        }

        .reveal.active {
            opacity: 1;
            transform: translateY(0);
        }

        /* ==========================================================================
           5. Hero Section
           ========================================================================== */
        .hero {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding-top: 4rem;
        }

        .status-badge {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 8px 16px;
            background: rgba(74, 222, 128, 0.08);
            border: 1px solid rgba(74, 222, 128, 0.2);
            border-radius: 50px;
            color: var(--green);
            font-weight: 600;
            font-size: 0.9rem;
            margin-bottom: 2rem;
            width: fit-content;
        }

        .pulse-dot {
            width: 8px; height: 8px;
            background-color: var(--green);
            border-radius: 50%;
            box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
            70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
            100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
        }

        .hero-title {
            font-size: clamp(3rem, 6vw, 5rem);
            font-weight: 900;
            margin-bottom: 0.5rem;
            background: linear-gradient(to left, #fff, #a5b4fc);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .hero-title .en-text {
            font-family: inherit;
            font-weight: inherit;
            font-size: 0.7em;
            color: var(--text-muted);
            -webkit-text-fill-color: var(--text-muted);
        }

        .hero-subtitle {
            font-size: clamp(1.2rem, 3vw, 1.8rem);
            color: var(--text-muted);
            font-weight: 500;
            margin-bottom: 2rem;
        }

        .hero-subtitle .highlight {
            color: var(--primary);
            font-weight: 700;
        }

        .hero-bio {
            font-size: 1.2rem;
            max-width: 800px;
            color: var(--text-muted);
            line-height: 1.8;
            margin-bottom: 3rem;
            border-right: 4px solid var(--primary);
            padding-right: 1.5rem;
        }

        /* Stats */
        .stats-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 2rem;
            margin-top: 2rem;
        }

        .stat-item {
            display: flex;
            flex-direction: column;
        }

        .stat-item .number {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--cyan);
            line-height: 1;
            margin-bottom: 0.5rem;
        }

        .stat-item .label {
            font-size: 1rem;
            color: var(--text-muted);
            font-weight: 500;
        }

        /* Scroll Indicator */
        .scroll-indicator {
            position: absolute;
            bottom: 40px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            opacity: 0.6;
        }

        .scroll-line {
            width: 2px;
            height: 60px;
            background: rgba(255, 255, 255, 0.1);
            position: relative;
            overflow: hidden;
        }

        .scroll-line::after {
            content: '';
            position: absolute;
            top: -50%; left: 0; width: 100%; height: 50%;
            background: var(--primary);
            animation: scrollLine 2s infinite ease-in-out;
        }

        @keyframes scrollLine {
            0% { top: -50%; }
            100% { top: 100%; }
        }

        /* ==========================================================================
           6. About Section
           ========================================================================== */
        .about-grid {
            display: grid;
            grid-template-columns: 1.2fr 0.8fr;
            gap: 4rem;
            align-items: center;
        }

        .about-text p {
            margin-bottom: 1.5rem;
            font-size: 1.1rem;
            color: var(--text-muted);
        }

        .philosophy-card h3 {
            color: var(--primary);
            margin-bottom: 1.5rem;
            font-size: 1.4rem;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .philosophy-quote {
            font-size: 1.3rem;
            font-style: italic;
            font-weight: 600;
            color: #fff;
            margin-bottom: 2rem;
            position: relative;
        }
        
        .philosophy-quote::before {
            content: '"';
            color: var(--primary);
            opacity: 0.5;
            font-size: 3rem;
            position: absolute;
            right: -20px;
            top: -20px;
            font-family: serif;
        }

        .principles-list {
            list-style: none;
        }

        .principles-list li {
            position: relative;
            padding-right: 1.5rem;
            margin-bottom: 0.8rem;
            color: var(--text-muted);
        }

        .principles-list li::before {
            content: '▹';
            position: absolute;
            right: 0;
            color: var(--primary);
            font-family: var(--font-mono);
        }

        /* ==========================================================================
           7. Tech Stack Section
           ========================================================================== */
        .tech-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 2rem;
        }

        .tech-category-title {
            font-size: 1.2rem;
            margin-bottom: 1.5rem;
            color: #fff;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .tech-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .tech-tag {
            background: rgba(108, 99, 255, 0.1);
            color: #a5b4fc;
            padding: 6px 14px;
            border-radius: 6px;
            font-size: 0.85rem;
            border: 1px solid rgba(108, 99, 255, 0.2);
            transition: var(--transition);
        }

        .tech-tag:hover {
            background: rgba(108, 99, 255, 0.2);
            border-color: var(--primary);
            color: #fff;
            transform: translateY(-2px);
        }

        /* ==========================================================================
           8. Featured Projects
           ========================================================================== */
        .projects-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 2rem;
        }

        .project-card {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .project-card.featured {
            grid-column: 1 / -1;
            background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(108, 99, 255, 0.05) 100%);
            border: 1px solid rgba(108, 99, 255, 0.3);
        }

        .project-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 1.5rem;
        }

        .project-num {
            color: var(--primary);
            font-size: 1.5rem;
            font-weight: 700;
            opacity: 0.5;
        }

        .project-card:hover .project-num {
            opacity: 1;
        }

        .project-title {
            font-size: 1.4rem;
            color: #fff;
            margin-bottom: 1rem;
        }

        .project-card.featured .project-title {
            font-size: 2rem;
        }

        .project-desc {
            color: var(--text-muted);
            margin-bottom: 2rem;
        }

        /* ==========================================================================
           9. Experience Timeline
           ========================================================================== */
        .timeline {
            position: relative;
            padding-right: 2rem;
            border-right: 2px solid rgba(255, 255, 255, 0.1);
        }

        .timeline-item {
            position: relative;
            margin-bottom: 3rem;
        }

        .timeline-item:last-child {
            margin-bottom: 0;
        }

        .timeline-dot {
            position: absolute;
            right: -31px;
            top: 5px;
            width: 14px;
            height: 14px;
            background: var(--bg-main);
            border: 2px solid var(--primary);
            border-radius: 50%;
            transition: var(--transition);
        }

        .timeline-item:hover .timeline-dot {
            background: var(--primary);
            box-shadow: 0 0 15px var(--primary-glow);
        }

        .timeline-date {
            font-family: var(--font-mono);
            color: var(--primary);
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
            display: inline-block;
        }

        .timeline-title {
            font-size: 1.4rem;
            color: #fff;
            margin-bottom: 1rem;
        }

        .timeline-desc {
            color: var(--text-muted);
            margin-bottom: 1.5rem;
        }

        /* ==========================================================================
           10. Interests
           ========================================================================== */
        .interests-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 2rem;
        }
        
        .interest-card h3 {
            font-size: 1.2rem;
            margin-bottom: 1rem;
            color: #fff;
        }
        
        .interest-card p {
            color: var(--text-muted);
            font-size: 0.95rem;
        }

        /* ==========================================================================
           11. Contact / CTA
           ========================================================================== */
        .cta-section {
            text-align: center;
            padding: 8rem 0;
            background: linear-gradient(180deg, transparent 0%, rgba(108, 99, 255, 0.05) 100%);
            border-top: 1px solid rgba(255, 255, 255, 0.05);
        }

        .cta-title {
            font-size: clamp(2rem, 5vw, 3.5rem);
            margin-bottom: 1.5rem;
            color: #fff;
        }

        .cta-desc {
            font-size: 1.2rem;
            color: var(--text-muted);
            margin-bottom: 3rem;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }

        .btn-group {
            display: flex;
            justify-content: center;
            gap: 1.5rem;
            flex-wrap: wrap;
        }

        .btn {
            padding: 1rem 2.5rem;
            border-radius: 8px;
            font-family: var(--font-title);
            font-weight: 700;
            font-size: 1.1rem;
            transition: var(--transition);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 10px;
        }

        .btn-primary {
            background: var(--primary);
            color: #fff;
            border: none;
            box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
        }

        .btn-primary:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(108, 99, 255, 0.5);
        }

        .btn-secondary {
            background: transparent;
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .btn-secondary:hover {
            border-color: #fff;
            transform: translateY(-3px);
        }

        /* Footer */
        footer {
            text-align: center;
            padding: 2rem 0;
            border-top: 1px solid rgba(255, 255, 255, 0.05);
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        /* ==========================================================================
           12. Responsive Design
           ========================================================================== */
        @media (max-width: 900px) {
            .about-grid {
                grid-template-columns: 1fr;
            }
            .projects-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 600px) {
            .stats-grid {
                gap: 1.5rem;
            }
            .btn-group {
                flex-direction: column;
                width: 100%;
            }
            .btn {
                width: 100%;
                justify-content: center;
            }
        }
