/* ========================================
   Homepage Styles
   ======================================== */

/* Hero Section */
.page-logo {
  display: block;
  margin: 2rem auto 1rem;
  max-width: var(--container-max-width);
}

.page-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 600;
  margin: 1rem auto;
  border-bottom: none;
  padding-bottom: 0;
  max-width: var(--container-max-width);
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.page-slogan {
  text-align: center;
  font-size: 1.25rem;
  color: var(--color-text-secondary, #666);
  margin: 1rem auto 2rem;
  max-width: var(--container-max-width);
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* Call to Action */
.call-to-action-list {
  display: flex;
  gap: 0;
  justify-content: center;
  margin: 2rem auto 3rem;
  max-width: var(--container-max-width);
  padding: 25px 0;
}

.call-to-action {
  display: inline-block;
  text-align: center;
  text-transform: uppercase;
  font-family: var(--secondary-font-family);
  font-size: 16px;
  font-weight: bold;
  vertical-align: middle;
  padding: 8px 24px;
  border: 1px solid var(--primary-color);
  border-radius: 24px;
  background: linear-gradient(to right, var(--primary-color-lighter), var(--primary-color));
  text-shadow: var(--primary-color-darker) 1px 1px 1px;
  text-decoration: none;
  margin: 10px;
  font-variation-settings: "CASL" 0, "MONO" 0, "slnt" -5, "CRSV" 1;
  transition: all 0.2s ease;

  &:first-child {
    margin-left: 0;
  }

  &:nth-of-type(2) {
    --primary-color: #222;
    --primary-color-lighter: #333;
    --primary-color-darker: #000;
  }
}

#main .call-to-action {
  font-variation-settings: "CASL" 0, "MONO" 0, "slnt" -5, "CRSV" 1;
  color: white;

  &:hover {
    color: black;
  }

  &:nth-of-type(2) {
    --primary-color: #222;
    --primary-color-lighter: #333;
    --primary-color-darker: #000;

    &:hover {
      color: white;
    }
  }
}

/* Homepage Sections */
.markdown-body {
  h2 {
    border: 0;
    text-align: center;
  }
}

h2 {
  .anchor {
    display: none;
  }

  &:not(:first-of-type) {
    margin-top: 7rem;
  }
}

@media screen and (min-width: 1024px) {
  .page-background {
    top: -210px;
    right: -463px;
    transform: rotate(45deg);
  }
}

/* Reasons Section */
.reasons {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 36px;
  text-align: center;

  h2 {
    width: 100%;
  }

  article {
    max-width: 300px;
    padding: 0;

    h3 {
      font-size: 1.25rem;
      font-weight: 600;
      margin: 0 0 0.5rem 0;
      color: var(--primary-color, #0066cc);
    }
  }
}

section.reasons {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.reason-header {
  font-size: 2rem;
  font-weight: 600;
  margin: 3rem 0 1.5rem;
  border-bottom: 1px solid var(--color-border, #e1e4e8);
  padding-bottom: 0.3em;
}

/* Playground Section */
#query-spacex {
  --playground-ide-height: 25em;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

/* Code Tabs */
code-tab::part(content) {
  width: 100%;
}

/* Libraries Section */
#libraries {
  display: grid;
  grid-template-columns: repeat(auto-fit, 140px);
  grid-template-rows: repeat(auto-fit, 140px);
  gap: 20px;
  list-style-type: none;
  place-content: center;
  margin: 0;
  padding: 0;

  li {
    margin: 0;
    padding: 0;
    display: contents;
  }

  a {
    color: inherit;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.9;
    padding: 20px;
    display: flex;
    text-decoration: none;
    border-radius: 100%;
    transition: background 0.2s ease-in-out;
    height: 100%;
    outline: none;

    &:hover figcaption,
    &:focus figcaption {
      color: var(--primary-color-lighter);
      text-shadow: 2px 2px 2px var(--footer-background);
    }

    @media (prefers-color-scheme: dark) {
      &:hover figcaption,
      &:focus figcaption {
        text-shadow: 2px 2px 2px var(--primary-color-darker);
      }
    }
  }

  figure {
    margin: 0;
    display: grid;
    grid-template-rows: 100px min-content;
  }

  figcaption {
    text-align: center;
  }

  svg {
    width: 100px;
    height: 100px;
  }
}

.library {
  svg {
    filter: brightness(1);
  }

  &.atomico svg path {
    fill: currentColor !important;
  }

  &:is(:hover, :focus) svg {
    filter: brightness(1.5);
    transition: transform 0.2s ease-in, filter 0.2s ease-in;
    transform: scale(1.0618);
    transform-origin: center;
  }
}

/* Demos Section */
#demos {
  --code-tabs-min-height: 505px;

  #default-tab {
    display: grid;
    grid-template-columns: min-content max-content;
    justify-content: center;
    height: var(--code-tabs-min-height);
    gap: 20px;
    align-items: center;

    svg {
      --ds: 1px;
      width: 100px;
      transform: rotate(var(--deg, 30deg));
      fill: currentColor;
      filter:
        drop-shadow(0 0 var(--ds) var(--fw-color, transparent))
        drop-shadow(0 0 var(--ds) var(--fw-color, transparent))
        drop-shadow(0 0 var(--ds) var(--fw-color, transparent))
        drop-shadow(0 0 var(--ds) var(--fw-color, transparent))
        drop-shadow(0 0 var(--ds) var(--fw-color, transparent));
      transition: fill 0.2s ease;
      will-change: transform, fill;
    }

    p {
      font-size: 48px;
    }
  }

  code-tab[selected] {
    height: var(--code-tabs-min-height, 505px);
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

codesandbox-button[show-demo] {
  flex: 1;
}
