/* Monte Carlo case study */

:root {
  color-scheme: dark;
}

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

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

.mc-study main > section:not(:first-of-type) > .site {
  animation: none !important;
}

/* Hero */

.mc-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;
}

.mc-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%
    );
}

.mc-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);
}

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

.mc-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;
}

.mc-hero__grid {
  display: grid;
  grid-template-columns:
    minmax(25rem, 0.82fr)
    minmax(38rem, 1.18fr);
  gap: clamp(3rem, 5vw, 5.5rem);
  align-items: center;
}

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

.mc-hero h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 4.5vw, 4.9rem);
  line-height: 0.99;
  text-wrap: balance;
}

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

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

.mc-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);
}

.mc-hero-media {
  position: relative;
  display: grid;
  width: min(100%, 46rem);
  overflow: hidden;
  margin: 0;
  justify-self: end;
  background: rgba(17, 24, 31, 0.78);
  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);
}

.mc-hero-media__image {
  position: relative;
  overflow: hidden;
  background: #fff;
}

.mc-hero-media__image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  object-position: center;
}

.mc-hero-media__image::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      transparent 68%,
      rgba(17, 24, 31, 0.38)
    );
}

.mc-hero-media__image > span {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  z-index: 1;
  padding: 0.38rem 0.55rem;
  color: var(--c-main-soft);
  background: rgba(23, 28, 35, 0.84);
  border: 1px solid rgba(110, 187, 213, 0.2);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.mc-hero-media figcaption {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 1rem;
  background: rgba(23, 28, 35, 0.96);
  border-top: 1px solid rgba(217, 240, 246, 0.08);
}

.mc-hero-media figcaption span {
  color: var(--c-main-2);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.mc-hero-media figcaption strong {
  color: var(--c-text-soft);
  font-family: var(--font-display);
  font-size: var(--fs-200);
  line-height: 1.35;
}

.mc-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);
}

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

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

.mc-hero__facts span,
.mc-method span,
.mc-parameters span,
.mc-feature__copy span,
.mc-results span,
.mc-equations article > 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;
}

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

/* Sections */

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

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

.mc-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);
}

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

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

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

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

.mc-method {
  display: grid;
  grid-template-columns: repeat(4, 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);
}

.mc-method article {
  display: grid;
  min-height: 16rem;
  grid-template-rows:
    1.4rem
    minmax(3.1rem, auto)
    auto;
  gap: var(--sp-3);
  align-content: start;
  padding: clamp(1.4rem, 2.4vw, 2rem);
}

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

.mc-method h3 {
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
}

.mc-method p,
.mc-feature__copy p,
.mc-results p,
.mc-outcome__copy > p:not(.lead) {
  color: var(--c-muted);
}

.mc-equations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}

.mc-equations article {
  display: grid;
  gap: var(--sp-4);
  align-content: start;
  min-height: 10rem;
  padding: 1.3rem 1.5rem;
  background: rgba(0, 166, 214, 0.05);
  border: 1px solid rgba(110, 187, 213, 0.16);
  border-radius: var(--r-lg);
}

.mc-equations strong {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
  align-items: center;
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.7rem);
}

.mc-bracket {
  display: inline-flex;
  gap: 0.35em;
  align-items: center;
}

.mc-bracket::before {
  content: "[";
}

.mc-bracket::after {
  content: "]";
}

.mc-exp {
  display: inline-flex;
  gap: 0.25em;
  align-items: center;
}

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

.math-frac > span:first-child {
  padding: 0 0.28em 0.16em;
  border-bottom: 1.4px solid currentColor;
}

.math-frac > span:last-child {
  padding: 0.16em 0.28em 0;
}

.mc-gallery {
  display: grid;
  gap: var(--sp-5);
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.mc-gallery--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mc-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);
}

.mc-media img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.mc-media figcaption {
  display: grid;
  gap: var(--sp-2);
  padding: 1rem 1.2rem;
  color: var(--c-muted);
  font-size: var(--fs-200);
  line-height: 1.55;
}

.mc-media figcaption strong {
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: var(--fs-300);
}

