*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

body {
  background-color: black;
  color: rgba(255, 255, 255, 0.98);
  display: flex;
  height: 100dvh;
  flex-direction: column;

  --sans-font-family: -apple-system, system-ui, BlinkMacSystemFont,
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --heading-font-family: var(--sans-font-family);

  --large-break: 1500px;
  --small-break: 800px;

  --large-text-block: 650px;
  --large-left-gap: 48px;
  --large-right-gap: 48px;
  --large-page-h-margin: 40px;

  --medium-gap: 36px;
  --medium-r-col: 420px;
  @media (width < 1160px) {
    --medium-r-col: 270px;
  }
  --medium-page-h-margin: 32px;

  --tiny-page-h-margin: 16px;

  a {
    color: inherit;
    text-decoration-color: rgba(255, 255, 255, 0.6);
  }
}

#VideoContainer {
  flex-shrink: 0;
  height: min(720px, 38%);
  max-height: calc(100vw * 9 / 16);
  top: 0;
  left: 0;
  right: 0;
  position: relative;
  background-color: black;

  display: flex;
  justify-content: center;
  align-items: center;

  #ResizingControl {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 10px;
    cursor: ns-resize;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.27);
  }

  noscript {
    font-family: var(--sans-font-family);
    max-width: 375px;
    padding: 16px;
    margin: 0 auto;
    display: block;
  }

  #VideoPlayerOverlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -1px;
    background: url("play-xlarge.svg") no-repeat center / auto 30%, image-set(url("img/poster-1600.webp") type("image/webp"), url("img/poster-1600.png") type("image/png")) no-repeat center / contain, black;
    cursor: pointer;
  }
}

