/* ============================================================
   Intro animation — name reveal + wipe (~5s total)
   Self-contained: safe to drop into any page.
   Tweak the two variables below to match your brand colors.
   ============================================================ */

:root {
  --intro-bg: #0a0a0a;     /* overlay's starting background color */
  --intro-bg-wipe: #d50d0b; /* color it flashes into right before it wipes away */
  --intro-fg: #ffffff;     /* text color */
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--intro-bg);
  color: var(--intro-fg);
  overflow: hidden;
  will-change: transform, background-color;
  animation-name: introColorShift, introWipe;
  animation-duration: 0.4s, 0.9s;
  animation-timing-function: ease, cubic-bezier(.76, 0, .24, 1);
  animation-fill-mode: forwards, forwards;
  animation-delay: 6.1s, 7.5s;
}

.intro-inner {
  text-align: center;
  animation: introInnerOut 0.4s ease forwards;
  animation-delay: 5.8s;
}

.intro-name {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  letter-spacing: 0.06em;
  line-height: 1;
  margin: 0;
  color: #ffffff !important; /* keep the name pure white regardless of the page's own h1 styles */
}

.intro-letter {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  animation: introLetterIn 0.6s cubic-bezier(.16, 1, .3, 1) forwards;
  animation-delay: calc(0.5s + var(--i) * 0.07s);
}

.intro-gap {
  display: inline-block;
  width: 0.35em;
}

.intro-subtitle {
  position: relative;
  height: 1.6em;
  margin-top: 0.75rem;
}

.intro-phrase {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%); /* fixed centering, independent of the fade animation */
  white-space: nowrap;
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: clamp(0.7rem, 1.6vw, 0.95rem);
  opacity: 0;
}

/* "Industrial Designer" — fades up, holds ~1.8s so it's readable, then fades out */
.intro-phrase-1 {
  animation-name: introPhraseIn, introPhraseOut;
  animation-duration: 0.5s, 0.2s;
  animation-timing-function: ease, ease;
  animation-fill-mode: forwards, forwards;
  animation-delay: 1.6s, 3.9s;
}

/* "Product Designer" — fades in right after phrase 1 fades out, holds ~1.8s */
.intro-phrase-2 {
  animation-name: introPhraseIn;
  animation-duration: 0.6s;
  animation-timing-function: ease;
  animation-fill-mode: forwards;
  animation-delay: 3.9s;
}

.intro-skip {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  background: none;
  border: none;
  color: var(--intro-fg);
  font-family: 'Roboto', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  cursor: pointer;
  padding: 0.5em 0;
  animation: introFadeUp 0.6s ease forwards;
  animation-delay: 1.2s;
}

.intro-skip:hover,
.intro-skip:focus {
  text-decoration: underline;
}

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

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

@keyframes introPhraseIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes introPhraseOut {
  to {
    opacity: 0;
  }
}

@keyframes introInnerOut {
  to {
    opacity: 0;
    transform: translateY(-24px);
  }
}

@keyframes introColorShift {
  to {
    background-color: var(--intro-bg-wipe);
  }
}

@keyframes introWipe {
  to {
    transform: translateY(-100%);
  }
}

/* Skip entirely for repeat visits within the same browser tab session */
.intro-seen .intro-overlay {
  display: none !important;
}

/* Respect reduced-motion preference: show the page immediately */
@media (prefers-reduced-motion: reduce) {
  .intro-overlay {
    display: none !important;
  }
}
