/* Портфолио v4 (07.11): визуал yzalex.ru + движение Grok/iOS.
   Шрифт системный (SF на Apple), Inter как запасной. Колонка 700, медиа 992.
   Тайминги и кривые взяты из CSS grok.com: fast .12 / base .18 / slow .32 / spring .4; standard (.2,0,0,1), spring (.22,1,.36,1). */
:root {
  --ink: #000;
  --ink-rgb: 0, 0, 0;
  --light: #F0F0F0;
  --muted: rgba(0, 0, 0, .5);
  --hair: rgba(0, 0, 0, .09);  --grey: rgba(0, 0, 0, .5);  --soft: rgba(0, 0, 0, .72);  --radius: 27px;   /* для HTML-схем в кейсах */
  --line: rgba(0, 0, 0, .1);
  --col: 700px;
  --wide: 992px;
  --r-lg: 27px;  --r: 22px;  --r-md: 16px;  --r-sm: 12px;  --r-xs: 8px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  --fast: .12s;  --base: .18s;  --slow: .32s;  --spring-d: .4s;
  --standard: cubic-bezier(.2, 0, 0, 1);
  --spring: cubic-bezier(.22, 1, .36, 1);
  --decel: cubic-bezier(0, 0, 0, 1);
  --hdr: 64px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--hdr) + 16px); -webkit-tap-highlight-color: transparent; }
