/* ============================================================
   ZIAD ABDULLAH ALOTAIBI — PORTFOLIO V3
   Mobile-first · Immersive cards · Horizontal scroll
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
    --bg: #030014;
    --surface: rgba(255,255,255,0.03);
    --surface2: rgba(255,255,255,0.06);
    --surface3: rgba(255,255,255,0.09);
    --accent: #d4a843;
    --accent-light: #f0c56a;
    --accent-dim: rgba(212,168,67,0.1);
    --accent-glow: rgba(212,168,67,0.25);
    --violet: #8b5cf6;
    --violet-dim: rgba(139,92,246,0.1);
    --text: #eaeaf2;
    --text-dim: #7a7a98;
    --text-muted: #3a3a55;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.14);
    --glass: rgba(8,6,28,0.6);
    --glass-border: rgba(255,255,255,0.08);
    --card-dark: rgba(3,0,20,0.95);
    --radius: 24px;
    --radius-sm: 14px;
    --radius-lg: 32px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --transition: all 0.5s var(--ease);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
[lang="ar"] body, [lang="ar"] { font-family: 'Cairo', sans-serif; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── Animated Mesh Background ──────────────────────────────── */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.mesh-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
}
.mesh-orb-1 {
    width: 50vmax; height: 50vmax;
    background: radial-gradient(circle, rgba(212,168,67,0.13), transparent 70%);
    top: -15%; right: -10%;
    animation: meshFloat1 18s ease-in-out infinite;
}
.mesh-orb-2 {
    width: 45vmax; height: 45vmax;
    background: radial-gradient(circle, rgba(139,92,246,0.1), transparent 70%);
    bottom: -10%; left: -15%;
    animation: meshFloat2 24s ease-in-out infinite;
}
.mesh-orb-3 {
    width: 35vmax; height: 35vmax;
    background: radial-gradient(circle, rgba(236,72,153,0.06), transparent 70%);
    top: 35%; left: 40%;
    animation: meshFloat3 28s ease-in-out infinite;
}
.mesh-orb-4 {
    width: 30vmax; height: 30vmax;
    background: radial-gradient(circle, rgba(34,197,94,0.05), transparent 70%);
    bottom: 30%; right: 10%;
    animation: meshFloat4 22s ease-in-out infinite;
}
@keyframes meshFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-60px, 80px) scale(1.1); }
    50% { transform: translate(40px, -30px) scale(0.95); }
    75% { transform: translate(-30px, -50px) scale(1.05); }
}
@keyframes meshFloat2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(80px, -60px) scale(1.08); }
    66% { transform: translate(-40px, 50px) scale(0.92); }
}
@keyframes meshFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-70px, -50px) scale(1.12); }
}
@keyframes meshFloat4 {
    0%, 100% { transform: translate(0, 0); }
    40% { transform: translate(50px, 40px) scale(1.06); }
    80% { transform: translate(-60px, -30px) scale(0.94); }
}

.bg-noise {
    position: fixed;
    inset: 0;
    z-index: 1;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
}

/* Content sits above background */
.nav, main, .hero, .section, .marquee-section, .divider,
.contact-wrap, .footer, .back-btn, .project-hero-band,
.project-hero, .project-body, #contact-section, .lightbox {
    position: relative;
    z-index: 2;
}

