/* =========================================================
   Страница кейса. Подключается после styles.css и только
   дополняет её — общие вещи (шапка, .wrap, .mono, .tag)
   живут в styles.css и здесь не переопределяются заново.
   ========================================================= */

:root {
  --ink: #15171b;
  --muted: #5a5f66;
  --rule: #dcd9d3;
  --surface: #e7e5e0;
  --lime: #cdf25e;
}

.back-link { text-decoration: none; color: var(--muted); }

/* Плашки в шапке кейса: на светлом фоне страницы, а не на карточке */
.case-hero .tag.light { background: var(--surface); color: #3a3f45; }
.case-hero .tag.accent { background: var(--lime); color: #111a0a; }

.mono.small { font-size: 11px; }
.mono.light { color: rgba(244, 243, 240, .6); }

/* ---------- обложка ---------- */
.case-hero {
  padding: clamp(36px, 5vw, 72px) 0 clamp(24px, 3vw, 36px);
  max-width: 1100px;
}
.case-hero h1 {
  margin: 20px 0 0;
  font-size: clamp(36px, 5.6vw, 72px); font-weight: 700;
  letter-spacing: -.035em; line-height: 1.02;
  overflow-wrap: break-word; hyphens: auto;
}
.case-intro {
  margin: 18px 0 0; max-width: 46ch;
  font-size: clamp(17px, 1.6vw, 21px); line-height: 1.55; color: var(--muted);
}

.case-cover {
  border-radius: clamp(20px, 2.4vw, 34px); overflow: hidden;
  background: #18212e;
  display: flex; align-items: flex-end; justify-content: center;
  aspect-ratio: 1680 / 760; min-height: 280px;
}
.case-cover img {
  width: auto; height: 92%; max-width: none; object-fit: contain;
}
@media (max-width: 700px) {
  .case-cover { aspect-ratio: 4 / 5; }
  .case-cover img { height: 94%; }
}

/* ---------- сетка: оглавление + текст ---------- */
.case-layout {
  display: grid; grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 96px);
  padding: clamp(40px, 6vw, 88px) 0 0;
  align-items: start;
}
.case-nav {
  position: sticky; top: 96px;
  display: flex; flex-direction: column; gap: 10px;
  font-size: 15px;
}
.case-nav-title { margin-bottom: 6px; }
.case-nav a {
  text-decoration: none; color: var(--muted);
  padding: 2px 6px; margin-left: -6px; border-radius: 6px;
  transition: color .2s ease, background .2s ease;
}
.case-nav a:hover { color: var(--ink); background: var(--lime); }
.case-nav a.is-active { color: var(--ink); font-weight: 600; }
.case-nav-back { margin-top: 14px; }

@media (max-width: 900px) {
  .case-layout { grid-template-columns: 1fr; gap: 0; }
  .case-nav { display: none; }
}

.case-main { min-width: 0; max-width: 900px; }

/* ---------- мета ---------- */
.case-meta { padding-bottom: clamp(28px, 4vw, 48px); }
.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-radius: 18px; overflow: hidden;
}
.meta-cell { background: #f2f1ee; padding: 18px 20px; }
.meta-value { margin-top: 6px; font-size: 17px; font-weight: 500; }

/* ---------- секции ---------- */
.case-section {
  padding: clamp(32px, 4.4vw, 56px) 0;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 96px;
}
.case-section.flush { border-top: 0; }
.case-section h2 {
  margin: 14px 0 0;
  font-size: clamp(26px, 3.4vw, 44px); font-weight: 600;
  letter-spacing: -.03em; line-height: 1.1; text-wrap: balance;
}
.case-p {
  margin: 18px 0 0; max-width: 62ch;
  font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: #3a3f45;
}

.three-col {
  margin-top: clamp(24px, 3vw, 36px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
}
.three-col p { margin: 10px 0 0; font-size: 16px; line-height: 1.55; color: #3a3f45; }

.details-grid {
  margin-top: clamp(24px, 3vw, 36px);
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px); align-items: start;
}
@media (max-width: 760px) { .details-grid { grid-template-columns: 1fr; } }
.details-text p { margin: 0 0 16px; font-size: 17px; line-height: 1.6; color: #3a3f45; }
.details-text p:last-child { margin-bottom: 0; }
.details-side { background: var(--surface); border-radius: 18px; padding: 22px 24px; }
.side-row { font-size: 15px; line-height: 1.5; color: #3a3f45; padding: 12px 0; }
.details-side .mono + .side-row { padding-top: 14px; }
.side-sep { height: 1px; background: rgba(19, 26, 23, .12); }

/* ---------- итоги ---------- */
.results-card {
  background: #15171b; color: #f4f3f0;
  border-radius: clamp(20px, 2.4vw, 34px);
  padding: clamp(28px, 4vw, 56px);
  display: grid; gap: clamp(24px, 3vw, 40px);
}
.results-headline {
  margin: 14px 0 0;
  font-size: clamp(24px, 3.2vw, 40px); font-weight: 600;
  letter-spacing: -.03em; line-height: 1.12; text-wrap: balance;
}
.results-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.result-chip { background: rgba(255, 255, 255, .08); border-radius: 18px; padding: 20px 22px; }
.result-label { font-size: 14px; color: #b0b4b8; }
.result-value { margin-top: 6px; font-size: clamp(20px, 2.2vw, 26px); font-weight: 600; letter-spacing: -.02em; }

/* ---------- идеи ---------- */
.ideas-grid {
  margin-top: clamp(24px, 3vw, 36px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.idea {
  background: var(--surface); border-radius: 18px; padding: 22px 24px;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), background .25s ease;
}
.idea:hover { transform: translateY(-3px); background: #e1dfd8; }
.idea-title { margin-top: 12px; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.idea p { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: #4a4f55; }

/* ---------- спасибо ---------- */
.thanks-card {
  background: var(--lime); color: #111a0a;
  border-radius: clamp(20px, 2.4vw, 34px);
  padding: clamp(28px, 4vw, 56px);
}
.thanks-card h2 { margin: 0; font-size: clamp(26px, 3.4vw, 44px); font-weight: 600; letter-spacing: -.03em; }
.thanks-card p { margin: 14px 0 0; max-width: 58ch; font-size: 17px; line-height: 1.6; color: #2c3a12; }
.thanks-links { margin-top: clamp(20px, 2.6vw, 32px); display: flex; flex-wrap: wrap; gap: 10px; }
.thanks-btn {
  display: inline-flex; align-items: center; padding: 14px 22px; border-radius: 14px;
  background: rgba(17, 26, 10, .08); color: #111a0a;
  font-size: 16px; font-weight: 500; text-decoration: none;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), background .2s ease;
}
.thanks-btn:hover { transform: translateY(-2px); background: rgba(17, 26, 10, .16); color: #111a0a; }
.thanks-btn.primary { background: #15171b; color: #f4f3f0; }
.thanks-btn.primary:hover { background: #15171b; color: #f4f3f0; }

/* ---------- другие кейсы ---------- */
.other-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-bottom: 18px;
}
.other-head h2 { margin: 0; font-size: clamp(22px, 2.6vw, 32px); font-weight: 600; letter-spacing: -.03em; }
.other-head a { font-size: 16px; }
.other-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.other-card {
  display: block; border-radius: 22px; overflow: hidden; text-decoration: none;
  background: var(--bg); color: var(--ink);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.other-card:hover { transform: translateY(-4px); background: var(--bg); color: var(--ink); }
.other-media {
  position: relative; overflow: hidden; background: var(--mediaBg);
  aspect-ratio: 4 / 3;
  display: flex; align-items: flex-end; justify-content: center;
}
.other-media img { width: auto; height: 88%; max-width: none; }
.other-text { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
/* Карточки покрашены темами из styles.css — подпись берёт цвет темы, а не общий серый */
.other-text .mono { color: var(--muted); }
.other-title { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }

/* Низ страницы: воздух под последней секцией */
#other { padding-bottom: clamp(56px, 8vw, 110px); }

@media (prefers-reduced-motion: reduce) {
  .case-nav { position: static; }
}
