/* zpp — страница программы. Самостоятельная тёмная тема в цветах бренда (docs/brand). */

@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/assets/fonts/inter-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/assets/fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #0d0e0c;
  --bg2: #151613;
  --bg3: #1d1e1b;
  --fg: #f2f2ee;
  --mut: rgb(242 242 238 / 0.64);
  --line: rgb(242 242 238 / 0.1);
  --a: #ff4a1c;
  --on-a: #0d0e0c;
  --font: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Cascadia Code', 'Cascadia Mono', Consolas, ui-monospace, monospace;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --bar-h: 64px;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: calc(var(--bar-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.5 var(--font); letter-spacing: -0.011em; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
p a, .lede a, .card a { color: var(--a); text-decoration: none; }
p a:hover, .lede a:hover, .card a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: 0.88em; padding: 1px 6px; border-radius: 6px; background: var(--bg3); letter-spacing: 0; overflow-wrap: anywhere; }
::selection { background: var(--a); color: var(--on-a); }
:focus-visible { outline: 2px solid var(--a); outline-offset: 3px; border-radius: 8px; }
.mono { font-family: var(--mono); letter-spacing: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1120px, calc(100% - var(--gutter) * 2)); margin: 0 auto; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 10px; background: var(--bg3); color: var(--fg);
  font: 500 15px/1 var(--font); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.4s var(--ease);
}
.btn:hover { background: #262723; }
.btn:active { transform: scale(0.97); }
.btn-accent { background: var(--a); color: var(--on-a); font-weight: 600; }
.btn-accent:hover { background: #ff6239; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--bg3); border-color: rgb(242 242 238 / 0.2); }
.btn-black { background: #000; color: var(--fg); border-color: rgb(242 242 238 / 0.18); }
.btn-black:hover { background: #000; border-color: rgb(242 242 238 / 0.42); }
/* кнопка скачивания в две строки: что качаем и канал · версия · вес */
.dl { height: auto; min-height: 60px; padding: 10px 22px 10px 18px; gap: 12px; border-radius: 12px; text-align: left; }
.dl-t { display: flex; flex-direction: column; gap: 4px; font-size: 16px; line-height: 1.15; }
.dl-t small { font-size: 12px; font-weight: 400; opacity: 0.78; }
.dl[hidden] { display: none; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 14px; border-radius: 9px; }

/* верхняя панель */
.bar {
  position: fixed; z-index: 50; inset: 0 0 auto; height: var(--bar-h); display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter);
  background: rgb(13 14 12 / 0.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.bar-l { display: flex; align-items: center; gap: 24px; min-width: 0; }
.home { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.home img { display: block; flex: none; }
.brand img { display: block; width: 96px; }
.bar-r { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.bar-nav { display: flex; gap: 2px; }

/* заставка при открытии: логотип и волны вокруг него */
.splash { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; background: var(--bg); transition: background-color 0.7s var(--ease); }
html.splashing .splash { display: grid; animation: sp-out 0.5s ease 4s forwards; } /* страховка, если zpp.js не загрузился */
html.splashing body { overflow: hidden; }
html.splashing .brand img { opacity: 0; animation: sp-show 0s linear 4.5s forwards; }
.splash.out { display: grid; animation: none; background-color: transparent; pointer-events: none; }
.splash-in { position: relative; display: grid; place-items: center; width: clamp(180px, 30vw, 300px); }
.splash-in::before { content: ''; position: absolute; inset: -60% -30%; border-radius: 50%; background: radial-gradient(closest-side, rgb(255 74 28 / 0.2), transparent); opacity: 0; animation: sp-glow 1.2s ease-out 0.15s forwards; }
.splash.out .splash-in::before, .splash.out .splash-wave { opacity: 0; transition: opacity 0.25s ease; }
.splash-logo { position: relative; display: block; width: 100%; height: auto; overflow: visible; transform-origin: 0 0; transition: transform 0.7s var(--ease); }
/* логотип по частям: молния выскакивает, следом подтягиваются след и буквы */
.splash-logo g.sb, .splash-logo g.sl, .splash-logo g.sw { transform-box: fill-box; }
.splash-logo .sb { transform-origin: 50% 50%; animation: sp-bolt 0.55s cubic-bezier(0.34, 1.7, 0.64, 1) both; }
.splash-logo .sl { animation: sp-trail 0.5s var(--ease) 0.12s both; }
.splash-logo .sw { animation: sp-word 0.55s var(--ease) 0.18s both; }
/* волна: два кольца один раз расходятся от логотипа в момент удара */
.splash-wave i { position: absolute; inset: -22% -9%; border: 1.5px solid var(--a); border-radius: 999px; opacity: 0; animation: sp-wave 1s cubic-bezier(0.2, 0.7, 0.3, 1) 0.18s both; }
.splash-wave i + i { animation-delay: 0.34s; border-width: 1px; }
@keyframes sp-bolt { 0% { opacity: 0; transform: scale(0.2) rotate(-14deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes sp-trail { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes sp-word { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes sp-wave { 0% { opacity: 0; transform: scale(0.85); } 20% { opacity: 0.85; } 100% { opacity: 0; transform: scale(2.2); } }
@keyframes sp-glow { 30% { opacity: 1; } 100% { opacity: 0.5; } }
@keyframes sp-out { to { opacity: 0; visibility: hidden; } }
@keyframes sp-show { to { opacity: 1; } }
.bar-nav a, .bar-nav button {
  display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: none; white-space: nowrap;
  color: var(--mut); font: 500 14px/1 var(--font); text-decoration: none; cursor: pointer; transition: color 0.2s ease, background-color 0.2s ease;
}
.bar-nav a:hover, .bar-nav button:hover { color: var(--fg); background: var(--bg3); }

/* ---------- витрина ---------- */
.show { position: relative; height: calc((var(--steps, 9) + 0.6) * 100svh); }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.ascii { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 60% 55% at 50% 50%, rgb(13 14 12 / 0.75), transparent 75%); }

.intro {
  position: absolute; z-index: 2; left: 50%; top: calc(var(--bar-h) + clamp(28px, 7vh, 72px)); width: min(820px, calc(100% - var(--gutter) * 2));
  transform: translate(-50%, calc(var(--p0, 0) * -48px)); opacity: calc(1 - var(--p0, 0) * 1.8); text-align: center;
}
.kicker { margin: 0 0 18px; font-size: 13px; color: var(--mut); }
.title { margin: 0; font-size: clamp(34px, 5.4vw, 68px); font-weight: 700; line-height: 1.02; letter-spacing: -0.045em; text-wrap: balance; }
.lede { margin: 20px auto 0; max-width: 40em; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.55; color: var(--mut); text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 20px; margin-top: 28px; }
.meta { font-size: 13px; color: var(--mut); }
.past-intro .intro { visibility: hidden; }

/* окно программы: настоящий интерфейс (assets/app) 1080×760, масштаб --k задаёт zpp.js */
.window {
  position: absolute; z-index: 3; left: 50%; top: 0; width: var(--ww, 760px);
  transform: translate(-50%, var(--wy, 0px)) scale(var(--ws, 1)); transform-origin: 50% 0;
  border: 1px solid rgb(242 242 238 / 0.14); border-radius: 16px; background: var(--bg2); overflow: hidden;
  box-shadow: 0 40px 120px -30px rgb(0 0 0 / 0.9), 0 0 0 1px rgb(0 0 0 / 0.6);
}
.window-bar { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--bg3); }
.window-bar span { margin-left: 8px; font-size: 12px; color: var(--mut); }
.frame { position: relative; width: 100%; aspect-ratio: 1080 / 760; background: var(--bg); overflow: hidden; }
.demo { position: absolute; left: 0; top: 0; width: 1080px; height: 760px; border: 0; transform-origin: 0 0; transform: scale(var(--k, 0.6)); opacity: 0; transition: opacity 0.5s ease; }
.demo.on { opacity: 1; }
.window-foot { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 14px; border-top: 1px solid var(--line); }
.hint { font-size: 12px; color: var(--mut); line-height: 1.35; }
.trying .window { border-color: var(--a); }
#try[aria-pressed='true'] { border-color: var(--a); color: var(--a); }

/* карточки шагов: видна только текущая, сторона — из data-side */
.cards { margin: 0; padding: 0; list-style: none; }
.card {
  position: absolute; z-index: 4; top: 50%; width: var(--cw, 300px); padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 14px;
  background: rgb(21 22 19 / 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transform: translateY(calc(-50% + 16px)); transition: opacity 0.45s ease, transform 0.6s var(--ease), visibility 0s linear 0.45s;
}
.card[data-side='left'] { left: var(--cx, 24px); }
.card[data-side='right'] { right: var(--cx, 24px); }
.card[data-side='none'] { display: none; }
.card.active { opacity: 1; visibility: visible; transform: translateY(-50%); transition-delay: 0s; }
.card h2 { margin: 0 0 10px; font-size: 21px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.2; }
.card h2::before { content: attr(data-n); display: block; margin-bottom: 10px; font: 500 12px/1 var(--mono); letter-spacing: 0; color: var(--a); }
.card p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--mut); }
.trying .card.active { opacity: 0; visibility: hidden; }

.rail { position: absolute; z-index: 4; right: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 11px; color: var(--mut); }
.rail i { position: relative; width: 2px; height: 140px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rail i::after { content: ''; position: absolute; inset: 0; background: var(--a); transform-origin: top; transform: scaleY(var(--s, 0)); }
.rail span:first-child { color: var(--fg); }

/* узкие экраны: окно сверху, карточка снизу */
.stage.m .card { top: auto; bottom: 14px; left: 12px; right: 12px; width: auto; transform: translateY(16px); }
.stage.m .card.active { transform: none; }
.stage.m .rail { display: none; }
.stage.m .hint { display: none; }

/* ---------- разделы ---------- */
.sec { position: relative; padding: clamp(72px, 10vw, 128px) 0; border-top: 1px solid var(--line); }
.h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.note { margin: 28px 0 0; max-width: 46em; font-size: 15px; color: var(--mut); }

.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 40px; }
.cols > div { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); }
.cols h3 { margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--a); }
.cols p { margin: 0; color: var(--mut); font-size: 15px; line-height: 1.6; }

.req { margin: 16px 0 0; font-size: 13px; color: var(--mut); }
.steps { margin: 40px 0 0; padding: 0; list-style: none; counter-reset: s; border-top: 1px solid var(--line); }
.steps li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 16px; padding: 22px 0; border-bottom: 1px solid var(--line); counter-increment: s; }
.steps li::before { content: '0' counter(s); grid-row: span 2; font: 500 14px/1.6 var(--mono); color: var(--a); }
.steps h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.steps p { margin: 0; color: var(--mut); font-size: 15px; max-width: 48em; }

.hash { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 16px; margin-top: 32px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); }
.hash .label { grid-column: 1 / -1; font-size: 12px; color: var(--mut); }
.hash code { background: none; padding: 0; font-size: 13px; word-break: break-all; }

.faq { margin-top: 36px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; cursor: pointer; list-style: none;
  font-size: clamp(17px, 1.6vw, 20px); font-weight: 550; letter-spacing: -0.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; font: 400 18px/1 var(--mono); color: var(--mut); transition: transform 0.4s var(--ease), color 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--a); }
.faq details p { margin: 0; padding: 0 50px 22px 0; max-width: 46em; color: var(--mut); font-size: 15.5px; line-height: 1.6; }

.authors .lede { margin: 18px 0 0; }
.credits { margin: 36px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.credits a { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); text-decoration: none; transition: border-color 0.25s ease, background-color 0.25s ease; }
.credits a:hover { border-color: var(--a); background: var(--bg3); }
.credits .who { font-size: 13px; color: var(--a); }
.credits b { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.credits span:last-child { color: var(--mut); font-size: 15px; }

.foot { padding: 40px 0 48px; border-top: 1px solid var(--line); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--mut); }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--fg); }
.soon { opacity: 0.55; cursor: default; }

/* «Что нового» */
.sheet {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; width: min(520px, 100%); max-width: 100%; height: 100%; max-height: none;
  border: 0; border-left: 1px solid var(--line); background: var(--bg2); color: var(--fg);
}
.sheet[open] { display: flex; flex-direction: column; animation: slide 0.6s var(--ease) both; }
.sheet::backdrop { background: rgb(0 0 0 / 0.6); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px 16px 24px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 20px; }
.tabs { display: flex; gap: 4px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.tabs button { height: 34px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--mut); font: 500 14px/1 var(--font); cursor: pointer; }
.tabs button:hover { color: var(--fg); background: var(--bg3); }
.tabs button[aria-selected='true'] { color: var(--fg); background: var(--bg3); border-color: var(--line); }
.rel-note { margin: 18px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--mut); }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 24px 48px; overscroll-behavior: contain; }
html.modal-open { overflow: hidden; }
.rel { padding: 26px 0; border-bottom: 1px solid var(--line); }
.rel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 14px; }
.rel-head h3 { margin: 0; font-size: 26px; letter-spacing: -0.03em; display: flex; align-items: center; gap: 10px; }
.rel-tag { height: 22px; padding: 0 8px; border-radius: 6px; background: var(--a); color: var(--on-a); font: 600 11px/22px var(--font); }
.rel-date { font-size: 13px; color: var(--mut); }
.rel-group + .rel-group { margin-top: 16px; }
.rel-group h4 { margin: 0 0 6px; font: 500 12px/1 var(--mono); color: var(--a); }
.rel-group ul { margin: 0; padding: 0; list-style: none; }
.rel-group li { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rel-group li b { font-weight: 600; font-size: 15px; }
.rel-group li span { font-size: 14px; color: var(--mut); }
.rel-empty { padding: 28px 0; color: var(--mut); }

/* меню делится на две половины вокруг логотипа zpp; где не помещается — остаётся только «Что нового» */
@media (max-width: 1179px) {
  .bar-nav a { display: none; }
}
@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .credits { grid-template-columns: minmax(0, 1fr); }
  .faq details p { padding-right: 0; }
}
@media (max-width: 680px) {
  .bar-nav { display: none; }
}
@media (max-width: 520px) {
  .home img + img { display: none; }
  .steps li { grid-template-columns: 40px minmax(0, 1fr); }
  .hash { grid-template-columns: minmax(0, 1fr); }
  .hash .btn { justify-self: start; }
  .lede { font-size: 15px; }
  .cta .dl { width: 100%; }
  .intro .lede { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