/* ── Custom Cursor ─────────────────────────────────────────── */
.cursor, .cursor-dot {
    display: none;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
@media (hover: hover) and (pointer: fine) {
    .cursor {
        display: block;
        width: 36px; height: 36px;
        border: 1.5px solid var(--accent);
        opacity: 0.35;
        transition: width 0.4s var(--ease), height 0.4s var(--ease),
                    opacity 0.3s, background 0.3s;
    }
    .cursor-dot {
        display: block;
        width: 5px; height: 5px;
        background: var(--accent);
    }
    .cursor.is-hovering {
        width: 56px; height: 56px;
        background: var(--accent-dim);
        opacity: 0.7;
    }
}

/* ── Navigation ────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 12px 16px;
}
.nav-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--glass);
    backdrop-filter: blur(28px) saturate(1.5);
    -webkit-backdrop-filter: blur(28px) saturate(1.5);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 5px 6px 5px 18px;
    transition: var(--transition);
}
.nav.scrolled .nav-inner {
    background: rgba(8,6,28,0.88);
    border-color: var(--border-hover);
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.nav-logo { display: flex; align-items: center; }
.logo-mark {
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: 100px;
    transition: var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-link--cta {
    background: var(--accent);
    color: #000;
    font-weight: 700;
}
.nav-link--cta:hover {
    background: var(--accent-light);
    box-shadow: 0 4px 20px var(--accent-glow);
}
.lang-toggle {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: 2px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ── HERO ──────────────────────────────────────────────────── */
.hero {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 110px 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.hero-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeUp 0.7s var(--ease) 0.15s forwards;
}
.hero-name {
    font-size: clamp(3.2rem, 15vw, 9rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.05em;
    color: var(--text);
    margin-bottom: 8px;
    opacity: 0;
    animation: fadeUp 0.8s var(--ease) 0.25s forwards;
}
.hero-name .gtext {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 30%, #f5dfa0 60%, var(--accent) 100%);
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 5s linear infinite;
}
@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 250% center; }
}

/* Typing effect line */
.hero-typing {
    font-size: clamp(1.1rem, 3.5vw, 1.6rem);
    font-weight: 400;
    color: var(--text-dim);
    margin-top: 24px;
    min-height: 2.2em;
    opacity: 0;
    animation: fadeUp 0.7s var(--ease) 0.45s forwards;
}
.typing-text {
    color: var(--accent-light);
    font-weight: 600;
}
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 1s step-end infinite;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
    opacity: 0;
    animation: fadeUp 0.7s var(--ease) 0.55s forwards;
}
.hero-tag {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    white-space: nowrap;
}

/* Hero CTA buttons */
.hero-ctas {
    display: flex;
    gap: 12px;
    margin-top: 36px;
    opacity: 0;
    animation: fadeUp 0.7s var(--ease) 0.65s forwards;
}
.hero-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #000;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.hero-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px var(--accent-glow);
}
.hero-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.hero-btn-secondary:hover {
    color: var(--text);
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

/* Hero stats */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin-top: 48px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 440px;
    opacity: 0;
    animation: fadeUp 0.7s var(--ease) 0.75s forwards;
}
.stat-card {
    padding: 22px 16px;
    text-align: center;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 6px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Scroll indicator */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 48px;
    opacity: 0;
    animation: fadeUp 0.7s var(--ease) 0.9s forwards;
}
.scroll-indicator span {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    animation: bounceArrow 2s ease-in-out infinite;
}
@keyframes bounceArrow {
    0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.3; }
    50% { transform: rotate(45deg) translate(6px, 6px); opacity: 1; }
}

/* ── MARQUEE ───────────────────────────────────────────────── */
.marquee-section {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
    overflow: hidden;
    background: rgba(3,0,20,0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.marquee-track {
    display: flex;
    gap: 0;
    width: max-content;
    animation: marqueeScroll 40s linear infinite;
}
[dir="rtl"] .marquee-track {
    animation: marqueeScrollRtl 40s linear infinite;
}
.marquee-item {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dim);
    padding: 0 20px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 20px;
}
.marquee-item::after {
    content: '✦';
    color: var(--accent);
    font-size: 0.55rem;
    opacity: 0.5;
}
@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes marqueeScrollRtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

/* ── Section Layout ────────────────────────────────────────── */
.section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.section-header { margin-bottom: 40px; }
.section-eyebrow {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
    display: block;
}
.section-title {
    font-size: clamp(2rem, 6vw, 3.6rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text);
}
.section-desc {
    color: var(--text-dim);
    margin-top: 16px;
    max-width: 460px;
    line-height: 1.8;
    font-size: 0.9rem;
}

/* ── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 100px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    background: var(--surface);
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.filter-btn:hover { border-color: var(--border-hover); color: var(--text); }
.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════════════
   PROJECT CARDS — Immersive full-bleed design
   Mobile: Horizontal swipeable scroll
   Desktop: 3-column grid
   ═══════════════════════════════════════════════════════════════ */

.projects-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px 24px;
    margin: 0 -20px;
    scrollbar-width: none;
}
.projects-container::-webkit-scrollbar { display: none; }

