/*==========================================
  Desiwood — "Why Desiwood" bento section
  (resources/views/frontend/components/why-choose.blade.php; behaviour in
  public/frontend/js/dw-why.js). Every rule is scoped to .dw-why.

  Cards are visible without JS. dw-why.js adds .is-ready (cards wait below their
  place) and then .is-in per card as it scrolls into view.
==========================================*/

.dw-why {
    --dw-why-bg: #0a0710;
    --dw-why-text: #fff;
    --dw-why-muted: #aaa4b8;
    --dw-why-card: rgba(255, 255, 255, .045);
    --dw-why-line: rgba(255, 255, 255, .11);
    --dw-why-accent: #ff8a00;
    --dw-why-accent-2: #ff006e;
    --dw-why-gradient: linear-gradient(90deg, var(--dw-why-accent) 0%, var(--dw-why-accent-2) 100%);
    --dw-why-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --dw-why-hover: .3s ease-out;
    position: relative;
    isolation: isolate;
    padding: 140px 0 150px;
    overflow: hidden;
    /* Near-black band that fades into the page above and below instead of a hard edge. */
    background: linear-gradient(180deg, transparent 0, var(--dw-why-bg) 140px, var(--dw-why-bg) calc(100% - 140px), transparent 100%);
    font-family: "Inter", var(--default-font, "Poppins"), sans-serif;
    color: var(--dw-why-text);
}

/* Soft purple/magenta glow behind the heading. */
.dw-why::before {
    content: "";
    position: absolute;
    top: 40px;
    left: 50%;
    z-index: -1;
    width: min(1200px, 130vw);
    height: 680px;
    transform: translateX(-50%);
    background:
        radial-gradient(closest-side, rgba(160, 40, 220, .38), transparent 72%),
        radial-gradient(42% 50% at 64% 42%, rgba(255, 0, 110, .26), transparent 70%),
        radial-gradient(36% 44% at 36% 50%, rgba(255, 138, 0, .16), transparent 70%);
    filter: blur(24px);
    pointer-events: none;
}

/* Second, lower glow so the grid itself sits in light instead of on flat black. */
.dw-why::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 120px;
    z-index: -1;
    width: min(1100px, 120vw);
    height: 560px;
    transform: translateX(-50%);
    background:
        radial-gradient(45% 55% at 30% 50%, rgba(255, 110, 0, .14), transparent 70%),
        radial-gradient(45% 55% at 72% 45%, rgba(200, 0, 140, .16), transparent 70%);
    filter: blur(30px);
    pointer-events: none;
}

.dw-why .container {
    max-width: 1200px;
}

/* ---------- Heading ---------- */

.dw-why__head {
    max-width: 720px;
    margin: 0 auto 72px;
    text-align: center;
}

.dw-why__eyebrow {
    margin: 0 0 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .2em;
    line-height: 1;
    text-transform: uppercase;
    color: #ff9d3d;
}

.dw-why__title {
    margin: 0;
    font-family: inherit;
    font-size: clamp(34px, 4.6vw, 56px);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.05;
    color: var(--dw-why-text);
}

.dw-why__accent {
    white-space: nowrap; /* the gradient phrase never breaks across lines */
    background: var(--dw-why-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dw-why__lead {
    max-width: 520px;
    margin: 22px auto 0;
    font-size: 17px;
    line-height: 1.6;
    color: var(--dw-why-muted);
}

/* ---------- Bento grid ---------- */

.dw-why__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
        "free    free    fast"
        "dash    global  global"
        "meta    royalty support";
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dw-why__card--free { grid-area: free; }
.dw-why__card--fast { grid-area: fast; }
.dw-why__card--dash { grid-area: dash; }
.dw-why__card--global { grid-area: global; }
.dw-why__card--meta { grid-area: meta; }
.dw-why__card--royalty { grid-area: royalty; }
.dw-why__card--support { grid-area: support; }

/* ---------- Card ---------- */

.dw-why__card {
    --mx: 50%;
    --my: 50%;
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 240px;
    padding: 30px;
    overflow: hidden;
    border: 1px solid var(--dw-why-line);
    border-radius: 20px;
    /* A light top edge and a faint warm wash lift the card off the background. */
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .05) 0%, transparent 38%),
        radial-gradient(120% 90% at 0% 0%, rgba(255, 120, 40, .07), transparent 60%),
        var(--dw-why-card);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 20px 50px -30px rgba(0, 0, 0, .8);
    transition: transform var(--dw-why-hover), border-color var(--dw-why-hover);
}

