/* Шрифты (локально, OFL) */
@font-face { font-family: 'Manrope'; src: url(../fonts/manrope-cyrillic-wght-normal.woff2) format('woff2'); font-weight: 200 800; font-display: block;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; src: url(../fonts/manrope-latin-wght-normal.woff2) format('woff2'); font-weight: 200 800; font-display: block;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; src: url(../fonts/unbounded-cyrillic-wght-normal.woff2) format('woff2'); font-weight: 200 900; font-display: block;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; src: url(../fonts/unbounded-latin-wght-normal.woff2) format('woff2'); font-weight: 200 900; font-display: block;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --accent: #e8432f;          /* линия маршрута и акцент карточки */
  --accent-soft: rgba(232, 67, 47, .35);
  --glow: #ffe2b8;            /* свечение границы текущего региона */
  --ink: #f6f2ec;
  --ink-dim: rgba(246, 242, 236, .66);
  --card-bg: rgba(9, 11, 15, .72);
  --gap: clamp(16px, 2.6vw, 52px);
  --card-w: clamp(300px, 29vw, 540px);
  --ease-out: cubic-bezier(.22, .9, .3, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif; -webkit-font-smoothing: antialiased; cursor: default; user-select: none; }

#stars { position: fixed; inset: 0; background: #02040a center / cover no-repeat; transition: opacity 1.2s; }
#map { position: fixed; inset: 0; }
#map canvas { outline: none; }
.maplibregl-canvas-container.maplibregl-interactive { cursor: default; }

/* «Кино»: виньетка и лёгкий тон */
#vignette { position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 75% 70% at 45% 50%, transparent 55%, rgba(0,0,0,.55) 100%),
    linear-gradient(180deg, rgba(0,0,0,.28) 0%, transparent 16%, transparent 80%, rgba(0,0,0,.38) 100%); }

/* Титул в космосе */
#title { position: fixed; left: calc(var(--gap) * 1.6); top: 50%; transform: translateY(-50%); width: min(46vw, 820px);
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out); }
#title.off { opacity: 0; transform: translate(-30px, -50%); pointer-events: none; }
#title .kicker { font: 600 clamp(11px, .95vw, 17px)/1.2 'Manrope'; letter-spacing: .32em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.4em; }
#title h1 { margin: 0; font: 700 clamp(34px, 4.7vw, 92px)/1.02 'Unbounded'; letter-spacing: -.02em; text-wrap: balance;
  text-shadow: 0 4px 40px rgba(0,0,0,.6); }
#title .team { margin-top: clamp(24px, 3.4vw, 64px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9em 2em;
  font: 500 clamp(13px, 1.1vw, 21px)/1.3 'Manrope'; max-width: 640px; }
#title .team span { padding-bottom: .35em; border-bottom: 1px solid rgba(255,255,255,.28); min-height: 1.7em; color: var(--ink); }
#title .team span.empty { color: rgba(255,255,255,.28); font-style: italic; }

/* Крупная подпись внизу слева (остановки без карточки) */
#caption { position: fixed; left: calc(var(--gap) * 1.6); bottom: calc(var(--gap) * 2.2); max-width: 60vw;
  transition: opacity .6s var(--ease-out), transform .8s var(--ease-out); }
#caption.off { opacity: 0; transform: translateY(16px); }
#caption .kicker { font: 600 clamp(11px, .95vw, 17px)/1.2 'Manrope'; letter-spacing: .3em; text-transform: uppercase; color: var(--glow); opacity: .9; margin-bottom: .7em; }
#caption .text { font: 700 clamp(26px, 3.2vw, 62px)/1.05 'Unbounded'; letter-spacing: -.015em; text-shadow: 0 3px 30px rgba(0,0,0,.75); }

/* Карточка справа */
#card { position: fixed; right: var(--gap); top: 50%; width: var(--card-w); max-height: calc(100vh - 2 * var(--gap));
  transform: translate(0, calc(-50% + 24px)); opacity: 0; pointer-events: none;
  background: var(--card-bg); backdrop-filter: blur(18px) saturate(1.15); -webkit-backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid rgba(255,255,255,.09); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.3);
  transition: opacity .45s var(--ease-out), transform .6s var(--ease-out); display: flex; flex-direction: column; }
