/* Вариант 2 — «Простор». Референс: Genesis — снимок неба на весь экран как пейзаж, текст по центру в небе,
   ровный гротеск средней жирности, светлая «таблетка» с круглым значком над заголовком, тёмная кнопка,
   цветной логотип из разноцветных букв, справа светлая кнопка и круглая кнопка-глобус. */

:root {
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --logo: "Montserrat", system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 82px);
  --swap-out: 340ms;
}
body { font-family: var(--sans); }

.photo { z-index: 0; }
.veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 10, 22, .5) 0%, rgba(8, 10, 22, .18) 34%, rgba(8, 10, 22, 0) 52%, rgba(6, 6, 12, .12) 74%, rgba(6, 6, 12, .62) 100%);
  transition: opacity .8s var(--ease);
}
body[data-ty="bottom"][data-mode="scene"] .veil {
  background: linear-gradient(180deg, rgba(8, 10, 22, .42) 0%, rgba(8, 10, 22, 0) 22%, rgba(6, 6, 12, 0) 40%, rgba(6, 6, 12, .45) 70%, rgba(6, 6, 12, .72) 100%);
}
body.is-sky .veil { opacity: 0; }

/* ——— верх ——— */
.top {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(16px + var(--sat)) calc(var(--gutter) + var(--sar)) 0 calc(var(--gutter) + var(--sal));
}
.wordmark {
  font: 600 clamp(24px, 2.6vw, 38px)/1 var(--logo); letter-spacing: .2em; padding-left: .02em;
  background: linear-gradient(90deg, #ff9f57 0%, #ff5d55 24%, #f2509c 46%, #a56bf0 68%, #47a8f0 84%, #4fd1a5 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 10px rgba(0, 0, 0, .25));
}
.top-right { display: flex; align-items: center; gap: 12px; }
.pill-light, .round {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; border-radius: 999px;
  background: rgba(240, 244, 250, .22); color: var(--milk);
  font: 500 17px/1 var(--sans);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: background .25s;
}
.pill-light { padding: 0 24px; }
.round { width: 48px; }
.round svg { width: 22px; height: 22px; }
.pill-light:hover, .round:hover { background: rgba(240, 244, 250, .34); }
.pill-light[aria-pressed="true"] { background: var(--milk); color: #1d2030; }

/* ——— экраны ——— */
.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: calc(clamp(86px, 11vh, 120px) + var(--sat)) calc(var(--gutter) + var(--sar)) calc(150px + var(--sab)) calc(var(--gutter) + var(--sal));
}
.copy { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: clamp(12px, 1.9vh, 22px); width: 100%; max-width: 1180px; margin: 0 auto; }
.copy::before { content: ""; position: absolute; z-index: -1; inset: -12% -8%; pointer-events: none; background: radial-gradient(closest-side, rgba(8, 10, 22, .4), rgba(8, 10, 22, 0)); }

.chip {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 clamp(4px, 1vh, 12px);
  padding: 7px 20px 7px 8px; border-radius: 999px;
  background: rgba(240, 244, 250, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  font: 500 clamp(14px, 1.2vw, 17px)/1.2 var(--sans); color: var(--milk);
}
.chip-ico {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: conic-gradient(from 200deg, var(--c1), var(--c2), var(--c3), var(--c6), var(--c1));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5);
  position: relative;
}
.chip-ico::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9); border-top-color: transparent; transform: rotate(-30deg); }

.headline {
  margin: 0; width: 100%;
  font: 500 clamp(34px, 5.2vw, 84px)/1.08 var(--sans); letter-spacing: -.022em;
  color: var(--milk); text-wrap: balance;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .3);
}
.headline [data-fit-line] { display: block; white-space: nowrap; overflow: hidden; }
.h-lead { display: block; }
.h-title {
  background: linear-gradient(90deg, var(--milk) 0%, var(--milk) 35%, var(--tint) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 2px 22px rgba(0, 0, 0, .25));
}
.sub {
  margin: 0; max-width: 40ch;
  font: 400 clamp(17px, 1.6vw, 25px)/1.42 var(--sans); color: rgba(255, 247, 239, .92);
  text-wrap: pretty; text-shadow: 0 1px 20px rgba(0, 0, 0, .35);
}
.actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 34px; border-radius: 999px;
  background: var(--cta-deep); color: #fff;
  font: 500 clamp(17px, 1.4vw, 20px)/1 var(--sans);
  box-shadow: 0 12px 34px -12px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform .2s var(--ease), background .4s;
}
.cta:hover { transform: translateY(-1px); }
.ghost { font: 500 16px/1 var(--sans); color: rgba(255, 247, 239, .88); padding: 12px 6px; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: rgba(255, 247, 239, .4); }
.intro .cta, .finale .cta { margin-top: 6px; }

/* положение текста */
body[data-ty="middle"] .scene { justify-content: center; }
body[data-ty="bottom"] .scene { justify-content: flex-end; }
body[data-tx="left"] .scene .copy { align-items: flex-start; text-align: left; margin-left: 0; }
body[data-tx="left"] .scene .actions { justify-content: flex-start; }
body[data-tx="right"] .scene .copy { align-items: flex-end; text-align: right; margin-right: 0; }
body[data-tx="right"] .scene .actions { justify-content: flex-end; }

[data-swap].is-out { transform: translateY(14px); }
body[data-dir="prev"] [data-swap].is-out { transform: translateY(-14px); }

