/* ============================================================
   QB — Why Us Section  v1.0  |  qb-why.css
   Almasa Digital — QB Studio

   Palette (light mode):
   White bg:      #FFFFFF / #F8F9FB
   Deep navy:     #060F25
   Brand teal:    #7ED0DC   (rgb 126,208,220)
   Brand purple:  #5F2DEE
   Body text:     rgba(6,15,37,0.62)
   Font:          Space Grotesk (headings) · Catamaran (body)
   ============================================================ */

/* ── Google Fonts import ──────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

/* ── Section shell ────────────────────────────────────────── */
.qbw-section {
    --qbw-teal:   #7ED0DC;
    --qbw-navy:   #060F25;
    --qbw-purple: #5F2DEE;
    --qbw-accent: #7ED0DC;   /* overridden per-card */

    position: relative;
    width: 100%;
    background: #ffffff;
    padding: 110px 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Subtle grain texture */
.qbw-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse 80% 50% at 100% 0%,   rgba(126,208,220,0.09) 0%, transparent 65%),
        radial-gradient(ellipse 60% 40% at 0%   100%, rgba(95,45,238,0.06)  0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ── Diamond watermark ────────────────────────────────────── */
.qbw-diamond-bg {
    position: absolute;
    right: -6%;
    top: 50%;
    transform: translateY(-50%);
    width: min(55vw, 620px);
    height: min(55vw, 620px);
    color: rgba(126,208,220,0.1);
    pointer-events: none;
    z-index: 0;
    animation: qbw-dia-spin 40s linear infinite;
}
.qbw-diamond-bg svg { width: 100%; height: 100%; }

@keyframes qbw-dia-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to   { transform: translateY(-50%) rotate(360deg); }
}

/* ── Inner layout ─────────────────────────────────────────── */
.qbw-inner {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 48px;
    display: grid;
    grid-template-columns: 1fr 1.55fr;
    gap: 64px;
    align-items: center;
}

/* ── LEFT PANEL ───────────────────────────────────────────── */
.qbw-left {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Eyebrow */
.qbw-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #7ED0DC;
    margin: 0 0 20px;

    /* entrance */
    opacity: 0;
    transform: translateX(-28px);
    transition: none;
}
.qbw-eye-gem {
    display: inline-flex;
    width: 18px; height: 18px;
    flex-shrink: 0;
}
.qbw-eye-gem svg { width: 100%; height: 100%; }

/* Title */
.qbw-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    font-weight: 800;
    color: #060F25;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 0 0 28px;

    /* entrance */
    opacity: 0;
    transform: translateX(-32px);
    transition: none;
}

/* Intro */
.qbw-intro {
    font-family: Catamaran, sans-serif;
    font-size: 1.05rem;
    line-height: 1.85;
    color: rgba(6,15,37,0.62);
    margin: 0 0 40px;

    /* entrance */
    opacity: 0;
    transform: translateX(-24px);
    transition: none;
}

/* CTA Button */
.qbw-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 15px 34px;
    background: #060F25;
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-radius: 3px;
    align-self: flex-start;
    position: relative;
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(.34,1.56,.64,1), box-shadow 0.28s ease;

    /* entrance */
    opacity: 0;
    transform: translateX(-20px);
}

/* Teal sweep on hover */
.qbw-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #7ED0DC;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.38s cubic-bezier(.77,0,.18,1);
    z-index: 0;
}
.qbw-btn:hover::before { transform: scaleX(1); }
.qbw-btn:hover { color: #060F25; transform: translateY(-3px) scale(1.02); box-shadow: 0 14px 40px rgba(126,208,220,0.3); }
.qbw-btn:active { transform: scale(0.97); }
.qbw-btn-text, .qbw-btn-arrow { position: relative; z-index: 1; }
.qbw-btn-arrow { display: inline-flex; width: 20px; height: 20px; transition: transform 0.28s ease; }
.qbw-btn:hover .qbw-btn-arrow { transform: translateX(5px); }
.qbw-btn-arrow svg { width: 100%; height: 100%; }

/* ── RIGHT: 2×2 GRID ──────────────────────────────────────── */
.qbw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

/* ── CARD ─────────────────────────────────────────────────── */
.qbw-card {
    position: relative;
    background: #F8F9FB;
    border: 1px solid rgba(6,15,37,0.07);
    border-radius: 20px;
    padding: 36px 32px 40px;
    overflow: hidden;
    cursor: default;
    transition:
        transform    0.38s cubic-bezier(.34,1.56,.64,1),
        box-shadow   0.38s ease,
        border-color 0.38s ease,
        background   0.38s ease;

    /* entrance — each card starts hidden, lifted */
    opacity: 0;
    transform: translateY(44px) scale(0.94);
}

/* Subtle card inner gradient */
.qbw-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 120% 100% at 0% 0%,
        color-mix(in srgb, var(--qbw-accent) 6%, transparent) 0%,
        transparent 65%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .qbw-card::before {
        background: radial-gradient(ellipse 120% 100% at 0% 0%, rgba(126,208,220,0.06) 0%, transparent 65%);
    }
}

