/* ==========================================================
   ROADMAP — component stylesheet
   Consolidates all roadmap styles. Loaded on the director pages.
   ========================================================== */

.rm {
    position: relative;
    overflow: hidden;
    background: #111;
    padding: clamp(38px, 4.5vw, 64px) 0 clamp(42px, 5vw, 72px);
}

.rm.is-detail {
    padding: clamp(30px, 3.6vw, 46px) 0 clamp(34px, 4.2vw, 56px);
}

.rm__container {
    width: min(var(--container-w, 1200px), calc(100% - var(--side-gutter, 25px) - var(--side-gutter, 25px)));
    margin: 0 auto;
    position: relative;
    min-height: 320px;
    isolation: isolate;
    scroll-margin-top: calc(var(--nav-h, 80px) + 24px);
}

/* ==========================================================
   SECTION INTRO
   ========================================================== */

.rm__intro {
    width: min(var(--container-w, 1200px), calc(100% - var(--side-gutter, 25px) - var(--side-gutter, 25px)));
    max-width: 1200px;
    max-height: 300px;
    margin: 0 auto clamp(18px, 2.2vw, 30px);
    text-align: center;
    overflow: hidden;
    transition:
        opacity .4s var(--cubic),
        transform .55s var(--cubic),
        filter .4s var(--cubic),
        max-height .7s var(--cubic),
        margin .7s var(--cubic);
}

.rm__intro-kicker {
    display: block;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, .48);
    font-family: var(--satoshi, "Satoshi", sans-serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.rm__intro-title {
    margin: 0;
    color: white;
    font-family: var(--pt-serif, "PT Serif", serif);
    font-size: clamp(36px, 5.4vw, 78px);
    font-weight: 400;
    line-height: .96;
    letter-spacing: 0;
}

.rm__intro-text {
    width: min(560px, 100%);
    margin: 18px auto 0;
    color: rgba(255, 255, 255, .62);
    font-family: var(--satoshi, "Satoshi", sans-serif);
    font-size: clamp(16px, 1.4vw, 19px);
    line-height: 1.75;
}

.rm.is-detail .rm__intro {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(-18px) scale(.98);
    filter: blur(8px);
    pointer-events: none;
}

/* During a desktop pose morph the progress line / gps dot are hidden,
   so stale coordinates never show while the road is being re-shaped. */
.rm.is-morphing .rm-road-progress,
.rm.is-morphing .rm-gps-marker {
    opacity: 0;
}

.rm.is-pre .rm__intro {
    opacity: 0;
    transform: translateY(22px);
}

.rm.is-revealed .rm__intro {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================
   TIMELINE
   ========================================================== */

.rm__timeline {
    position: relative;
    width: 100%;
    height: clamp(260px, 28vw, 320px);
    overflow: visible;
    z-index: 1;
    scroll-margin-top: calc(var(--nav-h, 80px) + 24px);
}

.rm__svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    will-change: height;
}

/* ==========================================================
   CONTENT PANEL
   Two-column composition on desktop: content left, road right.
   ========================================================== */

.rm__panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 56%;
    min-width: 0;
    z-index: 3;
    scroll-margin-top: calc(var(--nav-h, 80px) + 24px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: clamp(10px, 1.2vh, 18px);
    padding-right: clamp(18px, 2.6vw, 44px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    filter: blur(6px);
    transition:
        opacity .34s var(--cubic),
        transform .5s var(--cubic),
        filter .34s var(--cubic),
        visibility .34s step-end;
}

.rm.is-detail .rm__panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    filter: blur(0);
    transition:
        opacity .34s var(--cubic),
        transform .5s var(--cubic),
        filter .34s var(--cubic),
        visibility 0s;
}

.rm.is-closing .rm__panel {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    filter: blur(6px);
}

.rm__year {
    font-family: var(--pt-serif, "PT Serif", serif);
    font-size: clamp(38px, 6.4vh + 1vw, 96px);
    line-height: .9;
    color: var(--white, #fff);
    margin-bottom: 6px;
}

.rm__title {
    font-family: var(--pt-serif, "PT Serif", serif);
    font-size: clamp(21px, 2.1vh + 1.1vw, 44px);
    font-weight: 400;
    line-height: 1.12;
    color: var(--white, #fff);
    max-width: 100%;
}

.rm__description {
    width: 100%;
    color: rgba(255, 255, 255, .65);
    font-family: var(--satoshi, "Satoshi", sans-serif);
    font-size: clamp(14px, 1.05vh + .45vw, 17px);
    line-height: 1.72;
}

.rm__media {
    width: 100%;
}

.rm__media-placeholder {
    width: min(430px, 100%);
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .025)),
        #080808;
    display: grid;
    place-items: center;
    overflow: hidden;
    position: relative;
    transition:
        border-color .35s var(--cubic),
        background .45s var(--cubic);
}

.rm__media-placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 0%,
        rgba(255, 255, 255, .045) 45%,
        transparent 68%
    );
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
}

