:root {
  --page: var(--bg);
  --surface: var(--bg-card);
  --soft: var(--bg-1);
  --text: var(--ink);
  --muted: var(--ink-2);
  --quiet: var(--ink-3);
  --brand: var(--accent);
  --brand-deep: var(--bg-blue);
  --brand-hover: var(--accent-ink);
  --white: #ffffff;
  --white-76: rgba(255, 255, 255, 0.76);
  --white-16: rgba(255, 255, 255, 0.16);
  --container: min(1376px, calc(100vw - 64px));
  --article: 900px;
}

* { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 12px 16px;
  background: var(--brand-deep);
  color: var(--white);
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

.case-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 94%, transparent);
  backdrop-filter: blur(18px);
}

.case-logo {
  width: fit-content;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.case-site-header nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.case-site-header nav a {
  color: var(--muted);
  font-size: 14px;
  transition: color 160ms ease;
}

.case-site-header nav a:hover,
.case-site-header nav a[aria-current="page"] { color: var(--brand); }

.case-header-cta {
  justify-self: end;
  display: inline-flex;
  min-height: 42px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--white);
  font-size: 13px;
  font-weight: 650;
  transition: background 160ms ease, border-color 160ms ease;
}

.case-header-cta:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.case-logo:focus-visible,
.case-site-header nav a:focus-visible,
.case-header-cta:focus-visible,
.case-toc a:focus-visible,
.case-cta a:focus-visible,
.case-related a:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.case-hero {
  width: var(--container);
  margin: 0 auto;
  padding: clamp(44px, 5vw, 76px) 0 0;
}

.case-breadcrumb {
  display: flex;
  margin-bottom: 34px;
  align-items: center;
  gap: 9px;
  color: var(--quiet);
  font-size: 12px;
}

.case-breadcrumb a:hover { color: var(--brand); }

.case-company {
  display: flex;
  margin-bottom: 28px;
  align-items: center;
  gap: 16px;
}

.case-company__mark {
  display: grid;
  width: 142px;
  height: 62px;
  padding: 10px 14px;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
}

.case-company__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.case-company__logo--petrovax {
  width: 46px;
  max-width: 46px;
  object-position: left center;
}

.case-company__fallback {
  color: var(--brand);
  font-size: 18px;
  font-weight: 800;
}

.case-company > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.case-company strong { font-size: 16px; }

.case-company small {
  color: var(--quiet);
  font-size: 12px;
}

.case-hero__card-copy {
  display: flex;
  max-width: 1040px;
  margin: 0 0 18px;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  line-height: 1.35;
}

.case-hero__card-copy span {
  flex: 0 0 auto;
  color: var(--brand);
  font-weight: 650;
}

.case-hero__card-copy strong {
  color: var(--quiet);
  font-weight: 500;
}

.case-hero h1 {
  max-width: 1040px;
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  font-size: clamp(42px, 4.4vw, 64px);
  font-weight: 650;
  line-height: 1.01;
  letter-spacing: -0.055em;
}

.case-hero__accent { color: var(--brand); }

.case-hero__summary {
  max-width: 820px;
  margin: 30px 0 50px;
  color: var(--muted);
  font-size: clamp(18px, 1.65vw, 23px);
  line-height: 1.5;
}