.qbw-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 24px 60px rgba(6,15,37,0.10), 0 4px 16px rgba(6,15,37,0.06);
    border-color: var(--qbw-accent, #7ED0DC);
    background: #ffffff;
}
.qbw-card:hover::before { opacity: 1; }

/* ── Card head: number + gem ──────────────────────────────── */
.qbw-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

/* Number */
.qbw-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--qbw-accent, #7ED0DC);
    line-height: 1;

    /* subtle glowing number bg */
    background: linear-gradient(135deg, var(--qbw-accent, #7ED0DC), transparent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* fallback */
}
@supports not (-webkit-background-clip: text) {
    .qbw-num { color: var(--qbw-accent, #7ED0DC); }
}

/* Gem icon */
.qbw-card-gem {
    display: flex;
    width: 40px; height: 40px;
    color: var(--qbw-accent, #7ED0DC);
    opacity: 0.55;
    transition: opacity 0.3s ease, transform 0.6s cubic-bezier(.34,1.56,.64,1);
    flex-shrink: 0;
}
.qbw-card-gem svg { width: 100%; height: 100%; }
.qbw-card:hover .qbw-card-gem {
    opacity: 1;
    transform: rotate(45deg) scale(1.1);
}

/* ── Card title ───────────────────────────────────────────── */
.qbw-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    color: #060F25;
    line-height: 1.3;
    margin: 0 0 12px;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}
.qbw-card:hover .qbw-card-title {
    color: var(--qbw-accent, #7ED0DC);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .qbw-card:hover .qbw-card-title { color: #7ED0DC; }
}

/* ── Card text ────────────────────────────────────────────── */
.qbw-card-text {
    font-family: Catamaran, sans-serif;
    font-size: 0.92rem;
    line-height: 1.78;
    color: rgba(6,15,37,0.6);
    margin: 0;
    position: relative;
    z-index: 1;
}

/* ── Card bottom accent line ──────────────────────────────── */
.qbw-card-line {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--qbw-accent, #7ED0DC),
        transparent 80%
    );
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s cubic-bezier(.77,0,.18,1);
    border-radius: 0 0 20px 20px;
}
.qbw-card:hover .qbw-card-line { transform: scaleX(1); }

/* ── ENTRANCE ANIMATIONS ──────────────────────────────────── */

/* Left panel items — slide in from left */
.qbw-section.qbw-entered .qbw-eyebrow {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.7s cubic-bezier(.16,1,.3,1) 0.1s,
                transform 0.7s cubic-bezier(.16,1,.3,1) 0.1s;
}
.qbw-section.qbw-entered .qbw-title {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.85s cubic-bezier(.16,1,.3,1) 0.22s,
                transform 0.85s cubic-bezier(.16,1,.3,1) 0.22s;
}
.qbw-section.qbw-entered .qbw-intro {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.75s cubic-bezier(.16,1,.3,1) 0.38s,
                transform 0.75s cubic-bezier(.16,1,.3,1) 0.38s;
}
.qbw-section.qbw-entered .qbw-btn {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.65s cubic-bezier(.16,1,.3,1) 0.52s,
                transform 0.65s cubic-bezier(.16,1,.3,1) 0.52s;
}

/* Cards — stagger rise-up */
.qbw-section.qbw-entered .qbw-card[data-i="0"] {
    opacity: 1; transform: translateY(0) scale(1);
    transition: opacity 0.65s cubic-bezier(.16,1,.3,1) 0.32s,
                transform 0.65s cubic-bezier(.16,1,.3,1) 0.32s;
}
.qbw-section.qbw-entered .qbw-card[data-i="1"] {
    opacity: 1; transform: translateY(0) scale(1);
    transition: opacity 0.65s cubic-bezier(.16,1,.3,1) 0.46s,
                transform 0.65s cubic-bezier(.16,1,.3,1) 0.46s;
}
.qbw-section.qbw-entered .qbw-card[data-i="2"] {
    opacity: 1; transform: translateY(0) scale(1);
    transition: opacity 0.65s cubic-bezier(.16,1,.3,1) 0.58s,
                transform 0.65s cubic-bezier(.16,1,.3,1) 0.58s;
}
.qbw-section.qbw-entered .qbw-card[data-i="3"] {
    opacity: 1; transform: translateY(0) scale(1);
    transition: opacity 0.65s cubic-bezier(.16,1,.3,1) 0.70s,
                transform 0.65s cubic-bezier(.16,1,.3,1) 0.70s;
}
/* Support up to 8 cards */
.qbw-section.qbw-entered .qbw-card[data-i="4"] { opacity:1; transform:none; transition: opacity .65s cubic-bezier(.16,1,.3,1) .80s, transform .65s cubic-bezier(.16,1,.3,1) .80s; }
.qbw-section.qbw-entered .qbw-card[data-i="5"] { opacity:1; transform:none; transition: opacity .65s cubic-bezier(.16,1,.3,1) .90s, transform .65s cubic-bezier(.16,1,.3,1) .90s; }
.qbw-section.qbw-entered .qbw-card[data-i="6"] { opacity:1; transform:none; transition: opacity .65s cubic-bezier(.16,1,.3,1) 1.0s,  transform .65s cubic-bezier(.16,1,.3,1) 1.0s; }
.qbw-section.qbw-entered .qbw-card[data-i="7"] { opacity:1; transform:none; transition: opacity .65s cubic-bezier(.16,1,.3,1) 1.1s,  transform .65s cubic-bezier(.16,1,.3,1) 1.1s; }

/* Diamond watermark fades + slows spin on enter */
.qbw-diamond-bg {
    opacity: 0;
    transition: none;
}
.qbw-section.qbw-entered .qbw-diamond-bg {
    opacity: 1;
    transition: opacity 1.4s ease 0.4s;
}

/* ── Number counter animation on card enter ───────────────── */
.qbw-num {
    transition: letter-spacing 0.5s ease, opacity 0.5s ease;
}

/* ── SCAN LINE (same as logos section, consistent brand) ─── */
.qbw-scan-line {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 2px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(126,208,220,0.0) 15%,
        rgba(126,208,220,0.55) 42%,
        rgba(255,255,255,0.9)  50%,
        rgba(126,208,220,0.55) 58%,
        rgba(126,208,220,0.0) 85%,
        transparent 100%
    );
    z-index: 99;
    pointer-events: none;
    opacity: 0;
    filter: blur(0.5px);
}
.qbw-section.qbw-entered .qbw-scan-line {
    animation: qbw-scan 1.1s cubic-bezier(0.4,0,0.6,1) 0.02s forwards;
}
@keyframes qbw-scan {
    0%   { opacity:0;   transform: translateX(0); }
    7%   { opacity:1; }
    90%  { opacity:0.6; }
    100% { opacity:0;   transform: translateX(var(--qbw-scan-w, 1366px)); }
}

/* ── Horizontal shimmer line across top ──────────────────── */
.qbw-section::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(126,208,220,0.0) 10%,
        rgba(126,208,220,0.45) 35%,
        rgba(95,45,238,0.35) 65%,
        rgba(126,208,220,0.0) 90%,
        transparent 100%
    );
    transform: scaleX(0);
    transform-origin: left;
    transition: none;
    z-index: 1;
}
.qbw-section.qbw-entered::after {
    transform: scaleX(1);
    transition: transform 1.1s cubic-bezier(0.77,0,0.18,1) 0.05s;
}

