/* ============================================================
   Orgbench — дизайн-система сайта поддержки
   Палитра: чернильный тёмный фон + два цвета знака (синий→циан
   для source, оранжевый→красный для target, пурпур на пересечении).
   Шрифты: Schibsted Grotesk (display) / Manrope (body) / IBM Plex Mono (метки)
   Порт design-системы из cleververve.com, урезанный до компонентов,
   которые использует этот сайт.
   ============================================================ */

:root {
	--ink-900: #0d1522;
	--ink-800: #111c2e;
	--ink-700: #16233a;
	--ink-500: #1d2f4e;
	--paper: #f5f7fb;
	--card-light: #ffffff;
	--line-light: #e3e9f2;
	--txt-hi: #e9eef7;
	--txt-lo: #9fb0c9;
	--txt-dark: #1c2433;
	--txt-dark-lo: #56637a;
	--accent: #2f9fe0;
	--accent-strong: #1878c8;
	--source: #17b6cf;
	--overlap: #c0308f;
	--target: #f2701a;
	--amber: #d9a05f;
	--danger: #e0231f;
	--glass: rgba(255, 255, 255, 0.055);
	--glass-line: rgba(255, 255, 255, 0.12);
	--radius: 14px;
	--font-display: 'Schibsted Grotesk', 'Manrope', system-ui, sans-serif;
	--font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
	--shadow-soft: 0 8px 30px rgba(13, 21, 34, 0.08);
	--shadow-lift: 0 14px 40px rgba(13, 21, 34, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
	background: var(--ink-900);
	color: var(--txt-hi);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #82aaf5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }

/* ---------- Типографика ---------- */

h1, h2, h3 { font-family: var(--font-display); margin: 0 0 0.5em; line-height: 1.15; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.18rem; font-weight: 600; }
p { margin: 0 0 1em; }

.eyebrow {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--txt-lo);
	margin: 0 0 1.1em;
}
.section--light .eyebrow { color: var(--txt-dark-lo); }
.eyebrow::before {
	content: '';
	display: inline-block;
	width: 22px;
	height: 1px;
	background: var(--accent);
	vertical-align: middle;
	margin-right: 10px;
}

.lead { font-size: 1.13rem; color: var(--txt-lo); max-width: 46em; }
.section--light .lead { color: var(--txt-dark-lo); }

/* ---------- Навигация ---------- */

.site-head {
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.head-inner {
	padding: 18px 0;
	display: flex;
	align-items: center;
	gap: 20px;
}
.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--txt-hi);
	font-family: var(--font-display);
	font-weight: 700;
}
.brand:hover { color: var(--txt-hi); }
.site-nav {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 4px;
}
.nav-link {
	color: var(--txt-lo);
	font-size: 0.92rem;
	font-weight: 600;
	padding: 9px 13px;
	border-radius: 9px;
	transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover { color: var(--txt-hi); background: rgba(255, 255, 255, 0.06); }
.nav-link.is-active { color: var(--txt-hi); background: rgba(47, 159, 224, 0.16); }

/* ---------- Hero ---------- */

.hero {
	background:
		radial-gradient(1000px 480px at 82% -10%, rgba(47, 159, 224, 0.16), transparent 60%),
		linear-gradient(160deg, var(--ink-900) 0%, var(--ink-700) 55%, var(--ink-500) 100%);
	padding: 96px 0 72px;
}
.hero h1 { color: #fff; max-width: 15em; }
.hero-sub { font-size: 1.13rem; color: var(--txt-lo); max-width: 46em; }

.chat-shell { margin-top: 2em; }
.chat {
	border-radius: var(--radius);
	padding: 24px 28px;
	background: var(--glass);
	border: 1px solid var(--glass-line);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}
.chat-idle-title {
	font-family: var(--font-display);
	font-weight: 600;
	color: #fff;
	margin: 0 0 8px;
}
.chat-idle-body { margin: 0; color: var(--txt-lo); }

/* ---------- Секции ---------- */

.section { padding: 92px 0; }
.section--light { background: var(--paper); color: var(--txt-dark); }
.section--light h2, .section--light h3 { color: var(--txt-dark); }
.section--dark {
	background: linear-gradient(180deg, var(--ink-900) 0%, var(--ink-800) 100%);
}
.section__head { max-width: 720px; margin-bottom: 48px; }

.section--light a:not(.btn) { color: #3866cc; }
.section--light a:not(.btn):hover { color: #2d55b0; }

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

.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cards { display: grid; gap: 22px; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
	border-radius: var(--radius);
	padding: 28px;
	background: var(--glass);
	border: 1px solid var(--glass-line);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.24); }
.card--glass {
	background: var(--glass);
	border: 1px solid var(--glass-line);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}
.card--glass:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.24); }
.card--light {
	background: var(--card-light);
	border: 1px solid var(--line-light);
	box-shadow: var(--shadow-soft);
}
.card--light:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.link { font-weight: 700; }

/* ---------- Новости ---------- */

.news-brief { list-style: none; margin: 0 0 1.2em; padding: 0; display: grid; gap: 10px; }
.news-date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--txt-lo); margin-right: 10px; }
.news-item { border-top: 1px solid var(--glass-line); padding: 32px 0; }
.news-item:first-of-type { border-top: none; padding-top: 0; }
.news-item pre { overflow-x: auto; }

