:root {
  color-scheme: light;
  color: var(--case-ink, rgb(0 0 0 / 80%));
  background: #878787;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body,
.case-page {
  background: var(--color-white);
}

.case-page {
  --case-body-heading-size: var(--heading-size);
  --case-body-heading-line-height: 1;
  --case-body-paragraph-size: var(--body-size);
  --case-body-paragraph-line-height: 1.2;
  --case-introduction-space: 64px;
  --case-copy-inset: 22px;
  --case-divider-space: 160px;
  width: min(100%, 1512px);
  margin-inline: auto;
  padding: 42px 60px;
}

.case-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  width: 100%;
  min-height: 62px;
  height: auto;
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(12px, 2.25vw, 32px);
  margin: 0 0 20px;
  padding: 0;
}

.case-header__home,
.case-header h1 {
  display: flex;
  min-width: 0;
  align-items: center;
  margin: 0;
  padding: 15px 20px;
  color: var(--color-white);
  font-size: var(--heading-size);
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none;
  white-space: normal;
}

.case-header__home {
  display: block;
  align-content: center;
  flex: 0 1 auto;
  background: var(--color-brand-gray);
}

.case-header__home--wrapped {
  width: min-content;
}

.case-header__name,
.case-header__discipline {
  white-space: nowrap;
}

.case-header__separator {
  margin-inline: 0.3em 0;
}

.case-header h1 {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-left: auto;
  background: var(--project-accent);
  text-align: right;
}

.case-header__home:focus-visible {
  outline: 3px solid #111;
  outline-offset: -3px;
}

.case-study {
  width: 100%;
  margin-inline: auto;
  overflow: hidden;
  border: var(--stroke-width) solid var(--project-accent);
  background: var(--case-surface, var(--project-tint));
}

.case-study--stacked {
  display: flex;
  flex-direction: column;
  gap: var(--case-section-gap);
}

:where(.case-study h2) {
  margin-bottom: 18px;
}

:where(.case-study p) {
  margin-bottom: 15px;
}

.case-study p {
  -webkit-hyphens: auto;
  hyphens: auto;
}

.case-study > :not(.case-introduction) :is(h2, p) {
  margin-top: 0;
}

.case-study > :not(.case-introduction) h2 {
  font-size: var(--case-body-heading-size);
  font-weight: 500;
  line-height: var(--case-body-heading-line-height);
  letter-spacing: 0;
}

.case-study > :not(.case-introduction) p {
  font-size: var(--case-body-paragraph-size);
  font-weight: 200;
  line-height: var(--case-body-paragraph-line-height);
}

.case-study > :not(.case-introduction) p:last-child {
  margin-bottom: 0;
}

.case-study > :not(.case-introduction) strong {
  font-weight: 700;
}

.case-introduction {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.62fr);
  grid-template-areas: "intro metadata";
  align-items: start;
  column-gap: clamp(48px, 8vw, 120px);
  margin-block-end: calc(
    var(--case-divider-space) - var(--case-section-gap, 0px)
  );
  padding: var(--case-introduction-space) var(--case-copy-inset) 0;
}

.case-introduction__copy {
  grid-area: intro;
}

.case-introduction__copy p + p {
  margin-top: 1em;
}

.case-introduction p {
  grid-area: intro;
  width: 100%;
  margin: 0;
  color: var(--project-accent);
  font-size: var(--case-body-heading-size);
  font-weight: 300;
  line-height: 1.6;
}

.case-introduction p strong {
  color: var(--project-tint);
  font-weight: inherit;
  text-decoration-color: var(--project-accent);
  text-decoration-line: underline;
  text-decoration-skip-ink: none;
  text-decoration-style: solid;
  text-decoration-thickness: 1.3em;
  text-underline-offset: -1em;
}

.case-metadata {
  grid-area: metadata;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-self: start;
  align-content: start;
  gap: 58px;
  width: 100%;
  margin: 0;
  padding: 0;
  color: var(--project-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.case-metadata__item {
  min-width: 0;
}

.case-metadata dt,
.case-metadata dd {
  margin: 0;
  font-size: var(--body-size);
  line-height: 1.35;
}

.case-metadata dt {
  display: block;
  font-weight: 700;
}

.case-metadata dd {
  display: block;
  font-weight: 300;
}

.case-introduction::after {
  grid-column: 1 / -1;
  display: block;
  height: var(--stroke-width);
  flex: 0 0 var(--stroke-width);
  margin: var(--case-divider-space) 0 0;
  background: var(--project-accent);
  content: "";
}

.case-back {
  display: flex;
  min-height: 246px;
  align-items: center;
  justify-content: center;
}

.case-back__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 30px;
  background: var(--project-accent);
  color: var(--color-white);
  font-size: var(--heading-size);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.case-back__link img {
  width: 24px;
  height: 22px;
  flex: 0 0 auto;
  transform: rotate(180deg);
}

.case-back__link:focus-visible {
  outline: 3px solid #111;
  outline-offset: 4px;
}

@media (max-width: 760px) {
  .case-page {
    --case-body-heading-size: 1.6rem;
    --case-body-paragraph-size: 1rem;
    --case-body-paragraph-line-height: 1.45;
    --case-divider-space: 72px;
    padding: 0;
  }

  .case-study--stacked {
    --case-introduction-mobile-padding-inline: 0px;
    padding: 0 var(--case-copy-inset) 88px;
  }

  .case-header {
    position: relative;
    min-height: 54px;
    gap: 0;
  }

  .case-header__home,
  .case-header h1 {
    max-width: 50%;
    padding: 13px 14px;
    font-size: 14px;
    line-height: 1.15;
  }

  .case-header__home {
    max-width: 60%;
  }

  .case-header__separator {
    display: none;
  }

  .case-introduction {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
    padding: var(--case-introduction-space) var(--case-introduction-mobile-padding-inline, var(--case-copy-inset)) 0;
  }

  .case-introduction p {
    margin-top: var(--case-introduction-space);
    line-height: 1.45;
  }

  .case-back {
    min-height: 160px;
    padding-inline: 14px;
  }

  .case-back__link {
    gap: 12px;
    max-width: 100%;
    padding: 15px 20px;
    font-size: clamp(17px, 5.4vw, 22px);
  }

  .case-back__link img {
    width: 20px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
