/* ===== CASE STUDY — single page ===== */

/* ── Hero ───────────────────────────────────────────────── */
.case-hero {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  padding-top: 48px;
  padding-bottom: 0;
}

.case-hero__inner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: start;
  padding-bottom: 60px;
}

.case-hero__copy {
  display: grid;
  gap: 20px;
  max-width: 640px;
}

.case-hero__copy h1 {
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.case-hero__copy .lede {
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 58ch;
}

/* Meta row: Klient · Branża · Okres · Usługi */
.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.case-meta__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 24px;
  margin-right: 24px;
  border-right: 1px solid var(--line);
}

.case-meta__item:last-child {
  border-right: 0;
  padding-right: 0;
  margin-right: 0;
}

.case-meta__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-family: var(--mono);
}

.case-meta__value {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* KPI sidebar */
.case-hero__kpis {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: center;
}

.case-kpi {
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s;
}

.case-kpi b {
  font-size: clamp(30px, 3.8vw, 44px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--blue);
}

.case-kpi span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Cover image ────────────────────────────────────────── */
.case-cover {
  padding-block: 48px;
  background: var(--bg);
}

.case-cover .imgph {
  aspect-ratio: 16 / 7;
  border-radius: var(--r-xl);
}

/* ── Body ───────────────────────────────────────────────── */
.case-body {
  padding-block: clamp(48px, 6vw, 88px);
  background: var(--bg);
}

.case-body__content {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 0;
}

/* Section separator line */
.case-sep {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
  color: var(--muted-2);
}

.case-sep::before,
.case-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.case-sep__label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}

.case-sep__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Content sections */
.case-section {
  padding-bottom: 64px;
  margin-bottom: 64px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 24px;
}

.case-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
}

.case-section h2 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0;
}

/* Prose inside sections */
.case-prose {
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink-2);
  display: grid;
  gap: 1em;
}

.case-prose p { margin: 0; }
.case-prose strong { font-weight: 600; color: var(--ink); }
.case-prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

.case-prose ul {
  margin: 0;
  padding-left: 1.4em;
  display: grid;
  gap: 8px;
}

.case-prose li { padding-left: 4px; }
.case-prose li::marker { color: var(--blue); }

/* Result KPI cards inside body */
.case-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.case-result-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.case-result-card b {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--blue);
}

.case-result-card span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ── Quote / testimonial ────────────────────────────────── */
.case-quote {
  background: var(--ink);
  border-radius: var(--r-xl);
  padding: clamp(28px, 4vw, 48px) clamp(28px, 4vw, 52px);
  display: grid;
  gap: 24px;
  margin: 0;
}

.case-quote__text {
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.48;
  letter-spacing: -0.018em;
  font-weight: 500;
  color: #fff;
  position: relative;
}

.case-quote__text::before {
  content: """;
  font-size: 1em;
  color: var(--blue);
  margin-right: 2px;
}

.case-quote__text::after {
  content: """;
  font-size: 1em;
  color: var(--blue);
  margin-left: 2px;
}

.case-quote__cite {
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  gap: 12px;
}

.case-quote__cite::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--blue);
  flex-shrink: 0;
}

/* ── CTA ────────────────────────────────────────────────── */
.case-cta {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(56px, 8vw, 100px);
}

.case-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.case-cta__copy {
  display: grid;
  gap: 12px;
  max-width: 560px;
}

.case-cta__copy h2 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.case-cta__copy p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

/* ── Prev / Next nav ────────────────────────────────────── */
.case-nav {
  padding-block: clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--line);
}

.case-nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 32px;
}

.case-nav__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  max-width: 400px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.2s, background 0.2s;
}

.case-nav__item:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.case-nav__item--next {
  align-items: flex-end;
  text-align: right;
  margin-left: auto;
}

.case-nav__dir {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.case-nav__tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.case-nav__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  transition: color 0.2s;
  line-height: 1.3;
}

.case-nav__item:hover .case-nav__title {
  color: var(--blue-700);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .case-hero__inner {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .case-hero__kpis {
    flex-direction: row;
    gap: 12px;
  }

  .case-kpi {
    flex: 1;
  }

  .case-results {
    grid-template-columns: repeat(3, 1fr);
  }

  .case-cta__inner {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .case-hero__kpis {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .case-kpi:last-child {
    grid-column: 1 / -1;
  }

  .case-results {
    grid-template-columns: 1fr 1fr;
  }

  .case-results > *:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .case-meta {
    gap: 16px 0;
  }

  .case-meta__item {
    min-width: 50%;
    border-right: 0;
    padding-right: 0;
    margin-right: 0;
    padding-bottom: 16px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--line);
  }

  .case-meta__item:last-child {
    border-bottom: 0;
  }

  .case-nav__inner {
    flex-direction: column;
  }

  .case-nav__item--next {
    align-items: flex-start;
    text-align: left;
  }
}
