/* case-cards.css — ТАП reworked case cards (Направление 1)
   Card styles for CaseCardA / CaseCardB. Pairs with case-cards.jsx.
   Relies on ТАП design-system tokens (colors / type / spacing / radii /
   shadows / motion). No --ease override: uses the DS --ease. */

.cc, .cc * { box-sizing: border-box; }

/* ============ shared ============ */
.cc { text-decoration: none; color: inherit; display: block; }
.cc__client {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-500);
}
.cc-pill {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-600);
  background: var(--ink-50); border: 1px solid var(--ink-100);
  border-radius: var(--r-full); padding: 4px 10px; white-space: nowrap;
}
.cc__read {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .04em; color: var(--blue-600); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px; margin-top: auto;
}
.cc__read-arr { transition: transform .18s var(--ease); }

/* ============ Variant A ============ */
.cc--a {
  background: #fff; border: 1px solid var(--ink-100); border-radius: var(--r-md);
  padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-4);
  box-shadow: var(--sh-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
  cursor: pointer;
}
.cc--a:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--blue-300); }
.cc--a:hover .cc__read-arr { transform: translateX(3px); }
.cc__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.cc__hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cc__hero-num { display: flex; align-items: baseline; gap: 6px; }
.cc__big {
  font-family: var(--font-sans); font-weight: 700; font-size: 46px;
  letter-spacing: -0.035em; line-height: .95; color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
.cc__unit { font-family: var(--font-mono); font-size: 14px; color: var(--ink-500); }
.cc__hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-bottom: 4px; }
.cc__delta {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: var(--blue-700); background: var(--blue-50);
  border: 1px solid var(--blue-100); border-radius: var(--r-xs);
  padding: 3px 8px; white-space: nowrap;
}
.cc__was { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); }
.cc__label { font-size: 13px; color: var(--ink-500); margin-top: -6px; }

/* bars */
.cc-bars { display: flex; flex-direction: column; gap: 10px; }
.cc-bar { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 10px; }
.cc-bar__k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; color: var(--ink-400); text-transform: uppercase; }
.cc-bar__track { height: 8px; background: var(--ink-50); border-radius: var(--r-full); overflow: hidden; }
.cc-bar__fill { display: block; height: 100%; border-radius: var(--r-full); width: 0; transition: width 1.1s var(--ease); }
.cc-bar__fill--before { background: var(--ink-200); }
.cc-bar__fill--after { background: var(--blue-600); }
.cc-bar__v { font-family: var(--font-mono); font-size: 12px; font-weight: 600; white-space: nowrap; }
.cc-bar__v em { font-style: normal; font-weight: 400; color: var(--ink-400); margin-left: 1px; }
.cc-bar__v--mute { color: var(--ink-400); }
.cc-bar__v--hi { color: var(--ink-900); }

/* expand */
.cc__expand {
  appearance: none; background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 0;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-500); width: fit-content; white-space: nowrap;
}
.cc__expand:hover { color: var(--blue-600); }
.cc__chev { transition: transform .2s var(--ease); }
.cc--a.is-open .cc__chev { transform: rotate(180deg); }

.cc__panel { overflow: hidden; max-height: 0; }
.cc--a.is-open .cc__panel { max-height: 460px; }
.cc__panel-in { min-height: 0; }
.cc--a.is-open .cc__panel-in {
  padding-top: 14px; border-top: 1px solid var(--ink-100); margin-top: 4px;
}
.cc__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.cc-chip {
  font-size: 12px; color: var(--ink-700); background: var(--paper-50);
  border: 1px solid var(--ink-100); border-radius: var(--r-xs); padding: 5px 10px;
}
.cc__tl-title {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-400); margin-bottom: 10px;
}
.cc-tl { list-style: none; margin: 0 0 6px; padding: 0 0 0 4px; position: relative; }
.cc-tl::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px;
  background: var(--ink-100);
}
.cc-tl__step {
  position: relative; padding: 0 0 14px 24px; display: flex; align-items: center; min-height: 18px;
}
.cc-tl__step:last-child { padding-bottom: 0; }
.cc-tl__dot {
  position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  width: 11px; height: 11px; border-radius: var(--r-full);
  background: #fff; border: 2px solid var(--blue-600); box-shadow: 0 0 0 3px var(--blue-50);
}
.cc-tl__step:last-child .cc-tl__dot { background: var(--blue-600); }
.cc-tl__label { font-size: 13px; color: var(--ink-700); }

/* ============ Variant B ============ */
.cc--b {
  background: #fff; border: 1px solid var(--ink-100); border-radius: var(--r-md);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--sh-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
  cursor: pointer;
}
.cc--b:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); border-color: var(--blue-300); }
.cc--b:hover .cc__read-arr { transform: translateX(3px); }