#card.show { opacity: 1; transform: translate(0, -50%); }
#card.hiding { transition-duration: .2s, .2s; transform: translate(0, calc(-50% - 10px)); }
#card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); box-shadow: 0 0 18px var(--accent); }
#card .body { padding: clamp(18px, 1.7vw, 32px) clamp(20px, 1.9vw, 36px) clamp(18px, 1.7vw, 32px) clamp(24px, 2.2vw, 40px); display: flex; flex-direction: column; gap: clamp(10px, 1vw, 18px); min-height: 0; }
#card .kicker { font: 600 clamp(10px, .78vw, 14px)/1.3 'Manrope'; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
#card h2 { margin: 0; font: 700 clamp(19px, 1.75vw, 34px)/1.12 'Unbounded'; letter-spacing: -.01em; text-wrap: balance; }
#card .place { font: 600 clamp(12px, .95vw, 17px)/1.3 'Manrope'; color: var(--ink-dim); margin-top: -.3em; }
#card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .55em; font: 500 clamp(13px, 1.08vw, 20px)/1.35 'Manrope'; }
#card li { position: relative; padding-left: 1.25em; }
#card li::before { content: ''; position: absolute; left: 0; top: .66em; width: .7em; height: 2px; background: var(--accent); border-radius: 2px; }
#card .symbols { display: flex; align-items: center; gap: clamp(12px, 1.2vw, 22px); }
#card .symbols img { display: block; height: clamp(64px, 6.4vw, 124px); width: auto; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }
#card .symbols img.flag { height: clamp(44px, 4.3vw, 84px); border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
#card .symbols .lbl { font: 500 clamp(10px, .75vw, 13px)/1.35 'Manrope'; color: var(--ink-dim); }
#card figure { margin: 0; position: relative; flex-shrink: 1; min-height: 0; }
#card figure img { display: block; width: 100%; aspect-ratio: 16 / 9.5; object-fit: cover; max-height: 34vh; }
#card figure figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.2em 1.2em .6em clamp(24px, 2.2vw, 40px);
  background: linear-gradient(transparent, rgba(0,0,0,.75)); font: 600 clamp(11px, .85vw, 15px)/1.3 'Manrope'; }
#card figure figcaption small { display: block; font-weight: 400; font-size: .78em; opacity: .62; margin-top: .2em; }
#card .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1vw, 18px); }
#card .stat .v { white-space: nowrap; font: 700 clamp(24px, 2.5vw, 48px)/1 'Unbounded'; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#card .stat .v em { font-style: normal; font-size: .4em; font-weight: 600; margin-left: .25em; letter-spacing: 0; color: var(--ink-dim); }
#card .stat .l { font: 500 clamp(11px, .85vw, 15px)/1.3 'Manrope'; color: var(--ink-dim); margin-top: .45em; }
#card .stat .bar { height: 3px; background: rgba(255,255,255,.12); border-radius: 3px; margin-top: .7em; overflow: hidden; }
#card .stat .bar i { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 10px var(--accent); transition: width 1.4s var(--ease-out) .25s; }

/* Подписи городов (HTML-маркеры) */
/* точка ровно в координате города, текст справа (или слева у .left) */
.city { pointer-events: none; position: relative; width: 0; height: 0; opacity: 0; transition: opacity .5s;
  font: 600 clamp(12px, .95vw, 17px)/1 'Manrope'; color: #fff; transform-origin: left center;
  text-shadow: 0 0 2px rgba(0,0,0,.9), 0 0 6px rgba(0,0,0,.8), 0 1px 12px rgba(0,0,0,.6); }
