/* ==========================================================================
   CSS VARIABLES & THEME
   ========================================================================== */
   :root {
    /* Light Theme (Default in code, overridden by JS/html attr) */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #111111;
    --text-secondary: #555555;
    --border-color: rgba(0, 0, 0, 0.14);
    --hover-bg: rgba(0, 0, 0, 0.04);
    --inverted-bg: #111111;
    --inverted-text: #ffffff;
    --overlay: rgba(255, 255, 255, 0.8);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --bg-primary: #090909;
    --bg-secondary: #111111;
    --text-primary: #ffffff;
    --text-secondary: #b7b7b7;
    --border-color: rgba(255, 255, 255, 0.14);
    --hover-bg: rgba(255, 255, 255, 0.04);
    --inverted-bg: #ffffff;
    --inverted-text: #111111;
    --overlay: rgba(0, 0, 0, 0.8);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   RESET & TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Typography based on direction */
html[lang="ar"] body {
    font-family: 'Cairo', sans-serif;
}
html[lang="en"] body {
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
a:hover {
    opacity: 0.7;
}
ul { list-style: none; }
img, video { max-width: 100%; height: auto; display: block; }

/* Utilities */
.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 5%;
}
.section {
    padding: clamp(4rem, 8vw, 8rem) 0;
}
.bg-secondary {
    background-color: var(--bg-secondary);
}
.text-center { text-align: center; }
.overflow-hidden { overflow: hidden; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}
.btn-primary {
    background-color: var(--inverted-bg);
    color: var(--inverted-text);
}
.btn-primary:hover {
    background-color: var(--text-primary);
    transform: scale(1.02);
}
.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--text-primary);
}
.btn-outline:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}
.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--border-color);
    color: var(--text-secondary);
}

/* ==========================================================================
   HEADER & NAV
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 900;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}
.logo-link {
    display: flex;
    align-items: center;
    height: 40px;
}
.logo-img {
    height: 100%;
    width: auto;
}
.logo-text-fallback {
    font-size: 1.25rem;
    font-weight: 800;
}

.desktop-nav .nav-list {
    display: flex;
    gap: 2rem;
}
.desktop-nav a {
    font-size: 0.9rem;
    font-weight: 600;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.header-controls button {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}
.lang-toggle {
    font-weight: 700;
    font-size: 0.9rem;
}
.theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: block; }

.mobile-menu-btn {
    display: none;
}
.hamburger, .hamburger::before, .hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s;
    position: relative;
}
.hamburger::before, .hamburger::after { content: ''; position: absolute; }
.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

.mobile-menu-btn[aria-expanded="true"] .hamburger { background-color: transparent; }
.mobile-menu-btn[aria-expanded="true"] .hamburger::before { top: 0; transform: rotate(45deg); }
.mobile-menu-btn[aria-expanded="true"] .hamburger::after { bottom: 0; transform: rotate(-45deg); }

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: var(--bg-primary);
    z-index: 850;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    overflow-y: auto;
    padding: 2rem 5%;
}
.mobile-drawer.open {
    transform: translateY(0);
    opacity: 1;
}
.mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.mobile-nav-list a {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

@media (max-width: 1024px) {
    .desktop-nav { display: none; }
    .mobile-menu-btn { display: flex; }
}

/* ==========================================================================
   1. HERO SECTION
   ========================================================================== */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
}
.hero-video-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}
.hero-bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.70) 0%,
        rgba(0, 0, 0, 0.70) 65%,
        rgba(0, 0, 0, 0.78) 78%,
        rgba(0, 0, 0, 0.90) 90%,
        #090909 100%
    );
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}
.hero-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}
.hero-section .hero-badge {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.22);
}
.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    margin-bottom: 1rem;
}
.hero-section .hero-title {
    color: #ffffff;
}
.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
}
.hero-section .hero-subtitle {
    color: rgba(255, 255, 255, 0.68);
}
.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}
.hero-section .btn-primary {
    background-color: #ffffff;
    color: #111111;
    border-color: #ffffff;
}
.hero-section .btn-primary:hover {
    background-color: #e8e8e8;
    color: #111111;
}
.hero-section .btn-outline {
    background-color: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.8);
}
.hero-section .btn-outline:hover {
    background-color: #ffffff;
    color: #111111;
    border-color: #ffffff;
}
.experience-indicator {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.experience-indicator::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-primary);
}
.hero-section .experience-indicator {
    color: rgba(255, 255, 255, 0.65);
}
.hero-section .experience-indicator::before {
    background-color: #ffffff;
}

