/* Shared response to actions across the portal and the game navigation. */
:is(.element-unified, .element-game) {
    --element-action-in: 150ms;
    --element-action-out: 120ms;
    --element-action-press: 90ms;
    --element-action-ease: cubic-bezier(.2, .8, .2, 1);
}

.element-unified #content a.text-link {
    text-decoration-thickness: 1px;
    text-underline-offset: .24em;
}

.element-unified #content a.text-link:is(:hover, :focus-visible) { text-decoration-line: underline; }

@media screen and (prefers-reduced-motion: no-preference) {
    .element-unified[data-element-enter].page-home #content .unified-home-intro {
        animation: element-home-arrive 360ms cubic-bezier(.22, 1, .36, 1) both;
    }

    @keyframes element-home-arrive {
        from { translate: 0 5px; }
        to { translate: 0; }
    }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .element-unified #content :is(a.button, button.button):not(:disabled, [aria-disabled='true']),
    .element-game .topbar :is(a, button).icon-button {
        transition: color var(--element-action-out) var(--element-action-ease),
            background-color var(--element-action-out) var(--element-action-ease),
            border-color var(--element-action-out) var(--element-action-ease),
            translate var(--element-action-out) var(--element-action-ease);
    }

    .element-unified #content :is(a.button, button.button):not(:disabled, [aria-disabled='true']):hover,
    .element-game .topbar :is(a, button).icon-button:hover {
        translate: 0 -1px;
        transition-duration: var(--element-action-in);
    }

    .element-unified #content :is(a.button, button.button):not(:disabled, [aria-disabled='true']):active,
    .element-game .topbar :is(a, button).icon-button:active {
        translate: 0 1px;
        transition-duration: var(--element-action-press);
    }

    .element-unified #content :is(.unified-home-topic > summary, .unified-home-tools a, .unified-home-headlines a) {
        transition: color var(--element-action-out) ease-out, background-color var(--element-action-out) ease-out;
    }
}
