/* PingLane — общие стили обеих страниц */

:root {
  --bg: #0a0d12;
  --bg-2: #0f141c;
  --panel: #131a24;
  --panel-2: #18212d;
  --line: #222c3a;
  --text: #e8ecf3;
  --muted: #8b96a8;
  --dim: #5d6879;
  --lane: #3ee6a8;
  --lane-ink: #062016;
  --spike: #ff5a5f;
  --warn: #f0b23c;
  --blue: #2e7bd6;
  --radius: 14px;
  --max: 1120px;
  --display: "Unbounded", "Segoe UI", sans-serif;
  --body: "Manrope", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--lane); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; overflow-wrap: break-word; hyphens: auto; }
h1 { font-size: clamp(32px, 5.4vw, 58px); letter-spacing: -0.02em; }
h2 { font-size: clamp(24px, 3.4vw, 36px); letter-spacing: -0.01em; }
h3 { font-size: 17px; font-weight: 500; }
p { margin: 0; }

code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- шапка ---------- */

.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10, 13, 18, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font: 600 18px var(--display); }
.logo:hover { text-decoration: none; }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 600; }
.nav a:hover, .nav a[aria-current] { color: var(--text); text-decoration: none; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  font: 700 15px var(--body); border: 1px solid transparent; cursor: pointer;
  transition: transform .12s, background .12s, border-color .12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-lane { background: var(--lane); color: var(--lane-ink); }
.btn-lane:hover { background: #5cf0ba; }
.btn-ghost { color: var(--text); border-color: var(--line); background: var(--panel); }
.btn-ghost:hover { border-color: #33415a; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }

/* ---------- секции ---------- */

section { padding: 96px 0; border-top: 1px solid var(--line); scroll-margin-top: 64px; }
section.hero { border-top: 0; padding: 72px 0 96px; }
.eyebrow {
  display: inline-block; margin-bottom: 14px;
  font: 600 12px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--lane);
}
.lead { color: var(--muted); font-size: 18px; max-width: 620px; margin-top: 18px; }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head p { color: var(--muted); margin-top: 14px; font-size: 17px; }

/* ---------- первый экран ---------- */

.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero h1 .accent { color: var(--lane); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 28px; color: var(--dim); font-size: 14px; }
.hero-meta span::before { content: "— "; color: var(--line); }
.hero-meta span:first-child::before { content: ""; }

/* окно приложения: повторяет настоящее окно tkinter */
.app {
  background: #f3f4f6; color: #1d2330;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
  max-width: 380px; margin-left: auto;
  font-family: "Segoe UI", var(--body);
}
.app-bar { display: flex; align-items: center; height: 34px; padding: 0 12px; background: #fff; border-bottom: 1px solid #e3e5ea; font-size: 12px; color: #444; }
.app-bar .dots { margin-left: auto; display: flex; gap: 16px; color: #888; font-size: 13px; }
.app-body { padding: 26px 28px 22px; text-align: center; }
.app-title { font-weight: 700; font-size: 21px; }
.app-server { color: #8a8f99; font-size: 13px; margin: 2px 0 20px; }
.app-btn {
  width: 190px; padding: 12px 0; border: 0; border-radius: 6px;
  font: 700 24px "Segoe UI", var(--body); color: #fff; background: var(--blue); cursor: pointer;
  transition: background .2s, transform .1s;
}
.app-btn:active { transform: scale(.98); }
.app-btn.on { background: #d64545; }
.app-btn:disabled { opacity: .7; cursor: progress; }
.app-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; font-size: 14px; min-height: 22px; }
.app-dot { width: 11px; height: 11px; border-radius: 50%; background: #9a9a9a; transition: background .2s; flex: none; }
.app-links { display: flex; justify-content: center; gap: 14px; margin-top: 12px; font-size: 12px; color: #8a8f99; }
.app-caption { text-align: right; color: var(--dim); font-size: 13px; margin-top: 12px; }

/* ---------- график пинга ---------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.prose p + p { margin-top: 16px; }
.prose p { color: var(--muted); font-size: 17px; }
.prose strong { color: var(--text); font-weight: 700; }

.chart { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 16px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 20px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.chart-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 7px; }
.chart-note { color: var(--dim); font-size: 12px; margin-top: 10px; }

.ping-rows { display: grid; gap: 4px; margin-top: 4px; }
.pr { display: grid; grid-template-columns: 84px minmax(0, 1fr) 40px; gap: 12px; align-items: center; padding: 5px 6px; border-radius: 8px; }
.pr:hover { background: var(--panel-2); }
.pr-name { font-size: 14px; color: var(--text); }
.pr-bars { display: grid; gap: 2px; padding-right: 34px; }
.pr-bar { height: 8px; border-radius: 0 4px 4px 0; position: relative; min-width: 2px; }
.pr-bar.before { background: #5d6879; }
.pr-bar.after { background: var(--lane); }
.pr-bar span { position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%); font: 11px var(--mono); color: var(--muted); white-space: nowrap; }
.pr-bar.after span { color: var(--text); font-weight: 600; }
.pr-diff { font: 600 13px var(--mono); color: var(--lane); text-align: right; }
.hero-meta .hero-stat { color: var(--lane); font-weight: 700; }

.callout {
  margin-top: 22px; padding: 14px 16px;
  border-left: 3px solid var(--warn); background: rgba(240, 178, 60, .07);
  border-radius: 0 10px 10px 0; color: var(--text); font-size: 15px;
}

/* ---------- карточки ---------- */

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin: 14px 0 8px; }
.card p { color: var(--muted); font-size: 15px; }
.icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(62, 230, 168, .1); color: var(--lane); }
.icon svg { width: 22px; height: 22px; }

/* ---------- шаги ---------- */

.steps { counter-reset: step; display: grid; gap: 14px; }
.step {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 20px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px;
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font: 600 18px var(--display); color: var(--lane); border: 1px solid rgba(62, 230, 168, .35);
}
.step p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.key-sample { display: inline-block; max-width: 100%; margin-top: 8px; color: var(--lane); background: var(--bg-2); word-break: break-all; }

/* ---------- тарифы ---------- */

.prices { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 16px; }
.price.trial { border-style: dashed; border-color: rgba(62, 230, 168, .45); background: rgba(62, 230, 168, .04); }
.price.trial .sum { color: var(--lane); }
.btn-trial { color: var(--lane); border-color: rgba(62, 230, 168, .5); background: transparent; }
.btn-trial:hover { background: rgba(62, 230, 168, .1); }
.price { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; position: relative; }
.price.best { border-color: rgba(62, 230, 168, .5); }
.price .tag { position: absolute; top: -11px; left: 24px; background: var(--lane); color: var(--lane-ink); font: 700 11px var(--mono); padding: 3px 10px; border-radius: 20px; letter-spacing: .06em; text-transform: uppercase; }
.price .term { color: var(--muted); font-weight: 600; }
.price .sum { font: 600 40px var(--display); margin: 8px 0 4px; }
.price .per { color: var(--dim); font-size: 14px; }
.price .btn { margin-top: 22px; width: 100%; justify-content: center; }
.price-notes { margin-top: 26px; color: var(--muted); font-size: 15px; display: grid; gap: 6px; }
.price-notes li { list-style: none; }
.price-notes li::before { content: "✓"; color: var(--lane); margin-right: 10px; }
.price-notes { padding: 0; }

/* ---------- вопросы ---------- */

.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 700; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--lane); font: 400 22px/1 var(--mono); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { color: var(--muted); padding-bottom: 20px; font-size: 15px; }
.faq details > div p + p { margin-top: 10px; }

/* ---------- блок кода ---------- */

pre {
  margin: 14px 0 0; padding: 16px 18px; overflow-x: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: #c9d3e3; line-height: 1.55;
}
pre .c { color: var(--dim); }
pre .k { color: var(--lane); }

/* ---------- призыв в конце ---------- */

.cta-band { text-align: center; }
.cta-band h2 { max-width: 640px; margin: 0 auto; }
.cta-band p { color: var(--muted); margin: 14px auto 28px; max-width: 520px; }

footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--dim); font-size: 13px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
footer .legal { margin-left: auto; }

/* ---------- страница «Как устроено» ---------- */

.diagram { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 760px; height: auto; }

.part { display: grid; grid-template-columns: 280px 1fr; gap: 40px; padding: 36px 0; border-top: 1px solid var(--line); }
.part:first-of-type { border-top: 0; padding-top: 0; }
.part-name { font: 600 14px var(--mono); color: var(--lane); }
.part-name + h3 { margin-top: 10px; font-size: 20px; }
.part-side p { color: var(--muted); font-size: 14px; margin-top: 10px; }
.part ul { margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.part li { list-style: none; color: var(--muted); padding-left: 20px; position: relative; }
.part li::before { content: ""; position: absolute; left: 0; top: 11px; width: 8px; height: 2px; background: var(--lane); }
.part li strong { color: var(--text); }

.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tl { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; position: relative; }
.tl .when { font: 600 11px var(--mono); color: var(--lane); letter-spacing: .08em; text-transform: uppercase; }
.tl h3 { font-size: 15px; margin: 8px 0 6px; }
.tl p { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
td:first-child { white-space: nowrap; }
td { color: var(--muted); }
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; font-size: 14px; color: var(--muted); background: var(--panel); }

/* ---------- узкие экраны ---------- */

@media (max-width: 900px) {
  .hero-grid, .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .app { margin: 0 auto; }
  .app-caption { text-align: center; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .prices { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
  .part { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .top .btn { margin-left: auto; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  section { padding: 64px 0; }
  section.hero { padding: 40px 0 64px; }
  .grid-3, .prices, .timeline { grid-template-columns: 1fr; }
  .step { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 18px; }
  .step .btn { grid-column: 2; justify-self: start; }
  .lead { font-size: 16px; }
  h1 { font-size: clamp(28px, 8.6vw, 40px); }
  footer .legal { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