/* ==========================================================================
   2. ABOUT SECTION
   ========================================================================== */
.about-section {
    position: relative;
    min-height: clamp(650px, 76svh, 850px);
    margin-top: -1px;
    padding: 0;
    overflow: hidden;
    background: #090909;
    color: #ffffff;
    isolation: isolate;
}

.about-section::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 30%;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(9, 9, 9, 0) 0%,
        rgba(9, 9, 9, 0.18) 22%,
        rgba(9, 9, 9, 0.58) 52%,
        rgba(9, 9, 9, 0.88) 78%,
        #090909 100%
    );
}

.about-container {
    position: static;
    display: flex;
    align-items: center;
    min-height: inherit;
    padding-top: clamp(6rem, 9vw, 9rem);
    padding-bottom: clamp(7rem, 10vw, 10rem);
}

.about-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    pointer-events: none;
}

.about-image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        #090909 0%,
        rgba(9, 9, 9, 0.88) 3%,
        rgba(9, 9, 9, 0.50) 8%,
        rgba(0, 0, 0, 0.28) 15%,
        rgba(0, 0, 0, 0.28) 100%
    );
}

.about-image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

html[dir="rtl"] .about-image::after {
    background: linear-gradient(
        to left,
        rgba(0, 0, 0, 0.94) 0%,
        rgba(0, 0, 0, 0.82) 22%,
        rgba(0, 0, 0, 0.56) 42%,
        rgba(0, 0, 0, 0.22) 62%,
        rgba(0, 0, 0, 0.04) 82%,
        transparent 100%
    );
}

html[dir="ltr"] .about-image::after {
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.94) 0%,
        rgba(0, 0, 0, 0.82) 22%,
        rgba(0, 0, 0, 0.56) 42%,
        rgba(0, 0, 0, 0.22) 62%,
        rgba(0, 0, 0, 0.04) 82%,
        transparent 100%
    );
}

.about-section .image-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    background: #090909;
}

.about-section .image-placeholder img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 42% 45%;
    filter: none;
    transform: scale(1.001);
    transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

html[dir="ltr"] .about-section .image-placeholder img {
    object-position: 58% 45%;
}

.about-text {
    position: relative;
    z-index: 4;
    width: min(45%, 620px);
}

html[dir="rtl"] .about-text {
    margin-left: auto;
    margin-right: 0;
    text-align: right;
}

html[dir="ltr"] .about-text {
    margin-right: auto;
    margin-left: 0;
    text-align: left;
}

@media (min-width: 769px) {
    .about-text {
        width: min(38%, 540px);
        transform: translateY(0);
    }
    html[dir="rtl"] .about-text {
        margin-left: auto;
        margin-right: 0;
    }
    html[dir="ltr"] .about-text {
        margin-right: auto;
        margin-left: 0;
    }
}

.about-section .section-title {
    color: #ffffff;
    font-size: clamp(2.6rem, 4vw, 4.2rem);
    line-height: 1.15;
    margin-bottom: 1.6rem;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.32);
}

.about-section .about-desc {
    color: rgba(255, 255, 255, 0.74);
    font-size: clamp(1rem, 1.18vw, 1.16rem);
    line-height: 1.9;
    max-width: 590px;
    margin-bottom: 2.3rem;
}

