:root {
  --bg: #f8f8f8;
  --white: color-mix(in srgb, var(--bg), white 80%);
  --gray-0: color-mix(in srgb, var(--white), black 5%);
  --gray-1: color-mix(in srgb, var(--bg), black 5%);
  --gray-2: color-mix(in srgb, var(--bg), #604000 10%);
  --gray-3: color-mix(in srgb, var(--bg), #604000 20%);
  --gray-4: color-mix(in srgb, var(--bg), black 30%);
  --gray-5: color-mix(in srgb, var(--bg), black 40%);
  --yellow: #b78203;
  --blue: #3b6aca;
  --red: #cc1818;
  --purple: #8b2d8b;
  --green: #398927;
  --fg: #212529;
  --accent: #e91e63;
  --accent-fg: white;
  --accent-hover: color-mix(in srgb, var(--accent), black 40%);
  --width: 900px;
  --border-radius: 0.375rem;
}
html {
  scrollbar-gutter: stable;
  scrollbar-color: var(--gray-5) var(--bg);
}
body {
  line-height: 1.6;
  min-height: 100vh;
  background: var(--bg);
  font-size: 12pt;
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  flex-direction: column;

}

a:has(svg),
a:has(img) {
  display: inline-block;
}

a {
  text-decoration: none;
  color: var(--accent);
  transition:
    color .15s ease-in-out,
    background-color .15s ease-in-out,
    border-color .15s ease-in-out,
    box-shadow .15s ease-in-out;
  &:hover {
    color: var(--accent-hover);
  }
  &:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--accent), transparent 50%);
  }
}

section {
  margin-bottom: 2rem;
}

.outer-container {
  margin: 0 auto;
  max-width: 1000px;
  &.wide {
    max-width: 1200px;
  }
}
.main {
  margin: 2rem auto;
  padding: 0 1.5rem;
}

h1 {
  font-size: 2.5rem;
}
h2 {
  font-size: 1.5rem;
  font-weight: normal;
}
h3 {
  font-size: 1.6rem;
  font-size: 1.2rem;
  font-weight: normal;
}
.heading {
  margin: 1rem 0 0.5rem 0;
  &:first-child {
    margin-top: 0;
  }
  &[data-level="1"]:not(:first-child) {
    margin: 2rem 0 0.5rem 0;
  }
  &:not([data-level="1"]) a {
    color: var(--fg);
  }
  a {
    position: relative;
    text-decoration: none;
  }
  .icon {
    top: 0;
    bottom: 0;
    opacity: 0;
    display: flex;
    pointer-events: none;
    align-self: center;
    width: 1em;
    height: 1em;
    position: absolute;
    left: -1em;
    transition: opacity .15s ease-in-out;
  }
  a:hover .icon {
    opacity: 1;
  }
}

ol, ul {
  line-height: 1.7;
}