/* ── REDUCED MOTION ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .qbw-eyebrow, .qbw-title, .qbw-intro, .qbw-btn,
    .qbw-card, .qbw-diamond-bg {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
    .qbw-scan-line { display: none !important; }
    .qbw-section::after { transform: scaleX(1) !important; transition: none !important; }
    .qbw-diamond-bg { animation: none !important; }
}

/* ── ELEMENTOR EDITOR ─────────────────────────────────────── */
.elementor-editor-active .qbw-eyebrow,
.elementor-editor-active .qbw-title,
.elementor-editor-active .qbw-intro,
.elementor-editor-active .qbw-btn,
.elementor-editor-active .qbw-card,
.elementor-editor-active .qbw-diamond-bg {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
}
.elementor-editor-active .qbw-scan-line { display: none !important; }
.elementor-editor-active .qbw-section::after { transform: scaleX(1) !important; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .qbw-inner {
        grid-template-columns: 1fr;
        gap: 56px;
        padding: 0 32px;
    }
    .qbw-diamond-bg { right: -15%; width: 55vw; opacity: 0.5; }
    .qbw-section.qbw-entered .qbw-diamond-bg { opacity: 0.5; }
}

@media (max-width: 768px) {
    .qbw-section { padding: 72px 0; }
    .qbw-inner { padding: 0 20px; gap: 40px; }
    .qbw-grid { grid-template-columns: 1fr; gap: 16px; }
    .qbw-title { font-size: clamp(1.8rem, 8vw, 2.8rem); }
    .qbw-diamond-bg { display: none; }
    .qbw-btn { align-self: stretch; justify-content: center; }
}

@media (max-width: 480px) {
    .qbw-card { padding: 28px 24px 32px; }
}