.about-section .principles-list {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.about-section .principles-list li {
    color: rgba(255, 255, 255, 0.95);
    font-size: clamp(1rem, 1.1vw, 1.12rem);
    font-weight: 600;
    line-height: 1.6;
}

.about-section .principles-list li::before {
    background-color: rgba(255, 255, 255, 0.58);
}

/* ==========================================================================
   3. CORE APPROACH
   ========================================================================== */
.approach-section {
    position: relative;
    z-index: 5;
    background: #090909;
    color: #ffffff;
    padding-top: 0;
    padding-bottom: clamp(5rem, 8vw, 8rem);
}

.approach-grid {
    position: relative;
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    gap: clamp(1.25rem, 2vw, 2rem);
    justify-content: center;
    margin-top: -70px;
}

.approach-card {
    flex: 1 1 300px;
    max-width: 420px;
    min-height: 260px;
    padding: clamp(2rem, 3vw, 3rem);
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.13);
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
    transition:
        transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 320ms ease,
        box-shadow 320ms ease;
}

.approach-section .approach-num {
    color: rgba(255, 255, 255, 0.68);
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 1.25rem;
}

.approach-section .approach-card h3 {
    color: #ffffff;
    font-size: clamp(1.15rem, 1.4vw, 1.35rem);
    line-height: 1.45;
    margin-bottom: 1rem;
}

.approach-section .approach-card p {
    color: rgba(255, 255, 255, 0.64);
    line-height: 1.8;
}

@media (hover: hover) and (pointer: fine) {
    .approach-card:hover {
        transform: translateY(-6px);
        border-color: rgba(255, 255, 255, 0.24);
        box-shadow: 0 24px 55px rgba(0, 0, 0, 0.32);
    }
    .about-section:hover .image-placeholder img {
        transform: scale(1.018);
    }
}

@media (max-width: 1100px) {
    .about-text {
        width: min(50%, 560px);
    }
    .about-section {
        min-height: 700px;
    }
    .approach-grid {
        margin-top: -55px;
    }
}

@media (max-width: 768px) {
    .about-section {
        min-height: max(760px, 88svh);
    }
    .about-container {
        display: flex;
        align-items: flex-end;
        min-height: inherit;
        padding-top: 7rem;
        padding-bottom: 6.5rem;
    }
    .about-text {
        width: 100%;
        max-width: 100%;
    }
    html[dir="rtl"] .about-text,
    html[dir="ltr"] .about-text {
        margin-left: 0;
        margin-right: 0;
    }
    .about-section .image-placeholder img {
        object-position: 50% 45%;
    }
    html[dir="rtl"] .about-image::after,
    html[dir="ltr"] .about-image::after {
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.96) 0%,
            rgba(0, 0, 0, 0.82) 30%,
            rgba(0, 0, 0, 0.50) 52%,
            rgba(0, 0, 0, 0.18) 75%,
            rgba(0, 0, 0, 0.04) 100%
        );
    }
    .about-section::after {
        height: 20%;
    }
    .approach-section {
        padding-top: 2rem;
    }
    .approach-grid {
        margin-top: 0;
        flex-direction: column;
        gap: 1.25rem;
    }
    .approach-card {
        width: 100%;
        max-width: none;
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .about-section {
        min-height: 800px;
    }
    .about-container {
        padding-top: 6rem;
        padding-bottom: 5rem;
    }
    .about-section .section-title {
        font-size: clamp(2.2rem, 10vw, 3rem);
    }
    .about-section .about-desc {
        line-height: 1.8;
    }
    .approach-card {
        padding: 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .about-section .image-placeholder img,
    .approach-card {
        transition: none;
        transform: none !important;
    }
}

/* ==========================================================================
   4. SERVICES
   ========================================================================== */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 3rem;
    justify-content: center;
}
.service-card {
    flex: 0 1 calc(33.333% - 1rem);
    min-width: 280px;
    max-width: 400px;
    padding: 2rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease;
}
.service-card:hover { transform: scale(1.02); }
.service-icon {
    width: 48px; height: 48px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}
.service-icon svg {
    width: 100%;
    height: 100%;
}
.service-card h3 { font-size: 1.1rem; }

