/* SMGLI Motion 0.24.0
   Uses the individual translate / scale properties instead of transform, so
   nothing here overrides a transform the theme already sets.
   Part A (header) works for everyone: with "Reduce motion" turned on in the
   system, the theme makes the change instant instead of animated.
   Part B (hover, reveal, counters...) only runs when motion is allowed. */

/* ============================================================
   A. Header: components tighten up once the page scrolls
      (html.smgli-compact is set by motion.js past 80px, removed above 20px)
   ============================================================ */
.site-header {
    transition: box-shadow .3s ease, background-color .3s ease;
}

.site-header__inner {
    transition: min-height .35s cubic-bezier(.2, .7, .2, 1), padding .35s cubic-bezier(.2, .7, .2, 1);
}

/* The whole header shrinks as one block, no delays between components */
.site-brand__logo {
    transition: height .35s cubic-bezier(.2, .7, .2, 1);
}

.primary-nav__list {
    transition: gap .35s cubic-bezier(.2, .7, .2, 1);
}

.header-actions {
    transition: gap .35s cubic-bezier(.2, .7, .2, 1);
}

.header-actions .button {
    transition: background-color .15s ease, translate .2s ease, box-shadow .2s ease,
                min-height .35s cubic-bezier(.2, .7, .2, 1),
                padding .35s cubic-bezier(.2, .7, .2, 1),
                font-size .35s cubic-bezier(.2, .7, .2, 1);
}

.smgli-compact .site-header {
    background: rgba(251, 250, 247, .985);
    box-shadow: 0 8px 24px rgba(31, 28, 23, .10);
}

/* Reading progress: a clay line along the bottom of the header fills as the page scrolls
   (element added by motion.js, --smgli-progress from 0 to 1) */
.smgli-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--color-accent, #BA4A29);
    transform-origin: 0 50%;
    scale: var(--smgli-progress, 0) 1;
    pointer-events: none;
}

/* Frosted glass once compact: the page shows softly through the header */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .smgli-compact .site-header {
        background: rgba(251, 250, 247, .78);
        -webkit-backdrop-filter: blur(12px) saturate(1.2);
        backdrop-filter: blur(12px) saturate(1.2);
    }
}

@media (min-width: 761px) {
    .smgli-compact .site-header__inner { min-height: 56px; }
    .smgli-compact .site-brand__logo { height: 34px; }
    .smgli-compact .primary-nav__list { gap: 1.05rem; }
    .smgli-compact .header-actions { gap: .45rem; }
    .smgli-compact .header-actions .button {
        min-height: 34px;
        padding: .3rem .8rem;
        font-size: .8rem;
    }
}

@media (max-width: 760px) {
    .smgli-compact .site-header__inner { padding: .45rem 0; }
    .smgli-compact .site-brand__logo { height: 30px; }
    .smgli-compact .header-actions .button { min-height: 38px; }
}

/* Conference home: the section nav (Keynotes, Panels, Workshops...) is position: fixed
   under the header, at the theme's full header height (76px; 108/122px with the admin
   bar). Once the header is compact (56px) the nav follows it; before this a strip of the
   page showed between the two. Breakpoints mirror the theme's .admin-bar rules; under
   761px the theme keeps the nav at top: 0 and the header does not shrink in height. */
.anchor-nav {
    transition: top .35s cubic-bezier(.2, .7, .2, 1), transform .28s ease, opacity .28s ease;
}

@media (min-width: 761px) {
    .smgli-compact .anchor-nav { top: 56px; }
    .smgli-compact .admin-bar .anchor-nav { top: 88px; }   /* 56 header + 32 admin bar */
}

@media (min-width: 761px) and (max-width: 782px) {
    .smgli-compact .admin-bar .anchor-nav { top: 102px; }  /* 56 header + 46 admin bar */
}

