/* ==========================================================================
   TAMOOH — FOUNDERS & PARTNERS PAGE (AWWWARDS DESIGN LANGUAGE)
   Founder showcase cards + RTL auto-scrolling partner marquee
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section Shell
   -------------------------------------------------------------------------- */
.founders-section {
    position: relative;
    z-index: var(--z-content);
    padding: clamp(4rem, 9vw, 7.5rem) clamp(1.25rem, 4vw, 3rem);
}

.founders-section--alt {
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(112, 0, 255, 0.09) 0%, transparent 70%),
        linear-gradient(180deg, transparent 0%, rgba(9, 10, 16, 0.85) 45%, transparent 100%);
}

/* --------------------------------------------------------------------------
   Section Header
   -------------------------------------------------------------------------- */
.founders-header {
    max-width: 780px;
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
    text-align: center;
}

.founders-header__title {
    font-family: var(--font-arabic-heading);
    font-size: var(--text-h2);
    font-weight: 900;
    line-height: 1.35;
    margin: 1.15rem 0 1rem;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.72) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.founders-header__desc {
    font-size: var(--text-body);
    color: var(--text-muted);
    line-height: 1.95;
    max-width: 640px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Founders Grid
   -------------------------------------------------------------------------- */
.founders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
    max-width: 1180px;
    margin: 0 auto;
}

.founder-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 26px;
    background: var(--bg-glass);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
    transition:
        transform 0.5s var(--ease-cinematic),
        border-color 0.5s var(--ease-smooth),
        box-shadow 0.5s var(--ease-smooth);
    isolation: isolate;
}

/* Animated gradient hairline border */
.founder-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: var(--gradient-card-border);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s var(--ease-smooth);
    pointer-events: none;
    z-index: 3;
}

.founder-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 32px 70px rgba(0, 0, 0, 0.62);
}

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

/* --- Photo --- */
.founder-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(0, 242, 254, 0.12) 0%, rgba(112, 0, 255, 0.14) 100%);
}

.founder-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    filter: saturate(1.04) contrast(1.02);
    transition: transform 0.9s var(--ease-cinematic), filter 0.6s var(--ease-smooth);
}

.founder-card:hover .founder-card__img {
    transform: scale(1.07);
    filter: saturate(1.12) contrast(1.05);
}

/* Bottom fade so the photo melts into the card body */
.founder-card__media::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 42%;
    background: linear-gradient(180deg, transparent 0%, rgba(9, 10, 16, 0.72) 68%, rgba(9, 10, 16, 0.96) 100%);
    pointer-events: none;
}

.founder-card__initial {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-arabic-heading);
    font-size: 5rem;
    font-weight: 900;
    color: var(--neon-cyan);
    opacity: 0.22;
    text-shadow: 0 0 40px var(--neon-cyan-glow);
}

/* --- Job title ribbon over the photo --- */
.founder-card__ribbon {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #04121a;
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-teal) 100%);
    box-shadow: 0 8px 24px rgba(0, 242, 254, 0.32);
    backdrop-filter: blur(6px);
}

/* --- Body --- */
.founder-card__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 14px;
    padding: 8px 26px 28px;
    text-align: center;
}

.founder-card__name {
    font-family: var(--font-arabic-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-pure);
    line-height: 1.4;
    margin: 0;
}

/* --- The specialty block (directly under the photo) --- */
.founder-card__specialty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    align-self: center;
    padding: 10px 20px;
    border-radius: 14px;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.24);
    box-shadow: inset 0 0 22px rgba(0, 242, 254, 0.07);
    line-height: 1.6;
}

.founder-card__specialty i {
    font-size: 0.86rem;
    color: var(--neon-teal);
    flex-shrink: 0;
}

.founder-card__bio {
    font-size: 0.93rem;
    color: var(--text-muted);
    line-height: 1.9;
    margin: 0;
}

.founder-card__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 6px;
}

.founder-card__social {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass-card);
    transition: all 0.3s var(--ease-smooth);
}