@media (max-width: 600px) {
    .service-card[data-service="analysis"] {
        order: 1;
    }

    .service-card[data-service="strategy"] {
        order: 2;
    }

    .service-card[data-service="writing"] {
        order: 3;
    }

    .service-card[data-service="production"] {
        order: 4;
    }

    .service-card[data-service="editing"] {
        order: 5;
    }

    .service-card[data-service="social"] {
        order: 6;
    }

    .service-card[data-service="promotion"] {
        order: 7;
    }

    .service-card[data-service="reporting"] {
        order: 8;
    }

    .service-card[data-service="development"] {
        order: 9;
    }
}

/* ==========================================================================
   5. RESULTS & WORK
   ========================================================================== */
.results-header { margin-bottom: 5rem; }
.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
    justify-content: center;
}
.stat-card {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}
.stat-value { font-size: 2.5rem; font-weight: 800; }
.stat-label { color: var(--text-secondary); font-size: 0.9rem; }

.subsection-title {
    font-size: 2rem;
    margin-bottom: 2rem;
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1.25rem, 2vw, 2rem);
    align-items: start;
    width: 100%;
}

.project-card {
    display: block;
    width: 100%;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    border-radius: 16px;
    cursor: pointer;
}

.project-card--disabled {
    cursor: default;
}

.project-card:not(.project-card--disabled):focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 4px;
}

.project-media {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: inherit;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    isolation: isolate;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease;
}

.project-cover-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    z-index: 1;
}

.project-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 2;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 32%, rgba(0, 0, 0, 0.08) 65%, transparent 100%);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.project-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(48px, 6vw, 60px);
    height: clamp(48px, 6vw, 60px);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease;
    pointer-events: none;
}

.project-play-icon svg {
    width: 24px;
    height: 24px;
    fill: #fff;
    margin-left: 2px;
}
html[lang="ar"] .project-play-icon svg {
    margin-left: 0;
    margin-right: 2px;
}

.project-card-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 1.25rem;
    padding-bottom: clamp(1rem, 2vw, 1.25rem);
    z-index: 5;
    pointer-events: none;
    overflow: visible;
}

.project-client-name {
    color: #fff;
    font-size: clamp(17px, 2vw, 19px);
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    padding-bottom: 0.18em;
    line-height: 1.55;
    display: block;
    height: auto;
    max-height: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: break-word;
}

.project-instagram-label {
    display: block;
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(11px, 1.5vw, 12px);
    transition: color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .project-card:not(.project-card--disabled):hover .project-media {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .project-card:not(.project-card--disabled):hover .project-cover {
        transform: scale(1.03);
    }
    
    .project-card:not(.project-card--disabled):hover .project-card-overlay {
        background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.65) 32%, rgba(0, 0, 0, 0.15) 65%, transparent 100%);
    }

    .project-card:not(.project-card--disabled):hover .project-play-icon {
        transform: translate(-50%, -50%) scale(1.08);
        background: rgba(0, 0, 0, 0.6);
    }

    .project-card:not(.project-card--disabled):hover .project-instagram-label {
        color: rgba(255, 255, 255, 0.95);
    }
}

.project-card:not(.project-card--disabled):active .project-media {
    transform: scale(0.99);
}

@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .project-card {
        width: 100%;
        max-width: 320px;
        margin-inline: auto;
    }
}

/* ==========================================================================
   6. PROCESS TIMELINE
   ========================================================================== */
.timeline {
    margin-top: 4rem;
    position: relative;
    max-width: 800px;
    margin-inline: auto;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 20px; /* LTR */
    width: 2px;
    background-color: var(--border-color);
}
html[lang="ar"] .timeline::before {
    left: auto;
    right: 20px;
}
.timeline-item {
    position: relative;
    padding-inline-start: 50px;
    margin-bottom: 3rem;
}
.timeline-dot {
    position: absolute;
    top: 0;
    left: 11px; /* LTR */
    width: 20px; height: 20px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 4px solid var(--text-primary);
}
html[lang="ar"] .timeline-dot {
    left: auto; right: 11px;
}
.timeline-content h3 { margin-bottom: 0.5rem; }
.timeline-content p { color: var(--text-secondary); }

/* ==========================================================================
   7. CLIENTS MARQUEE
   ========================================================================== */
