/* 3D-карта главной страницы. Все селекторы изолированы от обычной карты на других страницах. */
.home-geo3d {
    --geo3d-ground: #fff;
    --geo3d-ground-2: #fff;
    --geo3d-ink: #151515;
    --geo3d-muted: #5f6368;
    --geo3d-teal: #3493b3;
    background: #fff;
    color: var(--geo3d-ink);
    font-family: "InterTight", "Inter", Arial, sans-serif;
    overflow: hidden;
}

.home-geo3d__inner {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0 auto;
    padding: clamp(40px, 4vw, 72px) clamp(16px, 2.1vw, 72px) clamp(20px, 2.5vw, 34px);
}

.home-geo3d__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px 28px;
    margin-bottom: clamp(10px, 1.4vw, 18px);
}

.home-geo3d__eyebrow {
    margin: 0 0 7px;
    color: var(--geo3d-ink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .22em;
    line-height: 1.3;
    text-transform: uppercase;
}

.home-geo3d__title {
    max-width: 760px;
    margin: 0;
    color: var(--geo3d-ink);
    font-family: "InterTight", "Inter", Arial, sans-serif;
    font-size: clamp(27px, 3.3vw, 46px);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.02;
}

.home-geo3d__layers {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.home-geo3d__layers button {
    margin: 0;
    padding: 8px 14px;
    border: 1px solid #d5dadd;
    border-radius: 999px;
    background: #f3f5f6;
    color: var(--geo3d-ink);
    cursor: pointer;
    font: 600 13px/1.2 "InterTight", "Inter", Arial, sans-serif;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.home-geo3d__layers button:hover { border-color: var(--geo3d-teal); color: var(--geo3d-ink); }
.home-geo3d__layers button[aria-pressed="true"] { border-color: var(--geo3d-teal); background: var(--geo3d-teal); color: #fff; }
.home-geo3d button:focus-visible,
.home-geo3d a:focus-visible { outline: 2px solid #151515; outline-offset: 2px; }

.home-geo3d__stage {
    position: relative;
    width: 100%;
    height: clamp(420px, 62vw, 720px);
    max-height: 72vh;
    min-height: 420px;
    overflow: hidden;
    border-radius: 6px;
    background: #fff;
}

.home-geo3d__stage canvas {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    outline: 0;
    cursor: move;
    touch-action: none;
}

.home-geo3d__stage[data-mode="pan"] canvas { cursor: grab; }
.home-geo3d__stage[data-mode="pan"] canvas:active { cursor: grabbing; }

.home-geo3d__marks {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.home-geo3d__mark {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: visible;
    appearance: none;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

a.home-geo3d__mark,
button.home-geo3d__mark { cursor: pointer; pointer-events: auto; }
.home-geo3d__mark--proj { z-index: 4; }
.home-geo3d__mark--cap { z-index: 3; }
.home-geo3d__mark--dep { z-index: 2; }
.home-geo3d__mark--city { z-index: 1; }

.home-geo3d__mark svg {
    position: absolute;
    display: block;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5));
}

.home-geo3d__mark--proj > svg { top: -46px; left: -17px; width: 34px; height: 46px; }
.home-geo3d__mark--dep > svg { top: -27px; left: -10px; width: 20px; height: 27px; }

.home-geo3d__leader {
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    background: #fff;
    box-shadow: 0 0 3px rgba(0, 0, 0, .5);
    transform-origin: 0 50%;
}

.home-geo3d__label {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
}

.home-geo3d__mark--proj .home-geo3d__label {
    padding: 5px 10px 6px;
    border: 1px solid #9ad3e6;
    border-radius: 5px;
    background: var(--geo3d-teal);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
    color: #fff;
    font-size: clamp(13px, 1.3vw, 17px);
    font-weight: 700;
    line-height: 1.05;
}

.home-geo3d__mark--proj .home-geo3d__label small {
    display: block;
    margin-top: 3px;
    color: #ddf2f8;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
    line-height: 1;
}

.home-geo3d__mark--dep .home-geo3d__label {
    padding: 3px 7px 4px;
    border-radius: 4px;
    background: rgba(22, 26, 29, .86);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
}

.home-geo3d__city-dot {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 8px;
    height: 8px;
    border: 2px solid #1e5f73;
    border-radius: 50%;
    background: #fff;
    box-sizing: border-box;
}

.home-geo3d__mark--city .home-geo3d__label {
    padding: 2px 5px 3px;
    border: 1px solid rgba(20, 64, 79, .15);
    border-radius: 3px;
    background: rgba(246, 250, 251, .82);
    color: #14404f;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    line-height: 1;
    text-transform: uppercase;
}

.home-geo3d__capital-dot {
    position: absolute;
    top: -7px;
    left: -7px;
    width: 14px;
    height: 14px;
    border: 2.5px solid #fff;
    background: #0f4354;
    box-sizing: border-box;
    transform: rotate(45deg);
}

.home-geo3d__mark--cap .home-geo3d__label {
    padding: 3px 7px 4px;
    border: 1px solid rgba(15, 67, 84, .18);
    border-radius: 4px;
    background: rgba(248, 251, 252, .9);
    color: #0f3b4a;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

a.home-geo3d__mark:hover .home-geo3d__label,
button.home-geo3d__mark:hover .home-geo3d__label,
a.home-geo3d__mark:focus-visible .home-geo3d__label,
button.home-geo3d__mark:focus-visible .home-geo3d__label {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--geo3d-teal), 0 6px 18px rgba(0, 0, 0, .45);
}

a.home-geo3d__mark:focus-visible,
button.home-geo3d__mark:focus-visible { outline: 0; }

.home-geo3d__nav {
    position: absolute;
    z-index: 6;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid #cfd5d8;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 3px 14px rgba(21, 21, 21, .12);
    backdrop-filter: blur(4px);
}

.home-geo3d__nav button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--geo3d-muted);
    cursor: pointer;
}

.home-geo3d__nav button:hover { color: var(--geo3d-ink); }
.home-geo3d__nav button[aria-pressed="true"] { background: var(--geo3d-teal); color: #fff; }
.home-geo3d__nav svg { width: 18px; height: 18px; }

.home-geo3d__hint {
    position: absolute;
    z-index: 5;
    bottom: 10px;
    left: 12px;
    color: var(--geo3d-muted);
    font-size: 12px;
    line-height: 1.3;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(255, 255, 255, .9), 0 0 10px #fff;
}

.home-geo3d__loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 20px;
    color: var(--geo3d-muted);
    font-size: 14px;
    text-align: center;
}

.home-geo3d__loading[hidden] { display: none; }

.home-geo3d__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px 24px;
    margin-top: 10px;
}

.home-geo3d__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 22px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
}

.home-geo3d__legend span { display: inline-flex; align-items: center; gap: 8px; }
.home-geo3d__legend i { width: 13px; height: 13px; border: 2px solid #fff; border-radius: 50%; background: var(--legend); box-sizing: border-box; }
.home-geo3d__legend svg { width: 14px; height: 19px; flex: none; }
.home-geo3d__compass { width: 64px; height: 64px; flex: none; }
.home-geo3d__compass text { fill: #151515; }
.home-geo3d__note { width: 100%; margin: 0; color: var(--geo3d-muted); font-size: 12px; line-height: 1.45; }
.home-geo3d__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.home-geo3d__chronology {
    padding-top: clamp(28px, 4vw, 60px);
    padding-bottom: clamp(28px, 4vw, 60px);
    color: var(--geo3d-ink);
}

/* Модальные карточки светлые; не наследуют белый цвет текста от тёмной карты. */
.home-geo3d .geo-deposit-modal,
.home-geo3d .geo-deposit-modal .modal__container,
.home-geo3d .geo-deposit-modal .modal__wrapper {
    color: #151515;
}

@media (max-width: 767px) {
    .home-geo3d__header { align-items: flex-start; }
    .home-geo3d__layers { width: 100%; }
    .home-geo3d__layers button { padding: 7px 12px; font-size: 12px; }
    .home-geo3d__stage { height: auto; min-height: 0; max-height: none; aspect-ratio: 1 / 1; }
    .home-geo3d__hint { right: 60px; font-size: 10px; }
    .home-geo3d__mark--proj .home-geo3d__label { padding: 4px 7px 5px; font-size: 12px; }
    .home-geo3d__mark--proj .home-geo3d__label small { font-size: 7px; }
    .home-geo3d__mark--dep .home-geo3d__label { padding: 2px 5px 3px; font-size: 10px; }
    .home-geo3d__mark--city .home-geo3d__label { padding: 1px 4px 2px; font-size: 8px; letter-spacing: .06em; }
    .home-geo3d__mark--cap .home-geo3d__label { padding: 2px 5px 3px; font-size: 13px; }
    .home-geo3d__legend { gap: 7px 14px; font-size: 12px; }
    .home-geo3d__compass { width: 54px; height: 54px; }
}

@media (max-width: 420px) {
    .home-geo3d__inner { padding-right: 16px; padding-left: 16px; }
    .home-geo3d__nav button { width: 31px; height: 31px; }
    .home-geo3d__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .home-geo3d__mark,
    .home-geo3d__layers button { transition: none; }
}
