/* Molecular Dynamics case study */

:root {
  color-scheme: dark;
}

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

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

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

/* Hero */

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

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

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

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

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

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

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

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

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

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

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

.md-phase {
  position: relative;
  display: grid;
  width: min(100%, 45rem);
  overflow: hidden;
  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);
}

.md-phase video {
  display: block;
  width: 100%;
  aspect-ratio: 22 / 17;
  background: #fff;
  object-fit: contain;
}

.md-phase__controls {
  display: grid;
  grid-template-columns:
    minmax(13rem, 0.75fr)
    minmax(0, 1.25fr);
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem;
  background: rgba(23, 28, 35, 0.96);
  border-top: 1px solid rgba(217, 240, 246, 0.08);
}

.md-phase__cue {
  display: grid;
  gap: 0.18rem;
  color: var(--c-main-2);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.045em;
  line-height: 1.35;
  text-transform: uppercase;
}

.md-phase__cue strong {
  color: var(--c-text-soft);
  font-size: 0.55rem;
  letter-spacing: 0;
  text-transform: none;
}

.md-phase__tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.md-phase__tabs button {
  min-height: 2.3rem;
  color: var(--c-muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(217, 240, 246, 0.08);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-100);
  font-weight: var(--fw-bold);
  cursor: pointer;
  animation: md-phase-invite 1.8s ease-in-out infinite alternate;
  transition:
    color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.md-phase__tabs button:hover,
.md-phase__tabs button:focus-visible,
.md-phase__tabs button.is-active {
  color: var(--c-text);
  background: rgba(0, 166, 214, 0.11);
  border-color: rgba(110, 187, 213, 0.42);
}

.md-phase__tabs button.is-active {
  animation: none;
}

.md-phase.has-selection .md-phase__tabs button {
  animation: none;
}

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

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

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

.md-hero__facts span,
.md-method span,
.md-verification span,
.md-state__head 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;
}

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

/* Sections */

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

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

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

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

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

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

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

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

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

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

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

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

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

.md-media img {
  display: block;
  width: 100%;
  height: auto;
}

.md-media figcaption {
  padding: 1rem 1.2rem;
  color: var(--c-muted);
  font-size: var(--fs-200);
  line-height: 1.55;
}

.md-media--wide {
  width: min(94vw, 76rem);
  max-width: none;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
  margin-inline: auto;
}

.md-verification {
  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);
}

.md-verification article {
  display: grid;
  min-height: 12rem;
  grid-template-rows: 1.3rem 2.5rem auto;
  gap: var(--sp-3);
  align-content: start;
  padding: clamp(1.4rem, 2.4vw, 2rem);
}

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

.md-verification strong {
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.7vw, 1.45rem);
}

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

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

.md-state__head {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(217, 240, 246, 0.08);
}

.md-state__head strong {
  color: var(--c-text-soft);
  font-family: var(--font-display);
}

.md-state__images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.md-state__images figure {
  margin: 0;
}

.md-state__images figure + figure {
  border-left: 1px solid rgba(217, 240, 246, 0.08);
}

.md-state__images img {
  display: block;
  width: 100%;
  aspect-ratio: 1.29;
  background: #fff;
  object-fit: contain;
}

.md-state__images figcaption {
  padding: 0.75rem;
  color: var(--c-muted);
  border-top: 1px solid rgba(217, 240, 246, 0.08);
  font-size: var(--fs-100);
  text-align: center;
}

.md-feature {
  display: grid;
  grid-template-columns:
    minmax(0, 0.86fr)
    minmax(24rem, 1.14fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: center;
}

.md-feature__copy {
  display: grid;
  gap: var(--sp-4);
}

.md-media--result {
  width: min(100%, 50rem);
  justify-self: end;
}

.md-media--result img {
  background: #fff;
}

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

.md-rdf .md-media img {
  background: #fff;
}

.md-rdf figcaption {
  display: grid;
  gap: var(--sp-2);
}

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

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

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

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

.md-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 .md-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 .md-hero__top {
    position: absolute;
    top: 0.8rem;
    right: 3.2rem;
    z-index: 3;
    width: auto;
  }

  .is-project-embed .md-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 .md-hero__copy {
    gap: 0.75rem;
    align-self: center;
  }

  .is-project-embed .md-hero h1 {
    font-size: clamp(2.7rem, 3.45vw, 3.75rem);
  }

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

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

  .is-project-embed .md-phase {
    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 .md-phase video {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .is-project-embed .md-phase__controls {
    grid-template-columns:
      minmax(12rem, 0.78fr)
      minmax(0, 1.22fr);
    padding: 0.45rem;
  }

  .is-project-embed .md-phase__cue {
    font-size: 0.5rem;
  }

  .is-project-embed .md-phase__cue strong {
    font-size: 0.5rem;
  }

  .is-project-embed .md-phase__tabs button {
    min-height: 1.95rem;
  }

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

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

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

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

/* Responsive */

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

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

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

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

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

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

  .md-hero__grid {
    gap: 1.25rem;
  }

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

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

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

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

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

  .md-hero__grid {
    align-content: center;
    gap: 0.75rem;
  }

  .md-hero__copy {
    gap: 0.55rem;
  }

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

  .md-hero__copy .lead {
    font-size: 0.84rem;
    line-height: 1.38;
  }

  .md-tags {
    gap: 0.3rem;
  }

  .md-tags li {
    padding: 0.28rem 0.44rem;
    font-size: 0.61rem;
  }

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

  .md-phase video {
    aspect-ratio: 22 / 14;
  }

  .md-phase__controls {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.4rem;
  }

  .md-phase__cue {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.45rem;
  }

  .md-phase__cue strong {
    font-size: 0.45rem;
    text-align: right;
  }

  .md-phase__tabs {
    gap: 0.3rem;
  }

  .md-phase__tabs button {
    min-height: 1.75rem;
  }

  .md-hero__facts article {
    grid-template-rows: 0.9rem minmax(1.9rem, auto);
    padding: 0.45rem 0.38rem;
  }

  .md-hero__facts span {
    font-size: 0.45rem;
  }

  .md-hero__facts strong {
    font-size: 0.55rem;
    line-height: 1.2;
  }

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

  .md-method,
  .md-verification,
  .md-states,
  .md-rdf {
    grid-template-columns: 1fr;
  }

  .md-method article,
  .md-verification article {
    min-height: 11rem;
  }

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

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

  .md-media,
  .md-method,
  .md-verification,
  .md-state {
    border-radius: var(--r-lg);
  }

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

@keyframes md-phase-invite {
  to {
    background: rgba(0, 166, 214, 0.075);
    border-color: rgba(110, 187, 213, 0.3);
    box-shadow: 0 0 0.75rem rgba(0, 166, 214, 0.08);
  }
}


/* Related project */

.md-related {
  width: fit-content;
  color: var(--c-main-soft);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  text-decoration: none;
}

.md-related::after {
  display: inline-block;
  margin-left: 0.45rem;
  content: "↗";
  transition: translate var(--dur-fast) var(--ease);
}

.md-related:hover::after,
.md-related:focus-visible::after {
  translate: 0.18rem -0.18rem;
}