.rm__panel.is-swapping .rm__media-placeholder::after {
    animation: rmMediaSheen .82s var(--cubic) .12s both;
}

.rm__media-placeholder span {
    color: rgba(255, 255, 255, .2);
    font-family: var(--satoshi, "Satoshi", sans-serif);
    font-size: clamp(38px, 6vw, 72px);
    font-weight: 700;
    letter-spacing: -.02em;
}

.rm__media-image {
    display: block;
    width: min(440px, 100%);
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
}

.rm__cta {
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    color: white;
    background: rgba(255, 255, 255, .06);
    padding: 13px 18px;
    font-family: var(--satoshi, "Satoshi", sans-serif);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition:
        background .25s var(--cubic),
        border-color .25s var(--cubic),
        transform .25s var(--cubic);
    margin-top: 2px;
}

.rm__cta:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .28);
    transform: translateY(-1px);
}

/* Empty CTA stays in flow so it never produces a zero-size rect /
   phantom layout box; it just takes no visible space. */
.rm__cta.is-empty {
    height: 0;
    max-height: 0;
    padding: 0;
    border-width: 0;
    margin-top: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

.rm__panel.is-swapping .rm__year,
.rm__panel.is-swapping .rm__title,
.rm__panel.is-swapping .rm__description,
.rm__panel.is-swapping .rm__media,
.rm__panel.is-swapping .rm__cta {
    animation: rmPanelSwap .38s var(--cubic) both;
}

.rm__panel.is-swapping .rm__title {
    animation-delay: .035s;
}

.rm__panel.is-swapping .rm__description {
    animation-delay: .07s;
}

.rm__panel.is-swapping .rm__media {
    animation-delay: .11s;
}

@keyframes rmPanelSwap {
    0% {
        opacity: 0;
        transform: translateY(16px);
        filter: blur(3px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes rmMediaSheen {
    0% {
        opacity: 0;
        transform: translateX(-120%);
    }
    18% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(120%);
    }
}

/* ==========================================================
   DIVIDER (visible in detail state on desktop)
   ========================================================== */

.rm__container::after {
    content: "";
    position: absolute;
    top: 4%;
    bottom: 4%;
    left: 56%;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 255, 255, .16) 18%,
        rgba(255, 255, 255, .16) 82%,
        transparent
    );
    opacity: 0;
    transform: scaleY(.72);
    transform-origin: center;
    transition:
        opacity .4s var(--cubic),
        transform .7s var(--cubic);
    pointer-events: none;
    z-index: 0;
}

.rm.is-detail .rm__container::after {
    opacity: 1;
    transform: scaleY(1);
}

/* ==========================================================
   CLOSE
   ========================================================== */

.rm__close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 6;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    background: rgba(255, 255, 255, .03);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity .3s var(--cubic),
        background .3s var(--cubic);
}

.rm.is-detail .rm__close {
    opacity: 1;
    pointer-events: auto;
}