.mc-media--wide {
  width: min(94vw, 76rem);
  max-width: none;
  margin-top: var(--sp-5);
  margin-inline: auto;
}

.mc-parameters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--sp-5);
  overflow: hidden;
  background: rgba(38, 46, 57, 0.5);
  border: 1px solid rgba(217, 240, 246, 0.1);
  border-radius: var(--r-xl);
}

.mc-parameters article {
  display: grid;
  min-height: 10rem;
  grid-template-rows: 1.3rem 2.2rem auto;
  gap: var(--sp-3);
  align-content: center;
  padding: 1.3rem 1.5rem;
}

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

.mc-parameters strong {
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.mc-parameters small {
  color: var(--c-muted);
}

.mc-feature {
  display: grid;
  grid-template-columns:
    minmax(24rem, 1.15fr)
    minmax(0, 0.85fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: center;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.mc-media--result {
  width: min(100%, 50rem);
}

.mc-feature__copy {
  display: grid;
  overflow: hidden;
  background: rgba(38, 46, 57, 0.5);
  border: 1px solid rgba(217, 240, 246, 0.1);
  border-radius: var(--r-xl);
}

.mc-feature__copy article {
  display: grid;
  grid-template-rows: 1.3rem auto auto;
  gap: var(--sp-3);
  align-content: start;
  padding: 1.3rem 1.5rem;
}

.mc-feature__copy article + article {
  border-top: 1px solid rgba(217, 240, 246, 0.09);
}

.mc-feature__copy strong {
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
}

.mc-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--sp-5);
  overflow: hidden;
  background: rgba(38, 46, 57, 0.5);
  border: 1px solid rgba(217, 240, 246, 0.1);
  border-radius: var(--r-xl);
}

.mc-results article {
  display: grid;
  min-height: 12rem;
  grid-template-rows: 1.3rem auto 1.2rem auto;
  gap: var(--sp-2);
  align-content: center;
  padding: 1.3rem 1.5rem;
}

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

.mc-results strong {
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw, 2.4rem);
}

.mc-results small {
  color: var(--c-main-soft);
}

.mc-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);
}

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

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

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

/* Project modal */

