/* =====================================================================
   SCROLL ANIMATIONS  (assets/reveal.css)
   Elements are tagged automatically by reveal.js – no HTML changes needed.
   ===================================================================== */

/* ---------- scroll reveal ---------- */
.rv { opacity: 0 }

.rv.in {
    animation: rv-up .85s cubic-bezier(.22, .8, .26, 1) both;
    animation-delay: var(--rv-d, 0ms);
}
.rv[data-rv="left"].in  { animation-name: rv-left }
.rv[data-rv="right"].in { animation-name: rv-right }
.rv[data-rv="zoom"].in  { animation-name: rv-zoom }

@keyframes rv-up    { from { opacity: 0; translate: 0 38px }   to { opacity: 1; translate: 0 0 } }
@keyframes rv-left  { from { opacity: 0; translate: -56px 0 }  to { opacity: 1; translate: 0 0 } }
@keyframes rv-right { from { opacity: 0; translate: 56px 0 }   to { opacity: 1; translate: 0 0 } }
@keyframes rv-zoom  { from { opacity: 0; scale: .9 }           to { opacity: 1; scale: 1 } }

/* ---------- reading-progress bar (top of page) ---------- */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--gold));
    transform: scaleX(0);
    transform-origin: 0 50%;
    z-index: 100;
    pointer-events: none;
}

/* ---------- header gets a soft shadow once the page scrolls ---------- */
header { transition: box-shadow .3s ease, background-color .3s ease }
header.scrolled { box-shadow: 0 8px 24px rgba(18, 38, 63, .14) }

/* ---------- back-to-top button ---------- */
.to-top {
    position: fixed;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    width: 46px; height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    translate: 0 14px;
    transition: opacity .3s, translate .3s, visibility .3s, background-color .2s;
    z-index: 50;
}
.to-top.show { opacity: 1; visibility: hidden; translate: 0 0 }
.to-top:hover { background: var(--blue) }
.to-top::before {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 11px; height: 11px;
    border-left: 3px solid #fff;
    border-top: 3px solid #fff;
    transform: translate(-50%, -30%) rotate(45deg);
}

/* ---------- respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
    .rv { opacity: 1 !important; animation: none !important }
    .to-top, header { transition: none }
}