/* Spotlight that follows the pointer (--mx/--my set by dw-why.js). */
.dw-why__card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(380px circle at var(--mx) var(--my), rgba(255, 110, 60, .1), rgba(255, 0, 110, .05) 40%, transparent 70%);
    opacity: 0;
    transition: opacity var(--dw-why-hover);
}

/* Gradient border on hover: a 1px ring masked out of a gradient fill. */
.dw-why__card::after {
    content: "";
    position: absolute;
    inset: -1px;
    padding: 1px;
    border-radius: inherit;
    background: var(--dw-why-gradient);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dw-why-hover);
}

.dw-why__card:hover {
    transform: translateY(-4px);
}

.dw-why__card:hover::before,
.dw-why__card:hover::after {
    opacity: 1;
}

.dw-why__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

/* ---------- Icon ---------- */

.dw-why__icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: auto;
    overflow: hidden;
    border-radius: 12px;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 138, 0, .32), transparent 72%),
        linear-gradient(160deg, rgba(255, 138, 0, .1), rgba(255, 0, 110, .12)),
        rgba(255, 255, 255, .04);
    box-shadow: inset 0 0 14px rgba(255, 60, 110, .22), 0 0 22px -6px rgba(255, 90, 60, .45);
    color: #ffd0a0;
    transition: transform var(--dw-why-hover);
}

/* Faint gradient border on the icon tile. */
.dw-why__icon::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(140deg, rgba(255, 138, 0, .85), rgba(255, 0, 110, .45) 55%, rgba(255, 255, 255, .1));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* Shimmer: a soft highlight sweeps across the tile once per hover. */
.dw-why__icon::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
    transform: translateX(-120%);
}

.dw-why__card:hover .dw-why__icon {
    transform: scale(1.05);
}

.dw-why__card:hover .dw-why__icon::after {
    transform: translateX(120%);
    transition: transform 1.1s var(--dw-why-ease);
}

.dw-why__icon svg {
    position: relative;
    z-index: 1;
    display: block;
}

/* ---------- Text ---------- */

.dw-why__card-title {
    margin: 32px 0 0;
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.3;
    color: var(--dw-why-text);
}

.dw-why__card-desc {
    max-width: 34ch;
    margin: 8px 0 0;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--dw-why-muted);
}

/* ---------- Hero cards ---------- */

.dw-why__card--hero {
    min-height: 300px;
    padding: 32px;
    border-color: rgba(255, 138, 0, .18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .06) 0%, transparent 40%),
        radial-gradient(70% 90% at 100% 100%, rgba(255, 0, 110, .16), transparent 65%),
        radial-gradient(60% 80% at 0% 0%, rgba(255, 138, 0, .12), transparent 60%),
        rgba(255, 255, 255, .05);
}

.dw-why__card--hero .dw-why__card-title {
    font-size: 22px;
}

.dw-why__card--hero .dw-why__card-desc {
    font-size: 15px;
}

/* Slowly rotating conic border, very faint (hero cards only). */
.dw-why__ring {
    position: absolute;
    inset: 0;
    z-index: -1;
    padding: 1px;
    border-radius: inherit;
    overflow: hidden;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: .9;
    pointer-events: none;
}

.dw-why__ring span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    aspect-ratio: 1;
    background: conic-gradient(from 0deg, transparent 0 58%, rgba(255, 138, 0, .95) 76%, rgba(255, 0, 110, .95) 86%, transparent 95%);
    transform: translate(-50%, -50%) rotate(0deg);
    animation: dw-why-spin 7s linear infinite;
}