.cc-viz {
  position: relative; padding: 18px 20px 16px;
  background:
    radial-gradient(120% 130% at 85% -10%, rgba(37,99,235,.22), transparent 58%),
    linear-gradient(180deg, #16203A, var(--ink-900));
  color: #fff; overflow: hidden;
}
.cc-viz__grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 0%, #000 40%, transparent 85%);
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 40%, transparent 85%);
}
.cc-viz > * { position: relative; }
.cc-viz__head { display: flex; align-items: center; justify-content: space-between; }
.cc-viz__ind {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-300);
}
.cc-viz__live {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em;
  color: var(--teal-300); display: inline-flex; align-items: center; gap: 6px;
}
.cc-viz__live i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--teal-500);
  box-shadow: 0 0 0 0 var(--teal-glow); animation: ccpulse 2s infinite var(--ease);
}
@keyframes ccpulse { 0% { box-shadow: 0 0 0 0 var(--teal-glow); } 70% { box-shadow: 0 0 0 7px rgba(20,184,166,0); } 100% { box-shadow: 0 0 0 0 rgba(20,184,166,0); } }

.cc-viz__num { display: flex; align-items: baseline; gap: 7px; margin-top: 12px; }
.cc-viz__big {
  font-family: var(--font-sans); font-weight: 700; font-size: 44px; line-height: .9;
  letter-spacing: -0.035em; color: #fff; font-variant-numeric: tabular-nums;
}
.cc-viz__unit { font-family: var(--font-mono); font-size: 13px; color: var(--ink-300); }
.cc-viz__delta {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  color: var(--blue-300); margin-top: 6px;
}

.cc-viz__bars { margin-top: 16px; display: flex; flex-direction: column; gap: 7px; }
.cc-vb { display: grid; grid-template-columns: 78px 1fr auto; align-items: center; gap: 9px; }
.cc-vb__k { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-400); }
.cc-vb__track { height: 7px; background: rgba(255,255,255,.08); border-radius: var(--r-full); overflow: hidden; }
.cc-vb__fill { display: block; height: 100%; border-radius: var(--r-full); width: 0; transition: width 1.2s var(--ease); }
.cc-vb__fill--b { background: rgba(255,255,255,.28); }
.cc-vb__fill--a { background: linear-gradient(90deg, var(--blue-500), var(--blue-400)); }
.cc-vb__v { font-family: var(--font-mono); font-size: 11px; color: var(--ink-300); white-space: nowrap; }
.cc-vb__v--hi { color: #fff; font-weight: 600; }

/* qualitative case (no single metric) — process composition */
.cc-qual__title {
  font-family: var(--font-sans); font-weight: 700; font-size: 26px; line-height: 1.05;
  letter-spacing: -0.03em; color: #fff; margin-top: 12px;
}
.cc-qual__sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--ink-300); margin-top: 6px; }
.cc-qual__lanes { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; }
.cc-qual__lane {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 8px 11px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-left: 2px solid var(--blue-400);
}
.cc-qual__lane-name { font-size: 13px; font-weight: 600; color: #fff; }
.cc-qual__lane-kind { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-300); }
.cc-qual__merge {
  display: flex; align-items: center; gap: 8px; margin-top: 9px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--blue-300);
}
.cc-qual__merge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue-400); box-shadow: 0 0 0 3px rgba(37,99,235,.2);
}

.cc-viz__tl {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .02em; color: var(--ink-400);
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .35s var(--ease), opacity .3s var(--ease), margin-top .35s var(--ease), padding-top .35s var(--ease);
  margin-top: 0;
}
.cc--b:hover .cc-viz__tl, .cc--b:focus-within .cc-viz__tl { max-height: 60px; opacity: 1; margin-top: 14px; }
.cc-viz__tl-step em { color: var(--blue-400); font-style: normal; }

.cc-b__body { padding: var(--s-5) var(--s-6) var(--s-6); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cc-b__metric { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink-900); }
.cc-b__desc { font-size: 13.5px; line-height: 1.55; color: var(--ink-500); margin: 0 0 6px; }
.cc--b .cc__read {
  margin-top: auto; width: 100%;
  padding-top: var(--s-4); border-top: 1px solid var(--ink-100);
}

@media (prefers-reduced-motion: reduce) {
  .cc-bar__fill, .cc-vb__fill, .cc__read-arr, .cc__panel, .cc-viz__tl { transition: none !important; }
  .cc-viz__live i { animation: none; }
}
