/* 22515407: курсовая по методичке. Своя сцена (works/22515407/stage.html).
   Без скрипта и при отключённых анимациях: оглавление, счётчики и все 18 листов плиткой, каждый открывается крупно.
   В режиме истории: оглавление слева, листы ложатся в стопку, камера подъезжает к таблицам, в конце раскладка всех листов. */

#w22515407 .cw { display: grid; gap: 22px; width: 100%; font-family: var(--text); color: var(--ink); }
#w22515407 .cw-k { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--meta); }
#w22515407 .cw-toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; font-size: 15px; line-height: 1.25; max-width: 420px; }
#w22515407 .cw-toc li { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 3px 8px 3px 20px; border-radius: 6px; }
#w22515407 .cw-toc li::before { content: ""; position: absolute; left: 6px; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; }
#w22515407 .cw-toc .cw-l1 { padding-left: 34px; font-size: 14px; }
#w22515407 .cw-toc .cw-l1::before { left: 20px; width: 4px; height: 4px; top: 0.68em; }
#w22515407 .cw-n { flex: none; color: var(--meta); font-variant-numeric: tabular-nums; font-size: 13px; }
#w22515407 .cw-stats { display: flex; margin-top: 16px; }
#w22515407 .cw-stats p { margin: 0; display: flex; flex-direction: column; gap: 4px; padding: 0 16px; border-left: 1px solid var(--line); }
#w22515407 .cw-stats p:first-child { padding-left: 0; border-left: 0; }
#w22515407 .cw-stats b { font: 800 44px/0.9 var(--display); font-variant-numeric: tabular-nums; }
#w22515407 .cw-stats span { font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--meta); }
#w22515407 .cw-note { margin: 14px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--meta); max-width: 36ch; }
#w22515407 .cw-strip, #w22515407 .cw-chip, #w22515407 .cw-fin, #w22515407 .cw-num { display: none; }
@media (min-width: 900px) {
  #w22515407 .cw { grid-template-columns: minmax(260px, 300px) minmax(0, 1fr); align-items: start; gap: 36px; }
}
#w22515407 .cw-cam { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
#w22515407 .cw-pg { position: relative; background: #fff; box-shadow: 0 0 0 1px rgba(14, 26, 58, 0.13), 0 10px 22px -14px rgba(14, 26, 58, 0.45); }
#w22515407 .cw-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #fff; cursor: zoom-in; line-height: 0; }
#w22515407 .cw-open img { display: block; width: 100%; height: auto; }
#w22515407 .cw-hot { position: absolute; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: zoom-in; }
#w22515407 .cw-hot:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
#w22515407 .cw-cap { display: none; }

/* ——— режим истории ——— */
#w22515407:is(.story *) .cw { position: absolute; inset: 0; display: block; --cw-k: 0; }
#w22515407:is(.story *) .cw-nav {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--cw-nav, 250px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 3;
}
#w22515407:is(.story *) .cw-toc { font-size: 14px; gap: 0; }
#w22515407:is(.story *) .cw-toc li { padding: 4px 8px 4px 20px; color: var(--meta); transition: color 0.3s, background-color 0.3s; }
#w22515407:is(.story *) .cw-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#w22515407:is(.story *) .cw-toc .cw-l1 { font-size: 13px; padding-left: 32px; }
#w22515407:is(.story *) .cw-toc li::before { opacity: 0.35; background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; transition: opacity 0.3s, background-color 0.3s; }
#w22515407:is(.story *) .cw-toc li.cw-done { color: var(--ink); }
#w22515407:is(.story *) .cw-toc li.cw-done::before { opacity: 0.85; background: currentColor; }
#w22515407:is(.story *) .cw-toc li.cw-cur { color: var(--ink); background: var(--mk); font-weight: 700; }
#w22515407:is(.story *) .cw-toc li.cw-cur::before { opacity: 1; background: var(--ink); }
#w22515407:is(.story *) .cw-toc li.cw-cur .cw-n { color: var(--ink); }
#w22515407:is(.story *) .cw-toc li.cw-ch.cw-cur { background: none; }
#w22515407:is(.story *) .cw-stats { margin-top: 16px; padding: 14px 0 0 8px; border-top: 1px solid var(--line); }
#w22515407:is(.story *) .cw-stats b { font-size: clamp(34px, 3.2vw, 46px); min-width: 1.1em; }
#w22515407:is(.story *) .cw-note { padding-left: 8px; }

#w22515407:is(.story *) .cw-desk {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  clip-path: inset(calc(var(--cw-ay, 0px) * (1 - var(--cw-k))) 0 0 calc(var(--cw-ax, 0px) * (1 - var(--cw-k))) round 20px);
}
#w22515407:is(.story *) .cw-desk::before {
  content: "";
  position: absolute;
  inset: calc(var(--cw-ay, 0px) * (1 - var(--cw-k))) 0 0 calc(var(--cw-ax, 0px) * (1 - var(--cw-k)));
  border-radius: 20px;
  background: var(--wash);
  opacity: calc(1 - var(--cw-k) * 0.6);
}
#w22515407:is(.story *) .cw-cam { position: absolute; left: 0; top: 0; width: 0; height: 0; display: block; transform-origin: 0 0; }
#w22515407:is(.story *) .cw-pg {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  transform-origin: 0 0;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(14, 26, 58, 0.16);
}
#w22515407:is(.story *) .cw-pg.cw-top { pointer-events: auto; box-shadow: 0 0 0 1px rgba(14, 26, 58, 0.12), 0 2px 6px rgba(14, 26, 58, 0.08), 0 30px 50px -30px rgba(14, 26, 58, 0.55); }
#w22515407:is(.story *) .cw-open img { width: 100%; height: 100%; }
#w22515407:is(.story *) .cw-hot { transition: box-shadow 0.3s, background-color 0.3s; }
#w22515407:is(.story *) .cw-hot.cw-hl { box-shadow: 0 0 0 2px var(--mk), 0 0 0 4px rgba(14, 26, 58, 0.18); }
@media (hover: hover) {
  #w22515407:is(.story *) .cw-top .cw-hot:hover { box-shadow: 0 0 0 2px var(--ink); background: rgba(14, 26, 58, 0.03); }
  #w22515407:is(.story *) .cw-top .cw-hot:hover .cw-cap { display: block; }
}
#w22515407:is(.story *) .cw-cap {
  position: absolute;
  left: -2px;
  top: -2px;
  translate: 0 -100%;
  padding: 3px 7px;
  border-radius: 5px 5px 5px 0;
  background: var(--ink);
  color: #fff;
  font: 700 11px/1.2 var(--text);
  white-space: nowrap;
}