.city.on { opacity: 1; }
.city i { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); width: .55em; height: .55em; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 0 10px rgba(255,255,255,.7); }
.city span { position: absolute; left: .7em; top: 0; transform: translateY(-52%); white-space: nowrap; }
.city.left span { left: auto; right: .7em; }
.city.hq i { background: var(--glow); }
.city.big { font-size: clamp(16px, 1.45vw, 27px); font-weight: 700; }
.city.big i { width: .5em; height: .5em; background: var(--accent); box-shadow: 0 0 0 3px rgba(255,255,255,.95), 0 0 16px var(--accent); }
.maplibregl-marker { will-change: transform; }

/* Служебное */
#hud { position: fixed; left: calc(var(--gap) * 1.6); bottom: calc(var(--gap) * .8); display: flex; align-items: center; gap: 1em;
  font: 600 clamp(10px, .75vw, 13px)/1 'Manrope'; letter-spacing: .18em; color: rgba(255,255,255,.55); transition: opacity .4s; }
#hud .dots { display: flex; gap: 6px; }
#hud .dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.25); transition: background .3s, transform .3s; }
#hud .dots i.on { background: var(--accent); transform: scale(1.3); }
#hud .warm { font-weight: 400; letter-spacing: .06em; color: rgba(255,255,255,.35); }
#credit { position: fixed; right: var(--gap); bottom: calc(var(--gap) * .45); font: 400 clamp(9px, .62vw, 11px)/1.2 'Manrope'; color: rgba(255,255,255,.4); text-align: right; }
#black { position: fixed; inset: 0; background: #000; opacity: 1; pointer-events: none; transition: opacity .6s; z-index: 50; }
#black.off { opacity: 0; }
#loading { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 51; font: 600 13px 'Manrope'; letter-spacing: .3em; color: rgba(255,255,255,.5); text-transform: uppercase; transition: opacity .4s; }
#loading.off { opacity: 0; }

/* Лента времени */
#card .timeline { display: flex; justify-content: space-between; position: relative; margin: .2em 0 .1em; }
#card .timeline::before { content: ''; position: absolute; left: 6px; right: 6px; top: 6px; height: 2px; background: rgba(255,255,255,.14); }
#card .tl { position: relative; display: flex; flex-direction: column; align-items: center; gap: .55em; font: 600 clamp(10px, .78vw, 14px)/1 'Manrope'; color: rgba(255,255,255,.4); }
#card .tl i { width: 12px; height: 12px; border-radius: 50%; background: #1a1d22; border: 2px solid rgba(255,255,255,.3); transition: all .5s; }
#card .tl.past i { background: var(--accent); border-color: var(--accent); }
#card .tl.past { color: rgba(255,255,255,.7); }
#card .tl.now i { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 16px var(--accent); transform: scale(1.15); }
#card .tl.now { color: #fff; }
#card .year { font: 700 clamp(34px, 3.6vw, 68px)/1 'Unbounded'; color: var(--accent); letter-spacing: -.02em; margin-bottom: -.15em;
  animation: rise .7s var(--ease-out) both .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Диаграмма-полосы */
#card .bars { display: flex; flex-direction: column; gap: .7em; }
#card .bars .cap { font: 500 clamp(10px, .75vw, 13px)/1.3 'Manrope'; color: var(--ink-dim); }
#card .bars .lab { display: flex; justify-content: space-between; font: 500 clamp(12px, .95vw, 17px)/1.3 'Manrope'; margin-bottom: .35em; }
#card .bars .lab b { font: 700 clamp(13px, 1.05vw, 19px)/1.3 'Unbounded'; font-variant-numeric: tabular-nums; }
#card .bars .track { height: 8px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
#card .bars .track i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #b8321f, var(--accent)); box-shadow: 0 0 12px var(--accent); transition: width 1.3s var(--ease-out); }

/* Рамки под портреты (фото вставите сами) */
#card .people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1vw, 18px); }
#card .people.n1 { grid-template-columns: minmax(0, .55fr); }
#card .person .frame { aspect-ratio: 3 / 4; border-radius: 10px; border: 1.5px dashed rgba(255,255,255,.3); background: rgba(255,255,255,.04);
  display: grid; place-items: center; overflow: hidden; max-height: 30vh; }
