/* KatanaCode — страницы кейсов /en/cases/*: дашборды, витрины приложений, промпты нейросетей */
.cs { --surface: #15151c; --s1: #ff2434; --s2: #3987e5; --s3: #199e70; --s4: #c98500; --good: #2fbf71; }

/* ---------- Шапка ---------- */
.cs .header { background: rgba(13, 13, 17, .72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.cs-nav { display: flex; gap: 6px; margin-left: auto; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.cs-nav a { padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); transition: color .2s, background .2s; }
.cs-nav a:hover { color: var(--text); }
.cs-nav a[aria-current] { background: var(--red); color: #fff; }
.cs-back { font-size: 14px; color: var(--muted); }
.cs-back:hover { color: var(--text); }

/* ---------- Первый экран: удар катаны открывает заголовок ---------- */
.cs main { position: relative; z-index: 2; }
.js .cs-hero h1 .w { display: inline-block; clip-path: inset(-10% -5% 100% -5%); transform: translateY(40%) skewY(6deg); animation: cs-word .9s var(--ease) forwards; animation-delay: calc(.35s + var(--i) * .07s); }
@keyframes cs-word { to { clip-path: inset(-10% -5% -20% -5%); transform: none; } }
.cs-cut { position: absolute; left: -10%; top: 44%; width: 120%; height: 3px; z-index: 4; pointer-events: none;
  background: linear-gradient(90deg, transparent, #fff 40%, var(--red) 60%, transparent); box-shadow: 0 0 24px 6px var(--red-glow);
  transform: rotate(-8deg) scaleX(0); transform-origin: 0 50%; animation: cs-cut .9s .15s var(--ease-io) forwards; }
@keyframes cs-cut { 0% { transform: rotate(-8deg) scaleX(0); opacity: 1; } 55% { transform: rotate(-8deg) scaleX(1); opacity: 1; } 100% { transform: rotate(-8deg) scaleX(1) translateX(20%); opacity: 0; } }
.js .cs-hero .badge, .js .cs-hero .section-lead { opacity: 0; animation: cs-rise .9s var(--ease) forwards; }
.js .cs-hero .badge { animation-delay: .2s; }
.js .cs-hero .section-lead { animation-delay: .8s; }
@keyframes cs-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.js .cs-hero-ninja { animation: cs-ninja-in 1.1s .3s var(--ease) both; }
@keyframes cs-ninja-in { from { opacity: 0; transform: translateY(60px) scale(.9); } to { opacity: 1; transform: none; } }
.cs-orb { position: absolute; left: 50%; top: 55%; width: 34px; height: 34px; margin: -17px 0 0 -17px; color: var(--sand); filter: drop-shadow(0 0 8px rgba(255, 36, 52, .5)); }
.cs-fly { position: absolute; width: 30px; height: 30px; color: var(--red); opacity: .7; animation: cs-spin 9s linear infinite; pointer-events: none; }
@keyframes cs-spin { to { rotate: 360deg; } }

/* Подсветка карточки под курсором */
.case, .app-store, .chat, .lever, .proof a, .cs-kpi { transition: transform .5s var(--ease), border-color .3s; transform-style: preserve-3d; position: relative; }
.case::after, .lever::after, .proof a::after, .cs-kpi::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 36, 52, .12), transparent 60%); }
.case:hover::after, .lever:hover::after, .proof a:hover::after, .cs-kpi:hover::after { opacity: 1; }
.case:hover { border-color: rgba(255, 36, 52, .35); }

.cs-hero { padding: calc(var(--header-h) + 70px) 0 40px; overflow: hidden; }
.cs-hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .5fr); gap: 40px; align-items: center; }
.cs-hero h1 { font-size: clamp(36px, 5.6vw, 76px); font-weight: 900; letter-spacing: -.035em; line-height: 1; }
.cs-hero h1 .accent { color: var(--red); }
.cs-hero .section-lead { max-width: 680px; font-size: 19px; }
.cs-hero-ninja { position: relative; aspect-ratio: 1; }
.cs-hero-ninja::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #ff4a57, #c3101e 70%); box-shadow: 0 0 120px rgba(255, 36, 52, .35);
  -webkit-mask: linear-gradient(#000 0 58%, transparent 58% 61%, #000 61% 68%, transparent 68% 72%, #000 72% 79%, transparent 79% 84%, #000 84%);
          mask: linear-gradient(#000 0 58%, transparent 58% 61%, #000 61% 68%, transparent 68% 72%, #000 72% 79%, transparent 79% 84%, #000 84%); }
.cs-hero-ninja > svg:first-child { position: absolute; left: 10%; bottom: -2%; width: 80%; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .6)); animation: cs-float 5s ease-in-out infinite; }
.cs-kanji { position: absolute; right: -2vw; top: 40px; font: 900 min(42vw, 560px)/1 serif; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .05); pointer-events: none; user-select: none; }
@keyframes cs-float { 50% { transform: translateY(-10px); } }

