:root {
  font-size: 13pt;
  --card-bg: rgb(from var(--fg) r g b / 3%);
  --card-border: rgb(from var(--fg) r g b / 7%);
}

html {
  max-width: initial;
}

body {
  margin: initial;
}

a {
  color: var(--fg);

  &:hover {
    color: var(--accent-bright);
  }
}

button {
  color: var(--fg);
}

@keyframes slide-appear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-appear-button {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  80% {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

header {
  display: flex;
  align-items: center;
  column-gap: 100px;
  overflow-x: hidden;
  padding-left: 100px;
  max-width: 1500px;
  margin: 0 auto;

  > div {
    min-width: 400px;
    padding-bottom: 300px;
  }

  > img {
    width: 900px;
  }
}

h1 {
  font-family: var(--bold);
}

#logo {
  transform: scale(1.8);
  padding-top: 0.8em; /* Otherwise, the logo clips on mobile */
  margin-bottom: -1em;
}

#title > span {
  display: inline-block;

  @media not (prefers-reduced-motion) {
    opacity: 0;
    transform: translateY(15px);
    animation: slide-appear 0.5s forwards;
  }
}

#hero {
  padding: 30px 0 30px;
}

.button {
  margin-top: 24px;

  @media not (prefers-reduced-motion) {
    animation: slide-appear-button 3.5s;
  }
}

main {
  max-width: 80em;
  margin-left: auto;
  margin-right: auto;
}

#cards {
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
  row-gap: 20px;
  padding: 20px;
  justify-content: center;
  align-content: center;

  > .card {
    text-align: start;
  }
}

.card {
  flex: 1;
  min-width: 250px;
  padding: 10px 25px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
}

#carousel {
  display: flex;
  max-width: 1500px;
  height: 700px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  margin: 100px 0;

  &.js-disabled {
    height: initial;
  }

  > button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    min-height: 50px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: background-color 0.2s;

    &.js-disabled {
      display: none;
    }

    &:hover {
      background-color: color-mix(in srgb, var(--card-bg), var(--fg) 5%);
      cursor: pointer;
    }

    @media (prefers-contrast: more) {
      border: 1px solid var(--fg);
    }
  }
}

#carousel-image-wrapper {
  width: 100%;
}

.carousel-image {
  max-height: 700px;
  opacity: 0;
  transition: opacity 0.5s ease;

  &.show {
    opacity: 1;
  }
}

#icon {
  width: 120px;
  margin-top: 60px;
}

#os-buttons {
  > button {
    background-color: transparent;
    border: none;
    padding: 10px;
    border-radius: 10px;

    &:hover {
      background-color: var(--card-bg);
    }

    > * {
      margin: 0 auto;
    }

    &[aria-pressed="true"] {
      @media (prefers-contrast: more) {
        border: 1px solid var(--fg);
      }
    }

    &[aria-pressed="false"] > * {
      @media not (prefers-contrast: more) {
        opacity: 0.4;
      }
    }
  }

  &.js-disabled {
    display: none;
  }
}

#os-content {
  min-height: 200px;
  max-width: 500px;
  align-content: center;
  margin: 0 auto;
  padding: 0 20px;

  > * {
    transition: opacity 0.5s ease;
    opacity: 0;

    &.show {
      opacity: 1;
    }
  }

  > .card.js-disabled {
    margin-top: 20px;
  }
}

@media (max-width: 900px) {
  header {
    flex-direction: column;
    margin-top: 92px;
    padding-left: initial;

    > div {
      padding-bottom: 40px;
    }
  }

  #cards {
    flex-direction: column;

    > .card {
      max-width: 500px;
    }
  }

  #carousel {
    height: 400px;
    margin: 50px 0;
  }

  .carousel-image {
    max-height: 400px;
  }

  footer > div > ul > li {
    display: block;
    text-align: start;
    padding: 10px;
  }
}
