/* Анимации главной */
.hero { position: relative; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; inset: -40% -10%; pointer-events: none;
  background: radial-gradient(40% 30% at 25% 40%, rgba(53, 214, 192, .2), transparent 70%), radial-gradient(35% 28% at 75% 30%, rgba(90, 120, 255, .18), transparent 70%);
  animation: aurora 16s ease-in-out infinite alternate;
}
.hero::after { background: radial-gradient(30% 24% at 60% 65%, rgba(166, 90, 255, .13), transparent 70%); animation-duration: 22s; animation-direction: alternate-reverse; }
.hero .wrap { position: relative; z-index: 1; }
@keyframes aurora { from { transform: translate3d(-4%, -3%, 0) rotate(-3deg); } to { transform: translate3d(5%, 4%, 0) rotate(4deg); } }
.hero-icons img { animation: float 6s ease-in-out infinite; }
.hero-icons img:nth-child(2) { animation-delay: -1s; }
.hero-icons img:nth-child(3) { animation-delay: -2s; }
.hero-icons img:nth-child(4) { animation-delay: -3s; }
.hero-icons img:nth-child(5) { animation-delay: -4s; }
.hero-icons img:nth-child(6) { animation-delay: -5s; }
@keyframes float { 50% { transform: translateY(-9px); } }
.grid .card { animation: rise .5s both; transition: transform .2s, border-color .2s, box-shadow .2s; }
.grid .card:nth-child(2) { animation-delay: 50ms; }
.grid .card:nth-child(3) { animation-delay: 100ms; }
.grid .card:nth-child(4) { animation-delay: 150ms; }
.grid .card:nth-child(5) { animation-delay: 200ms; }
.grid .card:nth-child(6) { animation-delay: 250ms; }
.grid .card:not(.next):hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 34px rgba(0, 0, 0, .35); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* Страница продукта */
[hidden] { display: none !important; }
.product-page { --pa: var(--accent); }
.product-page .btn.primary { background: var(--pa); border-color: var(--pa); color: #07131f; }
.product-page .btn.primary:hover { filter: brightness(1.1); background: var(--pa); }
.product-page a:not(.btn):not(.download) { color: var(--pa); }
.product-page .eyebrow { color: var(--pa); margin-bottom: 6px; }
.product-page :focus-visible { outline-color: var(--pa); }
.p-hero { position: relative; overflow: hidden; padding: 34px 0 58px; background: linear-gradient(160deg, color-mix(in srgb, var(--pa) 24%, var(--bg)) 0%, #0c1a30 52%, var(--bg) 100%); }
.p-hero .wrap { position: relative; }
.back { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; font-weight: 600; }
.p-title { display: flex; align-items: center; gap: 20px; margin-top: 18px; }
.p-title img { width: 96px; height: 96px; border-radius: 22%; object-fit: contain; flex: none; animation: rise .5s both; }
.p-title h1 { font-size: clamp(36px, 6vw, 58px); letter-spacing: -.02em; }
.p-hero .lead { margin: 20px 0 18px; max-width: 66ch; }
.p-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 26px; padding: 0; }
.p-tags li { padding: 5px 12px; border: 1px solid color-mix(in srgb, var(--pa) 55%, var(--line)); border-radius: 999px; font-size: 14px; }
.muted { color: var(--muted); margin: 8px 0 28px; }
.reveal { transition: opacity .6s, transform .6s; }
.js .reveal:not(.in) { opacity: 0; transform: translateY(22px); }

/* Тур */
.tour { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.tour-stage { position: sticky; top: 86px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.device { background: #03070d; border: 1px solid #33455f; box-shadow: 0 22px 54px rgba(0, 0, 0, .5); }
.device.phone { width: min(292px, 100%); padding: 8px; border-radius: 34px; }
.device.tv { width: 100%; padding: 9px 9px 15px; border-radius: 12px; }
.screen { position: relative; overflow: hidden; background: #0a1220; }
.device.phone .screen { aspect-ratio: 540 / 1170; border-radius: 26px; }
.device.tv .screen { aspect-ratio: 16 / 9; border-radius: 4px; }
.screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s; }
.screen img.on { opacity: 1; }
.hot { position: absolute; border: 2px solid var(--pa); border-radius: 10px; box-shadow: 0 0 0 999px rgba(3, 8, 16, .46), 0 0 18px var(--pa); transition: left .5s cubic-bezier(.3, .8, .3, 1), top .5s cubic-bezier(.3, .8, .3, 1), width .5s cubic-bezier(.3, .8, .3, 1), height .5s cubic-bezier(.3, .8, .3, 1); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 50% { border-color: #fff; } }
.tour-controls { display: flex; gap: 8px; }
.tour-btn { min-width: 44px; min-height: 44px; padding: 6px 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; cursor: pointer; }
.tour-btn:hover { border-color: var(--pa); }
.steps-list { display: grid; gap: 8px; }
.step { position: relative; display: flex; gap: 14px; width: 100%; overflow: hidden; padding: 14px 16px; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font: inherit; cursor: pointer; transition: border-color .2s, background .2s; }
.step:hover { border-color: color-mix(in srgb, var(--pa) 60%, var(--line)); }
.step.active { background: var(--surface-2); border-color: var(--pa); }
.step-num { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--bg); color: var(--pa); font-weight: 700; font-size: 14px; }
.step-body strong { display: block; font-size: 17px; }
.step-text { display: grid; grid-template-rows: 0fr; color: var(--muted); overflow: hidden; max-height: 0; opacity: 0; transition: max-height .35s, opacity .35s, margin .35s; }
.step.active .step-text { max-height: 130px; opacity: 1; margin-top: 4px; }
.step-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.step-bar i { display: block; width: 100%; height: 100%; background: var(--pa); transform: scaleX(0); transform-origin: left; }
.step.running .step-bar i { animation: progress var(--tour-ms, 6500ms) linear forwards; }
@keyframes progress { to { transform: scaleX(1); } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Демо */
.demo { background: var(--surface); border-block: 1px solid var(--line); }
.demo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: center; }
.demo h3 { font-size: 28px; margin-bottom: 10px; }
.demo p { color: var(--muted); }
.demo-note { min-height: 52px; color: var(--text) !important; }
.fed { position: relative; width: min(100%, 460px); margin: auto; aspect-ratio: 420 / 340; }
.fed svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fed-line { stroke: var(--line); stroke-width: 2; transition: stroke .25s; }
.fed-line.on { stroke: var(--pa); stroke-width: 3; }
.fed-dot { fill: var(--pa); }
.fed-hub, .fed-node { position: absolute; transform: translate(-50%, -50%); border-radius: 999px; white-space: nowrap; }
.fed-hub { left: 50%; top: 50%; padding: 11px 17px; background: var(--pa); color: #07131f; font-weight: 700; }
.fed-node { min-height: 44px; padding: 6px 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); font: inherit; font-size: 14px; cursor: pointer; }
.fed-node:hover, .fed-node.on { border-color: var(--pa); background: var(--bg); }
.src-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.src-chip { min-height: 44px; padding: 6px 15px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; font: inherit; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.src-chip[aria-pressed="true"] { color: #fff; background: color-mix(in srgb, var(--c) 42%, var(--bg)); border-color: var(--c); }
.src-feed { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; min-height: 340px; align-content: start; }
.src-tile { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; animation: rise .35s both; font-size: 14px; }
.src-tile i { flex: none; width: 56px; aspect-ratio: 16 / 9; border-radius: 6px; background: linear-gradient(135deg, var(--c), #16263c); }
.demo-empty { grid-column: 1 / -1; align-self: center; text-align: center; }
.dial { width: min(100%, 320px); margin: auto; padding: 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 26px; text-align: center; }
.dial-status { margin: 0 0 6px; font-size: 14px; color: var(--pa) !important; }
.dial-row { display: flex; align-items: center; gap: 4px; min-height: 52px; }
.dial-num { flex: 1; font-size: 26px; overflow-wrap: anywhere; padding-left: 44px; }
.dial-num.empty { color: var(--muted); }
.dial-erase { flex: none; width: 44px; height: 44px; color: var(--text); background: none; border: 0; border-radius: 10px; font-size: 20px; cursor: pointer; }
.dial-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 14px; }
.dial-key { height: 54px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 27px; font: inherit; font-size: 21px; cursor: pointer; transition: transform .08s, border-color .15s; }
.dial-key:hover { border-color: var(--pa); }
.dial-key:active { transform: scale(.94); }
.dial-call { width: 62px; height: 62px; color: #fff; background: #2fa650; border: 0; border-radius: 50%; font-size: 26px; cursor: pointer; transition: background .2s, transform .2s; }
.dial-call span { display: block; }
.dial-call.hang { background: #d8344a; }
.dial-call.hang span { transform: rotate(135deg); }
.iax-log { height: 266px; overflow-y: auto; margin: 14px 0 0; padding: 10px; list-style: none; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.iax-log li { display: grid; grid-template-columns: 22px 92px minmax(0, 1fr); gap: 6px; padding: 3px 4px; animation: rise .25s both; }
.iax-log b { color: var(--pa); }
.iax-log li.in b { color: #6db6ff; }
.iax-log code { font-family: ui-monospace, Consolas, monospace; }
.iax-log span { color: var(--muted); }
.tv-mock { display: flex; gap: 10px; padding: 12px; aspect-ratio: 16 / 9; background: #070d17; border: 7px solid #03070d; outline: 1px solid #33455f; border-radius: 10px; }
.tv-rail { display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.tv-rail span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); border-radius: 8px; transition: background .15s, color .15s; }
.tv-rail span.on { background: var(--pa); color: #07131f; }
.tv-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1fr; gap: 9px; }
.tv-card { border-radius: 7px; border: 2px solid transparent; background: linear-gradient(145deg, hsl(var(--h) 56% 44%), hsl(calc(var(--h) + 45) 50% 22%)); transition: transform .15s, border-color .15s, box-shadow .15s; }
.tv-card.on { transform: scale(1.07); border-color: #fff; box-shadow: 0 0 16px var(--pa); }
.tv-card.open { animation: pulse-card .45s; }
@keyframes pulse-card { 50% { transform: scale(1.16); } }
.pad { display: grid; grid-template: repeat(3, 52px) / repeat(3, 52px); gap: 5px; justify-content: start; margin: 18px 0 12px; }
.pad button { color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 14px; cursor: pointer; }
.pad button:hover { border-color: var(--pa); }
.pad button:active { transform: scale(.94); }
.pad-up { grid-area: 1 / 2; } .pad-left { grid-area: 2 / 1; } .pad-ok { grid-area: 2 / 2; font-weight: 700 !important; } .pad-right { grid-area: 2 / 3; } .pad-down { grid-area: 3 / 2; }

.accordion { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 26px; align-items: start; }
.accordion details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.accordion details[open] { border-color: color-mix(in srgb, var(--pa) 60%, var(--line)); }
.accordion summary { min-height: 52px; padding: 13px 18px; font-size: 18px; font-weight: 600; cursor: pointer; }
.accordion ul { margin: 0; padding: 0 20px 16px 38px; color: var(--muted); }
.accordion li { margin-bottom: 5px; }
.p-download { background: var(--surface); border-top: 1px solid var(--line); }
.p-download-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 46px; }
.p-download .downloads { margin-top: 20px; }
.p-download h3 { font-size: 20px; margin-bottom: 10px; }
.limits { margin: 0; padding-left: 20px; color: var(--muted); }
.limits li { margin-bottom: 7px; }
.p-nav { border-top: 1px solid var(--line); }
.p-nav .wrap { display: flex; justify-content: space-between; gap: 16px; padding-block: 18px; }
.p-nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }

@media (max-width: 860px) {
  .tour, .demo-grid, .p-download-grid, .accordion { grid-template-columns: minmax(0, 1fr); }
  .tour-stage { position: static; }
  .src-feed { min-height: 0; }
}
@media (max-width: 640px) {
  .p-title img { width: 72px; height: 72px; }
  .device.phone { width: min(244px, 100%); }
  .fed-node { padding: 5px 9px; font-size: 13px; }
  .fed-hub { padding: 8px 12px; font-size: 14px; }
  .tv-rail span { width: 24px; height: 24px; font-size: 13px; }
  .tv-mock { padding: 7px; gap: 6px; }
  .tv-grid { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .step-bar { display: none; }
}
