/* ============================================================
   Sepia World Map - cinematic narrative interface
   ============================================================ */

.sepia-world-map {
    --swm-bg: #050403;
    --swm-gold: #d8a84d;
    --swm-gold-light: #f5d77f;
    --swm-gold-dim: rgba(216, 168, 77, 0.42);
    --swm-cream: #fff4dc;
    --swm-muted: rgba(255, 244, 220, 0.66);
    --swm-panel: rgba(7, 6, 5, 0.66);
    --swm-panel-strong: rgba(7, 6, 5, 0.84);
    --swm-line: rgba(245, 215, 127, 0.18);
    --swm-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --swm-font: 'Inter', ui-sans-serif, system-ui, sans-serif;
    position: relative;
    width: 100%;
    min-height: 100svh;
    overflow: hidden;
    background: var(--swm-bg);
    color: var(--swm-cream);
    font-family: var(--swm-font);
    isolation: isolate;
}

.sepia-world-map *,
.sepia-world-map *::before,
.sepia-world-map *::after {
    box-sizing: border-box;
}

.swm-map-area {
    position: relative;
    min-height: 100svh;
    overflow: hidden;
    background: var(--swm-bg);
}

.swm-bg-photo {
    --swm-camera-x: 0px;
    --swm-camera-y: 0px;
    --swm-parallax-x: 0px;
    --swm-parallax-y: 0px;
    --swm-camera-scale: 1.015;
    position: absolute;
    inset: -4%;
    z-index: 0;
    width: 108%;
    height: 108%;
    object-fit: cover;
    object-position: center;
    filter: saturate(0.95) contrast(1.04) brightness(0.82);
    transform:
        translate(
            calc(var(--swm-camera-x) + var(--swm-parallax-x)),
            calc(var(--swm-camera-y) + var(--swm-parallax-y))
        )
        scale(var(--swm-camera-scale));
    transform-origin: center;
    transition: transform 0.7s var(--swm-ease), filter 0.7s var(--swm-ease);
    will-change: transform;
}

.swm-color-grade,
.swm-vignette,
.swm-fog,
.swm-routes-svg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.swm-color-grade {
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(5, 4, 3, 0.46) 0%, transparent 30%, transparent 62%, rgba(5, 4, 3, 0.48) 100%),
        linear-gradient(180deg, rgba(5, 4, 3, 0.25) 0%, transparent 24%, transparent 58%, rgba(5, 4, 3, 0.78) 100%);
    mix-blend-mode: multiply;
}

.swm-vignette {
    z-index: 2;
    background:
        radial-gradient(circle at 51% 16%, rgba(245, 215, 127, 0.18), transparent 24%),
        radial-gradient(ellipse at 48% 52%, transparent 0%, rgba(5, 4, 3, 0.18) 58%, rgba(5, 4, 3, 0.74) 100%);
}

.swm-fog {
    z-index: 3;
    overflow: hidden;
}

.swm-fog-layer {
    position: absolute;
    left: -10%;
    right: -10%;
    height: 32%;
    top: 34%;
    opacity: 0.14;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.018' numOctaves='3' seed='8'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='900' height='260' filter='url(%23n)' opacity='0.65'/%3E%3C/svg%3E") repeat-x;
    background-size: 900px 260px;
    mix-blend-mode: screen;
    animation: swm-fog-drift 54s linear infinite;
}

.swm-fog-layer:nth-child(2) {
    top: 55%;
    opacity: 0.1;
    animation-duration: 78s;
    animation-direction: reverse;
}

@keyframes swm-fog-drift {
    from { background-position: 0 0; }
    to { background-position: 900px 0; }
}

.swm-routes-svg {
    z-index: 4;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.swm-route {
    fill: none;
    stroke: var(--swm-gold-light);
    stroke-width: 0.55;
    stroke-dasharray: 2.5 4.5;
    opacity: 0.12;
    transition: opacity 0.45s var(--swm-ease), stroke-width 0.45s var(--swm-ease);
}

.swm-route.is-lit {
    opacity: 0.72;
    stroke-width: 1.25;
    animation: swm-route-flow 2.7s linear infinite;
}

@keyframes swm-route-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -28; }
}

.swm-hud-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0 clamp(18px, 4vw, 54px);
    color: rgba(255, 244, 220, 0.72);
    background: linear-gradient(180deg, rgba(5, 4, 3, 0.68), transparent);
}