@media (min-width: 68.001rem) {
  .is-project-embed .mc-hero {
    height: 100svh;
    min-height: 38rem;
    grid-template-rows:
      minmax(0, 1fr)
      auto;
    align-content: stretch;
    row-gap: 0.75rem;
    padding-block: 1rem 0.8rem;
  }

  .is-project-embed .mc-hero__top {
    position: absolute;
    top: 0.8rem;
    right: 3.2rem;
    z-index: 3;
    width: auto;
  }

  .is-project-embed .mc-hero__grid {
    grid-row: 1;
    height: 100%;
    min-height: 0;
    grid-template-columns:
      minmax(24rem, 0.94fr)
      minmax(30rem, 1.06fr);
    gap: clamp(1.8rem, 3vw, 3rem);
    align-self: stretch;
    align-items: center;
    padding-top: 1.1rem;
  }

  .is-project-embed .mc-hero__copy {
    gap: 0.75rem;
    align-self: center;
  }

  .is-project-embed .mc-hero h1 {
    font-size: clamp(2.75rem, 3.5vw, 3.85rem);
  }

  .is-project-embed .mc-hero__copy .lead {
    font-size: 0.96rem;
  }

  .is-project-embed .mc-tags li {
    padding: 0.35rem 0.6rem;
    font-size: 0.68rem;
  }

  .is-project-embed .mc-hero-media {
    width: min(100%, 39rem);
    height: min(51svh, 25rem);
    min-height: 0;
    grid-template-rows:
      minmax(0, 1fr)
      auto;
    align-self: center;
    justify-self: end;
  }

  .is-project-embed .mc-hero-media__image {
    min-height: 0;
  }

  .is-project-embed .mc-hero-media__image img {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .is-project-embed .mc-hero-media figcaption {
    padding: 0.52rem 0.72rem;
  }

  .is-project-embed .mc-hero-media figcaption span {
    font-size: 0.5rem;
  }

  .is-project-embed .mc-hero-media figcaption strong {
    font-size: 0.63rem;
  }

  .is-project-embed .mc-hero__facts {
    grid-row: 2;
    align-self: end;
  }

  .is-project-embed .mc-hero__facts article {
    grid-template-rows:
      1rem
      minmax(1.8rem, auto);
    padding: 0.52rem 0.72rem;
  }

  .is-project-embed .mc-hero__facts span {
    font-size: 0.5rem;
  }

  .is-project-embed .mc-hero__facts strong {
    font-size: 0.63rem;
    line-height: 1.28;
  }
}

/* Responsive */

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

  .mc-hero h1 {
    font-size: clamp(2.75rem, 4vw, 4rem);
  }

  .mc-method {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mc-method article:nth-child(3) {
    border-top: 1px solid rgba(217, 240, 246, 0.09);
    border-left: 0;
  }

  .mc-method article:nth-child(4) {
    border-top: 1px solid rgba(217, 240, 246, 0.09);
  }
}

@media (max-width: 68rem) {
  .mc-hero__grid,
  .mc-section__head,
  .mc-feature,
  .mc-outcome__grid {
    grid-template-columns: 1fr;
  }

  .mc-hero__grid {
    gap: 1.25rem;
  }

  .mc-hero-media {
    width: min(100%, 42rem);
    justify-self: center;
  }

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

@media (max-width: 48rem) {
  .mc-hero {
    height: 100svh;
    min-height: 0;
    padding-block: 0.75rem 0.9rem;
  }

  .mc-hero__top {
    font-size: 0.56rem;
  }

  .mc-hero__grid {
    align-content: center;
    gap: 0.72rem;
  }

  .mc-hero__copy {
    gap: 0.52rem;
  }

  .mc-hero h1 {
    max-width: none;
    font-size: clamp(2.05rem, 9.4vw, 2.75rem);
    line-height: 0.98;
  }

  .mc-hero__copy .lead {
    font-size: 0.82rem;
    line-height: 1.36;
  }

  .mc-tags {
    gap: 0.3rem;
  }

  .mc-tags li {
    padding: 0.28rem 0.44rem;
    font-size: 0.59rem;
  }

  .mc-hero-media {
    width: min(100%, 23rem);
    border-radius: var(--r-lg);
  }

  .mc-hero-media__image img {
    aspect-ratio: 16 / 8.8;
  }

  .mc-hero-media__image > span {
    right: 0.45rem;
    bottom: 0.45rem;
    padding: 0.25rem 0.38rem;
    font-size: 0.43rem;
  }

  .mc-hero-media figcaption {
    grid-template-columns: 1fr;
    gap: 0.18rem;
    padding: 0.45rem 0.55rem;
  }

  .mc-hero-media figcaption span {
    font-size: 0.43rem;
  }

  .mc-hero-media figcaption strong {
    font-size: 0.57rem;
    line-height: 1.25;
  }

  .mc-hero__facts article {
    grid-template-rows: 0.9rem minmax(1.9rem, auto);
    padding: 0.44rem 0.36rem;
  }

  .mc-hero__facts span {
    font-size: 0.43rem;
  }

  .mc-hero__facts strong {
    font-size: 0.53rem;
    line-height: 1.2;
  }

  .mc-section__head h2,
  .mc-outcome h2 {
    max-width: none;
    font-size: clamp(2.05rem, 9.8vw, 3.1rem);
  }

  .mc-method,
  .mc-equations,
  .mc-gallery--two,
  .mc-parameters,
  .mc-results {
    grid-template-columns: 1fr;
  }

  .mc-method article {
    min-height: 11rem;
  }

  .mc-method article + article,
  .mc-parameters article + article,
  .mc-results article + article {
    border-top: 1px solid rgba(217, 240, 246, 0.09);
    border-left: 0;
  }

  .mc-media,
  .mc-method,
  .mc-parameters,
  .mc-feature__copy,
  .mc-results {
    border-radius: var(--r-lg);
  }

  .mc-parameters article,
  .mc-results article {
    min-height: 9.5rem;
  }

  .mc-outcome {
    min-height: 76svh;
  }
}
