@font-face {
  font-family: "Akkurat";
  font-weight: 300;
  font-style: normal;
  src: url("fonts/Akkurat-Light.woff2") format("woff2");
}

@font-face {
  font-family: "Akkurat";
  font-weight: 400;
  font-style: normal;
  src: url("fonts/Akkurat.woff2") format("woff2");
}

@font-face {
  font-family: "Akkurat";
  font-weight: 700;
  font-style: normal;
  src: url("fonts/Akkurat-Bold.woff2") format("woff2");
}

@keyframes plain-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fade-in-with-stagger {
  0% {
    opacity: 0;
  }

  60% {
    opacity: 1;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes move-background-position {
  from {
    background-position-x: 0;
  }
  to {
    background-position-x: 100%;
  }
}

:root {
  --text-color: #3b4048;
  --text-color-light: #4d5159;
  --text-color-very-light: #5a5a5a;

  --page-margin: 16px;

  --page-max-width: 1200px;
  --page-max-width-with-margin: min(
    calc(100% - 2 * var(--page-margin)),
    var(--page-max-width)
  );

  --text-max-width: 700px;
  --text-max-width-with-margin: min(
    calc(100% - 2 * var(--page-margin)),
    var(--text-max-width)
  );

  --extended-max-width: 1600px;
}

:focus-visible {
  outline: 2px solid #008eff;
  outline-offset: 4px;
}

html {
  @media not (prefers-reduced-motion) {
    scroll-behavior: smooth;
  }
}

body {
  line-height: 1.4;
  font-family: "Akkurat", sans;
  text-rendering: optimizelegibility;
  color: var(--text-color);

  margin: 0;
  background-color: #f5f5f5;

  @media not (prefers-reduced-motion) {
    animation-name: plain-fade-in;
    animation-duration: 1.25s;
    animation-timing-function: ease;
  }
}

.qs-contact-link {
  border: 1px solid black;
  border-radius: 50px;
  padding: 8px 18px;

  color: inherit;
  text-decoration: none;
  text-wrap: nowrap;

  @media not (prefers-reduced-motion) {
    transition: box-shadow 0.2s;
  }

  &:hover {
    box-shadow: 0 0 0 1px black inset;
  }

  &:focus-visible {
    outline-offset: 0;
  }
}

.qs-header {
  margin-block-start: 16px;
  margin-inline: auto;
  max-width: var(--page-max-width-with-margin);

  .navigation {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;

    row-gap: 16px;
  }

  .logo-link {
    justify-self: start;
  }

  .logo-image {
    max-height: 4rem; /* 64px */
    width: auto;
    display: block;
  }

  .qs-contact-link {
    align-self: end;
    justify-self: end;

    margin-bottom: 5px; /* for better optical alignment with the logo */
  }

  .grouped-links {
    grid-column: 1 / -1;

    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
  }

  .link {
    color: inherit;
    text-decoration-color: transparent;
    font-weight: 700;

    padding: 4px 6px;

    @media not (prefers-reduced-motion) {
      transition: text-decoration-color 0.2s;
    }

    &:hover {
      text-decoration: underline;
      text-underline-offset: 2px;
      text-decoration-thickness: 2px;
      text-decoration-color: currentColor;
    }

    &:focus-visible {
      outline-offset: 0;
    }
  }

  @media (width <= 600px) {
    .qs-contact-link.after-links {
      display: none;
    }
  }

  @media (width > 600px) {
    margin-block-start: 24px;

    .navigation {
      grid-template-columns: 1fr auto 1fr;
    }

    .logo-link {
      margin-block-end: 14px; /* for better optical alignment with the links */
    }

    .grouped-links {
      grid-column: auto;
      gap: 6px 16px;
      justify-content: center;
    }

    .qs-contact-link {
      margin-block-end: 0;
      align-self: auto;
    }

    .qs-contact-link.before-links {
      display: none;
    }
  }

  @media (width >= 700px) {
    .grouped-links {
      gap: 24px;
    }
  }
}

.qs-intro {
  margin-block-start: 24px;

  .illustration {
    display: grid;
  }

  .color-show {
    grid-row: 1;
    grid-column: 1;

    width: 100%;
    background: linear-gradient(
      90deg,
      #1a2a6c,
      #b21f1f,
      #fdbb2d,
      #23d5ab,
      #1a2a6c
    );
    background-size: 400%;
    background-position-x: 100%;

    @media not (prefers-reduced-motion) {
      animation-name: move-background-position;
      animation-duration: 10s;
      animation-fill-mode: both;
    }
  }

  .title {
    grid-row: 1;
    grid-column: 1;
    align-self: center;

    margin-block: 48px;
    margin-inline: auto;
    max-width: var(--page-max-width-with-margin);

    font-weight: 300;
    font-size: 3rem; /* 48px */
    line-height: 1.1;
    text-align: center;
    color: white;
    text-wrap: balance;

    @media not (prefers-reduced-motion) {
      animation-name: fade-in-up;
      animation-delay: 0.25s;
      animation-duration: 1s;
      animation-fill-mode: both;
      animation-timing-function: ease;
    }
  }

  .text-container {
    margin-block-start: 48px;

    @media not (prefers-reduced-motion) {
      animation-name: fade-in-up;
      animation-delay: 0.5s;
      animation-duration: 1s;
      animation-fill-mode: both;
      animation-timing-function: ease;
    }
  }

  .text {
    margin-inline: auto;
    max-width: var(--text-max-width-with-margin);

    font-size: 1.125rem; /* 18px */
    text-wrap: balance;
    text-align: center;
  }

  .image {
    display: block;
    width: 100%;

    max-height: 400px;
    object-fit: cover;

    margin-block-start: 32px;
  }

  @media (width >= 600px) {
    .image {
      margin-block-start: 48px;
    }
  }

  @media (width >= 900px) {
    .text-container {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .image {
      margin: 0;
      flex-shrink: 1;
      max-width: 600px;
    }

    .text {
      max-width: 500px;

      margin-block: 0;
      margin-inline: 48px 0;
      text-align: start;
    }
  }

  @media (width >= 1000px) {
    .title {
      margin-block: 64px;
    }

    .text-container {
      margin-block-start: 64px;
    }
  }

  @media (width >= 1200px) {
    .text {
      margin-inline-end: 48px;
    }
  }

  @media (width >= 1600px) {
    .title {
      margin-block: 80px;
    }
  }
}

.qs-content {
  margin-block-start: 48px;
  padding-block: 24px;

  font-size: 1.0625rem; /* 17px */
  background-color: white;

  + .content {
    margin-block-start: 32px;
  }

  @media not (prefers-reduced-motion) {
    animation-name: fade-in-up;
    animation-delay: 0.25s;
    animation-duration: 0.75s;
    animation-fill-mode: both;
    animation-timing-function: ease;
  }

  .title {
    scroll-margin-top: 24px;

    margin-block: 0;
    margin-inline: auto;
    max-width: var(--page-max-width-with-margin);

    font-size: 2rem; /* 32px */
    font-weight: 300;
    line-height: 1.2;
    text-align: center;
    text-wrap: balance;
  }

  .sub-title {
    font-size: 1.0625rem; /* 17px */
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-wrap: balance;

    margin-block-start: 32px;
    margin-block-end: 0;
  }

  .qs-illustration + .text {
    margin-block-start: 32px;
  }

  .text {
    margin-block-start: 22px;
    margin-block-end: 0;
    margin-inline: auto;
    max-width: var(--text-max-width-with-margin);

    + .text {
      margin-block-start: 16px;
    }
  }

  .image {
    display: block;
    width: 100%;

    max-width: var(--extended-max-width);
    max-height: 600px;
    object-fit: cover;

    margin-inline: auto;
    margin-block-start: 32px;
  }

  .text-image {
    display: block;
    width: 100%;

    max-width: var(--text-max-width);
    object-fit: cover;

    margin-inline: auto;
    margin-block: 24px;

    &.small {
      max-width: 256px;
    }
  }

  .past-work {
    margin-block-start: 24px;

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 24px;

    .sub-title {
      width: 100%;
      margin-block: 0;
    }

    .logo-image {
      display: block;
      max-width: 64px;
    }
  }

  .qs-contact-link {
    display: block;
    margin-block-start: 22px;
    width: fit-content;
    margin-inline: auto;
  }

  &:has(:last-child.image) {
    padding-block-end: 0;
  }

  @media (width >= 600px) {
    padding-block: 32px;

    .text {
      margin-block-start: 24px;

      + .text {
        margin-block-start: 20px;
      }
    }

    .image {
      margin-block-start: 48px;
    }

    .text-image {
      margin-block: 32px;
    }

    .past-work {
      margin-block-start: 32px;
      row-gap: 32px;
    }
  }

  @media (width >= 1000px) {
    margin-block-start: 64px;
    padding-block: 48px;

    .text-image {
      margin-block: 48px;
    }
  }

  @media (width >= 1632px) {
    padding-block-end: 48px;

    &:has(:last-child.image) {
      padding-block-end: 48px;
    }
  }
}

.qs-illustration {
  --illustration-max-width: 304px;
  --illustration-padding-block: 32px;
  --illustration-padding-inline: 72px;

  height: 200px;
  max-width: calc(
    var(--illustration-max-width) + var(--illustration-padding-inline) * 2
  );

  margin-inline: var(--page-margin);
  margin-block-start: 32px;

  padding-block: var(--illustration-padding-block);

  background: linear-gradient(45deg, #fbfbfb, #ececec);

  display: flex;
  justify-content: center;
  align-items: end;
  gap: 16px;

  @media (width >= 480px) {
    margin-inline: auto;
  }

  .band {
    width: 24px;
  }

  .pink {
    height: 100%;
    background: linear-gradient(to bottom, #c54bff, #600c98);
  }

  .purple {
    height: 80%;
    background: linear-gradient(to bottom, #9300ff, #380c49);
  }

  .blue {
    height: 70%;
    background: linear-gradient(to bottom, #4b78ff, #1d0ca8);
  }

  .turquoise {
    height: 60%;
    background: linear-gradient(to bottom, #0cd1ea, #0c9e9c);
  }

  .green {
    height: 70%;
    background: linear-gradient(to bottom, #0cfd78, #0c970f);
  }

  .yellow {
    height: 80%;
    background: linear-gradient(to bottom, #fffd3f, #e8d60e);
  }

  .orange {
    height: 70%;
    background: linear-gradient(to bottom, #ffa421, #c46d15);
  }

  .red {
    height: 60%;
    background: linear-gradient(to bottom, #ff1212, #a81818);
  }

  &.trispectral {
    height: 140px;

    .blue {
      height: 100%;
    }

    .green {
      height: 100%;
    }

    .red {
      height: 80%;
    }
  }

  .wave {
    height: 100%;
    width: 100%;
    max-width: 304px;

    background: linear-gradient(
      90deg,
      #c54bff,
      #9300ff,
      #4b78ff,
      #0cd1ea,
      #0cfd78,
      #fffd3f,
      #ffa421,
      #ff1212
    );

    clip-path: path(
      "m0 0v200h304v-111.04c-92-48.961-83.035-72.756-132-28.962-37.626 33.823-52 30.946-172-60z"
    );
  }
}

.qs-scan-demo {
  display: grid;
  gap: 32px;
  justify-items: center;
  justify-content: center;

  margin-block-start: 32px;

  padding-block: 32px 48px;
  padding-inline: var(--page-margin);

  background-color: black;

  &:has(.checkbox:checked) {
    .layer {
      opacity: 1;
    }
  }

  &:has(.checkbox:not(:checked, :active)):not(:focus-within) {
    .layer {
      @media not (prefers-reduced-motion) {
        animation-name: fade-in-with-stagger;
        animation-duration: 2s;
        animation-direction: alternate;
        animation-timing-function: linear;
        animation-iteration-count: infinite;
      }
    }
  }

  .scan,
  .layer {
    grid-row: 1;
    grid-column: 1;
    max-width: 100%;
    max-height: 500px;
  }

  .layer {
    opacity: 0;

    @media not (prefers-reduced-motion) {
      transition: opacity 0.5s;
    }
  }

  .toggle {
    -webkit-user-select: none;
    user-select: none;

    grid-row: 2;

    display: flex;
    align-items: center;
    gap: 6px;

    padding-block: 8px;
    padding-inline: 12px;

    border: 1px solid grey;
    background-color: white;
  }

  @media (width >= 750px) {
    grid-template-columns: auto auto;
    margin-block-start: 48px;
    gap: 64px;

    .scan,
    .layer {
      max-height: 700px;
    }

    .toggle {
      grid-row: 1;
      grid-column: 2;
      align-self: center;
    }
  }
}

.qs-updates {
  margin-block-start: 48px;
  margin-inline: auto;
  max-width: 600px;

  .title {
    scroll-margin-top: 24px;

    font-size: 2rem; /* 32px */
    font-weight: 300;
    line-height: 1.2;
    text-align: center;
    text-wrap: balance;

    margin-block: 0;
  }

  .entry {
    padding-block: 26px;
    padding-inline: var(--page-margin);

    background-color: white;
  }

  .separator {
    border: 0;
    height: 1px;
    background-color: #d0d0d0;
    width: calc(100% - 64px);
    margin-block: 23px;
  }

  .title + .entry {
    margin-block-start: 22px;
  }

  .entry-title {
    margin-block: 0;
  }

  .entry-image {
    display: block;
    max-width: 136px;
    margin-block-start: 24px;
    margin-inline: auto;
  }

  .entry-text {
    margin-block-start: 24px;
    margin-block-end: 0;

    text-underline-offset: 3px;
  }

  @media (width >= 600px) {
    .entry {
      padding: 26px;
    }

    .entry-image {
      margin-block-start: 32px;
    }

    .entry-text {
      margin-block-start: 32px;
    }

    .separator {
      margin-block: 27px;
      width: calc(100% - 80px);
    }
  }
}

.qs-footer {
  margin-block-start: 48px;
  padding-block-end: 48px;
  background-color: white;

  .color-show {
    height: 26px;
    width: 100%;

    background: linear-gradient(
      90deg,
      #fdbb2d,
      #1a2a6c,
      #b21f1f,
      #1a2a6c,
      #23d5ab
    );
    background-size: 400%;
    background-position-x: 100%;

    @media not (prefers-reduced-motion) {
      animation-name: move-background-position;
      animation-duration: 10s;
      animation-fill-mode: both;
    }
  }

  .title {
    font-size: 2rem; /* 32px */
    font-weight: 300;
    line-height: 1.2;
    text-align: center;
    text-wrap: balance;

    margin-block: 48px 0;
    margin-inline: var(--page-margin);

    scroll-margin-top: 74px; /* .color-show height + margin-block-start */
  }

  .address {
    font-style: normal;
  }

  .address-team-title,
  .address-office-title {
    display: block;

    font-size: 1.0625rem; /* 17px */
    font-weight: 700;
    text-align: center;
  }

  .address-team-title {
    margin-block-start: 22px;
  }

  .address-office-title {
    margin-block-start: 48px;
  }

  .office-address {
    display: flex;
    justify-content: center;
    gap: 8px;

    margin-block-start: 10px;
    margin-block-end: 0;

    &::after {
      content: "";
      width: 32px;
      aspect-ratio: 16 / 9;
      background-image: url("images/flag.png");
      background-size: contain;
      background-repeat: no-repeat;
    }
  }

  .flag {
    max-width: 32px;
  }

  .office-image {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
    margin-top: 16px;

    max-width: 2400px;
    margin-inline: auto;

    @media (width >= 650px) {
      height: 300px;
      margin-top: 22px;
    }

    @media (width >= 1000px) {
      height: 470px;
      margin-top: 28px;
    }
  }

  .map {
    display: block;
    margin-block-start: 24px;

    img {
      width: 100%;
      display: block;

      border-block: 1px solid #d3d3d3;
    }
  }

  .copyright {
    display: block;
    margin-block-start: 32px;

    font-size: 0.875rem; /* 14px */
    text-align: center;
    line-height: 1.7;
  }

  @media (width >= 600px) {
    margin-block-start: 80px;

    .map {
      margin-block-start: 48px;

      img {
        max-height: 500px;
        object-fit: cover;
        max-width: var(--extended-max-width);
        margin-inline: auto;
        box-sizing: border-box;
      }
    }
  }

  @media (width >= 1000px) {
    .address-team-title {
      margin-block-start: 32px;
    }

    .address-team-title,
    .address-office-title {
      font-size: 1.125rem /* 18px */;
    }
  }

  @media (width >= 1600px) {
    .map {
      img {
        border: 1px solid #d3d3d3;
      }
    }
  }
}

.qs-team-members {
  display: grid;
  justify-content: center;
  gap: 32px;

  margin-block-start: 12px;

  .member-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 22px;
  }

  .member-image {
    max-width: 112px;
    border-radius: 50%;

    align-self: center;
  }

  .text-container {
    display: flex;
    flex-direction: column;
  }

  .member-name {
    margin-block: 0;
    font-weight: 300;
    font-size: 1.1875rem /* 19px */;
  }

  .member-title {
    margin-block: 0;
    font-weight: 700;
    font-size: 0.8125rem /* 13px */;
    text-transform: uppercase;

    margin-block-start: 1px;
  }

  .member-email,
  .member-phone {
    width: max-content;
    padding: 3px;
    margin: -3px;

    text-underline-offset: 3px;
  }

  .member-email {
    margin-block-start: 3px;

    font-size: 0.9375rem; /* 15px */
  }

  .member-phone {
    margin-block-start: 1px;

    font-size: 0.875rem; /* 14px */
  }

  @media (width >= 600px) {
    .member-image {
      max-width: 128px;
    }

    .member-email {
      margin-block-start: 4px;
    }
  }

  @media (width >= 840px) {
    display: flex;
    gap: 48px;

    margin-block-start: 24px;
  }

  @media (width >= 1000px) {
    gap: 64px;

    .member-image {
      max-width: 144px;
    }

    .member-name {
      font-size: 1.375rem; /* 22px */
    }

    .member-email {
      font-size: 1rem; /* 16px */
    }

    .member-phone {
      font-size: 0.9375rem; /* 15px */
    }
  }
}