#TranscriptContainer {
  background: linear-gradient(to bottom, #262626, black);
  overflow: scroll;
  display: grid;

  padding: 48px 0;
  grid-template-columns: 1fr var(--large-text-block) 1fr;
  column-gap: var(--large-left-gap);

  @media (width < 1500px) {
    column-gap: var(--medium-gap);
    padding: 32px var(--medium-page-h-margin);
    justify-content: center;
    grid-template-columns: var(--large-text-block) var(--medium-r-col);
  }
  @media (width < 1160px) {
    grid-template-columns: fit-content(var(--large-text-block)) var(
        --medium-r-col
      );
  }
  @media (width < 850px) {
    grid-template-columns: fit-content(var(--large-text-block));
    padding: 24px;
  }
  @media (width < 600px) {
    padding: var(--tiny-page-h-margin);
  }

  font-family: Charter, Georgia, Cambria, "Times New Roman", Times, serif;

  header {
    grid-column: 1;

    display: grid;
    grid-template-columns: min-content auto;
    grid-auto-rows: min-content;
    column-gap: 16px;

    @media (width >= 1500px) {
      right: calc(
        var(--large-text-block) + (100vw - var(--large-text-block)) / 2 +
          var(--large-left-gap)
      );
      position: fixed;
    }

    @media (width < 1500px) {
      grid-column: 2;
      margin-left: 0;
      margin-right: 0;
    }

    @media (width < 1160px) {
      grid-template-columns: 0 max-content;
      column-gap: 0;
    }

    @media (width < 850px) {
      display: none;
    }

    font-family: var(--sans-font-family);
    font-weight: 470;
    color: rgba(255, 255, 255, 0.75);
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.005em;

    p {
      grid-column: 2;
    }

    .Title {
      font-weight: 800;
      letter-spacing: 0.0125em;
      color: rgba(255, 255, 255, 0.95);
    }

    .Subtitle a:hover {
      text-decoration: underline;
    }

    a {
      text-decoration: none;
      color: inherit;
    }

    nav {
      margin-top: 32px;
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: subgrid;
      row-gap: 8px;

      h3 {
        grid-column: 1;
        font-weight: 700;
        font-size: inherit;
        color: rgba(255, 255, 255, 0.5);
        text-align: right;
        letter-spacing: 0.01em;

        @media (width < 1160px) {
          display: none;
        }
      }

      ul,
      ol {
        grid-column: 2;
        padding-left: 0;
        list-style-position: inside;

        li a {
          text-decoration: none;
          position: relative;
          display: block;

          .number {
            width: 1em;
            display: inline-block;
          }

          &::before {
            position: absolute;
            pointer-events: none;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            content: "";
            margin: -4px -8px;
            border-radius: 8px;
          }

          &:hover::before {
            background-color: rgba(255, 255, 255, 0.08);
          }

          &.Highlighted::before {
            background-color: rgba(255, 255, 255, 0.12);
          }
        }
      }

      ul {
        list-style: none;
      }
    }

    .Patronage {
      margin-top: 24px;
      font-size: 14px;
      line-height: 18px;
      max-width: 250px;

      a {
        text-decoration: underline;
      }
    }
  }

  article {
    position: relative;
    padding-bottom: 36px;
    text-wrap: pretty;

    grid-column: 2;
    @media (width < 1500px) {
      order: -1;
      grid-column: 1;
    }

    h2 {
      font-family: var(--heading-font-family);
      font-weight: bold;
      font-size: 28px;
      line-height: 28px;
      margin-bottom: 28px;

      @media (width < 600px) {
        font-size: 24px;
        line-height: 24px;
        margin-bottom: 24px;
      }

      .anchor {
        display: none;
        color: #aaa;
        text-decoration: none;
      }

      @media (hover: hover) and (width > 850px) {
        position: relative;
        margin-left: -24px;
        padding-left: 24px;
        &:hover .anchor {
          display: block;
          position: absolute;
          left: -1px;
          top: 0;
        }
      }
    }

    p + h2 {
      margin-top: 48px;
    }

    blockquote {
      margin-left: 32px;
      margin-right: 32px;
      margin-bottom: 18px;
      font-style: italic;

      @media (width < 600px) {
        margin-left: 16px;
        margin-right: 0;
      }
    }

    p {
      font-size: 20px;
      line-height: 28px;
      margin-bottom: 18px;
      @media (width < 600px) {
        font-size: 18px;
        line-height: 25px;
        margin-bottom: 16px;
      }

      margin-left: -32px;
      padding-left: 32px;
      position: relative;

      button {
        display: none;
      }

      &::before {
        position: absolute;
        pointer-events: none;
        top: 0;
        left: 32px;
        bottom: 0;
        right: 0;
        content: "";
        margin: -8px -12px;
        border-radius: 8px;
      }

      &.Highlighted::before {
        background-color: rgba(255, 255, 255, 0.12);
      }

      @media (hover: hover) and (width >= 850px) {
        &:hover button {
          display: block;
          position: absolute;
          left: 0;
          top: 2px;
          width: 24px;
          height: 24px;
          background-color: #999999;
          mask: url("play-small.svg") no-repeat;
          -webkit-mask: url("play-small.svg") no-repeat;
          border: none;
          cursor: pointer;

          &:hover {
            background-color: white;
          }

          &:active {
            background-color: #404040;
          }
        }
      }
    }

    .ImageContainer {
      display: block;
      cursor: pointer;

      img {
        width: 100%;
        border-radius: 8px;
      }

      @media (width >= 850px) {
        position: absolute;
        max-width: 500px;
        top: anchor(top);

        left: calc(100% + var(--large-right-gap));
        width: calc(
          (100vw - var(--large-text-block)) / 2 - var(--large-right-gap) -
            var(--large-page-h-margin)
        );

        @media (width < 1500px) {
          left: calc(100% + var(--medium-gap));
          width: calc(
            (100vw - 100% - var(--medium-r-col) - var(--medium-gap)) / 2 +
              var(--medium-r-col) - var(--medium-page-h-margin)
          );
        }
      }
      @media (width < 850px) {
        position: relative;
        margin-bottom: 16px;
      }
      @media (width < 600px) {
        margin-left: calc(-1 * var(--tiny-page-h-margin));
        width: calc(100% + var(--tiny-page-h-margin) * 2);
        img {
          border-radius: 0;
        }
      }

      @media (hover: hover) and (width >= 850px) {
        &::after {
          position: absolute;
          top: 0;
          left: 0;
          bottom: 0;
          right: 0;
          border-radius: 8px;
          content: "";
        }
        &:hover::after {
          background: url("play-large.svg") no-repeat center, rgba(127, 127, 127, 0.25);
        }
        &:active::after {
          background: url("play-large.svg") no-repeat center, rgba(127, 127, 127, 0.10);
        }
      }
    }

    #Abstract {
      margin-bottom: 48px;

      @media (width >= 600px) {
        margin-left: 40px;
        margin-right: 40px;
      }

      p {
        font-size: 16px;
        line-height: 23px;
        font-style: italic;
        color: rgba(255, 255, 255, 0.72);
        margin-bottom: 14px;
        margin-left: 0;
        padding-left: 0;

        &::before {
          display: none;
        }

        em {
          font-style: normal;
        }
      }

      p:last-child {
        margin-bottom: 0;
      }

      @media (width < 600px) {
        &::before {
          content: "abstract";
          display: block;
          font-family: var(--sans-font-family);
          font-variant: small-caps;
          font-size: 12px;
          letter-spacing: 0.08em;
          color: rgba(255, 255, 255, 0.45);
          margin-bottom: 10px;
        }

        p {
          font-style: normal;
        }
      }
    }

    #Footer {
      margin-top: 48px;
      border-top: 1px solid #505050;
      padding-top: 36px;
    }
  }
}
