/* ===========================================================
   Appify KZ — case.css
   Стили детальной страницы кейса. Опирается на CSS-переменные
   и классы из base.css / site.css / modern.css — не дублирует их.
   =========================================================== */

/* ---------- Хлебные крошки (расширяем breadcrumbs из site.css) ---------- */
.case-breadcrumbs {
  padding: 18px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.case-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}
.case-breadcrumbs a:hover { color: var(--brand-2); }
.case-breadcrumbs .sep { margin: 0 7px; opacity: .55; }
.case-breadcrumbs span { color: #cbd5e1; }

/* ---------- HERO двухколоночный ---------- */
.case-hero {
  padding: 64px 0 72px;
  position: relative;
  overflow: hidden;
}
.case-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 52px;
  align-items: center;
}

/* Левая колонка hero */
.case-hero-body { display: flex; flex-direction: column; gap: 0; }
.case-hero-body .eyebrow { margin-bottom: 12px; }
.case-hero-body .title {
  font-size: clamp(30px, 4.8vw, 52px);
  margin: 0 0 18px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -1.6px;
  color: var(--text-bright);
}
.case-hero-body .subtitle {
  color: #b6c0cc;
  font-size: 17px;
  line-height: 1.7;
  max-width: 540px;
  margin: 0 0 20px;
}

/* Бейдж статуса */
.case-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid rgba(34,197,94,.35);
  background: rgba(34,197,94,0.09);
  color: var(--success);
  margin-bottom: 16px;
}
.case-status.demo {
  color: var(--brand-2);
  border-color: rgba(34,211,238,.35);
  background: rgba(34,211,238,0.08);
}
.case-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* Теги в hero */
.case-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 24px;
}
.case-hero-tags span {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(20,184,166,0.10);
  color: var(--brand-2);
  border: 1px solid rgba(20,184,166,0.22);
  font-weight: 600;
}

/* CTA-строка в hero */
.case-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

/* ---------- Правая колонка: визуал кейса ---------- */
.case-hero-visual {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(20,184,166,0.12), rgba(34,211,238,0.05));
  border: 1px solid var(--stroke-bright);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 3D-tilt поддержка из modern.css */
  transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transition: transform .25s ease-out;
  will-change: transform;
}
.case-hero-visual::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 22px;
  pointer-events: none;
  background: radial-gradient(420px 240px at 80% 10%, rgba(34,211,238,.22), transparent 60%),
              radial-gradient(400px 200px at 0% 100%, rgba(20,184,166,.18), transparent 60%);
  z-index: 0;
}
.case-hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
  border-radius: 20px;
}
/* Иконка-плейсхолдер при отсутствии картинки */
.case-hero-visual .chv-icon {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  color: var(--brand-2);
  opacity: .55;
}
.case-hero-visual .chv-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Декоративная рамка свечения */
@media (hover: hover) and (pointer: fine) {
  .case-hero-grid { perspective: 1200px; }
  .case-hero-visual:hover {
    box-shadow: 0 20px 60px rgba(20,184,166,0.18), 0 0 0 1px rgba(20,184,166,0.35);
  }
}

/* ---------- Секции кейса ---------- */
.case-section {
  padding: 64px 0;
  position: relative;
}
.case-section + .case-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--stroke) 20%, var(--stroke) 80%, transparent);
}

.case-section-inner {
  max-width: 860px;
}

/* Единый заголовок секции с цветным якорем слева (вместо двойного eyebrow+h2) */
.case-h2 {
  position: relative;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  color: var(--text-bright);
  margin: 0;
  padding-left: 16px;
}
.case-h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: .14em;
  bottom: .14em;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

/* Полоса метрик сразу после hero — результат виден до прокрутки */
.case-metrics-band {
  padding: 8px 0 4px;
  margin-bottom: 8px;
}
.case-metrics-band .case-metrics {
  margin-top: 18px;
}

/* Prose-типографика для richtext-контента */
.case-prose {
  color: #cbd5e1;
  font-size: 16.5px;
  line-height: 1.75;
  margin-top: 20px;
}
.case-prose h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -.5px;
  margin: 28px 0 10px;
}
.case-prose h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-bright);
  margin: 22px 0 8px;
}
.case-prose p {
  margin: 0 0 14px;
}
.case-prose ul {
  margin: 8px 0 14px;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}