body { background: #fff; color: var(--ink); font: 450 17px/1.5 var(--sans); letter-spacing: -0.012em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, video { display: block; width: 100%; height: auto; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; }
code { font: inherit; }
.wrap { width: calc(100% - 40px); max-width: var(--col); margin: 0 auto; }
.muted { color: var(--muted); }
.link-op { color: var(--muted); transition: color var(--base) var(--standard); }
.link-op:hover { color: var(--ink); }

/* ── нажатие как в iOS: всё живое чуть сжимается ── */
.press { transition: transform var(--base) var(--spring), background-color var(--base) var(--standard), opacity var(--base); }
.press:active { transform: scale(.96); transition-duration: var(--fast); }
.press-soft { transition: transform var(--slow) var(--spring); }
.press-soft:active { transform: scale(.985); transition-duration: var(--fast); }
.press-row { transition: background-color var(--base) var(--standard); }
.press-row:active { background-color: rgba(var(--ink-rgb), .06); transition-duration: 0s; }

/* ── шапка: стекло + плавное размытие у края (как scroll-edge в Grok / iOS) ── */
.hdr { position: fixed; inset: 0 0 auto; z-index: 30; height: var(--hdr); }
.hdr-in { position: relative; z-index: 2; height: 100%; width: calc(100% - 40px); max-width: calc(var(--col) + 8px); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.edge { position: absolute; inset: 0 0 -28px; pointer-events: none; }
.edge i { position: absolute; inset: 0; }
.edge i:nth-child(1) { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); -webkit-mask: linear-gradient(#000 70%, transparent); mask: linear-gradient(#000 70%, transparent); }
.edge i:nth-child(2) { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); -webkit-mask: linear-gradient(#000 50%, transparent 80%); mask: linear-gradient(#000 50%, transparent 80%); }
.edge i:nth-child(3) { -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); background: linear-gradient(rgba(255,255,255,.82), rgba(255,255,255,.55) 60%, rgba(255,255,255,0)); -webkit-mask: linear-gradient(#000 40%, transparent 75%); mask: linear-gradient(#000 40%, transparent 75%); }
.me { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 16px; }
.me img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.nav-back { display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 14px 0 8px; border-radius: 999px; background: rgba(var(--ink-rgb), .05); font-weight: 500; font-size: 16px; }
.nav-back i { font-size: 22px; }
.hdr-r { display: flex; align-items: center; gap: 14px; font-size: 16px; }

/* сегмент-контрол RU / EN с бегунком */
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(var(--ink-rgb), .06); font-size: 13px; font-weight: 600; }
.seg a { position: relative; z-index: 1; width: 38px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 7px; color: var(--muted); transition: color var(--base) var(--standard); }
.seg a.on { color: var(--ink); }
.seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: 38px; border-radius: 7px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 3px 8px rgba(0,0,0,.06); transition: transform var(--spring-d) var(--spring); }
html[lang="en"] .seg-thumb { transform: translateX(38px); }
.seg.flip .seg-thumb { transform: translateX(38px); }
html[lang="en"] .seg.flip .seg-thumb { transform: none; }

/* ── кнопки ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 18px; border-radius: 22px; font-weight: 500; font-size: 17px; letter-spacing: -0.015em; white-space: nowrap; cursor: pointer; }
.btn i { font-size: 19px; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: rgba(var(--ink-rgb), .72); }
.btn-light { background: var(--light); }
.btn-light:hover { background: rgba(var(--ink-rgb), .12); }
.btn-sm { height: 38px; padding: 0 15px; font-size: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hdr .btn { height: 40px; padding: 0 15px; font-size: 16px; }

/* ── типографика ── */
.h1 { font: 800 clamp(48px, 7vw, 76px)/1 var(--display); letter-spacing: -0.045em; }
.h2 { font: 700 32px/1.12 var(--display); letter-spacing: -0.035em; margin: 96px 0 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags li { font-size: 14px; line-height: 1.3; padding: 2px 7px 3px; border-radius: var(--r-xs); border: 1px solid var(--line); color: var(--muted); font-weight: 450; }
.nums { display: flex; flex-wrap: wrap; gap: 12px 48px; }
.nums li b { display: block; font: 700 28px/1.1 var(--display); letter-spacing: -0.035em; }
.nums li s { color: rgba(var(--ink-rgb), .25); text-decoration-thickness: 2px; font-weight: 600; }
.nums li span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.35; color: var(--muted); max-width: 190px; }

/* ── главная ── */
main { padding-top: calc(var(--hdr) + 40px); }
.hero-t { font: 600 clamp(24px, 3.2vw, 31px)/1.26 var(--display); letter-spacing: -0.03em; }
.status { display: flex; align-items: center; gap: 8px; margin-top: 22px; font-size: 16px; }
.dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #34C759; flex: none; }
.dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; background: rgba(52, 199, 89, .35); animation: pulse 2.4s var(--standard) infinite; }
@keyframes pulse { 0% { transform: scale(.4); opacity: 1; } 70%, 100% { transform: scale(1.4); opacity: 0; } }
.shimmer { color: transparent; background: linear-gradient(90deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,.5) 40%, rgba(0,0,0,.95) 50%, rgba(0,0,0,.5) 60%, rgba(0,0,0,.5) 100%) 0 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; animation: shimmer 3.2s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.hero .btn-row { margin-top: 18px; }
.hero .nums { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }
@media (min-width: 721px) { .hero .nums li span { max-width: none; white-space: nowrap; } }

.card { display: block; padding: 7px; border-radius: var(--r-lg); border: 1px solid var(--line); background: #fff; transition: transform var(--slow) var(--spring), box-shadow var(--slow) var(--standard), border-color var(--base); }
.card:hover { border-color: rgba(var(--ink-rgb), .16); box-shadow: 0 10px 30px rgba(0, 0, 0, .06); }
.card-media { border-radius: var(--r); overflow: hidden; background: var(--light); aspect-ratio: 16 / 10.5; }
.card-media .shot, .row-ic .shot, .c-cover .shot { display: block; width: 100%; height: 100%; transition: transform .5s var(--spring); }
.card-media img, .card-media video, .card-media .vbox, .row-ic img, .row-ic video, .row-ic .vbox, .c-cover img, .c-cover video, .c-cover .vbox { width: 100%; height: 100% !important; object-fit: cover; aspect-ratio: auto !important; }
.card:hover .card-media .shot { transform: scale(1.02); }
.card-body { padding: 14px 12px 12px; }
.card-t { margin-top: 10px; font: 600 22px/1.2 var(--display); letter-spacing: -0.03em; }
.card-body .muted { margin-top: 6px; font-size: 16px; line-height: 1.45; }
.card-body .btn { margin-top: 18px; }
.card + .grid2 { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .card-media { aspect-ratio: 4 / 3.1; }
.grid2 .card-t { font-size: 20px; }

/* сгруппированный список как в iOS Настройках */
.group { background: #f7f7f7; border-radius: var(--r); padding: 4px; }
.group > li + li .row::before { content: ""; position: absolute; top: 0; left: 70px; right: 16px; height: 1px; background: rgba(var(--ink-rgb), .07); }
.row { position: relative; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px 10px 12px; border-radius: 18px; }
a.row:hover { background: rgba(255, 255, 255, .6); }
.row-ic { flex: none; width: 44px; height: 44px; border-radius: 11px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.row-ic-txt { display: flex; align-items: center; justify-content: center; font: 700 18px/1 var(--display); }
.row-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-tx b { font-weight: 550; font-size: 17px; line-height: 1.3; }
.row-tx span { font-size: 15px; line-height: 1.35; color: var(--muted); }
.row-r { flex: none; font-size: 15px; color: var(--muted); }
.chev { flex: none; font-size: 20px; color: rgba(var(--ink-rgb), .28); margin-left: -6px; }
.meta .row { min-height: 0; padding: 12px 16px; }
.meta .row-tx { flex-direction: column-reverse; }
.meta .row-tx b { font-weight: 450; font-size: 16px; }
.meta .row-tx span { font-size: 14px; }
.meta > li + li .row::before { left: 16px; }
.meta a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }

/* UI-шоты */
.shots-sec .h2 { margin-bottom: 24px; }
.shots { overflow: hidden; display: grid; gap: 12px; padding: 6px 0; }
.shots-track { display: flex; gap: 12px; width: max-content; will-change: transform; }
.shot-c { flex: none; width: clamp(180px, 19vw, 280px); aspect-ratio: 900 / 1257; border-radius: var(--r); overflow: hidden; background: var(--light); cursor: zoom-in; transition: transform var(--slow) var(--spring); }
.shot-c img { width: 100%; height: 100%; object-fit: cover; }
.shot-c:hover { transform: scale(1.025); }
.shot-c:active { transform: scale(.97); transition-duration: var(--fast); }
.shot-c.ghost { visibility: hidden; }
.shots-cap { display: flex; justify-content: space-between; gap: 20px; margin-top: 16px; font-size: 15px; }
.shots-cap a { white-space: nowrap; }

/* финал */
.cta { margin-top: 120px; padding: 40px 32px; border-radius: var(--r-lg); background: var(--light); text-align: center; }
.cta .h2 { margin: 0; }
.cta .muted { margin-top: 8px; }
.cta .btn-row { justify-content: center; margin-top: 22px; }
.cta .btn-light { background: #fff; }
.foot { display: flex; justify-content: space-between; gap: 16px; padding: 28px 0 34px; line-height: 20px; font-size: 14px; color: var(--muted); }

/* ── лайтбокс: шот вырастает из своего места (FLIP) ── */
.lb { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.lb.on { pointer-events: auto; cursor: zoom-out; }
.lb-bg { position: absolute; inset: 0; background: rgba(255, 255, 255, .7); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); opacity: 0; transition: opacity var(--slow) var(--standard); }
.lb.on .lb-bg { opacity: 1; }
.lb-img { position: absolute; left: 0; top: 0; width: auto; max-width: none; border-radius: var(--r); box-shadow: 0 30px 80px rgba(0, 0, 0, .2); transform-origin: 0 0; opacity: 0; will-change: transform; }

/* ── страница кейса ── */
.c-head { padding-top: 24px; }
.kicker { font-size: 15px; color: var(--muted); }
.c-head .h1 { margin-top: 6px; }
.lead { margin-top: 18px; font: 600 22px/1.3 var(--display); letter-spacing: -0.025em; }
.tldr { margin-top: 12px; font-size: 18px; line-height: 1.5; color: rgba(var(--ink-rgb), .72); }
.tldr strong { color: var(--ink); font-weight: 550; }
.c-head .tags { margin-top: 16px; }
.c-head .nums { margin-top: 32px; }
.c-cover { width: calc(100% - 40px); max-width: var(--wide); margin: 40px auto 0; aspect-ratio: 16 / 10; border-radius: var(--r-lg); overflow: hidden; background: var(--light); }
.meta { margin-top: 28px; }
.inside { position: sticky; top: calc(var(--hdr) + 4px); z-index: 20; margin-top: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); }
.inside summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; cursor: pointer; font-size: 16px; font-weight: 500; }
.inside summary::-webkit-details-marker { display: none; }
.inside summary i { font-size: 20px; color: var(--muted); transition: transform var(--spring-d) var(--spring); }
.inside[open] summary i { transform: rotate(180deg); }
.inside .toc { display: flex; flex-direction: column; padding: 0 8px 8px; }
.inside .toc a { padding: 7px 8px; border-radius: 10px; font-size: 16px; color: var(--muted); transition: background-color var(--base), color var(--base); }
.inside .toc a:hover { background: var(--light); color: var(--ink); }
.inside .toc a.on { color: var(--ink); font-weight: 550; }
.inside[open] .toc { animation: drop var(--slow) var(--spring); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

.c-text { margin-top: 8px; }
.c-text > * { width: calc(100% - 40px); max-width: var(--col); margin-left: auto; margin-right: auto; }
.c-text > .media { max-width: var(--wide); }
.c-text .h2 { font-size: 40px; margin-top: 96px; margin-bottom: 0; }
.c-text .h2 + * { margin-top: 14px; }
.c-text h3 { margin-top: 44px; font: 600 22px/1.25 var(--display); letter-spacing: -0.028em; }
.c-text h2 + h3 { margin-top: 22px; }
.c-text p, .c-text ul, .c-text ol { margin-top: 12px; }
.c-text p, .c-text li { font-size: 18px; line-height: 1.55; }
.c-text ul:not(.tasks) li, .c-text ol li { position: relative; padding-left: 22px; margin-top: 6px; }
.c-text ul:not(.tasks) li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: rgba(var(--ink-rgb), .3); }
.c-text ol { counter-reset: n; }
.c-text ol li { counter-increment: n; }
.c-text ol li::before { content: counter(n) "."; position: absolute; left: 0; color: var(--muted); }
.c-text strong, .c-text em { font-weight: 600; font-style: normal; }
.c-text p a, .c-text li a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.c-text blockquote { margin-top: 20px; padding: 18px 20px; border-radius: var(--r-md); background: var(--light); font-size: 19px; line-height: 1.45; }
.tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px !important; }
.task { display: flex; flex-direction: column; padding: 16px 16px 18px; border-radius: var(--r-md); border: 1px solid var(--line); }
.task-n { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; margin-bottom: 14px; }
.task b { font-weight: 600; font-size: 18px; line-height: 1.25; letter-spacing: -0.02em; }
.task span { margin-top: 6px; font-size: 15px; line-height: 1.45; color: var(--muted); }

.c-text .media { margin-top: 36px; margin-bottom: 8px; display: grid; gap: 12px; }
.c-text .fig .frame { background: var(--light); border-radius: var(--r-lg); overflow: hidden; padding: 40px; }
.c-text .fig .frame img, .c-text .fig .frame .vbox { border-radius: var(--r-sm); box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 12px 32px rgba(0,0,0,.07); }
.c-text .fig video { object-fit: cover; }
.c-text .fig figcaption { margin: 10px auto 0; max-width: var(--col); font-size: 15px; line-height: 1.45; color: var(--muted); }
.c-text .fig.zoom img { cursor: zoom-in; }
.c-text .fig-svg .frame { padding: 0; background: transparent; }
.c-text .fig-html { padding: 32px 36px 36px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.next { margin-top: 120px; }
.next .card-media { aspect-ratio: 16 / 7; }
.next .kicker { display: block; }
.next .card-t { margin-top: 4px; font-size: 26px; }

/* ── появление: снизу, с лёгким масштабом и размытием (как в Grok) ── */
.js .rise { opacity: 0; transform: translateY(.6em) scale(.985); filter: blur(4px); transition: opacity .5s var(--standard), transform .7s var(--spring), filter .5s var(--standard); }
.js .rise.in { opacity: 1; transform: none; filter: none; }
.js .stream .w { display: inline-block; opacity: 0; filter: blur(6px); transform: translateY(.25em); transition: opacity .5s var(--standard), filter .5s var(--standard), transform .6s var(--spring); transition-delay: calc(var(--i) * 28ms); }
.js .stream.in .w { opacity: 1; filter: none; transform: none; }
.still .rise, .still .stream .w { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .js .rise, .js .stream .w { opacity: 1; transform: none; filter: none; transition: none; }
  .dot::after, .shimmer { animation: none; }
  .shimmer { color: var(--muted); background: none; }
  html { scroll-behavior: auto; }
}

/* ── HTML-схемы в новом стиле: тонко ────────────────────── */
.dg { font-size: 15px; line-height: 1.4; }
.dg-title { font-weight: 500; font-size: 20px; letter-spacing: -0.02em; }
.dg-sub { margin-top: 6px !important; color: var(--grey); max-width: 40em; }
.dg-k, .dg-cols span, .dgp-h, .dgt-h, .dgc-leg { font-size: 13px; color: var(--grey); }
.dg-foot { margin-top: 14px !important; font-size: 13px; color: var(--grey); }
.dg-cols, .dg-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.25fr); gap: 0 20px; }
.dg-cols { margin-top: 28px; padding-bottom: 10px; border-bottom: 1px solid var(--hair); }
.dg-rows { position: relative; margin: 0 !important; }
.dg-rows::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--hair); }
.c-text .dg-rows li.dg-row { padding: 14px 0; margin: 0; border-bottom: 1px solid var(--hair); align-items: start; }
.c-text .dg-rows li.dg-row::before { content: none; }
.dg-row:last-child { border-bottom: 0 !important; }
.dg-dot { position: relative; z-index: 1; width: 7px; height: 7px; margin: 7px 0 0 1px; background: rgba(0,0,0,.2); }
.dg-stage i { display: block; font-style: normal; font-size: 12px; color: var(--grey); }
.dg-card { color: var(--soft); }
.dg-row.is-cur .dg-dot { background: var(--ink); }
.dg-row.is-alt .dg-dot { background: transparent; outline: 1px dashed rgba(0,0,0,.3); }
.dg-row.is-alt .dg-stage, .dg-row.is-alt .dg-tell { color: var(--grey); }
.dgc { display: grid; grid-template-columns: repeat(26, minmax(0, 1fr)); gap: 4px; margin-top: 24px; }
.dgc i, .dgc-leg i { display: block; aspect-ratio: 1; }
.dgc i.on, .dgc-leg i.on { background: var(--ink); }
.dgc i.off, .dgc-leg i.off { outline: 1px dashed rgba(0,0,0,.3); outline-offset: -1px; }
.dgc-leg { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 14px; }
.dgc-leg span { display: flex; align-items: center; gap: 8px; }
.dgc-leg i { width: 9px; }
.dg-if, .dg3 { display: grid; gap: 0 24px; margin-top: 28px; }
.dg-if { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dg-if > div, .dg3 > div { padding-top: 12px; border-top: 1px solid var(--hair); }
.dg-if p:not(.dg-k), .dg-p { margin-top: 6px !important; }
.dg-ui { margin-top: 10px !important; color: var(--soft); }
.dgp, .dgt { margin-top: 28px; }
.dgp-h, .dgp-r { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px; gap: 20px; align-items: center; }
.dgt-h, .dgt-r { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: baseline; }
.dgp-h, .dgt-h { padding: 8px 0; border-bottom: 1px solid var(--hair); }
.dgp-r, .dgt-r { padding: 12px 0; border-bottom: 1px solid var(--hair); }
.dgp-r i { font-style: normal; font-size: 12px; color: var(--grey); margin-right: 10px; }
.dgp-r b { display: block; height: 8px; background: rgba(0,0,0,.06); }
.dgp-r b.ai, .dgc-leg i.lg-ai { background: var(--ink); }
.dgp-r b.hu, .dgc-leg i.lg-hu { background: rgba(0,0,0,.35); }
.dgp-r b.half, .dgc-leg i.lg-half { background: linear-gradient(90deg, rgba(0,0,0,.35) 45%, rgba(0,0,0,.06) 45%); }
.dgc-leg i.lg-ai, .dgc-leg i.lg-hu, .dgc-leg i.lg-half { width: 22px; height: 8px; aspect-ratio: auto; }
.dgt-r span:first-child { color: var(--soft); }
.dgt-r .win { font-weight: 500; }
.c-text .fig-html { padding: 32px 36px 36px; background: #fff; border: 1px solid var(--hair); border-radius: var(--radius); }

/* иконки Remix Icon */
[class^="ri-"], [class*=" ri-"] { font-size: 1.05em; line-height: 1; vertical-align: -0.12em; }
.c-meta a i { font-size: .95em; margin-left: 2px; }
.lb-x { font-size: 24px; }

/* плейсхолдер, пока нет картинки */
.ph-box { display: grid; gap: 8px; place-content: center; text-align: center; min-height: 260px; padding: 24px; background: var(--plate); border-radius: var(--radius); color: var(--grey); font-size: 13px; }
.ph-tag { color: var(--ink); }
.c-text h2 + h3 { margin-top: 20px; }

/* схема флоу бронирования */
.dgf-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 16px; margin-top: 32px; }
.c-text .dgf p { margin-top: 0; }
.c-text .dgf .dg-sub { margin-top: 6px; }
.c-text .dgf-timer { grid-column: 2 / 6; grid-row: 1; margin-bottom: 22px; padding-bottom: 8px; border-bottom: 1px dashed rgba(0, 0, 0, .25); font-size: 12px; color: var(--soft); text-align: center; }
.dgf-s { grid-row: 2; font-size: 13px; line-height: 1.4; }
.c-text .dgf-h { position: relative; padding-top: 14px; border-top: 1px solid var(--hair); font-weight: 500; font-size: 14px; }
.dgf-h i { font-style: normal; color: var(--grey); margin-right: 6px; }
.dgf-sq { position: absolute; top: -4px; left: 0; width: 7px; height: 7px; background: rgba(0, 0, 0, .25); }
.is-done .dgf-sq { background: var(--ink); }
.is-entry .dgf-sq { background: #fff; outline: 1px solid rgba(0, 0, 0, .35); outline-offset: -1px; }
.dgf-g { margin-top: 14px; color: var(--soft); }
.c-text .dgf-g p + p { margin-top: 3px; }
.c-text .dgf-g .dg-k { margin-bottom: 6px; }
.dgf-g b { font-weight: 500; color: var(--ink); }
.dgf-g s { display: block; margin-top: 6px; text-decoration: none; font-size: 12px; color: var(--grey); }
.is-entry .dgf-g:first-of-type { padding: 10px 10px 12px; border: 1px dashed rgba(0, 0, 0, .25); }
@media (max-width: 900px) {
  .dgf-grid { grid-template-columns: minmax(0, 1fr); }
  .c-text .dgf-timer { grid-column: auto; text-align: left; }
  .dgf-s { grid-row: auto; margin-bottom: 22px; }
}

nw-r { white-space: nowrap; }

/* видео: постер лежит под видео, само видео проявляется, когда пошли кадры */
.vbox { display: block; position: relative; overflow: hidden; background: var(--plate) center / cover no-repeat; }
.vbox video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s ease; }
.vbox video.on { opacity: 1; }

/* ── адаптив ── */
@media (max-width: 720px) {
  :root { --hdr: 58px; }
  .hide-s { display: none; }
  .me span { display: none; }
  main { padding-top: calc(var(--hdr) + 24px); }
  .h2 { font-size: 28px; margin-top: 72px; }
  .grid2, .tasks { grid-template-columns: minmax(0, 1fr); }
  .nums { gap: 16px 28px; }
  .nums li b { font-size: 24px; }
  .shot-c { width: 170px; border-radius: var(--r-md); }
  .shots-cap { flex-direction: column; gap: 6px; }
  .cta { padding: 32px 20px; }
  .c-text .h2 { font-size: 32px; margin-top: 72px; }
  .c-text p, .c-text li { font-size: 17px; }
  .c-text .fig .frame { padding: 14px; border-radius: var(--r); }
  .c-text .fig-html { padding: 20px; }
  .c-cover, .c-text > .media { width: calc(100% - 20px); }
  .lead { font-size: 20px; }
  .dgf-grid { grid-template-columns: minmax(0, 1fr); }
  .c-text .dgf-timer { grid-column: auto; text-align: left; }
  .dgf-s { grid-row: auto; margin-bottom: 22px; }
  .dg-cols { display: none; }
  .dg-row { grid-template-columns: 20px minmax(0, 1fr); }
  .dg-tell, .dg-card { grid-column: 2; margin-top: 4px; }
  .dg-if, .dg3 { grid-template-columns: minmax(0, 1fr); }
  .dgc { gap: 2px; }
  .dgp-h, .dgp-r { grid-template-columns: minmax(0, 1fr) 44px 44px; gap: 10px; }
  .dgt-h, .dgt-r { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; font-size: 14px; }
}
.task .task-n { margin-top: 0; color: #fff; font-size: 15px; }

/* ═════ Таблетка-меню (реф James Ayres; та же, что в /lab): закрыта — название раздела, открыта — контакты.
   Размеры и радиус пишет app.js пружиной (stiffness 400, damping 30) — keep in sync с lab/lab.js ═════ */
.jm { position: fixed; top: calc(var(--hdr) + 8px); left: 50%; z-index: 40; transform: translateX(-50%);
  width: 96px; height: 48px; border-radius: 48px; overflow: hidden;
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  background: rgba(255,255,255,0); opacity: 0; pointer-events: none; transition: opacity .3s var(--standard); }
.jm.show { opacity: 1; pointer-events: auto; }
.jm.open { box-shadow: inset 0 0 0 1px rgba(255,255,255,.24), 0 9px 47px rgba(0,0,0,.02), 0 26px 132px rgba(0,0,0,.04), 0 48px 240px rgba(0,0,0,.06); }
.jm-closed { position: absolute; left: 0; top: 0; height: 48px; padding: 0 20px; border-radius: 48px; white-space: nowrap;
  background: rgba(0,0,0,.05); font-size: 16px; font-weight: 500; display: flex; align-items: center; transition: opacity .15s var(--standard); }
.jm-label { display: inline-block; transition: opacity .2s var(--standard), filter .2s var(--standard); }
.jm-label.swap { opacity: 0; filter: blur(3px); }
.jm-open { position: absolute; left: 0; top: 0; width: 360px; padding: 26px 28px 28px; opacity: 0; visibility: hidden; transition: opacity .2s var(--standard); }
.jm.open .jm-closed { opacity: 0; pointer-events: none; }
.jm.open .jm-open { opacity: 1; visibility: visible; transition: opacity .32s var(--spring) .08s; }
.jm-top { display: flex; align-items: center; justify-content: space-between; margin: -6px -4px 18px 0; font-size: 16px; font-weight: 500; }
.jm-x { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.06); font-size: 20px; transition: background .18s; }
.jm-x:hover { background: rgba(0,0,0,.1); }
.al { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.al-chip { margin: 6px 0 2px; padding: 3px 11px; border-radius: 20px; background: rgba(60,80,110,.45); color: #fff; font: 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .02em; }
.al-card { width: 100%; border-radius: 18px; background: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; color: #000; box-shadow: 0 1px 2px rgba(0,0,0,.06); transition: transform .18s var(--standard); }
.al-card:active { transform: scale(.98); }
.al-card > div { flex: 1; min-width: 0; }
.al-card time { display: block; font: 11.5px/1.3 ui-monospace, "SF Mono", Menlo, monospace; color: rgba(0,0,0,.35); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-card strong { display: block; font-weight: 500; font-size: 16px; line-height: 1.2; }
.al-card > img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; }
.al-dots { width: 48px; height: 48px; flex: none; background: radial-gradient(circle, #000 1.6px, transparent 2px) 0 0/12px 12px;
  -webkit-mask: radial-gradient(circle, transparent 9px, #000 10px, #000 20px, transparent 21px); mask: radial-gradient(circle, transparent 9px, #000 10px, #000 20px, transparent 21px); }
.card-wide + .card-wide { margin-top: 28px; }

/* ═════ Меню-таблетка внизу экрана: растёт вверх (якорь bottom), фон плотнее — лежит поверх контента ═════ */
.jm { top: auto; bottom: calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.1); }
/* подпись по центру и в свою ширину (max-content): иначе абсолютный блок упирается в старую ширину таблетки и сплющивается */
/* закрыта — постоянная ширина (пишет app.js): кольцо слева, раздел по центру-слева, плюс справа */
.jm-closed { left: 0; width: 100%; gap: 10px; padding: 0 14px 0 15px; background: rgba(255,255,255,.8); }
.jm-label { flex: 1; white-space: nowrap; text-align: left; }
.jm-plus { flex: none; width: 28px; height: 28px; margin-right: -4px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(0,0,0,.06); }
.jm-ring { width: 20px; height: 20px; flex: none; transform: rotate(-90deg); }
.jm-ring circle { fill: none; stroke-width: 2.4; stroke: rgba(0,0,0,.1); }
.jm-ring .jm-ring-p { stroke: var(--ink); stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.jm-pct { font-style: normal; margin-left: 6px; color: rgba(0,0,0,.4); font-variant-numeric: tabular-nums; }
.jm-open { padding: 22px 16px 16px; }
.jm-top { margin: -4px 0 10px; padding: 0 0 0 10px; }
.jm-nav { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 240px); overflow-y: auto; }
.jm-nav a { display: flex; gap: 12px; align-items: baseline; padding: 9px 10px; border-radius: 12px; color: rgba(0,0,0,.4); font-size: 15px; line-height: 1.3; transition: background-color .18s, color .18s; }
.jm-nav a i { font-style: normal; font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(0,0,0,.3); flex: none; width: 18px; }
.jm-nav a:hover { background: rgba(0,0,0,.04); }
.jm-nav li.past a { color: rgba(0,0,0,.72); }
.jm-nav li.cur a { color: #000; font-weight: 500; background: rgba(0,0,0,.05); }
.jm-nav li.cur a i { color: #000; }
.jm-ct { display: flex; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,.07); }
.jm-ct a { flex: 1; text-align: center; padding: 10px 0; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); font-size: 14px; font-weight: 500; }
[data-name] { scroll-margin-top: calc(var(--hdr) + 16px); }

/* ═════ Ещё проекты: плитки 2×2 с обложками ═════ */
.mp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 16px; }
.mp { display: flex; flex-direction: column; gap: 12px; color: inherit; }
.mp-m { display: block; aspect-ratio: 16 / 10.5; border-radius: var(--r); overflow: hidden; background: var(--light); isolation: isolate; }
.mp-m .shot { display: block; width: 100%; height: 100%; transition: transform .6s var(--spring); }
.mp-m img, .mp-m video, .mp-m .vbox { width: 100%; height: 100% !important; object-fit: cover; aspect-ratio: auto !important; }
.mp:hover .mp-m .shot { transform: scale(1.03); }
.mp-tx { padding: 0 2px; }
.mp-tx b { display: block; font-weight: 600; font-size: 17px; letter-spacing: -.015em; }
.mp-tx span { display: block; margin-top: 3px; font-size: 15px; color: rgba(var(--ink-rgb), .5); }
@media (max-width: 520px) { .mp-grid { grid-template-columns: 1fr; } }

/* ═════ «Связаться» в шапке: ховер или клик — снизу выпадают баблы Telegram и почты.
   Уход быстрый (exit-кривая ~300ms), приход пружиной ~780ms со стаггером ═════ */
.hc { position: relative; }
.hc-pop { position: absolute; top: 100%; right: 0; padding-top: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.hc-b { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 20px; white-space: nowrap;
  background: #fff; color: var(--ink); font-size: 15px; font-weight: 500; box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.1);
  opacity: 0; transform: translateY(-12px) scale(.9); transform-origin: top right;
  transition: opacity .3s cubic-bezier(.55,0,.55,.2), transform .3s cubic-bezier(.55,0,.55,.2), background-color .18s; }
.hc-b:first-child { border-top-right-radius: 6px; }
.hc-b:hover { background: #f4f4f4; }
.hc.open .hc-pop { pointer-events: auto; }
.hc.open .hc-b { opacity: 1; transform: none; transition: opacity .4s cubic-bezier(.22,1,.36,1), transform .78s cubic-bezier(.22,1,.36,1), background-color .18s; }
.hc.open .hc-b:nth-child(2) { transition-delay: .07s, .07s, 0s; }
@media (hover: hover) {
  .hc:hover .hc-pop { pointer-events: auto; }
  .hc:hover .hc-b { opacity: 1; transform: none; transition: opacity .4s cubic-bezier(.22,1,.36,1), transform .78s cubic-bezier(.22,1,.36,1), background-color .18s; }
  .hc:hover .hc-b:nth-child(2) { transition-delay: .07s, .07s, 0s; }
}

/* ═════ Кейс: HTML-таблицы и схемы — в ширину текста; следующий кейс — крупно, в широкую колонку ═════ */
.c-text > .media:has(> .fig-html) { max-width: var(--col); }
.c-text .media > .fig-html { padding: 28px 28px 30px; }
.next { width: min(var(--wide), calc(100vw - 40px)); margin-left: calc((100% - min(var(--wide), calc(100vw - 40px))) / 2); }
.next .card-media { aspect-ratio: 16 / 10; }
.next .card-body { padding: 22px 22px 18px; }
.next .card-t { font-size: 40px; line-height: 1.08; letter-spacing: -.035em; margin-top: 6px; }
.next .muted { max-width: 46em; margin-top: 10px; font-size: 17px; }
@media (max-width: 640px) { .next .card-t { font-size: 28px; } .next .card-body { padding: 16px 12px 12px; } }

/* ═════ Опыт — плашка светлее ═════ */
.group-lite { background: #f7f7f7; }

/* ═════ HTML-схемы: размеры текста сильнее общего .c-text p ═════ */
.c-text .dg .dg-sub { font-size: 16px; line-height: 1.45; color: var(--grey); }
.c-text .dg .dg-foot { font-size: 14px; line-height: 1.45; color: var(--grey); }
.dgt-h, .dgp-h { border-bottom-color: rgba(0,0,0,.16); }

/* подвал: строка © … почта на одной линии с центром таблетки (низ 20 + 48/2 = 44px) — keep in sync с .jm bottom */
@media (max-width: 640px) { .foot { padding-bottom: 96px; } }
.jm-x { width: 28px; height: 28px; font-size: 18px; }

/* ═════ Шапка кейса — как карточка на главной: теги, заголовок с результатом, описание ═════ */
.c-head .tags { margin-top: 0; }
.c-head .tags .tag-time { border-color: transparent; background: var(--light); }
.c-title { margin-top: 16px; font: 700 clamp(32px, 4.4vw, 46px)/1.08 var(--display); letter-spacing: -.035em; }
.c-desc { margin-top: 14px; font-size: 19px; line-height: 1.5; color: var(--muted); max-width: 40em; }

/* ═════ ЛК покупателя: живой стенд вместо обложки (стенд сам масштабирует кадр 1440×931 под окно) ═════ */
.c-stand { position: relative; width: calc(100% - 40px); max-width: var(--wide); margin: 40px auto 0; aspect-ratio: 1440 / 931; border-radius: var(--r-lg); overflow: hidden; background: #f5f7fa; box-shadow: 0 0 0 1px var(--line); }
.c-stand iframe { display: block; width: 100%; height: 100%; border: 0; pointer-events: none; }
.c-stand.live iframe { pointer-events: auto; }
/* пока стенд не «включён» кликом, колесо листает страницу; при наведении — подсказка */
.c-stand-hit { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 22px; cursor: pointer; background: transparent; }
.c-stand-hit span { padding: 10px 16px; border-radius: 20px; background: rgba(0,0,0,.78); color: #fff; font-size: 15px; font-weight: 500;
  opacity: 0; transform: translateY(8px); transition: opacity .3s cubic-bezier(.55,0,.55,.2), transform .3s cubic-bezier(.55,0,.55,.2); }
.c-stand-hit:hover span, .c-stand-hit:focus-visible span { opacity: 1; transform: none; transition: opacity .4s cubic-bezier(.22,1,.36,1), transform .78s cubic-bezier(.22,1,.36,1); }
@media (hover: none) { .c-stand-hit span { opacity: 1; transform: none; } }
.c-stand.live .c-stand-hit { display: none; }
.c-stand-cap { width: calc(100% - 40px); max-width: var(--wide); margin: 10px auto 0; font-size: 15px; color: var(--muted); }

/* ═════ Карточки по три — в ряд в колонке текста (без дыры); «Вводные» без номеров ═════ */
.c-text .tasks-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.c-text .tasks-intro .task-n { display: none; }
.c-text .tasks-intro .task b { margin-top: 0; }
@media (max-width: 760px) { .c-text .tasks-3 { grid-template-columns: 1fr; } }

/* ═════ Режим правки текста (только локалка) ═════ */
.ed-bar { position: fixed; left: 16px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ed-bar button { height: 38px; padding: 0 14px; border-radius: 19px; background: #fff; color: #000; font-size: 14px; font-weight: 500; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.1); }
.ed-bar .ed-c { background: #000; color: #fff; }
.ed-bar .ed-r { color: rgba(0,0,0,.5); }
.ed-on [contenteditable] { outline: 1px dashed rgba(0,0,0,.18); outline-offset: 3px; border-radius: 2px; cursor: text; }
.ed-on [contenteditable]:focus { outline: 2px solid #3b82f6; }
.ed-on .ed-ch { background: rgba(255, 230, 0, .25); }
.ed-on .rise { opacity: 1 !important; transform: none !important; }

/* меню на главной: без кольца, открыто — карточки контактов (прежняя версия) */
.jm-home .jm-closed { padding-left: 20px; }
.jm-home .jm-open { padding: 26px 24px 24px; }
.jm-home .jm-top { margin: -6px 0 18px; padding: 0; }

/* плашка «Роль · Команда · …» в кейсе: воздух между значением и подписью */
.meta .row-tx { gap: 6px; }
.meta .row { padding-top: 16px; padding-bottom: 16px; }