.swm-hud-brand,
.swm-hud-status {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.swm-hud-brand {
    color: var(--swm-gold-light);
}

.swm-hud-status {
    color: rgba(255, 244, 220, 0.44);
}

.swm-destination {
    position: absolute;
    z-index: 8;
    display: grid;
    place-items: center;
    width: 94px;
    height: 94px;
    color: var(--swm-gold-light);
    text-decoration: none;
    transform: translate(-50%, -50%);
}

.swm-faro-glow {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(245, 215, 127, 0.52) 0%, rgba(216, 168, 77, 0.2) 36%, transparent 70%);
    box-shadow: 0 0 52px rgba(245, 215, 127, 0.5), 0 0 120px rgba(216, 168, 77, 0.24);
    animation: swm-faro-pulse 3.8s ease-in-out infinite;
}

.swm-destination-label {
    position: relative;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.72);
}

@keyframes swm-faro-pulse {
    0%, 100% { opacity: 0.66; transform: scale(0.86); }
    50% { opacity: 1; transform: scale(1.08); }
}

.swm-hotspot {
    position: absolute;
    z-index: 10;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    color: var(--swm-gold-light);
    background: transparent;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform 0.35s var(--swm-ease);
}

.swm-hotspot:hover,
.swm-hotspot.is-active {
    transform: translate(-50%, -50%) scale(1.08);
}

.swm-hotspot:focus-visible {
    outline: 2px solid var(--swm-gold-light);
    outline-offset: 7px;
}

.swm-hotspot-aura {
    position: absolute;
    inset: -18px;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(245, 215, 127, 0.3), transparent 64%);
    opacity: 0.24;
    transition: opacity 0.3s var(--swm-ease), transform 0.3s var(--swm-ease);
}

.swm-hotspot-ring {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border: 1px solid var(--swm-gold-dim);
    border-radius: inherit;
    background:
        radial-gradient(circle at 50% 45%, rgba(245, 215, 127, 0.18), rgba(14, 10, 6, 0.72) 58%),
        rgba(7, 6, 5, 0.6);
    box-shadow:
        inset 0 0 18px rgba(245, 215, 127, 0.12),
        0 12px 28px rgba(0, 0, 0, 0.58),
        0 0 0 1px rgba(255, 244, 220, 0.06);
    backdrop-filter: blur(8px);
}

.swm-hotspot-ring::before,
.swm-hotspot-ring::after {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(245, 215, 127, 0.22);
    border-radius: inherit;
}

.swm-hotspot-ring::after {
    inset: 15px;
    border-color: rgba(245, 215, 127, 0.34);
}

.swm-hotspot-number {
    position: relative;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.swm-hotspot-callout {
    position: absolute;
    left: 58px;
    top: 50%;
    display: grid;
    min-width: 170px;
    padding-left: 18px;
    color: var(--swm-cream);
    opacity: 0;
    pointer-events: none;
    text-align: left;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.86);
    transform: translateY(-50%) translateX(-6px);
    transition: opacity 0.28s var(--swm-ease), transform 0.28s var(--swm-ease);
}

.swm-hotspot-callout::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 12px;
    height: 1px;
    background: var(--swm-gold-dim);
}

.swm-hotspot:hover .swm-hotspot-callout,
.swm-hotspot.is-active .swm-hotspot-callout {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.swm-hotspot:hover .swm-hotspot-aura,
.swm-hotspot.is-active .swm-hotspot-aura {
    opacity: 0.88;
    transform: scale(1.16);
}

.swm-hotspot-name {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.swm-hotspot-short {
    margin-top: 3px;
    font-size: 0.72rem;
    color: rgba(255, 244, 220, 0.56);
}

.swm-story-panel {
    position: absolute;
    left: clamp(18px, 5vw, 68px);
    bottom: clamp(22px, 6vw, 70px);
    z-index: 14;
    width: min(440px, calc(100vw - 36px));
    padding: 24px 26px 22px;
    border: 1px solid var(--swm-line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 244, 220, 0.055), transparent 32%),
        linear-gradient(180deg, var(--swm-panel), var(--swm-panel-strong));
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 244, 220, 0.08);
    backdrop-filter: blur(18px);
}

.swm-story-panel::before {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    top: 10px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245, 215, 127, 0.38), transparent);
}