.case-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.case-facts article {
  display: flex;
  min-height: 154px;
  padding: 26px;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.case-facts strong {
  color: var(--brand);
  font-size: clamp(31px, 3.1vw, 46px);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.05em;
}

.case-facts span {
  max-width: 230px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.case-passport {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-left: 1px solid var(--line);
}

.case-passport div {
  display: flex;
  min-height: 112px;
  padding: 22px 26px;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.case-passport span {
  color: var(--quiet);
  font-size: 12px;
}

.case-passport strong {
  font-size: 15px;
  font-weight: 650;
}

.case-story {
  display: grid;
  grid-template-columns: 280px minmax(0, 900px);
  justify-content: space-between;
  gap: clamp(56px, 7vw, 112px);
  width: var(--container);
  margin: 0 auto;
  padding: clamp(68px, 7vw, 108px) 0 clamp(84px, 8vw, 124px);
}

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

.case-section {
  padding: 0 0 clamp(70px, 7vw, 104px);
  scroll-margin-top: 94px;
}

.case-section:last-child { padding-bottom: 0; }

.case-section > header {
  display: flex;
  margin-bottom: 28px;
  padding-bottom: 13px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.case-section > header span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.case-section > header p {
  margin: 0;
  color: var(--quiet);
  font-size: 12px;
}

.case-section h2 {
  max-width: 760px;
  margin: 0 0 30px;
  color: var(--text);
  font-size: clamp(34px, 3.7vw, 54px);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.052em;
}

.case-prose { max-width: 760px; }

.case-prose p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.68;
}

.case-callout {
  margin: 38px 0 0;
  padding: 28px 32px;
  border: 0;
  border-left: 4px solid var(--brand);
  background: var(--soft);
  color: var(--text);
  font-size: clamp(21px, 2.1vw, 29px);
  font-weight: 600;
  line-height: 1.35;
}

.case-methods {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.case-method {
  display: grid;
  grid-template-columns: 56px 1fr;
  min-height: 150px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.case-method > span {
  padding: 24px 14px;
  border-right: 1px solid var(--line);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.case-method > div { padding: 24px 26px; }

.case-method h3 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.25;
}

.case-method p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.case-section--result {
  margin-bottom: clamp(70px, 7vw, 104px);
  padding: 36px 38px 64px;
  background: var(--brand-deep);
  color: var(--white);
}

.case-section--result > header { border-color: var(--white-16); }
.case-section--result > header span { color: #7ba2ff; }
.case-section--result h2 { color: var(--white); }

.case-result-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 34px;
  padding: 0 0 30px;
  gap: 24px;
  border-bottom: 1px solid var(--white-16);
}

.case-result-facts div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.case-result-facts strong {
  color: #7ba2ff;
  font-size: 34px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.045em;
}

.case-result-facts span {
  color: var(--white-76);
  font-size: 12px;
  line-height: 1.4;
}

.case-section--result .case-prose p { color: var(--white-76); }

.case-quote {
  margin: 40px 0 0;
  padding: 28px;
  border: 1px solid var(--white-16);
  background: rgba(255, 255, 255, 0.06);
}

.case-quote blockquote {
  margin: 0 0 20px;
  color: var(--white);
  font-size: clamp(21px, 2.2vw, 30px);
  font-weight: 600;
  line-height: 1.4;
}

.case-quote figcaption {
  color: var(--white-76);
  font-size: 12px;
}

.case-insights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.case-insight {
  display: flex;
  min-height: 220px;
  padding: 26px;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.case-insight > span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.case-insight p {
  margin: 30px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 550;
  line-height: 1.48;
}

.case-insight--lesson { background: var(--soft); }

.case-toc {
  position: sticky;
  top: 88px;
  display: flex;
  max-height: calc(100vh - 104px);
  align-self: start;
  padding: 0 8px 0 24px;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border-left: 1px solid var(--line);
}

.case-toc > span {
  margin-bottom: 14px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 650;
}

.case-toc a {
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
  transition: color 160ms ease, transform 160ms ease;
}

.case-toc a:hover,
.case-toc a.is-active {
  color: var(--brand);
  transform: translateX(4px);
}

.case-toc__cta {
  margin-top: 22px;
  padding: 14px !important;
  background: var(--brand);
  color: var(--white) !important;
  font-weight: 650;
}

.case-toc__back { margin-top: 10px; }

.case-cta {
  padding: clamp(68px, 7vw, 104px) max(32px, calc((100vw - 1440px) / 2));
  background: var(--brand);
  color: var(--white);
}

.case-cta > span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.case-cta h2 {
  max-width: 980px;
  margin: 24px 0 20px;
  font-size: clamp(40px, 5.2vw, 74px);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.06em;
}

.case-cta h2 em {
  color: var(--white);
  font-style: normal;
}

.case-cta p {
  max-width: 700px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  line-height: 1.55;
}

.case-cta > a {
  display: inline-flex;
  min-height: 50px;
  margin-top: 26px;
  padding: 0 18px;
  align-items: center;
  gap: 30px;
  background: var(--white);
  color: var(--brand-deep);
  font-size: 14px;
  font-weight: 650;
}

.case-related {
  width: var(--container);
  margin: 0 auto;
  padding: clamp(68px, 7vw, 104px) 0;
}

.case-related > header {
  display: flex;
  margin-bottom: 28px;
  align-items: end;
  justify-content: space-between;
}

.case-related > header span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.case-related h2 {
  margin: 0;
  font-size: clamp(32px, 3.2vw, 46px);
  letter-spacing: -0.05em;
}

.case-related > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.case-related > div > a {
  display: flex;
  min-height: 320px;
  padding: 26px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background 160ms ease;
}

.case-related > div > a:hover { background: var(--soft); }

.case-related__mark {
  width: 122px;
  height: 46px;
  margin-bottom: 34px;
}

.case-related__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.case-related small {
  color: var(--quiet);
  font-size: 12px;
}

.case-related strong {
  margin-top: 5px;
  font-size: 18px;
}

.case-related p {
  margin: 20px 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.48;
}

.case-related > div > a > span {
  margin-top: auto;
  align-self: end;
  color: var(--brand);
  font-size: 24px;
}

.case-not-found {
  width: min(700px, calc(100% - 40px));
  margin: 15vh auto;
}

@media (max-width: 1100px) {
  .case-site-header { grid-template-columns: 1fr auto; }
  .case-site-header nav { display: none; }
  .case-story { grid-template-columns: 1fr; }
  .case-toc { display: none; }
}

@media (max-width: 720px) {
  :root { --container: calc(100vw - 36px); }

  .case-site-header {
    min-height: 64px;
    padding: 0 18px;
  }

  .case-logo { font-size: 17px; }

  .case-header-cta {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .case-header-cta span { font-size: 18px; }

  .case-hero { padding-top: 30px; }
  .case-breadcrumb { margin-bottom: 22px; }

  .case-company {
    margin-bottom: 22px;
    align-items: flex-start;
  }

  .case-company__mark {
    width: 112px;
    height: 52px;
  }

  .case-company strong { font-size: 14px; }
  .case-company small { font-size: 12px; }

  .case-hero__card-copy {
    margin-bottom: 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
  }

  .case-hero h1 {
    font-size: 30px;
    overflow-wrap: normal;
    line-height: 1.02;
  }

  .case-hero__summary {
    margin: 22px 0 32px;
    font-size: 17px;
  }

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

  .case-facts article {
    min-height: 126px;
    padding: 18px;
  }

  .case-facts strong { font-size: 28px; }
  .case-facts span { font-size: 12px; }

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

  .case-passport div {
    min-height: 88px;
    padding: 18px;
  }

  .case-story { padding: 62px 0 76px; }
  .case-section { padding-bottom: 66px; }
  .case-section h2 { font-size: 34px; }
  .case-prose p { font-size: 16px; line-height: 1.65; }

  .case-callout {
    margin-top: 28px;
    padding: 22px;
    font-size: 21px;
  }

  .case-method { grid-template-columns: 44px 1fr; }
  .case-method > span { padding-inline: 10px; }
  .case-method > div { padding: 22px 18px; }
  .case-method h3 { font-size: 19px; }
  .case-method p { font-size: 15px; }

  .case-section--result {
    width: calc(100% + 36px);
    margin-left: -18px;
    padding: 28px 18px 58px;
  }

  .case-result-facts { grid-template-columns: 1fr; }
  .case-result-facts strong { font-size: 30px; }
  .case-insights { grid-template-columns: 1fr; }
  .case-insight { min-height: 176px; padding: 22px; }
  .case-insight p { font-size: 17px; }

  .case-cta { padding: 64px 18px; }
  .case-cta h2 { font-size: 40px; }
  .case-cta p { font-size: 15px; }

  .case-related { padding: 62px 0; }

  .case-related > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .case-related > div { grid-template-columns: 1fr; }
  .case-related > div > a { min-height: 272px; padding: 22px; }
  .case-related p { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
