:root {
  --almost-white: hsl(0, 0%, 98%);
  --medium-gray: hsl(0, 0%, 41%);
  --almost-black: hsl(0, 0%, 8%);
  --radius: 16px;
  --max-width: 1110px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

::selection {
  background: var(--almost-black);
  color: var(--almost-white);
}

:focus-visible {
  outline: 2px solid var(--almost-black);
  outline-offset: 3px;
  border-radius: 4px;
}

body {
  font-family: "Epilogue", system-ui, -apple-system, sans-serif;
  font-weight: 500;
  line-height: 1.5;
  color: var(--almost-black);
  background: var(--almost-white);
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.container {
  width: min(100% - 3rem, var(--max-width));
  margin-inline: auto;
}

/* Header */
.header {
  padding: 1.5rem 0;
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.logo img {
  height: 28px;
  width: auto;
}

.menu-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.nav {
  display: none;
}

.auth--desktop {
  display: none;
}

/* Mobile nav panel */
@media (max-width: 899px) {
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(68vw, 280px);
    background: var(--almost-white);
    padding: 1.5rem;
    z-index: 20;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .nav.is-open {
    display: block;
    transform: translateX(0);
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
  }

  .nav-backdrop[hidden] {
    display: none;
  }

  .nav__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .nav__toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
  }

  .chevron {
    width: 10px;
    height: 6px;
    transition: transform 0.2s ease;
  }

  .nav__toggle[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
  }

  .dropdown {
    list-style: none;
    margin-top: 1rem;
    margin-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .dropdown[hidden] {
    display: none;
  }

  .dropdown a {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--medium-gray);
    font-weight: 700;
  }

  .dropdown img {
    width: 16px;
    height: 16px;
  }

  .nav__item > a {
    font-weight: 700;
    color: var(--medium-gray);
  }

  .auth--mobile {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2.5rem;
  }

  .btn--block {
    text-align: center;
  }
}

/* Desktop */
@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }

  .nav {
    display: block;
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    transform: none;
    overflow: visible;
  }

  .nav__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2.5rem;
  }

  .nav__item {
    position: relative;
  }

  .nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--medium-gray);
  }

  .nav__toggle:hover {
    color: var(--almost-black);
  }

  .nav__item > a {
    font-weight: 700;
    color: var(--medium-gray);
  }

  .nav__item > a:hover {
    color: var(--almost-black);
  }

  .chevron {
    width: 10px;
    height: 6px;
    transition: transform 0.2s ease;
  }

  .nav__toggle[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
  }

  .dropdown {
    position: absolute;
    top: calc(100% + 1.25rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: 150px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 30;
  }

  .dropdown[hidden] {
    display: none;
  }

  .dropdown a {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--medium-gray);
    font-weight: 700;
    white-space: nowrap;
  }

  .dropdown a:hover {
    color: var(--almost-black);
  }

  .dropdown img {
    width: 16px;
    height: 16px;
  }

  .auth--desktop {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin-left: auto;
  }

  .auth--mobile {
    display: none;
  }

  .nav-backdrop {
    display: none;
  }
}

/* Buttons */
.btn {
  font-weight: 700;
  border-radius: 15px;
  padding: 0.75rem 1.25rem;
  display: inline-block;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn--ghost {
  color: var(--medium-gray);
}

.btn--ghost:hover {
  color: var(--almost-black);
}

.btn--outline {
  border: 2px solid var(--medium-gray);
  color: var(--medium-gray);
}

.btn--outline:hover {
  border-color: var(--almost-black);
  color: var(--almost-black);
}

.btn--primary {
  background: var(--almost-black);
  color: var(--almost-white);
  padding: 1rem 1.75rem;
}

.btn--primary:hover {
  background: #3a3a3a;
  color: #fff;
}

/* Hero */
.hero {
  padding: 2rem 0 4rem;
}

.hero__grid {
  display: grid;
  gap: 2.5rem;
}

.hero__content {
  text-align: center;
}

.hero__content h1 {
  font-size: 2.25rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero__content p {
  color: var(--medium-gray);
  margin-bottom: 2rem;
  max-width: 42ch;
  margin-inline: auto;
}

.hero__image {
  order: -1;
}

.hero__image picture,
.hero__image img {
  width: 100%;
  height: auto;
}

.clients {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 4rem;
  flex-wrap: wrap;
}

.clients img {
  height: 18px;
  width: auto;
  opacity: 0.6;
}

@media (min-width: 900px) {
  .hero {
    padding: 4rem 0 6rem;
  }

  .hero__grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
  }

  .hero__content {
    text-align: left;
  }

  .hero__content p {
    margin-inline: 0;
  }

  .hero__image {
    order: 0;
  }

  .hero__content h1 {
    font-size: 4.5rem;
  }
}

/* Attribution */
.attribution {
  font-size: 12px;
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--medium-gray);
}

.attribution a {
  color: hsl(228, 45%, 44%);
}