.project-card {
    flex: 0 0 78vw;
    max-width: 78vw;
    scroll-snap-align: center;
    position: relative;
    height: 440px;
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--glass-border);
    transition: transform 0.6s var(--ease), border-color 0.5s var(--ease), box-shadow 0.6s var(--ease);
    opacity: 0;
    transform: translateY(30px);
}
.project-card.revealed { opacity: 1; transform: translateY(0); }
.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(212,168,67,0.2);
    box-shadow: 0 40px 80px -20px rgba(0,0,0,0.5);
}

/* Spotlight */
.card-spotlight {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 5;
    background: radial-gradient(
        400px circle at var(--x, 50%) var(--y, 50%),
        rgba(255,255,255,0.08),
        transparent 40%
    );
}
.project-card:hover .card-spotlight { opacity: 1; }

/* Full-bleed background (image or gradient+emoji) */
.card-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
    background: var(--glass);
}
.card-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ease);
}
.project-card:hover .card-bg img {
    transform: scale(1.08);
}
.card-emoji {
    font-size: 4.5rem;
    filter: drop-shadow(0 8px 30px rgba(0,0,0,0.5));
    transition: transform 0.7s var(--ease);
    z-index: 1;
    position: relative;
}
.project-card:hover .card-emoji {
    transform: scale(1.2) translateY(-8px);
}

