@font-face {
  font-family: "Gelasio";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/gelasio-400.woff2") format("woff2");
}

@font-face {
  font-family: "Gelasio";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/gelasio-700.woff2") format("woff2");
}

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

html {
  background: #ababab;
}

body {
  --frame-y: clamp(0.75rem, 4vh, 2.75rem);
  --frame-x: clamp(0.65rem, 3vw, 2.25rem);
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--frame-y) var(--frame-x);
  color: #111;
  font-family: Georgia, "Gelasio", "Liberation Serif", "Times New Roman", Times, serif;
  -webkit-font-smoothing: antialiased;
}

.card {
  width: min(1080px, 100%, calc((100vh - 2 * var(--frame-y)) * 7 / 4));
  width: min(1080px, 100%, calc((100dvh - 2 * var(--frame-y)) * 7 / 4));
  aspect-ratio: 7 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.55rem, 3.2%, 2.4rem) clamp(0.7rem, 4%, 2.6rem);
  background: #fff;
  box-shadow: 4px 8px 20px rgba(0, 0, 0, 0.16);
  container-type: inline-size;
}

.wordmark {
  margin: 0;
  font-size: clamp(2rem, 17cqi, 11.5rem);
  font-weight: 700;
  line-height: 0.84;
  letter-spacing: 0.1em;
  text-align: center;
}

/* Balances the letter-spacing after the last letter so AKTON sits optically centered. */
.wordmark span {
  display: inline-block;
  padding-left: 0.1em;
}

.lines {
  position: relative;
  display: inline-grid;
  max-width: 100%;
  margin-top: clamp(0.5rem, 2.4cqi, 1.45rem);
  color: #5c5c5c;
}

.lines p {
  margin: 0;
  white-space: nowrap;
  font-weight: 400;
  line-height: 1.35;
}

/* On small cards the lines keep a readable minimum, capped so the tagline still fits the card. */
.tagline {
  text-align: center;
  font-size: min(1.2rem, 3.9cqi, max(0.75rem, 2.35cqi));
}

.specialist {
  margin-top: 0.45em;
  text-align: center;
  font-size: min(0.92rem, 3.1cqi, max(0.625rem, 1.75cqi));
}

@media (prefers-reduced-motion: no-preference) {
  .card {
    --line-in: 0.85s;
    --line2-delay: 0.86s;
    animation: rise 1.1s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }

  .wordmark {
    animation: mark-in 1.25s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
  }

  .lines p:nth-child(1) {
    animation: word-in var(--line-in) cubic-bezier(0.16, 1, 0.3, 1) 0.42s backwards;
  }

  .lines p:nth-child(2) {
    animation: word-in var(--line-in) cubic-bezier(0.16, 1, 0.3, 1) var(--line2-delay) backwards;
  }

  /*
   * The streak covers exactly the box of the two lines, so it can never reach AKTON or the page.
   * "lighten" leaves white untouched and only brightens the gray glyphs; .lines must therefore
   * not be an isolated group, or the streak is painted as a gray bar on the white card.
   * It starts together with the other CSS animations, so the delay lands on the end of line 2.
   */
  .lines::after {
    --streak-half: 0.85em;
    --streak-core: 0.136em;
    --travel: 2.4em;
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent calc(50% - var(--streak-half)),
        #c6c6c6 calc(50% - var(--streak-core)),
        #c6c6c6 calc(50% + var(--streak-core)),
        transparent calc(50% + var(--streak-half))
      )
      100% 0 / calc(200% + 2 * var(--travel)) 100% no-repeat;
    mix-blend-mode: lighten;
    pointer-events: none;
    animation: sweep 2s linear calc(var(--line2-delay) + var(--line-in)) 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }

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

@keyframes mark-in {
  from {
    opacity: 0;
    letter-spacing: 0.22em;
  }

  to {
    opacity: 1;
    letter-spacing: 0.1em;
  }
}

@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

/* Moves the streak from fully left of the text (100%) to fully right of it (0%). */
@keyframes sweep {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: 0 0;
  }
}
