:root {
  --page: 1180px;
  --article: 760px;
  --paper: #f4f7fb;
  --ink: #142a45;
  --blue: #1c5797;
  --accent: #72b4e4;
  --pale: #e8f1f9;
  --line: rgba(20, 42, 69, .15);
  --muted: rgba(20, 42, 69, .62);
  --white: #fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 "Onest", sans-serif;
}
a { color: inherit; text-decoration: none; }

.case-site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 58px;
  padding: 0 max(24px, calc((100vw - var(--page)) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.case-logo { color: var(--blue); font-weight: 800; letter-spacing: -.05em; }
.case-site-header nav { display: flex; gap: 28px; color: var(--muted); font-size: 13px; }
.case-site-header nav a:hover { color: var(--blue); }
.case-header-cta {
  justify-self: end;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 5px;
  background: var(--blue);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  font-weight: 650;
}

.case-hero {
  width: min(var(--page), calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 0;
}
.case-breadcrumb {
  margin-bottom: 32px;
  display: flex;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.case-company { margin-bottom: 24px; display: flex; align-items: center; gap: 14px; }
.case-company__mark {
  width: 132px;
  height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  display: grid;
  place-items: center;
}
.case-company__logo { width: 100%; height: 100%; object-fit: contain; }
.case-company__logo--petrovax {
  width: 42px;
  max-width: 42px;
  object-position: left center;
}
.case-company__fallback { color: var(--blue); font-weight: 800; }
.case-company > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.case-company strong { font-size: 16px; }
.case-company small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.case-hero h1 {
  max-width: 1030px;
  margin: 0;
  font-size: clamp(40px, 5.1vw, 70px);
  line-height: .99;
  font-weight: 560;
  letter-spacing: -.055em;
}
.case-hero__summary {
  max-width: 760px;
  margin: 28px 0 46px;
  color: var(--muted);
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.5;
}
.case-facts {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.case-facts article {
  min-height: 150px;
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.case-facts article:first-child { padding-left: 0; }
.case-facts article:last-child { border-right: 0; }
.case-facts strong {
  color: var(--blue);
  font: 500 clamp(30px, 3.2vw, 45px)/1 "Source Serif 4", serif;
}
.case-facts span { max-width: 180px; color: var(--muted); font-size: 13px; }
.case-passport {
  padding: 22px 0 28px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.case-passport div { display: flex; flex-direction: column; gap: 4px; }
.case-passport span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.case-passport strong { font-size: 14px; font-weight: 560; }

.case-story {
  width: min(var(--page), calc(100% - 48px));
  margin: 0 auto;
  padding: 78px 0 104px;
  display: grid;
  grid-template-columns: minmax(0, var(--article)) 260px;
  justify-content: space-between;
  gap: 90px;
}
.case-section {
  padding: 0 0 88px;
  scroll-margin-top: 90px;
}
.case-section:last-child { padding-bottom: 0; }
.case-section > header {
  margin-bottom: 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.case-section > header span { color: var(--accent); font-size: 12px; font-weight: 700; }
.case-section > header p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.case-section h2 {
  max-width: 700px;
  margin: 0 0 28px;
  font-size: clamp(32px, 3.5vw, 48px);
  line-height: 1.08;
  font-weight: 550;
  letter-spacing: -.045em;
}
.case-prose { max-width: 690px; }
.case-prose p {
  margin: 0 0 18px;
  color: rgba(20, 42, 69, .82);
  font: 400 19px/1.68 "Source Serif 4", serif;
}
.case-callout {
  margin: 38px 0 0;
  padding: 28px 32px;
  border: 0;
  border-left: 4px solid var(--accent);
  background: var(--pale);
  color: var(--blue);
  font: 500 clamp(22px, 2.2vw, 30px)/1.35 "Source Serif 4", serif;
}
.case-methods { border-top: 1px solid var(--line); }
.case-method {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
}
.case-method > span { color: var(--accent); font-size: 13px; font-weight: 700; }
.case-method h3 { margin: 0 0 8px; font-size: 21px; line-height: 1.25; }
.case-method p { max-width: 620px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.case-section--result {
  width: calc(100% + 64px);
  margin-left: -32px;
  margin-bottom: 88px;
  padding: 38px 32px 76px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--white);
}
.case-section--result > header { border-color: rgba(255,255,255,.18); }
.case-section--result > header p { color: rgba(255,255,255,.55); }
.case-result-facts {
  margin: 0 0 34px;
  padding: 0 0 30px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.case-result-facts div { display: flex; flex-direction: column; gap: 8px; }
.case-result-facts strong { color: var(--accent); font: 500 35px/1 "Source Serif 4", serif; }
.case-result-facts span { color: rgba(255,255,255,.58); font-size: 12px; }
.case-section--result .case-prose p { color: rgba(255,255,255,.78); }
.case-quote {
  margin: 40px 0 0;
  padding: 30px;
  background: rgba(255,255,255,.07);
}
.case-quote blockquote {
  margin: 0 0 22px;
  color: var(--white);
  font: italic 500 clamp(23px, 2.4vw, 32px)/1.35 "Source Serif 4", serif;
}
.case-quote figcaption { color: rgba(255,255,255,.54); font-size: 12px; }

.case-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.case-insight {
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.case-insight > span { color: var(--accent); font-size: 12px; font-weight: 700; }
.case-insight p { margin: 30px 0 0; font: 500 19px/1.45 "Source Serif 4", serif; }
.case-insight--difficulty { background: var(--white); }
.case-insight--lesson { border-color: var(--blue); background: var(--pale); }

.case-toc {
  position: sticky;
  top: 90px;
  align-self: start;
  padding-left: 24px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.case-toc > span {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.case-toc a {
  padding: 7px 0;
  color: var(--muted);
  font-size: 13px;
  transition: color .2s, transform .2s;
}
.case-toc a:hover, .case-toc a.is-active { color: var(--blue); transform: translateX(4px); }
.case-toc__cta {
  margin-top: 22px;
  padding: 13px 14px !important;
  border-radius: 5px;
  background: var(--blue);
  color: var(--white) !important;
}
.case-toc__back { margin-top: 12px; }

.case-cta {
  padding: 86px max(24px, calc((100vw - var(--page)) / 2));
  background: var(--blue);
  color: var(--white);
}
.case-cta > span { font-size: 10px; letter-spacing: .16em; }
.case-cta h2 {
  max-width: 900px;
  margin: 22px 0 20px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 550;
}
.case-cta h2 em { color: var(--accent); font-family: "Source Serif 4", serif; font-weight: 500; }
.case-cta p { max-width: 650px; color: rgba(255,255,255,.67); font-size: 18px; }
.case-cta > a {
  margin-top: 22px;
  padding: 14px 18px;
  border-radius: 5px;
  background: var(--white);
  color: var(--blue);
  display: inline-flex;
  gap: 32px;
  font-weight: 650;
}

.case-related {
  width: min(var(--page), calc(100% - 48px));
  margin: 0 auto;
  padding: 82px 0 92px;
}
.case-related > header { margin-bottom: 28px; display: flex; align-items: end; justify-content: space-between; }
.case-related > header span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; }
.case-related h2 { margin: 0; font-size: 36px; letter-spacing: -.04em; }
.case-related > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.case-related > div > a {
  min-height: 310px;
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.35);
  display: flex;
  flex-direction: column;
  transition: background .2s, transform .2s;
}
.case-related > div > a:hover { background: var(--white); transform: translateY(-4px); }
.case-related__mark { width: 112px; height: 48px; margin-bottom: 34px; }
.case-related__logo { width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.case-related small { color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.case-related strong { margin-top: 5px; font-size: 17px; }
.case-related p { margin: 20px 0; color: var(--muted); line-height: 1.45; }
.case-related > div > a > span { margin-top: auto; align-self: end; font-size: 24px; }

.case-footer {
  min-height: 110px;
  padding: 0 max(24px, calc((100vw - var(--page)) / 2));
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.case-footer > a:last-child { justify-self: end; }
.case-not-found { width: min(700px, calc(100% - 40px)); margin: 15vh auto; }

@media (max-width: 900px) {
  .case-site-header { grid-template-columns: 1fr auto; }
  .case-site-header nav { display: none; }
  .case-story { grid-template-columns: 1fr; padding-top: 58px; }
  .case-toc { display: none; }
  .case-facts { grid-template-columns: 1fr 1fr; }
  .case-facts article:nth-child(2) { border-right: 0; }
  .case-facts article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .case-facts article:nth-child(3) { padding-left: 0; }
}

@media (max-width: 620px) {
  .case-site-header { height: 54px; padding: 0 16px; }
  .case-header-cta { min-height: 36px; padding: 0 12px; gap: 10px; }
  .case-hero, .case-story, .case-related { width: calc(100% - 32px); }
  .case-hero { padding-top: 30px; }
  .case-breadcrumb { margin-bottom: 22px; }
  .case-company__mark { width: 108px; height: 50px; }
  .case-hero h1 { font-size: clamp(35px, 11vw, 48px); }
  .case-hero__summary { margin: 22px 0 32px; font-size: 17px; }
  .case-facts article { min-height: 120px; padding: 20px 14px; }
  .case-facts article:first-child, .case-facts article:nth-child(3) { padding-left: 0; }
  .case-facts strong { font-size: 28px; }
  .case-passport { grid-template-columns: 1fr; gap: 14px; }
  .case-story { padding-bottom: 72px; }
  .case-section { padding-bottom: 64px; }
  .case-section h2 { font-size: 32px; }
  .case-prose p { font-size: 18px; }
  .case-callout { margin-top: 28px; padding: 22px; font-size: 22px; }
  .case-method { grid-template-columns: 42px 1fr; }
  .case-section--result { width: calc(100% + 32px); margin-left: -16px; padding: 28px 16px 58px; border-radius: 0; }
  .case-result-facts { grid-template-columns: 1fr; }
  .case-insights { grid-template-columns: 1fr; }
  .case-insight { min-height: 175px; }
  .case-cta { padding: 64px 16px; }
  .case-cta h2 { font-size: 40px; }
  .case-related { padding: 62px 0; }
  .case-related > header { align-items: start; flex-direction: column; gap: 7px; }
  .case-related > div { grid-template-columns: 1fr; }
  .case-related > div > a { min-height: 260px; }
  .case-footer { padding: 26px 16px; grid-template-columns: 1fr auto; }
  .case-footer p { display: none; }
}