.founder-card__social:hover {
    color: #04121a;
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   PARTNERS MARQUEE — RTL auto scroll (right → left)
   Physical LTR layout ensures that cloned buffer items are laid out to the right,
   allowing them to smoothly enter from the right as translateX shifts left,
   guaranteeing a 100% gapless, seamless 60fps loop.
   -------------------------------------------------------------------------- */
.partners-marquee {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: clamp(1.5rem, 3vw, 2.5rem) 0;
    direction: ltr; /* CRITICAL: Physical track alignment so translate3d(-50%) moves left without gaps */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

.partners-marquee__track {
    display: flex;
    align-items: center;
    width: max-content;
    gap: clamp(1.2rem, 2vw, 1.8rem);
    will-change: transform;
    animation-name: tamooMarqueeRTL;
    animation-duration: var(--marquee-duration, 40s);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* Pause when the visitor hovers — lets them actually read a logo */
.partners-marquee:hover .partners-marquee__track,
.partners-marquee:focus-within .partners-marquee__track {
    animation-play-state: paused;
}

/* The track has two identical halves (Half A + Half B).
   Travelling -50% shifts exactly the width of Half A, perfectly landing Half B
   at the start coordinates, producing an infinite, gapless, jump-free loop. */
@keyframes tamooMarqueeRTL {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

@keyframes tamooMarqueeLTR {
    0% {
        transform: translate3d(-50%, 0, 0);
    }
    100% {
        transform: translate3d(0, 0, 0);
    }
}

[dir='ltr'] .partners-marquee__track {
    animation-name: tamooMarqueeLTR;
}

/* --- Partner chip (Card) --- */
.partner-chip {
    direction: rtl; /* RTL content inside each individual card */
    text-align: right;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    width: 330px;
    min-height: 102px;
    padding: 14px 18px;
    border-radius: 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    color: inherit;
    transition:
        transform 0.4s var(--ease-cinematic),
        border-color 0.4s var(--ease-smooth),
        box-shadow 0.4s var(--ease-smooth),
        background 0.4s var(--ease-smooth);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.42);
    position: relative;
    overflow: hidden;
}

.partner-chip:hover {
    border-color: var(--border-glow);
    background: var(--bg-glass-hover);
    transform: translateY(-5px);
    box-shadow: 0 20px 48px rgba(0, 242, 254, 0.22);
}

/* Large, prominent, high-definition company logo container */
.partner-chip__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    padding: 8px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}

.partner-chip:hover .partner-chip__logo {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 242, 254, 0.3);
}

.partner-chip__logo img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.partner-chip__info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    flex: 1;
    text-align: right;
}

.partner-chip__name {
    font-family: var(--font-arabic-heading);
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-pure);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.partner-chip__type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--neon-teal);
}

.partner-chip__type i {
    font-size: 0.72rem;
    opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Marquee Control Button (pause / play)
   -------------------------------------------------------------------------- */
.marquee-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 1.75rem;
    padding: 11px 24px;
    border-radius: 999px;
    font-family: var(--font-arabic-body);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-glass-card);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
}

.marquee-toggle:hover {
    color: var(--neon-cyan);
    border-color: var(--border-glow);
    background: rgba(0, 242, 254, 0.08);
}

.marquee-toggle i {
    font-size: 0.82rem;
}

/* Not enough logos to make a loop worth animating — render as a static row */
.partners-marquee__track--static {
    animation: none !important;
    transform: none !important;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
}

.marquee-toggle.is-hidden {
    display: none;
}

/* The marquee block is hidden while the section shows an empty/error state. */
#partnersContent.is-hidden {
    display: none;
}

.partners-state:not(:empty) {
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

/* --------------------------------------------------------------------------
   Partners Grid Fallback (used when there is not enough content to loop)
   -------------------------------------------------------------------------- */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
    max-width: 1180px;
    margin: 0 auto;
}

.partners-grid .partner-chip {
    width: 100%;
}

/* --------------------------------------------------------------------------
   Stats Strip
   -------------------------------------------------------------------------- */
.founders-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(1.25rem, 3vw, 2.5rem);
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.25rem, 3vw, 2.5rem);
    border-radius: 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
}