/* ---------- Документация ---------- */

.lede { color: var(--txt-lo); font-size: 1.05rem; max-width: 60ch; margin: 0 0 2em; }
.card-meta { color: var(--txt-lo); font-size: 0.85rem; margin: 0 0 14px; }

.doc-page { padding: 48px 0 96px; }
.doc-grid { display: grid; grid-template-columns: 260px 1fr; gap: 48px; align-items: start; }

.toc {
	position: sticky;
	top: 88px;
	max-height: calc(100vh - 110px);
	overflow-y: auto;
}
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.toc a { color: var(--txt-lo); font-size: 0.88rem; }
.toc a:hover { color: var(--txt-hi); }
.toc-l2 { padding-left: 0; }
.toc-l3 { padding-left: 16px; }

.doc-body { max-width: 76ch; }
.doc-meta { color: var(--txt-lo); font-size: 0.88rem; margin-bottom: 2em; }
.doc-body pre { overflow-x: auto; }

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

.btn {
	display: inline-block;
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 0.97rem;
	border-radius: 11px;
	padding: 13px 26px;
	border: 1px solid transparent;
	cursor: pointer;
	background: var(--accent-strong);
	color: #fff;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); color: #fff; }
.btn--primary {
	background: var(--accent-strong);
	color: #fff;
	box-shadow: 0 6px 22px rgba(24, 120, 200, 0.35);
}
.btn--primary:hover { background: #135a99; color: #fff; box-shadow: 0 10px 28px rgba(24, 120, 200, 0.45); }
.btn--ghost {
	background: transparent;
	color: var(--txt-hi);
	border-color: var(--glass-line);
}
.btn--ghost:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.05); }
.section--light .btn--ghost { color: var(--txt-dark); border-color: #c9d4e4; }
.section--light .btn--ghost:hover { color: var(--txt-dark); border-color: var(--accent); background: rgba(47, 159, 224, 0.07); }
.btn-sm { padding: 9px 16px; font-size: 0.9rem; border-radius: 9px; }
.nav-ask { margin-left: 8px; }

/* ---------- Футер ---------- */

.site-foot {
	border-top: 1px solid rgba(255, 255, 255, 0.07);
	padding: 32px 0;
	color: var(--txt-lo);
}
.foot-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
	font-size: 0.88rem;
}
.foot-inner a { color: var(--txt-hi); }

/* ---------- Reveal-микроанимации ---------- */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal--in { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal, .js .reveal { opacity: 1; transform: none; transition: none; }
	.card, .btn { transition: none; }
}

/* ---------- Адаптивность ---------- */

@media (max-width: 960px) {
	.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
	.section { padding: 64px 0; }
	.hero { padding: 72px 0 56px; }
	.grid--3, .grid--2, .cards.two { grid-template-columns: 1fr; }
	.doc-grid { grid-template-columns: 1fr; }
	.toc { position: static; max-height: none; }
	.head-inner { flex-wrap: wrap; }
	.foot-inner { flex-direction: column; align-items: flex-start; }
}
