/* Орфей · статичная карта, заставка и плавность интерфейса */
:root { --ease: cubic-bezier(.22,.8,.24,1); --ease-in: cubic-bezier(.5,0,.75,0); }

/* ── Карта: вода, подписи, уровни детализации ─────────── */
.map, .leaflet-container { background: #0c1113; }
.map::after { content: ""; position: absolute; inset: 0; z-index: 400; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0,0,0,.55)); }
.mlabel { pointer-events: none; }
.mlabel span { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font: 400 10px/1 var(--mono); letter-spacing: .08em; color: #7d878d; text-shadow: 0 0 3px #0c1113, 0 0 6px #0c1113; transition: opacity .4s var(--ease); }
.ml-sea span { font-size: 11px; letter-spacing: .5em; color: #2f5e66; }
.ml-state span { font-size: 12px; letter-spacing: .4em; color: #4b555b; }
.ml-nat span { font: italic 400 11px/1 var(--ui); color: #3f7f88; letter-spacing: .1em; }
.ml-cap span, .ml-city span { color: #aeb6ba; font-size: 10.5px; }
.ml-city span::before { content: "■ "; color: #6c767c; font-size: 7px; vertical-align: 2px; }
.ml-cap span::before { content: "★ "; color: var(--amber); font-size: 9px; }
.ml-town span { color: #8a9398; font-size: 9.5px; }
.ml-county span { color: #3d474c; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.map[data-lod="1"] .t2 span, .map[data-lod="1"] .t3 span, .map[data-lod="1"] .t4 span,
.map[data-lod="2"] .t3 span, .map[data-lod="2"] .t4 span,
.map[data-lod="3"] .t4 span { opacity: 0; }
.leaflet-control-scale-line { background: rgba(18,21,23,.8); color: var(--muted); border-color: var(--faint); font: 400 10px var(--mono); }

/* ── Рельеф и болота ──────────────────────────────────── */
.relief { image-rendering: auto; opacity: .96; }
.wetimg { image-rendering: auto; }
.wet--marsh { fill: url(#p-marsh); }
.wet--swamp { fill: url(#p-swamp); }
.wet--mangrove { fill: url(#p-mangrove); }
.wet--mine { fill: url(#p-mine); }
.ml-wet span { font: italic 400 11px/1 var(--ui); letter-spacing: .06em; color: #57a99f; }
.ml-mine span { font: italic 400 11px/1 var(--ui); letter-spacing: .06em; color: #c99654; }
.ml-ridge span { transform: translate(-50%, -50%) rotate(var(--r, 0deg)); font-size: 9px; letter-spacing: .45em; color: #a08a68; opacity: .85; }
.no-wet .lay-wet { display: none; }
.map-legend hr { border: 0; border-top: 1px solid var(--line); margin: 3px 0; }
.map-legend .lg { width: 14px; height: 10px; border-radius: 2px; flex: none; }
.lg-relief { background: linear-gradient(90deg, #1c2828, #46402f 60%, #6e6455); box-shadow: inset 1px 1px 0 rgba(255,255,255,.12), inset -1px -1px 0 rgba(0,0,0,.5); }
.lg-wet { background: rgba(63,143,134,.18) repeating-linear-gradient(90deg, transparent 0 3px, rgba(79,163,154,.7) 3px 4px); border: 1px dashed rgba(79,163,154,.6); }
.lg-road { height: 0 !important; border-top: 2px solid rgba(224,164,88,.6); border-radius: 0 !important; }

/* ── Точки ────────────────────────────────────────────── */
.pin.pop { animation: pinIn .7s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes pinIn { from { opacity: 0; transform: scale(.2); } 60% { opacity: 1; transform: scale(1.25); } to { transform: scale(1); } }
.pin i { transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s; }
.pin:hover i { transform: rotate(45deg) scale(1.2); }
.pin.k-city:hover i, .pin.k-med:hover i, .pin.k-road:hover i { transform: scale(1.25); }
.pin.on i { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--c) 12%, transparent), 0 0 30px var(--c); } }

/* ── Вкладки: скользящая подложка ─────────────────────── */
.tabs { position: relative; }
.tabs__ind { position: absolute; left: 0; top: 0; height: 100%; border-radius: 6px; background: var(--amber); transition: transform .5s var(--ease), width .5s var(--ease); z-index: 0; }
.tabs a { position: relative; z-index: 1; transition: color .35s var(--ease); }
.tabs a[aria-current="page"] { background: transparent; }

/* ── Смена разделов и панелей ─────────────────────────── */
.view.enter { animation: viewIn .55s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.side > * { animation: rise .5s var(--ease) both; }
.side > *:nth-child(2) { animation-delay: .04s; } .side > *:nth-child(3) { animation-delay: .08s; }
.side > *:nth-child(4) { animation-delay: .12s; } .side > *:nth-child(5) { animation-delay: .16s; }
.side > *:nth-child(n+6) { animation-delay: .2s; }
.pgrid .pcard { animation: rise .6s var(--ease) both; }
.pgrid .pcard:nth-child(2) { animation-delay: .05s; } .pgrid .pcard:nth-child(3) { animation-delay: .1s; }
.pgrid .pcard:nth-child(4) { animation-delay: .15s; } .pgrid .pcard:nth-child(5) { animation-delay: .2s; }
.pgrid .pcard:nth-child(n+6) { animation-delay: .25s; }
.pcard { transition: border-color .35s var(--ease), transform .45s var(--ease), box-shadow .45s var(--ease); }
.pcard:hover { box-shadow: 0 18px 40px -20px rgba(224,164,88,.35); }
.pcard__img img { transition: transform .8s var(--ease), filter .6s var(--ease); }
.pcard:not(.locked):hover .pcard__img img { transform: scale(1.04); filter: none; }
.docs__main > .doc, .chrow { animation: rise .5s var(--ease) both; }
.ditem, .plist button, .chip, .btn { transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), filter .25s; }
.modal:not([hidden]) .modal__back { animation: fade .35s ease both; }
.modal:not([hidden]) .modal__box { animation: pop .5s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.route-bar:not([hidden]), .toast:not([hidden]) { animation: rise .4s var(--ease) both; }
.toast:not([hidden]) { animation-name: toastIn; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* Интерфейс проявляется после заставки */
body:not(.ready) .top { opacity: 0; transform: translateY(-12px); }
body:not(.ready) #app { opacity: 0; }
.top { transition: opacity .8s var(--ease) .35s, transform .8s var(--ease) .35s; }
#app { transition: opacity 1s var(--ease) .2s; }

/* ── Заставка ─────────────────────────────────────────── */
.intro { position: fixed; inset: 0; z-index: 5000; background: #000; color: #f2f4f6; overflow: hidden; display: grid; place-items: center; }
.intro__art { position: absolute; inset: -4%; background: url(img/orpheus_wide-1920.webp) 70% 35% / cover no-repeat; opacity: 0; transform: scale(1.14); filter: saturate(.85);
  animation: artIn 6s var(--ease) 1.2s forwards; }
@keyframes artIn { to { opacity: .55; transform: scale(1.02); } }
.intro.done .intro__art { animation: artIn 1s var(--ease) forwards, drift 30s ease-in-out 1s infinite alternate; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.08) translateX(-1.5%); } }
.intro__veil { position: absolute; inset: 0; background:
  radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.25), rgba(0,0,0,.88) 75%),
  linear-gradient(180deg, rgba(0,0,0,.6), transparent 30%, transparent 70%, rgba(0,0,0,.8)); }
.intro__scan { position: absolute; inset: 0; pointer-events: none; opacity: .35; mix-blend-mode: overlay;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px); animation: scan 8s linear infinite; }
@keyframes scan { to { background-position: 0 300px; } }
.intro__boot { position: absolute; left: 28px; top: 26px; font: 400 10.5px/1.9 var(--mono); letter-spacing: .14em; color: var(--teal); }
.intro__boot div { opacity: 0; animation: type .6s steps(20) both; }
.intro__boot div:nth-child(1) { animation-delay: .25s; } .intro__boot div:nth-child(2) { animation-delay: .85s; } .intro__boot div:nth-child(3) { animation-delay: 1.2s; }
@keyframes type { from { opacity: 1; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.intro__bar { width: 220px; height: 3px; margin-top: 6px; background: rgba(95,167,177,.18); }
.intro__bar i { display: block; height: 100%; width: 0; background: var(--teal); animation: bar 2.4s var(--ease) 1.2s forwards; }
@keyframes bar { to { width: 100%; } }
.intro__center { position: relative; text-align: center; padding: 0 16px; width: min(1000px, 100%); }
.intro__seal { width: 54px; height: 54px; margin: 0 auto 18px; display: block; opacity: 0; animation: sealIn 1.2s var(--ease) 1.9s forwards; }
@keyframes sealIn { from { opacity: 0; transform: scale(.6) rotate(-90deg); } to { opacity: 1; transform: none; } }
.intro__title { font: 400 clamp(64px, 17vw, 230px)/.8 var(--display); letter-spacing: .02em; margin: 0; color: #f2f4f6; text-shadow: 0 0 40px rgba(224,164,88,.18); }
.intro__title span { display: inline-block; opacity: 0; filter: blur(14px); transform: translateY(18px) scale(1.08);
  animation: letter 1.1s var(--ease) forwards; animation-delay: calc(2.2s + var(--i) * .12s); }
@keyframes letter { to { opacity: 1; filter: blur(0); transform: none; } }
.intro__tag { margin: 22px auto 0; max-width: 560px; font: 400 clamp(14px, 1.6vw, 17px)/1.5 var(--ui); color: #c9cfd2; opacity: 0; animation: fadeUp 1.2s var(--ease) 3.2s forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.intro__menu { margin-top: 34px; min-height: 110px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.intro__menu > * { animation: fadeUp .7s var(--ease) both; }
.intro__menu > *:nth-child(2) { animation-delay: .12s; } .intro__menu > *:nth-child(3) { animation-delay: .24s; }
.intro__btn { min-width: 220px; height: 48px; padding: 0 28px; border: 1px solid var(--amber); color: var(--amber); background: rgba(224,164,88,.06); font: 400 13px/1 var(--mono); letter-spacing: .3em; text-transform: uppercase; border-radius: 2px; transition: background .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease); }
.intro__btn:hover, .intro__btn:focus-visible { background: var(--amber); color: #121517; box-shadow: 0 0 40px rgba(224,164,88,.35); outline: none; }
.intro__link { font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 6px; }
.intro__link:hover { color: var(--amber); }
.intro__hint { font: 400 10px/1 var(--mono); letter-spacing: .3em; text-transform: uppercase; color: #6c767c; }
.intro__menu > .intro__hint { animation: fadeUp .7s var(--ease) .3s both, blink 2.4s ease-in-out 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.intro__lv { width: min(860px, 100%); text-align: left; }
.intro__lvh { font: 400 10.5px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--teal); margin-bottom: 12px; text-align: center; }
.intro__lv .chgrid button { background: rgba(10,12,13,.75); backdrop-filter: blur(6px); animation: fadeUp .5s var(--ease) both; animation-delay: calc(var(--i) * 25ms); transition: border-color .25s, background .25s, transform .25s var(--ease); }
.intro__lv .chgrid button:hover { transform: translateY(-2px); background: rgba(224,164,88,.12); }
.intro__lv .intro__link { display: block; margin: 14px auto 0; }
.intro__foot { position: absolute; left: 28px; right: 28px; bottom: 22px; display: flex; justify-content: space-between; font: 400 10px/1 var(--mono); letter-spacing: .2em; color: #4e575c; opacity: 0; animation: fadeUp 1s var(--ease) 2.6s forwards; }
/* до старта (экран «нажмите») партитура анимаций стоит на паузе — чтобы звук и картинка шли вместе */
.intro:not(.play) .intro__art, .intro:not(.play) .intro__boot *, .intro:not(.play) .intro__center *,
.intro:not(.play) .intro__center .intro__title span, .intro:not(.play) .intro__foot { animation-play-state: paused !important; }

.intro__gate { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: #000; opacity: 0; visibility: hidden; transition: opacity .7s var(--ease), visibility 0s .7s; cursor: pointer; }
.intro__gate.show { opacity: 1; visibility: visible; transition: opacity .6s var(--ease); }
.intro__gate.gone { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .7s var(--ease), visibility 0s .7s; }
.intro__gate-in { text-align: center; display: grid; gap: 22px; justify-items: center; padding: 0 16px; }
.intro__gate-k { font: 400 10px/1 var(--mono); letter-spacing: .24em; color: var(--teal); opacity: .8; }
.intro__gate-go { font: 400 14px/1 var(--mono); letter-spacing: .34em; text-transform: uppercase; color: #e9ecee; padding: 14px 24px; border: 1px solid rgba(255,255,255,.18); border-radius: 2px; animation: blink 2.4s ease-in-out infinite; transition: border-color .3s, color .3s; }
.intro__gate:hover .intro__gate-go, .intro__gate-go:focus-visible { border-color: var(--amber); color: var(--amber); outline: none; }
.intro__gate-s { font: 400 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #5d676c; }
.intro__gate-s::before { content: "♪ "; color: var(--amber); }
.intro__gate-mute { font: inherit; letter-spacing: inherit; text-transform: inherit; color: #8d969c; border-bottom: 1px dotted #5d676c; padding: 2px 0; }
.intro__gate-mute:hover { color: var(--amber); border-color: var(--amber); }

.intro__snd { position: absolute; z-index: 4; right: 24px; top: 22px; font: 400 10px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: #6c767c; padding: 7px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 2px; transition: color .25s, border-color .25s; }
.intro__snd::before { content: "◉ "; color: var(--amber); }
.intro__snd[aria-pressed="false"]::before { content: "○ "; color: #5d676c; }
.intro__snd:hover { color: var(--amber); border-color: var(--amber); }
@media (max-width: 640px) { .intro__snd { right: 12px; top: 12px; font-size: 9px; } .intro__boot { top: 48px; } }

/* пропуск анимации щелчком */
.intro.skip .intro__boot div, .intro.skip .intro__bar i, .intro.skip .intro__seal, .intro.skip .intro__title span,
.intro.skip .intro__tag, .intro.skip .intro__foot { animation-delay: 0s !important; animation-duration: .4s !important; }
/* уход */
.intro.out { pointer-events: none; animation: introOut 1.1s var(--ease-in) forwards; }
.intro.out .intro__center { animation: centerOut .9s var(--ease-in) forwards; }
@keyframes introOut { 40% { opacity: 1; } to { opacity: 0; } }
@keyframes centerOut { to { opacity: 0; transform: scale(1.12); filter: blur(10px); } }

@media (max-width: 640px) {
  .intro__boot { left: 16px; top: 16px; font-size: 9px; }
  .intro__foot { left: 16px; right: 16px; font-size: 8.5px; }
  .intro__menu { margin-top: 24px; }
  .intro__lv .chgrid { grid-template-columns: repeat(3, 1fr); max-height: 52vh; overflow: auto; }
  .intro__lv .chgrid button { padding: 8px; }
  .intro__lv .chgrid span { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro *, .intro, .view.enter, .side > *, .pin.pop, .pgrid .pcard, .chrow { animation-duration: .01s !important; animation-delay: 0s !important; }
}
