:root {
  --bg: #f5f2ea;
  --bg-alt: #ece7da;
  --surface: #fffdf8;
  --ink: #141a2b;
  --muted: #565d70;
  --line: #d6cfbd;
  --accent: #cf430c;
  --accent-ink: #ffffff;
  --link: #b13a09;
  --teal: #0b6f6a;
  --teal-bg: #dcefec;
  --code-bg: #ebe6d8;
  --log-bg: #141a2b;
  --log-ink: #e7e5dc;
  --log-dim: #8d93a8;
  --log-ok: #6fd6a0;
  --log-warn: #ffb36b;
  --shadow: 0 1px 0 rgba(20, 26, 43, .04), 0 8px 24px -12px rgba(20, 26, 43, .25);
  --serif: Georgia, "Palatino Linotype", "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1320;
    --bg-alt: #121a2b;
    --surface: #172033;
    --ink: #ecebe4;
    --muted: #a6abbb;
    --line: #2b3550;
    --accent: #ff7a3d;
    --accent-ink: #1a0f08;
    --link: #ff9a66;
    --teal: #5fd8cb;
    --teal-bg: #12332f;
    --code-bg: #1d2740;
    --log-bg: #0a0e18;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
code, pre { font-family: var(--mono); }
code { background: var(--code-bg); padding: .1em .38em; border-radius: 4px; font-size: .88em; overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; letter-spacing: -.01em; margin: 0; }
p { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 760px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 6px; z-index: 50; }
.skip:focus { top: 12px; }
.js-only { display: none; }
.js .js-only { display: flex; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--bg-alt); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 6px; font: 600 .95rem/1.2 var(--sans); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .12s ease, background .12s ease; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); text-decoration: none; filter: brightness(1.06); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--bg); text-decoration: none; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 56px; border-bottom: 1px solid var(--line); background:
  radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--bg); }
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow { font: 600 .8rem/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; margin-bottom: 20px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; margin-bottom: 28px; }
.trust { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .92rem; color: var(--muted); }
.trust li::before { content: "✓"; color: var(--teal); font-weight: 700; margin-right: 8px; }