#card .person .frame span { font: 500 clamp(10px, .8vw, 14px) 'Manrope'; color: rgba(255,255,255,.35); letter-spacing: .2em; text-transform: uppercase; }
#card .person .frame img { width: 100%; height: 100%; object-fit: cover; }
#card .person .nm { font: 700 clamp(13px, 1.05vw, 19px)/1.2 'Manrope'; margin-top: .55em; }
#card .person .nt { font: 500 clamp(11px, .82vw, 15px)/1.3 'Manrope'; color: var(--ink-dim); margin-top: .2em; }

/* Видео */
#card .video { border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
#card .video video { width: 100%; height: 100%; object-fit: cover; display: block; }
#card .video.empty { display: grid; place-items: center; align-content: center; gap: .6em; border: 1.5px dashed rgba(255,255,255,.3); background: rgba(255,255,255,.04); }
#card .video.empty span { font-size: clamp(28px, 2.6vw, 48px); color: var(--accent); }
#card .video.empty small { font: 500 clamp(11px, .85vw, 15px)/1.3 'Manrope'; color: var(--ink-dim); text-align: center; padding: 0 1em; }

/* Финал */
#caption.big .text { font-size: clamp(36px, 5vw, 96px); }

/* ---------- Крупные фото: каждая фотография — отдельная карточка ---------- */
/* затемнение карты под фото: слева у точки посадки карта видна */
#dim { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s var(--ease-out);
  background: linear-gradient(90deg, rgba(3,5,8,0) 8%, rgba(3,5,8,.55) 20%, rgba(3,5,8,.78) 40%); }
#dim.on { opacity: 1; }
#gallery { position: fixed; left: 20.5vw; right: var(--gap); top: calc(var(--gap) * .9); bottom: calc(var(--gap) * 1.5);
  display: flex; align-items: center; justify-content: flex-end; column-gap: clamp(12px, 1.3vw, 26px); pointer-events: none; }
#gallery > * { opacity: 0; transform: translateY(26px); transition: opacity .5s var(--ease-out), transform .7s var(--ease-out); }
#gallery.show > * { opacity: 1; transform: none; }
#gallery.show > :nth-child(2) { transition-delay: .08s; } #gallery.show > :nth-child(3) { transition-delay: .16s; } #gallery.show > :nth-child(4) { transition-delay: .24s; }
#gallery.hiding > * { opacity: 0; transform: translateY(-10px); transition-duration: .2s; transition-delay: 0s; }
.gtext, .gphoto, .gcard { position: relative; background: rgba(9, 11, 15, .86); border: 1px solid rgba(255,255,255,.09); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.gtext::before, .gphoto::before, .gcard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); box-shadow: 0 0 18px var(--accent); z-index: 1; }
.gtext { flex: 0 0 clamp(220px, 21vw, 400px); align-self: center; padding: clamp(18px, 1.7vw, 32px) clamp(18px, 1.7vw, 32px) clamp(18px, 1.7vw, 32px) clamp(22px, 2vw, 38px);
  display: flex; flex-direction: column; gap: clamp(10px, 1vw, 18px); }
.gtext .kicker { font: 600 clamp(10px, .74vw, 14px)/1.3 'Manrope'; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.gtext h2 { margin: 0; font: 700 clamp(18px, 1.7vw, 34px)/1.12 'Unbounded'; letter-spacing: -.01em; text-wrap: balance; }
.gtext ul, .gcard ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .55em; font: 500 clamp(13px, 1.05vw, 20px)/1.35 'Manrope'; }
.gtext li, .gcard li { position: relative; padding-left: 1.25em; }
.gtext li::before, .gcard li::before { content: ''; position: absolute; left: 0; top: .66em; width: .7em; height: 2px; background: var(--accent); border-radius: 2px; }
.gphoto { margin: 0; flex: 0 0 auto; padding: 0 0 0 4px; }
.gphoto img { display: block; object-fit: cover; }
.gphoto figcaption { padding: clamp(10px, .9vw, 16px) clamp(14px, 1.2vw, 22px) clamp(12px, 1vw, 18px); display: flex; flex-direction: column; gap: .25em; }
.gphoto figcaption b { font: 700 clamp(14px, 1.15vw, 22px)/1.2 'Manrope'; }
.gphoto figcaption span { font: 500 clamp(12px, .9vw, 17px)/1.3 'Manrope'; color: var(--ink-dim); }
.gphoto figcaption small { font: 400 clamp(9px, .62vw, 12px)/1.3 'Manrope'; color: rgba(255,255,255,.42); }