.icon-tabler {
  fill: none;
  stroke: currentColor;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.hero {
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  margin-bottom: 4rem;
  position: relative;

  @media (min-width: 1200px) {
    .hero-content-image {
      background-size: contain;
      background-repeat: no-repeat;
      background-position: var(--background-position);
      position: absolute;
      top: 0;
      bottom: 0;
      right: 0;
      left: 0;
      z-index: -1;
    }
    .hero-content {
      padding-left: var(--padding-left-size);
      padding-right: var(--padding-right-size);
    }
    &.left {
      --padding-right-size: 8rem;
      --background-position: right;
      .hero-content {
        background-image: linear-gradient(100deg, var(--bg) 80%, transparent 80.1%);
      }
    }
    &.right {
      --padding-left-size: 12rem;
      --background-position: left;
      .hero-content-wrapper {
        .hero-content {
          justify-self: end;
          align-self: end;
        }
      }
      .hero-content {
        background-image: linear-gradient(100deg, transparent 20%, var(--bg) 20.1%);
      }
    }
  }

  @media (max-width: 1199px) {
    .hero-content-image {
      background-size: contain;
      background-repeat: no-repeat;
      background-position: var(--background-position);
      width: 100%;
      aspect-ratio: 16/9;
      margin-bottom: 1rem;
    }
  }


  .hero-content-wrapper {
    height: 100%;
  }

  .hero-content {
    max-width: 30rem;
    h1 {
      margin: 0;
    }
    .logo {
      max-width: 100%;
      max-height: 6rem;
    }
  }
}

.btn-group {
  --btn-group-gap: 8px;
  display: inline-flex;
  gap: var(--btn-group-gap);
  &>.btn {
    flex: 1 1 auto;
    margin-bottom: var(--btn-group-gap);
  }
}


.btn {
  --btn-padding-x: 0.75rem;
  --btn-padding-y: 0.375rem;
  --btn-font-family: ;
  --btn-font-size: 1rem;
  --btn-font-weight: 400;
  --btn-line-height: 1.5;
  --btn-color: var(--accent-fg);
  --btn-bg: transparent;
  --btn-border-width: 1px;
  --btn-border-color: transparent;
  --btn-border-radius: 0.375rem;
  --btn-hover-border-color: transparent;
  --btn-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
  --btn-disabled-opacity: 0.65;
  --btn-focus-box-shadow: 0 0 0 0.25rem rgba(var(--btn-focus-shadow-rgb), .5);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--btn-padding-y) var(--btn-padding-x);
  font-family: var(--btn-font-family);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  line-height: var(--btn-line-height);
  color: var(--btn-color);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  border: var(--btn-border-width) solid var(--btn-border-color);
  border-radius: var(--btn-border-radius);
  background-color: var(--btn-bg);
  transition:
    color .15s ease-in-out,
    background-color .15s ease-in-out,
    border-color .15s ease-in-out,
    box-shadow .15s ease-in-out;
  &:hover {
    color: var(--btn-hover-color);
    background-color: var(--btn-hover-bg);
  }
  &.dropdown-toggle:after {
    margin-left: .255em;
    vertical-align: .255em;
    content: "";
    border-top: .3em solid;
    border-right: .3em solid rgba(0, 0, 0, 0);
    border-bottom: 0;
    border-left: .3em solid rgba(0, 0, 0, 0);
  }
}

.btn-outline-primary {
  --btn-color: #e91e63;
  --btn-border-color: #e91e63;
  --btn-hover-color: #000;
  --btn-hover-bg: #e91e63;
  --btn-hover-border-color: #e91e63;
  --btn-focus-shadow-rgb: 233, 30, 99;
  --btn-active-color: #000;
  --btn-active-bg: #e91e63;
  --btn-active-border-color: #e91e63;
  --btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --btn-disabled-color: #e91e63;
  --btn-disabled-bg: transparent;
  --btn-disabled-border-color: #e91e63;
}

.btn-primary {
  --btn-color: var(--accent-fg);
  --btn-bg: var(--accent);
  --btn-border-color: var(--accent);
  --btn-hover-color: #000;
  --btn-hover-bg: rgb(236.3, 63.75, 122.4);
  --btn-hover-border-color: rgb(235.2, 52.5, 114.6);
  --btn-focus-shadow-rgb: 198, 26, 84;
  --btn-active-color: #000;
  --btn-active-bg: rgb(237.4, 75, 130.2);
  --btn-active-border-color: rgb(235.2, 52.5, 114.6);
  --btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --btn-disabled-color: #000;
  --btn-disabled-bg: var(--accent);
  --btn-disabled-border-color: var(--accent);
}

.dropdown-menu {
  position-area: bottom center;
  position-anchor: auto;
  justify-self: self-start;
  white-space: nowrap;
  z-index: 1000;
  padding: 0.5rem 0;
  margin: 0;
  color: var(--dropdown-color);
  text-align: left;
  list-style: none;
  background-color: var(--bg);
  background-clip: padding-box;
  border: 1px solid var(--gray-5);
  border-radius: var(--border-radius);

  .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 1rem;
    color: var(--fg);
    text-decoration: none;
    white-space: nowrap;
    border: 0;
    border-radius: var(--dropdown-item-border-radius, 0);

    &:hover {
      background: var(--gray-2);
    }
  }
}

