/*
 * rm/analytics-cards (Product; Platform reuses the block). Values from staging Product
 * post-1032.css and getComputedStyle at 1440 / 390:
 *   section 2a755451 width 95%, margin 70px (0 and padding 0 20px ≤767; 60px 0 / 0 25px ≤1024),
 *   inner padding 10px; grid aacc1ae 84% wide, padding 10px, 3 columns, gap 20px, min-height 451px;
 *   cards #292929, radius 40px, padding 30px, gap 10px (15px ≤1024); icon 80px; title 2c38e71
 *   28/400/1.05 white; text 643f8d7 20/300/1.5 white, paragraph margin 1em 0.
 */

.rm-analytics {
    width: calc(var(--rm-frame) * .95);
    margin: 70px 70px 70px calc(var(--rm-bleed) + 70px);
    padding: 10px;
}

.rm-analytics__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 84%;
    min-height: 451px;
    margin: 0 auto;
    padding: 10px;
}

.rm-analytics__card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 30px;
    border-radius: 40px;
    background: var(--rm-black);
    color: var(--rm-white);
}

.rm-analytics__icon {
    display: block;
    width: 80px;
    height: auto;
}

.rm-analytics__title {
    margin: 0;
    font-size: var(--rm-type-28);
    font-weight: 400;
    line-height: 1.05;
}

.rm-analytics__text {
    margin: 1em 0;
    font-size: var(--rm-type-20l);
    font-weight: 300;
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .rm-analytics {
        width: auto;
        margin: 60px 0;
        padding: 10px 35px;
    }

    .rm-analytics__grid {
        width: 100%;
    }

    .rm-analytics__card {
        gap: 15px;
    }
}

@media (max-width: 767px) {
    .rm-analytics {
        margin: 0;
        padding: 10px 30px;
    }

    .rm-analytics__grid {
        grid-template-columns: 1fr;
        min-height: 0;
    }
}

/* Drawn icons (parts/glyph.php): strokes draw once when the card is revealed, staggered
   by card (assets/js/motifs.js marks the card rm-glyph-done after). On hover the lens scans while
   the bars rise in turn, the sliders and their blurple tracks line up, the trend re-traces and its
   projection and target pulse; the pestle grinds while the Rx
   re-traces; the crystal ball shows a rising line inside while its sparkles twinkle.
   The one exception to transform/opacity-only motion: stroke-dashoffset on an SVG
   path, which paints inside the fixed 80px icon and never moves layout. */
.rm-glyph {
    display: block;
    width: 80px;
    height: 80px;
    overflow: visible;
}

