/* Маракуйя · обвязка — стили: тёмная «студия», стеклянные панели, моушен.
 * Шрифты только системные: сайт статический и работает без внешних загрузок.
 */

:root {
  --ink: #07080b;
  --ink-2: #0d0f14;
  --cream: #f2efe9;
  --amber: #ffb04a;
  --violet: #a487ff;
  --cyan: #5cd8ee;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: rgba(255, 255, 255, 0.80);
  --text-dim: rgba(255, 255, 255, 0.56);
  --text-faint: rgba(255, 255, 255, 0.38);
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --panel: linear-gradient(160deg, rgba(24, 27, 34, 0.72), rgba(9, 10, 14, 0.62));
  --radius: 22px;
  --gutter: clamp(20px, 5vw, 88px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(120% 80% at 50% 0%, #14161d 0%, #07080b 60%, #050609 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: #0a0b0f; }
body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; }

a { color: inherit; }

::selection { background: var(--amber); color: #10100e; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── сцена ── */

.stage-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}

[data-webgl='off'] .stage-canvas { display: none; }

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(140% 100% at 50% 45%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0) 74%, rgba(0, 0, 0, 0.55) 100%);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9;
  padding: 10px 16px;
  background: var(--cream);
  color: #10100e;
  border-radius: 0 0 10px 0;
  font-size: 0.85rem;
}

.skip:focus { left: 0; }

/* ── шапка ── */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  background: linear-gradient(180deg, rgba(7, 8, 11, 0.86) 0%, rgba(7, 8, 11, 0.35) 62%, rgba(7, 8, 11, 0) 100%);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand__mark {
  color: var(--amber);
  display: flex;
  transform: translateZ(0);
  animation: brandSpin 26s linear infinite;
}

@keyframes brandSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }

.brand__name { font-size: 0.98rem; font-weight: 600; letter-spacing: -0.01em; color: var(--cream); }

.brand__tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.dot-nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 18px);
  min-width: 0;
  overflow: hidden;
}

.dot-nav__item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--text-faint);
  transition: color 0.3s ease;
  white-space: nowrap;
}

.dot-nav__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.dot-nav__label { display: none; }

.dot-nav__item:hover { color: var(--text); }

.dot-nav__item[aria-current='true'] { color: var(--cream); }

.dot-nav__item[aria-current='true'] .dot-nav__dot {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(255, 176, 74, 0.9);
  transform: scale(1.45);
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.lang:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }

.lang__icon { color: var(--amber); font-size: 0.9rem; line-height: 1; }

/* ── секции ── */

main { position: relative; z-index: 2; }

.stage {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(96px, 13vh, 150px) var(--gutter) clamp(84px, 12vh, 130px);
}

.stage__inner {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 36rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 4vw, 56px);
}

.stage--right .stage__copy { grid-column: 2; }
.stage--right .stage__index { grid-column: 1; grid-row: 1; justify-self: start; }

.stage__copy {
  padding: clamp(22px, 2.6vw, 38px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 0 32px 80px -48px rgba(0, 0, 0, 0.95);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1), transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.stage[data-visible='true'] .stage__copy { opacity: 1; transform: none; }

.stage__eyebrow {
  display: block;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}

.stage__title {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 2.9vw, 2.85rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--cream);
  text-wrap: balance;
}

.stage--hero .stage__title { font-size: clamp(2.15rem, 4.4vw, 4rem); }

.stage__lead {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(0.95rem, 1.05vw, 1.06rem);
  line-height: 1.55;
  color: var(--text);
}

.stage__note {
  margin: 18px 0 0;
  max-width: 52ch;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.stage__note.hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--amber);
  cursor: pointer;
  display: inline-block;
  margin-top: 22px;
}

.stage__note.hint::after {
  content: ' ↓';
  display: inline-block;
  animation: hintBob 2.4s ease-in-out infinite;
}

@keyframes hintBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.stage__index {
  font-family: var(--mono);
  font-size: clamp(3.4rem, 9vw, 7.6rem);
  font-weight: 600;
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.07);
  justify-self: end;
  user-select: none;
}

/* ── блоки внутри секций ── */

.stats,
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
}