/* ============================================================
   B. Everything that moves: only when the visitor allows motion
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {

    /* 1. Page transitions: soft fade between pages (Chrome, Edge, Safari 18+; others ignore it) */
    @view-transition { navigation: auto; }

    ::view-transition-old(root),
    ::view-transition-new(root) { animation-duration: .25s; }

    /* The header stays put during the page fade, only the content changes */
    .site-header { view-transition-name: smgli-header; }

    /* 2. Main menu: a fine line grows out from the centre, 9px under the words
       (padding + negative margin keep the header height unchanged) */
    .primary-nav > .primary-nav__list > .menu-item > a,
    .primary-nav > .primary-nav__list > .menu-item > .primary-nav__label {
        background-image: linear-gradient(currentColor, currentColor);
        background-repeat: no-repeat;
        background-position: 50% 100%;
        background-size: 0% 1px;
        padding-bottom: 9px;
        margin-bottom: -9px;
        transition: background-size .35s cubic-bezier(.2, .7, .2, 1), color .15s ease;
    }

    .primary-nav > .primary-nav__list > .menu-item > a:hover,
    .primary-nav > .primary-nav__list > .menu-item > a:focus-visible,
    .primary-nav > .primary-nav__list > .menu-item > .primary-nav__label:hover,
    .primary-nav > .primary-nav__list > .menu-item > .primary-nav__label:focus-visible {
        background-size: 100% 1px;
    }

    /* 3. Dropdowns fade and slide down instead of popping */
    @keyframes smgli-drop {
        from { opacity: 0; translate: 0 -6px; }
    }

    .primary-nav .menu-item-has-children:hover > .sub-menu,
    .primary-nav .menu-item-has-children:focus-within > .sub-menu,
    .primary-nav .sub-menu.is-open {
        animation: smgli-drop .2s ease-out;
    }

    /* Items that open a dropdown get no line (the panel would cover it): their arrow turns
       over instead, and the dropdown items get a small clay bar on the left when hovered. */
    .primary-nav > .primary-nav__list > .menu-item-has-children > a,
    .primary-nav > .primary-nav__list > .menu-item-has-children > .primary-nav__label {
        background-image: none;
    }

    .primary-nav .menu-item-has-children > a::after,
    .primary-nav .menu-item-has-children > .primary-nav__label::after {
        display: inline-block;
        margin-left: .3em;
        transition: rotate .3s cubic-bezier(.2, .7, .2, 1);
    }

    .primary-nav .menu-item-has-children:hover > a::after,
    .primary-nav .menu-item-has-children:focus-within > a::after,
    .primary-nav .menu-item-has-children:hover > .primary-nav__label::after,
    .primary-nav .menu-item-has-children:focus-within > .primary-nav__label::after {
        rotate: 180deg;
    }

    .primary-nav .sub-menu a {
        transition: background-color .15s ease, box-shadow .2s ease;
    }

    .primary-nav .sub-menu a:hover,
    .primary-nav .sub-menu a:focus-visible {
        box-shadow: inset 3px 0 0 var(--color-accent, #BA4A29);
    }

    /* 3b. Illustrations on every page (collage pieces, icons, bursts, dividers).
       motion.js finds them and tags them: .smgli-art / .smgli-icon / .smgli-orn / .smgli-line.
       They arrive (.smgli-go), then live (.smgli-live): art and icons float slowly, each at its
       own pace; on hover they turn a little to the left; art also moves with the scroll
       (parallax, set inline by motion.js on desktop). */
    /* Art slides in from the side it sits on (--smgli-from-x set by motion.js: + right, − left) */
    @keyframes smgli-art-in {
        from {
            opacity: 0;
            translate: var(--smgli-from-x, 0px) 24px;
            rotate: var(--smgli-from-r, -4deg);
            scale: .92;
        }
        60% { opacity: 1; }
    }

    @keyframes smgli-icon-in {
        0% { opacity: 0; scale: .3; rotate: -20deg; }
        65% { opacity: 1; scale: 1.15; rotate: 6deg; }
        85% { scale: .97; rotate: -2deg; }
    }

    /* Pieces sliding in from the edge must never make the page scroll sideways */
    .site-main { overflow-x: clip; }

    @keyframes smgli-orn-in {
        from { opacity: 0; scale: .2; rotate: -180deg; }
    }

    @keyframes smgli-line-in {
        from { opacity: 0; scale: 0 1; }
    }

    @keyframes smgli-float {
        0%, 100% { translate: 0 0; rotate: 0deg; }
        50% { translate: 0 calc(var(--smgli-amp, 8px) * -1); rotate: var(--smgli-tilt, -.6deg); }
    }

    @keyframes smgli-fade-up {
        from { opacity: 0; translate: 0 18px; }
    }

    .smgli-wait { opacity: 0; }

    .smgli-art.smgli-go {
        animation: smgli-art-in 1.5s cubic-bezier(.16, 1, .3, 1) var(--smgli-d, 0s) both;
    }

    /* v0.27: pieces glued to an edge slide in without turning or shrinking, so their glued edge
       never lifts off it during the entrance */
    @keyframes smgli-art-in-glued {
        from {
            opacity: 0;
            translate: var(--smgli-from-x, 0px) var(--smgli-from-y, 0px);
        }
        60% { opacity: 1; }
    }

    .smgli-art.smgli-glued.smgli-go,
    .smgli-icon.smgli-glued.smgli-go {
        animation: smgli-art-in-glued 1.5s cubic-bezier(.16, 1, .3, 1) var(--smgli-d, 0s) both;
    }

    .smgli-icon.smgli-go {
        animation: smgli-icon-in .9s ease-out var(--smgli-d, 0s) both;
    }

    .smgli-orn.smgli-go {
        animation: smgli-orn-in 1s cubic-bezier(.2, .7, .2, 1) var(--smgli-d, 0s) both;
    }

    .smgli-line.smgli-go {
        animation: smgli-line-in 1s cubic-bezier(.2, .7, .2, 1) var(--smgli-d, 0s) both;
    }

    .smgli-art.smgli-live,
    .smgli-icon.smgli-live {
        animation: smgli-float var(--smgli-dur, 9s) ease-in-out infinite;
    }

    .smgli-icon.smgli-live { --smgli-amp: 4px; --smgli-tilt: 3deg; }

    /* Pieces glued to the top or bottom of their section (class set by motion.js) can't float:
       a gap would open between them and that edge. Instead they "breathe": they grow very
       slightly and come back, from their glued edge (transform-origin set by motion.js), so they
       stay alive without ever leaving the edge. Pieces only touching a side keep floating up and
       down, without tilting. */
    /* Glued pieces sway: they slide a little toward the outside of the page (where their own
       edge is, so the overflow hides the move and no gap opens on that side) and grow from their
       glued edge, then come back, slowly and subtly (v0.20). --smgli-out-x set by motion.js: −6px for
       a piece on the left, +6px on the right, ±4px for a piece glued only at the top or bottom. */
    @keyframes smgli-grow {
        0%, 100% { translate: 0 0; scale: 1; }
        50% { translate: var(--smgli-out-x, 0px) 0; scale: 1.015; }
    }

    .smgli-art.smgli-anchored.smgli-live,
    .smgli-icon.smgli-anchored.smgli-live,
    .smgli-draw.smgli-anchored.smgli-live,
    .smgli-draw.smgli-glued.smgli-live {
        animation: smgli-grow calc(var(--smgli-dur, 7s) * 1.4) ease-in-out infinite;
    }

    /* Mouse over an illustration: it turns a little (inline transform from motion.js) */
    .smgli-art,
    .smgli-icon,
    .smgli-draw {
        transition: transform .6s cubic-bezier(.2, .7, .2, 1), scale .4s cubic-bezier(.2, .7, .2, 1);
    }

    /* v0.22: on hover the piece turns a little to the left (inline rotate from motion.js,
       pushed into its glued edge when it has one). No zoom, no move up or down. */

    /* Small bursts and stars breathe too once they have arrived (v0.22) */
    @keyframes smgli-orn-breathe {
        0%, 100% { scale: 1; rotate: 0deg; }
        50% { scale: 1.04; rotate: 4deg; }
    }

    .smgli-orn.smgli-live { animation: smgli-orn-breathe 9s ease-in-out infinite; }

    /* Line drawings (About "logo" illustration, vision mark, logomarks): drawn in with a
       clock-hand sweep around the centre, then they breathe slowly. Hover redraws them. */
    @property --smgli-sweep {
        syntax: '<angle>';
        inherits: false;
        initial-value: 360deg;
    }

    @keyframes smgli-draw {
        from { --smgli-sweep: 0deg; opacity: .2; }
        15% { opacity: 1; }
        to { --smgli-sweep: 360deg; }
    }

    @keyframes smgli-breathe {
        0%, 100% { scale: 1; rotate: 0deg; }
        50% { scale: 1.025; rotate: -1deg; }
    }

    .smgli-draw.smgli-go,
    .smgli-draw.smgli-live:hover {
        -webkit-mask-image: conic-gradient(from -135deg, #000 var(--smgli-sweep), transparent calc(var(--smgli-sweep) + .5deg));
        mask-image: conic-gradient(from -135deg, #000 var(--smgli-sweep), transparent calc(var(--smgli-sweep) + .5deg));
    }

    .smgli-draw.smgli-go {
        animation: smgli-draw 2.2s cubic-bezier(.45, .05, .35, 1) var(--smgli-d, 0s) both;
    }

    .smgli-draw.smgli-live {
        animation: smgli-breathe 8s ease-in-out infinite;
    }

    .smgli-draw.smgli-live:hover {
        animation: smgli-draw 1.2s cubic-bezier(.45, .05, .35, 1) both;
    }

    /* Vertical rules (the dashed line beside "What's happening now"): drawn top to bottom */
    @keyframes smgli-vline-in {
        from { scale: 1 0; }
    }

    .smgli-vline { transform-origin: 50% 0; }
    .smgli-vline.smgli-go {
        animation: smgli-vline-in 1s cubic-bezier(.2, .7, .2, 1) var(--smgli-d, 0s) both;
    }

    /* Sliders. Testimonials: each new quote arrives out of a soft blur, the name follows.
       What's happening now: label, title, text and link arrive one after the other.
       Dots: the active one stretches into a small pill. */
    @keyframes smgli-quote-in {
        from { opacity: 0; translate: 0 14px; filter: blur(6px); }
    }

    /* v0.28: shorter entrance (was .9s / .7s + .3s) now that a quote stays 3 seconds (2 in v0.28, 4 in v0.28.1), so the
       quote and the name are fully there for most of that time */
    .hs-voices__figure.is-active .hs-voices__quote {
        animation: smgli-quote-in .5s cubic-bezier(.2, .7, .2, 1) both;
    }

    .hs-voices__figure.is-active .hs-voices__cite {
        animation: smgli-fade-up .4s cubic-bezier(.2, .7, .2, 1) .15s both;
    }

    .announce__item.is-active > * {
        animation: smgli-fade-up .7s cubic-bezier(.2, .7, .2, 1) both;
    }

    .announce__item.is-active > :nth-child(2) { animation-delay: .1s; }
    .announce__item.is-active > :nth-child(3) { animation-delay: .2s; }
    .announce__item.is-active > :nth-child(n+4) { animation-delay: .3s; }

    .home .hs-voices__dot,
    .home .hs-announce .announce__dots button,
    .announce__dots button {
        transition: width .35s cubic-bezier(.2, .7, .2, 1), background-color .3s ease, opacity .3s ease, border-radius .35s ease;
    }

    .home .hs-voices__dot.is-active {
        width: 22px;
        border-radius: 999px;
    }

    .home .hs-announce .announce__dots button.is-active,
    .announce__dots button.is-active {
        width: 24px;
        border-radius: 999px;
    }

    .home .hs-hero__copy > * {
        animation: smgli-fade-up .8s cubic-bezier(.2, .7, .2, 1) both;
    }

    /* The title types itself (see below), so it doesn't also fade */
    .home .hs-hero__copy > h1 { animation: none; }

    /* Page titles typed letter by letter (classes set by motion.js) */
    @keyframes smgli-blink {
        50% { opacity: 0; }
    }

    .smgli-pre .site-main h1 { opacity: 0; }
    .smgli-typing .smgli-ch { opacity: 0; }
    .smgli-typing .smgli-ch.smgli-on { opacity: 1; }

    /* Caret: drawn on the last letter shown, absolutely positioned, so it takes no room in the
       line (a real element could wrap onto a new line under big titles and push the page down).
       Its thickness and height follow the title size. */
    .smgli-typing .smgli-ch { position: relative; }

    .smgli-cur::after {
        content: "";
        position: absolute;
        top: .12em;
        bottom: .08em;
        right: -.08em;
        border-left: max(2px, .045em) solid currentColor;
        animation: smgli-blink .8s steps(1) infinite;
        pointer-events: none;
    }

    .home .hs-hero__copy > :nth-child(2) { animation-delay: .12s; }
    .home .hs-hero__copy > :nth-child(3) { animation-delay: .24s; }
    .home .hs-hero__copy > :nth-child(4) { animation-delay: .36s; }
    .home .hs-hero__copy > :nth-child(n+5) { animation-delay: .48s; }

    /* 4. Solid buttons lift 3px on hover, settle on click */
    .button,
    .wp-block-button__link,
    .hs-pricing__ac-add,
    [class*="27-button"] {
        transition: background-color .15s ease, color .15s ease, border-color .15s ease,
                    translate .2s ease, box-shadow .2s ease;
    }

    .button:hover,
    .wp-block-button__link:hover,
    .hs-pricing__ac-add:hover,
    [class*="27-button"]:hover {
        translate: 0 -3px;
        box-shadow: 0 8px 18px rgba(31, 28, 23, .20);
    }

    .button:active,
    .wp-block-button__link:active,
    .hs-pricing__ac-add:active,
    [class*="27-button"]:active {
        translate: 0 0;
        box-shadow: none;
        transition-duration: .05s;
    }

    /* Buttons drawn as text with a pointing hand (Patron "Join at this level"): the theme gives
       them no background, so a lift and a shadow showed an empty grey box around the words.
       They don't lift; the hand moves forward instead (v0.21). */
    .button:has(img[src*="anicule"]):hover,
    .button:has(img[src*="anicule"]):active {
        translate: none;
        box-shadow: none;
    }

    .button:has(img[src*="anicule"]) img[src*="anicule"] {
        transition: translate .3s cubic-bezier(.2, .7, .2, 1);
    }

    .button:has(img[src*="anicule"]):hover img[src*="anicule"],
    .button:has(img[src*="anicule"]):focus-visible img[src*="anicule"] {
        translate: 8px 0;
    }

    /* Home "Register" buttons in the pricing panel: the theme sets their transition with a
       stronger selector, so it is repeated here at the same strength */
    .home .hs-pricing__ac-add {
        transition: background-color .15s ease, translate .2s ease, box-shadow .2s ease;
    }

    /* 5. Manicule links (the drawn pointing hand): one line only. On hover the hand moves
       forward and the line under text + hand redraws from the left (its colour comes from
       part C below). Covers the home (.btn-manicule), Community Partners (.cp27-manicule),
       Watch & Listen (.wl27-manicule) and any other link whose hand is an image named
       *manicule*. */
    @keyframes smgli-rule {
        from { scale: 0 1; }
    }

    /* v0.26: hands drawn by the theme as a masked <span> are covered too: the Conference
       site's .icon--manicule (every .link-manicule and the contest "Submit" links) and the
       Institute Sponsor page's .sponsor-link__hand. */
    .btn-manicule__icon,
    .smgli-hand,
    .icon--manicule,
    .sponsor-link__hand,
    a img[src*="anicule"]:not(.smgli-hand img) {
        transition: translate .3s cubic-bezier(.2, .7, .2, 1);
    }

    .btn-manicule:hover .btn-manicule__icon:not(.smgli-hand img),
    .btn-manicule:focus-visible .btn-manicule__icon:not(.smgli-hand img),
    a:hover .smgli-hand,
    a:focus-visible .smgli-hand,
    a:hover .icon--manicule,
    a:focus-visible .icon--manicule,
    a:hover .sponsor-link__hand,
    a:focus-visible .sponsor-link__hand,
    a:hover img[src*="anicule"]:not(.smgli-hand img),
    a:focus-visible img[src*="anicule"]:not(.smgli-hand img) {
        translate: 8px 0;
    }

    .btn-manicule__rule,
    .cp27-manicule__rule,
    .gi27-manicule__rule,
    .link-manicule__rule {
        transform-origin: left center;
        transition: opacity .3s ease, background-color .2s ease;
    }

    .btn-manicule:hover .btn-manicule__rule,
    .btn-manicule:focus-visible .btn-manicule__rule,
    .cp27-manicule:hover .cp27-manicule__rule,
    .cp27-manicule:focus-visible .cp27-manicule__rule,
    .gi27-manicule:hover .gi27-manicule__rule,
    .gi27-manicule:focus-visible .gi27-manicule__rule,
    .link-manicule:hover .link-manicule__rule,
    .link-manicule:focus-visible .link-manicule__rule {
        animation: smgli-rule .45s cubic-bezier(.2, .7, .2, 1);
    }

    /* Links whose line is a border (Watch & Listen .wl27-manicule, Sponsor .sponsor-link--manicule):
       a second line in the same colour draws itself over the border from the left on hover. */
    .wl27-manicule,
    .sponsor-link--manicule {
        position: relative;
    }

    .wl27-manicule::after,
    .sponsor-link--manicule::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -2px;
        height: 2px;
        background: currentColor;
        scale: 0 1;
        transform-origin: left center;
        pointer-events: none;
    }

    .sponsor-link--manicule::after { bottom: -1px; height: 1px; }

    .wl27-manicule:hover::after,
    .wl27-manicule:focus-visible::after,
    .sponsor-link--manicule:hover::after,
    .sponsor-link--manicule:focus-visible::after {
        scale: 1 1;
        transition: scale .45s cubic-bezier(.2, .7, .2, 1);
    }

    /* 6. Cards: lift only when the card holds a link (a card that moves should be clickable).
       Cards inside horizontal carousels are left alone so the track never shows a scrollbar. */
    :is(.card, .pricing-card, .media-card, .hs-card, .hs-pricing__ac-card,
        .sup27-partner-card, .sup27-sponsor-card, .wl27-card, .hs-patron_tier, .hs-sponsor_pkg):not(.carousel__track *, .hs-keynotes__grid *) {
        transition: translate .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease, border-color .15s ease;
    }

    :is(.card, .pricing-card, .media-card, .hs-card, .hs-pricing__ac-card,
        .sup27-partner-card, .sup27-sponsor-card, .wl27-card, .hs-patron_tier, .hs-sponsor_pkg):not(.carousel__track *, .hs-keynotes__grid *):has(a):hover {
        translate: 0 -5px;
        box-shadow: 0 16px 36px rgba(31, 28, 23, .16);
    }

    /* v0.23: Patron tiers and Sponsor packages lift the same way (the list above). The theme
       moved Sponsor packages up 2px with its own transform, which would add to ours. */
    .page-template-template-support-sponsor .hs-sponsor_pkg:hover { transform: none; }

    /* Community Partners cards (v0.23): every card lifts a little, with or without a link, and
       its border takes the full colour of its category (--cat, set by the theme) */
    .cp27-cards .cp27-card {
        transition: translate .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease, border-color .2s ease;
    }

    .cp27-cards .cp27-card:hover,
    .cp27-cards .cp27-card:focus-within {
        translate: 0 -4px;
        box-shadow: 0 12px 28px rgba(31, 28, 23, .14);
        border-color: var(--cat, currentColor);
    }

    /* Keynote photos zoom inside their frame (the frame already clips them) */
    .keynote-card img,
    .hs-keynotes__photo {
        transition: scale .6s cubic-bezier(.2, .7, .2, 1);
    }

    .keynote-card:hover img,
    .hs-keynotes__card:hover .hs-keynotes__photo {
        scale: 1.06;
    }

    /* 7. Sections fade up as they enter the screen (classes set by motion.js, below the fold only) */
    .smgli-rv {
        transition: opacity .8s ease, translate .8s cubic-bezier(.2, .7, .2, 1);
    }

    .smgli-hide {
        opacity: 0;
        translate: 0 40px;
    }

    /* 8. FAQ accordion: answer slides open, the +/− turns as it changes */
    @keyframes smgli-open {
        from { opacity: 0; translate: 0 -4px; }
    }

    @keyframes smgli-spin {
        from { rotate: -90deg; }
    }

    .accordion__q { transition: color .15s ease; }
    .accordion__q:hover { color: var(--color-accent, #BA4A29); }

    .accordion__item.is-open .accordion__a { animation: smgli-open .3s ease-out; }
    .accordion__item.is-open .accordion__q::after { animation: smgli-spin .3s ease-out; }

    /* 8b. Open/close boxes built on <details> (home "Prize" categories, any other in the page):
       the box unfolds smoothly instead of snapping open, then its text and links arrive one
       after the other; it folds back smoothly too. The height animation needs Chrome/Edge 131+
       or Safari 26+; other browsers keep the instant opening with the fade-in. (v0.21) */
    @supports (interpolate-size: allow-keywords) {
        .site-main { interpolate-size: allow-keywords; }

        .site-main details::details-content {
            block-size: 0;
            overflow: clip;
            transition: block-size .55s cubic-bezier(.2, .7, .2, 1),
                        content-visibility .55s allow-discrete;
        }

        .site-main details[open]::details-content { block-size: auto; }
    }

    @keyframes smgli-panel-in {
        from { opacity: 0; translate: 0 -14px; }
    }

    .site-main details[open] > summary ~ * {
        animation: smgli-panel-in .5s cubic-bezier(.2, .7, .2, 1) both;
    }

    .site-main details[open] > summary ~ * > * {
        animation: smgli-fade-up .5s cubic-bezier(.2, .7, .2, 1) .12s both;
    }

    .site-main details[open] > summary ~ * > * + * { animation-delay: .24s; }

    .site-main details[open] .btn-manicule__rule {
        transform-origin: left;
        animation: smgli-rule .6s cubic-bezier(.2, .7, .2, 1) .45s both;
    }

    .hs-prize__cat-plus,
    .hs-prize__cat-more {
        transition: transform .4s cubic-bezier(.2, .7, .2, 1), rotate .4s cubic-bezier(.2, .7, .2, 1), opacity .3s ease;
    }

    /* 9. Stat counters: fixed-width digits so the number doesn't wobble while counting */
    .smgli-counting { font-variant-numeric: tabular-nums; }
}

/* ============================================================
   C. Manicule links, colour only (applies with or without motion):
      no second underline under the words, text and line turn clay on hover.
      Light links on dark bands turn ochre; clay links turn a darker clay.
   ============================================================ */
.btn-manicule__label,
.cp27-manicule__row {
    transition: color .2s ease;
}

.btn-manicule:hover,
.btn-manicule:focus-visible,
.cp27 .cp27-manicule:hover,
.cp27 .cp27-manicule:focus-visible {
    color: var(--clay, #BA4A29);
    text-decoration: none;
}

.btn-manicule:hover .btn-manicule__label,
.btn-manicule:focus-visible .btn-manicule__label,
.cp27 .cp27-manicule:hover .cp27-manicule__row,
.cp27 .cp27-manicule:focus-visible .cp27-manicule__row {
    color: inherit;
    text-decoration: none;
}

.btn-manicule:hover .btn-manicule__rule,
.btn-manicule:focus-visible .btn-manicule__rule {
    opacity: 1;
}

.btn-manicule--light:hover,
.btn-manicule--light:focus-visible {
    color: var(--ochre, #D68A1C);
}

.btn-manicule--clay:hover,
.btn-manicule--clay:focus-visible,
.cp27 .cp27-manicule--clay:hover,
.cp27 .cp27-manicule--clay:focus-visible {
    color: var(--clay-hover, #A03D20);
}

/* The hand itself takes the hover colour too. Hands drawn as an <img> can't be recoloured,
   so motion.js wraps each one in <span class="smgli-hand">; a copy of the same drawing,
   painted in the link's colour through a mask, fades in over it on hover.
   (Hands the theme already draws with a mask follow the colour by themselves.) */
.smgli-hand {
    position: relative;
    display: inline-block;
    flex: none;
    line-height: 0;
}

.smgli-hand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: currentColor;
    -webkit-mask: var(--smgli-hand) no-repeat center / contain;
    mask: var(--smgli-hand) no-repeat center / contain;
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}

.smgli-hand img { transition: opacity .2s ease; }

a:hover .smgli-hand::after,
a:focus-visible .smgli-hand::after { opacity: 1; }

a:hover .smgli-hand img,
a:focus-visible .smgli-hand img { opacity: 0; }

/* Conference site: the thin line under a manicule link (55% opacity in the theme) goes to full
   strength on hover, like the Institute lines (v0.26) */
.link-manicule:hover .link-manicule__rule,
.link-manicule:focus-visible .link-manicule__rule {
    opacity: 1;
}

/* Get Involved page links work like the Community Partners ones */
.gi27 .gi27-manicule:hover,
.gi27 .gi27-manicule:focus-visible {
    color: var(--clay, #BA4A29);
    text-decoration: none;
}

.gi27 .gi27-manicule:hover .gi27-manicule__row,
.gi27 .gi27-manicule:focus-visible .gi27-manicule__row {
    color: inherit;
    text-decoration: none;
}

/* Printing or saving as PDF always shows everything */
@media print {
    .smgli-hide,
    .smgli-wait {
        opacity: 1 !important;
        translate: none !important;
    }
}

/* ============================================================
   D. Theme fix, applies with or without motion (v0.23)
   Patron page "Join at this level" / "Donate any amount": the theme's site.css hover rule uses
   the `background:` shorthand, which resets the underline drawing to its natural size and
   repeats it. The 189×2px line then tiled into a full clay box over the words. This puts the
   underline back to one 2px line. Belongs in the theme's patron.css in the long run.
   ============================================================ */
.page-template-template-support-patron .hs-patron_tier__paybtn:hover,
.page-template-template-support-patron .hs-patron_tier__paybtn:focus-visible {
    background-size: 100% 2px;
    background-repeat: no-repeat;
    background-position: left bottom 1px;
}

/* the same shorthand also removed the underline of every tier except "Donor" on hover */
.page-template-template-support-patron .hs-patron_tier__paybtn:not(.patron-pay--donor):hover,
.page-template-template-support-patron .hs-patron_tier__paybtn:not(.patron-pay--donor):focus-visible {
    background-image: url("/wp-content/themes/institute-theme/assets/img/patron/Patron-Tiers-Underline.svg");
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes smgli-underline {
        from { background-size: 0% 2px; }
    }

    .page-template-template-support-patron .hs-patron_tier__paybtn:hover {
        animation: smgli-underline .45s cubic-bezier(.2, .7, .2, 1);
    }
}

/* Section background pieces lifted into real pictures by motion.js (v0.25): a layer behind the
   section's content, clipped like the background was */
.smgli-bglayer {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.smgli-bglayer .smgli-bgpiece {
    position: absolute;
    max-width: none;
    margin: 0;
}

/* ============================================================
   C. Home carousels: pause button and dots (v0.28.5, accessibility)
   WCAG 2.2.2 Pause, Stop, Hide: the keynote cards and the testimonials move on their own every
   3 s, so each gets a pause / play button (added by motion.js next to the dots).
   WCAG 2.5.8 Target size: the 8px dots get an invisible 24px click area and 24px between
   centres. WCAG 1.4.11 Non-text contrast: the empty dots' outlines reach 3:1 on the paper.
   ============================================================ */
.smgli-carousel-ctrl {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .875rem;
}
.home .hs-keynotes .smgli-carousel-ctrl { margin-top: clamp(2rem, 5vw, 3rem); }
.home .hs-voices .smgli-carousel-ctrl { margin-top: .5rem; }
.smgli-carousel-ctrl > .hs-keynotes__dots,
.smgli-carousel-ctrl > .hs-voices__dots { margin-top: 0; }

.home .hs-keynotes__dots,
.home .hs-voices__dots { gap: 1rem; }
.home .hs-keynotes__dot,
.home .hs-voices__dot { position: relative; }
.home .hs-keynotes__dot::after,
.home .hs-voices__dot::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
}
.home .hs-keynotes__dot:not(.is-active) { border-color: color-mix(in srgb, var(--charcoal, #2b2621) 62%, transparent); }
.home .hs-voices__dot:not(.is-active) { opacity: 1; }
.home .hs-keynotes__dot:focus-visible {
    outline: 2px solid var(--plum, #47141f);
    outline-offset: 4px;
}

.smgli-pause {
    appearance: none;
    flex: none;
    position: relative;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--clay, #ba4a29);
    border-radius: 50%;
    background: transparent;
    color: var(--clay, #ba4a29);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.smgli-pause[hidden] { display: none; }
/* pause icon: two bars */
.smgli-pause::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 10px;
    translate: -50% -50%;
    background: linear-gradient(to right, currentColor 0 3px, transparent 3px 5px, currentColor 5px 8px);
}
/* play icon once paused: a triangle */
.smgli-pause.is-paused::before {
    width: 0;
    height: 0;
    translate: -35% -50%;
    background: none;
    border-style: solid;
    border-width: 5.5px 0 5.5px 9px;
    border-color: transparent transparent transparent currentColor;
}
.smgli-pause:hover {
    background: var(--clay, #ba4a29);
    color: #fbfaf7;
}
.smgli-pause:focus-visible {
    outline: 2px solid var(--plum, #47141f);
    outline-offset: 3px;
}
/* Windows high contrast: keep the drawn icon visible */
@media (forced-colors: active) {
    .smgli-pause::before { forced-color-adjust: none; color: ButtonText; }
    .smgli-pause.is-paused::before { border-left-color: ButtonText; }
    .smgli-pause:not(.is-paused)::before { background: linear-gradient(to right, ButtonText 0 3px, transparent 3px 5px, ButtonText 5px 8px); }
}
