:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --ink: #171a1f;
  --muted: #626a76;
  --line: #dfe4eb;
  --blue: #4f64ff;
  --blue-dark: #3449df;
  --mint: #1fbf91;
  --orange: #ee8a35;
  --navy: #14192b;
  --shadow: 0 18px 55px rgba(25, 33, 59, .10);
  --radius: 20px;
  --content: 740px;
  --wide: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Onest", "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: var(--blue-dark); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--blue); }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(79, 100, 255, .38); outline-offset: 4px; border-radius: 6px; }

.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 1000;
  padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 10px;
}
.skip-link:focus { top: 16px; }
.reading-progress { position: fixed; inset: 0 0 auto; z-index: 80; height: 3px; background: transparent; }
.reading-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--blue), #8068ff, var(--mint)); }

.site-header { position: sticky; top: 0; z-index: 60; border-bottom: 1px solid rgba(223, 228, 235, .8); background: rgba(245, 247, 250, .88); backdrop-filter: blur(16px); }
.nav { max-width: var(--wide); margin: auto; min-height: 72px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 780; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; border: 1px solid var(--ink); border-radius: 9px; display: grid; place-items: center; font: 700 11px/1 ui-monospace, monospace; box-shadow: 4px 4px 0 var(--blue); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 650; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--blue-dark); }
.nav-cta { padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.menu-toggle { display: none; border: 0; background: transparent; padding: 8px; color: var(--ink); font: inherit; }

.container { width: min(calc(100% - 44px), var(--wide)); margin-inline: auto; }
.narrow { width: min(calc(100% - 44px), var(--content)); margin-inline: auto; }
.section { padding: 92px 0; }
.section-sm { padding: 58px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 36px; }
.section-head p { max-width: 560px; margin: 0; color: var(--muted); }
.eyebrow, .tech-label { font: 700 12px/1.4 "JetBrains Mono", Consolas, monospace; letter-spacing: .09em; text-transform: uppercase; color: var(--blue-dark); }
.eyebrow { margin: 0 0 18px; }
h1, h2, h3 { text-wrap: balance; line-height: 1.12; letter-spacing: -.035em; }
h1 { font-size: clamp(42px, 7vw, 78px); margin: 0 0 24px; }
h2 { font-size: clamp(31px, 4vw, 48px); margin: 0 0 20px; }
h3 { font-size: clamp(22px, 2.6vw, 29px); margin: 0 0 12px; }
p { margin: 0 0 1.3em; }
.lead { max-width: 740px; color: #424955; font-size: clamp(20px, 2.4vw, 25px); line-height: 1.55; }

.hero { position: relative; overflow: hidden; padding: 84px 0 72px; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .42; background-image: linear-gradient(rgba(79,100,255,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(79,100,255,.09) 1px, transparent 1px); background-size: 34px 34px; mask-image: linear-gradient(to bottom, #000, transparent 78%); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.45fr .75fr; gap: 78px; align-items: center; }
.hero-copy { max-width: 820px; }
.hero-actions, .button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 50px; padding: 12px 20px; border: 1px solid var(--ink); border-radius: 12px; background: var(--ink); color: #fff; text-decoration: none; font-size: 16px; font-weight: 730; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.button:hover { color: #fff; background: var(--blue-dark); border-color: var(--blue-dark); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(79,100,255,.22); }
.button-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.button-secondary:hover { color: var(--blue-dark); background: #fff; border-color: var(--blue); }
.button-telegram { background: #fff; color: var(--navy); border-color: #fff; }
.button-telegram:hover { background: var(--mint); color: #09231b; border-color: var(--mint); }

.portrait-card { display: grid; gap: 14px; max-width: 350px; justify-self: end; }
.portrait-frame { aspect-ratio: 4 / 5; border-radius: 28px; overflow: hidden; background: #e6e9ef; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.9); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 66%; }
.portrait-meta { width: 100%; padding: 17px 18px; border-radius: 14px; background: rgba(20,25,43,.94); color: #fff; box-shadow: var(--shadow); }
.portrait-meta strong { display: block; font-size: 17px; }
.status { display: inline-flex; align-items: center; gap: 8px; margin-top: 5px; color: #cdd3df; font: 650 11px/1.4 "JetBrains Mono", Consolas, monospace; text-transform: uppercase; letter-spacing: .06em; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(31,191,145,.14); }

.signal-route { margin-top: 56px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font: 700 12px/1.5 "JetBrains Mono", Consolas, monospace; text-transform: uppercase; letter-spacing: .06em; }
.signal-node { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.72); color: var(--ink); }
.signal-arrow { color: var(--blue); }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { position: relative; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 rgba(255,255,255,.8); }
.card:hover { border-color: #c6ceff; box-shadow: 0 14px 40px rgba(36,43,74,.08); }
.card .tech-label { display: block; margin-bottom: 32px; }
.card p { color: var(--muted); font-size: 16px; }
.card-link { display: inline-flex; margin-top: 8px; font-weight: 700; text-decoration: none; }
.card-link::after { content: " →"; margin-left: 7px; }

.case-feature { overflow: hidden; display: grid; grid-template-columns: .95fr 1.05fr; min-height: 490px; border-radius: 28px; background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.case-copy { padding: clamp(34px, 6vw, 70px); align-self: center; }
.case-copy .eyebrow { color: #8fa0ff; }
.case-copy p { color: #c9ceda; }
.case-demo { padding: 44px 38px; background: radial-gradient(circle at 100% 0, rgba(79,100,255,.34), transparent 44%), #1b2138; display: grid; align-content: center; }
.chat-window { overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: #f8f9fc; color: var(--ink); box-shadow: 0 26px 70px rgba(0,0,0,.27); }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font: 700 11px/1.4 "JetBrains Mono", monospace; text-transform: uppercase; }
.chat-body { display: grid; gap: 12px; padding: 20px; }
.bubble { max-width: 83%; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.bubble-user { justify-self: end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.bubble-ai { background: #e9edf3; border-bottom-left-radius: 4px; }
.chat-status { color: var(--mint); }

.article-list { display: grid; gap: 1px; border-top: 1px solid var(--line); }
.article-row { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 24px; padding: 25px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.article-row:hover { color: var(--blue-dark); }
.article-row .tech-label { color: var(--muted); }
.article-row strong { font-size: clamp(18px, 2.2vw, 23px); letter-spacing: -.02em; line-height: 1.3; }

.author-strip { display: grid; grid-template-columns: 96px 1fr auto; gap: 22px; align-items: center; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.author-strip img { width: 96px; height: 96px; object-fit: cover; border-radius: 18px; background: var(--surface-soft); }
.author-strip p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

.telegram-cta { position: relative; overflow: hidden; padding: clamp(32px, 6vw, 64px); border-radius: 28px; background: var(--navy); color: #fff; }
.telegram-cta::after { content: ""; position: absolute; inset: -30% -15% auto auto; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 55px rgba(79,100,255,.08), 0 0 0 110px rgba(79,100,255,.05); }
.telegram-cta > * { position: relative; z-index: 1; }
.telegram-cta .eyebrow { color: #8fa0ff; }
.telegram-cta p { max-width: 720px; color: #c9ceda; }

.site-footer { padding: 52px 0 32px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--muted); font-size: 14px; }
.footer-note { margin-top: 34px; color: var(--muted); font-size: 13px; }

.cookie-notice {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  left: 22px;
  animation: cookie-notice-in .28s ease-out both;
}
.cookie-notice__inner {
  width: min(100%, var(--wide));
  margin-inline: auto;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 16px;
  background: rgba(20, 25, 43, .96);
  color: #fff;
  box-shadow: 0 18px 55px rgba(20, 25, 43, .24);
  backdrop-filter: blur(16px);
}
.cookie-notice p { margin: 0; font-size: 14px; line-height: 1.5; }
.cookie-notice a { color: #bdc6ff; }
.cookie-notice a:hover { color: #fff; }
.cookie-notice__button {
  min-width: 72px;
  min-height: 44px;
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font: 750 15px/1 "Onest", "Segoe UI", Arial, sans-serif;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.cookie-notice__button:hover { background: var(--mint); transform: translateY(-1px); }
.cookie-notice--closing { animation: cookie-notice-out .22s ease-in both; }

@keyframes cookie-notice-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cookie-notice-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(12px); }
}

/* Article */
.article-hero { padding: 76px 0 54px; border-bottom: 1px solid var(--line); }
.article-hero .narrow { position: relative; }
.article-hero h1 { font-size: clamp(38px, 6vw, 68px); }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 28px; color: var(--muted); font-size: 14px; }
.article-meta img { width: 38px; height: 38px; border-radius: 10px; }
.article-layout { display: grid; grid-template-columns: minmax(0, var(--content)) 230px; justify-content: center; gap: 78px; padding: 72px 22px 30px; }
.article-content { min-width: 0; }
.article-content > h2 { margin-top: 2.1em; scroll-margin-top: 100px; }
.article-content > h3 { margin-top: 1.8em; scroll-margin-top: 100px; }
.article-content > p, .article-content > ul, .article-content > ol { color: #303641; }
.article-content li { margin-bottom: .65em; }
.article-content ul, .article-content ol { padding-left: 1.35em; }
.article-content strong { color: var(--ink); }
.article-aside { position: relative; }
.toc { position: sticky; top: 102px; padding-left: 18px; border-left: 1px solid var(--line); }
.toc strong { display: block; margin-bottom: 13px; font: 700 11px/1.4 "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .07em; }
.toc a { display: block; padding: 7px 0; color: var(--muted); text-decoration: none; font-size: 13px; line-height: 1.35; }
.toc a.active { color: var(--blue-dark); font-weight: 700; }

.key-point, .note, .warning, .process, .comparison, .metric-row, .dialogue { margin: 38px 0; }
.key-point { padding: 28px 30px; border-left: 4px solid var(--blue); border-radius: 0 16px 16px 0; background: #edf0ff; }
.key-point .tech-label { display: block; margin-bottom: 9px; }
.key-point p:last-child, .note p:last-child, .warning p:last-child { margin-bottom: 0; }
.note, .warning { padding: 24px 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.note { box-shadow: inset 4px 0 0 var(--mint); }
.warning { box-shadow: inset 4px 0 0 var(--orange); }
.process { counter-reset: step; display: grid; gap: 0; }
.process-step { position: relative; padding: 0 0 28px 62px; }
.process-step::before { counter-increment: step; content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--blue-dark); font: 700 12px/1 monospace; }
.process-step:not(:last-child)::after { content: ""; position: absolute; left: 20px; top: 46px; bottom: 4px; width: 1px; background: var(--line); }
.process-step strong { display: block; margin-bottom: 4px; }
.process-step p { margin: 0; color: var(--muted); font-size: 16px; }
.comparison { overflow: hidden; display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.comparison > div { padding: 27px; }
.comparison > div + div { border-left: 1px solid var(--line); background: #f1f3ff; }
.comparison ul { margin-bottom: 0; padding-left: 1.1em; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.metric { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.metric strong { display: block; margin-bottom: 5px; font-size: 22px; }
.metric span { color: var(--muted); font-size: 13px; }
.dialogue { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.dialogue-head { display: flex; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--line); font: 700 11px/1.4 monospace; text-transform: uppercase; }
.dialogue-body { display: grid; gap: 14px; padding: 24px; }
.dialogue-message { max-width: 82%; padding: 13px 15px; border-radius: 14px; font-size: 15px; line-height: 1.48; }
.dialogue-message.client { justify-self: end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.dialogue-message.ai { background: var(--surface-soft); border-bottom-left-radius: 4px; }
.inline-cta { margin: 52px 0; padding: 28px; border: 1px solid #cfd6ff; border-radius: 18px; background: linear-gradient(135deg, #fff, #eef0ff); }
.inline-cta h3 { font-size: 24px; }
.inline-cta p { color: var(--muted); }

.legal { padding: 72px 0; }
.legal h1 { font-size: clamp(38px, 5vw, 58px); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr .55fr; gap: 38px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-aside { display: none; }
  .case-feature { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .nav { min-height: 64px; }
  .menu-toggle { display: block; }
  .nav-links { position: fixed; inset: 64px 0 0; display: none; align-content: start; padding: 34px 22px; background: var(--bg); }
  .menu-open .nav-links { display: grid; }
  .nav-links a { font-size: 20px; }
  .hero { padding-top: 58px; }
  .hero-grid { grid-template-columns: 1fr; }
  .portrait-card { width: min(86%, 350px); justify-self: start; }
  .portrait-meta { width: 100%; }
  .section { padding: 66px 0; }
  .section-head { display: block; }
  .card-grid { grid-template-columns: 1fr; }
  .article-row { grid-template-columns: 1fr auto; }
  .article-row .tech-label { grid-column: 1 / -1; }
  .author-strip { grid-template-columns: 72px 1fr; }
  .author-strip img { width: 72px; height: 72px; }
  .author-strip .button { grid-column: 1 / -1; }
  .case-demo { padding: 28px 18px; }
  .footer-grid { grid-template-columns: 1fr; }
  .comparison { grid-template-columns: 1fr; }
  .comparison > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .metric-row { grid-template-columns: 1fr; }
  .article-layout { padding-inline: 22px; }
  .article-hero { padding-top: 54px; }
  .cookie-notice { right: 12px; bottom: 12px; left: 12px; }
  .cookie-notice__inner { align-items: stretch; gap: 14px; padding: 16px; flex-direction: column; }
  .cookie-notice__button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
