:root {
  --bg: #d6d5d5;
  --surface: #f1f1f1;
  --surface-hover: rgba(8, 8, 8, .06);
  --surface-active: rgba(8, 8, 8, .1);
  --ink: #080808;
  --hairline: #4f4f4f;
  --divider: rgba(8, 8, 8, .12);
  --accent: #f4a40f;
  --accent-bright: #ffb833;
  --warm-dark: #2d2619;
  --blue: #344cf2;
  --case-rail: 56px;
  --case-shell: 708px;
  --case-content: 644px;
  --case-text: 640px;
  --case-sidebar: 348px;
  --case-gap: 12px;
  --case-layout: calc(var(--case-rail) + var(--case-gap) + var(--case-shell) + var(--case-gap) + var(--case-sidebar));
  --case-tablet-layout: calc(var(--case-rail) + var(--case-gap) + var(--case-shell));
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.176 0 0 0 0 0.149 0 0 0 0 0.098 1 0 0 0 0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='2.6' intercept='-0.8'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.02'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

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

html::-webkit-scrollbar,
body::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  color: var(--ink);
  background: var(--bg);
  font: 400 14px/1.36 Inter, Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  position: fixed;
  content: "";
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .44;
  background-color: #d6d5d5;
  background-image:
    linear-gradient(to right, rgba(200, 200, 200, 0) 0, #c8c8c8 1px, rgba(200, 200, 200, 0) 2px),
    linear-gradient(to bottom, rgba(200, 200, 200, 0) 0, #c8c8c8 1px, rgba(200, 200, 200, 0) 2px);
  background-size: 41.16px 41.16px;
  box-shadow: inset 0 4px 120px 10px rgba(8, 8, 8, .12);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid #7594f5; outline-offset: 2px; }

.case-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 144px 24px 32px;
}

.case-layout {
  width: var(--case-layout);
  display: grid;
  grid-template-columns: var(--case-rail) var(--case-shell) var(--case-sidebar);
  align-items: start;
  gap: var(--case-gap);
}

.card,
.rail-card {
  min-width: 0;
  background-color: var(--surface);
  background-image: var(--noise);
  border: solid var(--ink);
  border-width: 1px 2px 4px 1px;
  border-radius: 4px;
  transition:
    transform 240ms ease-out,
    box-shadow 240ms ease-out;
  will-change: transform;
}

.case-rail {
  position: sticky;
  top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-sidebar {
  position: sticky;
  top: 32px;
  display: flex;
  flex-direction: column;
  gap: var(--case-gap);
  align-self: start;
  width: var(--case-sidebar);
}

.rail-back-slot {
  width: 100%;
  height: 56px;
}

.rail-card {
  width: 56px;
  overflow: hidden;
  padding: 12px;
}

.rail-back {
  color: var(--ink);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  transition:
    transform 240ms ease-out,
    box-shadow 240ms ease-out,
    color 100ms ease-in;
}

.rail-back img {
  width: 10.665px;
  height: 10.25px;
  transition:
    opacity 100ms ease-in,
    transform 100ms ease-in;
}

.rail-back span {
  display: block;
  font: 400 16px/1.2 Inter, sans-serif;
  transition:
    color 100ms ease-in,
    transform 100ms ease-in;
}

.case-sidebar .rail-back {
  width: 100%;
  padding: 12px 20px;
}

.menu-card {
  position: relative;
  z-index: 1;
  height: 301px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.brand-mark,
.icon-link,
.language-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  transition: background-color 100ms ease-in;
}

.brand-mark {
  position: relative;
}

.brand-mark img,
.icon-link.is-active img {
  width: 32px;
  height: 32px;
}

.brand-mark__fallback {
  display: block;
}

.brand-mark__animation {
  display: none;
  width: 28px;
  height: 28px;
  pointer-events: none;
}

.brand-mark__animation svg {
  display: block;
  width: 28px;
  height: 28px;
}

.brand-mark.is-lottie-ready .brand-mark__fallback { display: none; }
.brand-mark.is-lottie-ready .brand-mark__animation { display: block; }

.icon-link img {
  width: 24px;
  height: 24px;
}

.menu-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.language-button {
  padding: 0;
  border: 0;
  color: rgba(8, 8, 8, .42);
  background: transparent;
  font: 500 16px/1.2 Inter, sans-serif;
  cursor: pointer;
  margin-top: auto;
}

.social-card {
  position: relative;
  z-index: 2;
  height: 193px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.social-card :is(a, button),
.social-card span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  transition:
    transform 240ms ease-out,
    filter 240ms ease-out;
}

.social-card :is(a, button) {
  padding: 0;
  border: 0;
  background: transparent;
}

.social-card button {
  color: inherit;
  cursor: pointer;
}

.social-card :is(a, button):nth-child(1) span { background: #010100; }
.social-card :is(a, button):nth-child(2) span { background: #0c64ba; }
.social-card :is(a, button):nth-child(3) span { background: var(--blue); }
.social-card :is(a, button):nth-child(4) span { background: rgba(210, 210, 209, .88); }

.social-card :is(a, button):nth-child(1) img { width: 23px; height: 23px; }
.social-card :is(a, button):nth-child(2) img { width: 16px; height: 16px; }
.social-card :is(a, button):nth-child(3) img { width: 21px; height: 16px; }
.social-card :is(a, button):nth-child(4) img { width: 20px; height: 17px; }

.sound-toggle {
  width: 56px;
  height: 61px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px;
}

.sound-toggle__icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: background-color 100ms ease-in;
}

.sound-toggle img {
  width: 20px;
  height: 20px;
}

.snackbar {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 100;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 12px 12px;
  color: var(--ink);
  background: var(--surface);
  border: solid var(--ink);
  border-width: 1px 2px 4px 1px;
  border-radius: 4px;
  box-shadow: 1px 1px 0 var(--ink);
  font: 400 14px/1.36 Inter, Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease-out,
    transform 160ms ease-out;
}

.snackbar[hidden] { display: none; }

.snackbar.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: hover) and (pointer: fine) {
  .card:not(.case-main):hover,
  .rail-card:hover,
  .summary-box:hover,
  .stat-card:hover,
  .scope-grid div:hover,
  .decision-grid div:hover,
  .updates-grid article:hover,
  .limits-decision-list article:hover,
  .image-frame:hover,
  .result-hero:hover,
  .result-grid div:hover {
    box-shadow: 1px 1px 0 var(--ink);
    transform: translate(-1px, -1px);
  }

  .icon-link:hover,
  .language-button:hover { background: var(--surface-hover); }

  .rail-back:hover {
    color: #4d4d4d;
  }

  .rail-back:hover img {
    opacity: .72;
  }

  .social-card :is(a, button):hover span {
    filter: brightness(1.08);
    transform: translateY(-2px);
  }

  .social-card :is(a, button):nth-child(4):hover span {
    background: var(--surface-hover);
    filter: none;
  }

  .sound-toggle__icon:hover {
    background: var(--surface-hover);
  }

  .rail-back-slot:hover .rail-back {
    box-shadow: 1px 1px 0 var(--ink);
    transform: translate(-1px, -1px);
  }
}

.icon-link:active,
.language-button:active { background: var(--surface-active); }

.social-card :is(a, button):nth-child(4):active span {
  background: var(--surface-active);
}

.sound-toggle__icon:active {
  background: var(--surface-active);
}

.case-main {
  width: var(--case-shell);
  overflow: visible;
  padding: 24px 32px 32px;
}

h1, h2, h3, p, figure { margin: 0; }

h1 {
  width: var(--case-content);
  font: 400 44px/1.1 Manrope, sans-serif;
  letter-spacing: 0;
}

.case-section {
  width: var(--case-content);
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid var(--divider);
}

.case-section h2 {
  margin-bottom: 20px;
  font: 400 32px/1.32 Manrope, sans-serif;
  letter-spacing: 0;
}

.case-section > p,
.text-stack {
  width: var(--case-text);
}

.case-section p,
.summary-box p {
  font: 400 14px/1.36 Inter, sans-serif;
}

.text-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hypothesis-copy {
  width: var(--case-content);
}

.hypothesis-copy p {
  font: 400 14px/1.36 Inter, sans-serif;
}

.case-hero {
  width: var(--case-content);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tags {
  width: var(--case-content);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tags span {
  padding: 4px 8px 6px;
  border: .6px solid var(--hairline);
  border-radius: 4px;
  background: rgba(255, 255, 255, .4);
  font: 400 12px/1.2 Manrope, sans-serif;
  white-space: nowrap;
}

.image-frame {
  position: relative;
  overflow: hidden;
  border: .6px solid var(--hairline);
  border-radius: 4px;
  background: #d4d4d4;
  transition:
    transform 240ms ease-out,
    box-shadow 240ms ease-out;
  will-change: transform;
}

.hero-shot {
  width: var(--case-content);
  height: 380px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-shot img {
  display: block;
  width: 596px;
  height: auto;
  aspect-ratio: 596 / 330;
  object-fit: contain;
  object-position: center;
}

.metric {
  position: absolute;
  right: 13px;
  bottom: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 16px 20px;
  overflow: hidden;
  border-radius: 16px;
  color: var(--warm-dark);
  background: var(--accent-bright);
  box-shadow: 0 2px 56px 1px rgba(45, 38, 25, .08);
}

.metric strong {
  font: 600 44px/1.05 Inter, sans-serif;
  white-space: nowrap;
}

.metric span {
  opacity: .8;
  font: 500 14px/1.2 Inter, sans-serif;
  text-align: center;
}

.case-page--limits .hero-shot .metric {
  color: var(--accent-bright);
  background: var(--warm-dark);
}

.summary-box {
  width: var(--case-content);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 20px 32px;
  border: .6px solid var(--hairline);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255,255,255,.4), rgba(255,255,255,.4)),
    rgba(255, 184, 51, .08);
  transition:
    transform 240ms ease-out,
    box-shadow 240ms ease-out;
  will-change: transform;
}

.summary-box h2 {
  font: 400 20px/1.12 Manrope, sans-serif;
}

.summary-box--plain {
  background: rgba(255, 255, 255, .4);
}

.summary-box--plain p + p {
  margin-top: 12px;
}

.stats-grid,
.scope-grid,
.result-grid {
  width: var(--case-content);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stats-grid,
.scope-grid {
  gap: 8px;
}

.stat-card,
.scope-grid div,
.result-grid div,
.decision-grid div,
.updates-grid article,
.limits-decision-list article {
  border: .6px solid var(--hairline);
  border-radius: 4px;
  background: rgba(255, 255, 255, .4);
  transition:
    transform 240ms ease-out,
    box-shadow 240ms ease-out;
  will-change: transform;
}

.stat-card {
  padding: 12px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.stat-card strong {
  display: block;
  font: 600 32px/1.32 Manrope, sans-serif;
}

.stat-card span {
  display: block;
  margin-top: 2px;
  color: rgba(8, 8, 8, .8);
  font: 400 12px/1.36 Inter, sans-serif;
}

.scope-grid div {
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.scope-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}

.updates-grid h3,
.decision-grid h3 {
  display: block;
  font: 400 20px/1.12 Manrope, sans-serif;
}

.scope-grid b {
  display: block;
  max-width: 190px;
  color: var(--ink);
  font: 500 14px/1.32 Manrope, sans-serif;
}

.scope-grid span {
  display: block;
  margin-top: 2px;
  max-width: 190px;
  color: rgba(6, 2, 11, .8);
  font: 400 12px/1.36 Inter, sans-serif;
}

.work-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.work-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.work-item p {
  width: var(--case-text);
}

.work-item .image-frame {
  width: var(--case-content);
  max-height: 260px;
}

.work-item .balance-work-shot {
  width: var(--case-content);
  height: 148px;
  max-height: none;
  background: #d4d4d4;
}

.work-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-item .balance-work-shot img {
  position: absolute;
  max-width: none;
  height: auto;
  object-fit: cover;
}

.work-item .balance-work-shot--research img {
  top: -52px;
  left: 0;
  width: 100%;
}

.work-item .balance-work-shot--draft img {
  top: 11px;
  left: 32px;
  width: calc(100% + 11px);
}

.work-item .balance-work-shot--benchmark img {
  top: 50%;
  left: 5.28%;
  width: 89.34%;
  transform: translateY(-50%);
}

.work-item .balance-work-shot--sync img {
  top: -6px;
  left: 0;
  width: 100%;
}

.decision-grid {
  width: var(--case-content);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 4px;
  align-items: stretch;
}

.decision-grid div {
  padding: 16px 16px 20px;
  border: .6px solid var(--hairline);
  box-shadow: none;
}

.decision-grid div:nth-child(odd) {
  background: #f1f1f1;
}

.decision-grid div:nth-child(even) {
  background: rgba(255, 255, 255, .4);
}

.decision-grid div:nth-child(-n+2) {
  padding: 16px 16px 20px;
}

.decision-grid p,
.updates-grid p {
  margin-top: 0;
}

.decision-grid h3 {
  width: 100%;
  font: 400 20px/1.12 Manrope, sans-serif;
}

.decision-grid p {
  width: 100%;
  color: rgba(8, 8, 8, .8);
  font: 400 14px/1.36 Inter, sans-serif;
}

.update-main {
  width: var(--case-content);
  height: 359px;
  margin-top: 20px;
}

.update-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Плашки «до/после» поверх картинки — версткой, чтобы переводились.
   Размеры — из макета 693:58671 (масштаб 644/1388 ≈ 0.464) */

.update-plates {
  position: absolute;
  left: 9px;
  bottom: 15px;
  display: flex;
  gap: 6px;
}

.update-plate {
  position: relative;
  width: 219px;
  height: 75px;
  padding: 11px 12px 13px;
  overflow: hidden;
  border: .6px solid rgba(4, 28, 17, .44);
  border-radius: 12px;
  background: #fff;
}

.update-plate--before {
  background: linear-gradient(rgba(243, 103, 99, .02), rgba(243, 103, 99, .02)), #fff;
}

.update-plate--after {
  background: linear-gradient(rgba(89, 225, 161, .12), rgba(89, 225, 161, .12)), #fff;
}

.update-plate b {
  display: block;
  color: #393636;
  font: 500 15px/1.2 Inter, sans-serif;
}

.update-plate--after b {
  color: #041c11;
}

.update-plate span {
  display: block;
  margin-top: 4px;
  max-width: 170px;
  color: rgba(8, 8, 8, .8);
  font: 400 11px/1.32 Inter, sans-serif;
}

.update-plate em {
  position: absolute;
  top: 9px;
  right: 12px;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
}

.case-page--limits .limits-interface-shot {
  width: var(--case-content);
  /* В PNG вшиты пустые поля (60px сверху, 105px снизу из 845):
     контент 680px → 596 × 680 / 1324 ≈ 306px + паддинги 24 */
  height: 354px;
  max-height: none;
  margin-top: 0;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-page--limits .limits-states-map {
  height: 148px;
}

.case-page--limits .limits-states-map img {
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.case-page--limits .limits-interface-shot img {
  display: block;
  width: 100%;
  max-width: 596px;
  height: 100%;
  max-height: none;
  object-fit: cover;
  /* 36.5% — срез смещён вверх: сверху пустого поля меньше, чем снизу */
  object-position: center 36.5%;
  transform: none;
}

.case-page--limits #scope > .text-stack {
  margin-top: 12px;
}

.case-page--limits #work .limits-decision-list {
  margin-top: -8px;
}

.case-page--limits #results > .text-stack {
  margin-top: 20px;
}

.updates-grid {
  width: var(--case-content);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.updates-grid article {
  padding: 16px 20px 20px;
}

.updates-grid h3 {
  max-width: 212px;
  font: 400 16px/1.32 Manrope, sans-serif;
}

.case-page--limits .limits-decision-list {
  width: var(--case-content);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-page--limits .limits-decision-list article {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 16px 20px;
  overflow: hidden;
  background: #f1f1f1;
}

.case-page--limits .limits-decision-list h3 {
  max-width: none;
  width: 100%;
  font: 500 16px/1.2 Inter, sans-serif;
}

.case-page--limits .limits-decision-list p {
  width: 100%;
  margin: 0;
  color: rgba(8, 8, 8, .72);
  font: 400 14px/1.36 Inter, sans-serif;
}

.updates-grid img {
  width: 100%;
  height: 108px;
  margin-top: 12px;
  border: .6px solid var(--hairline);
  border-radius: 4px;
  background: #f0f0f0;
  object-fit: cover;
}

.result-hero {
  width: var(--case-content);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 24px 32px;
  overflow: hidden;
  border-radius: 4px;
  color: var(--accent-bright);
  background: var(--warm-dark);
  transition:
    transform 240ms ease-out,
    box-shadow 240ms ease-out;
  will-change: transform;
}

.result-hero span {
  display: block;
  font: 400 16px/1.4 Inter, sans-serif;
}

.result-hero strong {
  display: block;
  margin-top: 12px;
  font: 600 64px/1.05 Inter, sans-serif;
}

.case-page--limits .result-hero strong {
  font-size: 44px;
}

.case-page--limits .result-hero {
  align-items: flex-start;
}

.case-page--limits .result-hero mark {
  align-self: flex-start;
  display: inline-flex;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.result-hero mark {
  height: max-content;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--warm-dark);
  background: var(--accent-bright);
  font: 500 16px/1.2 Inter, sans-serif;
}

.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
  margin-bottom: 20px;
}

.result-grid div {
  min-height: 137px;
  padding: 24px 24px 32px;
}

.result-grid span {
  display: block;
  opacity: .8;
  font: 400 16px/1.4 Inter, sans-serif;
}

.result-grid strong {
  display: block;
  margin-top: 12px;
  font: 600 44px/1.2 Inter, sans-serif;
}

.result-grid em {
  color: rgba(8, 8, 8, .8);
  font-style: normal;
  font-weight: 400;
}

.result-grid mark {
  padding: 0;
  color: var(--accent-bright);
  background: transparent;
}

.toc-card {
  width: var(--case-sidebar);
  min-height: auto;
  padding: 24px 28px 32px;
  overflow: hidden;
}

.toc-card h2 {
  font: 400 24px/1.2 Manrope, sans-serif;
}

.toc-card nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-right: 24px;
}

.toc-card a {
  font: 400 14px/1.36 Inter, sans-serif;
  color: rgba(8, 8, 8, .72);
  transition: color 100ms ease-in;
}

.toc-card a.is-active {
  color: var(--ink);
}

.toc-progress {
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
}

.toc-progress::before {
  position: absolute;
  content: "";
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  border-radius: 0;
  background: var(--divider);
}

.toc-progress span {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: var(--toc-progress, 0%);
  min-height: 0;
  border-radius: 0;
  background: var(--accent);
}

footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 20px;
  color: rgba(8, 8, 8, .42);
  font: 400 12px/1.4 Inter, sans-serif;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .case-page {
    min-height: max(100vh, 851px);
    padding: clamp(32px, calc((100vh - 794px) / 2), 144px) 24px 32px;
  }

  .case-layout { margin: 0 auto; }
}

@media (max-width: 1199px) {
  html {
    scrollbar-color: var(--ink) var(--bg);
    scrollbar-width: thin;
  }
  html::-webkit-scrollbar {
    display: block;
    width: 4px;
  }
  html::-webkit-scrollbar-track {
    background: var(--bg);
  }
  html::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: var(--ink);
  }
  .case-page { padding: 32px; }
  .case-layout {
    width: var(--case-tablet-layout);
    display: grid;
    grid-template-columns: var(--case-rail) var(--case-shell);
    grid-template-rows: auto auto;
    gap: var(--case-gap);
  }
  .hero-shot img {
    width: 100%;
    height: 100%;
  }
  .case-rail {
    grid-column: 1;
    grid-row: 1 / span 2;
    position: static;
    top: auto;
    display: flex;
    flex-direction: column;
    gap: var(--case-gap);
  }
  .menu-card {
    width: 56px;
    height: 301px;
    flex-direction: column;
  }
  .menu-links {
    flex-direction: column;
    margin-top: 24px;
  }
  .social-card {
    width: 56px;
    height: 193px;
    flex-direction: column;
    gap: 12px;
  }
  .sound-toggle {
    width: 56px;
    height: 61px;
  }
  .social-card :is(a, button) { flex: 0 0 32px; }
  .social-card span { width: 32px; }
  .case-main {
    grid-column: 2;
    grid-row: 2;
    width: var(--case-shell);
  }
  .case-sidebar {
    grid-column: 2;
    grid-row: 1;
    position: static;
    top: auto;
    z-index: auto;
    width: var(--case-shell);
  }
  .toc-card {
    min-height: auto;
    width: var(--case-shell);
  }
  .toc-card nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-right: 0;
  }
  .toc-progress {
    display: none;
  }
}

@media (min-width: 1200px) and (max-height: 620px) {
  .case-rail,
  .case-sidebar {
    position: static;
    top: auto;
  }
}

@media (max-width: 839px) {
  .case-page { padding: 16px 8px 32px; }
  .case-layout {
    width: min(var(--case-shell), calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .case-rail {
    display: contents;
  }
  .menu-card {
    order: 1;
    position: relative;
    top: auto;
    z-index: auto;
    width: 100%;
    min-height: 56px;
    height: 56px;
    flex-direction: row;
    justify-content: space-between;
  }
  .menu-links {
    flex-direction: row;
    margin-top: 0;
  }
  .language-button { margin-top: 0; }
  .social-card {
    order: 2;
    width: 100%;
    height: 56px;
    flex-direction: row;
    gap: 12px;
  }
  .social-card :is(a, button) { flex: 1 1 0; }
  .social-card span { width: 100%; }
  .sound-toggle {
    display: none;
  }
  .case-main,
  .case-sidebar,
  .toc-card,
  .case-hero,
  .case-section,
  h1,
  .tags,
  .hero-shot,
  .summary-box,
  .stats-grid,
  .scope-grid,
  .decision-grid,
  .updates-grid,
  .limits-decision-list,
  .result-hero,
  .result-grid,
  .case-section > p,
  .text-stack,
  .work-item p,
  .work-item .image-frame,
  .update-main {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .case-main,
  .case-sidebar,
  .toc-card {
    width: 100%;
    max-width: 100%;
  }
  .case-sidebar {
    order: 3;
    position: static;
    top: auto;
    z-index: auto;
  }
  .rail-back {
    width: 100%;
    height: 56px;
    padding: 12px 20px;
  }
  .toc-card {
    height: auto;
    min-height: 0;
    padding: 16px 20px 20px;
  }
  .toc-card nav {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .case-main {
    order: 4;
    overflow-x: hidden;
    padding: 24px 20px 32px;
  }
  .case-main > *,
  .case-section > *,
  .case-hero > * {
    max-width: 100%;
  }
  h1 {
    font-size: clamp(30px, 8.8vw, 36px);
    line-height: 1.12;
    overflow-wrap: anywhere;
  }
  .hero-shot {
    height: auto;
    padding: 24px;
    aspect-ratio: 644 / 380;
  }
  .hero-shot img {
    width: 100%;
    height: auto;
    aspect-ratio: 596 / 330;
    object-fit: contain;
  }
  .result-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .result-hero mark {
    order: -1;
    align-self: flex-start;
    display: inline-flex;
    padding: 8px 12px;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
  }
  .stats-grid,
  .scope-grid,
  .decision-grid,
  .updates-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }
  .decision-grid {
    gap: 0;
  }
  .decision-grid div:nth-child(-n+2) {
    display: none;
  }
  .decision-grid div:nth-child(n+4) {
    margin-top: 4px;
  }
  .decision-grid div:nth-child(odd):nth-child(n+5) {
    margin-top: 16px;
  }
  .decision-grid div:nth-child(n+3) {
    padding-top: 16px;
  }
  .decision-grid div:nth-child(n+3)::before {
    display: block;
    margin-bottom: 16px;
    color: var(--ink);
    font: 400 20px/1.12 Manrope, sans-serif;
  }
  .decision-grid div:nth-child(odd)::before {
    content: "Триггер";
  }
  .decision-grid div:nth-child(even)::before {
    content: "Как решали";
  }
  .scope-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  }
  .toc-card nav { grid-template-columns: 1fr; }

  .snackbar {
    left: 50%;
    bottom: 16px;
    width: max-content;
    max-width: calc(100vw - 16px);
    text-align: center;
    transform: translate(-50%, 8px);
  }

  .snackbar.is-visible {
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