.cs-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 48px; }
.cs-kpi { padding: 22px 24px; border-radius: 20px; background: linear-gradient(180deg, var(--card-hi), var(--card)); border: 1px solid var(--line); }
.cs-kpi b { display: block; font: 700 clamp(28px, 3.2vw, 42px)/1 var(--display); letter-spacing: -.03em; }
.cs-kpi span { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); line-height: 1.4; }

/* ---------- Кейс: витрина сайта + панель Search Console ---------- */
.cs-section { padding: 50px 0; }
.cs-section > .container > .section-head { margin-bottom: 36px; }
.case { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "info info" "site gsc"; gap: 22px 24px; padding: 28px; margin-bottom: 26px; border-radius: 28px;
  background: radial-gradient(700px 400px at 0% 0%, rgba(255, 36, 52, .08), transparent 60%), var(--card); border: 1px solid var(--line); }
.case:nth-of-type(even) { grid-template-areas: "info info" "gsc site"; }
.case-site { grid-area: site; min-width: 0; display: flex; }
.case-site .browser { flex: 1; display: flex; flex-direction: column; }
.case-site .browser img, .case-site .browser-nda { flex: 1; min-height: 0; height: 100%; }
.case-info { grid-area: info; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 8px 40px; align-items: end; }
.case-info .case-tags { grid-column: 1 / -1; margin-bottom: 0; }
.case-info .case-wins { margin: 0; }
.case-info .case-link { margin-top: 10px; }
.browser { display: block; border-radius: 16px; overflow: hidden; background: #0b0b10; border: 1px solid var(--line-hi); transition: transform .6s var(--ease), border-color .3s; }
.browser:hover { transform: translateY(-4px) rotate(-.4deg); border-color: rgba(255, 36, 52, .6); }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #17171f; font-size: 12px; color: var(--dim); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #3a3a46; }
.browser-bar i:first-child { background: var(--red); }
.browser-bar span { margin-left: 10px; padding: 3px 12px; border-radius: 999px; background: rgba(255, 255, 255, .05); }
.browser img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.browser-nda { aspect-ratio: 16 / 10; display: grid; place-items: center; text-align: center; padding: 30px;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .03) 0 14px, transparent 14px 28px), #101016; }
.browser-nda b { display: block; font: 900 64px/1 serif; color: transparent; -webkit-text-stroke: 1.5px var(--red); }
.browser-nda span { display: block; margin-top: 12px; color: var(--muted); font-size: 14px; }
.case-info h3 { font-size: clamp(24px, 2.6vw, 34px); }
.case-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.case-tags span { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-hi); color: var(--muted); }
.case-tags span:first-child { border-color: rgba(255, 36, 52, .5); color: #ff6a75; }
.case-info p { margin-top: 10px; color: var(--muted); font-size: 15px; }
.case-wins { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; font-size: 15px; }
.case-wins li { display: flex; gap: 10px; }
.case-wins li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; background: var(--red); transform: rotate(45deg); }
.case-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: 600; color: var(--red); }
.case-link:hover { text-decoration: underline; }