.clients-marquee {
    width: 100dvw;
    max-width: 100dvw;
    margin-inline: calc(50% - 50dvw);
    padding-inline: 0;
    overflow: hidden;
    position: relative;
    background: transparent;
    direction: ltr;
    scrollbar-gutter: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: clamp(260px, 22vw, 340px);
    padding-block: clamp(2.5rem, 5vw, 4.5rem);
    box-sizing: border-box;
}

.clients-marquee::-webkit-scrollbar,
.clients-marquee-viewport::-webkit-scrollbar,
.clients-marquee-wrapper::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.clients-marquee::before,
.clients-marquee::after,
.clients-marquee-track::before,
.clients-marquee-track::after {
    content: none !important;
    display: none !important;
}

.clients-marquee-track {
    display: flex;
    align-items: center;
    width: max-content;
    min-width: max-content;
    gap: 0;
    will-change: transform;
    animation: clients-marquee-scroll-ltr 30s linear infinite;
    overflow: visible;
}
html[lang="ar"] .clients-marquee-track {
    animation: clients-marquee-scroll-rtl 30s linear infinite;
}

.clients-marquee-track:hover,
.clients-marquee-group:hover {
    animation-play-state: running !important;
}

.clients-marquee-group {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    width: max-content;
    --client-logo-gap: clamp(2.5rem, 4vw, 4.5rem);
    gap: var(--client-logo-gap);
    padding-inline-end: var(--client-logo-gap);
    padding-block: 0;
    padding-inline-start: 0;
    margin: 0;
    overflow: visible;
}

.client-logo-wrapper {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    padding-block: clamp(1rem, 2vw, 1.75rem);
    padding-inline: clamp(0.75rem, 1.5vw, 1.5rem);
    box-sizing: content-box;
    margin: 0;
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
}

.client-logo-wrapper[data-client-id="nuwa"] {
    padding-inline: clamp(1.25rem, 2vw, 2rem);
}

.client-logo-img {
    display: block;
    height: clamp(95px, 9vw, 150px);
    width: auto;
    max-width: min(38vw, 380px);
    max-height: none;
    object-fit: contain;
    object-position: center;
    margin: 0;
    background: transparent;
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1 !important;
    mix-blend-mode: normal;
    transform-origin: center;
    --logo-responsive-factor: 1;
    transform: scale(calc(var(--client-logo-scale, 1) * var(--logo-responsive-factor, 1)));
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.client-logo-wrapper:hover .client-logo-img {
    opacity: 1 !important;
    transform: scale(calc(var(--client-logo-scale, 1) * var(--logo-responsive-factor, 1) * 1.04));
}

@media (max-width: 900px) {
    .clients-marquee {
        min-height: clamp(210px, 30vw, 280px);
        padding-block: clamp(2rem, 5vw, 3rem);
    }
    .client-logo-img {
        height: clamp(80px, 12vw, 120px);
        max-width: 44vw;
    }
}
@media (max-width: 768px) {
    .client-logo-img {
        --logo-responsive-factor: 0.88;
    }
}
@media (max-width: 600px) {
    .clients-section {
        padding-bottom: 2rem;
    }
    .clients-marquee {
        min-height: 0;
        padding-block: 1.25rem;
    }
    .team-section {
        padding-top: 2.5rem;
    }
    .client-logo-img {
        height: clamp(88px, 24vw, 115px);
        max-width: 68vw;
        --logo-responsive-factor: 0.95;
    }
    .clients-marquee-group {
        gap: clamp(2rem, 8vw, 3rem);
    }
}
@media (max-width: 480px) {
    .client-logo-img {
        height: clamp(82px, 25vw, 105px);
        --logo-responsive-factor: 0.92;
    }
}

.client-text-fallback {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
    opacity: 0.5;
    white-space: nowrap;
}

@keyframes clients-marquee-scroll-ltr {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(calc(-1 * var(--clients-marquee-distance)), 0, 0); }
}