/* ---------- Несколько субъектов на слайде: карточки по бокам, выноски к центрам ---------- */
#group { position: fixed; inset: 0; pointer-events: none; }
#group .leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#group .leaders path { fill: none; stroke: var(--glow); stroke-width: 1.6; opacity: .85; filter: drop-shadow(0 0 3px rgba(0,0,0,.9));
  transition: stroke-dashoffset .5s var(--ease-out); }
#group.hiding .leaders, #group.hiding .gcard { opacity: 0; transition: opacity .2s; }
.gcard { position: absolute; width: var(--gw); padding: clamp(12px, 1.1vw, 20px) clamp(14px, 1.2vw, 22px) clamp(14px, 1.2vw, 22px) clamp(18px, 1.5vw, 28px);
  display: flex; flex-direction: column; gap: clamp(6px, .6vw, 11px); opacity: 0; transform: translateY(14px); transition: opacity .45s var(--ease-out), transform .6s var(--ease-out); }
.gcard.show { opacity: 1; transform: none; }
.gcard .sym { display: flex; align-items: center; gap: clamp(10px, .9vw, 16px); }
.gcard .sym img.coat { height: clamp(52px, 4.6vw, 90px); width: auto; filter: drop-shadow(0 4px 12px rgba(0,0,0,.5)); }
.gcard .sym img.flag { height: clamp(34px, 3vw, 58px); width: auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.gcard h3 { margin: 0; font: 700 clamp(14px, 1.15vw, 22px)/1.15 'Unbounded'; letter-spacing: -.01em; text-wrap: balance; }
.gcard .place { font: 600 clamp(11px, .85vw, 16px)/1.3 'Manrope'; color: var(--glow); }
.gcard ul { font-size: clamp(12px, .9vw, 17px); gap: .4em; }

#gallery .gphotos { display: flex; flex-direction: row; align-items: center; gap: clamp(12px, 1.3vw, 26px); flex: 0 0 auto; }
#gallery .gphotos.col { flex-direction: column; }
#gallery .gphotos .gphoto { opacity: 0; transform: translateY(26px); transition: opacity .5s var(--ease-out), transform .7s var(--ease-out); }
#gallery.show .gphotos .gphoto { opacity: 1; transform: none; }
#gallery.show .gphotos .gphoto:nth-child(2) { transition-delay: .1s; } #gallery.show .gphotos .gphoto:nth-child(3) { transition-delay: .2s; }
#gallery.hiding .gphotos .gphoto { opacity: 0; transition-duration: .2s; transition-delay: 0s; }

#gallery.stack { flex-direction: column; align-items: flex-end; justify-content: center; row-gap: clamp(12px, 1.3vw, 26px); }
#gallery.stack .gtext { flex: 0 0 auto; align-self: flex-end; width: min(100%, 760px); }
.city.left.fr span { left: .7em; right: auto; }

/* крупные карточки субъектов */
.gcard { padding: clamp(14px, 1.4vw, 28px) clamp(16px, 1.5vw, 30px) clamp(16px, 1.5vw, 30px) clamp(20px, 1.9vw, 36px); gap: clamp(8px, .8vw, 14px); }
.gcard .sym img.coat { height: clamp(60px, 6vw, 120px); }
.gcard .sym img.flag { height: clamp(40px, 3.9vw, 78px); }
.gcard h3 { font-size: clamp(17px, 1.6vw, 32px); }
.gcard .place { font-size: clamp(13px, 1.1vw, 21px); }
.gcard ul { font-size: clamp(13px, 1.15vw, 22px); }
#group .leaders circle.end { fill: var(--glow); }

#gallery .gphotos.grid { flex-wrap: wrap; justify-content: center; align-content: center; }
