/*
 * Scroll-driven journey timeline
 *
 * Route geometry and animation timing are tuned in journey.js. This file keeps
 * the path weight, traveler bloom, and milestone silhouette in one visual layer.
 */
:root {
    /* Electric-blue palette and line treatment. */
    --journey-track-color: rgba(105, 169, 255, 0.18);
    --journey-glow-color: rgba(50, 190, 255, 0.16);
    --journey-line-color: #79e6ff;
    --journey-hot-color: #e4fbff;
    --journey-deep-color: #238dff;
    --journey-marker-fill: rgba(7, 20, 39, 0.94);
    --journey-marker-complete-fill: rgba(20, 61, 98, 0.96);

    --journey-track-width: 1.35px;
    --journey-line-width: 2.35px;
    --journey-line-glow-width: 8px;
    --journey-bloom-radius: 28px;
    --journey-halo-radius: 10px;
    --journey-core-radius: 3.75px;

}

/* Keep the background, route, content, marker controls, and header in order. */
body {
    isolation: isolate;
}

.journey-visual,
.journey-milestones {
    position: absolute;
    inset: 0;
    width: 100%;
    overflow: hidden;
}

.journey-visual {
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    contain: paint;
    transition: opacity 280ms ease;
}

.journey-visual.is-ready {
    opacity: 1;
}

.journey-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    shape-rendering: geometricPrecision;
}

.journey-path-track,
.journey-path-complete-glow,
.journey-path-complete {
    fill: none;
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.journey-path-track {
    stroke: var(--journey-track-color);
    stroke-width: var(--journey-track-width);
}

.journey-path-complete-glow {
    stroke: var(--journey-glow-color);
    stroke-width: var(--journey-line-glow-width);
    will-change: stroke-dashoffset;
}

.journey-path-complete {
    stroke: var(--journey-line-color);
    stroke-width: var(--journey-line-width);
    will-change: stroke-dashoffset;
}

/* The bloom is intentionally confined to the small traveler, not the full path. */
.journey-traveler {
    pointer-events: none;
    will-change: transform;
}

.journey-traveler-bloom,
.journey-traveler-halo,
.journey-traveler-core {
    vector-effect: non-scaling-stroke;
    transform-box: fill-box;
    transform-origin: center;
}

.journey-traveler-bloom {
    r: var(--journey-bloom-radius);
    fill: url(#journey-bloom) var(--journey-deep-color);
    opacity: 0.25;
    filter: blur(10px);
}

.journey-traveler-halo {
    r: var(--journey-halo-radius);
    fill: rgba(121, 230, 255, 0.22);
    stroke: rgba(121, 230, 255, 0.82);
    stroke-width: 1px;
    filter: drop-shadow(0 0 7px rgba(66, 191, 255, 0.92));
}

.journey-traveler-core {
    r: var(--journey-core-radius);
    fill: var(--journey-hot-color);
    stroke: #ffffff;
    stroke-width: 0.75px;
    filter: drop-shadow(0 0 4px #ffffff) drop-shadow(0 0 8px var(--journey-line-color));
}

/*
 * Marker navigation sits above page content, but only the 48px anchors receive
 * pointer input. JS positions each marker by assigning its left and top values.
 */
.journey-milestones {
    z-index: 10;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity 220ms ease, visibility 0s linear 220ms;
}

.journey-milestones.is-ready {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.journey-marker {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 48px;
    height: 48px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(185, 216, 255, 0.82);
    pointer-events: auto;
    touch-action: manipulation;
    transform: translate(-50%, -50%);
    -webkit-tap-highlight-color: transparent;
}

.journey-marker-core {
    position: relative;
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border: 1px solid rgba(121, 230, 255, 0.5);
    border-radius: 50%;
    background: var(--journey-marker-fill);
    box-shadow: 0 0 0 1px rgba(35, 141, 255, 0.06);
    font-family: "DM Mono", monospace;
    font-size: 0.58rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.02em;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease,
        color 180ms ease, box-shadow 180ms ease;
}

.journey-marker-core::before {
    content: "";
    position: absolute;
    inset: -2px;
    border: 1px solid var(--journey-line-color);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
}

.journey-marker.is-complete {
    color: var(--journey-hot-color);
}

.journey-marker.is-complete .journey-marker-core {
    border-color: var(--journey-line-color);
    background: var(--journey-marker-complete-fill);
    box-shadow: 0 0 9px rgba(66, 191, 255, 0.42), inset 0 0 10px rgba(121, 230, 255, 0.12);
}

.journey-marker.is-active .journey-marker-core,
.journey-marker[aria-current="step"] .journey-marker-core {
    color: #ffffff;
    border-color: var(--journey-hot-color);
    transform: scale(1.12);
    box-shadow: 0 0 12px rgba(121, 230, 255, 0.72), 0 0 26px rgba(35, 141, 255, 0.44);
}

.journey-marker.is-active .journey-marker-core::before {
    animation: journey-marker-arrival 760ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

@media (hover: hover) {
    .journey-marker:not(.is-active):hover .journey-marker-core {
        color: #ffffff;
        border-color: var(--journey-hot-color);
        transform: scale(1.08);
        box-shadow: 0 0 12px rgba(66, 191, 255, 0.55);
    }
}

.journey-marker:focus-visible {
    outline: none;
}

.journey-marker:focus-visible .journey-marker-core {
    border-color: var(--journey-hot-color);
    box-shadow: 0 0 0 3px var(--void), 0 0 0 5px var(--journey-hot-color),
        0 0 18px rgba(66, 191, 255, 0.7);
}

/* Keep anchor destinations clear of the sticky desktop and mobile headers. */
main section[id] {
    scroll-margin-top: 92px;
}

@keyframes journey-marker-arrival {
    0% {
        opacity: 0.9;
        transform: scale(0.82);
    }
    100% {
        opacity: 0;
        transform: scale(1.9);
    }
}

@media (max-width: 900px) {
    :root {
        --journey-track-width: 1.2px;
        --journey-line-width: 2px;
        --journey-line-glow-width: 7px;
        --journey-bloom-radius: 24px;
        --journey-halo-radius: 9px;
    }

    .journey-marker-core {
        width: 29px;
        height: 29px;
        font-size: 0.55rem;
    }

    main section[id] {
        scroll-margin-top: 76px;
    }
}

@media (max-width: 560px) {
    :root {
        /* JS narrows the route on phones; these values reduce its visual footprint. */
        --journey-track-width: 1px;
        --journey-line-width: 1.75px;
        --journey-line-glow-width: 6px;
        --journey-bloom-radius: 20px;
        --journey-halo-radius: 8px;
        --journey-core-radius: 3.25px;
    }

    .journey-marker-core {
        width: 27px;
        height: 27px;
        font-size: 0.52rem;
    }
}

/* Static fallback: show the complete route and remove all continuous motion. */
body.journey-reduced .journey-visual,
body.journey-reduced .journey-milestones {
    transition: none;
}

body.journey-reduced .journey-path-complete-glow,
body.journey-reduced .journey-path-complete {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
}

body.journey-reduced .journey-traveler {
    display: none;
}

body.journey-reduced .journey-marker-core {
    transition: none;
}

body.journey-reduced .journey-marker.is-active .journey-marker-core::before {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    .journey-visual,
    .journey-milestones,
    .journey-marker-core {
        transition: none;
    }

    .journey-path-complete-glow,
    .journey-path-complete {
        stroke-dasharray: none !important;
        stroke-dashoffset: 0 !important;
    }

    .journey-traveler {
        display: none;
    }

    .journey-marker.is-active .journey-marker-core::before {
        animation: none;
    }
}
