/* ============================================================
   Editorial Neo-Brutalist + Vibrant/Fluid Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@400;600;800;900&family=Tajawal:wght@300;400;500;700&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-x: hidden;
}
html::-webkit-scrollbar { display: none; }

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #F2F0EB;
    color: #111111;
    overflow-x: hidden;
    max-width: 100vw;
    cursor: none; /* hidden — custom cursor takes over */
    position: relative;
}

/* ── Noise Texture Overlay ────────────────────────────────── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ── Scroll Progress Bar ──────────────────────────────────── */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #E64833 0%, #F2B807 50%, #244A2E 100%);
    z-index: 99999;
    transform-origin: left;
    transition: width 0.1s linear;
    box-shadow: 0 0 12px rgba(230, 72, 51, 0.7);
}

/* ── Custom Cursor ────────────────────────────────────────── */
#cursor-dot, #cursor-ring {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform;
}

#cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #E64833;
    transition: background-color 0.3s ease, width 0.2s ease, height 0.2s ease;
}

#cursor-ring {
    width: 36px;
    height: 36px;
    border: 2px solid #E64833;
    opacity: 0.6;
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}

#cursor-dot.active {
    width: 12px;
    height: 12px;
    background-color: #F2B807;
}

#cursor-ring.active {
    width: 64px;
    height: 64px;
    border-color: #F2B807;
    opacity: 0.4;
}

/* ── Glow Blobs ───────────────────────────────────────────── */
.glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    /* Prevent blobs from causing horizontal overflow */
    max-width: 60vw;
    max-height: 60vw;
    overflow: hidden;
}

.blob-coral {
    width: clamp(200px, 40vw, 400px);
    height: clamp(200px, 40vw, 400px);
    background: radial-gradient(circle, rgba(230,72,51,0.25) 0%, transparent 70%);
    animation: blob-drift-1 12s ease-in-out infinite alternate;
}

.blob-ochre {
    width: clamp(180px, 35vw, 350px);
    height: clamp(180px, 35vw, 350px);
    background: radial-gradient(circle, rgba(242,184,7,0.2) 0%, transparent 70%);
    animation: blob-drift-2 15s ease-in-out infinite alternate;
}

.blob-forest {
    width: clamp(150px, 30vw, 300px);
    height: clamp(150px, 30vw, 300px);
    background: radial-gradient(circle, rgba(36,74,46,0.3) 0%, transparent 70%);
    animation: blob-drift-3 10s ease-in-out infinite alternate;
}

@keyframes blob-drift-1 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -60px) scale(1.1); }
}
@keyframes blob-drift-2 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, 40px) scale(0.9); }
}
@keyframes blob-drift-3 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.15); }
}

/* ── Neo-Brutalist Button ─────────────────────────────────── */
.btn-editorial {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-family: 'Alexandria', sans-serif;
    font-weight: 800;
    font-size: 1.125rem;
    color: #111111;
    background-color: #F2F0EB;
    border: 3px solid #111111;
    box-shadow: 6px 6px 0px #111111;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-transform: uppercase;
    text-decoration: none;
    cursor: none;
}

.btn-editorial:hover {
    transform: translate(-4px, -4px);
    box-shadow: 10px 10px 0px #111111;
}

.btn-editorial:active {
    transform: translate(6px, 6px);
    box-shadow: 0px 0px 0px #111111;
}

