/* /mate/bot/v2/ — «пульт оператора»: холодний папір у крапку, білі панелі, синій робота й бірюзовий «скан» над карткою,
   де сидить робот. Розкладки sitegen RULES §2: phone ≤ 760, tablet 761–1100, desktop (data-layout ставить boot.js). */
:root {
  color-scheme: light dark;
  --bg: #eef2f8; --dot: #d3dbe8; --panel: #ffffff; --ink: #141a26; --muted: #5b6475; --line: #d9e0ec;
  --accent: #2b55e6; --accent-ink: #fff; --scan: #19c6d8; --warn: #b85c00; --good: #0b7a4b; --shade: rgb(20 26 38 / .10);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --side: 16px; --r: 18px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1220; --dot: #1d2436; --panel: #151b2c; --ink: #e8ecf5; --muted: #9aa4b8; --line: #263049;
    --accent: #7d9bff; --accent-ink: #0b1020; --scan: #4fe3f2; --warn: #ffb35c; --good: #4fd19a; --shade: rgb(0 0 0 / .45); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--sans); color: var(--ink); background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.4px); background-size: 22px 22px; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--side); }

/* шапка */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { font-weight: 800; text-decoration: none; letter-spacing: -.02em; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--scan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--scan) 25%, transparent); }
.navl { display: none; gap: 18px; font-size: 14px; color: var(--muted); }
.navl a { text-decoration: none; padding: 10px 0; }
.langs { display: flex; gap: 4px; }
.langs a { font-family: var(--mono); font-size: 12px; min-width: 44px; min-height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--panel); }
.langs a[aria-current] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* перший екран */
.hero { padding: 32px 0 24px; display: grid; gap: 24px; }
.kicker { color: var(--accent); margin: 0 0 12px; }
h1 { margin: 0; font-size: clamp(32px, 8.6vw, 76px); line-height: 1.02; letter-spacing: -.035em; font-weight: 850; text-wrap: balance; }
.lead { margin: 16px 0 0; max-width: 58ch; color: var(--muted); font-size: clamp(16px, 2.1vw, 19px); }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font: 650 15px/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.hint { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.hint::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--scan); flex: none; }
html[data-input="touch"] .hint .m, html:not([data-input="touch"]) .hint .t { display: none; }

/* картки (перчі робота) */
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  box-shadow: 0 1px 0 var(--shade); transition: border-color .2s, box-shadow .2s, transform .2s; min-width: 0; }
.card .ph { aspect-ratio: 1 / 1; background: var(--bg); }
.card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card .b { padding: 12px 14px 16px; }
.card h2, .card h3 { margin: 0; font-size: 17px; line-height: 1.25; }
.card p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.card .price { display: inline-block; margin-top: 10px; font-family: var(--mono); font-size: 12px; padding: 4px 8px; border-radius: 6px; background: var(--bg); }
/* ціль утримання L-023: підсвітка й смуга заповнення (стани ставить mate.js) */
.card[data-hold-state="over"], .card.is-here { border-color: var(--scan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--scan) 35%, transparent), 0 14px 30px var(--shade); }
/* полосу [data-hold-progress] малює сам mate.js (scaleX за --mate-hold) — тут її не чіпаємо */
/* «скан» над карткою, де зараз робот */
.card.is-here::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 36%; pointer-events: none;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--scan) 22%, transparent) 85%, var(--scan));
  opacity: .8; }
@media (prefers-reduced-motion: no-preference) {
  .card.is-here::after { animation: scan 2.4s ease-in-out infinite; }
  @keyframes scan { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(190%); } }
}

/* сцена першого екрана: велика картка + «живий» сигнал (L-020: рухається без курсора) */
.stage { position: relative; display: grid; }
.stage .card.feat { max-width: 520px; width: 100%; justify-self: center; }
.stage .card.feat .ph { aspect-ratio: 4 / 3; }
.feat .tag { position: absolute; left: 12px; top: 12px; z-index: 2; color: #fff; background: rgb(20 26 38 / .78); padding: 6px 10px; border-radius: 999px; }
.pulse { position: absolute; z-index: 1; left: 50%; top: 38%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%;
  border: 2px solid var(--scan); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: ping 2.6s cubic-bezier(.2, .7, .3, 1) infinite; }
  .pulse.p2 { animation-delay: 1.3s; }
  @keyframes ping { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
}

/* вітрина + журнал */
section { padding: 32px 0; }
.sec-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 16px; }
.sec-h h2 { margin: 0; font-size: clamp(24px, 5vw, 40px); letter-spacing: -.02em; }
.sec-h p { margin: 0; color: var(--muted); max-width: 60ch; }
.demo-grid { display: grid; gap: 20px; }
.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.log { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; align-self: start; }
.log h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.log h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.log ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 280px; overflow: auto; }
.log li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; font-size: 14px; padding: 6px 0; border-top: 1px dashed var(--line); }
.log li time { font-family: var(--mono); font-size: 11px; color: var(--muted); padding-top: 2px; }
.log li.handoff { color: var(--warn); }
.log .empty { color: var(--muted); font-size: 14px; margin: 0; }

/* як працює */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; transition: border-color .3s, box-shadow .3s; }
.steps li::before { content: "0" counter(s); font-family: var(--mono); color: var(--accent); display: block; margin-bottom: 6px; }
.steps li.on { border-color: var(--scan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--scan) 28%, transparent); }
.steps h3 { margin: 0 0 4px; font-size: 18px; }
.steps p { margin: 0; color: var(--muted); }

/* можливості */
.caps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.caps .card { padding: 16px; }
.caps .card .b { padding: 0; }

/* підключення */
.install { background: var(--ink); color: var(--bg); border-radius: calc(var(--r) + 6px); padding: 22px 18px; }
.install h2 { margin: 0 0 8px; font-size: clamp(24px, 5vw, 40px); letter-spacing: -.02em; }
.install p { margin: 0 0 14px; opacity: .8; max-width: 60ch; }
.code { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start;
  background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .14); border-radius: 12px; padding: 12px; }
.code pre { margin: 0; overflow-x: auto; font: 13px/1.5 var(--mono); white-space: pre; }
.code .btn { min-height: 40px; padding: 8px 14px; background: var(--bg); color: var(--ink); border-color: var(--bg); }
.plats { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.plats li { font-family: var(--mono); font-size: 12px; padding: 6px 10px; border: 1px solid rgb(255 255 255 / .2); border-radius: 999px; }
.install .btn.accent { margin-top: 18px; }

/* питання */
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; font-weight: 650; }
.faq details p { margin: 0 0 14px; color: var(--muted); }
.foot { padding: 24px 0 calc(110px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.foot p { margin: 0 0 6px; max-width: 80ch; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); opacity: 0; z-index: 40;
  padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 650; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* планшет 761–1100 */
@media (min-width: 761px) {
  :root { --side: 28px; }
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .caps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .install { padding: 32px; }
  section { padding: 48px 0; }
}
/* десктоп > 1100: текст | сцена; вітрина | журнал (Master-Detail) */
@media (min-width: 1101px) {
  :root { --side: 40px; }
  .navl { display: flex; }
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: 56px; padding: 56px 0 40px; }
  .demo-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .log { position: sticky; top: 76px; }
  .caps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card:hover { border-color: var(--accent); }
}
/* телефон в альбомі */
@media (max-height: 500px) and (max-width: 1000px) { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); } .top { position: static; } }
@media (prefers-reduced-motion: reduce) { .card, .steps li, .toast { transition: none; } }
