/* === ТЁМНАЯ ТЕМА ======================================================== */
:root{
  --bg: #0e0e10;
  --bg-section: #16181c;
  --card: #151922;
  --text: #ffffff;
  --muted: #aab5c4;
  --line: rgba(255,255,255,.12);
  --neon: #00fff7;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
}
html,body{ background:var(--bg); color:var(--text); }

/* === БАЗА / ТИПОГРАФИКА ================================================ */
*{ box-sizing:border-box; }
img{ display:block; max-width:100%; height:auto; border:0; }
a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--neon), #fff 20%); }
h1,h2,h3{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Montserrat", sans-serif;
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 .5em;
}
h1{ font-size: clamp(28px, 4.2vw, 44px); }
h2{ font-size: clamp(22px, 3vw, 28px); margin-top: 40px; }
h3{ font-size: clamp(18px, 2.2vw, 22px); }

.muted{ color:var(--muted); }
.case{
  max-width:1040px;
  margin:0 auto;
  padding:48px 20px 80px;
  line-height:1.65;
}

.case .lead{ font-size:clamp(16px, 2vw, 20px); opacity:.9; margin:0 0 20px; }

/* абзацы/вертикальный ритм */
.case p { margin: .6em 0 1em; }

/* === СПИСКИ (аккуратные маркеры) ======================================= */
.case ul, .case ol { margin: .2em 0 0 0; padding: 0; }
.case ul{ list-style: none; display:grid; gap:.45rem; }
.case ul > li{
  position: relative; padding-left: 1.35rem;
}
.case ul > li::before{
  content:"•";
  position:absolute; left:.25rem; top:.25rem;
  color: color-mix(in oklab, var(--neon), #fff 15%);
  font-weight:700;
}

/* Нумерованный — красивые счётчики */
.case ol{
  counter-reset: step;
  display:grid; gap:.45rem;
  list-style:none;
}
.case ol > li{
  counter-increment: step;
  position:relative; padding-left: 2rem;
}
.case ol > li::before{
  content: counter(step) ".";
  position:absolute; left:0; top:.05rem;
  width:1.6rem; height:1.6rem; display:grid; place-items:center;
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: #041410;
  font-weight:700;
  border:1px solid color-mix(in oklab, var(--neon), #fff 10%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
  color: color-mix(in oklab, var(--neon), black 10%);
}

/* === FIGURE / IMAGES ==================================================== */
.case figure{ margin:16px 0; }
.case figure img{
  border-radius:10px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.03);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.case figcaption{ font-size:.92rem; opacity:.85; margin-top:6px; }

/* Если у figure .after-only не загрузилось изображение — скрыть */
.after-only:not(:has(img[src])){ display:none; }

/* === КАРТОЧКИ СТРУКТУРЫ ================================================= */
.case-structure{ margin-top:32px; }
.case-structure .icon-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:16px;
}
@media (max-width:1024px){ .case-structure .icon-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width:640px){ .case-structure .icon-grid{ grid-template-columns: 1fr; } }

.icon-card{
  background:var(--bg-section);
  border:1px solid var(--line);
  border-radius:14px;
  padding:18px;
  box-shadow:var(--shadow);
  display:grid;
  gap:8px;
  align-content:start;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.icon-card:hover{
  transform:translateY(-2px);
  border-color:color-mix(in oklab, var(--neon), #fff 25%);
  box-shadow:0 10px 28px rgba(0,0,0,.38);
  background: color-mix(in oklab, var(--bg-section), #fff 3%);
}
.icon{
  width:44px; height:44px;
  display:inline-grid; place-items:center;
  border-radius:10px;
  background:rgba(255,255,255,.06);
  color:#8fe7ff;
}
.icon svg{ width:28px; height:28px; display:block; }

/* === ГАЛЕРЕЯ СКРИНШОТОВ ================================================= */
.grid-3{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
  gap:16px;
}
.mockup{
  background:rgba(255,255,255,.03);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  box-shadow:0 8px 28px rgba(0,0,0,.22);
}
.mockup img{
  border-radius:10px;
  aspect-ratio:16/9;
  object-fit:cover;
}
.mockup figcaption{ font-size:.95rem; opacity:.9; margin-top:8px; }

/* === РЕЗУЛЬТАТЫ — галочки ============================================== */
.checks{ list-style:none; margin:10px 0 0; padding:0; display:grid; gap:8px; }
.checks li{ position:relative; padding-left:1.6rem; }
.checks li::before{
  content:"✔"; position:absolute; left:.2rem; top:0; line-height:1;
  color: color-mix(in oklab, var(--neon), #fff 8%); font-weight:700;
}

/* === БЛОК ВЫДЕРЖКИ/ОТЗЫВА ============================================== */
blockquote{
  position: relative;
  margin: 16px 0 0;
  padding: 16px 16px 16px 52px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border-radius: 14px;
  color: var(--text);
  box-shadow: var(--shadow);
}
blockquote::before{
  content: "“";
  position: absolute;
  left: 14px; top: 2px;
  font-size: 44px; line-height: 1; opacity: .35;
  color: color-mix(in oklab, var(--neon), #fff 10%);
}
blockquote b{ color: #d8e6ff; font-weight: 600; }

/* === КНОПКА ============================================================= */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:.5rem; white-space:nowrap; cursor:pointer;
  padding:12px 18px; border-radius:14px;
  border:1px solid color-mix(in oklab, var(--neon), #fff 10%);
  background: color-mix(in oklab, var(--neon), black 88%);
  color:#041410;
  box-shadow:0 0 0 2px color-mix(in oklab, var(--neon), transparent 85%), 0 8px 24px rgba(0,0,0,.4);
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.btn:hover{ transform:translateY(-1px); background:color-mix(in oklab, var(--neon), black 82%); }

/* Fix: контраст текста на тёмной кнопке */
.btn{
  color: #eaf7ff !important;           /* светлый текст */
  text-shadow: 0 1px 0 rgba(0,0,0,.25); /* чуть лучше читается */
  font-weight: 700;
}
.btn:hover{ color:#ffffff !important; }

.btn:focus-visible{
  outline: 2px solid color-mix(in oklab, var(--neon), #fff 10%);
  outline-offset: 2px;
  border-radius: 999px;
}

/* альтернативно: чуть светлее фон кнопки */
.btn{
  background: color-mix(in oklab, var(--neon), black 75%);
}


/* === АДАПТИВ МЕЛОЧИ ===================================================== */
@media (max-width:560px){
  .case{ padding:40px 16px 64px; }
  blockquote{ padding-left:46px; }
}


/* Типографика страницы кейса */
html, body {
  font-family: "Montserrat", "Ubuntu", system-ui, -apple-system, "Segoe UI",
               Roboto, Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Заголовки — тем же семейством, чуть плотнее */
.case h1, .case h2, .case h3 {
  font-family: "Montserrat", "Ubuntu", system-ui, -apple-system, "Segoe UI",
               Roboto, Arial, sans-serif !important;
  font-weight: 600;
}

/* На всякий случай: всё внутри кейса наследует Montserrat */
.case, .case *:not(code):not(pre) {
  font-family: inherit !important;
}


/* ===== Хлебные крошки на страницах кейсов ===== */
.crumbs{
  max-width: var(--container,1200px);
  margin: 0 auto 12px;
  padding: 0 24px;
  font: 14px/1.6 var(--font, "Montserrat","Ubuntu",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif);
  color: var(--muted, #a9c6d1);
}
.crumbs a{
  color: var(--white, #eafcff);
  text-decoration: none;
  opacity: .85;
}
.crumbs a:hover{ opacity:1; text-decoration: underline; }
.crumbs .sep{ margin: 0 .5rem; opacity:.45; }


/* ===== Кнопка «Вернуться» ===== */
.backlink{
  display:inline-flex; align-items:center; gap:8px;
  max-width: var(--container,1200px);
  margin: 8px auto 12px; padding: 0 24px;
  font: 14px/1.6 var(--font, "Montserrat","Ubuntu",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif);
  color: var(--neon); text-decoration:none;
  opacity:.85;
}
.backlink:hover{ opacity:1; text-decoration:underline; }