.founders-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 128px;
    text-align: center;
}

.founders-stat__value {
    font-family: var(--font-latin);
    font-size: clamp(1.7rem, 3.2vw, 2.4rem);
    font-weight: 800;
    line-height: 1.2;
    background: var(--gradient-tamooh);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.founders-stat__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-subtle);
}

.founders-stat__divider {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(180deg, transparent, var(--border-subtle), transparent);
}

@media (max-width: 640px) {
    .founders-stat__divider {
        display: none;
    }

    .founders-stat {
        min-width: 42%;
    }
}

/* --------------------------------------------------------------------------
   Loading / Empty / Error States
   -------------------------------------------------------------------------- */
.founders-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    max-width: 520px;
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
    border-radius: 26px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px dashed var(--border-subtle);
    text-align: center;
}

.founders-state__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    border-radius: 22px;
    font-size: 1.9rem;
    color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.09);
    border: 1px solid rgba(0, 242, 254, 0.22);
}

.founders-state__icon--error {
    color: #ff6b6b;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.28);
}

.founders-state__icon--muted {
    color: var(--text-subtle);
    background: var(--bg-glass-card);
    border-color: var(--border-subtle);
}

.founders-state__title {
    font-family: var(--font-arabic-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-pure);
    margin: 0;
}

.founders-state__text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.85;
    margin: 0;
}

.founders-state__retry {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
    padding: 11px 26px;
    border-radius: 999px;
    font-family: var(--font-arabic-body);
    font-size: 0.88rem;
    font-weight: 700;
    color: #04121a;
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-teal) 100%);
    border: none;
    cursor: pointer;
    transition: transform 0.3s var(--ease-elastic), box-shadow 0.3s var(--ease-smooth);
}

.founders-state__retry:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 30px rgba(0, 242, 254, 0.32);
}

/* Shimmer skeleton for founders */
.founder-skeleton {
    border-radius: 26px;
    overflow: hidden;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
}

.founder-skeleton__media {
    width: 100%;
    aspect-ratio: 1 / 1;
}

.founder-skeleton__line {
    height: 14px;
    margin: 16px 26px;
    border-radius: 8px;
}

.founder-skeleton__line--short {
    width: 52%;
}

.founder-skeleton__media,
.founder-skeleton__line {
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0.04) 20%,
        rgba(255, 255, 255, 0.1) 45%,
        rgba(255, 255, 255, 0.04) 70%
    );
    background-size: 220% 100%;
    animation: tamooShimmer 1.5s var(--ease-smooth) infinite;
}

@keyframes tamooShimmer {
    from { background-position: 200% 0; }
    to   { background-position: -20% 0; }
}

/* --------------------------------------------------------------------------
   Entrance Reveal (used with IntersectionObserver)
   -------------------------------------------------------------------------- */
.founder-reveal {
    opacity: 0;
    transform: translateY(38px);
    transition:
        opacity 0.85s var(--ease-cinematic),
        transform 0.85s var(--ease-cinematic);
}

.founder-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .partners-marquee__track {
        animation: none !important;
        transform: none !important;
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
    }

    .founder-card,
    .founder-card__img,
    .partner-chip {
        transition: none !important;
    }

    .founder-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .founder-skeleton__media,
    .founder-skeleton__line {
        animation: none;
    }
}

/* Screen-reader-only helper (used on the duplicated marquee copy) */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .founders-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

    .partner-chip {
        width: 232px;
    }
}

@media (max-width: 560px) {
    .founders-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .founder-card__body {
        padding: 8px 20px 24px;
    }

    .founder-card__name {
        font-size: 1.4rem;
    }

    .partner-chip {
        width: 210px;
        padding: 13px 15px;
    }

    .partner-chip__logo {
        width: 50px;
        height: 50px;
    }

    /* On very small screens a scrolling logo strip is more useful than
       a marquee, so let the track wrap into a static grid. */
    .partners-marquee {
        -webkit-mask-image: none;
        mask-image: none;
    }

    .partners-marquee__track {
        animation: none;
        transform: none;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }
}
