/**
 * Premium scroll + hover polish for the public marketing site and tracking UI.
 * Scoped with :not(.ivl-vault-user-shell) so vault client dashboards are unchanged.
 * Loaded after public-marketing-home.css. Structure/HTML unchanged.
 */

html.ivl-pub-home-root:not(:has(body.ivl-vault-user-shell)) {
    --ivl-scrollbar-thumb: rgba(77, 20, 140, 0.32);
    --ivl-scrollbar-thumb-hover: rgba(77, 20, 140, 0.5);
    --ivl-scrollbar-thumb-active: rgba(77, 20, 140, 0.62);
}

/* Client dashboard uses homepage masthead; match homepage scrollbar thumb tokens */
html.ivl-pub-home-root:has(body.ivl-vdash-index-masthead) {
    --ivl-scrollbar-thumb: rgba(77, 20, 140, 0.32);
    --ivl-scrollbar-thumb-hover: rgba(77, 20, 140, 0.5);
    --ivl-scrollbar-thumb-active: rgba(77, 20, 140, 0.62);
}

/* ── Motion tokens & accessibility ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) {
    --ivl-motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ivl-motion-ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
    --ivl-motion-duration: 0.5s;
    --ivl-shadow-lift: 0 20px 48px rgba(77, 20, 140, 0.1);
    --ivl-shadow-lift-navy: 0 18px 44px rgba(77, 20, 140, 0.14);
}

body.ivl-pub-home.ivl-vdash-index-masthead {
    --ivl-motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ivl-motion-ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
    --ivl-motion-duration: 0.5s;
    --ivl-shadow-lift: 0 20px 48px rgba(77, 20, 140, 0.1);
    --ivl-shadow-lift-navy: 0 18px 44px rgba(77, 20, 140, 0.14);
}

@media (prefers-reduced-motion: reduce) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-subpage-hero--image .ivl-pub-subpage-hero__bg {
        animation: none !important;
    }
}

/* Tracking page: keep flat white shell (override ambient body gradient below) */
body.ivl-pub-home.ivl-tracking-ui-page:not(.ivl-vault-user-shell) {
    background: #fff;
}

/* ── Page background (marketing only; flat, no gradients) ── */
body.ivl-pub-home:not(.ivl-vault-user-shell):not(.ivl-tracking-ui-page) {
    background: #f5f7fa;
}

/* ── Sticky header: glass + soft edge ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-header-shell {
    backdrop-filter: saturate(1.35) blur(14px);
    -webkit-backdrop-filter: saturate(1.35) blur(14px);
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(77, 20, 140, 0.07);
    box-shadow: 0 4px 24px rgba(77, 20, 140, 0.045);
}

/*
 * Vault client dashboard: clone homepage sticky header (same border + shadow).
 * Portal uses dark .ivl-vault-portal-bg — frosted blur would tint purple; solid white matches the clean homepage bar.
 */
body.ivl-pub-home.ivl-vdash-index-masthead .ivl-pub-header-shell {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(77, 20, 140, 0.07);
    box-shadow: 0 4px 24px rgba(77, 20, 140, 0.045);
}

/* ── Scroll reveal (overrides base .reveal timing) ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .reveal {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition:
        opacity 0.85s var(--ivl-motion-ease),
        transform 0.85s var(--ivl-motion-ease);
    will-change: opacity, transform;
}

body.ivl-pub-home:not(.ivl-vault-user-shell) .reveal.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

/* ── Hero image: slow, subtle Ken Burns (subpages) ── */
@media (prefers-reduced-motion: no-preference) {
    @keyframes ivl-premium-hero-drift {
        0%,
        100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.035);
        }
    }

    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-subpage-hero--image .ivl-pub-subpage-hero__bg {
        animation: ivl-premium-hero-drift 28s ease-in-out infinite;
        transform-origin: center center;
    }
}