.rm-glyph * {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rm-glyph__s {
    stroke: var(--rm-white);
    stroke-width: 2;
}

.rm-glyph__a {
    stroke: var(--rm-blurple-medium);
    stroke-width: 2.4;
}

.rm-glyph .rm-glyph__dot {
    fill: var(--rm-blurple-medium);
    stroke: none;
}

.rm-glyph__draw {
    stroke-dasharray: 1;
}

.rm-analytics__card:nth-child(2) {
    --rm-c: 120ms;
}

.rm-analytics__card:nth-child(3) {
    --rm-c: 240ms;
}

.rm-js .rm-analytics__card.rm-revealed .rm-glyph__draw {
    animation: rm-glyph-draw 1100ms var(--rm-ease) both;
    animation-delay: calc(400ms + var(--rm-c, 0ms) + var(--rm-d, 0ms));
}

.rm-js .rm-analytics__card.rm-glyph-done .rm-glyph__draw,
.rm-js .rm-analytics__card.rm-glyph-done .rm-glyph__pop {
    animation: none;
}

.rm-js .rm-analytics__card.rm-revealed .rm-glyph__pop {
    animation: rm-glyph-pop 500ms var(--rm-ease) both;
    animation-delay: calc(1200ms + var(--rm-c, 0ms));
}

.rm-glyph__knob,
.rm-glyph__fill,
.rm-glyph__lens,
.rm-glyph__bar {
    transform-box: fill-box;
    transition: transform 700ms var(--rm-ease);
}

.rm-glyph__knob {
    transform-origin: center;
}

.rm-glyph__fill {
    transform-origin: left center;
}

.rm-glyph__bar {
    transform-origin: center bottom;
}

.rm-glyph__ring {
    fill: none;
    stroke: var(--rm-blurple-medium);
    stroke-width: 1.5;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.rm-glyph__knob--2,
.rm-glyph__fill--2 {
    transition-delay: 80ms;
}

.rm-glyph__knob--3,
.rm-glyph__fill--3 {
    transition-delay: 160ms;
}

@media (hover: hover) {
    .rm-analytics__card:hover .rm-glyph__knob--1 {
        transform: translateX(14px);
    }

    .rm-analytics__card:hover .rm-glyph__knob--2 {
        transform: translateX(-2px);
    }

    .rm-analytics__card:hover .rm-glyph__knob--3 {
        transform: translateX(8px);
    }

    .rm-analytics__card:hover .rm-glyph__fill--1 {
        transform: scaleX(2.17);
    }

    .rm-analytics__card:hover .rm-glyph__fill--2 {
        transform: scaleX(.93);
    }

    .rm-analytics__card:hover .rm-glyph__fill--3 {
        transform: scaleX(1.44);
    }

    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__lens {
        animation: rm-glyph-scan 1200ms var(--rm-ease-swap) both;
    }

    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__bar {
        animation: rm-glyph-rise 700ms var(--rm-ease) both;
        animation-delay: calc(250ms + var(--rm-k, 0ms));
    }

    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__retrace {
        animation: rm-glyph-retrace 800ms var(--rm-ease) both;
    }

    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__projection {
        animation: rm-glyph-pop 400ms var(--rm-ease) 650ms both;
    }

    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__ring {
        animation: rm-glyph-ring 1000ms var(--rm-ease) 800ms both;
    }
}

.rm-glyph .rm-glyph__tint {
    fill: rgba(207, 205, 242, .14);
    stroke: none;
}

.rm-glyph__rx {
    stroke-width: 1.7;
}

.rm-glyph__pestle-stroke {
    stroke-width: 4;
}

.rm-glyph__fillin {
    transform-box: fill-box;
    transform-origin: center bottom;
}

.rm-js .rm-analytics__card.rm-revealed .rm-glyph__fillin {
    animation: rm-glyph-fillin 700ms var(--rm-ease) both;
    animation-delay: calc(400ms + var(--rm-c, 0ms) + var(--rm-d, 0ms));
}

.rm-js .rm-analytics__card.rm-glyph-done .rm-glyph__fillin {
    animation: none;
}

@keyframes rm-glyph-fillin {
    from { opacity: 0; }
}

.rm-glyph .rm-glyph__pestle,
.rm-glyph .rm-glyph__shine {
    transform-box: view-box;
}

.rm-glyph .rm-glyph__pestle {
    transform-origin: 21px 23px;
}

.rm-glyph .rm-glyph__shine {
    transform-origin: 26px 24px;
}

.rm-glyph__vision,
.rm-glyph__vision-dot {
    opacity: 0;
}

.rm-glyph__vision {
    stroke-dasharray: 1;
}

.rm-glyph__spark {
    transform-box: fill-box;
    transform-origin: center;
}

@media (hover: hover) {
    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__pestle {
        animation: rm-glyph-grind 1100ms var(--rm-ease-swap) both;
    }

    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__shine {
        animation: rm-glyph-shine 1000ms var(--rm-ease) both;
    }

    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__vision {
        animation: rm-glyph-vision 900ms var(--rm-ease) 200ms both;
    }

    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__vision-dot {
        animation: rm-glyph-appear 400ms var(--rm-ease) 950ms both;
    }

    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__spark {
        animation: rm-glyph-twinkle 900ms var(--rm-ease) both;
    }

    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__spark--2 {
        animation-delay: 150ms;
    }

    .rm-analytics__card.rm-glyph-done:hover .rm-glyph__spark--3 {
        animation-delay: 300ms;
    }
}

@keyframes rm-glyph-grind {
    25% { transform: rotate(-16deg); }
    50% { transform: rotate(8deg); }
    75% { transform: rotate(-10deg); }
}

@keyframes rm-glyph-shine {
    from { transform: rotate(-60deg); }
}

@keyframes rm-glyph-vision {
    from { opacity: 1; stroke-dashoffset: 1; }
    to { opacity: 1; stroke-dashoffset: 0; }
}

@keyframes rm-glyph-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rm-glyph-twinkle {
    30% { transform: scale(.3); }
    65% { transform: scale(1.3); }
}

@keyframes rm-glyph-scan {
    35% { transform: translate(-5px, 3px); }
    70% { transform: translate(4px, -2px); }
}

@keyframes rm-glyph-rise {
    from { transform: scaleY(.2); }
}

@keyframes rm-glyph-ring {
    from { opacity: .9; transform: scale(1); }
    to { opacity: 0; transform: scale(3.2); }
}

@keyframes rm-glyph-draw {
    from { stroke-dashoffset: 1; }
}

@keyframes rm-glyph-retrace {
    from { stroke-dashoffset: 1; }
}

@keyframes rm-glyph-pop {
    from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .rm-glyph *,
    .rm-analytics__card .rm-glyph * {
        animation: none !important;
        transition: none;
        transform: none !important;
    }
}
