.case-page {
  --case-rule: #d8d5ce;
  --case-dot-hover: #a7a49d;
  --case-placeholder: #f1efe9;
  --case-content-width: 44rem;
}

@media (prefers-color-scheme: dark) {
  .case-page {
    --case-rule: #49463f;
    --case-dot-hover: #88857e;
    --case-placeholder: #262420;
  }
}

.case-shell {
  max-width: 1440px;
  margin-inline: auto;
  padding: 0 24px 24px;
}

.case-page a {
  color: var(--color-secondary);
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.case-page a:hover,
.case-page a[aria-current="location"] {
  color: var(--color-text);
  text-decoration-line: underline;
}

.case-page a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}

.case-page :is(h1, h2)[tabindex="-1"]:focus {
  outline: none;
}

.case-skip-link {
  position: fixed;
  top: 8px;
  left: 24px;
  z-index: 2;
  padding: 12px;
  background: var(--color-background);
  transform: translateY(-200%);
}

.case-skip-link:focus {
  transform: translateY(0);
}

.case-site-header,
.case-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-block: 16px;
  border-bottom: 1px solid var(--case-rule);
}

.case-site-header a,
.case-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.case-intro {
  padding-block: 48px 32px;
}

.case-intro,
.case-story {
  width: 100%;
  max-width: var(--case-content-width);
  min-width: 0;
}

.case-intro h1 {
  margin: 0;
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-wrap: balance;
}


.case-lead {
  margin: 24px 0 0;
  max-width: var(--case-content-width);
  font-size: 1.25rem;
  color: var(--color-secondary);
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  margin: 32px 0 0;
  color: var(--color-secondary);
  font-size: 1rem;
}

.case-meta dt {
  margin-bottom: 4px;
}

.case-meta dd {
  margin: 0;
}

.case-toc {
  padding-block: 8px 32px;
}

.case-toc__title {
  display: none;
}

.case-toc ol {
  display: grid;
  gap: 4px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-toc a {
  display: block;
  padding-block: 8px;
  line-height: 1.35;
}

.case-section {
  padding-bottom: 48px;
  scroll-margin-top: 32px;
}

.case-section h2 {
  max-width: var(--case-content-width);
  margin: 0 0 24px;
  font-size: clamp(1.875rem, 3vw, 2.5rem);
  text-wrap: balance;
}

.case-section h3 {
  max-width: var(--case-content-width);
  margin: 40px 0 20px;
  font-size: 1.5rem;
}

.case-section > p {
  max-width: var(--case-content-width);
  margin: 0 0 20px;
}

.case-illustration {
  margin: 28px 0 36px;
}

.case-illustration picture,
.case-illustration img {
  display: block;
  width: 100%;
}

.case-illustration img {
  height: auto;
}

.case-illustration figcaption {
  margin-top: 12px;
  color: var(--color-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

.case-illustration--flow img {
  max-width: 400px;
  margin-inline: auto;
  color-scheme: light dark;
}

.case-section strong {
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: var(--case-rule);
  text-underline-offset: 4px;
}

.case-footer {
  margin-top: 16px;
  padding-block: 24px;
  border-top: 1px solid var(--case-rule);
  border-bottom: 0;
}

@media (min-width: 600px) {
  .case-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .case-shell {
    padding-inline: 48px;
  }

  .case-layout {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    column-gap: 48px;
  }

  .case-intro {
    grid-column: 2;
    grid-row: 1;
    padding-block: 56px 48px;
  }


  .case-lead {
    font-size: 1.375rem;
  }

  .case-meta {
    font-size: 1.125rem;
  }

  .case-gallery {
    grid-column: 2;
    grid-row: 2;
  }

  .case-toc {
    grid-column: 1;
    grid-row: 2 / 4;
    position: sticky;
    top: 24px;
    align-self: start;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 0 8px 8px 0;
  }

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

  .case-story {
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
    font-size: 1.25rem;
  }

  .case-section {
    padding-bottom: 64px;
  }
}

@media (min-width: 1280px) {
  .case-shell {
    padding-inline: 64px;
  }

  .case-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    column-gap: 80px;
  }
}

.case-gallery {
  width: 100%;
  max-width: var(--case-content-width);
  min-width: 0;
  margin-bottom: 56px;
  scroll-margin-top: 32px;
}

.case-gallery h2 {
  margin: 0 0 24px;
  font-size: clamp(1.875rem, 3vw, 2.5rem);
  text-wrap: balance;
}

.case-gallery [hidden] {
  display: none !important;
}

.case-gallery__formats {
  display: flex;
  justify-content: flex-start;
  gap: 32px;
  margin-bottom: 16px;
}

.case-gallery__format {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--color-secondary);
  cursor: pointer;
}

.case-gallery__format[aria-pressed="true"] {
  border-bottom-color: currentColor;
  color: var(--color-text);
}

.case-gallery__format:hover {
  color: var(--color-text);
}

.case-gallery__format:focus-visible,
.case-gallery__arrow:focus-visible,
.case-gallery__dot:focus-visible,
.case-gallery__track:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.case-gallery__track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.case-gallery[data-enhanced] .case-gallery__track {
  scrollbar-width: none;
}

.case-gallery[data-enhanced] .case-gallery__track::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .case-gallery__track {
    scroll-behavior: smooth;
  }
}

.case-gallery__slide {
  flex: 0 0 100%;
  min-width: 0;
  aspect-ratio: 1024 / 952;
  margin: 0;
  background: #f1f1f1;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

@media (prefers-color-scheme: dark) {
  .case-gallery__slide {
    background: #0d0d0d;
  }
}

.case-gallery__image,
.case-gallery__image picture {
  display: block;
  width: 100%;
  height: 100%;
}

.case-gallery__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.case-gallery__navigation {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  margin-top: 8px;
}

.case-gallery__arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.case-gallery__arrow:disabled {
  color: var(--color-secondary);
  opacity: 0.4;
  cursor: not-allowed;
}

.case-gallery__position {
  text-align: center;
}

.case-gallery__dots {
  display: flex;
  justify-content: center;
  height: 44px;
}

.case-gallery__dot {
  display: grid;
  place-items: center;
  width: 16px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--case-rule);
  cursor: pointer;
}

.case-gallery__dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.case-gallery__dot:hover {
  color: var(--case-dot-hover);
}

.case-gallery__dot[aria-current="true"] {
  color: var(--color-text);
}

.case-gallery__counter {
  display: block;
  margin-top: 0;
  color: var(--color-secondary);
  font-size: 0.875rem;
  line-height: 1.2;
}

.case-gallery[data-format="phone"] .case-gallery__slide {
  background: transparent;
}

@media (max-width: 600px) {
  .case-gallery__formats {
    gap: 24px;
  }
}

@media (max-width: 599px) {
  .case-footer {
    padding-bottom: 12px;
  }

  .case-toc__title {
    display: block;
    margin: 0 0 16px;
    font-size: 1.875rem;
    text-wrap: balance;
  }

  .case-gallery__arrow {
    display: none;
  }
}