/* ── Hero split: card + CTA refinement ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-hero-split__card {
    transition:
        box-shadow 0.45s var(--ivl-motion-ease-soft),
        transform 0.45s var(--ivl-motion-ease-soft);
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-hero-split__card:hover {
        box-shadow:
            0 28px 64px rgba(0, 0, 0, 0.42),
            0 2px 0 rgba(255, 255, 255, 0.08) inset;
    }
}

body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-hero-split__cta-ghost {
    transition:
        background 0.3s var(--ivl-motion-ease-soft),
        color 0.3s var(--ivl-motion-ease-soft),
        border-color 0.3s ease,
        transform 0.3s var(--ivl-motion-ease-soft),
        box-shadow 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-hero-split__cta-ghost:hover {
        background: rgba(255, 102, 0, 0.16);
        border-color: rgba(255, 179, 128, 0.98);
        transform: translateY(-1px);
        box-shadow:
            0 8px 24px rgba(0, 0, 0, 0.15),
            0 0 0 1px rgba(255, 102, 0, 0.35);
    }
}

body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-hero-split__feedback {
    transition:
        background 0.3s ease,
        padding 0.3s var(--ivl-motion-ease-soft),
        letter-spacing 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-hero-split__feedback:hover {
        letter-spacing: 0.1em;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* ── Track strip & quick tiles ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-track-strip__shortcut {
    transition:
        transform 0.35s var(--ivl-motion-ease),
        box-shadow 0.35s ease,
        border-color 0.25s ease,
        background 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-track-strip__shortcut:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 32px rgba(77, 20, 140, 0.12);
    }
}

body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-track-strip__submit {
    transition:
        transform 0.25s var(--ivl-motion-ease-soft),
        filter 0.25s ease,
        box-shadow 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-track-strip__submit:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(43, 92, 171, 0.35);
    }
}

/* ── Z-blocks: lift + image zoom ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-zblock {
    transition:
        transform 0.45s var(--ivl-motion-ease-soft),
        box-shadow 0.45s var(--ivl-motion-ease-soft),
        border-color 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-zblock:hover {
        transform: translateY(-4px);
        box-shadow: var(--ivl-shadow-lift);
        border-color: rgba(77, 20, 140, 0.14);
    }
}

body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-zblock__media img {
    transition: transform 0.75s var(--ivl-motion-ease);
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-zblock:hover .ivl-pub-zblock__media img {
        transform: scale(1.045);
    }
}

body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-zblock__btn {
    transition:
        transform 0.3s var(--ivl-motion-ease-soft),
        filter 0.25s ease,
        box-shadow 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-zblock__btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 22px rgba(77, 20, 140, 0.22);
        filter: brightness(1.06);
    }
}

/* ── Panels & inner cards ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-panel {
    transition:
        transform 0.4s var(--ivl-motion-ease-soft),
        box-shadow 0.4s var(--ivl-motion-ease-soft),
        border-color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-panel:hover {
        transform: translateY(-2px);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.95) inset,
            0 16px 40px rgba(26, 39, 68, 0.09);
        border-color: rgba(77, 20, 140, 0.12);
    }

    /* Forms / split layouts: keep steady (no lift) */
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-contact-split .ivl-pub-panel:hover,
    body.ivl-pub-home:not(.ivl-vault-user-shell) form .ivl-pub-panel:hover {
        transform: none;
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.9) inset,
            0 8px 24px rgba(26, 39, 68, 0.06);
        border-color: #c5d4e8;
    }
}