.case-prose ul li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 15.5px;
  color: #cbd5e1;
}
.case-prose ul li::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  flex-shrink: 0;
  margin-top: 9px;
}
.case-prose strong { color: var(--text-bright); font-weight: 600; }
.case-prose em { color: #b6c0cc; font-style: italic; }
.case-prose a {
  color: var(--brand-2);
  text-decoration: none;
  border-bottom: 1px dashed rgba(34,211,238,0.4);
}
.case-prose a:hover { border-bottom-style: solid; }

/* ---------- Быстрые факты (meta) ---------- */
.case-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 28px 0;
  border-top: 1px dashed var(--stroke);
  border-bottom: 1px dashed var(--stroke);
  margin: 0 0 40px;
}
.case-fact {
  flex: 1 0 150px;
  background: linear-gradient(180deg, var(--card), #0b111a);
  border: 1px solid var(--stroke-bright);
  border-radius: 14px;
  padding: 14px 18px;
}
.case-fact b {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .7px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}
.case-fact span {
  font-size: 14.5px;
  color: var(--text-bright);
  font-weight: 600;
}

/* ---------- Метрики ---------- */
.case-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}
.case-metric {
  background: linear-gradient(180deg, var(--card), #0b111a);
  border: 1px solid var(--stroke-bright);
  border-radius: 18px;
  padding: 28px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease;
}
.case-metric:hover {
  transform: translateY(-4px);
  border-color: rgba(20,184,166,0.4);
}
.case-metric::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  opacity: .7;
}
.case-metric-value {
  display: block;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.case-metric-label {
  color: #b6c0cc;
  font-size: 13.5px;
  line-height: 1.4;
}

/* ---------- Стек-технологии ---------- */
.case-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.case-tech-chip {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(11,18,27,0.7);
  border: 1px solid var(--stroke-bright);
  color: #cbd5e1;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: transform .2s ease, border-color .2s ease;
}
.case-tech-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(20,184,166,.45);
  color: var(--text-bright);
}
.case-tech-chip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

/* ---------- Галерея ---------- */
.case-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.case-gallery-item {
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--stroke-bright);
  background: var(--card);
  position: relative;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.case-gallery-item:hover {
  transform: translateY(-4px);
  border-color: rgba(20,184,166,0.45);
  box-shadow: 0 14px 30px rgba(0,0,0,.4);
}
.case-gallery-item img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}
/* Оверлей-иконка при наведении */
.case-gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(20,184,166,0.08);
  opacity: 0;
  transition: opacity .2s ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='M21 21l-4.35-4.35M11 8v6M8 11h6'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
}
.case-gallery-item:hover::after { opacity: 1; }
.case-gallery-caption {
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
  background: linear-gradient(180deg, var(--card), #0b111a);
}

/* ---------- Связанные кейсы ---------- */
.case-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 28px;
}

/* ---------- CTA-полоса в конце ---------- */
.case-cta-band {
  margin: 24px 0 0;
  padding: 44px 32px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(20,184,166,0.16), rgba(34,211,238,0.07));
  border: 1px solid rgba(20,184,166,0.35);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.case-cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 300px at 50% 0%, rgba(34,211,238,.10), transparent 60%);
  pointer-events: none;
}
.case-cta-band h3 {
  position: relative;
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -.6px;
}
.case-cta-band p {
  position: relative;
  margin: 0 0 22px;
  color: #cbd5e1;
  font-size: 16px;
}
.case-cta-band .cta {
  position: relative;
  justify-content: center;
}

/* ---------- Адаптив ---------- */

/* Hero: одна колонка на планшете и мобиле */
@media (max-width: 900px) {
  .case-hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .case-hero-visual {
    aspect-ratio: 16/9;
    max-width: 100%;
  }
  .case-hero-body .title {
    font-size: 34px;
  }
  .case-metrics {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .case-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .case-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .case-hero {
    padding: 40px 0 48px;
  }
  .case-hero-body .title {
    font-size: 28px;
    letter-spacing: -0.8px;
  }
  .case-hero-body .subtitle {
    font-size: 15px;
  }
  .case-section {
    padding: 44px 0;
  }
  .case-gallery {
    grid-template-columns: 1fr;
  }
  .case-related-grid {
    grid-template-columns: 1fr;
  }
  .case-cta-band {
    padding: 32px 20px;
  }
  .case-cta-band h3 {
    font-size: 22px;
  }
  .case-metrics {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .case-metrics {
    grid-template-columns: 1fr;
  }
  .case-hero-cta .btn {
    width: 100%;
    justify-content: center;
  }
}