.swm-panel-kicker {
    margin-bottom: 14px;
    color: rgba(245, 215, 127, 0.72);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.swm-panel-title {
    margin: 0;
    max-width: 12ch;
    color: var(--swm-cream);
    font-size: clamp(2rem, 4vw, 3.7rem);
    font-weight: 800;
    line-height: 0.95;
}

.swm-panel-text {
    margin: 18px 0 0;
    color: rgba(255, 244, 220, 0.82);
    font-size: 0.98rem;
    line-height: 1.62;
}

.swm-panel-sub {
    margin: 12px 0 0;
    color: rgba(245, 215, 127, 0.66);
    font-size: 0.78rem;
    line-height: 1.5;
}

.swm-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.swm-cta-primary,
.swm-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    font-family: var(--swm-font);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 0.25s var(--swm-ease), border-color 0.25s var(--swm-ease), background 0.25s var(--swm-ease);
}

.swm-cta-primary {
    color: #130d08;
    border: 1px solid rgba(245, 215, 127, 0.62);
    background: linear-gradient(135deg, #d8a84d, #f5d77f 52%, #b98230);
    box-shadow: 0 12px 36px rgba(216, 168, 77, 0.34);
}

.swm-cta-secondary {
    color: var(--swm-cream);
    border: 1px solid rgba(245, 215, 127, 0.22);
    background: rgba(255, 244, 220, 0.055);
}

.swm-cta-primary:hover,
.swm-cta-secondary:hover {
    transform: translateY(-2px);
}

.swm-cta-secondary:hover {
    border-color: rgba(245, 215, 127, 0.46);
    background: rgba(255, 244, 220, 0.09);
}

.swm-chapter-rail {
    display: flex;
    gap: 8px;
    margin-top: 22px;
}

.swm-chapter-rail span {
    width: 34px;
    height: 2px;
    background: rgba(255, 244, 220, 0.22);
    transition: width 0.25s var(--swm-ease), background 0.25s var(--swm-ease);
}

.swm-chapter-rail span.is-active {
    width: 56px;
    background: var(--swm-gold-light);
}

.swm-mobile-cards {
    display: none;
}

@media (max-width: 860px) {
    .swm-map-area {
        min-height: 72svh;
    }

    .swm-bg-photo {
        object-position: 48% center;
    }

    .swm-hud-status,
    .swm-hotspot-callout,
    .swm-story-panel {
        display: none;
    }

    .swm-destination {
        width: 72px;
        height: 72px;
    }

    .swm-hotspot {
        display: none;
    }

    .swm-routes-svg {
        display: none;
    }

    .swm-mobile-cards {
        display: grid;
        gap: 12px;
        padding: 18px 16px 26px;
        background:
            linear-gradient(180deg, rgba(5, 4, 3, 0.84), #050403 26%),
            var(--swm-bg);
    }

    .swm-mobile-card {
        display: grid;
        grid-template-columns: 42px 1fr;
        gap: 14px;
        width: 100%;
        padding: 16px;
        border: 1px solid var(--swm-line);
        border-radius: 8px;
        color: var(--swm-cream);
        background: rgba(255, 244, 220, 0.045);
        text-align: left;
        font-family: var(--swm-font);
    }

    .swm-mobile-card.is-active {
        border-color: rgba(245, 215, 127, 0.5);
        background: rgba(216, 168, 77, 0.1);
    }

    .swm-mobile-card-number {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        border: 1px solid var(--swm-gold-dim);
        border-radius: 999px;
        color: var(--swm-gold-light);
        font-size: 0.72rem;
        font-weight: 800;
    }

    .swm-mobile-card-text {
        display: grid;
        align-content: center;
        gap: 4px;
    }

    .swm-mobile-card-name {
        font-size: 0.95rem;
        font-weight: 800;
    }

    .swm-mobile-card-sub {
        color: var(--swm-muted);
        font-size: 0.8rem;
        line-height: 1.42;
    }

    .swm-mobile-cta {
        width: 100%;
        margin-top: 4px;
    }
}

@media (min-width: 1280px) {
    .swm-story-panel {
        width: 470px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .swm-bg-photo,
    .swm-route,
    .swm-fog-layer,
    .swm-faro-glow,
    .swm-hotspot,
    .swm-hotspot-aura,
    .swm-hotspot-callout,
    .swm-cta-primary,
    .swm-cta-secondary {
        animation: none !important;
        transition: none !important;
    }
}