/* подпись к таблице или рисунку, к которым подъехала камера */
#w22515407:is(.story *) .cw-chip {
  position: absolute;
  left: var(--cw-dcx, 50%);
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - var(--cw-ax, 0px) - 24px);
  margin: 0;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  translate: -50% 10px;
  opacity: 0;
  transition: opacity 0.3s, translate 0.35s var(--ease);
  pointer-events: none;
}
#w22515407:is(.story *) .cw-chip span { overflow: hidden; text-overflow: ellipsis; }
#w22515407:is(.story *) .cw-chip svg { flex: none; color: var(--mk); }
#w22515407:is(.story *) .cw-chip.cw-chip-in { opacity: 1; translate: -50% 0; }
/* под плашкой текст листа гаснет, а не срезается её краем */
#w22515407:is(.story *) .cw-desk::after {
  content: "";
  position: absolute;
  left: var(--cw-ax, 0px);
  right: 0;
  bottom: 0;
  height: 64px;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff 72%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 2;
}
#w22515407:is(.story *) .cw-desk:has(.cw-chip-in)::after { opacity: 1; }

/* финал: все листы, таблицы и рисунки отмечены маркером */
#w22515407:is(.story *) .cw-fin {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 4;
  margin: 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
}
#w22515407:is(.story *) .cw-fs { display: none; }
#w22515407:is(.story *) .cw-fin i {
  display: inline-block;
  width: 14px;
  height: 10px;
  margin: 0 5px 0 14px;
  border-radius: 2px;
  background: var(--mk);
  box-shadow: inset 0 0 0 1px rgba(14, 26, 58, 0.25);
  vertical-align: 0;
}
#w22515407:is(.story *) .cw-fin-on .cw-pg { pointer-events: auto; box-shadow: 0 0 0 1px rgba(14, 26, 58, 0.14), 0 12px 24px -16px rgba(14, 26, 58, 0.55); }
#w22515407:is(.story *) .cw-mark .cw-hot { background: color-mix(in srgb, var(--mk) 62%, transparent); mix-blend-mode: multiply; box-shadow: none; }
#w22515407:is(.story *) .cw-fin-on .cw-chip { opacity: 0; }

/* телефон боком: сцена ниже 150 px, вместо стопки лента всех листов */
#w22515407:is(.story *) .cw-film .cw-pg { pointer-events: auto; box-shadow: 0 0 0 1px rgba(14, 26, 58, 0.2); transition: opacity 0.3s, box-shadow 0.3s; }
#w22515407:is(.story *) .cw-film .cw-pg.cw-now { box-shadow: 0 0 0 2px var(--ink), 0 6px 10px -6px rgba(14, 26, 58, 0.6); }
#w22515407:is(.story *) .cw-film .cw-hot { background: color-mix(in srgb, var(--mk) 62%, transparent); mix-blend-mode: multiply; box-shadow: none; }
#w22515407:is(.story *) .cw-film .cw-chip, #w22515407:is(.story *) .cw-film .cw-fin { display: none; }
#w22515407:is(.story *) .cw-film.cw-fin-on .cw-strip { opacity: 1; }

/* телефон и узкое окно: оглавление прячется, сверху строка с разделом и счётчиком */
@media (max-width: 899px) {
  #w22515407:is(.story *) .cw-nav { display: none; }
  #w22515407:is(.story *) .cw-strip {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 24px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    font-size: 13px;
    line-height: 1.2;
    z-index: 3;
  }
  #w22515407:is(.story *) .cw-sec { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #w22515407:is(.story *) .cw-mini { flex: none; color: var(--meta); font-variant-numeric: tabular-nums; }
  /* подъезд к таблице: в строке её название на маркере вместо раздела и счётчиков */
  #w22515407:is(.story *) .cw-strip-cap .cw-sec { background: var(--mk); border-radius: 5px; padding: 2px 7px; margin-left: -2px; }
  #w22515407:is(.story *) .cw-strip-cap .cw-mini { display: none; }
  #w22515407:is(.story *) .cw-desk::before { border-radius: 14px; }
  #w22515407:is(.story *) .cw-chip { font-size: 12px; padding: 5px 10px 5px 8px; bottom: 8px; }
  #w22515407:is(.story *) .cw-fin { font-size: 12px; }
  #w22515407:is(.story *) .cw-fin b, #w22515407:is(.story *) .cw-fl { display: none; }
  #w22515407:is(.story *) .cw-fs { display: inline; font-weight: 700; }
  #w22515407:is(.story *) .cw-fin i { margin-left: 10px; }
  #w22515407:is(.story *) .cw-fin-on .cw-strip { opacity: 0; }
  #w22515407 .cw-cam { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