.log { margin: 0; background: var(--log-bg); color: var(--log-ink); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid #00000022; transform: rotate(.6deg); }
.log-head { display: flex; align-items: center; gap: 6px; padding: 10px 14px; font: .75rem var(--mono); color: var(--log-dim); border-bottom: 1px solid #ffffff14; }
.log-dot { width: 10px; height: 10px; border-radius: 50%; background: #ffffff26; }
.log-body { margin: 0; padding: 18px 18px 20px; font-size: .8rem; line-height: 1.75; overflow-x: auto; }
.log-body code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
.log .ok { color: var(--log-ok); }
.log .warn { color: var(--log-warn); }
.log .dim { color: var(--log-dim); }

/* ---------- sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); margin-bottom: 8px; }
.section-sub { color: var(--muted); margin: 0; }

/* ---------- filter ---------- */
.filter { gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 24px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 600 .88rem/1 var(--sans); padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search input { font: inherit; font-size: .95rem; padding: 10px 14px; min-width: min(320px, 100%); border-radius: 6px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.search input::placeholder { color: var(--muted); }

/* ---------- cards ---------- */
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; overflow: hidden; }
.card::before { content: ""; position: absolute; top: 0; right: 0; width: 34px; height: 34px; background: linear-gradient(225deg, var(--bg) 50%, var(--line) 50%); }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card[hidden] { display: none; }
.card-top { display: flex; align-items: center; gap: 12px; font: .75rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-right: 30px; margin-bottom: 14px; }
.card-code { background: var(--ink); color: var(--bg); padding: 3px 7px; border-radius: 3px; font-weight: 700; letter-spacing: .04em; }
.card-title { font-size: 1.3rem; margin-bottom: 8px; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-title a:focus-visible { outline: none; }
.card:has(.card-title a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.card-sum { color: var(--muted); font-size: .96rem; margin-bottom: 14px; }
.card-bul { list-style: none; padding: 0; margin: 0 0 16px; font-size: .92rem; border-top: 1px dashed var(--line); padding-top: 12px; }
.card-bul li { padding-left: 20px; position: relative; margin-bottom: 4px; }
.card-bul li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.tags { list-style: none; padding: 0; margin: auto 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 600 .72rem/1 var(--mono); padding: 5px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.tag-standalone { background: var(--teal-bg); color: var(--teal); border-color: transparent; }
.tag-integration { border-style: dashed; color: var(--ink); }
.card-about { font-size: .82rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; margin: 0 0 10px; }
.card-go { font-weight: 700; font-size: .92rem; color: var(--link); }
.empty { margin-top: 20px; padding: 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* ---------- steps / facts ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.steps li { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px 18px; }
.steps li::before { content: counter(step); display: block; font: 700 2.2rem/1 var(--serif); color: var(--accent); margin-bottom: 10px; }
.steps h3, .facts h3 { font-size: 1.1rem; margin-bottom: 6px; }
.steps p, .facts p { margin: 0; color: var(--muted); font-size: .95rem; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px 32px; }
.facts li { border-left: 3px solid var(--accent); padding-left: 16px; }

/* ---------- about block ---------- */
.about-block { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: var(--radius); padding: 24px 26px; margin: 40px 0 0; box-shadow: var(--shadow); }
.section .about-block { margin: 0; }
.about-kicker { font: 700 .75rem/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 10px; }
.about-text { font-family: var(--serif); font-size: 1.15rem; line-height: 1.55; margin-bottom: 18px; }
.about-block .cta-row:empty { display: none; }

/* ---------- faq ---------- */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 28px 16px 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.5rem; color: var(--accent); transition: transform .15s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding: 0 0 18px; margin: 0; }

/* ---------- document pages ---------- */
.doc { padding-top: 28px; padding-bottom: 72px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 24px; font-size: .88rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumbs a { color: var(--muted); }
.doc-head { margin-bottom: 36px; max-width: 820px; }
.doc-head h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: 16px; }
.doc-head .lead { margin-bottom: 0; }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.doc-main section, .prose section { margin-bottom: 40px; }
.doc-main h2, .prose h2 { font-size: 1.6rem; margin-bottom: 14px; }
.doc-single .prose, .doc-single .doc-head { max-width: 820px; }
.list-num, .list-dot { padding-left: 1.3em; margin: 0 0 1em; }
.list-num li, .list-dot li { margin-bottom: 10px; padding-left: 4px; }
.list-num li::marker { color: var(--accent); font-weight: 700; font-family: var(--mono); }
.list-dot li::marker { color: var(--accent); }
.note { font-size: .92rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 14px; }
.code { background: var(--log-bg); color: var(--log-ink); padding: 16px 18px; border-radius: var(--radius); overflow-x: auto; font-size: .86rem; line-height: 1.7; margin: 0 0 1em; }
.code code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font: 700 .75rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg-alt); }

.doc-side { position: sticky; top: 88px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.side-h { font: 700 1.1rem var(--serif); margin: 0 0 14px; }
.facts-list { margin: 0 0 16px; }
.facts-list div { padding: 10px 0; border-top: 1px dashed var(--line); }
.facts-list dt { font: 600 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.facts-list dd { margin: 0; font-size: .92rem; }
.side-note { font-size: .9rem; color: var(--muted); }
.side-card .cta-row { flex-direction: column; }

.related { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.5rem; margin-bottom: 18px; }
.related-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.related-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; color: var(--muted); }
.related-list a { font-weight: 700; font-size: 1.02rem; color: var(--ink); text-decoration: none; }
.related-list a:hover { color: var(--link); }

.services { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.services li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.services h2 { font-size: 1.25rem; margin-bottom: 8px; }
.services p { color: var(--muted); margin: 0; font-size: .96rem; }
.contacts { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 12px; }
.prose .steps { margin-bottom: 20px; }

/* ---------- footer ---------- */
.foot { margin-top: 24px; background: var(--ink); color: var(--bg); padding: 48px 0 28px; font-size: .92rem; }
.foot a { color: var(--bg); opacity: .85; }
.foot a:hover { opacity: 1; }
.foot-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot-brand { font: 700 1.3rem var(--serif); margin: 0 0 8px; }
.foot-h { font: 700 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; opacity: .65; margin: 0 0 12px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 6px; }
.foot-contacts { margin-top: 12px; }
.foot-legal { margin-top: 32px; padding-top: 20px; border-top: 1px solid #ffffff26; font-size: .8rem; opacity: .7; }
.foot-legal p { margin-bottom: .6em; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 40px 0; }
  .hero-in { grid-template-columns: 1fr; gap: 32px; }
  .log { transform: none; }
  .doc-grid { grid-template-columns: 1fr; gap: 32px; }
  .doc-side { position: static; order: -1; }
  .foot-in { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .cards { grid-template-columns: 1fr; }
  .top-in { padding-block: 8px; }
  .btn-lg { width: 100%; }
  .hero .cta-row .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
@media print {
  .top, .foot, .doc-side, .filter, .skip { display: none; }
  body { background: #fff; color: #000; }
}
