:root {
  --brand-blue: #3050A0;
  --brand-font: 'Eurostile Extended', 'Eurostile', 'Bank Gothic', 'Franklin Gothic Medium', 'Arial Narrow', sans-serif;
  /* Scales the RE/word lockup down on narrow screens, caps out at the
     original 2.4rem desktop size once the viewport is wide enough. */
  --brand-size: clamp(1.5rem, 6.2vw, 2.4rem);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--brand-blue);
  overflow-x: hidden;
}

#stage {
  background: var(--brand-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh; /* avoids iOS Safari URL-bar resize jumping the layout */
  padding: 2rem 1.5rem;
  padding-top: calc(2rem + var(--safe-top));
  padding-bottom: calc(2rem + var(--safe-bottom));
  text-align: center;
  font-family: var(--brand-font);
}

#logo-ph {
  width: min(1200px, 90vw);
  min-height: 300px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#logo-ph img {
  max-width: 100%;
  max-height: 100%;
}

#anim-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: calc(var(--brand-size) * 1.4);
  margin: 0 auto 0.5rem;
  white-space: nowrap;
}

#re-prefix {
  font-family: var(--brand-font);
  font-weight: 700;
  font-size: var(--brand-size);
  letter-spacing: 0.04em;
  color: #f0f0f0;
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  text-shadow: 0 0 18px rgba(240, 240, 240, 0.25);
  display: none;
}

#re-prefix::after {
  content: '';
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: -300px;
  right: 0;
  background: var(--brand-blue);
  z-index: -1;
}

#re-suffix {
  font-family: var(--brand-font);
  font-weight: 400;
  font-size: var(--brand-size);
  letter-spacing: 0.04em;
  color: #f0f0f0;
  line-height: 1;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  transform: translateX(-110%);
  display: none;
}

#intro-layer {
  position: fixed;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  font-size: var(--brand-size);
}

#intro-mask {
  position: fixed;
  background: var(--brand-blue);
  z-index: 99;
  pointer-events: none;
  display: none;
}

.il {
  display: inline-block;
  font-size: var(--brand-size);
  line-height: 1;
  letter-spacing: 0.04em;
  color: #f0f0f0;
  backface-visibility: hidden;
  transform-origin: center bottom;
  opacity: 0;
  transform: rotateX(90deg);
  position: relative;
  z-index: 101;
}

.il-up {
  font-weight: 700;
}

.il-lo {
  font-weight: 400;
}

#tagline {
  font-family: var(--brand-font);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: #888;
  text-transform: uppercase;
  margin-top: 0.5rem;
  opacity: 0;
  transition: opacity 600ms ease;
  max-width: 90vw; /* forces a wrap instead of a horizontal overflow on narrow phones */
  text-align: center;
}

#replay-btn {
  margin-top: 1.5rem;
  background: transparent;
  border: 1px solid #444;
  color: #888;
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.6rem 1.25rem;
  min-height: 44px; /* comfortable touch target */
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#replay-btn:disabled {
  cursor: default;
  opacity: 0.45;
}

@media (max-width: 600px) {
  #stage {
    padding: 1.5rem 1.25rem;
    padding-top: calc(1.5rem + var(--safe-top));
    padding-bottom: calc(1.5rem + var(--safe-bottom));
  }

  #logo-ph {
    min-height: 140px;
    margin-bottom: 1.25rem;
  }
}

/* short / landscape phones */
@media (max-height: 480px) {
  #logo-ph {
    min-height: 90px;
    margin-bottom: 0.75rem;
  }

  #stage {
    padding-top: calc(1rem + var(--safe-top));
    padding-bottom: calc(1rem + var(--safe-bottom));
  }

  #replay-btn {
    margin-top: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tagline {
    transition: none;
  }
}
