/* Maze diffusion case study */

:root {
  color-scheme: dark;
}

body {
  min-height: 100svh;
  background: var(--c-bg-deep);
}

.maze-study {
  overflow-x: clip;
}

.maze-hero {
  position: relative;
  display: grid;
  height: 100svh;
  min-height: 46rem;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: center;
  overflow: clip;
  padding-block: 1.35rem 1.5rem;
  background:
    radial-gradient(
      circle at 76% 42%,
      rgba(0, 166, 214, 0.16),
      transparent 31rem
    ),
    linear-gradient(
      180deg,
      rgba(31, 37, 46, 0.97),
      rgba(23, 28, 35, 0.99)
    );
  border-bottom: 1px solid rgba(217, 240, 246, 0.08);
  isolation: isolate;
}

.maze-hero::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  opacity: 0.28;
  background-image:
    linear-gradient(
      rgba(217, 240, 246, 0.025) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(217, 240, 246, 0.025) 1px,
      transparent 1px
    );
  background-size: 5rem 5rem;
  mask-image:
    radial-gradient(
      circle at 74% 42%,
      black,
      transparent 72%
    );
}

.maze-hero::after {
  position: absolute;
  right: -8rem;
  bottom: -18rem;
  z-index: -1;
  width: 40rem;
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(110, 187, 213, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 5rem rgba(0, 166, 214, 0.025),
    0 0 0 10rem rgba(0, 166, 214, 0.018);
}

.maze-hero__top,
.maze-hero__grid,
.maze-hero__facts {
  width: min(94vw, 92rem);
  max-width: none;
}

.maze-hero__top {
  display: flex;
  justify-content: flex-end;
  color: var(--c-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.maze-hero__grid {
  display: grid;
  grid-template-columns:
    minmax(26rem, 0.84fr)
    minmax(36rem, 1.16fr);
  gap: clamp(3rem, 5vw, 5.5rem);
  align-items: center;
}

.maze-hero__copy {
  display: grid;
  min-width: 0;
  gap: var(--sp-4);
  justify-items: start;
}

.maze-hero h1 {
  max-width: 12ch;
  font-size: clamp(3rem, 4.6vw, 4.8rem);
  line-height: 0.99;
  text-wrap: balance;
}

.maze-hero__copy .lead {
  max-width: 39rem;
  font-size: clamp(1rem, 1.35vw, 1.18rem);
}

.maze-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.maze-tags li {
  padding: 0.44rem 0.72rem;
  color: var(--c-text-soft);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(217, 240, 246, 0.1);
  border-radius: var(--r-pill);
  font-size: var(--fs-200);
}

.maze-hero__visual {
  position: relative;
  width: min(100%, 46rem);
  overflow: hidden;
  margin: 0;
  justify-self: end;
  background: rgba(17, 24, 31, 0.76);
  border: 1px solid rgba(110, 187, 213, 0.2);
  border-radius: var(--r-xl);
  box-shadow:
    var(--sh-lg),
    0 0 3rem rgba(0, 166, 214, 0.1);
}

.maze-hero__visual video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #070d12;
  object-fit: contain;
}

.maze-hero__visual figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  color: var(--c-muted);
  font-size: var(--fs-200);
}

.maze-hero__visual figcaption strong {
  color: var(--c-main-2);
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.maze-hero__readout {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.maze-hero__readout span {
  padding: 0.36rem 0.52rem;
  color: var(--c-main-soft);
  background: rgba(23, 28, 35, 0.76);
  border: 1px solid rgba(110, 187, 213, 0.18);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: var(--fw-bold);
}

.maze-hero__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  background: rgba(38, 46, 57, 0.56);
  border: 1px solid rgba(217, 240, 246, 0.1);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}

.maze-hero__facts article {
  display: grid;
  grid-template-rows: 1.2rem minmax(2.6rem, auto);
  gap: 0.35rem;
  align-content: start;
  padding: 0.82rem 1.05rem;
}

.maze-hero__facts article + article {
  border-left: 1px solid rgba(217, 240, 246, 0.08);
}

.maze-hero__facts span,
.maze-cards span {
  color: var(--c-main-2);
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.maze-hero__facts strong {
  color: var(--c-text-soft);
  font-family: var(--font-display);
  font-size: var(--fs-200);
  line-height: 1.4;
}

.maze-section {
  position: relative;
  background:
    linear-gradient(
      180deg,
      rgba(31, 37, 46, 0.62),
      rgba(23, 28, 35, 0.95)
    );
}

.maze-section.section {
  padding-block: clamp(4.5rem, 7vw, 7rem);
}

.maze-section--surface {
  background:
    radial-gradient(
      circle at 80% 18%,
      rgba(0, 166, 214, 0.08),
      transparent 26rem
    ),
    linear-gradient(
      180deg,
      rgba(23, 28, 35, 0.98),
      rgba(31, 37, 46, 0.74)
    );
  border-block: 1px solid rgba(217, 240, 246, 0.07);
}

.maze-section__head,
.maze-outcome__grid {
  display: grid;
  grid-template-columns:
    minmax(0, 0.94fr)
    minmax(22rem, 1.06fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: center;
}

.maze-section__head > div:first-child,
.maze-outcome__grid > div {
  display: grid;
  gap: var(--sp-4);
}

.maze-section__head h2,
.maze-model h2,
.maze-result h2,
.maze-outcome h2 {
  max-width: 14ch;
  font-size: clamp(2.25rem, 3.75vw, 3.9rem);
  line-height: 1.02;
  text-wrap: balance;
}

.maze-section__head > p {
  justify-self: end;
}

.maze-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
  overflow: hidden;
  background: rgba(38, 46, 57, 0.5);
  border: 1px solid rgba(217, 240, 246, 0.1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
}

.maze-cards article {
  display: grid;
  min-height: 15rem;
  grid-template-rows: 1.4rem minmax(3.4rem, auto) auto;
  gap: var(--sp-3);
  align-content: start;
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.maze-cards article + article {
  border-left: 1px solid rgba(217, 240, 246, 0.09);
}

.maze-cards h3 {
  font-size: clamp(1.3rem, 2vw, 1.85rem);
}

.maze-cards p,
.maze-model__copy > p:not(.lead),
.maze-result__copy > p:not(.lead) {
  color: var(--c-muted);
}

.maze-geometry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5);
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.maze-media {
  overflow: hidden;
  margin: 0;
  background: rgba(38, 46, 57, 0.56);
  border: 1px solid rgba(217, 240, 246, 0.1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
}

.maze-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.maze-media figcaption {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.2rem;
  color: var(--c-muted);
  font-size: var(--fs-200);
}

.maze-media figcaption strong {
  color: var(--c-text);
  font-family: var(--font-display);
}

.maze-model,
.maze-result {
  display: grid;
  grid-template-columns:
    minmax(0, 0.92fr)
    minmax(22rem, 1.08fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: center;
}

.maze-model__copy,
.maze-result__copy {
  display: grid;
  gap: var(--sp-4);
}

.maze-equations {
  display: grid;
  gap: var(--sp-3);
  padding: clamp(1.2rem, 3vw, 2rem);
  background:
    radial-gradient(
      circle at 86% 12%,
      rgba(0, 166, 214, 0.11),
      transparent 16rem
    ),
    rgba(38, 46, 57, 0.64);
  border: 1px solid rgba(217, 240, 246, 0.1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
}

.maze-equations article {
  display: grid;
  gap: 0.55rem;
  padding: 1rem 1.1rem;
  background: rgba(23, 28, 35, 0.55);
  border: 1px solid rgba(110, 187, 213, 0.12);
  border-radius: var(--r-md);
}

.maze-equations article > span,
.maze-equations dt {
  color: var(--c-main-2);
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  font-weight: var(--fw-bold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.maze-equations article strong {
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.9rem);
}

.maze-equations dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin: 0;
}

.maze-equations dl div {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 0.95rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(217, 240, 246, 0.08);
  border-radius: var(--r-sm);
}

.maze-equations dd {
  margin: 0;
  color: var(--c-text-soft);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
}

.maze-result {
  grid-template-columns:
    minmax(24rem, 1.12fr)
    minmax(0, 0.88fr);
}

.maze-media--result {
  width: min(100%, 43rem);
  justify-self: start;
}

.maze-outcome {
  display: grid;
  min-height: 72svh;
  align-content: center;
  background:
    radial-gradient(
      circle at 78% 32%,
      rgba(0, 166, 214, 0.1),
      transparent 28rem
    ),
    linear-gradient(
      180deg,
      rgba(31, 37, 46, 0.74),
      rgba(23, 28, 35, 0.99)
    );
  border-top: 1px solid rgba(217, 240, 246, 0.08);
}

.maze-outcome__grid {
  align-items: center;
}

.maze-outcome__copy {
  display: grid;
  gap: var(--sp-4);
}

.maze-study .page-top {
  animation: none !important;
  opacity: 1 !important;
  filter: none !important;
  translate: 0 0 !important;
  scale: 1 !important;
}

@media (max-width: 82rem) {
  .maze-hero__grid {
    grid-template-columns:
      minmax(24rem, 0.86fr)
      minmax(32rem, 1.14fr);
    gap: 2.5rem;
  }

  .maze-hero h1 {
    font-size: clamp(2.8rem, 4.4vw, 4rem);
  }
}

@media (max-width: 68rem) {
  .maze-hero {
    height: auto;
    min-height: 100svh;
    padding-block: 1rem 2.5rem;
  }

  .maze-hero__grid,
  .maze-section__head,
  .maze-model,
  .maze-result,
  .maze-outcome__grid {
    grid-template-columns: 1fr;
  }

  .maze-hero__grid {
    gap: 1.5rem;
  }

  .maze-hero__visual {
    width: min(100%, 42rem);
    justify-self: center;
  }

  .maze-section__head > p {
    justify-self: start;
  }

  .maze-media--result {
    justify-self: center;
  }
}

@media (max-width: 48rem) {
  .maze-hero {
    height: 100svh;
    min-height: 0;
    padding-block: 0.8rem 1rem;
  }

  .maze-hero__top {
    font-size: 0.58rem;
  }

  .maze-hero__copy {
    gap: 0.65rem;
  }

  .maze-hero h1 {
    max-width: none;
    font-size: clamp(2.1rem, 9.6vw, 2.95rem);
    line-height: 0.98;
  }

  .maze-hero__copy .lead {
    font-size: 0.88rem;
    line-height: 1.42;
  }

  .maze-tags {
    gap: 0.35rem;
  }

  .maze-tags li {
    padding: 0.3rem 0.48rem;
    font-size: 0.64rem;
  }

  .maze-hero__visual {
    width: min(100%, 26rem);
    border-radius: var(--r-lg);
  }

  .maze-hero__visual video {
    aspect-ratio: 16 / 9;
  }

  .maze-hero__visual figcaption {
    padding: 0.5rem 0.65rem;
    font-size: 0.66rem;
  }

  .maze-hero__readout {
    top: 0.45rem;
    right: 0.45rem;
    gap: 0.25rem;
  }

  .maze-hero__readout span {
    padding: 0.25rem 0.36rem;
    font-size: 0.48rem;
  }

  .maze-hero__facts article {
    grid-template-rows: 1rem minmax(2.1rem, auto);
    padding: 0.5rem 0.42rem;
  }

  .maze-hero__facts span {
    font-size: 0.5rem;
  }

  .maze-hero__facts strong {
    font-size: 0.6rem;
    line-height: 1.28;
  }

  .maze-section__head h2,
  .maze-model h2,
  .maze-result h2,
  .maze-outcome h2 {
    max-width: none;
    font-size: clamp(2.05rem, 10vw, 3.1rem);
  }

  .maze-cards,
  .maze-geometry {
    grid-template-columns: 1fr;
  }

  .maze-cards article + article {
    border-top: 1px solid rgba(217, 240, 246, 0.09);
    border-left: 0;
  }

  .maze-cards article {
    min-height: 12rem;
    grid-template-rows: 1.2rem auto auto;
  }

  .maze-cards,
  .maze-media,
  .maze-equations {
    border-radius: var(--r-lg);
  }

  .maze-equations dl {
    grid-template-columns: 1fr;
  }

  .maze-outcome {
    min-height: 74svh;
  }
}

.maze-equations .math-equation {
  font-size: clamp(1.25rem, 2.2vw, 1.9rem);
}

/* Mathematical fractions */

.math-equation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48em;
  align-items: center;
  color: var(--c-text) !important;
  font-family: var(--font-display) !important;
  font-size: inherit;
  font-weight: var(--fw-semibold);
  letter-spacing: normal;
  line-height: 1.25;
  text-transform: none;
}

.math-equation > span {
  color: inherit !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: none;
}

.math-frac {
  display: inline-grid;
  min-width: 2.25em;
  grid-template-rows: auto auto;
  align-items: center;
  color: inherit;
  line-height: 1;
  text-align: center;
  vertical-align: middle;
}

.math-frac > span {
  color: inherit !important;
  font-family: inherit !important;
  font-size: 0.9em !important;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.math-frac > span:first-child {
  padding: 0 0.32em 0.2em;
  border-bottom: 1.5px solid currentColor;
}

.math-frac > span:last-child {
  padding: 0.2em 0.32em 0;
}

@media (max-width: 48rem) {
  .math-equation {
    gap: 0.4em;
  }

  .math-frac {
    min-width: 2.05em;
  }
}

/* Maze governing equation */

.maze-equations article >
strong.math-equation {
  color: var(--c-text) !important;
  -webkit-text-fill-color: var(--c-text) !important;
  font-family: var(--font-display) !important;
  font-size: clamp(1.25rem, 2.2vw, 1.9rem);
  font-weight: var(--fw-semibold);
  letter-spacing: normal !important;
  text-transform: none !important;
}

.maze-equations article >
strong.math-equation span {
  color: var(--c-text) !important;
  -webkit-text-fill-color: var(--c-text) !important;
  font-family: var(--font-display) !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

.maze-equations article >
strong.math-equation .math-frac >
span:first-child {
  border-bottom-color: var(--c-text) !important;
}