/* ── Buttons (primary / ghost) ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-btn {
    transition:
        transform 0.3s var(--ivl-motion-ease-soft),
        box-shadow 0.3s ease,
        filter 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-btn--primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 28px rgba(43, 92, 171, 0.35);
        filter: brightness(1.04);
    }

    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-btn--ghost:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(77, 20, 140, 0.06);
    }
}

/* ── Prose links: underline draw ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-prose a {
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition:
        color 0.25s ease,
        background-size 0.35s var(--ivl-motion-ease);
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-prose a:hover {
        background-size: 100% 2px;
    }
}

/* ── Subpage hero (solid gradient): depth ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-subpage-hero:not(.ivl-pub-subpage-hero--image) {
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-subpage-hero h1 {
    text-shadow: 0 2px 28px rgba(0, 0, 0, 0.18);
}

/* ── Infobanner / alert strip ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-infobanner,
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-alertstrip {
    transition: box-shadow 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-infobanner:hover,
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-alertstrip:hover {
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
    }
}

/* ── Stats strip ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-stats__label {
    transition: color 0.3s ease;
}

body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-stats .count {
    transition: transform 0.35s var(--ivl-motion-ease);
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-stats__grid > div:hover .count {
        transform: scale(1.03);
    }

    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-stats__grid > div:hover .ivl-pub-stats__label {
        color: rgba(255, 255, 255, 0.95);
    }
}

/* ── Minibanner CTA ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-minibanner__btn {
    transition:
        transform 0.3s var(--ivl-motion-ease-soft),
        box-shadow 0.3s ease,
        filter 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-minibanner__btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
    }
}

/* ── News / updates cards ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-updates__card {
    transition:
        transform 0.4s var(--ivl-motion-ease-soft),
        box-shadow 0.4s ease,
        border-color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-updates__card:hover {
        transform: translateY(-3px);
        box-shadow: var(--ivl-shadow-lift);
        border-color: rgba(77, 20, 140, 0.1);
    }

    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-updates__card a:hover {
        text-decoration-thickness: 2px;
    }
}

/* ── Carousel ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-carousel__arrow {
    transition:
        transform 0.3s var(--ivl-motion-ease-soft),
        opacity 0.25s ease,
        background 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-carousel__arrow:hover {
        transform: scale(1.08);
    }
}

body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-carousel__slide {
    transition: transform 0.5s var(--ivl-motion-ease);
}

/* ── Map embeds ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-map-frame {
    transition:
        box-shadow 0.45s ease,
        border-radius 0.35s ease;
    border-radius: 4px;
    overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-map-frame:hover {
        box-shadow: 0 16px 40px rgba(77, 20, 140, 0.12);
    }
}

/* ── Footer ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-footer__soc {
    transition:
        transform 0.3s var(--ivl-motion-ease-soft),
        background 0.25s ease,
        color 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-footer__soc:hover {
        transform: translateY(-3px) scale(1.06);
    }
}

body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-footer a {
    transition:
        color 0.25s ease,
        text-underline-offset 0.25s ease;
}

/* ── Nav dropdown links ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-dropdown__link {
    transition:
        background 0.22s ease,
        padding-left 0.28s var(--ivl-motion-ease-soft),
        color 0.2s ease;
}

/* ── Featured / service links on home ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-featured__link {
    transition:
        transform 0.35s var(--ivl-motion-ease-soft),
        color 0.25s ease,
        gap 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-featured__link:hover {
        transform: translateX(4px);
    }
}

/* ── Tracking page: promo + panels (uses same body class) ── */
body.ivl-pub-home.ivl-tracking-ui-page:not(.ivl-vault-user-shell) .ivl-tracking-promo {
    transition:
        box-shadow 0.4s var(--ivl-motion-ease-soft),
        transform 0.4s var(--ivl-motion-ease-soft);
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-pub-home.ivl-tracking-ui-page:not(.ivl-vault-user-shell) .ivl-tracking-promo:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 36px rgba(77, 20, 140, 0.12);
    }
}

/* ── Keyboard focus (premium, visible rings) ── */
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-btn:focus-visible {
    outline: 2px solid var(--ivl-fedex-orange, #ff6600);
    outline-offset: 3px;
}

body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-masthead__nav a:focus-visible,
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-dropdown__link:focus-visible,
body.ivl-pub-home:not(.ivl-vault-user-shell) .ivl-pub-footer a:focus-visible {
    outline: 2px solid var(--ivl-fedex-orange, #ff6600);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Standalone auth cards (2FA / password reset): match public polish, no dashboard chrome ── */
body.ivl-vault-twofa-theme:not(.ivl-vault-user-shell) .ivl-twofa-ui-card {
    transition:
        box-shadow 0.45s var(--ivl-motion-ease-soft, cubic-bezier(0.4, 0, 0.2, 1)),
        transform 0.45s var(--ivl-motion-ease-soft, cubic-bezier(0.4, 0, 0.2, 1)),
        border-color 0.3s ease;
}

body.ivl-vault-twofa-theme:not(.ivl-vault-user-shell) .ivl-twofa-ui-submit {
    transition:
        transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.28s ease,
        filter 0.22s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.ivl-vault-twofa-theme:not(.ivl-vault-user-shell) .ivl-twofa-ui-card:hover {
        transform: translateY(-3px);
        box-shadow:
            0 28px 56px rgba(77, 20, 140, 0.14),
            0 0 0 1px rgba(255, 255, 255, 0.85) inset;
        border-color: rgba(77, 20, 140, 0.18);
    }

    body.ivl-vault-twofa-theme:not(.ivl-vault-user-shell) .ivl-twofa-ui-submit:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 26px rgba(227, 24, 55, 0.28);
        filter: brightness(1.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ivl-vault-twofa-theme:not(.ivl-vault-user-shell) .ivl-twofa-ui-card,
    body.ivl-vault-twofa-theme:not(.ivl-vault-user-shell) .ivl-twofa-ui-submit {
        transition: none !important;
    }

    body.ivl-vault-twofa-theme:not(.ivl-vault-user-shell) .ivl-twofa-ui-card:hover,
    body.ivl-vault-twofa-theme:not(.ivl-vault-user-shell) .ivl-twofa-ui-submit:hover {
        transform: none !important;
    }
}
