:root {
  color-scheme: light;
  --ink: #101115;
  --muted: #555968;
  --paper: #fff;
  --line: #cdd3e0;
  --blue: #133ef0;
  --tint: #f5f7ff;
  --selected: #dce4ff;
  font: 16px/1.5 system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--blue); text-underline-offset: .2em; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin-block-start: 0; }
.shell { width: min(100% - clamp(40px, 8vw, 120px), 1368px); margin-inline: auto; }
.top, .footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.top { min-height: 76px; padding-inline: clamp(0px, 1.8vw, 26px); }
nav { display: flex; flex-wrap: wrap; gap: clamp(16px, 3vw, 36px); }
nav a { font-size: clamp(.94rem, 1.35vw, 1.2rem); padding-block: 9px; }
nav a[aria-current] { color: var(--ink); font-weight: 650; }
.brand { color: var(--ink); text-decoration: none; font-weight: 900; font-size: 2rem; letter-spacing: -.09em; line-height: 1; }
.brand span, h1 span { color: var(--blue); }
main { min-height: 72vh; }
h1 { font-size: clamp(3rem, 7vw, 6.6rem); font-weight: 780; letter-spacing: -.065em; line-height: .87; margin-bottom: 18px; }
.lead { font-size: clamp(1.02rem, 1.65vw, 1.4rem); line-height: 1.4; font-weight: 500; color: var(--muted); margin-bottom: 17px; }
.primary, .choice { border-radius: 9px; font-weight: 650; }
.primary { display: inline-flex; align-items: center; justify-content: center; min-height: 47px; padding: 9px 24px; color: white; background: var(--blue); text-decoration: none; font-size: clamp(1rem, 1.45vw, 1.22rem); }
.primary:hover { background: #0e2bb4; }
.label { color: var(--blue); font-size: clamp(.95rem, 1.5vw, 1.22rem); font-weight: 720; margin-bottom: 7px; }
h2 { font-size: clamp(2rem, 3.35vw, 3.25rem); font-weight: 740; letter-spacing: -.052em; line-height: 1.08; margin-bottom: 9px; }
.choice { background: white; border: 0; padding: 8px 13px; min-height: 43px; }
.choice:hover { background: var(--selected); color: #1537c8; }
.case-study { border-top: 1px solid var(--line); scroll-margin-top: 14px; }
.case-intro { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 68px); padding-block: clamp(38px, 6vw, 86px); }
.case-intro h2 { font-size: clamp(2.7rem, 6.25vw, 6.4rem); margin-bottom: 20px; line-height: .93; }
.case-intro h2 span { color: var(--blue); }
.case-intro blockquote { margin: 0 0 14px; font-size: clamp(1.25rem, 3vw, 2.55rem); font-weight: 640; letter-spacing: -.03em; }
.case-opening > p:not(.label) { max-width: 48ch; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.22rem); }
.case-entry { display: inline-flex; gap: 10px; padding-block: 4px; font-weight: 670; }
.case-cover, .chapter-shot { margin: 0; min-width: 0; }
.case-cover { background: #e8edff; padding: clamp(12px, 2.8vw, 36px); }
.case-cover .shot-link { box-shadow: 0 12px 30px #10245420; }
.shot-link { display: block; position: relative; background: white; }
.shot-link img { display: block; width: 100%; height: auto; }
.shot-link::after { content: "Увеличить"; position: absolute; right: 8px; bottom: 8px; background: white; color: var(--blue); border: 1px solid var(--line); padding: 3px 8px; font-size: .82rem; font-weight: 650; }
.shot-link:hover::after, .shot-link:focus-visible::after { background: var(--blue); color: white; border-color: var(--blue); }
.case-cover figcaption, .chapter-shot figcaption { margin-top: 9px; color: var(--muted); font-size: .9rem; }
.architecture { grid-column: 1 / -1; color: var(--ink); background: var(--tint); padding: clamp(16px, 3vw, 28px); }
.architecture summary { cursor: pointer; font-weight: 680; }
.architecture[open] summary { margin-bottom: 18px; }
.service-map { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 4vw, 55px); }
.service-map li { position: relative; border-top: 1px solid var(--line); padding-top: 10px; min-width: 0; }
.service-map li:not(:last-child)::after { content: "→"; position: absolute; top: -15px; right: -14px; color: var(--blue); }
.service-map a, .service-map span { color: var(--blue); display: block; font-size: .9rem; }
.service-map strong { display: block; margin-top: 3px; font-size: clamp(1rem, 1.55vw, 1.33rem); overflow-wrap: anywhere; }
.service-map p { margin: 5px 0 0; color: var(--ink); max-width: 30ch; }
.source-branch { max-width: 65ch; margin: 24px 0 0; border-left: 1px solid var(--blue); padding-left: 12px; color: var(--ink); }
.source-branch strong { color: var(--ink); margin-right: 7px; }
.case-layout { display: grid; grid-template-columns: clamp(190px, 19vw, 265px) minmax(0, 1fr); gap: clamp(20px, 4vw, 64px); align-items: start; scroll-margin-top: 18px; padding-bottom: clamp(40px, 6vw, 85px); }
.chapter-nav { position: sticky; top: 25px; display: block; padding: 12px 0; }
.chapter-nav > p { font-weight: 740; margin: 0 0 10px; }
.chapter-nav ol, .story-path ol { list-style: none; margin: 0; padding: 0; }
.chapter-nav li { position: relative; }
.chapter-nav ol ol { border-left: 1px solid var(--line); margin-left: 6px; padding-left: 15px; }
.chapter-nav ol ol > li::before { content: ""; position: absolute; width: 10px; border-top: 1px solid var(--line); left: -15px; top: 20px; }
.chapter-nav a { display: inline-block; color: var(--muted); font-size: .94rem; text-decoration: none; padding: 7px 3px; }
.chapter-nav a:hover, .chapter-nav a[aria-current] { color: var(--blue); }
.chapter-nav a[aria-current] { font-weight: 750; }
.story-path { border-top: 1px solid var(--line); padding-block: 10px; margin-bottom: 18px; }
.story-path ol { display: flex; flex-wrap: wrap; gap: 4px 11px; }
.story-path li + li::before { content: "/"; margin-right: 11px; color: var(--muted); }
.story-path a { font-size: .91rem; padding: 4px 0; }
.story-path a[aria-current] { text-decoration: none; }
.chapter { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); align-items: start; gap: 18px clamp(22px, 4vw, 58px); }
.root-chapter .chapter-head { grid-column: 1 / -1; }
.chapter-head h3 { font-size: clamp(2rem, 3.6vw, 3.7rem); line-height: 1.01; font-weight: 740; letter-spacing: -.055em; margin-bottom: 16px; }
.chapter-head > p:last-child { color: var(--muted); max-width: 43ch; margin-bottom: 0; }
.comparison { min-width: 0; }
.version-switch {
  --switch-inset: 3px;
  display: inline-grid; grid-template-columns: repeat(2, 1fr); position: relative; isolation: isolate;
  max-width: 100%; padding: var(--switch-inset); margin-bottom: 18px; border-radius: 9px; background: var(--tint);
}
.version-switch::before {
  content: ""; position: absolute; z-index: -1;
  inset: var(--switch-inset) auto var(--switch-inset) var(--switch-inset);
  width: calc(50% - var(--switch-inset)); border-radius: 6px; background: var(--selected);
  transform: translateX(0);
}
.version-switch:has([data-choice="after"][aria-pressed="true"])::before { transform: translateX(100%); }
.version-switch button {
  background: transparent; padding: 6px 12px; min-height: 44px; border: 0; border-radius: 6px;
  font-weight: 650; touch-action: manipulation;
}
.version-switch button[aria-pressed="true"] { color: var(--blue); }
@media (hover: hover) {
  .version-switch button:hover { color: var(--blue); }
}
@media (prefers-reduced-motion: no-preference) {
  [data-compare][data-animate] .version-switch::before { transition: transform 165ms cubic-bezier(.65,0,.35,1); }
}
.news-example { margin: 0 0 15px; padding: 10px 0 12px 16px; border-left: 3px solid var(--blue); }
.news-example figcaption, .demo-label { color: var(--muted); font-size: .875rem; }
.news-example blockquote { margin: 4px 0 0; font-size: clamp(1.13rem, 2.05vw, 1.7rem); letter-spacing: -.025em; line-height: 1.28; }
.comparison-result { min-height: 98px; background: var(--tint); padding: 14px 16px; }
.comparison-result strong { display: block; color: #1537c8; }
.comparison-result p { margin: 4px 0 0; }
.pipeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin: 0 0 17px; padding: 0; list-style: none; }
.pipeline li { position: relative; border-bottom: 2px solid var(--line); padding: 10px 2px; min-width: 0; font-weight: 650; }
.pipeline li:not(:last-child)::after { content: "→"; position: absolute; inset: 10px -8px auto auto; color: var(--muted); font-weight: 400; }
.pipeline .pipeline-change { color: var(--blue); border-color: var(--blue); }
.pipeline-caption, .reading-sample { margin-bottom: 0; min-height: 80px; }
.pipeline-caption strong { display: block; }
.pipeline-caption mark { background: var(--selected); color: var(--ink); }
.structure-label { font-weight: 680; margin-bottom: 8px; }
.structure { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 16px; padding: 0; list-style: none; color: var(--muted); font-size: .94rem; }
.structure li { border-bottom: 1px solid var(--line); }
.structure li:first-child { border-color: var(--blue); color: var(--blue); }
.reading-sample { border-top: 2px solid var(--blue); padding-top: 10px; font-size: clamp(1.11rem, 1.9vw, 1.52rem); line-height: 1.32; }
.demo-label { margin: 9px 0 0; }
.evidence { grid-column: 2; border-top: 1px solid var(--line); padding: 9px 0 0; }
.evidence summary { color: var(--blue); cursor: pointer; font-weight: 650; padding-block: 5px; }
.evidence p { margin: 8px 0; }
.evidence a { display: inline-block; margin: 0 16px 3px 0; }
.story-choices { grid-column: 1 / -1; min-width: 0; }
.choice-heading { margin: 0 0 10px; color: var(--muted); font-size: .91rem; font-weight: 670; }
.branch-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.prompt-sample { margin: 12px 0 0; padding: 9px 10px; border-left: 2px solid #758ce7; background: #eef1fa; overflow-wrap: anywhere; }
.prompt-sample figcaption { color: var(--muted); font-size: .82rem; font-weight: 650; }
.prompt-sample blockquote { margin: 3px 0 0; font: .9rem/1.45 ui-monospace, Consolas, monospace; }
.service-handoff { list-style: none; margin: 0; padding: 0 0 0 13px; border-left: 2px solid var(--blue); }
.service-handoff li + li { margin-top: 12px; }
.service-handoff strong, .service-handoff span { display: block; }
.service-handoff span { color: var(--muted); }
.chapter-shot { grid-column: 1 / -1; margin-top: 10px; padding: clamp(10px, 2vw, 22px); background: #eef1fa; }
.excerpt-shot { background: var(--tint); max-width: 830px; }
.publication-gallery { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(10px, 2vw, 25px); align-items: start; }
.publication-gallery .chapter-shot { grid-column: auto; min-width: 0; }
.publication-log { width: 100%; border-collapse: collapse; text-align: left; }
.publication-log caption { text-align: left; padding-bottom: 10px; font-weight: 680; }
.publication-log th, .publication-log td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); }
.publication-log thead { color: var(--muted); font-size: .88rem; }
.publication-log time { white-space: nowrap; }
.prose { max-width: 700px; padding-block: clamp(29px, 5vw, 70px); }
.prose > p { max-width: 62ch; }
.prose h3 { margin-top: 24px; margin-bottom: 7px; }
.footer { min-height: 76px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.footer nav a { font-size: .875rem; }
.screenshot-dialog { max-width: min(94vw, 1320px); max-height: 92vh; padding: 0; border: 1px solid var(--line); color: var(--ink); }
.screenshot-dialog::backdrop { background: #111933c9; }
.screenshot-dialog figure { margin: 0; padding: 14px; display: grid; gap: 9px; }
.screenshot-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; }
.screenshot-original { padding-block: 9px; font-size: .94rem; font-weight: 650; }
.screenshot-dialog img { display: block; width: auto; max-width: 100%; height: auto; max-height: 75vh; margin-inline: auto; object-fit: contain; }
.screenshot-dialog figcaption { color: var(--muted); font-size: .94rem; max-width: 65ch; }
.screenshot-close { margin-left: auto; padding: 9px 13px; border: 1px solid var(--line); background: white; color: var(--blue); font-weight: 650; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.view :is(h1, h2, h3)[tabindex="-1"]:focus { outline: none; }
@media (max-width: 980px) {
  .chapter { grid-template-columns: 1fr; }
  .evidence { grid-column: auto; }
}
@media (max-width: 720px) {
  .case-intro, .publication-gallery { grid-template-columns: 1fr; }
  .service-map { grid-template-columns: 1fr; }
  .service-map li:not(:last-child)::after { content: "↓"; top: auto; bottom: -16px; right: 0; }
  .case-layout { grid-template-columns: 1fr; }
  .chapter-nav { display: none; }
  .story-path { padding-block: 8px; margin-bottom: 13px; }
  .branch-options { grid-template-columns: 1fr; }
}
@media (max-width: 490px) {
  .top { min-height: 63px; }
  h1 { font-size: clamp(1.95rem, 8.6vw, 2.65rem); margin-bottom: 12px; }
  .lead { font-size: .94rem; }
  .primary { padding-inline: 14px; }
}

.case-mode .top { min-height: 55px; }
.case-mode .top nav a { font-size: .9rem; }
.case-mode .footer { min-height: 58px; }
.case-mode .screenshot-dialog { color-scheme: light; color: #141d2a; background: white; }
.case-mode .screenshot-dialog a, .case-mode .screenshot-dialog button { color: #1643c9; }
.case-mode .case-layout {
  --node-accent: var(--blue);
  padding: clamp(12px, 2.2vw, 29px) 0;
  min-height: min(580px, calc(100svh - 141px));
  grid-template-columns: minmax(185px, .34fr) minmax(0, 1fr);
  gap: clamp(12px, 3vw, 42px);
  border-top: 1px solid var(--line);
}
.case-mode .chapter-nav { top: 74px; color: var(--muted); padding: 8px 0; }
.case-mode .chapter-nav li a { display: block; padding: 7px 8px; border-left: 1px solid transparent; margin-bottom: 4px; }
.case-mode .chapter-nav li.on-route > a { color: var(--ink); }
.case-mode .chapter-nav li > a[aria-current] { color: var(--node-accent); border-left-color: var(--node-accent); background: var(--selected); }
.case-mode .chapter-nav ol ol { border-left-color: var(--line); }
.case-mode .chapter-nav ol ol > li::before { border-color: var(--line); }
.case-mode .case-body { min-width: 0; }
.case-mode .story-path { padding: 4px 0 8px; margin-bottom: 8px; border: 0; }
.case-mode .story-path a[aria-current] { color: var(--node-accent); }
.case-mode .chapter {
  padding: clamp(16px, 2.8vw, 34px);
  background: var(--paper);
  border-top: 1px solid var(--line);
  gap: clamp(12px, 2vw, 24px);
  scroll-margin-top: 68px;
}
.case-mode .root-chapter { background: var(--tint); }
.case-mode .root-chapter .chapter-head { grid-column: auto; }
.brief-preview { margin: 0; align-self: center; min-width: 0; }
.brief-preview a { position: relative; display: block; overflow: hidden; max-height: clamp(130px, 14vw, 207px); }
.brief-preview img { width: 111%; max-width: none; height: auto; display: block; }
.brief-preview a:focus-visible { outline-offset: 3px; }
.brief-preview figcaption { margin-top: 5px; font-size: .83rem; color: var(--muted); }
.case-mode .chapter-head h3 { font-size: clamp(2rem, 4vw, 4.1rem); margin-bottom: 10px; }
.case-mode .root-chapter h3 { font-size: clamp(2rem, 3.45vw, 3.45rem); max-width: 18ch; text-wrap: balance; }
.case-mode .chapter-head .label, .case-mode .pipeline-change { color: var(--node-accent); }
.case-mode .pipeline-change { border-bottom-color: var(--node-accent); }
.case-mode .comparison-result { background: var(--tint); border-left: 2px solid var(--node-accent); min-height: 0; }
.case-mode .comparison-result strong { color: var(--ink); }
.case-mode .pipeline-caption mark { padding-inline: 3px; }
.case-mode .node-archive { grid-column: 1 / -1; margin: 0; padding: 8px 0 0; background: transparent; border-top: 1px solid var(--line); color: var(--muted); }
.node-archive > summary, .prompt-toggle > summary { cursor: pointer; color: var(--blue); font-size: .91rem; font-weight: 640; padding-block: 4px; }
.case-mode .prompt-sample { background: var(--tint); color: var(--ink); margin-top: 4px; }
.case-mode .prompt-toggle { margin-top: 6px; }
.case-mode .chapter-shot { background: var(--tint); }
.case-mode .shot-link::after { color: #1643c9; border-color: #9fb3d0; }
@media (max-width: 760px) {
  .case-mode .case-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .case-mode .chapter-nav { display: none; }
  .brief-preview { order: 2; }
  .brief-preview a { max-height: 132px; }
}
@media (max-width: 490px) {
  .case-mode .shell { width: calc(100% - 24px); }
  .case-mode .case-layout { padding-block: 9px; }
  .case-mode .chapter { padding: 12px; }
}

.case-mode .chapter-head > p:not(.label) { color: var(--muted); max-width: 52ch; margin-bottom: 12px; }
.case-mode .chapter-head .case-orientation { margin-bottom: 0; }
.case-orientation strong { color: var(--ink); }
.source-jump { display: inline-block; font-size: .94rem; font-weight: 650; }
.source-page main { max-width: 900px; padding-block: 36px 64px; }
.source-page h1 { font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1; }
.source-entry { border-top: 1px solid var(--line); padding-block: 28px; scroll-margin-top: 12px; }
.source-entry .label { font-size: .92rem; overflow-wrap: anywhere; }
.source-entry pre { margin: 12px 0; padding: 14px; background: var(--tint); border-left: 2px solid var(--blue); white-space: pre-wrap; overflow-wrap: anywhere; font: .9rem/1.5 ui-monospace, Consolas, monospace; }
.source-code summary { color: var(--blue); cursor: pointer; font-weight: 650; padding-block: 6px; }

.case-masthead { padding: clamp(24px, 5vw, 58px) 0 clamp(20px, 3.2vw, 36px); }
.case-masthead h2 { font-size: clamp(2.45rem, 5.85vw, 5.85rem); margin: 0 0 9px; }
.case-wordmark { display: inline-block; width: min(3.8em, 100%); vertical-align: -.2em; }
.case-wordmark img { display: block; width: 100%; height: auto; }
.case-masthead p { max-width: 62ch; margin: 14px 0 0; color: var(--ink); font-size: clamp(1.13rem, 1.95vw, 1.65rem); line-height: 1.45; }
.case-masthead p strong { color: var(--blue); font-weight: 720; }
.case-mode .top { min-height: 65px; }
.case-mode .case-layout { grid-template-columns: minmax(205px, 24%) minmax(0, 1fr); gap: clamp(24px, 4vw, 60px); padding-top: clamp(17px, 3vw, 36px); min-height: 0; }
.case-mode .chapter { padding: 8px 0 30px; border: 0; gap: clamp(12px, 2vw, 24px); }
.case-mode .root-chapter { background: var(--paper); }
.case-mode .chapter-nav { top: 16px; }
.case-mode .chapter-nav > ol { border-left: 1px solid var(--line); margin-left: 7px; }
.case-mode .chapter-nav > ol > li { padding: 0 0 14px 14px; }
.case-mode .chapter-nav > ol > li::before {
  content: ""; position: absolute; top: 13px; left: -6px; width: 9px; height: 9px;
  border: 1px solid var(--muted); border-radius: 50%; background: var(--paper);
}
.case-mode .chapter-nav > ol > li.on-route::before { background: var(--blue); border-color: var(--blue); }
.case-mode .chapter-nav li a { padding: 4px 0; margin: 0; border: 0; }
.case-mode .chapter-nav > ol > li > a { font-size: 1rem; font-weight: 720; }
.case-mode .chapter-nav li > a[aria-current] { background: transparent; }
.case-mode .chapter-nav ol ol { margin: 4px 0 0; }
.case-mode .chapter-nav ol ol > li::before { top: 14px; }
.case-mode .story-path { display: none; }
.code-excerpt { padding: 10px 12px; margin: 0 0 10px; background: var(--tint); border-radius: 7px; white-space: pre-wrap; overflow-wrap: anywhere; font: .9rem/1.45 ui-monospace, Consolas, monospace; }
.story-next {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 14px; align-items: center;
  padding: clamp(14px, 2vw, 23px) 0; border-block: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.story-next-label { grid-column: 1; color: var(--muted); font-size: .83rem; font-weight: 630; }
.story-next-title { grid-column: 1; font-size: clamp(1.16rem, 2vw, 1.65rem); line-height: 1.17; font-weight: 735; }
.story-next-arrow {
  grid-area: 1 / 2 / span 2; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; background: var(--tint);
  color: var(--blue); font-size: 1.4rem; line-height: 1;
}
.story-next:focus-visible { outline-offset: 4px; }
.story-next:focus-visible .story-next-title { color: var(--blue); }
.story-next:focus-visible .story-next-arrow { background: var(--selected); }
@media (hover: hover) {
  .story-next:hover .story-next-title { color: var(--blue); }
  .story-next:hover .story-next-arrow { background: var(--selected); }
}
.work-style { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 17px; }
.work-style h4 { font-size: 1.35rem; margin: 0 0 9px; }
.work-style ul { padding-left: 19px; margin: 0; max-width: 64ch; }
.work-style li + li { margin-top: 7px; }
@media (max-width: 760px) {
  .case-mode .case-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .case-mode .chapter-nav { display: block; position: static; padding: 0; }
  .case-mode .chapter-nav > ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin: 0; border: 0; }
  .case-mode .chapter-nav > ol > li { padding: 0; border-bottom: 1px solid var(--line); }
  .case-mode .chapter-nav > ol > li::before, .case-mode .chapter-nav ol ol { display: none; }
  .case-mode .chapter-nav > ol > li > a { font-size: .91rem; padding: 8px 0; }
  .case-mode .story-path:not([hidden]) { display: block; margin: 0 0 10px; }
}
