@media (prefers-reduced-motion: no-preference) {
    /* starfield behind the hero */
    #title { position: relative; }
    #title > * { position: relative; z-index: 1; }
    #starfield { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

    /* cross-document page fade (no SPA router) */
    @view-transition { navigation: auto; }
    ::view-transition-old(root) { animation: vt-fade .18s ease-out; }
    ::view-transition-new(root) { animation: vt-fade .18s ease-in reverse; }
    @keyframes vt-fade { from { opacity: 1; } to { opacity: 0; } }

    /* boot-up overlay (home, once per tab, fresh navigations only; SSR'd, shown only under html.booting) */
    html.booting #hud-boot {
        align-items: center; justify-content: center;
        animation: hud-boot-out .5s ease .95s forwards;
    }
    html.booting #hud-boot::before {
        content: ""; position: absolute; left: 0; right: 0; top: -4px; height: 3px;
        background: #ff7100; box-shadow: 0 0 18px 3px rgba(255, 113, 0, .8);
        animation: hud-scan .9s linear forwards;
    }
    html.booting #hud-boot .hud-boot-txt {
        font-family: "Orbitron", sans-serif; font-size: .85rem; letter-spacing: .3em;
        color: #ff7100; text-transform: uppercase;
        animation: hud-blink .9s steps(2, start) infinite;
    }
    @keyframes hud-scan { to { top: 100%; } }
    @keyframes hud-blink { 50% { opacity: .15; } }
    @keyframes hud-boot-out { to { opacity: 0; visibility: hidden; } }

    /* hero typewriter on first boot */
    .head h1.head.type-reveal, h1.head.type-reveal {
        clip-path: inset(0 100% 0 0);
        animation: type-reveal 1.1s steps(28, end) .55s forwards;
    }
    @keyframes type-reveal { to { clip-path: inset(0 0 0 0); } }
    /* on mobile the h1 sits below the hero image — the delayed clip
       reads as an empty band, so show it immediately there */
    @media (max-width: 991.98px) {
        .head h1.head.type-reveal, h1.head.type-reveal { clip-path: none; animation: none; }
    }

    /* hover lift + glow */
    .hud-frame, .card, .news-card, .news-feature, .event-card, .ship-tile, .gallery-tile, .guide-card {
        transition: transform .18s ease, box-shadow .18s ease;
    }
    .hud-frame:hover, .card:hover, .news-card:hover, .news-feature:hover, .event-card:hover,
    .ship-tile:hover, .gallery-tile:hover, .guide-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 0 22px rgba(255, 113, 0, .45);
    }

    /* scroll reveal (JS-enabled only; CSS-only users unaffected) */
    html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
    html.js .reveal.is-visible { opacity: 1; transform: none; }
}

/* reading progress bar (no animation needed to honour it, but keep inside no-preference for consistency) */
#read-bar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1500;
    background: #ff7100; box-shadow: 0 0 10px rgba(255, 113, 0, .7);
}