@keyframes dw-why-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Free Distribution: big ₹0 on the right. */
.dw-why__card--free {
    justify-content: space-between;
    align-items: stretch;
    gap: 24px;
}

.dw-why__stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    text-align: right;
}

.dw-why__stat-value {
    font-size: clamp(88px, 10vw, 136px);
    font-weight: 700;
    letter-spacing: -.06em;
    line-height: .85;
    background: linear-gradient(135deg, #ffb347 0%, #ff8a00 35%, #ff006e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 8px 30px rgba(255, 40, 100, .35));
}

.dw-why__stat-label {
    margin-top: 14px;
    font-size: 13px;
    color: var(--dw-why-muted);
}

/* Global Reach: platform names under the text, dotted globe on the right. */
.dw-why__card--global {
    justify-content: space-between;
    gap: 16px;
}

.dw-why__card--global .dw-why__body {
    position: relative;
    z-index: 1;
}

.dw-why__platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.dw-why__platforms li {
    padding: 6px 12px;
    border: 1px solid var(--dw-why-line);
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.2;
    color: #c9c4d4;
}

.dw-why__globe {
    flex: 0 0 auto;
    align-self: center;
    width: 240px;
    height: 240px;
    margin: -20px -12px -20px 0;
    filter: drop-shadow(0 0 24px rgba(255, 40, 110, .35));
}

/* ---------- Scroll reveal ---------- */

.dw-why.is-ready .dw-why__card {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity .7s var(--dw-why-ease) calc(var(--i) * 80ms),
        transform .7s var(--dw-why-ease) calc(var(--i) * 80ms),
        border-color var(--dw-why-hover);
}

.dw-why.is-ready .dw-why__card.is-in {
    opacity: 1;
    transform: none;
}

/* After the reveal the hover lift must not wait for the stagger delay. */
.dw-why.is-ready .dw-why__card.is-settled {
    transition: transform var(--dw-why-hover), border-color var(--dw-why-hover);
}

.dw-why.is-ready .dw-why__card.is-settled:hover {
    transform: translateY(-4px);
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
    .dw-why {
        padding: 110px 0 120px;
    }

    .dw-why__head {
        margin-bottom: 56px;
    }

    .dw-why__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "free    free"
            "fast    dash"
            "global  global"
            "meta    royalty"
            "support support";
    }
}

@media (max-width: 767.98px) {
    .dw-why {
        padding: 88px 0 96px;
    }

    .dw-why__head {
        margin-bottom: 44px;
    }

    .dw-why__lead {
        font-size: 16px;
    }

    .dw-why__grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "free" "global" "fast" "dash" "meta" "royalty" "support";
        gap: 12px;
    }

    .dw-why__card {
        min-height: 0;
        padding: 26px;
    }

    .dw-why__card-title {
        margin-top: 24px;
    }

    /* Hero cards keep their emphasis: visual stacked under the text. */
    .dw-why__card--hero {
        flex-direction: column;
        padding: 28px;
    }

    .dw-why__stat {
        align-items: flex-start;
        text-align: left;
    }

    .dw-why__stat-value {
        font-size: 96px;
    }

    .dw-why__globe {
        align-self: center;
        width: 220px;
        height: 220px;
        margin: 4px 0 -36px;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .dw-why__ring span {
        animation: none;
    }

    .dw-why__card,
    .dw-why__card::before,
    .dw-why__card::after,
    .dw-why__icon,
    .dw-why.is-ready .dw-why__card,
    .dw-why.is-ready .dw-why__card.is-settled {
        transition: none;
    }

    .dw-why.is-ready .dw-why__card {
        opacity: 1;
        transform: none;
    }

    .dw-why__card:hover,
    .dw-why.is-ready .dw-why__card.is-settled:hover,
    .dw-why__card:hover .dw-why__icon {
        transform: none;
    }

    .dw-why__card:hover .dw-why__icon::after {
        transition: none;
    }
}