.rm__close:hover {
    background: rgba(255, 255, 255, .1);
}

/* ==========================================================
   TOOLTIP
   ========================================================== */

.rm__tooltip {
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    transform: translateY(8px) scale(.96);
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 18px;
    padding: 14px 18px;
    min-width: 180px;
    opacity: 0;
    pointer-events: none;
    transition: .25s var(--cubic);
}

.rm__tooltip.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.rm__tooltip-year {
    display: block;
    color: white;
    font-size: 14px;
    font-family: var(--satoshi, "Satoshi", sans-serif);
    margin-bottom: 6px;
}

.rm__tooltip-text {
    color: rgba(255, 255, 255, .6);
    font-size: 14px;
    line-height: 1.5;
    font-family: var(--satoshi, "Satoshi", sans-serif);
}

/* ==========================================================
   ROAD & NODES
   ========================================================== */

.rm-road-base {
    fill: none;
    stroke: rgba(255, 255, 255, .16);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rm-road-progress {
    fill: none;
    stroke: white;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition:
        stroke .25s var(--cubic),
        filter .35s var(--cubic);
    filter: drop-shadow(0 0 7px rgba(255, 255, 255, .09));
}

.rm-road-reveal {
    fill: none;
    stroke: rgba(255, 255, 255, .78);
    stroke-width: 1.5;
    pointer-events: none;
    opacity: 0;
    transition: stroke-dashoffset 1.5s var(--cubic);
}

.rm.is-revealed .rm-road-reveal {
    opacity: 1;
}

.rm.is-pre .rm-road-base,
.rm.is-pre .rm-road-progress,
.rm.is-pre .rm-gps-marker {
    opacity: 0;
}

.rm.is-pre .rm-road-reveal {
    opacity: 1;
}

.rm-node {
    cursor: pointer;
    outline: none;
    transition: opacity .55s var(--cubic);
}

.rm.is-pre .rm-node {
    opacity: 0;
}

.rm.is-revealed .rm-node {
    opacity: 1;
    transition-delay: calc(var(--rm-i, 0) * 48ms);
}

.rm-node-year {
    fill: white;
    font-size: 22px;
    font-family: var(--satoshi, "Satoshi", sans-serif);
    font-weight: 600;
    letter-spacing: -.02em;
    user-select: none;
    cursor: pointer;
}

.rm-node-hit {
    fill: transparent;
}

.rm-node-outer {
    fill: var(--bg-dark, #000);
    stroke: white;
    stroke-width: 2;
    transition: .35s var(--cubic);
}

.rm-node-inner {
    fill: white;
    transition: .35s var(--cubic);
}

.rm-node:hover .rm-node-outer,
.rm-node:focus-visible .rm-node-outer,
.rm-node.is-active .rm-node-outer {
    r: 16;
    fill: rgba(255, 255, 255, .08);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, .24));
}

.rm-node:hover .rm-node-inner,
.rm-node:focus-visible .rm-node-inner,
.rm-node.is-active .rm-node-inner {
    r: 8;
    fill: white;
}

.rm-node.is-active .rm-node-year {
    font-weight: 700;
}

.rm-node.is-pulsing .rm-node-outer {
    animation: rmNodePulse .72s var(--cubic) both;
}

.rm-node.is-pulsing .rm-node-inner {
    animation: rmNodeInnerPulse .72s var(--cubic) both;
}

.rm-node.is-dimmed {
    opacity: .44;
}

@keyframes rmNodePulse {
    0% {
        r: 12;
        stroke-width: 2;
        filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    }
    46% {
        r: 13.5;
        stroke-width: 2.2;
        filter: drop-shadow(0 0 12px rgba(255, 255, 255, .26));
    }
    100% {
        r: 13;
        stroke-width: 2;
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, .22));
    }
}

@keyframes rmNodeInnerPulse {
    0% {
        r: 5;
    }
    46% {
        r: 7;
    }
    100% {
        r: 6.5;
    }
}