ul.showcase {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  li {
    margin: 0;
    padding: 0;
    width: 30rem;
    display: block;
    aspect-ratio: 16/9;
    .label {
      margin-top: 0.25rem;
      text-align: center;
      display: block;
    }
  }
  img {
    width: 100%;
    display: block;
  }
}

/* Before/After image slider */
.ba-slider {
  position: relative;
  width: 100%;
  img {
    display: block;
    width: 100%;
    height: auto;
  }
  .resize {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    pointer-events: none;
    img {
      display: block;
      width: 100%;
      height: auto;
    }
  }
  .handle {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2rem;
    height: 100%;
    margin-left: -1rem;
    cursor: ew-resize;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    &:before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      width: 2px;
      height: 100%;
      background: var(--accent);
      z-index: 3;
    }
    &:after {
      content: "";
      width: 20px;
      height: 20px;
      background: var(--accent);
      border-radius: 50%;
      box-shadow: 0 0 0 2px var(--white);
      z-index: 4;
    }
  }
}

iframe {
  width: 100%;
  aspect-ratio: 16/9;
}

.main-nav {
  background: var(--gray-1);
  font-size: 1.1em;
  text-transform: uppercase;
  a {
    padding-top: 0.75em;
    padding-bottom: 0.75em;
  }
  margin-bottom: 1rem;
}

nav {
  flex-wrap: wrap;
  &, a {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  a {
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin: 0 1rem;
    gap: 0.5rem;
    letter-spacing: 0.02em;
    &.active {
      border-bottom: 2px solid var(--accent);
    }
  }
}

.markdown {
  li>p:first-child {
    margin-top: 0;
  }
}

footer {
  padding: 1rem;
  background: var(--gray-2);

  .footer-wrapper {
    display: flex;
    justify-content: space-between;
  }

  .socials-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    .socials {
      display: flex;
      flex-wrap: wrap;
    }
    .social {
      white-space: nowrap;
      .icon {
        padding: 0.5rem;
        width: 32px;
        height: 32px;
      }
    }
  }
}

.video {
  border: 1px solid var(--gray-5);
}

.downloads-video {
  .video {
    max-width: 480px;
  }
}

.download-links {
  line-height: 2;
}

.link-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  vertical-align: middle;
}

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  vertical-align: middle;
  .icon {
    width: 1.2rem;
    height: 1.2rem;
  }
}

.note {
  --note-accent: var(--gray-3);
  background: var(--gray-1);
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  list-style: none;
  border-left: 2px solid var(--note-accent);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  &.info      { --note-accent: var(--blue); }
  &.caution   { --note-accent: var(--red); }
  &.warning   { --note-accent: var(--yellow); }
  &.important { --note-accent: var(--purple); }
  &.tip       { --note-accent: var(--green); }

  .header {
    color: var(--note-accent);
    display: flex;
    padding: 0;
    align-items: center;
    vertical-align: middle;
    gap: 0.25rem;
    font-weight: bold;

    .icon {
      width: 1.2rem;
      height: 1.2rem;
    }
  }

  div>*:first-child { margin-top: 0; }
  div>*:last-child { margin-bottom: 0; }
}

.file-tree {
  list-style: none;
  padding-left: 0.5rem;

  ul {
    list-style: none;
    margin: 0;
    padding-left: 1rem;
    border-left: 1px solid var(--gray-3);
    margin-left: 0.5rem;

    li {
      margin: 0.2em 0;
      padding-left: 0.4rem;
    }

    /* Horizontal connectors */
    li {
      position: relative;
      &::before {
        content: "";
        position: absolute;
        display: block;
        top: 0.7em;
        left: -1rem;
        width: 1rem;
        height: 0;
        border-top: 1px solid var(--gray-3);
      }
    }
  }

  /* Remove horizontal line on root-level items */
  &[data-level="0"] > li::before {
    border: none;
  }

  details summary {
    cursor: pointer;
  }

  /* Icons */
  details > summary::before {
    content: "📁";
    margin-right: 0.3em;
  }
  li:not(:has(details))>span::before {
    content: "📄";
    margin-right: 0.3em;
  }
}

