:root {
  --bg: #F3F2F9;
  --surface: #FFFFFF;
  --surface2: #EEEAFB;
  --text: #130E2F;
  --muted: #57516F;
  --accent: #6C30FC;
  --accentText: #5A22E6;
  --accentSoft: rgba(108,48,252,0.10);
  --line: rgba(19,14,47,0.08);
  --ok: #0B7F57;
  --okSoft: rgba(11,127,87,0.10);
  --warn: #8A5300;
  --warnSoft: rgba(242,170,40,0.18);
  --shadow: 0 1px 2px rgba(19,14,47,0.05), 0 16px 40px -22px rgba(19,14,47,0.18);
  --hero: linear-gradient(160deg, #4A16D8 0%, #6C30FC 55%, #7C46FF 100%);
  --heroShadow: none;
  --panel: #130E2F;
  --footer: #0B0A13;
  --codeBg: #130E2F;
  --appBg: #F3F2F9;
  --appCard: #FFFFFF;
  --appText: #130E2F;
  --appMuted: #57516F;
  --phoneFrame: #0B0A13;
  --phoneShadow: 0 40px 80px -40px rgba(19,14,47,0.6);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B0A13;
  --surface: #16132A;
  --surface2: #201B38;
  --text: #F4F2FA;
  --muted: #AAA5C0;
  --accent: #7447F5;
  --accentText: #B49DFF;
  --accentSoft: rgba(124,77,255,0.16);
  --line: rgba(255,255,255,0.06);
  --ok: #45D99A;
  --okSoft: rgba(69,217,154,0.14);
  --warn: #F2CF7E;
  --warnSoft: rgba(242,207,126,0.14);
  --shadow: none;
  --hero: linear-gradient(160deg, #3A17C8 0%, #24107E 52%, #120B3D 100%);
  --heroShadow: none;
  --panel: #16132A;
  --footer: #07060D;
  --codeBg: #201B38;
  --appBg: #0B0A13;
  --appCard: #16132A;
  --appText: #F4F2FA;
  --appMuted: #AAA5C0;
  --phoneFrame: #2E2950;
  --phoneShadow: 0 0 0 1px rgba(255,255,255,0.08), 0 40px 80px -40px rgba(0,0,0,0.9);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0A13;
    --surface: #16132A;
    --surface2: #201B38;
    --text: #F4F2FA;
    --muted: #AAA5C0;
    --accent: #7447F5;
    --accentText: #B49DFF;
    --accentSoft: rgba(124,77,255,0.16);
    --line: rgba(255,255,255,0.06);
    --ok: #45D99A;
    --okSoft: rgba(69,217,154,0.14);
    --warn: #F2CF7E;
    --warnSoft: rgba(242,207,126,0.14);
    --shadow: none;
    --hero: linear-gradient(160deg, #3A17C8 0%, #24107E 52%, #120B3D 100%);
    --heroShadow: none;
    --panel: #16132A;
    --footer: #07060D;
    --codeBg: #201B38;
    --appBg: #0B0A13;
    --appCard: #16132A;
    --appText: #F4F2FA;
    --appMuted: #AAA5C0;
    --phoneFrame: #2E2950;
    --phoneShadow: 0 0 0 1px rgba(255,255,255,0.08), 0 40px 80px -40px rgba(0,0,0,0.9);
    color-scheme: dark;
  }
}
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: contents; }
:root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: contents; }
  :root:not([data-theme="light"]) .only-light { display: none; }
}
.only-light { display: contents; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.navlink:hover { background: var(--surface2); }
.contact-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,0.08); color: #FFFFFF; text-decoration: none; font-size: 13px; }
.contact-tile span { color: #C9C4DE; }
.contact-tile b { font-size: 14px; }
.contact-tile:hover { background: rgba(255,255,255,0.14); }
@media (max-width: 760px) {
  .navlink { display: none; }
  /* Шапка на телефоне: вторая строка — языки слева, тема и «Открыть QuatPay» справа, без переносов */
  header > nav { width: 100%; flex-wrap: nowrap !important; gap: 6px !important; }
  header > nav .langs { margin-right: auto; }
  .langs a, .langs span { padding: 6px 7px; }
  .hdr-cta { padding: 0 12px !important; white-space: nowrap; }
  #theme-toggle { flex: 0 0 44px; }
}
@media (max-width: 380px) {
  .langs a, .langs span { padding: 6px 5px; }
  .hdr-cta { padding: 0 10px !important; font-size: 13px; }
  #theme-toggle { width: 40px !important; height: 40px !important; margin: 0 !important; flex: 0 0 40px; }
}

/* Анимированные иконки: играют при появлении карточки, затем раз в 7 с, пока видны, и при наведении (assets/anim.js).
   Без JS или при «уменьшить движение»: статичные иконки в конечном виде. */
@keyframes a-scan { 0% { transform: translateY(-6px); opacity: 0 } 12% { opacity: 1 } 50% { transform: translateY(6px) } 88% { opacity: 1 } 100% { transform: translateY(-6px); opacity: 0 } }
@keyframes a-draw { from { stroke-dashoffset: 1 } to { stroke-dashoffset: 0 } }
@keyframes a-shackle { 0%, 30% { transform: translateY(-3px) } 55% { transform: translateY(0.6px) } 70%, 100% { transform: translateY(0) } }
@keyframes a-pop { 0% { transform: scale(0); opacity: 0 } 70% { transform: scale(1.35); opacity: 1 } 100% { transform: scale(1); opacity: 1 } }
@keyframes a-move { from { offset-distance: 0% } to { offset-distance: 100% } }
@keyframes a-charge { 0% { opacity: 0 } 25% { opacity: .25 } 50% { opacity: .5 } 75% { opacity: .75 } 100% { opacity: 1 } }
@keyframes a-flow { from { stroke-dashoffset: 7 } to { stroke-dashoffset: 0 } }
@keyframes a-tear { 0% { transform: none } 35%, 55% { transform: translate(2px, 1.2px) rotate(10deg) } 100% { transform: none } }
@keyframes a-spark { 0%, 100% { transform: scale(1); opacity: 1 } 40% { transform: scale(1.6) rotate(45deg); opacity: .6 } }
@keyframes a-orbit { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }
@keyframes a-beat { 0%, 100% { transform: scale(1) } 20% { transform: scale(1.22) } 40% { transform: scale(.94) } 60% { transform: scale(1.12) } 80% { transform: scale(1) } }
@keyframes a-sig { 0%, 100% { text-shadow: none; opacity: .75 } 12% { text-shadow: 0 0 10px rgba(123,240,190,.9); opacity: 1 } 30% { text-shadow: none; opacity: .75 } }
.ai svg * { transform-box: fill-box; transform-origin: center; }
.ai .a-ln, .ai .a-check { stroke-dasharray: 1; }
.ai .a-car, .ai .a-dart { offset-rotate: 0deg; offset-distance: 100%; }
.ai .a-orbit { transform-box: view-box; transform-origin: 12px 12px; }
.ai .a-scan { opacity: 0; }
.js .ai:not(.in) .a-ln, .js .ai:not(.in) .a-check { stroke-dashoffset: 1; }
.js .ai:not(.in) .a-shackle { transform: translateY(-3px); }
.js .ai:not(.in) .a-sig { transform: scale(0); opacity: 0; }
.js .ai:not(.in) .a-car, .js .ai:not(.in) .a-dart { offset-distance: 0%; }
.js .ai:not(.in) .a-bolt { opacity: 0; }
.ai.in .a-scan { animation: a-scan 1.4s ease-in-out 2; }
.ai.in .a-ln1 { animation: a-draw .5s ease-out .1s both; }
.ai.in .a-ln2 { animation: a-draw .5s ease-out .45s both; }
.ai.in .a-ln3 { animation: a-draw .5s ease-out .8s both; }
.ai.in .a-shackle { animation: a-shackle .9s ease-out both; }
.ai.in .a-check { animation: a-draw .45s ease-out .75s both; }
.ai.in .a-sig1 { animation: a-pop .45s ease-out .2s both; }
.ai.in .a-sig2 { animation: a-pop .45s ease-out .65s both; }
.ai.in .a-car { animation: a-move 1.8s ease-in-out both; }
.ai.in .a-heart { animation: a-beat 1.3s ease-in-out .15s 2; }
.ai.in .a-dart { animation: a-move .9s cubic-bezier(.3,.7,.4,1) .2s both; }
.ai.in .a-bolt { animation: a-charge 1.2s steps(1, end) both; }
.ai.in .a-flow { animation: a-flow .6s linear 4; }
.ai.in .a-stub { animation: a-tear 1.4s ease-in-out .2s both; }
.ai.in .a-spark { animation: a-spark .9s ease-in-out .2s 2; }
.ai.in .a-orbit { animation: a-orbit 2.4s ease-in-out both; }
.live-sig { animation: a-sig 4.5s ease-in-out infinite; }
.live-sig.s2 { animation-delay: 1.5s; }
.live-sig.s3 { animation-delay: 3s; }
@media (prefers-reduced-motion: reduce) {
  .ai *, .live-sig { animation: none !important; }
}

/* Переключатель языка в шапке */
.langs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface2); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.langs a, .langs span { padding: 6px 8px; border-radius: 9px; color: var(--muted); text-decoration: none; line-height: 1; }
.langs .lang-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.langs a:hover { color: var(--text); }
@media (max-width: 340px) { header > nav { flex-wrap: wrap !important; } }