.btn-editorial-red { background-color: #E64833; color: #F2F0EB; }
.btn-editorial-yellow { background-color: #F2B807; color: #111111; }

/* ── WhatsApp Pulse Button ────────────────────────────────── */
.whatsapp-pulse {
    animation: wa-pulse 2.5s ease-in-out infinite;
}

@keyframes wa-pulse {
    0%, 100% { box-shadow: 6px 6px 0px #111111; }
    50%       { box-shadow: 6px 6px 0px #111111, 0 0 0 8px rgba(230,72,51,0.25), 0 0 0 16px rgba(230,72,51,0.10); }
}

/* ── Glassmorphism Project Cards ──────────────────────────── */
.glass-card {
    background: rgba(242, 240, 235, 0.55);
    backdrop-filter: blur(16px) saturate(1.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    border: 1.5px solid rgba(17, 17, 17, 0.18);
    box-shadow:
        0 8px 32px rgba(17, 17, 17, 0.12),
        inset 0 1px 0 rgba(255,255,255,0.6);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease,
                background 0.35s ease;
    cursor: none;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

.glass-card > * { position: relative; z-index: 2; }

.glass-card:hover {
    background: rgba(242, 240, 235, 0.75);
    box-shadow:
        0 20px 60px rgba(17, 17, 17, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.8);
    transform: translateY(-6px) scale(1.01);
}

/* ── Project Image Tilt Wrapper ───────────────────────────── */
.tilt-wrap {
    transform-style: preserve-3d;
    perspective: 800px;
    transition: transform 0.05s linear;
}

/* ── Editorial Images ─────────────────────────────────────── */
.editorial-img {
    filter: grayscale(100%) contrast(1.2);
    transition: filter 0.5s ease;
    border: 3px solid #111111;
    box-shadow: 8px 8px 0px #E64833;
}

.editorial-img:hover { filter: grayscale(0%) contrast(1.1); }

/* ── Structural helpers ───────────────────────────────────── */
.editorial-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.border-grid   { border: 2px solid #111111; }
.border-b-grid { border-bottom: 2px solid #111111; }
.border-x-grid { border-left: 2px solid #111111; border-right: 2px solid #111111; }

/* ── Marquee ──────────────────────────────────────────────── */
.marquee {
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    display: flex;
}

.marquee span {
    display: inline-block;
    padding-left: 2rem;
    animation: marquee 20s linear infinite;
}

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

/* ── Form inputs ──────────────────────────────────────────── */
.editorial-input {
    background: transparent;
    border: 3px solid #111111;
    padding: 1.25rem;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.25rem;
    color: #111111;
    box-shadow: 4px 4px 0px rgba(17,17,17,0.2);
    transition: all 0.2s ease;
    width: 100%;
}

.editorial-input:focus {
    outline: none;
    box-shadow: 6px 6px 0px #E64833;
    transform: translate(-2px, -2px);
}

.editorial-input::placeholder { color: rgba(17,17,17,0.4); }

/* ── Hero Text Split Animation ────────────────────────────── */
.hero-line {
    display: block;
    overflow: hidden;
    padding: 0.2em 0;
    margin: -0.2em 0;
    font-size: 45pt;
}

.hero-line-inner {
    display: block;
    transform: translateY(120%);
    opacity: 0;
    will-change: transform, opacity;
}

/* ── Section Reveal Classes ───────────────────────────────── */
.gs-reveal {
    opacity: 0;
    transform: translateY(40px);
    will-change: transform, opacity;
}

/* ── Laptop mockup ────────────────────────────────────────── */
.mockup-laptop {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    /* Prevent overflow on tiny screens */
    overflow: visible;
}

.mockup-laptop .screen-outer {
    background: #1a1a1a;
    border-radius: 12px 12px 0 0;
    border: 3px solid #111;
    padding: 6px 6px 0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.mockup-laptop .screen-inner {
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.mockup-laptop .screen-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.glass-card:hover .mockup-laptop .screen-inner img { transform: scale(1.06); }

.mockup-laptop .base {
    background: linear-gradient(to bottom, #2a2a2a, #1a1a1a);
    height: 14px;
    border-radius: 0 0 4px 4px;
    border: 3px solid #111;
    border-top: none;
    position: relative;
}

.mockup-laptop .base::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 4px;
    background: #333;
    border-radius: 0 0 4px 4px;
}

.mockup-laptop .stand {
    width: 60%;
    height: 8px;
    background: #1a1a1a;
    border: 3px solid #111;
    border-top: none;
    margin: 0 auto;
    border-radius: 0 0 6px 6px;
}

/* ── Utility ──────────────────────────────────────────────── */
.outline-text {
    -webkit-text-stroke: 2px currentColor;
    color: transparent;
}

/* ── Mobile Overrides ────────────────────────────────────────
   All fixes for screens < 768px
   ─────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* 1. No custom cursor on touch devices */
    body { cursor: auto; }
    #cursor-dot, #cursor-ring { display: none !important; }

    /* 2. Outer wrapper — reduce margin & shadow */
    .m-4.md\:m-8 {
        margin: 0.5rem !important;
        box-shadow: 4px 4px 0px #111111 !important;
    }

    /* 3. Hero heading — scale down dramatically */
    #hero-title {
        font-size: clamp(2.8rem, 12vw, 5rem) !important;
        line-height: 1 !important;
        margin-bottom: 1.5rem !important;
    }

    /* 4. Hero / About / Contact section padding */
    .p-8, .p-10 {
        padding: 1.25rem !important;
    }

    /* 5. About section large quote text — scale down */
    .lg\:w-2\/3 p.text-2xl,
    .lg\:w-2\/3 p.lg\:text-4xl {
        font-size: 1.4rem !important;
        line-height: 1.5 !important;
    }

    /* 6. Contact "لنبني شيئاً عظيماً" heading */
    #contact h2 {
        font-size: clamp(2.5rem, 10vw, 4rem) !important;
        line-height: 1 !important;
    }

    /* 7. Email address — prevent overflow */
    #contact a[href^='mailto'] {
        word-break: break-all !important;
        font-size: 0.9rem !important;
        gap: 0.5rem !important;
    }

    /* 8. Laptop mockup — ensure it doesn't overflow card */
    .mockup-laptop {
        max-width: 100% !important;
    }

    .mockup-laptop .screen-outer {
        border-radius: 8px 8px 0 0;
        padding: 4px 4px 0;
    }

    /* 9. Glass cards — reduce padding */
    .glass-card {
        padding: 1rem !important;
    }

    /* 10. Brutalist buttons — reduce shadow on mobile */
    .btn-editorial {
        box-shadow: 3px 3px 0px #111111 !important;
        font-size: 0.95rem !important;
        padding: 0.75rem 1.25rem !important;
    }

    .btn-editorial:hover {
        transform: translate(-2px, -2px) !important;
        box-shadow: 5px 5px 0px #111111 !important;
    }

    /* 11. Projects section heading */
    #projects h2 {
        font-size: clamp(2rem, 9vw, 3.5rem) !important;
    }

    /* 12. Project tag badges — wrap nicely */
    .glass-card .flex.gap-2 {
        flex-wrap: wrap;
    }

    /* 13. Project card headings */
    .glass-card h3 {
        font-size: 1.6rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* 14. Project card descriptions */
    .glass-card p {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* 15. Form: floating label position adjustment */
    .editorial-input {
        padding: 1rem !important;
        font-size: 1rem !important;
    }

    /* 16. Submit button */
    .submit-btn {
        font-size: 1.1rem !important;
        padding: 1rem 1.25rem !important;
    }

    /* 17. Decorative TALK letters — hide on mobile (causes overflow) */
    #contact .absolute.-left-32 {
        display: none !important;
    }

    /* 18. Hero graphic side decorative blobs — contain */
    header .glow-blob {
        display: none;
    }

    /* 19. About section left panel */
    #about .lg\:w-1\/3 h2 {
        font-size: 2.5rem !important;
    }

    /* 20. Marquee text size */
    .marquee {
        font-size: 1.1rem !important;
    }

    /* 21. Footer — center everything */
    footer {
        text-align: center;
        font-size: 0.8rem;
    }

    /* 22. Nav padding on mobile */
    nav {
        padding: 1rem 0.75rem !important;
    }

    /* 23. WhatsApp pulse — simpler on mobile */
    .whatsapp-pulse {
        animation: wa-pulse 2.5s ease-in-out infinite;
    }
}