table {
  &.no-borders {
    th, td {
      padding: 0.1rem 1rem;
      &:first-child {
        padding-left: 0;
      }
    }
  }

  &:not(.no-borders) {
    overflow: hidden;
    border-radius: 0.375rem;
    box-shadow: 0 0 0 1px var(--gray-3);
    border: 1px solid transparent;
    border-collapse: collapse;
    td {
      background: var(--white);
      code {
        background: var(--gray-0);
      }
    }
    th, td {
      padding: 0.25rem 0.75rem;
      text-align: left;
      border: 1px solid var(--gray-2);
    }
  }
}

.branch-selector {
  margin-bottom: 1rem;
}

ol, ul {
  &.no-bullets {
  list-style-type: none;
  padding: 0;
}

  ol, ul {
    margin: 1rem 0;
  }

  li {
    &>:first-child {
      margin-top: 0;
    }
    &>:last-child {
      margin-bottom: 0;
    }
  }

  &.bullets-inside {
    padding: 0 0 0 1.25rem;
  }

  &.big-gaps li {
    margin-bottom: 1rem;
  }
}

.left-right {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 1rem;
  .expand {
    flex: 1;
  }
}

.card {
  background: var(--white);
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  margin: 1rem 0;
  &>:first-child {
    margin-top: 0;
  }
  &>:last-child {
    margin-bottom: 0;
  }
}

code {
  background: var(--gray-1);
  padding: 0.1rem 0.5rem;
  border-radius: 0.27rem;
  white-space: nowrap;
}

pre {
  white-space: pre;
  background: var(--gray-1);
  padding: 0.1rem 0.5rem;
  border-radius: 0.27rem;
  code {
    background: initial;
    padding: initial;
    border-radius: initial;
    white-space: inherit;
  }
}

.docs-container {
  display: flex;
  @media (max-width: 799px) {
    flex-direction: column;
  }
  gap: 2rem;
}
.docs-sidebar {
  flex: 0 0 200px;
  ul {
    margin: 0;
    ul {
      margin-left: 1rem;
    }
  }
  li>a, li>span, p>a {
    display: block;
    padding: 0.2rem 0.5rem;
  }
  a {
    &.active {
      background: var(--accent);
      color: var(--accent-fg);
      &:hover {
        background: var(--accent-hover);
        color: var(--accent-fg);
      }
    }
    &:hover {
      border-color: var(--accent-hover);
      background: var(--gray-1);
      color: var(--accent-hover);
    }
  }
}
.docs-content>:first-child,
.docs-content>.markdown>:first-child {
  margin-top: 0;
}

.team-table {
  img {
    max-height: 24px;
    vertical-align: middle;
  }
}

select,
::picker(select) {
  appearance: base-select;
}
::picker(select) {
  border: none;
}

select {
  border-radius: var(--border-radius) var(--border-radius);
  margin-left: 1rem;
  --select-bg: var(--gray-4);
  border: 2px solid var(--select-bg);
  outline: none;
  background: var(--white);
  padding: 0.25rem 0.5rem;
  transition:
    color .15s ease-in-out,
    background-color .15s ease-in-out,
    border-color .15s ease-in-out,
    box-shadow .15s ease-in-out;
  min-width: 7rem;

  &:open {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
  }

  &:hover, &:open {
    --select-bg: var(--accent);
  }

  option {
    display: flex;
    justify-content: flex-start;
    border-left: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
    background: #eee;
    padding: 0.25rem 0.5rem;
    outline: 0;
    transition: .15s ease-in-out;
    background: var(--white);

    &:last-of-type {
      border-radius: 0 0 var(--border-radius) var(--border-radius);
      border-bottom: 2px solid var(--accent);
    }

    &:focus {
      background: var(--gray-2);
    }
    &:hover {
      background: var(--gray-1);
    }
  }
}