/* Glow behind emoji */
.card-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 45%, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* Category gradient backgrounds */
.cat-web      { background: linear-gradient(160deg, #0a1628 0%, #1e3a8a 50%, #3b82f6 100%) !important; }
.cat-software { background: linear-gradient(160deg, #031a10 0%, #065f46 50%, #10b981 100%) !important; }
.cat-bot      { background: linear-gradient(160deg, #160a3c 0%, #4c1d95 50%, #8b5cf6 100%) !important; }
.cat-ai_model { background: linear-gradient(160deg, #1f0a00 0%, #7c2d12 50%, #f97316 100%) !important; }
.cat-research { background: linear-gradient(160deg, #140505 0%, #7f1d1d 50%, #ef4444 100%) !important; }

/* Content overlaying bottom of card */
.card-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 100px 24px 24px;
    background: linear-gradient(to top,
        var(--card-dark) 0%,
        rgba(3,0,20,0.85) 35%,
        rgba(3,0,20,0.4) 65%,
        transparent 100%
    );
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-num {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.5);
}
.card-badge {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 100px;
}
/* Badge colors */
.badge-web      { background: rgba(59,130,246,0.25);  color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.badge-software { background: rgba(52,211,153,0.2);   color: #6ee7b7; border: 1px solid rgba(52,211,153,0.3); }
.badge-bot      { background: rgba(167,139,250,0.25); color: #c4b5fd; border: 1px solid rgba(167,139,250,0.3); }
.badge-ai_model { background: rgba(251,146,60,0.22);  color: #fdba74; border: 1px solid rgba(251,146,60,0.3); }
.badge-research { background: rgba(248,113,113,0.2);  color: #fca5a5; border: 1px solid rgba(248,113,113,0.3); }

.card-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #fff;
}
.card-desc {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.card-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);
}
.card-arrow {
    font-size: 1.2rem;
    color: var(--accent);
    transition: transform 0.4s var(--ease);
    font-weight: 300;
}
.project-card:hover .card-arrow {
    transform: translateX(6px);
}
[dir="rtl"] .project-card:hover .card-arrow {
    transform: translateX(-6px);
}

/* Bottom accent glow */
.project-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--violet));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease);
    z-index: 6;
}
.project-card:hover::after { transform: scaleX(1); }

/* Scroll dots (mobile only) */
.scroll-indicators {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 20px;
}
.scroll-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}
.scroll-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.35s var(--ease);
    border: none;
    padding: 0;
    cursor: pointer;
}
.scroll-dot.active {
    background: var(--accent);
    width: 28px;
    border-radius: 4px;
}
.swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 1;
    transition: opacity 0.6s;
}
.swipe-hint.hidden { opacity: 0; pointer-events: none; }
.swipe-hint-arrow {
    display: inline-block;
    animation: swipeNudge 1.5s ease-in-out infinite;
}
@keyframes swipeNudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}
[dir="rtl"] .swipe-hint-arrow {
    animation: swipeNudgeRtl 1.5s ease-in-out infinite;
}
@keyframes swipeNudgeRtl {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-6px); }
}
@media (min-width: 768px) {
    .scroll-indicators { display: none; }
}

/* ── Desktop grid ─────────────────────────────────────────── */
@media (min-width: 768px) {
    .projects-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        overflow: visible;
        padding: 0;
        margin: 0;
    }
    .project-card {
        flex: none;
        max-width: none;
        height: 460px;
    }
}
@media (min-width: 1100px) {
    .projects-container {
        grid-template-columns: repeat(3, 1fr);
    }
    .project-card { height: 480px; }
}

/* ── RESEARCH SECTION ──────────────────────────────────────── */
.research-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 640px) {
    .research-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
    .research-grid { grid-template-columns: repeat(3, 1fr); }
}
.research-card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 26px 22px;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
    opacity: 0;
    transform: translateY(24px);
}
.research-card.revealed { opacity: 1; transform: translateY(0); }
.research-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    border-left-color: var(--accent-light);
    box-shadow: 0 24px 64px -12px rgba(0,0,0,0.5);
}
.rc-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.rc-icon { font-size: 1.7rem; line-height: 1; }
.rc-num {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    background: var(--surface2);
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid var(--border);
}
.rc-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: auto;
}
.rc-status.published {
    background: rgba(34,197,94,0.1);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.2);
}
.rc-status.review {
    background: rgba(148,163,184,0.06);
    color: #94a3b8;
    border: 1px solid rgba(148,163,184,0.12);
}
[dir="rtl"] .rc-status { margin-left: 0; margin-right: auto; }
.rc-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 10px;
}
.rc-abstract {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rc-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 16px;
    transition: gap 0.4s var(--ease), color 0.3s;
}
.research-card:hover .rc-cta {
    gap: 12px;
    color: var(--accent-light);
}

/* ── CONTACT ───────────────────────────────────────────────── */
.contact-wrap {
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.contact-section {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 48px 28px;
    position: relative;
    overflow: hidden;
}
.contact-section::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(212,168,67,0.07), transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}
.contact-section::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(139,92,246,0.05), transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}
@media (min-width: 768px) {
    .contact-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 60px;
        align-items: start;
        padding: 64px;
    }
}
.contact-info-title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 18px;
}
.contact-info-title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--accent), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.contact-info-desc {
    color: var(--text-dim);
    line-height: 1.8;
    font-size: 0.9rem;
    margin-bottom: 36px;
}
.contact-details { display: flex; flex-direction: column; gap: 10px; }
.contact-detail-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-dim);
    font-size: 0.84rem;
    padding: 14px 18px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.contact-detail-item:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: var(--surface2);
}
.contact-detail-item a { color: inherit; font-weight: 500; }
.contact-icon { font-size: 1.1rem; flex-shrink: 0; }

/* Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}
@media (min-width: 768px) { .contact-form { margin-top: 0; } }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.form-input, .form-textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    color: var(--text);
    font-size: 0.88rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
}
.form-input:focus, .form-textarea:focus {
    border-color: var(--accent);
    background: var(--surface2);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #000;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-align: center;
    cursor: pointer;
    border: none;
    font-family: inherit;
}
.form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--accent-glow);
}
.form-btn:disabled { opacity: 0.5; pointer-events: none; }
.form-msg {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
    display: none;
}
.form-msg.success {
    background: rgba(74,222,128,0.08);
    border: 1px solid rgba(74,222,128,0.2);
    color: #4ade80;
    display: block;
}
.form-msg.error {
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.2);
    color: #f87171;
    display: block;
}

/* ── PROJECT DETAIL PAGE ───────────────────────────────────── */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    padding: 10px 20px;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    transition: var(--transition);
    margin: 90px 20px 0;
}
.back-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.project-hero-band {
    width: 100%;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-top: 24px;
}
.project-hero-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 55%, rgba(255,255,255,0.08) 0%, transparent 55%);
    pointer-events: none;
}
.project-hero-band::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60%;
    background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
    pointer-events: none;
}
.project-hero-emoji {
    font-size: 6rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 12px 40px rgba(0,0,0,0.5));
    animation: heroEmoji 0.8s var(--ease) 0.2s both;
}
@keyframes heroEmoji {
    from { opacity: 0; transform: scale(0.4) translateY(24px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.project-hero {
    padding: 28px 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}
.project-hero > div:first-child {
    margin-bottom: 18px;
}
.project-hero-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 13px;
    border-radius: 100px;
    margin-bottom: 0;
}
.project-hero .rc-status {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
}
.project-hero-title {
    font-size: clamp(1.8rem, 6vw, 3.6rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 20px;
}
.project-hero-desc {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.85;
    max-width: 720px;
    margin-bottom: 36px;
}

/* Action buttons */
.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 56px;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    border: 1px solid transparent;
}
.action-btn-live {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #000;
    border-color: var(--accent);
}
.action-btn-live:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px var(--accent-glow);
}
.action-btn-secondary {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-dim);
    border-color: var(--glass-border);
}
.action-btn-secondary:hover {
    border-color: var(--border-hover);
    color: var(--text);
    transform: translateY(-3px);
}
.action-btn-contact {
    background: transparent;
    color: var(--accent);
    border-color: rgba(212,168,67,0.25);
}
.action-btn-contact:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    transform: translateY(-3px);
}

/* Project body */
.project-body {
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.project-long-desc {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 2;
    max-width: 740px;
    margin-bottom: 52px;
}
.project-long-desc h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 32px 0 12px;
}
.project-long-desc ul, .project-long-desc ol {
    padding-left: 22px;
    margin: 12px 0;
}
.project-long-desc li { margin-bottom: 8px; }
.project-long-desc p { margin-bottom: 14px; }

/* Tech */
.tech-section { margin-bottom: 52px; }
.tech-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.tech-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tech-pill {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-dim);
    padding: 8px 18px;
    border-radius: 100px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}
.tech-pill:hover { border-color: var(--border-hover); color: var(--text); }

/* Video */
.video-section { margin-bottom: 56px; }
.video-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.video-wrapper {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--glass-border);
}
.video-wrapper video { width: 100%; display: block; max-height: 540px; }

