/* «Про AI»: the button in the bar and the sheet. */

.bar { justify-content: space-between; }
.about {
  appearance: none; border: 1px solid var(--rm-black); border-radius: 0; cursor: pointer;
  background: var(--rm-white); color: var(--rm-black); font: inherit; font-size: 15px; line-height: 1;
  height: 40px; padding: 0 16px; display: inline-flex; align-items: center;
  transition: background-color 140ms ease-out, color 140ms ease-out;
}
.about:hover, .about[aria-expanded="true"] { background: var(--rm-black); color: var(--rm-white); }

/* ── Sheet ── */
.sheet { position: fixed; inset: 0; z-index: 10; }
.sheet[hidden] { display: none; }
.sheet__veil { position: absolute; inset: 0; background: rgb(255 255 255 / 0.94); animation: veil 240ms ease-out both; }
@keyframes veil { from { opacity: 0; } }
.sheet__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100vw);
  background: var(--rm-white); border-left: 1px solid var(--rm-black);
  display: flex; flex-direction: column;
  animation: sheet-in 420ms var(--e-out) both;
}
@keyframes sheet-in { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0); } }

.sheet__head {
  flex: none; height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px 0 40px; border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 16px; height: 100%; margin-left: -10px; }
.tab {
  appearance: none; border: 0; border-radius: 0; background: none; cursor: pointer; padding: 0 10px;
  font: inherit; font-size: 16px; color: var(--ink-2); position: relative;
  transition: color 140ms ease-out;
}
.tab::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--rm-black);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform 260ms var(--e-out);
}
.tab:hover { color: var(--rm-black); }
.tab:focus-visible { outline-offset: -4px; }
.tab[aria-selected="true"] { color: var(--rm-black); }
.tab[aria-selected="true"]::after { transform: none; }
.sheet__close {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
  width: 40px; height: 40px; display: grid; place-items: center;
}
.sheet__close .ico { width: 18px; height: 18px; }
.sheet__close:hover { background: var(--rm-grey-100); }

.sheet__body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 36px 40px 40px; outline: none;
  scrollbar-width: thin; scrollbar-color: var(--rm-grey-300) transparent;
}
.sheet__body.is-in > * { animation: ch-in 360ms var(--e-out) both; }
.sheet__body.is-in > :nth-child(2) { animation-delay: 40ms; }
.sheet__body.is-in > :nth-child(n+3) { animation-delay: 80ms; }
@keyframes ch-in { from { opacity: 0; transform: translateX(calc(var(--dir, 0) * 24px)) translateY(calc((1 - var(--dir, 0) * var(--dir, 0)) * 8px)); } }

.ch__title { margin: 0; font-size: clamp(28px, 2.6vw, 36px); line-height: 1.14; font-weight: 400; letter-spacing: -0.015em; text-wrap: balance; max-width: 20ch; }
.ch__lede { margin-top: 14px; font-size: 17px; line-height: 1.5; color: var(--ink-2); max-width: 58ch; }
.sub { margin: 0 0 14px; font-size: 20px; line-height: 1.25; font-weight: 400; }

.also { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--rm-black); display: grid; gap: 12px; }
.also__cap { font-size: 14px; color: var(--ink-2); }

/* Chapter 1: eight abilities around the model. */
.ring {
  margin: 32px 0 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px;
  border-top: 1px solid var(--line);
}
.ring > * { border-bottom: 1px solid var(--line); }
.ring__cell { padding: 16px 0 18px; display: grid; gap: 4px; align-content: start; }
.ring__name { font-size: 16px; line-height: 1.25; }
.ring__text { font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.ring__core {
  background: var(--rm-black); color: var(--rm-white); display: grid; place-items: center; min-height: 120px;
}
.ring__core span { font-family: var(--font-display); font-size: clamp(22px, 2.2vw, 30px); line-height: 1; }

.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
.path li { padding-top: 14px; border-top: 1px solid var(--rm-black); position: relative; }
.path li::before { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; background: var(--rm-black); }
.path li:last-child::before { background: var(--rm-red); }
.path__name { font-size: 16px; line-height: 1.25; }
.path__text { margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }

/* Chapter 2: the stack; offers light their layers. */
.layers .stack__row { transition: color 160ms ease-out; }
.sheet__body .also:first-of-type:not(:last-child) { margin-top: 24px; }
.pick[aria-pressed="true"] { background: var(--rm-black); color: var(--rm-white); }
.picked {
  margin-top: 24px; min-height: 44px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  font-size: 15px; line-height: 1.45;
}
.picked span { max-width: 52ch; }
.go {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 0;
  font: inherit; color: var(--rm-black); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.go:hover { text-decoration: underline; text-underline-offset: 4px; }
.layers { margin-top: 16px; }

/* Chapter 3: a stair, each step indented further and dearer. */
.stairs { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 8px; }
.stairs li {
  margin-left: calc(var(--i) * 12%); padding: 12px 16px 14px;
  border-top: 1px solid var(--rm-black); background: var(--rm-grey-100);
}
.stairs li:first-child { background: var(--rm-black); color: var(--rm-white); }
.stairs li:first-child .stairs__text { color: var(--ink-2-dark); }
.stairs__name { font-size: 17px; line-height: 1.25; }
.stairs__text { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.stairs__axis { margin-top: 10px; display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.swap { margin-top: 32px; }
.swap p { font-size: 16px; line-height: 1.5; max-width: 58ch; }

.sheet__foot {
  flex: none; display: flex; justify-content: space-between; gap: 16px;
  padding: 14px 40px; border-top: 1px solid var(--line);
}
.step {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 8px 0;
  font: inherit; font-size: 15px; color: var(--rm-black); display: inline-flex; align-items: center; gap: 10px;
}
.step[hidden] { display: none; }
.step--next { margin-left: auto; }
.step:hover span { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 767px) {
  .about { height: 36px; padding: 0 12px 0 10px; font-size: 14px; }
  .sheet__head { padding: 0 8px 0 16px; height: 56px; }
  .tabs { gap: 4px; }
  .tab { font-size: 15px; }
  .sheet__body { padding: 24px 16px 32px; }
  .sheet__foot { padding: 10px 16px; }
  .ring { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ring__core { grid-column: 1 / -1; grid-row: 1; min-height: 72px; }
  /* «Слои»: offers scroll in one row so the lit stack stays in the first screen. */
  .chips--pick { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .chips--pick .chip { white-space: nowrap; }
  .layers .stack__text { display: none; }
  .picked { margin-top: 16px; font-size: 14px; }
  .path { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
  .stairs li { margin-left: calc(var(--i) * 8%); }
}
@media (prefers-reduced-motion: reduce) {
  .sheet__veil, .sheet__panel, .sheet__body.is-in > * { animation: none; }
  .tab::after { transition: none; }
}