.stat__value {
  font-size: clamp(1.45rem, 2.2vw, 2.05rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.stat:nth-child(2) .stat__value { color: var(--violet); }
.stat:nth-child(3) .stat__value { color: var(--cyan); }

.stat__label { font-size: 0.86rem; color: var(--text); line-height: 1.35; }

.stat__hint {
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--text-faint);
}

.card {
  padding: 16px 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.card__kpi {
  display: block;
  font-size: clamp(1.3rem, 2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.card:nth-child(2) .card__kpi { color: var(--violet); }
.card:nth-child(3) .card__kpi { color: var(--cyan); }

.card__title { margin: 8px 0 6px; font-size: 0.94rem; font-weight: 600; color: var(--cream); }

.card__text { margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--text-dim); }

.bullets {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 11px;
}

.bullets__item {
  position: relative;
  padding-left: 24px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

.bullets__item::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.52em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 12px rgba(164, 135, 255, 0.85);
}

.bullets__item:nth-child(even)::before { background: var(--cyan); box-shadow: 0 0 12px rgba(92, 216, 238, 0.85); }

.bars { display: grid; gap: 14px; margin-top: 22px; }

.bar__head { display: flex; align-items: baseline; gap: 12px; }

.bar__value {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.bar:nth-child(2) .bar__value { color: var(--violet); }
.bar:nth-child(3) .bar__value { color: var(--cyan); }

.bar__name {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.bar__track {
  position: relative;
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.bar__fill {
  height: 100%;
  width: var(--bar, 10%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--violet));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.stage[data-visible='true'] .bar__fill { transform: scaleX(1); }

.bar:nth-child(2) .bar__fill { background: linear-gradient(90deg, var(--violet), var(--cyan)); }
.bar:nth-child(3) .bar__fill { background: linear-gradient(90deg, var(--cyan), var(--cream)); }

.bar__note { margin: 7px 0 0; font-size: 0.74rem; color: var(--text-faint); line-height: 1.45; }

.measures {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.measure__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }

.measure__value { font-size: 1rem; font-weight: 600; color: var(--cyan); font-variant-numeric: tabular-nums; }

.measure__name {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.measure__text { margin: 5px 0 0; font-size: 0.83rem; line-height: 1.5; color: var(--text-dim); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.chip {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text);
}

.chip:nth-child(3n + 1) { border-color: rgba(255, 176, 74, 0.45); color: var(--amber); }
.chip:nth-child(3n + 2) { border-color: rgba(164, 135, 255, 0.45); color: var(--violet); }
.chip:nth-child(3n) { border-color: rgba(92, 216, 238, 0.45); color: var(--cyan); }

.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.button {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--cream);
  color: #10100e;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.button:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -20px rgba(242, 239, 233, 0.8); }

.prompt { margin-top: 22px; padding: 4px 0 4px 16px; border-left: 2px solid var(--violet); }

.prompt__label {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet);
}

.prompt__text { margin: 7px 0 0; font-size: 0.87rem; line-height: 1.55; color: var(--text-dim); }

/* ── подвал ── */

.site-footer {
  position: relative;
  z-index: 2;
  padding: 44px var(--gutter) 110px;
  display: grid;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.site-footer p { margin: 0; max-width: 60ch; }

.site-footer__note { color: var(--text-dim); }

/* ── шкала разделов ── */

.timeline {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px var(--gutter) 16px;
  background: linear-gradient(180deg, rgba(7, 8, 11, 0) 0%, rgba(7, 8, 11, 0.88) 70%);
  backdrop-filter: blur(6px);
}

.timeline__now {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 9.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.timeline__num { color: var(--amber); font-weight: 600; }

.timeline__label { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.66rem; }

.timeline__rail {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
}

.timeline__fill {
  position: absolute;
  left: 0;
  bottom: 2px;
  height: 1px;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--violet), var(--amber));
  transition: width 0.2s linear;
}

.timeline__tick {
  position: relative;
  flex: 1;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.timeline__tick::before {
  content: '';
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.13);
  transition: background 0.3s ease;
}

.timeline__tick:hover::before { background: rgba(255, 255, 255, 0.34); }

.timeline__tick[data-current='true']::before { background: var(--amber); }

.timeline__num {
  position: absolute;
  top: 8px;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--text-faint);
}

.timeline__tick[data-current='true'] .timeline__num { color: var(--cream); }

/* ── заглушка без WebGL ── */

.fallback {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 5;
  width: min(660px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 176, 74, 0.42);
  background: rgba(24, 15, 8, 0.92);
  color: #ffd9b0;
  font-size: 0.84rem;
  line-height: 1.5;
}

.fallback p { margin: 0; }

.fallback__title { font-weight: 600; margin-bottom: 4px !important; }

noscript .fallback {
  position: static;
  transform: none;
  margin: 120px auto 40px;
}

/* ── адаптив ── */

@media (min-width: 1240px) {
  .dot-nav__label {
    display: block;
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 1080px) {
  .stage__inner { grid-template-columns: minmax(0, 1fr); }
  .stage--right .stage__copy { grid-column: 1; }
  .stage__index { display: none; }
  .stage--hero .stage__title { font-size: clamp(2rem, 6vw, 3rem); }
}

@media (max-width: 900px) {
  .dot-nav { display: none; }
  .stats, .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline__now { min-width: 0; }
  .timeline__label { display: none; }
}

@media (max-width: 640px) {
  :root { --radius: 18px; }
  .stage { padding: 92px 18px 96px; min-height: auto; }
  .stage__copy { padding: 20px 18px 22px; }
  .stats, .cards { grid-template-columns: minmax(0, 1fr); }
  .stage__title { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  .stage--hero .stage__title { font-size: clamp(1.85rem, 9vw, 2.6rem); }
  .stage__lead { font-size: 0.95rem; }
  .timeline { padding: 10px 16px 12px; gap: 10px; }
  .timeline__num { display: none; }
  .brand__tag { display: none; }
}

/* ── уважение к настройкам движения и контраста ── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .stage__copy { opacity: 1; transform: none; }
  .bar__fill { transform: scaleX(1); }
}

@media (prefers-contrast: more) {
  :root {
    --text: rgba(255, 255, 255, 0.94);
    --text-dim: rgba(255, 255, 255, 0.78);
    --text-faint: rgba(255, 255, 255, 0.62);
    --line: rgba(255, 255, 255, 0.24);
    --line-strong: rgba(255, 255, 255, 0.34);
  }
}
