:root {
  --navy-950: #08131F;
  --navy-900: #0B1B2E;
  --navy: #1A3A5F;
  --navy-500: #2C5A8A;
  --flow: #7FB8FF;
  --mist: #EEF2F6;
  --white: #FFFFFF;
  --graphite: #2B2F36;
  --muted: #9DB0C4;
  --coral: #FF7A59;
  --coral-ink: #A83A1E; /* коралл для текста на светлом фоне: контраст ≥ 4.5:1 */
  --display: 'Onest', system-ui, sans-serif;
  --text: 'Onest', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --gut: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--navy-950); color: var(--mist);
  font: 400 17px/1.55 var(--text); overflow-x: hidden;
  background-image: radial-gradient(120% 70% at 75% 0%, #15335A 0%, var(--navy-900) 45%, var(--navy-950) 100%);
  background-attachment: fixed;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -.02em; margin: 0; }
.mono { font: 500 13px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--white); color: var(--navy); padding: 8px 12px; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }

#leg { position: fixed; inset: 0; width: 100vw; height: 100svh; z-index: 0; pointer-events: none; transition: opacity .6s; }
body.in-story #leg { opacity: .4; } /* в истории главная — схема, нога лишь контекст */
body.past-story #leg { opacity: 0; }
body.mid #leg { opacity: .12; }
main, .top, .foot { position: relative; z-index: 1; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; text-decoration: none;
  font: 500 16px/1 var(--display); transition: transform .25s var(--ease), background .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn--coral { background: var(--coral); color: #1B0F0B; box-shadow: 0 10px 30px -10px rgba(255, 122, 89, .7); }
.btn--coral:hover { box-shadow: 0 14px 36px -10px rgba(255, 122, 89, .9); }
.btn--ghost { border: 1px solid rgba(238, 242, 246, .35); color: var(--mist); background: rgba(255, 255, 255, .04); backdrop-filter: blur(6px); }
.btn--ghost:hover { border-color: var(--mist); }
.btn--ghost-dark { border: 1px solid var(--navy); color: var(--navy); background: transparent; }
.btn--small { min-height: 40px; padding: 0 18px; font-size: 14px; }

/* шапка */
.top {
  position: fixed; inset: 0 0 auto; display: flex; align-items: center; gap: 28px;
  padding: 16px var(--gut); z-index: 20;
  background: rgba(8, 19, 31, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.logo { font: 600 18px/1 var(--display); text-decoration: none; letter-spacing: -.01em; margin-right: auto; }
.logo span { font: 400 11px var(--mono); color: var(--muted); margin-left: 8px; text-transform: uppercase; letter-spacing: .1em; }
.nav { display: flex; gap: 24px; font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--mist); }

/* hero */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding: 110px var(--gut) 90px; position: relative;
}
.hero__text { max-width: 860px; }
.who { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); margin-bottom: 30px; }
.who b { color: var(--mist); font-weight: 500; }
.who__photo {
  flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--navy-500), var(--navy)); color: var(--mist);
  font: 500 15px var(--display); border: 1px solid rgba(255, 255, 255, .2);
}
.hero__title { font-size: clamp(44px, 6.6vw, 104px); line-height: .98; font-weight: 400; letter-spacing: -.035em; }
.hero__title em { font-style: normal; color: var(--coral); }
.hero__lead { font-size: clamp(17px, 1.5vw, 21px); max-width: 30em; margin: 26px 0 32px; color: #C9D6E3; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.facts { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; max-width: 640px; }
.facts li { font-size: 13px; line-height: 1.45; color: var(--muted); border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 12px; }
.facts b { display: block; font: 500 22px/1.2 var(--display); color: var(--mist); margin-bottom: 6px; }
.scrollcue {
  position: absolute; left: var(--gut); bottom: 28px; display: flex; align-items: center; gap: 12px;
  font: 400 12px var(--mono); color: var(--muted); text-decoration: none; text-transform: uppercase; letter-spacing: .08em;
}
.scrollcue span { width: 1px; height: 36px; background: linear-gradient(var(--coral), transparent); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* история */
.story { position: relative; }
.story__stage { position: sticky; top: 0; height: 100svh; pointer-events: none; }
.lens {
  position: absolute; left: 38vw; top: 53%; width: min(500px, 32vw); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(circle at 40% 35%, #173A62, #0A1A2C 70%);
  box-shadow: 0 0 0 1px rgba(127, 184, 255, .25), 0 30px 80px -20px rgba(0, 0, 0, .7), inset 0 0 60px rgba(127, 184, 255, .08);
  opacity: 0; transition: opacity .6s;
}
body.in-story .lens { opacity: 1; }
.lens svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.lens__label {
  position: absolute; left: 50%; bottom: -36px; transform: translateX(-50%); white-space: nowrap;
  font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--coral);
}
.story__steps { margin-top: -100svh; padding: 0 var(--gut) 0 68vw; position: relative; }
.story__head { min-height: 60svh; display: flex; flex-direction: column; justify-content: center; padding-top: 20svh; }
.story__head h2 { font-size: clamp(36px, 5vw, 72px); line-height: 1; margin-bottom: 14px; }
.story__head p:last-child { color: var(--muted); margin: 0; }
.step { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; max-width: 520px; }
.step__card > :not(.urgent) { transition: opacity .5s; }
.step:not(.is-active) .step__card > :not(.urgent) { opacity: .25; }
.step.is-active .step__card > * { transition-delay: .6s; }
.step--long { min-height: 170svh; }
.step h3 { font-size: clamp(24px, 2.3vw, 34px); line-height: 1.1; margin-bottom: 10px; }
.step p { margin: 0 0 18px; color: #C9D6E3; }
.tags { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font: 400 13px var(--mono); padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(127, 184, 255, .3); color: #BFD7EA; }
.warn { font-size: 15px !important; line-height: 1.4; color: var(--mist) !important; border-left: 2px solid var(--coral); padding-left: 12px; margin-top: 22px !important; }

.rail { position: fixed; right: 20px; top: 50%; transform: translateY(-50%); display: grid; gap: 0; z-index: 5; opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .4s, visibility .4s; }
body.in-story .rail { opacity: 1; pointer-events: auto; visibility: visible; }
.rail button { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.rail button::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--muted); }
.rail button.is-active::before { background: var(--coral); border-color: var(--coral); }

/* финал */
.final { background: var(--mist); color: var(--navy); padding: 18svh var(--gut); position: relative; z-index: 2; }
.final h2 { font-size: clamp(36px, 6vw, 88px); line-height: 1; font-weight: 400; letter-spacing: -.035em; max-width: 12em; margin-bottom: 22px; }
.final .mono { color: var(--coral-ink); }
.final :focus-visible, .foot :focus-visible { outline-color: var(--navy); }
.final__lead { font-size: clamp(17px, 1.5vw, 21px); max-width: 32em; margin: 0 0 34px; color: #33475C; }
.todo { margin-top: 48px; font: 400 13px var(--mono); color: #5B6B7C; }
.foot { display: flow-root; background: var(--mist); color: #4A5866; padding: 0 var(--gut) 110px; font-size: 13px; z-index: 2; }
.warn--hero { margin: 18px 0 0 !important; font-size: 15px !important; min-height: 48px; display: flex; align-items: center; }
.warn--light { color: var(--navy) !important; margin-top: 28px !important; font-size: 15px !important; }
.urgent { margin-top: 22px; padding: 16px 18px; border-radius: 14px; background: rgba(238, 242, 246, .07); border: 1px solid rgba(238, 242, 246, .2); }
.urgent b { font: 500 15px var(--display); color: var(--mist); }
.urgent p { font-size: 14px; margin: 6px 0 0 !important; }
.voice { font-size: 18px !important; color: var(--mist) !important; font-style: italic; }
.contact { color: #33475C; margin: 24px 0 0; }
.msg { margin-top: 30px; max-width: 34em; padding: 18px 20px; border-radius: 14px; background: var(--white); border: 1px solid #D5DEE7; }
.msg__label { margin: 0 0 6px; font: 500 13px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: #5B6B7C; }
.msg__text { margin: 0 0 12px; color: var(--navy); }
.msg__copy { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--navy); background: transparent; color: var(--navy); font: 500 14px var(--display); cursor: pointer; }
.contact a { color: var(--navy); font-weight: 500; }
button.btn { border: 0; cursor: pointer; }
button.btn--ghost, button.btn--ghost-dark { border: 1px solid; }
button.btn--ghost { border-color: rgba(238, 242, 246, .35); }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 40; margin: 0; max-width: calc(100vw - 32px);
  background: var(--white); color: var(--navy); padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hint { margin-top: 18px !important; font-size: 15px; color: var(--peach, #FFB39A) !important; }
.more { margin: 0 0 14px; }
.more summary { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 500 15px var(--display); color: var(--mist); list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: '+'; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); }
.more[open] summary::after { content: '−'; }
.more p { margin: 6px 0 0 !important; }
.callouts { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.co { transition: opacity .5s; }
.co text { font: 500 11px var(--display); fill: #fff; }
.co rect { fill: rgba(10, 16, 44, .88); stroke: rgba(255, 179, 154, .7); stroke-width: .8; }
.co line { stroke: #FFB39A; stroke-width: 1.1; }
.co .dot { fill: #FF7A59; }
.co .ring { fill: none; stroke: #FF7A59; stroke-width: 1.2; }
.lens__now {
  position: absolute; left: 50%; bottom: calc(100% + 22px); transform: translateX(-50%); margin: 0;
  width: max-content; max-width: 44vw; text-align: center; font: 500 clamp(16px, 1.35vw, 21px)/1.3 var(--display); color: #fff;
  background: rgba(10, 16, 44, .78); border: 1px solid rgba(255, 179, 154, .45); padding: 10px 20px; border-radius: 999px;
  transition: border-color .3s;
}
.lens__now.flash { border-color: #FF7A59; }
.warn--big { font-size: 15px !important; color: var(--navy) !important; font-weight: 500; }

.dock { display: none; }
.hills { display: none; }

/* появление */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: .08s; }
.hero .reveal:nth-child(3) { transition-delay: .16s; }
.hero .reveal:nth-child(4) { transition-delay: .24s; }
.hero .reveal:nth-child(5) { transition-delay: .32s; }

body.no-webgl #leg { display: none; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .top .btn { display: none; }
  .hero { justify-content: flex-end; padding-bottom: 120px; }
  .facts { grid-template-columns: 1fr; gap: 12px; margin-top: 32px; }
  .facts li { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: baseline; }
  .facts b { font-size: 18px; margin: 0; }
  .scrollcue { display: none; }
  .lens { left: 50%; top: 74px; width: min(84vw, 40svh); transform: translateX(-50%); }
  .lens__now { bottom: auto; top: calc(100% + 12px); max-width: 92vw; font-size: 15px; padding: 8px 14px; }
  .co text { font-size: 15px; }
  .story__steps { padding: 0 var(--gut); }
  .story__head { padding-top: 52svh; min-height: 0; padding-bottom: 20svh; }
  /* между карточками ~полэкрана «чистой» анимации: сначала показываем, потом объясняем */
  .step { min-height: 150svh; justify-content: flex-end; padding-bottom: 96px; max-width: none; opacity: 1; }
  .step--long { min-height: 220svh; }
  .step__card { background: rgba(8, 19, 31, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px; padding: 20px 18px; }
  .step h3 { font-size: 26px; margin-bottom: 12px; }
  body:not(.scrolled) #leg { opacity: .3; }
  .warn--hero { background: rgba(8, 19, 31, .85); padding: 8px 12px !important; }
  .tags li { font: 400 14px var(--text); }
  .rail { display: none; } /* на телефоне — нативный скролл, рельс налезал на карточки */
  .dock {
    display: flex; gap: 8px; position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 30; padding: 8px; border-radius: 999px; background: rgba(8, 19, 31, .8); backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .12); transform: translateY(140%); visibility: hidden; transition: transform .4s var(--ease), visibility .4s;
  }
  .dock .btn { flex: 1; min-height: 48px; }
  body.scrolled:not(.at-final) .dock { transform: none; visibility: visible; } /* в блоке записи свои кнопки */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transform: none; transition: opacity .3s; }
  .scrollcue span { animation: none; }
  .btn:hover { transform: none; }
}