/* ——— низ ——— */
.foot {
  position: fixed; z-index: 20; left: calc(var(--gutter) + var(--sal)); right: calc(var(--gutter) + var(--sar)); bottom: calc(92px + var(--sab));
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; pointer-events: none;
}
.foot p { margin: 0; }
.foot button { pointer-events: auto; }
.meta { font: 500 14px/1.4 var(--sans); color: rgba(255, 247, 239, .86); display: flex; gap: 12px; flex-wrap: wrap; }
.meta button { color: var(--tint); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, .3); }
.credit button { font: 400 12px/1.3 var(--sans); color: rgba(255, 247, 239, .6); text-align: right; }
body[data-mode="intro"] .foot { bottom: calc(22px + var(--sab)); }

/* ——— таймлайн ——— */
.tl { position: fixed; z-index: 20; left: 0; right: 0; bottom: calc(12px + var(--sab)); padding: 0 calc(var(--gutter) + var(--sar)) 0 calc(var(--gutter) + var(--sal)); }
.tl-line { display: none; }
.tl-track { gap: 0; padding: 6px 0 4px; }
.tl-track::before, .tl-track::after { content: ""; flex: 1 0 0px; }
.tl-dot { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: clamp(110px, 13vw, 190px); min-height: 56px; padding: 0 8px; color: rgba(255, 247, 239, .6); }
.tl-dot::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 1px; background: rgba(255, 247, 239, .32); }
.tl-pin { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: rgba(255, 247, 239, .78); transition: transform .4s var(--ease), background .4s, box-shadow .4s; }
.tl-label { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 500 13px/1.15 var(--sans); white-space: nowrap; }
.tl-date { font-size: 11.5px; opacity: .75; }
.tl-date:empty { display: none; }
.tl-dot.is-active { color: var(--milk); }
.tl-dot.is-active .tl-pin { background: var(--milk); transform: scale(1.4); box-shadow: 0 0 0 5px rgba(255, 247, 239, .2); }
.tl-dot:hover { color: var(--milk); }

/* ——— панели ——— */
.panel {
  left: 10px; right: 10px; bottom: calc(10px + var(--sab));
  max-height: calc(100svh - 90px - var(--sat)); overflow: auto; overscroll-behavior: contain;
  padding: 22px 22px 20px; border-radius: 24px;
  background: #f4f6fa; color: #1c2131; font: 400 15px/1.45 var(--sans);
  box-shadow: 0 34px 90px -24px rgba(0, 0, 0, .6);
}
.panel-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; font: 300 28px/1 var(--sans); color: #4a5064; }
.panel-close:hover { background: #e5e9f1; }
.panel-chip { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 5px 14px 5px 5px; border-radius: 999px; background: #e6eaf2; font: 500 13px/1 var(--sans); color: #3b4258; }
.panel-chip .chip-ico { width: 24px; height: 24px; }
.panel-chip .chip-ico::after { inset: 6px; border-width: 1.5px; }
.panel-title { margin: 0 40px 8px 0; font: 500 26px/1.12 var(--sans); letter-spacing: -.015em; }
.panel-lead { margin: 0 0 4px; font-weight: 500; }
.panel-small { margin: 0 0 12px; color: #5b6276; font-size: 14px; }
.panel-list { display: grid; grid-template-columns: 112px 1fr; gap: 7px 12px; margin: 12px 0 16px; font-size: 14px; }
.panel-list dt { color: #7a8196; }
.panel-list dd { margin: 0; }
.panel-cta { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px; background: #6d1a2c; color: #fff; text-decoration: none; font-weight: 500; }
.panel--where { text-align: center; }
.panel--where canvas { width: min(230px, 62vw); margin: 4px auto 8px; --globe-bg: #121726; --globe-ink: rgba(244, 246, 250, .92); --globe-line: rgba(244, 246, 250, .16); --globe-accent: #ff7a8a; }
.panel--where .panel-title { margin: 8px 0 4px; }
.panel-coords { font-size: 12.5px; margin-bottom: 0; }
@media (min-width: 760px) {
  .panel { left: auto; right: calc(var(--gutter) + var(--sar)); top: calc(80px + var(--sat)); bottom: auto; width: 420px; }
  .panel--where { width: 340px; }
}

@media (max-width: 600px) {
  .pill-light { height: 42px; padding: 0 16px; font-size: 15px; }
  .round { width: 42px; height: 42px; }
  .chip { padding: 5px 16px 5px 5px; gap: 10px; }
  .chip-ico { width: 28px; height: 28px; }
  .chip-ico::after { inset: 7px; }
  .foot { bottom: calc(86px + var(--sab)); flex-direction: column; align-items: center; gap: 6px; text-align: center; }
  .meta { justify-content: center; font-size: 13px; }
  .credit button { text-align: center; font-size: 11px; }
  .screen { padding-bottom: calc(160px + var(--sab)); }
  .tl-dot { min-width: 118px; }
}
@media (max-height: 520px) {
  .screen { padding-top: calc(64px + var(--sat)); padding-bottom: calc(96px + var(--sab)); }
  .copy { gap: 8px; }
  .chip { margin-bottom: 0; font-size: 13px; }
  .sub { font-size: 15px; max-width: 60ch; }
  .cta { min-height: 44px; font-size: 15px; }
  .foot { bottom: calc(60px + var(--sab)); }
  .tl-dot { min-height: 44px; }
  .tl-date { display: none; }
}