/* Gallery */
.gallery-section { margin-bottom: 64px; }
.gallery-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 640px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    cursor: zoom-in;
    transition: var(--transition);
}
.gallery-item:hover {
    border-color: var(--border-hover);
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Contact note */
.contact-note-box {
    background: var(--accent-dim);
    border: 1px solid rgba(212,168,67,0.2);
    border-radius: var(--radius);
    padding: 24px 22px;
    margin-bottom: 52px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.contact-note-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.contact-note-text { font-size: 0.86rem; color: var(--text-dim); line-height: 1.8; }
.contact-note-text strong { color: var(--accent); font-weight: 700; }

/* ── Lightbox ──────────────────────────────────────────────── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(3,0,20,0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: min(100%, 1000px);
    width: auto;
    height: auto;
    border-radius: var(--radius);
    object-fit: contain;
    margin: auto;
    display: block;
}
.lightbox-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 44px; height: 44px;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    z-index: 10;
}
.lightbox-close:hover { background: var(--surface3); }

/* ── Footer ────────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 48px 20px 40px;
    margin-top: 60px;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.footer-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer-brand p { font-size: 0.84rem; color: var(--text-dim); font-weight: 500; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.footer-links a { font-size: 0.76rem; color: var(--text-dim); transition: var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 0.68rem; color: var(--text-muted); }

/* ── Divider ───────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), rgba(212,168,67,0.15), var(--border), transparent);
    margin: 0 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Language CSS Utilities ─────────────────────────────────── */
.lang-en { display: inline; }
.lang-ar { display: none; }
[lang="ar"] .lang-en { display: none; }
[lang="ar"] .lang-ar { display: inline; }
.lang-en-block { display: block; }
.lang-ar-block { display: none; }
[lang="ar"] .lang-en-block { display: none; }
[lang="ar"] .lang-ar-block { display: block; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes expandWidth {
    to { transform: scaleX(1); }
}

/* ── Reveal ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal:nth-child(2) { transition-delay: 80ms; }
.reveal:nth-child(3) { transition-delay: 160ms; }
.reveal:nth-child(4) { transition-delay: 240ms; }
.reveal:nth-child(5) { transition-delay: 320ms; }
.reveal:nth-child(6) { transition-delay: 400ms; }
.reveal:nth-child(7) { transition-delay: 480ms; }
.reveal:nth-child(8) { transition-delay: 560ms; }
.reveal:nth-child(9) { transition-delay: 640ms; }

/* ── RTL ───────────────────────────────────────────────────── */
[dir="rtl"] { letter-spacing: 0 !important; }
[dir="rtl"] .card-overlay { flex-direction: row-reverse; }
[dir="rtl"] .card-bottom { flex-direction: row-reverse; }
[dir="rtl"] .card-meta { flex-direction: row-reverse; }
[dir="rtl"] .project-card::after { transform-origin: right; }
[dir="rtl"] .research-card {
    border-left: 1px solid var(--glass-border);
    border-right: 3px solid var(--accent);
}
[dir="rtl"] .research-card:hover {
    border-left-color: var(--border-hover);
    border-right-color: var(--accent-light);
}
[dir="rtl"] .section-desc { margin-right: 0; margin-left: auto; }
[dir="rtl"] .back-btn { flex-direction: row-reverse; }
[dir="rtl"] .contact-note-box { flex-direction: row-reverse; }
[dir="rtl"] .project-long-desc ul,
[dir="rtl"] .project-long-desc ol { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .filter-bar { direction: rtl; }
[dir="rtl"] .project-actions { direction: rtl; }
[dir="rtl"] .action-btn { flex-direction: row-reverse; }
[dir="rtl"] .hero-ctas { direction: rtl; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav { padding: 8px 10px; }
    .nav-inner { padding: 4px 5px 4px 14px; }
    .hero { padding: 100px 20px 30px; }
    .section { padding: 60px 20px; }
    .project-hero-band { height: 200px; }
    .project-hero-emoji { font-size: 4.5rem; }
    .contact-section { padding: 36px 22px; }
    .hero-ctas { flex-direction: column; }
    .hero-btn-primary, .hero-btn-secondary {
        text-align: center;
        justify-content: center;
    }
}
@media (max-width: 480px) {
    .nav-link:not(.nav-link--cta) { display: none; }
    .hero-name { font-size: clamp(2.8rem, 16vw, 4.5rem); }
    .hero-stats { max-width: 100%; }
    .stat-num { font-size: 1.6rem; }
    .stat-label { font-size: 0.55rem; }
    .project-card { height: 400px; flex: 0 0 82vw; max-width: 82vw; }
}