@keyframes clients-marquee-scroll-rtl {
    from { transform: translate3d(calc(-1 * var(--clients-marquee-distance)), 0, 0); }
    to { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .clients-marquee-track { 
        animation: none; 
        flex-wrap: wrap; 
        justify-content: center; 
        width: 100%; 
        transform: none !important; 
    }
    .clients-marquee-group { 
        flex-wrap: wrap; 
        justify-content: center;
        padding: 0;
    }
    html[lang="ar"] .clients-marquee-group {
        padding: 0;
    }
    .clients-marquee-group[aria-hidden="true"] {
        display: none;
    }
}

/* ==========================================================================
   8. TEAM
   ========================================================================== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: clamp(1.5rem, 3vw, 3rem);
    row-gap: clamp(6rem, 7vw, 7.5rem);
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    align-items: start;
    padding-top: clamp(5.5rem, 8vw, 7.5rem);
}
.team-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    grid-column: span 2;
    width: 100%;
    max-width: 340px;
    justify-self: center;
    text-align: center;
}
/* First row cards (Member 1 and 2) */
.team-card:nth-child(1) {
    grid-row: 1;
    grid-column: 2 / span 2;
}
.team-card:nth-child(2) {
    grid-row: 1;
    grid-column: 4 / span 2;
}
/* Last row cards (Member 15 and 16) */
.team-card:nth-last-child(2) {
    grid-column: 2 / span 2;
}
.team-card:nth-last-child(1) {
    grid-column: 4 / span 2;
}

@media (max-width: 900px) {
    .team-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: clamp(1rem, 3vw, 2rem);
        row-gap: 5.5rem;
    }
    .team-card,
    .team-card:nth-child(1),
    .team-card:nth-child(2),
    .team-card:nth-last-child(2),
    .team-card:nth-last-child(1) {
        grid-column: span 2;
        grid-row: auto;
    }
}
@media (max-width: 600px) {
    .team-grid {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 1.75rem;
    }
    .team-card,
    .team-card:nth-child(1),
    .team-card:nth-child(2),
    .team-card:nth-last-child(2),
    .team-card:nth-last-child(1) {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        max-width: 340px;
        justify-self: center;
    }
}
.team-portrait-stage {
    position: relative;
    width: 100%;
    height: clamp(280px, 28vw, 380px);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    overflow: visible;
    background: transparent;
    margin-bottom: 0.75rem;
}
.team-image {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: auto;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center bottom !important;
    --responsive-portrait-factor: 1;
    transform: 
      translateX(-50%) 
      translate(var(--portrait-x, 0px), var(--portrait-y, 0px)) 
      scale(calc(var(--portrait-scale, 1) * var(--responsive-portrait-factor)));
    transform-origin: center bottom;
    display: block;
    background: transparent;
}

@media (max-width: 600px) {
    .team-image {
        --responsive-portrait-factor: 0.9;
    }
}
.fallback-icon {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
}
.fallback-icon svg {
    width: 50%;
    height: 50%;
    max-width: 150px;
    opacity: 0.3;
}
.team-info {
    position: relative;
    z-index: 3;
    width: 100%;
    text-align: center;
    background: var(--bg-secondary);
    padding-top: 0.5rem;
}
.team-card[data-member-id="member-06"] .team-info {
    transform: translateX(12px);
}
.team-info h4 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.team-role {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0;
    color: var(--text-primary);
}

/* ==========================================================================
   9. CONTACT
   ========================================================================== */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}
.contact-links {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}
.contact-link .icon { font-size: 1.5rem; filter: grayscale(100%); }

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.honeypot { display: none !important; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label { font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group textarea {
    padding: 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    border-radius: 4px;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--text-primary);
}
.form-messages { font-size: 0.9rem; font-weight: 600; }
.form-messages.error { color: var(--text-secondary); }
.form-messages.success { color: var(--text-primary); }

@media (max-width: 768px) {
    .contact-container { grid-template-columns: 1fr; }
}

/* ==========================================================================
   11. FOOTER
   ========================================================================== */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.footer-brand { font-weight: 800; font-size: 1.25rem; }
.footer-info, .footer-copyright { color: var(--text-secondary); font-size: 0.9rem; }
.back-to-top {
    margin-top: 2rem;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 44px; height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

/* ANIMATIONS (Subtle) */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease var(--project-reveal-delay, 0ms), transform 0.6s ease var(--project-reveal-delay, 0ms); }
.fade-in.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .fade-in { opacity: 1; transform: none; transition: none; }
    .project-media, .project-cover, .project-play-icon { transition: none !important; transform: none !important; }
}

