.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.hero__img {
  border-radius: 50%;
  width: 6rem;
  height: 6rem;
}

.hero__subtitle {
  color: var(--clr-slate800);
  font-size: var(--size-base);
  line-height: 0.9;
}

.hero__title {
  width: min(90vw, 820px); /* maximum width for the header box */
  margin: 0 auto;
  line-height: 0.9;
  white-space: nowrap; /* keep one line */
  overflow: hidden;
  color: var(--clr-slate400);
  position: relative;          /* for the hidden sizer */
  /* height will be set by JS to prevent vertical jump */
}

#typewriter {
  display: inline-block;
  transition: font-size 120ms ease; /* smooth resizing */
}

/* hidden sizer used only for measuring height in JS */
.hero__sizer {
  position: absolute;
  left: -9999px;  /* keep it out of view/layout */
  top: 0;
  visibility: hidden;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.hero__description {
  max-width: 60ch;
  font-size: var(--size-sm);
  color: var(--clr-slate600);
}

.hero__btn {
  text-transform: capitalize;
  font-size: var(--size-sm);
}

.cursor {
  display: inline-block;
  width: 0.6ch;
  border-right: 2px solid currentColor;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { border-color: transparent; } }

/* extra small viewport */
@media (min-width: 475px) {
  .hero { gap: 1.5rem; }

  .hero__img { width: 6.5rem; height: 6.5rem; }
  .hero__subtitle { font-size: var(--size-lg); }
  .hero__title { font-size: var(--size-5xl); }
  .hero__description { font-size: var(--size-base); }
  .hero__btn { font-size: var(--size-base); }
}

/* large viewport */
@media (min-width: 1024px) {
  .hero__img { width: 8rem; height: 8rem; }
  .hero__subtitle { font-size: var(--size-2xl); }
  .hero__title { font-size: var(--size-7xl); }
  .hero__description { font-size: var(--size-lg); }
  .hero__btn { font-size: var(--size-lg); }
}

/* extra large viewport */
@media (min-width: 1280px) {
  .hero { gap: 2rem; }

  .hero__img { width: 10rem; height: 10rem; }
  .hero__subtitle { font-size: var(--size-4xl); }
  .hero__title { font-size: var(--size-9xl); }
  .hero__description { font-size: var(--size-xl); }
  .hero__btn { font-size: var(--size-xl); }
}
