/* =========================================
   Quantitative Research – Final Full CSS
   Scope: .quant-research
========================================= */

.quant-research {
    --qr-blue: #165c7d;
    --qr-ink: #1a1f2b;
    --qr-muted: #61697a;
    --donut-gray: #d0d3db;
    --donut-gold: #ff6c63;

    position: relative;
    margin: 0 auto;
    border-radius: 10px;
    overflow: visible;
    font-family: inherit; /* use site font */
}

/* rail for alignment */
.quant-research .qr-rail {
    position: relative;
    max-width: 1160px;
    margin-inline: auto;
    padding: clamp(16px, 3.5vw, 36px) clamp(18px, 4vw, 56px);
}

/* remove any guides or borders */
.quant-research .qr-rail::before {
    display: none !important;
}
.quant-research::after {
    display: none !important;
}

/* header */
.qr-head h2 {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--qr-ink);
}
.qr-head .qr-sub {
    margin: 0 0 22px;
    font-weight: 400;
    line-height: 2;
}

/* rows */
.qr-item {
    display: grid;
    grid-template-columns: 1fr minmax(160px, 220px);
    gap: clamp(18px, 5vw, 80px);
    align-items: center;
    padding-block: clamp(18px, 4.5vw, 40px);
    border-top: none;
}
.qr-item.left {
    grid-template-columns: minmax(160px, 220px) 1fr;
}

/* text */
.qr-copy h3 {
    margin: 0 0 10px;
    line-height: 1.2;
    color: var(--qr-blue);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}
.qr-copy p {
    margin: 0;
    color: var(--qr-muted);
    line-height: 30px;
}

/* make all five stat headings larger */
.qr-item:nth-of-type(1) .qr-copy h3,  /* 82% */
.qr-item:nth-of-type(2) .qr-copy h3,  /* 65% */
.qr-item:nth-of-type(3) .qr-copy h3,  /* 72% */
.qr-item:nth-of-type(4) .qr-copy h3,  /* 37% */
.qr-item:nth-of-type(5) .qr-copy h3 {
    /* 48% */
    font-size: clamp(22px, 3.2vw, 34px);
}

/* donut container, flat and clean */
.qr-donut {
    position: relative;
    width: 200px;
    max-width: 42vw;
    margin: 0;
    transform-origin: 50% 50%;
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
}

/* donut svg */
.donut {
    width: 100%;
    height: auto;
    display: block;
    transform: rotate(-90deg); /* arc starts at top */
    background: transparent !important;
}
.donut .ring {
    fill: none;
    stroke: var(--donut-gray);
    stroke-width: 20;
    opacity: 0.98;
    filter: none !important;
}
.donut .slice {
    fill: none;
    stroke: var(--donut-gold);
    stroke-width: 20;
    stroke-linecap: round;
    filter: none !important; /* no glow */
    /* set stroke-dasharray in HTML to control percent */
}

/* percentage pill */
.qr-pill {
    position: absolute;
    left: 50%;
    bottom: 10%;
    transform: translateX(-50%);
    background: #1f1f1f;
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    line-height: 1;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
    white-space: nowrap;
}

/* hover wobble plus tiny arc sweep */
.qr-donut:hover {
    animation: qr-wobble 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes qr-wobble {
    0% {
        transform: rotate(0deg) scale(1);
    }
    30% {
        transform: rotate(8deg) scale(1.02);
    }
    60% {
        transform: rotate(-5deg) scale(1.01);
    }
    80% {
        transform: rotate(3deg) scale(1.005);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}
.qr-donut:hover .slice {
    animation: qr-sweep 900ms ease-in-out both;
}
@keyframes qr-sweep {
    0% {
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dashoffset: -22;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
    .qr-donut:hover {
        animation: none;
    }
    .qr-donut:hover .slice {
        animation: none;
    }
}

/* mobile improvements, center chart and text */
@media (max-width: 900px) {
    .qr-item,
    .qr-item.left {
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: center;
    }
    .qr-donut {
        order: -1; /* chart above text */
        margin-inline: auto; /* center chart */
    }
    .qr-copy h3,
    .qr-copy p {
        text-align: center;
    }
}
