/* 8–9 · «Бесплатная консультация» (#step) и «О клинике» (#about) — /variant/, 06.11, по блокам их сайта kosmetakazan.ru.
   Разметка — delo-src/partials/v8-step.html, v8-about.html; движение и просмотр документов — assets/js/b8.js.
   Язык — как у блоков 5–7: секции прозрачные и выше вуали (за ними она в расфокусе), всё читаемое — на молочном стекле
   (компьютер — с лёгким размытием, как плашки первого экрана; телефон — без размытия), Patefon-заголовки с синим акцентом,
   оранжевая кнопка записи, «more»-кнопки. Проявление — один раз, только opacity/transform */
.v8 { position: relative; z-index: 3; color: var(--ink); }
.s8-plate, .a8-plate { border-radius: 28px;
  background: linear-gradient(to bottom, rgba(250, 246, 239, 0.4) 0%, rgba(250, 246, 239, 0.46) 50%, rgba(250, 246, 239, 0.56) 100%);
  border: 1px solid rgba(255, 255, 255, 0.5); -webkit-backdrop-filter: blur(4px) saturate(1.05); backdrop-filter: blur(4px) saturate(1.05);
  box-shadow: 0 20px 50px -34px rgba(66, 47, 25, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.v8 .label { margin-bottom: 18px; font-size: 13px; letter-spacing: 0.14em; }
.v8 .label::before { width: 19px; height: 19px; }

/* ── 8 · «Бесплатная консультация»: одна широкая плашка (как «Тест на акне»), заголовок на всю ширину, ниже — текст и запись ── */
/* сверху — поле «Команды» (у неё отступ снизу) */
.v8-step { padding: 0 var(--pad); }
.s8-plate { max-width: 1180px; margin: 0 auto; padding: clamp(34px, 3.8vw, 58px); }
.s8-t { margin: 0; font-family: var(--head), var(--font); font-weight: 700; font-size: clamp(38px, 3.6vw, 60px); line-height: 1.04;
  letter-spacing: -0.01em; color: var(--ink); }
/* строка заголовка — в своей «щели»: при проявлении поднимается из-под края (запас снизу — под хвосты букв) */
.s8-ln { display: block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.s8-ln > span { display: block; text-wrap: balance; }
.s8-acc { color: var(--blue); }
.s8-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px clamp(32px, 4vw, 72px); margin-top: clamp(26px, 3.6vh, 42px); }
.s8-lead { max-width: 31em; font-size: clamp(17px, 1.32vw, 20px); line-height: 1.5; color: var(--ink2); text-wrap: pretty; }
.s8-lead .acc { color: var(--blue); }
.s8-act { flex: none; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.s8-act .cta { min-width: 300px; }
.s8-note { font-size: 15px; line-height: 1.35; color: var(--ink2); text-align: center; }

/* проявление (b8.js): плашка → строки заголовка из-под края → текст и запись. Без JS всё видно сразу */
.s8-js .s8-plate { transition: opacity 0.9s var(--ease), transform 1.15s var(--ease); }
.s8-js .s8-ln > span { transition: transform 1.1s var(--ease); transition-delay: calc(0.14s + var(--i, 0) * 0.11s); }
.s8-js .s8-row > * { transition: opacity 0.8s ease, transform 1.1s var(--ease); transition-delay: 0.4s; }
.s8-js .s8-row > .s8-act { transition-delay: 0.5s; }
.s8-js:not(.s8-on) .s8-plate { opacity: 0; transform: translate3d(0, 28px, 0); }
.s8-js:not(.s8-on) .s8-ln > span { transform: translate3d(0, 108%, 0); }
.s8-js:not(.s8-on) .s8-row > * { opacity: 0; transform: translate3d(0, 18px, 0); }
.s8-anim .s8-plate, .s8-anim .s8-ln > span, .s8-anim .s8-row > * { will-change: transform, opacity; }

/* ── 9 · «О клинике»: слева кто мы и «7 клиник», справа документы стопкой ── */
.v8-about { padding: clamp(96px, 14vh, 170px) 0 0; }
.a8-w { max-width: 1360px; margin: 0 auto; padding: 0 var(--pad); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(16px, 1.6vw, 24px); align-items: stretch; }
.a8-plate { padding: clamp(28px, 2.8vw, 46px); }
.a8-t { margin: 0; font-family: var(--head), var(--font); font-weight: 700; font-size: clamp(32px, 2.8vw, 48px); line-height: 1.05;
  letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.a8-t .acc { color: var(--blue); }
.a8-lead { margin-top: 16px; max-width: 33em; font-size: clamp(17px, 1.25vw, 19px); line-height: 1.5; color: var(--ink2); text-wrap: pretty; }
/* одна цифра крупно — как «10 визитов» в «Плане лечения»: «7» синим, рядом три строки */
.a8-net { margin-top: clamp(28px, 4vh, 44px); }
.a8-n { display: flex; align-items: center; gap: 0.16em; margin: 0; font-family: var(--head), var(--font); font-weight: 700; color: var(--ink); }
.a8-seven { flex: none; font-size: var(--seven, clamp(124px, 10.4vw, 168px)); line-height: 0.74; letter-spacing: -0.04em; color: var(--blue); padding-right: 0.04em; }
.a8-nt { display: flex; flex-direction: column; font-size: var(--nt, clamp(26px, 2.3vw, 36px)); line-height: 1.02; letter-spacing: -0.01em; }
.a8-nt > span { display: block; white-space: nowrap; }
.a8-kzn { margin-top: 18px; font-size: clamp(16px, 1.2vw, 18px); line-height: 1.45; color: var(--ink2); }
.a8-act { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: clamp(26px, 3.8vh, 38px); }
.a8-act .more { margin-top: 0; }

/* документы: два листа внахлёст, чуть повёрнуты (--r), в белой рамке, как снимки «Результатов»; --h — высота листа */
.a8-docs { display: flex; flex-direction: column; }
.a8-stack { --h: clamp(300px, 40vh, 400px); --wf: calc(var(--h) * 0.818); --wb: calc(var(--h) * 0.696); --ov: calc(var(--wb) * 0.45);
  --x0: calc(50% - (var(--wf) + var(--wb) - var(--ov)) / 2);
  position: relative; flex: 1 0 auto; min-height: calc(var(--h) + 34px); }
.a8-sheet { position: absolute; top: calc(50% - var(--h) / 2); height: var(--h); padding: 0; overflow: hidden; border: 5px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px; background: #f4f2ee; box-shadow: 0 24px 46px -30px rgba(22, 41, 74, 0.5), 0 2px 6px -2px rgba(22, 41, 74, 0.12);
  transform: rotate(var(--r)); cursor: zoom-in; -webkit-tap-highlight-color: transparent;
  transition: transform 0.6s var(--ease), opacity 0.6s ease; }
.a8-sheet img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s ease; user-select: none; -webkit-user-drag: none; }
.a8-sheet img.ok { opacity: 1; }
.a8-sheet-f { --r: -2.5deg; z-index: 2; left: var(--x0); width: var(--wf); }
.a8-sheet-b { --r: 4deg; z-index: 1; left: calc(var(--x0) + var(--wf) - var(--ov)); width: var(--wb); top: calc(50% - var(--h) / 2 + 8px); }
/* значок «открыть крупно» — как у снимков «Результатов» на телефоне */
.a8-sheet-f::after, .a8-open::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7'/%3E%3C/svg%3E"); }
.a8-sheet-f::after { content: ''; position: absolute; right: 10px; bottom: 10px; width: 38px; height: 38px; border-radius: 50%;
  background-color: var(--blue); background-position: center; background-size: 16px; background-repeat: no-repeat; box-shadow: 0 10px 22px -10px rgba(39, 93, 167, 0.9); }
.a8-sheet.a8-away { visibility: hidden; }
@media (hover: hover) and (pointer: fine) {
  .a8-sheet:hover { transform: translate3d(0, -8px, 0) rotate(calc(var(--r) * 0.4)); }
}
.a8-sheet:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 14px; }
/* (09.11 ночь: данные лицензии — в левой плашке, под описанием, за тонкой линией; кнопки — одним рядом ниже) */
.a8-lic { margin-top: clamp(20px, 2.8vh, 30px); padding-top: clamp(18px, 2.4vh, 26px); border-top: 1px solid rgba(22, 41, 74, 0.12); }
.a8-main .a8-act { margin-top: clamp(22px, 3vh, 30px); }
.a8-k { font: 600 13px/1.3 var(--font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.a8-num { margin-top: 10px; font-family: var(--head), var(--font); font-weight: 700; font-size: clamp(24px, 2.1vw, 32px); line-height: 1.1;
  color: var(--ink); white-space: nowrap; }
.a8-det { margin-top: 8px; max-width: 30em; font-size: 16px; line-height: 1.45; color: var(--ink2); text-wrap: pretty; }
.a8-open { margin-top: 0; }
.a8-open::after { background-size: 15px; }
.a8-open:hover::after { transform: scale(1.08); }

/* проявление (b8.js): плашка «кто мы» поднимается, когда въехала (a8-on); плашка документов — когда въехала она (a8-on2,
   на телефоне она ниже), и листы ложатся стопкой (подъём и поворот). Без JS всё видно сразу */
.a8-js .a8-plate { transition: opacity 0.9s var(--ease), transform 1.15s var(--ease); }
.a8-js .a8-docs { transition-delay: 0.12s; }
.a8-js:not(.a8-on) .a8-main, .a8-js:not(.a8-on2) .a8-docs { opacity: 0; transform: translate3d(0, 28px, 0); }
.a8-js .a8-sheet { transition: transform 1.2s var(--ease), opacity 0.8s ease; }
.a8-js .a8-sheet-b { transition-delay: 0.3s; }
.a8-js .a8-sheet-f { transition-delay: 0.42s; }
.a8-js.a8-done .a8-sheet { transition: transform 0.6s var(--ease), opacity 0.6s ease; transition-delay: 0s; }
.a8-js:not(.a8-on2) .a8-sheet { opacity: 0; transform: translate3d(0, 34px, 0) rotate(0deg); }
.a8-anim .a8-main, .a8-anim2 .a8-docs, .a8-anim2 .a8-sheet { will-change: transform, opacity; }

/* ── документ крупно (b8.js): поверх страницы, вырастает из своего листа; нажатие — увеличить и вести; страница не листается ── */
.v8-doc { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: calc(72px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); touch-action: none; overscroll-behavior: contain; }
.v8-doc[hidden] { display: none; }
.v8-doc-bg { position: absolute; inset: 0; background: rgba(243, 235, 226, 0.975); opacity: 0; transition: opacity 0.45s ease; }
.v8-doc.on .v8-doc-bg { opacity: 1; }
/* лист — по высоте экрана за вычетом крестика, подписи и строки под ней (--vb); --ar — пропорции документа (b8.js) */
.v8-doc-fr { --ar: 0.818; --vb: 230px; position: relative; flex: none; aspect-ratio: var(--ar); overflow: hidden;
  width: min(100%, 760px, calc((100svh - var(--vb) - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * var(--ar)));
  border: 6px solid rgba(255, 255, 255, 0.94); border-radius: 18px; background: #fff; box-shadow: 0 44px 80px -40px rgba(22, 41, 74, 0.55);
  cursor: zoom-in; touch-action: none; }
.v8-doc-fr.v8-zoomed { cursor: grab; }
.v8-doc-fr.v8-drag { cursor: grabbing; }
.v8-doc-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; transform-origin: 0 0;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.v8-doc-img.v8-tr { transition: transform 0.45s var(--ease); }
.v8-doc-cap { position: relative; max-width: 36em; text-align: center; }
.v8-doc-t { font-family: var(--head), var(--font); font-weight: 700; font-size: 19px; line-height: 1.2; color: var(--ink); text-wrap: balance; }
.v8-doc-m { margin-top: 4px; font-size: 15px; line-height: 1.4; color: var(--ink2); }
.v8-doc-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px; }
.v8-doc-hint { font-size: 15px; line-height: 1.35; color: var(--ink2); text-align: center; }
.v8-doc-sw { margin-top: 0; }
.v8-doc-x { position: absolute; z-index: 2; top: calc(12px + env(safe-area-inset-top)); right: 14px; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.94); box-shadow: 0 10px 24px -12px rgba(22, 41, 74, 0.5); transition: opacity 0.3s ease, transform 0.4s var(--ease); }
.v8-doc-x::before, .v8-doc-x::after { content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 2px; margin: -1px 0 0 -9px; border-radius: 2px; background: var(--ink); }
.v8-doc-x::before { transform: rotate(45deg); } .v8-doc-x::after { transform: rotate(-45deg); }
@media (hover: hover) { .v8-doc-x:hover { transform: rotate(90deg); } }
.v8-doc-cap, .v8-doc-bar, .v8-doc-x { opacity: 0; transition: opacity 0.35s ease, transform 0.4s var(--ease); }
.v8-doc.on .v8-doc-cap, .v8-doc.on .v8-doc-bar, .v8-doc.on .v8-doc-x { opacity: 1; transition-delay: 0.18s; }
.v8-doc-fr.v8-swap { opacity: 0; transition: opacity 0.18s ease; }
.v8-doc-fr.v8-swap-in { transition: opacity 0.3s ease; }

/* компьютер: плашки одной высоты — свободное место у «кто мы» делится поровну над и под «7 клиник», запись — внизу, в одну
   линию с «Посмотреть лицензию» */
@media (min-width: 761px) {
  /* (06.11 вечер: «7 клиник» убраны — без них середина плашки пустела; содержимое — по центру плашки по высоте) */
  .a8-main { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
  .a8-net { margin-top: auto; margin-bottom: auto; padding: clamp(28px, 4vh, 44px) 0 clamp(26px, 3.8vh, 38px); }
  .a8-act { margin-top: clamp(26px, 3.8vh, 38px); }
}
/* невысокий экран ноутбука */
@media (min-width: 761px) and (max-height: 760px) {
  .v8-about { padding-top: clamp(80px, 12vh, 120px); }
  .a8-stack { --h: clamp(280px, 44vh, 340px); }
  .a8-seven { --seven: clamp(108px, 9vw, 140px); }
  .a8-nt { --nt: clamp(24px, 2vw, 30px); }
}
@media (min-width: 761px) {
  .v8-doc-x { top: 22px; right: 26px; width: 54px; height: 54px; }
}

/* ── телефон: колонка с полями 14 px, как у блоков 5–7; стекло без размытия. Молочный цвет — ровный (0,66 — середина
   0,6→0,72 у плашек 4–7): у высоких плашек с градиентом headless-Chrome на снимках рисовал полосы (плашка непрозрачная, кроме
   одной полосы) ── */
@media (max-width: 760px) {
  .s8-plate, .a8-plate { padding: 22px 20px 20px; border-radius: 26px; -webkit-backdrop-filter: none; backdrop-filter: none;
    background: rgba(250, 246, 239, 0.66);
    border-color: rgba(255, 255, 255, 0.6); box-shadow: 0 20px 50px -34px rgba(66, 47, 25, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
  .v8 .label { margin-bottom: 12px; font-size: clamp(12.5px, 3.5vw, 14px); letter-spacing: 0.11em; gap: 10px; white-space: nowrap; }
  .v8 .label::before { width: 20px; height: 20px; }

  .v8-step { padding: 24px 14px 0; }
  /* «первый шаг на пути» — в одну строку и на 375 px (иначе «первый» оставался один) */
  .s8-t { font-size: clamp(28px, 7.7vw, 34px); line-height: 1.08; }
  .s8-row { display: block; margin-top: 14px; }
  .s8-lead { font-size: 17px; line-height: 1.45; }
  .s8-act { align-items: stretch; gap: 10px; margin-top: 22px; }
  .s8-act .cta { width: 100%; min-width: 0; height: 56px; padding: 0 16px; font-size: 16.5px; }

  .v8-about { padding: 64px 0 0; }
  .a8-w { display: block; padding: 0 14px; }
  .a8-docs { margin-top: 12px; }
  .a8-t { font-size: clamp(27px, 7.6vw, 32px); line-height: 1.08; }
  .a8-lead { margin-top: 10px; font-size: 16px; line-height: 1.45; }
  .a8-net { margin-top: 24px; }
  .a8-seven { --seven: clamp(100px, 29vw, 120px); }
  .a8-nt { --nt: clamp(24px, 6.9vw, 28px); }
  .a8-kzn { margin-top: 14px; font-size: 16px; }
  .a8-act { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 22px; }
  .a8-act .cta { width: 100%; height: 54px; padding: 0 16px; font-size: 16px; }
  .a8-act .more { align-self: center; }
  /* стопка — на всю ширину плашки (за поля): лист крупнее */
  .a8-stack { --h: calc((100vw - 28px - 14px) / 1.2); margin: 0 -20px; min-height: calc(var(--h) + 30px); }
  .a8-sheet { border-width: 4px; border-radius: 12px; }
  .a8-sheet-f::after { right: 8px; bottom: 8px; width: 34px; height: 34px; background-size: 15px; }
  .a8-lic { margin-top: 14px; }
  .a8-k { font-size: 12.5px; letter-spacing: 0.1em; }
  .a8-num { margin-top: 8px; font-size: clamp(21px, 5.9vw, 24px); }
  .a8-det { font-size: 15px; }
  .a8-open { margin-top: 0; }

  .v8-doc { gap: 12px; }
  .v8-doc-fr { --vb: 296px; }
  .v8-doc-t { font-size: 17px; }
}