.rm-gps-marker {
    fill: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity .32s ease;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, .42));
}

.rm-gps-marker.is-visible {
    opacity: 1;
}

.rm-gps-marker.is-traveling {
    animation: rmMarkerBreath .9s ease-in-out infinite;
}

@keyframes rmMarkerBreath {
    0%, 100% {
        r: 5;
    }
    50% {
        r: 6;
    }
}

/* ==========================================================
   BACK TO YEARS (mobile when a detail is open)
   ========================================================== */

.rm__back {
    position: fixed;
    top: calc(var(--nav-h, 80px) + 10px);
    left: 50%;
    z-index: 9990;
    box-sizing: border-box;
    width: max-content;
    max-width: min(var(--container-w, 1200px), calc(100% - var(--side-gutter, 25px) - var(--side-gutter, 25px)));
    padding: 9px 18px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(20, 20, 22, 0.78);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: var(--satoshi, "Arial", sans-serif);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(-8px);
    transition:
        opacity 0.25s var(--cubic, ease),
        transform 0.25s var(--cubic, ease),
        visibility 0.25s step-end;
}

.rm.is-mobile.is-detail ~ .rm__back {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition:
        opacity 0.25s var(--cubic, ease),
        transform 0.25s var(--cubic, ease),
        visibility 0s;
}

.rm.is-mobile.is-detail ~ .rm__back:hover {
    background: rgba(34, 34, 38, 0.88);
    border-color: rgba(255, 255, 255, 0.22);
}

.rm.is-mobile.is-detail ~ .rm__back:active {
    transform: translateX(-50%) translateY(1px);
}

.rm__back:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.45);
    outline-offset: 2px;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 1024px) {
    .rm__panel {
        width: 54%;
    }

    .rm__container::after {
        left: 54%;
    }
}

@media (max-width: 768px) {
    .rm {
        padding: 42px 0 54px;
    }

    .rm__intro {
        margin-bottom: 20px;
        text-align: left;
    }

    .rm.is-detail .rm__intro {
        opacity: 1;
        max-height: none;
        margin-bottom: 20px;
        transform: none;
        filter: none;
    }

    .rm__container,
    .rm.is-detail .rm__container {
        display: flex;
        flex-direction: column-reverse;
        min-height: 0;
        gap: 24px;
    }

    .rm__container::after {
        display: none;
    }

    .rm__timeline,
    .rm.is-detail .rm__timeline {
        width: 100%;
        height: 240px;
        min-height: 240px;
    }

    .rm__panel,
    .rm.is-detail .rm__panel {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        max-width: none;
        min-width: 0;
        transform: none;
        filter: none;
        padding-right: 0;
        z-index: 3;
    }

    .rm.is-closing .rm__panel {
        transform: none;
        filter: none;
    }

    .rm__close {
        display: none;
    }

    .rm__year {
        font-size: clamp(34px, 6vw, 64px);
    }

    .rm__title {
        font-size: clamp(20px, 4.5vw, 28px);
    }

    .rm__description {
        font-size: 15px;
    }

    .rm__media-placeholder {
        width: min(400px, 100%);
    }

    .rm-node-year {
        font-size: 12px;
        font-weight: 600;
    }

    .rm__panel,
    .rm__timeline {
        scroll-margin-top: calc(var(--nav-h, 80px) + 62px);
    }
}

/* ==========================================================
   REDUCED MOTION
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
    .rm *,
    .rm {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .rm__back {
        transition-duration: .01ms !important;
    }

    .rm.is-pre .rm-road-base,
    .rm.is-pre .rm-road-progress,
    .rm.is-pre .rm-gps-marker,
    .rm.is-pre .rm-road-reveal,
    .rm.is-pre .rm-node,
    .rm.is-pre .rm__intro {
        opacity: 1 !important;
    }

    .rm-road-reveal {
        opacity: 0 !important;
    }
}