/* Панель в стиле Search Console */
.gsc { grid-area: gsc; min-width: 0; display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-hi); overflow: hidden; }
.gsc-bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.gsc-bar b { color: var(--text); font-weight: 600; }
.gsc-bar .chip { margin-left: auto; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-hi); font-size: 12px; white-space: nowrap; }
.gsc-metrics { display: grid; grid-template-columns: repeat(4, 1fr); }
.gsc-m { min-width: 0; padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.gsc-m:last-child { border-right: 0; }
.gsc-m small { display: block; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsc-m b { display: block; margin-top: 4px; font: 700 clamp(18px, 1.8vw, 24px)/1.15 var(--display); white-space: nowrap; letter-spacing: -.02em; }
.gsc-m em { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--muted); }
.gsc-m.on { background: linear-gradient(180deg, rgba(255, 36, 52, .14), transparent); box-shadow: inset 0 3px 0 var(--red); }
.gsc-m .up { color: var(--good); font-weight: 600; }
.gsc-chart { position: relative; flex: 1; padding: 14px 14px 4px; display: flex; align-items: flex-end; }
.gsc-chart svg { width: 100%; }
.gsc-legend { display: flex; gap: 16px; padding: 0 18px 14px; font-size: 12px; color: var(--muted); }
.gsc-legend i { display: inline-block; width: 14px; height: 0; margin-right: 6px; vertical-align: 3px; border-top: 2.5px solid var(--s1); }
.gsc-legend i.proj { border-top-style: dashed; }

/* Графики */
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .ax { font: 500 11px var(--font); fill: rgba(245, 243, 240, .42); }
.chart .val { font: 600 12px var(--font); fill: var(--text); }
.chart-tip { position: absolute; z-index: 3; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: #0b0b10; border: 1px solid var(--line-hi);
  font-size: 13px; white-space: nowrap; transform: translate(-50%, calc(-100% - 14px)); opacity: 0; transition: opacity .15s; }
.chart-tip b { display: block; font-family: var(--display); font-size: 16px; }
.chart-tip.is-on { opacity: 1; }
.js .chart .line { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.js .chart.is-in .line { animation: cs-draw 1.6s var(--ease) forwards; }
.js .chart .area { opacity: 0; }
.js .chart.is-in .area { animation: cs-fade 1s .6s forwards; }
@keyframes cs-draw { to { stroke-dashoffset: 0; } }
@keyframes cs-fade { to { opacity: 1; } }

/* ---------- GEO: окна чата ---------- */
.chats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.chat { display: flex; flex-direction: column; border-radius: 22px; background: #212121; border: 1px solid rgba(255, 255, 255, .1); overflow: hidden; font-family: -apple-system, "Segoe UI", var(--font); }
.chat-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; color: #ececec; font-size: 14px; }
.chat-top b { font-weight: 600; font-size: 16px; }
.chat-top i { font-style: normal; font-size: 11px; padding: 3px 9px; border: 1px solid #424242; border-radius: 999px; color: #b4b4b4; }
.chat-body { flex: 1; padding: 4px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.chat-q { align-self: flex-end; max-width: 88%; padding: 10px 16px; border-radius: 20px; background: #303030; color: #ececec; font-size: 15px; line-height: 1.45; }
.chat-src { font-size: 12px; color: #8f8f8f; }
.chat-a { color: #e3e3e3; font-size: 14px; line-height: 1.6; }
.chat-a ol { margin: 8px 0; padding-left: 20px; display: grid; gap: 6px; }
.chat-a b { color: #fff; }
.chat-a mark { padding: 1px 6px; border-radius: 6px; background: rgba(255, 36, 52, .18); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 36, 52, .55); }
.chat-a .cite { display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 999px; background: #303030; color: #b4b4b4; font-size: 11px; }
.js .chat .chat-a { opacity: 0; transform: translateY(10px); transition: opacity .6s .5s, transform .6s .5s var(--ease); }
.js .chat.is-in .chat-a { opacity: 1; transform: none; }
.note { margin-top: 14px; font-size: 13px; color: var(--dim); }

.levers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.lever { padding: 24px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.lever .k { font: 900 40px/1 serif; color: transparent; -webkit-text-stroke: 1.2px var(--red); }
.lever h3 { margin: 14px 0 8px; font-size: 19px; }
.lever p { font-size: 15px; color: var(--muted); }

.proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.proof a { display: block; padding: 22px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); transition: border-color .3s, transform .5s var(--ease); }
.proof a:hover { border-color: rgba(255, 36, 52, .6); transform: translateY(-4px); }
.proof small { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--red); font-weight: 600; }
.proof b { display: block; margin: 8px 0 6px; font: 700 30px/1.05 var(--display); letter-spacing: -.02em; }
.proof span { font-size: 14px; color: var(--muted); }

/* ---------- Образец отчёта ---------- */
.dash { border-radius: 26px; background: #101016; border: 1px solid var(--line-hi); overflow: hidden; }
.dash-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.dash-bar .tabs { display: flex; gap: 4px; }
.dash-bar .tabs span { padding: 5px 12px; border-radius: 9px; color: var(--muted); }
.dash-bar .tabs span.on { background: rgba(255, 255, 255, .07); color: var(--text); }
.sample { margin-left: auto; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(201, 133, 0, .16); color: #e0a100; }
.dash-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 18px; }
.panel { padding: 20px 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.panel h4 { margin: 0 0 14px; font: 600 15px var(--font); display: flex; justify-content: space-between; gap: 10px; }
.panel h4 span { font-weight: 400; font-size: 12px; color: var(--dim); }
.panel.wide { grid-column: 1 / -1; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding: 0 8px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; }
.pos { display: inline-block; min-width: 30px; text-align: center; padding: 1px 7px; border-radius: 7px; font-weight: 700; background: rgba(255, 255, 255, .06); }
.pos.top { background: rgba(255, 36, 52, .16); color: #ff6a75; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 54px; align-items: center; gap: 12px; font-size: 13px; }
.bar-row .track { height: 12px; border-radius: 0 4px 4px 0; background: rgba(255, 255, 255, .05); overflow: hidden; }
.bar-row .fill { height: 100%; width: var(--w); border-radius: 0 4px 4px 0; background: var(--c, var(--s1)); }
.js .bar-row .fill { transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease); }
.js .is-in .bar-row .fill { transform: none; }
.bar-row b { text-align: right; }

/* ---------- ASO: витрина стора ---------- */
.apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.app-store { border-radius: 26px; padding: 24px; background: #f5f5f7; color: #111; overflow: hidden; }
.app-store.dark { background: #1c1c1e; color: #f5f5f7; }
.store-top { display: flex; gap: 16px; align-items: center; }
.store-top img { width: 84px; height: 84px; border-radius: 20px; flex: none; }
.store-top h3 { font: 700 22px/1.15 -apple-system, var(--font); letter-spacing: 0; }
.store-top p { font-size: 14px; opacity: .6; }
.store-get { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.store-get a { padding: 5px 16px; border-radius: 999px; background: #0a84ff; color: #fff; font-size: 14px; font-weight: 700; }
.store-shots { display: flex; gap: 10px; margin-top: 20px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.store-shots img { height: 320px; width: auto; max-width: none; flex: none; border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.store-done { list-style: none; padding: 18px 0 0; margin: 18px 0 0; border-top: 1px solid rgba(128, 128, 128, .25); display: grid; gap: 8px; font-size: 14px; }
.store-done li::before { content: "✓ "; color: var(--red); font-weight: 700; }

.app-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.app-console .gsc-chart { min-height: 0; }
.app-kw { border-top: 1px solid var(--line); }
.app-kw th { padding-top: 12px; }
.app-kw th:first-child, .app-kw td:first-child { padding-left: 18px; }
.app-kw th:last-child, .app-kw td:last-child { padding-right: 18px; }
.note.illus { margin-top: -4px; font-style: italic; }

/* ---------- Призыв ---------- */
.cs-cta { margin: 40px 0 90px; padding: clamp(30px, 5vw, 60px); border-radius: 30px; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center;
  background: radial-gradient(600px 300px at 100% 0%, rgba(255, 36, 52, .3), transparent 70%), var(--card); border: 1px solid rgba(255, 36, 52, .4); }
.cs-cta h2 { font-size: clamp(28px, 3.6vw, 48px); }
.cs-cta p { margin-top: 12px; color: var(--muted); }
.cs-more { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.js .cs-up { opacity: 0; transform: translateY(30px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .cs-up.is-in { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .cs-nav { margin-left: 0; }
  .header .cs-nav + .btn-sm { margin-left: auto; }
  .chats, .levers { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .chats .chat:last-child { display: none; }
}
@media (max-width: 860px) {
  .cs-hero-grid { grid-template-columns: 1fr; }
  .cs-hero-ninja { display: none; }
  .cs-kpis { grid-template-columns: 1fr 1fr; }
  .case, .case:nth-of-type(even) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "site" "info" "gsc"; padding: 16px; }
  .case-info { grid-template-columns: minmax(0, 1fr); }
  .gsc-m b { font-size: 18px; }
  .gsc-metrics { grid-template-columns: 1fr 1fr; }
  .gsc-m:nth-child(2) { border-right: 0; }
  .dash-body, .apps, .proof { grid-template-columns: minmax(0, 1fr); }
  .cs-cta { grid-template-columns: 1fr; }
  .cs-back { display: none; }
}
@media (max-width: 600px) {
  .cs .header .btn-sm { display: none; }
  .cs-nav { margin-left: auto; }
  .cs-nav a { padding: 7px 11px; font-size: 13px; }
  .chats, .levers { grid-template-columns: minmax(0, 1fr); }
  .chats .chat:last-child { display: flex; }
  .bar-row { grid-template-columns: 84px 1fr 44px; }
  .store-shots img { height: 260px; }
  .cs-nav .sm-hide, .gsc-bar .sm-hide { display: none; }
  .header-inner { gap: 12px; }
  .cs-kpi b { font-size: 24px; }
  .gsc-bar .chip { font-size: 11px; padding: 3px 8px; }
  .tbl .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-hero-ninja svg, .js .cs-hero h1 .w, .cs-cut, .js .cs-hero .badge, .js .cs-hero .section-lead, .js .cs-hero-ninja, .cs-fly { animation: none; clip-path: none; transform: none; opacity: 1; }
  .cs-cut { display: none; }
  .js .chart .line, .js .chart .area, .js .cs-up, .js .chat .chat-a, .js .bar-row .fill { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; transition: none; }
}
