/* The centre of the page: particle "Hi", name and hint. */

.hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 8px 16px 24px;
}

/* Canvas for the particle "Hi" covers the whole hero */
#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

/* Reserves the space the "Hi" is drawn into */
.slot {
  width: min(92vw, 880px);
  height: clamp(180px, 40vh, 420px);
  margin-bottom: clamp(18px, 3.5vh, 36px);
}

.intro {
  position: relative;
  z-index: 1;
  text-align: center;
  pointer-events: none;
}

/* "I'm Malavika" */
.name {
  display: inline-flex;
  align-items: baseline;
  gap: .28em;
  font-size: clamp(1.7rem, 5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
  opacity: 0;
  animation: rise .8s ease-out 1.1s forwards;
}

.name .im {
  color: var(--muted);
  font-weight: 400;
}

/*
 * Rolling letters: js/roll-text.js wraps each letter in
 * <span class="l"><span>a</span><span>a</span></span>.
 * On hover both copies slide up, one after another,
 * revealing the yellow copy underneath.
 */
.roll {
  display: inline-flex;
  pointer-events: auto;
  cursor: default;
}

.roll .l {
  position: relative;
  display: inline-block;
  height: 1.1em;
  overflow: hidden;
  line-height: 1.1;
}

.roll .l span {
  display: block;
  transition: transform .7s cubic-bezier(.65, 0, .35, 1);
  transition-delay: calc(var(--i) * 30ms);
}

.roll .l span + span {
  position: absolute;
  top: 100%;
  left: 0;
  color: var(--yellow);
}

.roll:hover .l span {
  transform: translateY(-100%);
}

/* Hint line: different wording for mouse and touch */
.hint {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  opacity: 0;
  animation: rise .8s ease-out 1.5s forwards;
}

.hint b {
  color: var(--yellow);
  font-weight: 500;
}

.hint-touch {
  display: none;
}

@media (hover: none) {
  .hint-mouse { display: none; }
  .hint-touch { display: inline; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* With animations off, show the text straight away */
@media (prefers-reduced-motion: reduce) {
  .name,
  .hint {
    opacity: 1;
  }
}
