/**
 * Homepage
 */

.homepage {
  align-items: center;
  background-color: var(--color-block-background);
  display: flex;
  flex-direction: column;
  position: relative;
}

.homepage.homepage--features {
  padding: 60px 0;
}

.homepage.homepage--title {
  background-color: var(--color-body-background);
}

.homepage-gallery.homepage-gallery--reasons {
  --homepage-gallery-background: var(--color-block-dark-background);
  --homepage-gallery-color: var(--color-body-font-dark-background);
}

.homepage-gallery.homepage-gallery--releases {
  --homepage-gallery-background: white;
  --homepage-gallery-color: var(--color-body-font);

  border-bottom: 1px solid var(--color-border);
  height: 460px;

  .homepage-gallery__item {
    min-width: 400px;
  }
}

.homepage-gallery {
  background-color: var(--homepage-gallery-background);
  color: var(--homepage-gallery-color);
  max-width: 100vw;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 40px 20px;

  h3 {
    font-size: 2em;
    font-weight: bold;
    position: sticky;
    left: 20px;
  }

  &::-webkit-scrollbar-thumb {
    background-color: var(--color-body-background);
  }
}

.homepage-gallery {
  display: flex;
  flex-direction: column;
  row-gap: 20px;
}

.homepage-gallery__grid {
  gap: 40px;
  display: grid;
  list-style-type: none;

  @media screen and (max-width: 1023px) {
    grid-template-columns: 1fr;
  }
  @media screen and (min-width: 1024px) and (max-width: 1479px) {
    grid-template-columns: repeat(2, 1fr);
  }
  @media screen and (min-width: 1480px) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.homepage-gallery__grid-item {
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 40px 20px;
  row-gap: 20px;

  h4 {
    font-weight: bold;
  }
}

.homepage-gallery__items {
  column-gap: 20px;
  display: flex;
  flex-direction: row;
  flex-grow: 1;
}

.homepage-gallery__item {
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;

  h4 a {
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    column-gap: 1ch;
    display: flex;
    font-weight: bold;
    justify-content: space-between;
    padding: 20px;
    text-decoration: none;
  }

  iframe {
    flex-grow: 1;
    height: 100%;
  }

  p {
    flex-grow: 1;
    font-size: var(--font-size-smaller);
    padding: 20px;
  }
}

.homepage-gallery__item__learnmore {
  font-size: var(--font-size-smaller);
  padding: 20px;
  text-align: right;

  &::after {
    content: " →";
  }
}

.homepage-gallery__version {
  display: flex;
  font-size: var(--font-size-smaller);
  font-weight: normal;
}

.homepage__content {
  display: flex;
  flex-direction: column;
  max-width: 1480px;
  padding: 20px;
  width: 100%;

  @media screen and (max-width: 1023px) {
    row-gap: 20px;
  }
  @media screen and (min-width: 1024px) {
    row-gap: 60px;
  }
}

.homepage__example {
  align-items: flex-start;
  display: grid;

  @media screen and (max-width: 1279px) {
    column-gap: 80px;
    grid-template-areas:
      "title"
      "code"
      "description";
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, auto);
    row-gap: 40px;
  }
  @media screen and (min-width: 1280px) {
    column-gap: 60px;
    grid-template-areas:
      "title code"
      "description code";
    grid-template-columns: 2fr 3fr;
    grid-template-rows: auto 1fr;
    row-gap: 40px;
  }
}

.homepage__example__code {
  grid-area: code;
}

.homepage__example__description {
  display: flex;
  flex-direction: column;
  grid-area: description;
  row-gap: 1em;
}

h2.homepage__example__title {
  grid-area: title;
  margin-top: 0;
}

.homepage__examples {
  display: flex;
  flex-direction: column;

  @media screen and (max-width: 1023px) {
    row-gap: 80px;
  }
  @media screen and (min-width: 1024px) {
    row-gap: 160px;
  }
}

.homepage__rubixml {
  align-items: center;
  background-image: linear-gradient(141deg,#2e00bb,#6200ee 71%,#9709ff);
  display: flex;
  flex-direction: column;
}

.homepage__rubixml__content {
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  max-width: 1480px;
  padding: 60px 20px;
  position: relative;
  row-gap: 20px;
  width: 100%;

  > h3,
  > p {
    color: white;
    text-shadow: 1px 2px rgba(0,0,0,.4);
  }

  > h3 {
    font-size: 2em;
  }

  @media screen and (max-width: 1799px) {
    background-image: url(../images/rubixml.png);
    background-position: 20px 20px;
    padding-top: 148px;
  }
  @media screen and (min-width: 1800px) {
    &::before {
      background-image: url(../images/rubixml.png);
      background-position: calc(-100%) top;
      content: "";
      left: -128px;
      top: 25px;
      position: absolute;
      height: 128px;
      width: 128px;
    }
  }
}

.homepage__rubixml__ctas {
  column-gap: 20px;
  display: flex;

  @media screen and (max-width: 1023px) {
    flex-direction: column;
  }
  @media screen and (min-width: 1024px) {
    flex-direction: row;
  }
}

.homepage__title {
  justify-content: center;
  display: flex;
  flex-direction: column;
  line-height: 1;
  overflow: hidden;
  position: relative;
  row-gap: 1em;
  width: 100%;

  @media screen and (max-width: 1023px) {
    padding: 40px 0 40px 0;
  }
  @media screen and (min-width: 1024px) {
    padding: 100px 0 100px 0;
  }
}

.homepage__title h1 {
  font-weight: bold;
  line-height: 1;

  @media screen and (max-width: 1023px) {
    font-size: 60px;
  }
  @media screen and (min-width: 1024px) {
    font-size: 6em;
    position: relative;
  }
}

.homepage__title h2,
.homepage__title p {
  max-width: 1024px;
}

.homepage__title h2 {
  font-weight: bold;
  line-height: 1.3;
  margin-top: 20px;

  @media screen and (min-width: 1024px) {
    font-size: 2em;
  }
}

.homepage__title h3 {
  font-size: 2em;
  font-weight: bold;
}

.homepage__title p {
  line-height: 1.5;
}

.homepage__cta {
  align-self: flex-start;
  background-color: var(--color-block-background);
  border-style: solid;
  border-width: 1px;
  margin-top: 20px;
  padding: 15px 20px;
  text-decoration: none;
}

.homepage__cta.homepage__cta--example {
  align-self: flex-start;
}