/* ==========================================================================
   MOBILE OVERFLOW & RESPONSIVENESS FIXES
   ========================================================================== */
html,
body {
    width: 100%;
    max-width: 100%;
}
body {
    overflow-x: clip;
}

/* Header */
@media (max-width: 600px) {
    .header-container {
        padding-inline: 1rem;
    }
    .header-controls {
        gap: 0.35rem;
        flex-shrink: 0;
    }
    .logo-link {
        min-width: 0;
        flex-shrink: 1;
    }
    .logo-img {
        max-width: 100%;
    }
}

/* Mobile Drawer */
.mobile-drawer {
    inset-inline: 0;
    left: auto;
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - 80px);
    overflow-x: hidden;
}

/* Hero */
@media (max-width: 768px) {
    .hero-section {
        width: 100%;
        max-width: 100%;
        min-height: 100svh;
    }
    .hero-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .hero-badge,
    .hero-title,
    .hero-subtitle,
    .hero-cta,
    .hero-experience,
    .experience-indicator {
        max-width: 100%;
        min-width: 0;
    }
    .hero-badge {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .hero-cta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 0.75rem;
    }
    .hero-cta .btn {
        width: 100%;
        min-width: 0;
        padding-inline: 0.75rem;
        text-align: center;
    }
}

@media (max-width: 350px) {
    .hero-cta {
        grid-template-columns: 1fr;
    }
}

/* About */
@media (max-width: 768px) {
    .about-text {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-inline: 0;
        transform: none;
    }
    .about-image,
    .about-section .image-placeholder {
        width: 100%;
        max-width: 100%;
    }
}

/* Approach Cards */
@media (max-width: 768px) {
    .approach-grid {
        margin-top: 0;
    }
    .approach-card {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
}

/* Services */
@media (max-width: 600px) {
    .service-card {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
}

/* Projects */
.projects-grid,
.project-card,
.project-media,
.project-card-meta {
    min-width: 0;
}

/* Process Timeline */
.timeline,
.timeline-item,
.timeline-content {
    min-width: 0;
    max-width: 100%;
}

/* Clients Marquee */
@media (max-width: 768px) {
    .clients-marquee {
        width: 100%;
        max-width: 100%;
        margin-inline: 0;
        overflow: hidden;
    }
}

/* Team */
@media (max-width: 600px) {
    .team-card {
        width: 100%;
        max-width: min(340px, 100%);
        min-width: 0;
    }
    .team-portrait-stage {
        --portrait-headroom: 45px;
        width: 100%;
        max-width: 100%;
        height: calc(clamp(300px, 86vw, 350px) + var(--portrait-headroom));
        overflow: clip;
    }
    .team-image {
        height: calc(100% - var(--portrait-headroom));
        width: auto;
        max-width: none;
        max-height: none;
        bottom: 0;
        --responsive-portrait-factor: 0.90;
    }
    .team-card[data-member-id="member-06"] .team-image {
        --portrait-x: -8px !important;
    }
    .team-card[data-member-id="member-08"] .team-image {
        --portrait-x: -5px !important;
    }
    .team-card[data-member-id="member-12"] .team-image {
        --portrait-x: 5px !important;
    }
    .team-card[data-member-id="member-13"] .team-image {
        --portrait-x: -5px !important;
    }
}
@media (max-width: 360px) {
    .team-portrait-stage {
        height: calc(300px + var(--portrait-headroom, 45px));
    }
}

/* Contact */
.contact-container {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.contact-container > *,
.contact-form,
.form-group {
    min-width: 0;
}
.form-group input,
.form-group textarea {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: minmax(0, 1fr);
    }
}
